diff --git a/asset-manifest.json b/asset-manifest.json index d6cdd8f..1c57ab5 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "/face-sample-dapp/static/css/main.ce0a1179.css", - "main.js": "/face-sample-dapp/static/js/main.a89338b7.js", + "main.js": "/face-sample-dapp/static/js/main.b8271fc6.js", "static/js/491.fad8be0c.chunk.js": "/face-sample-dapp/static/js/491.fad8be0c.chunk.js", "static/media/logo.svg": "/face-sample-dapp/static/media/logo.7a23ae45110dc7397f2d9370a6d70925.svg", "static/media/external-link-line.svg": "/face-sample-dapp/static/media/external-link-line.a51b58b662c99d07928ebabab5fdc2ce.svg", @@ -9,11 +9,11 @@ "static/media/menu-close.svg": "/face-sample-dapp/static/media/menu-close.7b8c1d89596f2603f074982ef4e3e56c.svg", "static/media/menu-fill.svg": "/face-sample-dapp/static/media/menu-fill.ab45b5c921edbefe3993d306680ba5f0.svg", "main.ce0a1179.css.map": "/face-sample-dapp/static/css/main.ce0a1179.css.map", - "main.a89338b7.js.map": "/face-sample-dapp/static/js/main.a89338b7.js.map", + "main.b8271fc6.js.map": "/face-sample-dapp/static/js/main.b8271fc6.js.map", "491.fad8be0c.chunk.js.map": "/face-sample-dapp/static/js/491.fad8be0c.chunk.js.map" }, "entrypoints": [ "static/css/main.ce0a1179.css", - "static/js/main.a89338b7.js" + "static/js/main.b8271fc6.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index e49e7a4..5bbb547 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Face Sample DApp
\ No newline at end of file +Face Sample DApp
\ No newline at end of file diff --git a/static/js/main.a89338b7.js b/static/js/main.b8271fc6.js similarity index 90% rename from static/js/main.a89338b7.js rename to static/js/main.b8271fc6.js index 0e60399..ea20ece 100644 --- a/static/js/main.a89338b7.js +++ b/static/js/main.b8271fc6.js @@ -1,3 +1,3 @@ -/*! For license information please see main.a89338b7.js.LICENSE.txt */ -(function(){var __webpack_modules__={2056:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});var n="abi/5.6.4"},5054:function(e,t,r){"use strict";r.d(t,{R:function(){return L},$:function(){return U}});var n=r(5671),i=r(3144),o=r(9716),a=r(520),s=r(9502),u=r(2056),c=r(3198),l=r(136),f=r(9388),h=r(7419),d=function(e){(0,l.Z)(r,e);var t=(0,f.Z)(r);function r(e){return(0,n.Z)(this,r),t.call(this,"address","address",e,!1)}return(0,i.Z)(r,[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(e,t){try{t=(0,h.getAddress)(t)}catch(r){this._throwError(r.message,t)}return e.writeValue(t)}},{key:"decode",value:function(e){return(0,h.getAddress)((0,o.hexZeroPad)(e.readValue().toHexString(),20))}}]),r}(c.XI),p=function(e){(0,l.Z)(r,e);var t=(0,f.Z)(r);function r(e){var i;return(0,n.Z)(this,r),(i=t.call(this,e.name,e.type,void 0,e.dynamic)).coder=e,i}return(0,i.Z)(r,[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(e,t){return this.coder.encode(e,t)}},{key:"decode",value:function(e){return this.coder.decode(e)}}]),r}(c.XI),v=new s.Logger(u.i);function y(e,t,r){var n=null;if(Array.isArray(r))n=r;else if(r&&"object"===typeof r){var i={};n=t.map((function(e){var t=e.localName;return t||v.throwError("cannot encode object for signature with missing names",s.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]&&v.throwError("cannot encode object for signature with duplicate names",s.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]=!0,r[t]}))}else v.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&v.throwArgumentError("types/value length mismatch","tuple",r);var o=new c.QV(e.wordSize),a=new c.QV(e.wordSize),u=[];t.forEach((function(e,t){var r=n[t];if(e.dynamic){var i=a.length;e.encode(a,r);var s=o.writeUpdatableValue();u.push((function(e){s(e+i)}))}else e.encode(o,r)})),u.forEach((function(e){e(o.length)}));var l=e.appendWriter(o);return l+=e.appendWriter(a)}function g(e,t){var r=[],n=e.subReader(0);t.forEach((function(t){var i=null;if(t.dynamic){var o=e.readValue(),a=n.subReader(o.toNumber());try{i=t.decode(a)}catch(u){if(u.code===s.Logger.errors.BUFFER_OVERRUN)throw u;(i=u).baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(u){if(u.code===s.Logger.errors.BUFFER_OVERRUN)throw u;(i=u).baseType=t.name,i.name=t.localName,i.type=t.type}void 0!=i&&r.push(i)}));var i=t.reduce((function(e,t){var r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach((function(e,t){var n=e.localName;if(n&&1===i[n]&&("length"===n&&(n="_length"),null==r[n])){var o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:function(){throw o}}):r[n]=o}}));for(var o=function(e){var t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:function(){throw t}})},a=0;a=0?i:"")+"]",u=-1===i||e.dynamic;return(a=t.call(this,"array",s,o,u)).coder=e,a.length=i,a}return(0,i.Z)(r,[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],r=0;re._data.length&&v.throwError("insufficient data length",s.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var r=[],n=0;n256||n%8!==0)&&C.throwArgumentError("invalid "+r[1]+" bit length","param",e),new R(n/8,"int"===r[1],e.name)}if(r=e.type.match(M)){var i=parseInt(r[1]);return(0===i||i>32)&&C.throwArgumentError("invalid bytes length","param",e),new S(i,e.name)}return C.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new c.Ej(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new c.QV(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,r=e.map((function(e){return t._getCoder(P._R.from(e))}));return new N(r,"_").defaultValue()}},{key:"encode",value:function(e,t){var r=this;e.length!==t.length&&C.throwError("types/values length mismatch",s.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var n=e.map((function(e){return r._getCoder(P._R.from(e))})),i=new N(n,"_"),o=this._getWriter();return i.encode(o,t),o.data}},{key:"decode",value:function(e,t,r){var n=this,i=e.map((function(e){return n._getCoder(P._R.from(e))}));return new N(i,"_").decode(this._getReader((0,o.arrayify)(t),r))}}]),e}(),U=new L},3198:function(e,t,r){"use strict";r.d(t,{BR:function(){return f},Ej:function(){return p},QV:function(){return d},XI:function(){return h}});var n=r(5671),i=r(3144),o=r(9716),a=r(2257),s=r(520),u=r(9502),c=r(2056),l=new u.Logger(c.i);function f(e){var t=[];return function e(r,n){if(Array.isArray(n))for(var i in n){var o=r.slice();o.push(i);try{e(o,n[i])}catch(a){t.push({path:o,error:a})}}}([],e),t}var h=function(){function e(t,r,i,o){(0,n.Z)(this,e),this.name=t,this.type=r,this.localName=i,this.dynamic=o}return(0,i.Z)(e,[{key:"_throwError",value:function(e,t){l.throwArgumentError(e,this.localName,t)}}]),e}(),d=function(){function e(t){(0,n.Z)(this,e),(0,s.defineReadOnly)(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}return(0,i.Z)(e,[{key:"data",get:function(){return(0,o.hexConcat)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(e){return this._data.push(e),this._dataLength+=e.length,e.length}},{key:"appendWriter",value:function(e){return this._writeData((0,o.concat)(e._data))}},{key:"writeBytes",value:function(e){var t=(0,o.arrayify)(e),r=t.length%this.wordSize;return r&&(t=(0,o.concat)([t,this._padding.slice(r)])),this._writeData(t)}},{key:"_getValue",value:function(e){var t=(0,o.arrayify)(a.O$.from(e));return t.length>this.wordSize&&l.throwError("value out-of-bounds",u.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,o.concat)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){e._data[t]=e._getValue(r)}}}]),e}(),p=function(){function e(t,r,i,a){(0,n.Z)(this,e),(0,s.defineReadOnly)(this,"_data",(0,o.arrayify)(t)),(0,s.defineReadOnly)(this,"wordSize",r||32),(0,s.defineReadOnly)(this,"_coerceFunc",i),(0,s.defineReadOnly)(this,"allowLoose",a),this._offset=0}return(0,i.Z)(e,[{key:"data",get:function(){return(0,o.hexlify)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,r){return this._coerceFunc?this._coerceFunc(t,r):e.coerce(t,r)}},{key:"_peekBytes",value:function(e,t,r){var n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:l.throwError("data out-of-bounds",u.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}},{key:"readValue",value:function(){return a.O$.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}}]),e}()},3165:function(e,t,r){"use strict";r.d(t,{HY:function(){return k},IC:function(){return O},QV:function(){return _},Xg:function(){return A},YW:function(){return T},_R:function(){return b},pc:function(){return g}});var n=r(136),i=r(9388),o=r(5671),a=r(3144),s=r(2257),u=r(520),c=r(9502),l=r(2056),f=new c.Logger(l.i),h={},d={calldata:!0,memory:!0,storage:!0},p={calldata:!0,memory:!0};function v(e,t){if("bytes"===e||"string"===e){if(d[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&p[t])return!0;return(d[t]||"payable"===t)&&f.throwArgumentError("invalid modifier","name",t),!1}function y(e,t){for(var r in t)(0,u.defineReadOnly)(e,r,t[r])}var g=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),m=new RegExp(/^(.*)\[([0-9]*)\]$/),b=function(){function e(t,r){(0,o.Z)(this,e),t!==h&&f.throwError("use fromString",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),y(this,r);var n=this.type.match(m);y(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return(0,a.Z)(e,[{key:"format",value:function(e){if(e||(e=g.sighash),g[e]||f.throwArgumentError("invalid format type","format",e),e===g.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"===typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var r="";return"array"===this.baseType?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==g.sighash&&(r+=this.type),r+="("+this.components.map((function(t){return t.format(e)})).join(e===g.full?", ":",")+")"):r+=this.type,e!==g.sighash&&(!0===this.indexed&&(r+=" indexed"),e===g.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(t,r){return"string"===typeof t?e.fromString(t,r):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(h,{name:t.name||null,type:I(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,r){return n=function(e,t){var r=e;function n(t){f.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function i(e){var r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");for(var o={type:"",name:"",state:{allowType:!0}},a=o,s=0;s2&&f.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||f.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=s.O$.from(r[1]),r[0]):e}function S(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function x(e){var t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&f.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&f.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||f.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&f.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&f.throwArgumentError("unable to determine stateMutability","value",e),t}var A=function(e){(0,n.Z)(r,e);var t=(0,i.Z)(r);function r(){return(0,o.Z)(this,r),t.apply(this,arguments)}return(0,a.Z)(r,[{key:"format",value:function(e){if(e||(e=g.sighash),g[e]||f.throwArgumentError("invalid format type","format",e),e===g.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});e===g.sighash&&f.throwError("cannot format a constructor for sighash",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===g.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"===typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isConstructorFragment(e))return e;"constructor"!==e.type&&f.throwArgumentError("invalid constructor object","value",e);var t=x(e);t.constant&&f.throwArgumentError("constructor cannot be constant","value",e);var n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(b.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?s.O$.from(e.gas):null};return new r(h,n)}},{key:"fromString",value:function(e){var t={type:"constructor"},n=(e=E(e,t)).match(C);return n&&"constructor"===n[1].trim()||f.throwArgumentError("invalid constructor string","value",e),t.inputs=w(n[2].trim(),!1),S(n[3].trim(),t),r.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),r}(k),T=function(e){(0,n.Z)(r,e);var t=(0,i.Z)(r);function r(){return(0,o.Z)(this,r),t.apply(this,arguments)}return(0,a.Z)(r,[{key:"format",value:function(e){if(e||(e=g.sighash),g[e]||f.throwArgumentError("invalid format type","format",e),e===g.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==g.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===g.full?", ":",")+") ",e!==g.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"===typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isFunctionFragment(e))return e;"function"!==e.type&&f.throwArgumentError("invalid function object","value",e);var t=x(e),n={type:e.type,name:P(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(b.fromObject):[],outputs:e.outputs?e.outputs.map(b.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?s.O$.from(e.gas):null};return new r(h,n)}},{key:"fromString",value:function(e){var t={type:"function"},n=(e=E(e,t)).split(" returns ");n.length>2&&f.throwArgumentError("invalid function string","value",e);var i=n[0].match(C);if(i||f.throwArgumentError("invalid function signature","value",e),t.name=i[1].trim(),t.name&&P(t.name),t.inputs=w(i[2],!1),S(i[3].trim(),t),n.length>1){var o=n[1].match(C);""==o[1].trim()&&""==o[3].trim()||f.throwArgumentError("unexpected tokens","value",e),t.outputs=w(o[2],!1)}else t.outputs=[];return r.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),r}(A);function R(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||f.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var O=function(e){(0,n.Z)(r,e);var t=(0,i.Z)(r);function r(){return(0,o.Z)(this,r),t.apply(this,arguments)}return(0,a.Z)(r,[{key:"format",value:function(e){if(e||(e=g.sighash),g[e]||f.throwArgumentError("invalid format type","format",e),e===g.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==g.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===g.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"===typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isErrorFragment(e))return e;"error"!==e.type&&f.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:P(e.name),inputs:e.inputs?e.inputs.map(b.fromObject):[]};return R(new r(h,t))}},{key:"fromString",value:function(e){var t={type:"error"},n=e.match(C);return n||f.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&P(t.name),t.inputs=w(n[2],!1),R(r.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),r}(k);function I(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var N=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function P(e){return e&&e.match(N)||f.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var C=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},8334:function(e,t,r){"use strict";r.r(t),r.d(t,{AbiCoder:function(){return i.R},ConstructorFragment:function(){return n.Xg},ErrorFragment:function(){return n.IC},EventFragment:function(){return n.QV},FormatTypes:function(){return n.pc},Fragment:function(){return n.HY},FunctionFragment:function(){return n.YW},Indexed:function(){return o.Hk},Interface:function(){return o.vU},LogDescription:function(){return o.CC},ParamType:function(){return n._R},TransactionDescription:function(){return o.vk},checkResultErrors:function(){return a.BR},defaultAbiCoder:function(){return i.$}});var n=r(3165),i=r(5054),o=r(7303),a=r(3198)},7303:function(e,t,r){"use strict";r.d(t,{CC:function(){return m},Hk:function(){return k},vU:function(){return S},vk:function(){return b}});var n=r(3144),i=r(5671),o=r(136),a=r(9388),s=r(7419),u=r(2257),c=r(9716),l=r(1583),f=r(8062),h=r(520),d=r(5054),p=r(3165),v=r(9502),y=r(2056),g=new v.Logger(y.i),m=function(e){(0,o.Z)(r,e);var t=(0,a.Z)(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r)}(h.Description),b=function(e){(0,o.Z)(r,e);var t=(0,a.Z)(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r)}(h.Description),w=function(e){(0,o.Z)(r,e);var t=(0,a.Z)(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r)}(h.Description),k=function(e){(0,o.Z)(r,e);var t=(0,a.Z)(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r,null,[{key:"isIndexed",value:function(e){return!(!e||!e._isIndexed)}}]),r}(h.Description),_={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function E(e,t){var r=new Error("deferred error during ABI decoding triggered accessing ".concat(e));return r.error=t,r}var S=function(){function e(t){var r=this;(0,i.Z)(this,e);var n=[];n="string"===typeof t?JSON.parse(t):t,(0,h.defineReadOnly)(this,"fragments",n.map((function(e){return p.HY.from(e)})).filter((function(e){return null!=e}))),(0,h.defineReadOnly)(this,"_abiCoder",(0,h.getStatic)(this instanceof e?this.constructor:void 0,"getAbiCoder")()),(0,h.defineReadOnly)(this,"functions",{}),(0,h.defineReadOnly)(this,"errors",{}),(0,h.defineReadOnly)(this,"events",{}),(0,h.defineReadOnly)(this,"structs",{}),this.fragments.forEach((function(e){var t=null;switch(e.type){case"constructor":return r.deploy?void g.warn("duplicate definition - constructor"):void(0,h.defineReadOnly)(r,"deploy",e);case"function":t=r.functions;break;case"event":t=r.events;break;case"error":t=r.errors;break;default:return}var n=e.format();t[n]?g.warn("duplicate definition - "+n):t[n]=e})),this.deploy||(0,h.defineReadOnly)(this,"deploy",p.Xg.from({payable:!1,type:"constructor"})),(0,h.defineReadOnly)(this,"_isInterface",!0)}return(0,n.Z)(e,[{key:"format",value:function(e){e||(e=p.pc.full),e===p.pc.sighash&&g.throwArgumentError("interface does not support formatting sighash","format",e);var t=this.fragments.map((function(t){return t.format(e)}));return e===p.pc.json?JSON.stringify(t.map((function(e){return JSON.parse(e)}))):t}},{key:"getFunction",value:function(e){if((0,c.isHexString)(e)){for(var t in this.functions)if(e===this.getSighash(t))return this.functions[t];g.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){var r=e.trim(),n=Object.keys(this.functions).filter((function(e){return e.split("(")[0]===r}));return 0===n.length?g.throwArgumentError("no matching function","name",r):n.length>1&&g.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var i=this.functions[p.YW.fromString(e).format()];return i||g.throwArgumentError("no matching function","signature",e),i}},{key:"getEvent",value:function(e){if((0,c.isHexString)(e)){var t=e.toLowerCase();for(var r in this.events)if(t===this.getEventTopic(r))return this.events[r];g.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.events).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?g.throwArgumentError("no matching event","name",n):i.length>1&&g.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}var o=this.events[p.QV.fromString(e).format()];return o||g.throwArgumentError("no matching event","signature",e),o}},{key:"getError",value:function(e){if((0,c.isHexString)(e)){var t=(0,h.getStatic)(this.constructor,"getSighash");for(var r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}g.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?g.throwArgumentError("no matching error","name",n):i.length>1&&g.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}var o=this.errors[p.YW.fromString(e).format()];return o||g.throwArgumentError("no matching error","signature",e),o}},{key:"getSighash",value:function(e){if("string"===typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(r){throw t}}return(0,h.getStatic)(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"===typeof e&&(e=this.getEvent(e)),(0,h.getStatic)(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"===typeof e&&(e=this.getError(e));var r=(0,c.arrayify)(t);return(0,c.hexlify)(r.slice(0,4))!==this.getSighash(e)&&g.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",(0,c.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"===typeof e&&(e=this.getError(e)),(0,c.hexlify)((0,c.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var r=(0,c.arrayify)(t);return(0,c.hexlify)(r.slice(0,4))!==this.getSighash(e)&&g.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",(0,c.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,c.hexlify)((0,c.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var r=(0,c.arrayify)(t),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(f){}break;case 4:var u=(0,c.hexlify)(r.slice(0,4)),l=_[u];if(l)o=this._abiCoder.decode(l.inputs,r.slice(4)),a=l.name,s=l.signature,l.reason&&(n=o[0]),"Error"===a?i="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(o[0])):"Panic"===a&&(i="; VM Exception while processing transaction: reverted with panic code ".concat(o[0]));else try{var f=this.getError(u);o=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,s=f.format()}catch(f){}}return g.throwError("call revert exception"+i,v.Logger.errors.CALL_EXCEPTION,{method:e.format(),data:(0,c.hexlify)(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}},{key:"encodeFunctionResult",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,c.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var r=this;"string"===typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&g.throwError("too many arguments for "+e.format(),v.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});var n=[];e.anonymous||n.push(this.getEventTopic(e));var i=function(e,t){return"string"===e.type?(0,l.id)(t):"bytes"===e.type?(0,f.keccak256)((0,c.hexlify)(t)):("bool"===e.type&&"boolean"===typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=u.O$.from(t).toHexString()),"address"===e.type&&r._abiCoder.encode(["address"],[t]),(0,c.hexZeroPad)((0,c.hexlify)(t),32))};for(t.forEach((function(t,r){var o=e.inputs[r];o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?g.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((function(e){return i(o,e)}))):n.push(i(o,t)):null!=t&&g.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}},{key:"encodeEventLog",value:function(e,t){var r=this;"string"===typeof e&&(e=this.getEvent(e));var n=[],i=[],o=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&g.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,a){var s=t[a];if(e.indexed)if("string"===e.type)n.push((0,l.id)(s));else if("bytes"===e.type)n.push((0,f.keccak256)(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([e.type],[s]))}else i.push(e),o.push(s)})),{data:this._abiCoder.encode(i,o),topics:n}}},{key:"decodeEventLog",value:function(e,t,r){if("string"===typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){var n=this.getEventTopic(e);(0,c.isHexString)(r[0],32)&&r[0].toLowerCase()===n||g.throwError("fragment/topic mismatch",v.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var i=[],o=[],a=[];e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(i.push(p._R.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(i.push(e),a.push(!1)):(o.push(e),a.push(!1))}));var s=null!=r?this._abiCoder.decode(i,(0,c.concat)(r)):null,u=this._abiCoder.decode(o,t,!0),l=[],f=0,h=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==s)l[t]=new k({_isIndexed:!0,hash:null});else if(a[t])l[t]=new k({_isIndexed:!0,hash:s[h++]});else try{l[t]=s[h++]}catch(n){l[t]=n}else try{l[t]=u[f++]}catch(n){l[t]=n}if(e.name&&null==l[e.name]){var r=l[t];r instanceof Error?Object.defineProperty(l,e.name,{enumerable:!0,get:function(){throw E("property ".concat(JSON.stringify(e.name)),r)}}):l[e.name]=r}}));for(var d=function(e){var t=l[e];t instanceof Error&&Object.defineProperty(l,e,{enumerable:!0,get:function(){throw E("index ".concat(e),t)}})},y=0;y=0)throw e;return h.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",l.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:r})}))),null==r.chainId?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then((function(t){return 0!==t[1]&&t[0]!==t[1]&&h.throwArgumentError("chainId address mismatch","transaction",e),t[0]})),t.next=23,(0,c.resolveProperties)(r);case 23:return t.abrupt("return",t.sent);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"_checkProvider",value:function(e){this.provider||h.throwError("missing provider",l.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),y=function(e){(0,i.Z)(r,e);var t=(0,o.Z)(r);function r(e,i){var o;return(0,s.Z)(this,r),o=t.call(this),(0,c.defineReadOnly)((0,n.Z)(o),"address",e),(0,c.defineReadOnly)((0,n.Z)(o),"provider",i||null),o}return(0,u.Z)(r,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(e,t){return Promise.resolve().then((function(){h.throwError(e,l.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})}))}},{key:"signMessage",value:function(e){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(e){return new r(this.address,e)}}]),r}(v)},7419:function(e,t,r){"use strict";r.r(t),r.d(t,{getAddress:function(){return v},getContractAddress:function(){return m},getCreate2Address:function(){return b},getIcapAddress:function(){return g},isAddress:function(){return y}});var n=r(9716),i=r(2257),o=r(8062),a=r(7986),s=new(r(9502).Logger)("address/5.6.1");function u(e){(0,n.isHexString)(e,20)||s.throwArgumentError("invalid address","address",e);for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=t[i].charCodeAt(0);for(var a=(0,n.arrayify)((0,o.keccak256)(r)),u=0;u<40;u+=2)a[u>>1]>>4>=8&&(t[u]=t[u].toUpperCase()),(15&a[u>>1])>=8&&(t[u+1]=t[u+1].toUpperCase());return"0x"+t.join("")}for(var c={},l=0;l<10;l++)c[String(l)]=String(l);for(var f=0;f<26;f++)c[String.fromCharCode(65+f)]=String(10+f);var h,d=Math.floor((h=9007199254740991,Math.log10?Math.log10(h):Math.log(h)/Math.LN10));function p(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return c[e]})).join("");t.length>=d;){var r=t.substring(0,d);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function v(e){var t=null;if("string"!==typeof e&&s.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=u(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&s.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&s.throwArgumentError("bad icap checksum","address",e),t=(0,i.g$)(e.substring(4));t.length<40;)t="0"+t;t=u("0x"+t)}else s.throwArgumentError("invalid address","address",e);return t}function y(e){try{return v(e),!0}catch(t){}return!1}function g(e){for(var t=(0,i.t2)(v(e).substring(2)).toUpperCase();t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t}function m(e){var t=null;try{t=v(e.from)}catch(u){s.throwArgumentError("missing from address","transaction",e)}var r=(0,n.stripZeros)((0,n.arrayify)(i.O$.from(e.nonce).toHexString()));return v((0,n.hexDataSlice)((0,o.keccak256)((0,a.encode)([t,r])),12))}function b(e,t,r){return 32!==(0,n.hexDataLength)(t)&&s.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,n.hexDataLength)(r)&&s.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),v((0,n.hexDataSlice)((0,o.keccak256)((0,n.concat)(["0xff",v(e),t,r])),12))}},5101:function(e,t,r){"use strict";r.d(t,{J:function(){return i},c:function(){return o}});var n=r(9716);function i(e){e=atob(e);for(var t=[],r=0;r0;)r.push(i%this.base),i=i/this.base|0}for(var s="",u=0;0===t[u]&&u=0;--c)s+=this.alphabet[r[c]];return s}},{key:"decode",value:function(e){if("string"!==typeof e)throw new TypeError("Expected String");var t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(var r=0;r>=8;for(;i>0;)t.push(255&i),i>>=8}for(var s=0;e[s]===this._leader&&s0&&(10===arguments[0]?v||(v=!0,f.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?f.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",u.Logger.errors.UNEXPECTED_ARGUMENT,{}):f.throwError("BigNumber.toString does not accept parameters",u.Logger.errors.UNEXPECTED_ARGUMENT,{})),b(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}],[{key:"from",value:function(t){if(t instanceof e)return t;if("string"===typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(h,g(t)):t.match(/^-?[0-9]+$/)?new e(h,g(new l(t))):f.throwArgumentError("invalid BigNumber string","value",t);if("number"===typeof t)return t%1&&w("underflow","BigNumber.from",t),(t>=d||t<=-d)&&w("overflow","BigNumber.from",t),e.from(String(t));var r=t;if("bigint"===typeof r)return e.from(r.toString());if((0,s.isBytes)(r))return e.from((0,s.hexlify)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"===typeof n)return e.from(n)}else{var i=r._hex;if(null==i&&"BigNumber"===r.type&&(i=r.hex),"string"===typeof i&&((0,s.isHexString)(i)||"-"===i[0]&&(0,s.isHexString)(i.substring(1))))return e.from(i)}return f.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}]),e}();function g(e){if("string"!==typeof e)return g(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&f.throwArgumentError("invalid hex","value",e),"0x00"===(e=g(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 y.from(g(e))}function b(e){var t=y.from(e).toHexString();return"-"===t[0]?new l("-"+t.substring(3),16):new l(t.substring(2),16)}function w(e,t,r){var n={fault:e,operation:t};return null!=r&&(n.value=r),f.throwError(e,u.Logger.errors.NUMERIC_FAULT,n)}function k(e){return new l(e,36).toString(16)}function _(e){return new l(e,16).toString(36)}},9716:function(e,t,r){"use strict";r.r(t),r.d(t,{arrayify:function(){return c},concat:function(){return l},hexConcat:function(){return m},hexDataLength:function(){return y},hexDataSlice:function(){return g},hexStripZeros:function(){return w},hexValue:function(){return b},hexZeroPad:function(){return k},hexlify:function(){return v},isBytes:function(){return u},isBytesLike:function(){return a},isHexString:function(){return d},joinSignature:function(){return E},splitSignature:function(){return _},stripZeros:function(){return f},zeroPad:function(){return h}});var n=new(r(9502).Logger)("bytes/5.6.1");function i(e){return!!e.toHexString}function o(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return d(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(var t=0;t=256)return!1}return!0}function c(e,t){if(t||(t={}),"number"===typeof e){n.checkSafeUint53(e,"invalid arrayify value");for(var r=[];e;)r.unshift(255&e),e=parseInt(String(e/256));return 0===r.length&&r.push(0),o(new Uint8Array(r))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),d(e)){var a=e.substring(2);a.length%2&&("left"===t.hexPad?a="0"+a:"right"===t.hexPad?a+="0":n.throwArgumentError("hex data is odd-length","value",e));for(var s=[],c=0;ct&&n.throwArgumentError("value out of range","value",arguments[0]);var r=new Uint8Array(t);return r.set(e,t-e.length),o(r)}function d(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}var p="0123456789abcdef";function v(e,t){if(t||(t={}),"number"===typeof e){n.checkSafeUint53(e,"invalid hexlify value");for(var r="";e;)r=p[15&e]+r,e=Math.floor(e/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"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),i(e))return e.toHexString();if(d(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)){for(var o="0x",a=0;a>4]+p[15&s]}return o}return n.throwArgumentError("invalid hexlify value","value",e)}function y(e){if("string"!==typeof e)e=v(e);else if(!d(e)||e.length%2)return null;return(e.length-2)/2}function g(e,t,r){return"string"!==typeof e?e=v(e):(!d(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 m(e){var t="0x";return e.forEach((function(e){t+=v(e).substring(2)})),t}function b(e){var t=w(v(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function w(e){"string"!==typeof e&&(e=v(e)),d(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);for(var t=0;t2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function _(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(e)){var r=c(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=v(r.slice(0,32)),t.s=v(r.slice(32,64))):65===r.length?(t.r=v(r.slice(0,32)),t.s=v(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=v(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){var i=h(c(t._vs),32);t._vs=v(i);var o=i[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=o:t.recoveryParam!==o&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),i[0]&=127;var s=v(i);null==t.s?t.s=s:t.s!==s&&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{var u=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==u&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&d(t.r)?t.r=k(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&d(t.s)?t.s=k(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);var l=c(t.s);l[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(l[0]|=128);var f=v(l);t._vs&&(d(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=k(t._vs,32)),null==t._vs?t._vs=f:t._vs!==f&&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(e){return v(l([(e=_(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},5422:function(e,t,r){"use strict";r.d(t,{Bz:function(){return s},_Y:function(){return o},fh:function(){return a},tL:function(){return i}});var n=r(2257),i=n.O$.from(-1),o=n.O$.from(0),a=n.O$.from(1),s=n.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},4867:function(e,t,r){"use strict";r.d(t,{R:function(){return n}});var n="0x0000000000000000000000000000000000000000000000000000000000000000"},9366:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});var n="hash/5.6.1"},1583:function(e,t,r){"use strict";r.d(t,{id:function(){return o}});var n=r(8062),i=r(3374);function o(e){return(0,n.keccak256)((0,i.Y0)(e))}},1049:function(e,t,r){"use strict";r.r(t),r.d(t,{_TypedDataEncoder:function(){return a.E},dnsEncode:function(){return i.Kn},hashMessage:function(){return o.r},id:function(){return n.id},isValidName:function(){return i.r1},messagePrefix:function(){return o.B},namehash:function(){return i.VM}});var n=r(1583),i=r(8793),o=r(2273),a=r(5992)},2273:function(e,t,r){"use strict";r.d(t,{B:function(){return a},r:function(){return s}});var n=r(9716),i=r(8062),o=r(3374),a="\x19Ethereum Signed Message:\n";function s(e){return"string"===typeof e&&(e=(0,o.Y0)(e)),(0,i.keccak256)((0,n.concat)([(0,o.Y0)(a),(0,o.Y0)(String(e.length)),e]))}},8793:function(e,t,r){"use strict";r.d(t,{Kn:function(){return p},VM:function(){return d},r1:function(){return h}});var n=r(9716),i=r(6651),o=r(3374),a=r(8062),s=r(9502),u=r(9366),c=new s.Logger(u.i),l=new Uint8Array(32);l.fill(0);var f=new RegExp("^((.*)\\.)?([^.]+)$");function h(e){try{for(var t=e.split("."),r=0;r256||t[2]&&t[2]!==String(n))&&v.throwArgumentError("invalid numeric width","type",e);var i=w.mask(r?n-1:n),o=r?i.add(b).mul(g):m;return function(t){var r=s.O$.from(t);return(r.lt(o)||r.gt(i))&&v.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),(0,u.hexZeroPad)(r.toTwos(256).toHexString(),32)}}var l=e.match(/^bytes(\d+)$/);if(l){var f=parseInt(l[1]);return(0===f||f>32||l[1]!==String(f))&&v.throwArgumentError("invalid bytes width","type",e),function(t){return(0,u.arrayify)(t).length!==f&&v.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=(0,u.arrayify)(e),r=t.length%32;return r?(0,u.hexConcat)([t,y.slice(r)]):(0,u.hexlify)(t)}(t)}}switch(e){case"address":return function(e){return(0,u.hexZeroPad)((0,a.getAddress)(e),32)};case"bool":return function(e){return e?k:_};case"bytes":return function(e){return(0,c.keccak256)(e)};case"string":return function(e){return(0,d.id)(e)}}return null}function R(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var O=function(){function e(t){(0,i.Z)(this,e),(0,l.defineReadOnly)(this,"types",Object.freeze((0,l.deepCopy)(t))),(0,l.defineReadOnly)(this,"_encoderCache",{}),(0,l.defineReadOnly)(this,"_types",{});var r={},n={},o={};Object.keys(t).forEach((function(e){r[e]={},n[e]=[],o[e]={}}));var a=function(e){var i={};t[e].forEach((function(o){i[o.name]&&v.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(e)),"types",t),i[o.name]=!0;var a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===e&&v.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),T(a)||(n[a]||v.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",t),n[a].push(e),r[e][a]=!0)}))};for(var s in t)a(s);var u=Object.keys(n).filter((function(e){return 0===n[e].length}));for(var c in 0===u.length?v.throwArgumentError("missing primary type","types",t):u.length>1&&v.throwArgumentError("ambiguous primary types or unused types: ".concat(u.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),(0,l.defineReadOnly)(this,"primaryType",u[0]),function e(i,a){a[i]&&v.throwArgumentError("circular type reference to ".concat(JSON.stringify(i)),"types",t),a[i]=!0,Object.keys(r[i]).forEach((function(t){n[t]&&(e(t,a),Object.keys(a).forEach((function(e){o[e][t]=!0})))})),delete a[i]}(this.primaryType,{}),o){var f=Object.keys(o[c]);f.sort(),this._types[c]=R(c,t[c])+f.map((function(e){return R(e,t[e])})).join("")}}return(0,o.Z)(e,[{key:"getEncoder",value:function(e){var t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,r=T(e);if(r)return r;var n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var i=n[1],o=this.getEncoder(i),a=parseInt(n[3]);return function(e){a>=0&&e.length!==a&&v.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var r=e.map(o);return t._types[i]&&(r=r.map(c.keccak256)),(0,c.keccak256)((0,u.hexConcat)(r))}}var s=this.types[e];if(s){var l=(0,d.id)(this._types[e]);return function(e){var r=s.map((function(r){var n=r.name,i=r.type,o=t.getEncoder(i)(e[n]);return t._types[i]?(0,c.keccak256)(o):o}));return r.unshift(l),(0,u.hexConcat)(r)}}return v.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||v.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return(0,c.keccak256)(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,r){var n=this;if(T(e))return r(e,t);var i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){var o=i[1],a=parseInt(i[3]);return a>=0&&t.length!==a&&v.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return n._visit(o,e,r)}))}var s=this.types[e];return s?s.reduce((function(e,i){var o=i.name,a=i.type;return e[o]=n._visit(a,t[o],r),e}),{}):v.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}],[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,r,n){return e.from(r).hashStruct(t,n)}},{key:"hashDomain",value:function(t){var r=[];for(var n in t){var i=E[n];i||v.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",t),r.push({name:n,type:i})}return r.sort((function(e,t){return S.indexOf(e.name)-S.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:r},t)}},{key:"encode",value:function(t,r,n){return(0,u.hexConcat)(["0x1901",e.hashDomain(t),e.from(r).hash(n)])}},{key:"hash",value:function(t,r,n){return(0,c.keccak256)(e.encode(t,r,n))}},{key:"resolveNames",value:function(t,r,i,o){return p(this,void 0,void 0,(0,n.Z)().mark((function a(){var s,c,f;return(0,n.Z)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:t=(0,l.shallowCopy)(t),s={},t.verifyingContract&&!(0,u.isHexString)(t.verifyingContract,20)&&(s[t.verifyingContract]="0x"),(c=e.from(r)).visit(i,(function(e,t){return"address"!==e||(0,u.isHexString)(t,20)||(s[t]="0x"),t})),a.t0=(0,n.Z)().keys(s);case 6:if((a.t1=a.t0()).done){a.next=13;break}return f=a.t1.value,a.next=10,o(f);case 10:s[f]=a.sent,a.next=6;break;case 13:return t.verifyingContract&&s[t.verifyingContract]&&(t.verifyingContract=s[t.verifyingContract]),i=c.visit(i,(function(e,t){return"address"===e&&s[t]?s[t]:t})),a.abrupt("return",{domain:t,value:i});case 16:case"end":return a.stop()}}),a)})))}},{key:"getPayload",value:function(t,r,n){e.hashDomain(t);var i={},o=[];S.forEach((function(e){var r=t[e];null!=r&&(i[e]=A[e](r),o.push({name:e,type:E[e]}))}));var a=e.from(r),c=(0,l.shallowCopy)(r);return c.EIP712Domain?v.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):c.EIP712Domain=o,a.encode(n),{types:c,domain:i,primaryType:a.primaryType,message:a.visit(n,(function(e,t){if(e.match(/^bytes(\d*)/))return(0,u.hexlify)((0,u.arrayify)(t));if(e.match(/^u?int/))return s.O$.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&v.throwArgumentError("invalid string","value",t),t}return v.throwArgumentError("unsupported type","type",e)}))}}}]),e}()},5148:function(e,t,r){"use strict";r.r(t),r.d(t,{HDNode:function(){return B},defaultPath:function(){return M},entropyToMnemonic:function(){return Z},getAccountPath:function(){return F},isValidMnemonic:function(){return D},mnemonicToEntropy:function(){return U},mnemonicToSeed:function(){return L}});var n=r(5671),i=r(3144),o=r(3482),a=r(9716),s=r(2257),u=r(3374),c=r(2522),l=r(520),f=r(8865),h=r(9598),d=r(4667),p=r(5452),v=r(136),y=r(9388),g=r(1583),m=r(9502),b=new m.Logger("wordlists/5.6.1"),w=function(){function e(t){(0,n.Z)(this,e),b.checkAbstract(this instanceof e?this.constructor:void 0,e),(0,l.defineReadOnly)(this,"locale",t)}return(0,i.Z)(e,[{key:"split",value:function(e){return e.toLowerCase().split(/ +/g)}},{key:"join",value:function(e){return e.join(" ")}}],[{key:"check",value:function(e){for(var t=[],r=0;r<2048;r++){var n=e.getWord(r);if(r!==e.getWordIndex(n))return"0x";t.push(n)}return(0,g.id)(t.join("\n")+"\n")}},{key:"register",value:function(e,t){t||(t=e.locale)}}]),e}(),k=null;function _(e){if(null==k&&(k="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==w.check(e)))throw k=null,new Error("BIP39 Wordlist for en (English) FAILED")}var E=new(function(e){(0,v.Z)(r,e);var t=(0,y.Z)(r);function r(){return(0,n.Z)(this,r),t.call(this,"en")}return(0,i.Z)(r,[{key:"getWord",value:function(e){return _(this),k[e]}},{key:"getWordIndex",value:function(e){return _(this),k.indexOf(e)}}]),r}(w));w.register(E);var S={en:E},x=new m.Logger("hdnode/5.6.2"),A=s.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),T=(0,u.Y0)("Bitcoin seed"),R=2147483648;function O(e){return(1<=256)throw new Error("Depth too large!");return N((0,a.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,a.hexlify)(this.depth),this.parentFingerprint,(0,a.hexZeroPad)((0,a.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,a.concat)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new e(C,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(t){if(t>4294967295)throw new Error("invalid index - "+String(t));var r=this.path;r&&(r+="/"+(2147483647&t));var n=new Uint8Array(37);if(t&R){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set((0,a.arrayify)(this.privateKey),1),r&&(r+="'")}else n.set((0,a.arrayify)(this.publicKey));for(var i=24;i>=0;i-=8)n[33+(i>>3)]=t>>24-i&255;var o=(0,a.arrayify)((0,h.Gy)(d.p.sha512,this.chainCode,n)),u=o.slice(0,32),c=o.slice(32),l=null,p=null;this.privateKey?l=I(s.O$.from(u).add(this.privateKey).mod(A)):p=new f.SigningKey((0,a.hexlify)(u))._addPoint(this.publicKey);var v=r,y=this.mnemonic;return y&&(v=Object.freeze({phrase:y.phrase,path:r,locale:y.locale||"en"})),new e(C,l,p,this.fingerprint,I(c),t,this.depth+1,v)}},{key:"derivePath",value:function(e){var t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();for(var r=this,n=0;n=R)throw new Error("invalid path index - "+i);r=r._derive(R+o)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i);var a=parseInt(i);if(a>=R)throw new Error("invalid path index - "+i);r=r._derive(a)}}return r}}],[{key:"_fromSeed",value:function(t,r){var n=(0,a.arrayify)(t);if(n.length<16||n.length>64)throw new Error("invalid seed");var i=(0,a.arrayify)((0,h.Gy)(d.p.sha512,T,n));return new e(C,I(i.slice(0,32)),null,"0x00000000",I(i.slice(32)),0,0,r)}},{key:"fromMnemonic",value:function(t,r,n){return t=Z(U(t,n=P(n)),n),e._fromSeed(L(t,r),{phrase:t,path:"m",locale:n.locale})}},{key:"fromSeed",value:function(t){return e._fromSeed(t,null)}},{key:"fromExtendedKey",value:function(t){var r=o.Base58.decode(t);82===r.length&&N(r.slice(0,78))===t||x.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var n=r[4],i=(0,a.hexlify)(r.slice(5,9)),s=parseInt((0,a.hexlify)(r.slice(9,13)).substring(2),16),u=(0,a.hexlify)(r.slice(13,45)),c=r.slice(45,78);switch((0,a.hexlify)(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new e(C,null,(0,a.hexlify)(c),i,u,s,n,null);case"0x0488ade4":case"0x04358394 ":if(0!==c[0])break;return new e(C,(0,a.hexlify)(c.slice(1)),null,i,u,s,n,null)}return x.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}]),e}();function L(e,t){t||(t="");var r=(0,u.Y0)("mnemonic"+t,u.Uj.NFKD);return(0,c.n)((0,u.Y0)(e,u.Uj.NFKD),r,2048,64,"sha512")}function U(e,t){t=P(t),x.checkNormalize();var r=t.split(e);if(r.length%3!==0)throw new Error("invalid mnemonic");for(var n=(0,a.arrayify)(new Uint8Array(Math.ceil(11*r.length/8))),i=0,o=0;o>3]|=1<<7-i%8),i++}var c=32*r.length/3,l=O(r.length/3);if(((0,a.arrayify)((0,h.JQ)(n.slice(0,c/8)))[0]&l)!==(n[n.length-1]&l))throw new Error("invalid checksum");return(0,a.hexlify)(n.slice(0,c/8))}function Z(e,t){if(t=P(t),(e=(0,a.arrayify)(e)).length%4!==0||e.length<16||e.length>32)throw new Error("invalid entropy");for(var r=[0],n=11,i=0;i8?(r[r.length-1]<<=8,r[r.length-1]|=e[i],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[i]>>8-n,r.push(e[i]&(1<<8-n)-1),n+=3);var o=e.length/4,s=(0,a.arrayify)((0,h.JQ)(e))[0]&O(o);return r[r.length-1]<<=o,r[r.length-1]|=s>>8-o,t.join(r.map((function(e){return t.getWord(e)})))}function D(e,t){try{return U(e,t),!0}catch(r){}return!1}function F(e){return("number"!==typeof e||e<0||e>=R||e%1)&&x.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}},5382:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});var n="json-wallets/5.6.1"},1529:function(e,t,r){"use strict";r.r(t),r.d(t,{decryptCrowdsale:function(){return w},decryptJsonWallet:function(){return x},decryptJsonWalletSync:function(){return A},decryptKeystore:function(){return S.pe},decryptKeystoreSync:function(){return S.hb},encryptKeystore:function(){return S.HI},getJsonWalletAddress:function(){return E},isCrowdsaleWallet:function(){return k},isKeystoreWallet:function(){return _}});var n=r(5671),i=r(3144),o=r(136),a=r(9388),s=r(468),u=r.n(s),c=r(7419),l=r(9716),f=r(8062),h=r(2522),d=r(3374),p=r(520),v=r(9502),y=r(5382),g=r(8661),m=new v.Logger(y.i),b=function(e){(0,o.Z)(r,e);var t=(0,a.Z)(r);function r(){return(0,n.Z)(this,r),t.apply(this,arguments)}return(0,i.Z)(r,[{key:"isCrowdsaleAccount",value:function(e){return!(!e||!e._isCrowdsaleAccount)}}]),r}(p.Description);function w(e,t){var r=JSON.parse(e);t=(0,g.Ij)(t);var n=(0,c.getAddress)((0,g.gx)(r,"ethaddr")),i=(0,g.p3)((0,g.gx)(r,"encseed"));i&&i.length%16===0||m.throwArgumentError("invalid encseed","json",e);for(var o=(0,l.arrayify)((0,h.n)(t,t,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),s=i.slice(16),p=new(u().ModeOfOperation.cbc)(o,a),v=u().padding.pkcs7.strip((0,l.arrayify)(p.decrypt(s))),y="",w=0;ws[r]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n>4],r+=d[15&t[o]];i.push(e+"=Uint8Array(0x"+r+")")}else i.push(e+"="+JSON.stringify(t))}catch(c){i.push(e+"="+JSON.stringify(n[e].toString()))}})),i.push("code=".concat(r)),i.push("version=".concat(this.version));var o=t,s="";switch(r){case f.NUMERIC_FAULT:s="NUMERIC_FAULT";var u=t;switch(u){case"overflow":case"underflow":case"division-by-zero":s+="-"+u;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-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:s=r}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(t+=" ("+i.join(", ")+")");var c=new Error(t);return c.reason=o,c.code=r,Object.keys(n).forEach((function(e){c[e]=n[e]})),c}},{key:"throwError",value:function(e,t,r){throw this.makeError(e,t,r)}},{key:"throwArgumentError",value:function(t,r,n){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:r,value:n})}},{key:"assert",value:function(e,t,r,n){e||this.throwError(t,r,n)}},{key:"assertArgument",value:function(e,t,r,n){e||this.throwArgumentError(t,r,n)}},{key:"checkNormalize",value:function(t){null==t&&(t="platform missing String.prototype.normalize"),h&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:h})}},{key:"checkSafeUint53",value:function(t,r){"number"===typeof t&&(null==r&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,r,n){n=n?": "+n:"",tr&&this.throwError("too many arguments"+n,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}},{key:"checkNew",value:function(t,r){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}},{key:"checkAbstract",value:function(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}}],[{key:"globalLogger",value:function(){return c||(c=new e("logger/5.6.0")),c}},{key:"setCensorship",value:function(t,r){if(!t&&r&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}a=!!t,o=!!r}},{key:"setLogLevel",value:function(t){var r=s[t.toLowerCase()];null!=r?u=r:e.globalLogger().warn("invalid log level - "+t)}},{key:"from",value:function(t){return new e(t)}}]),e}();p.errors=f,p.levels=l},2522:function(e,t,r){"use strict";r.d(t,{n:function(){return o}});var n=r(9716),i=r(9598);function o(e,t,r,o,a){var s;e=(0,n.arrayify)(e),t=(0,n.arrayify)(t);var u,c,l=1,f=new Uint8Array(o),h=new Uint8Array(t.length+4);h.set(t);for(var d=1;d<=l;d++){h[t.length]=d>>24&255,h[t.length+1]=d>>16&255,h[t.length+2]=d>>8&255,h[t.length+3]=255&d;var p=(0,n.arrayify)((0,i.Gy)(a,e,h));s||(s=p.length,c=new Uint8Array(s),u=o-((l=Math.ceil(o/s))-1)*s),c.set(p);for(var v=1;v0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}},5244:function(e,t,r){"use strict";r.d(t,{O:function(){return u}});var n=r(9716),i=r(9502),o=new i.Logger("random/5.6.1");var a=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof r.g)return r.g;throw new Error("unable to locate global object")}(),s=a.crypto||a.msCrypto;function u(e){(e<=0||e>1024||e%1||e!=e)&&o.throwArgumentError("invalid length","length",e);var t=new Uint8Array(e);return s.getRandomValues(t),(0,n.arrayify)(t)}s&&s.getRandomValues||(o.warn("WARNING: Missing strong random number source"),s={getRandomValues:function(e){return o.throwError("no secure random source avaialble",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},7986:function(e,t,r){"use strict";r.r(t),r.d(t,{decode:function(){return h},encode:function(){return c}});var n=r(9716),i=r(9502),o=new i.Logger("rlp/5.6.1");function a(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function s(e,t,r){for(var n=0,i=0;it+1+n&&o.throwError("child data too short",i.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:a}}function f(e,t){if(0===e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){var r=e[t]-247;t+1+r>e.length&&o.throwError("data short segment too short",i.Logger.errors.BUFFER_OVERRUN,{});var a=s(e,t+1,r);return t+1+r+a>e.length&&o.throwError("data long segment too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(e,t,t+1+r,r+a)}if(e[t]>=192){var u=e[t]-192;return t+1+u>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(e,t,t+1,u)}if(e[t]>=184){var c=e[t]-183;t+1+c>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});var f=s(e,t+1,c);return t+1+c+f>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+c+f,result:(0,n.hexlify)(e.slice(t+1+c,t+1+c+f))}}if(e[t]>=128){var h=e[t]-128;return t+1+h>e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+h,result:(0,n.hexlify)(e.slice(t+1,t+1+h))}}return{consumed:1,result:(0,n.hexlify)(e[t])}}function h(e){var t=(0,n.arrayify)(e),r=f(t,0);return r.consumed!==t.length&&o.throwArgumentError("invalid rlp data","data",e),r.result}},6620:function(e,t,r){"use strict";r.r(t),r.d(t,{SupportedAlgorithm:function(){return i.p},computeHmac:function(){return n.Gy},ripemd160:function(){return n.bP},sha256:function(){return n.JQ},sha512:function(){return n.o}});var n=r(9598),i=r(4667)},9598:function(e,t,r){"use strict";r.d(t,{Gy:function(){return h},bP:function(){return c},JQ:function(){return l},o:function(){return f}});var n=r(3125),i=r.n(n),o=r(9716),a=r(4667),s=r(9502),u=new s.Logger("sha2/5.6.1");function c(e){return"0x"+i().ripemd160().update((0,o.arrayify)(e)).digest("hex")}function l(e){return"0x"+i().sha256().update((0,o.arrayify)(e)).digest("hex")}function f(e){return"0x"+i().sha512().update((0,o.arrayify)(e)).digest("hex")}function h(e,t,r){return a.p[e]||u.throwError("unsupported algorithm "+e,s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+i().hmac(i()[e],(0,o.arrayify)(t)).update((0,o.arrayify)(r)).digest("hex")}},4667:function(e,t,r){"use strict";var n;r.d(t,{p:function(){return n}}),function(e){e.sha256="sha256",e.sha512="sha512"}(n||(n={}))},8865:function(e,t,r){"use strict";r.r(t),r.d(t,{SigningKey:function(){return J},computePublicKey:function(){return X},recoverPublicKey:function(){return Y}});var n=r(5671),i=r(3144),o=r(518),a=r.n(o),s=r(3125),u=r.n(s);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof r.g?r.g:"undefined"!==typeof self&&self;function c(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((void 0===t||null===t)&&r.path)}},e(r,r.exports),r.exports}var l=f;function f(e,t){if(!e)throw new Error(t||"Assertion failed")}f.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var h=c((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),d=c((function(e,t){var r=t;r.assert=l,r.toArray=h.toArray,r.zero2=h.zero2,r.toHex=h.toHex,r.encode=h.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0===(1&u)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0===(1&c)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"===typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(a())(e,"hex","le")}})),p=d.getNAF,v=d.getJSF,y=d.assert;function g(e,t){this.type=e,this.p=new(a())(t.p,16),this.red=t.prime?a().red(t.prime):a().mont(this.p),this.zero=new(a())(0).toRed(this.red),this.one=new(a())(1).toRed(this.red),this.two=new(a())(2).toRed(this.red),this.n=t.n&&new(a())(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))}var m=g;function b(e,t){this.curve=e,this.type=t,this.precomputed=null}g.prototype.point=function(){throw new Error("Not implemented")},g.prototype.validate=function(){throw new Error("Not implemented")},g.prototype._fixedNafMul=function(e,t){y(e.precomputed);var r=e._getDoubles(),n=p(t,1,this._bitLength),i=(1<=o;u--)a=(a<<1)+n[u];s.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var c=o[s];y(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},g.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0;for(o=0;o=1;o-=2){var d=o-1,y=o;if(1===u[d]&&1===u[y]){var g=[t[d],null,null,t[y]];0===t[d].y.cmp(t[y].y)?(g[1]=t[d].add(t[y]),g[2]=t[d].toJ().mixedAdd(t[y].neg())):0===t[d].y.cmp(t[y].y.redNeg())?(g[1]=t[d].toJ().mixedAdd(t[y]),g[2]=t[d].add(t[y].neg())):(g[1]=t[d].toJ().mixedAdd(t[y]),g[2]=t[d].toJ().mixedAdd(t[y].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],b=v(r[d],r[y]);for(f=Math.max(b[0].length,f),l[d]=new Array(f),l[y]=new Array(f),a=0;a=0;o--){for(var S=0;o>=0;){var x=!0;for(a=0;a=0&&S++,_=_.dblp(S),o<0)break;for(a=0;a0?s=c[a][A-1>>1]:A<0&&(s=c[a][-A-1>>1].neg()),_="affine"===s.type?_.mixedAdd(s):_.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},b.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,s=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:n,b:i},{a:o,b:s}]},_.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},_.prototype.pointFromX=function(e,t){(e=new(a())(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)},_.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},_.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},S.prototype.isInfinity=function(){return this.inf},S.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)},S.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(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},S.prototype.getX=function(){return this.x.fromRed()},S.prototype.getY=function(){return this.y.fromRed()},S.prototype.mul=function(e){return e=new(a())(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)},S.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},S.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},S.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))},S.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},S.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},w(x,m.BasePoint),_.prototype.jpoint=function(e,t,r){return new x(this,e,t,r)},x.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)},x.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},x.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),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),f=n.redMul(c),h=u.redSqr().redIAdd(l).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},x.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),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(f)).redISub(i.redMul(c)),d=this.z.redMul(a);return this.curve.jpoint(f,h,d)},x.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=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},x.prototype.inspect=function(){return this.isInfinity()?"":""},x.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var A=c((function(e,t){var r=t;r.base=m,r.short=E,r.mont=null,r.edwards=null})),T=c((function(e,t){var r,n=t,i=d.assert;function o(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,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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:u().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:u().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:u().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:u().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"]}),a("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:u().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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:u().sha256,gRed:!1,g:["9"]}),a("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:u().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(s){r=void 0}a("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:u().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function R(e){if(!(this instanceof R))return new R(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=h.toArray(e.entropy,e.entropyEnc||"hex"),r=h.toArray(e.nonce,e.nonceEnc||"hex"),n=h.toArray(e.pers,e.persEnc||"hex");l(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var O=R;R.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 i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},R.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=h.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var C=d.assert;function M(e,t){if(e instanceof M)return e;this._importDER(e,t)||(C(e.r&&e.s,"Signature without r or s"),this.r=new(a())(e.r,16),this.s=new(a())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var B=M;function L(){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;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function Z(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}M.prototype._importDER=function(e,t){e=d.toArray(e,t);var r=new L;if(48!==e[r.place++])return!1;var n=U(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=U(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var s=U(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var u=e.slice(r.place,s+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new(a())(o),this.s=new(a())(u),this.recoveryParam=null,!0},M.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=Z(t),r=Z(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];D(n,t.length),(n=n.concat(t)).push(2),D(n,r.length);var i=n.concat(r),o=[48];return D(o,i.length),o=o.concat(i),d.encode(o,e)};var F=function(){throw new Error("unsupported")},j=d.assert;function z(e){if(!(this instanceof z))return new z(e);"string"===typeof e&&(j(Object.prototype.hasOwnProperty.call(T,e),"Unknown curve "+e),e=T[e]),e instanceof T.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}var H=z;z.prototype.keyPair=function(e){return new P(this,e)},z.prototype.keyFromPrivate=function(e,t){return P.fromPrivate(this,e,t)},z.prototype.keyFromPublic=function(e,t){return P.fromPublic(this,e,t)},z.prototype.genKeyPair=function(e){e||(e={});for(var t=new O({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||F(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(a())(2));;){var i=new(a())(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},z.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},z.prototype.sign=function(e,t,r,n){"object"===typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(a())(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),s=e.toArray("be",i),u=new O({hash:this.hash,entropy:o,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new(a())(1)),l=0;;l++){var f=n.k?n.k(l):new(a())(u.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var d=h.getX(),p=d.umod(this.n);if(0!==p.cmpn(0)){var v=f.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var y=(h.getY().isOdd()?1:0)|(0!==d.cmp(p)?2:0);return n.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),y^=1),new B({r:p,s:v,recoveryParam:y})}}}}}},z.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(a())(e,16)),r=this.keyFromPublic(r,n);var i=(t=new B(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,u=o.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)},z.prototype.recoverPubKey=function(e,t,r,n){j((3&r)===r,"The recovery param is more than two bits"),t=new B(t,n);var i=this.n,o=new(a())(e),s=t.r,u=t.s,c=1&r,l=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c);var f=t.r.invm(i),h=i.sub(o).mul(f).umod(i),d=u.mul(f).umod(i);return this.g.mulAdd(h,s,d)},z.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new B(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var V=c((function(e,t){var r=t;r.version="6.5.4",r.utils=d,r.rand=function(){throw new Error("unsupported")},r.curve=A,r.curves=T,r.ec=H,r.eddsa=null})).ec,q=r(9716),K=r(520),W=new(r(9502).Logger)("signing-key/5.6.2"),G=null;function $(){return G||(G=new V("secp256k1")),G}var J=function(){function e(t){(0,n.Z)(this,e),(0,K.defineReadOnly)(this,"curve","secp256k1"),(0,K.defineReadOnly)(this,"privateKey",(0,q.hexlify)(t)),32!==(0,q.hexDataLength)(this.privateKey)&&W.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var r=$().keyFromPrivate((0,q.arrayify)(this.privateKey));(0,K.defineReadOnly)(this,"publicKey","0x"+r.getPublic(!1,"hex")),(0,K.defineReadOnly)(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),(0,K.defineReadOnly)(this,"_isSigningKey",!0)}return(0,i.Z)(e,[{key:"_addPoint",value:function(e){var t=$().keyFromPublic((0,q.arrayify)(this.publicKey)),r=$().keyFromPublic((0,q.arrayify)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(e){var t=$().keyFromPrivate((0,q.arrayify)(this.privateKey)),r=(0,q.arrayify)(e);32!==r.length&&W.throwArgumentError("bad digest length","digest",e);var n=t.sign(r,{canonical:!0});return(0,q.splitSignature)({recoveryParam:n.recoveryParam,r:(0,q.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,q.hexZeroPad)("0x"+n.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(e){var t=$().keyFromPrivate((0,q.arrayify)(this.privateKey)),r=$().keyFromPublic((0,q.arrayify)(X(e)));return(0,q.hexZeroPad)("0x"+t.derive(r.getPublic()).toString(16),32)}}],[{key:"isSigningKey",value:function(e){return!(!e||!e._isSigningKey)}}]),e}();function Y(e,t){var r=(0,q.splitSignature)(t),n={r:(0,q.arrayify)(r.r),s:(0,q.arrayify)(r.s)};return"0x"+$().recoverPubKey((0,q.arrayify)(e),n,r.recoveryParam).encode("hex",!1)}function X(e,t){var r=(0,q.arrayify)(e);if(32===r.length){var n=new J(r);return t?"0x"+$().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?t?(0,q.hexlify)(r):"0x"+$().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+$().keyFromPublic(r).getPublic(!0,"hex"):(0,q.hexlify)(r):W.throwArgumentError("invalid public or private key","key","[REDACTED]")}},4530:function(e,t,r){"use strict";r.r(t),r.d(t,{keccak256:function(){return v},pack:function(){return p},sha256:function(){return y}});var n=r(2257),i=r(9716),o=r(8062),a=r(9598),s=r(3374),u=r(9502),c=new RegExp("^bytes([0-9]+)$"),l=new RegExp("^(u?int)([0-9]*)$"),f=new RegExp("^(.*)\\[([0-9]*)\\]$"),h=new u.Logger("solidity/5.6.1");function d(e,t,r){switch(e){case"address":return r?(0,i.zeroPad)(t,32):(0,i.arrayify)(t);case"string":return(0,s.Y0)(t);case"bytes":return(0,i.arrayify)(t);case"bool":return t=t?"0x01":"0x00",r?(0,i.zeroPad)(t,32):(0,i.arrayify)(t)}var o=e.match(l);if(o){var a=parseInt(o[2]||"256");return(o[2]&&String(a)!==o[2]||a%8!==0||0===a||a>256)&&h.throwArgumentError("invalid number type","type",e),r&&(a=256),t=n.O$.from(t).toTwos(a),(0,i.zeroPad)(t,a/8)}if(o=e.match(c)){var u=parseInt(o[1]);return(String(u)!==o[1]||0===u||u>32)&&h.throwArgumentError("invalid bytes type","type",e),(0,i.arrayify)(t).byteLength!==u&&h.throwArgumentError("invalid value for ".concat(e),"value",t),r?(0,i.arrayify)((t+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):t}if((o=e.match(f))&&Array.isArray(t)){var p=o[1];parseInt(o[2]||String(t.length))!=t.length&&h.throwArgumentError("invalid array length for ".concat(e),"value",t);var v=[];return t.forEach((function(e){v.push(d(p,e,!0))})),(0,i.concat)(v)}return h.throwArgumentError("invalid type","type",e)}function p(e,t){e.length!=t.length&&h.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);var r=[];return e.forEach((function(e,n){r.push(d(e,t[n]))})),(0,i.hexlify)((0,i.concat)(r))}function v(e,t){return(0,o.keccak256)(p(e,t))}function y(e,t){return(0,a.JQ)(p(e,t))}},6651:function(e,t,r){"use strict";r.d(t,{Ll:function(){return p}});var n=r(3374);function i(e,t){t||(t=function(e){return[parseInt(e,16)]});var r=0,n={};return e.split(",").forEach((function(e){var i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function o(e){var t=0;return e.split(",").map((function(e){var r=e.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:t+parseInt(r[0],16),h:t=parseInt(r[1],16)}}))}function a(e,t){for(var r=0,n=0;n=(r+=i.l)&&e<=r+i.h&&(e-r)%(i.d||1)===0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}var s=o("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),u="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(e){return parseInt(e,16)})),c=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],l=i("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),f=i("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),h=i("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!==0)throw new Error("bad data");for(var t=[],r=0;r=0)return[];if(e>=65024&&e<=65039)return[];var t=function(e){var t=a(e,c);if(t)return[e+t.s];var r=l[e];if(r)return r;var n=f[e];return n?[e+n[0]]:h[e]||null}(e);return t||[e]})),r=t.reduce((function(e,t){return t.forEach((function(t){e.push(t)})),e}),[]),(r=(0,n.XL)((0,n.uu)(r),n.Uj.NFKC)).forEach((function(e){if(a(e,d))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),r.forEach((function(e){if(a(e,s))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var i=(0,n.uu)(r);if("-"===i.substring(0,1)||"--"===i.substring(2,4)||"-"===i.substring(i.length-1))throw new Error("invalid hyphen");if(i.length>63)throw new Error("too long");return i}},1261:function(e,t,r){"use strict";r.r(t),r.d(t,{UnicodeNormalizationForm:function(){return o.Uj},Utf8ErrorFuncs:function(){return o.te},Utf8ErrorReason:function(){return o.Uw},_toEscapedUtf8String:function(){return o.U$},formatBytes32String:function(){return a},nameprep:function(){return u.Ll},parseBytes32String:function(){return s},toUtf8Bytes:function(){return o.Y0},toUtf8CodePoints:function(){return o.XL},toUtf8String:function(){return o.ZN}});var n=r(4867),i=r(9716),o=r(3374);function a(e){var t=(0,o.Y0)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,i.hexlify)((0,i.concat)([t,n.R]).slice(0,32))}function s(e){var t=(0,i.arrayify)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===t[r-1];)r--;return(0,o.ZN)(t.slice(0,r))}var u=r(6651)},3374:function(e,t,r){"use strict";r.d(t,{Uj:function(){return n},te:function(){return u},Uw:function(){return i},U$:function(){return h},uu:function(){return d},Y0:function(){return l},XL:function(){return v},ZN:function(){return p}});var n,i,o=r(9716),a=new(r(9502).Logger)("strings/5.6.1");function s(e,t,r,n,o){if(e===i.BAD_PREFIX||e===i.UNEXPECTED_CONTINUE){for(var a=0,s=t+1;s>6===2;s++)a++;return a}return e===i.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(n||(n={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(i||(i={}));var u=Object.freeze({error:function(e,t,r,n,i){return a.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:s,replace:function(e,t,r,n,o){return e===i.OVERLONG?(n.push(o),0):(n.push(65533),s(e,t,r))}});function c(e,t){null==t&&(t=u.error),e=(0,o.arrayify)(e);for(var r=[],n=0;n>7!==0){var s=null,c=null;if(192===(224&a))s=1,c=127;else if(224===(240&a))s=2,c=2047;else{if(240!==(248&a)){n+=t(128===(192&a)?i.UNEXPECTED_CONTINUE:i.BAD_PREFIX,n-1,e,r);continue}s=3,c=65535}if(n-1+s>=e.length)n+=t(i.OVERRUN,n-1,e,r);else{for(var l=a&(1<<8-s-1)-1,f=0;f1114111?n+=t(i.OUT_OF_RANGE,n-1-s,e,r,l):l>=55296&&l<=57343?n+=t(i.UTF16_SURROGATE,n-1-s,e,r,l):l<=c?n+=t(i.OVERLONG,n-1-s,e,r,l):r.push(l))}}else r.push(a)}return r}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.current;t!=n.current&&(a.checkNormalize(),e=e.normalize(t));for(var r=[],i=0;i>6|192),r.push(63&s|128);else if(55296==(64512&s)){i++;var u=e.charCodeAt(i);if(i>=e.length||56320!==(64512&u))throw new Error("invalid utf-8 string");var c=65536+((1023&s)<<10)+(1023&u);r.push(c>>18|240),r.push(c>>12&63|128),r.push(c>>6&63|128),r.push(63&c|128)}else r.push(s>>12|224),r.push(s>>6&63|128),r.push(63&s|128)}return(0,o.arrayify)(r)}function f(e){var t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function h(e,t){return'"'+c(e,t).map((function(e){if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?f(e):f(55296+((e-=65536)>>10&1023))+f(56320+(1023&e))})).join("")+'"'}function d(e){return e.map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function p(e,t){return d(c(e,t))}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.current;return c(l(e,t))}},5452:function(e,t,r){"use strict";r.r(t),r.d(t,{TransactionTypes:function(){return n},accessListify:function(){return _},computeAddress:function(){return m},parse:function(){return R},recoverAddress:function(){return b},serialize:function(){return A}});var n,i=r(7419),o=r(2257),a=r(9716),s=r(5422),u=r(8062),c=r(520),l=r(7986),f=r(8865),h=r(9502),d=new h.Logger("transactions/5.6.2");function p(e){return"0x"===e?null:(0,i.getAddress)(e)}function v(e){return"0x"===e?s._Y:o.O$.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(n||(n={}));var y=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],g={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function m(e){var t=(0,f.computePublicKey)(e);return(0,i.getAddress)((0,a.hexDataSlice)((0,u.keccak256)((0,a.hexDataSlice)(t,1)),12))}function b(e,t){return m((0,f.recoverPublicKey)((0,a.arrayify)(e),t))}function w(e,t){var r=(0,a.stripZeros)(o.O$.from(e).toHexString());return r.length>32&&d.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function k(e,t){return{address:(0,i.getAddress)(e),storageKeys:(t||[]).map((function(t,r){return 32!==(0,a.hexDataLength)(t)&&d.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(r,"]"),t),t.toLowerCase()}))}}function _(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&d.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),k(e[0],e[1])):k(e.address,e.storageKeys)}));var t=Object.keys(e).map((function(t){var r=e[t].reduce((function(e,t){return e[t]=!0,e}),{});return k(t,Object.keys(r).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function E(e){return _(e).map((function(e){return[e.address,e.storageKeys]}))}function S(e,t){if(null!=e.gasPrice){var r=o.O$.from(e.gasPrice),n=o.O$.from(e.maxFeePerGas||0);r.eq(n)||d.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}var s=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),w(e.maxFeePerGas||0,"maxFeePerGas"),w(e.gasLimit||0,"gasLimit"),null!=e.to?(0,i.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",E(e.accessList||[])];if(t){var u=(0,a.splitSignature)(t);s.push(w(u.recoveryParam,"recoveryParam")),s.push((0,a.stripZeros)(u.r)),s.push((0,a.stripZeros)(u.s))}return(0,a.hexConcat)(["0x02",l.encode(s)])}function x(e,t){var r=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.gasPrice||0,"gasPrice"),w(e.gasLimit||0,"gasLimit"),null!=e.to?(0,i.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",E(e.accessList||[])];if(t){var n=(0,a.splitSignature)(t);r.push(w(n.recoveryParam,"recoveryParam")),r.push((0,a.stripZeros)(n.r)),r.push((0,a.stripZeros)(n.s))}return(0,a.hexConcat)(["0x01",l.encode(r)])}function A(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&d.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,c.checkProperties)(e,g);var r=[];y.forEach((function(t){var n=e[t.name]||[],i={};t.numeric&&(i.hexPad="left"),n=(0,a.arrayify)((0,a.hexlify)(n,i)),t.length&&n.length!==t.length&&n.length>0&&d.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=(0,a.stripZeros)(n)).length>t.maxLength&&d.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),r.push((0,a.hexlify)(n))}));var n=0;if(null!=e.chainId?"number"!==typeof(n=e.chainId)&&d.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!(0,a.isBytesLike)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push((0,a.hexlify)(n)),r.push("0x"),r.push("0x")),!t)return l.encode(r);var i=(0,a.splitSignature)(t),o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&d.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&d.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push((0,a.hexlify)(o)),r.push((0,a.stripZeros)((0,a.arrayify)(i.r))),r.push((0,a.stripZeros)((0,a.arrayify)(i.s))),l.encode(r)}(e,t);switch(e.type){case 1:return x(e,t);case 2:return S(e,t)}return d.throwError("unsupported transaction type: ".concat(e.type),h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function T(e,t,r){try{var n=v(t[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");e.v=n}catch(o){d.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,a.hexZeroPad)(t[1],32),e.s=(0,a.hexZeroPad)(t[2],32);try{var i=(0,u.keccak256)(r(e));e.from=b(i,{r:e.r,s:e.s,recoveryParam:e.v})}catch(o){}}function R(e){var t=(0,a.arrayify)(e);if(t[0]>127)return function(e){var t=l.decode(e);9!==t.length&&6!==t.length&&d.throwArgumentError("invalid raw transaction","rawTransaction",e);var r={nonce:v(t[0]).toNumber(),gasPrice:v(t[1]),gasLimit:v(t[2]),to:p(t[3]),value:v(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=o.O$.from(t[6]).toNumber()}catch(c){return r}if(r.r=(0,a.hexZeroPad)(t[7],32),r.s=(0,a.hexZeroPad)(t[8],32),o.O$.from(r.r).isZero()&&o.O$.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,i=t.slice(0,6);0!==r.chainId&&(i.push((0,a.hexlify)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);var s=(0,u.keccak256)(l.encode(i));try{r.from=b(s,{r:(0,a.hexlify)(r.r),s:(0,a.hexlify)(r.s),recoveryParam:n})}catch(c){}r.hash=(0,u.keccak256)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){var t=l.decode(e.slice(1));8!==t.length&&11!==t.length&&d.throwArgumentError("invalid component count for transaction type: 1","payload",(0,a.hexlify)(e));var r={type:1,chainId:v(t[0]).toNumber(),nonce:v(t[1]).toNumber(),gasPrice:v(t[2]),gasLimit:v(t[3]),to:p(t[4]),value:v(t[5]),data:t[6],accessList:_(t[7])};return 8===t.length||(r.hash=(0,u.keccak256)(e),T(r,t.slice(8),x)),r}(t);case 2:return function(e){var t=l.decode(e.slice(1));9!==t.length&&12!==t.length&&d.throwArgumentError("invalid component count for transaction type: 2","payload",(0,a.hexlify)(e));var r=v(t[2]),n=v(t[3]),i={type:2,chainId:v(t[0]).toNumber(),nonce:v(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:v(t[4]),to:p(t[5]),value:v(t[6]),data:t[7],accessList:_(t[8])};return 9===t.length||(i.hash=(0,u.keccak256)(e),T(i,t.slice(9),S)),i}(t)}return d.throwError("unsupported transaction type: ".concat(t[0]),h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},9601:function(e,t,r){"use strict";r.r(t),r.d(t,{commify:function(){return S},formatEther:function(){return T},formatUnits:function(){return x},parseEther:function(){return R},parseUnits:function(){return A}});var n=r(5671),i=r(3144),o=r(9716),a=r(9502),s=r(6945),u=r(2257),c=new a.Logger(s.i),l={},f=u.O$.from(0),h=u.O$.from(-1);function d(e,t,r,n){var i={fault:t,operation:r};return void 0!==n&&(i.value=n),c.throwError(e,a.Logger.errors.NUMERIC_FAULT,i)}for(var p="0";p.length<256;)p+=p;function v(e){if("number"!==typeof e)try{e=u.O$.from(e).toNumber()}catch(t){}return"number"===typeof e&&e>=0&&e<=256&&!(e%1)?"1"+p.substring(0,e):c.throwArgumentError("invalid decimal size","decimals",e)}function y(e,t){null==t&&(t=0);var r=v(t),n=(e=u.O$.from(e)).lt(f);n&&(e=e.mul(h));for(var i=e.mod(r).toString();i.length2&&c.throwArgumentError("too many decimal points","value",e);var o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&d("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length80&&c.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new e(l,r,n,i)}}]),e}(),b=function(){function e(t,r,i,o){(0,n.Z)(this,e),t!==l&&c.throwError("cannot use FixedNumber constructor; use FixedNumber.from",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=o,this._hex=r,this._value=i,this._isFixedNumber=!0,Object.freeze(this)}return(0,i.Z)(e,[{key:"_checkFormat",value:function(e){this.format.name!==e.format.name&&c.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}},{key:"addUnsafe",value:function(t){this._checkFormat(t);var r=g(this._value,this.format.decimals),n=g(t._value,t.format.decimals);return e.fromValue(r.add(n),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(t){this._checkFormat(t);var r=g(this._value,this.format.decimals),n=g(t._value,t.format.decimals);return e.fromValue(r.sub(n),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(t){this._checkFormat(t);var r=g(this._value,this.format.decimals),n=g(t._value,t.format.decimals);return e.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(t){this._checkFormat(t);var r=g(this._value,this.format.decimals),n=g(t._value,t.format.decimals);return e.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}},{key:"floor",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(w.toFormat(r.format))),r}},{key:"ceiling",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(w.toFormat(r.format))),r}},{key:"round",value:function(t){null==t&&(t=0);var r=this.toString().split(".");if(1===r.length&&r.push("0"),(t<0||t>80||t%1)&&c.throwArgumentError("invalid decimal count","decimals",t),r[1].length<=t)return this;var n=e.from("1"+p.substring(0,t),this.format),i=k.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(e){if(null==e)return this._hex;e%8&&c.throwArgumentError("invalid byte width","width",e);var t=u.O$.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,o.hexZeroPad)(t,e/8)}},{key:"toUnsafeFloat",value:function(){return parseFloat(this.toString())}},{key:"toFormat",value:function(t){return e.fromString(this._value,t)}}],[{key:"fromValue",value:function(t,r,n){return null!=n||null==r||(0,u.Zm)(r)||(n=r,r=null),null==r&&(r=0),null==n&&(n="fixed"),e.fromString(y(t,r),m.from(n))}},{key:"fromString",value:function(t,r){null==r&&(r="fixed");var n=m.from(r),i=g(t,n.decimals);!n.signed&&i.lt(f)&&d("unsigned value cannot be negative","overflow","value",t);var a=null;n.signed?a=i.toTwos(n.width).toHexString():(a=i.toHexString(),a=(0,o.hexZeroPad)(a,n.width/8));var s=y(i,n.decimals);return new e(l,a,s,n)}},{key:"fromBytes",value:function(t,r){null==r&&(r="fixed");var n=m.from(r);if((0,o.arrayify)(t).length>n.width/8)throw new Error("overflow");var i=u.O$.from(t);n.signed&&(i=i.fromTwos(n.width));var a=i.toTwos((n.signed?0:1)+n.width).toHexString(),s=y(i,n.decimals);return new e(l,a,s,n)}},{key:"from",value:function(t,r){if("string"===typeof t)return e.fromString(t,r);if((0,o.isBytes)(t))return e.fromBytes(t,r);try{return e.fromValue(t,0,r)}catch(n){if(n.code!==a.Logger.errors.INVALID_ARGUMENT)throw n}return c.throwArgumentError("invalid FixedNumber value","value",t)}},{key:"isFixedNumber",value:function(e){return!(!e||!e._isFixedNumber)}}]),e}(),w=b.from(1),k=b.from("0.5"),_=new a.Logger("units/5.6.1"),E=["wei","kwei","mwei","gwei","szabo","finney","ether"];function S(e){var t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&_.throwArgumentError("invalid value","value",e);var r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");var i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);for(var o=[];r.length;){if(r.length<=3){o.unshift(r);break}var a=r.length-3;o.unshift(r.substring(a)),r=r.substring(0,a)}return n+o.join(",")+i}function x(e,t){if("string"===typeof t){var r=E.indexOf(t);-1!==r&&(t=3*r)}return y(e,null!=t?t:18)}function A(e,t){if("string"!==typeof e&&_.throwArgumentError("value must be a string","value",e),"string"===typeof t){var r=E.indexOf(t);-1!==r&&(t=3*r)}return g(e,null!=t?t:18)}function T(e){return x(e,18)}function R(e){return A(e,18)}},2876:function(e,t,r){"use strict";r.r(t),r.d(t,{Wallet:function(){return A},verifyMessage:function(){return T},verifyTypedData:function(){return R}});var n=r(4165),i=r(5671),o=r(3144),a=r(7326),s=r(136),u=r(9388),c=r(7419),l=r(9745),f=r(8408),h=r(9716),d=r(2273),p=r(5992),v=r(5148),y=r(8062),g=r(520),m=r(5244),b=r(8865),w=r(3463),k=r(1529),_=r(5452),E=r(9502),S=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(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())}))},x=new E.Logger("wallet/5.6.2");var A=function(e){(0,s.Z)(r,e);var t=(0,u.Z)(r);function r(e,n){var o,s;if((0,i.Z)(this,r),o=t.call(this),null!=(s=e)&&(0,h.isHexString)(s.privateKey,32)&&null!=s.address){var u=new b.SigningKey(e.privateKey);if((0,g.defineReadOnly)((0,a.Z)(o),"_signingKey",(function(){return u})),(0,g.defineReadOnly)((0,a.Z)(o),"address",(0,_.computeAddress)(o.publicKey)),o.address!==(0,c.getAddress)(e.address)&&x.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){var t=e.mnemonic;return t&&t.phrase}(e)){var f=e.mnemonic;(0,g.defineReadOnly)((0,a.Z)(o),"_mnemonic",(function(){return{phrase:f.phrase,path:f.path||v.defaultPath,locale:f.locale||"en"}}));var d=o.mnemonic,p=v.HDNode.fromMnemonic(d.phrase,null,d.locale).derivePath(d.path);(0,_.computeAddress)(p.privateKey)!==o.address&&x.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,g.defineReadOnly)((0,a.Z)(o),"_mnemonic",(function(){return null}))}else{if(b.SigningKey.isSigningKey(e))"secp256k1"!==e.curve&&x.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,g.defineReadOnly)((0,a.Z)(o),"_signingKey",(function(){return e}));else{"string"===typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);var y=new b.SigningKey(e);(0,g.defineReadOnly)((0,a.Z)(o),"_signingKey",(function(){return y}))}(0,g.defineReadOnly)((0,a.Z)(o),"_mnemonic",(function(){return null})),(0,g.defineReadOnly)((0,a.Z)(o),"address",(0,_.computeAddress)(o.publicKey))}return n&&!l.zt.isProvider(n)&&x.throwArgumentError("invalid provider","provider",n),(0,g.defineReadOnly)((0,a.Z)(o),"provider",n||null),o}return(0,o.Z)(r,[{key:"mnemonic",get:function(){return this._mnemonic()}},{key:"privateKey",get:function(){return this._signingKey().privateKey}},{key:"publicKey",get:function(){return this._signingKey().publicKey}},{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"connect",value:function(e){return new r(this,e)}},{key:"signTransaction",value:function(e){var t=this;return(0,g.resolveProperties)(e).then((function(r){null!=r.from&&((0,c.getAddress)(r.from)!==t.address&&x.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);var n=t._signingKey().signDigest((0,y.keccak256)((0,_.serialize)(r)));return(0,_.serialize)(r,n)}))}},{key:"signMessage",value:function(e){return S(this,void 0,void 0,(0,n.Z)().mark((function t(){return(0,n.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,h.joinSignature)(this._signingKey().signDigest((0,d.r)(e))));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"_signTypedData",value:function(e,t,r){return S(this,void 0,void 0,(0,n.Z)().mark((function i(){var o,a=this;return(0,n.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,p.E.resolveNames(e,t,r,(function(e){return null==a.provider&&x.throwError("cannot resolve ENS names without a provider",E.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),a.provider.resolveName(e)}));case 2:return o=n.sent,n.abrupt("return",(0,h.joinSignature)(this._signingKey().signDigest(p.E.hash(o.domain,t,o.value))));case 4:case"end":return n.stop()}}),i,this)})))}},{key:"encrypt",value:function(e,t,r){if("function"!==typeof t||r||(r=t,t={}),r&&"function"!==typeof r)throw new Error("invalid callback");return t||(t={}),(0,w.HI)(this,e,t,r)}}],[{key:"createRandom",value:function(e){var t=(0,m.O)(16);e||(e={}),e.extraEntropy&&(t=(0,h.arrayify)((0,h.hexDataSlice)((0,y.keccak256)((0,h.concat)([t,e.extraEntropy])),0,16)));var n=(0,v.entropyToMnemonic)(t,e.locale);return r.fromMnemonic(n,e.path,e.locale)}},{key:"fromEncryptedJson",value:function(e,t,n){return(0,k.decryptJsonWallet)(e,t,n).then((function(e){return new r(e)}))}},{key:"fromEncryptedJsonSync",value:function(e,t){return new r((0,k.decryptJsonWalletSync)(e,t))}},{key:"fromMnemonic",value:function(e,t,n){return t||(t=v.defaultPath),new r(v.HDNode.fromMnemonic(e,null,n).derivePath(t))}}]),r}(f.E);function T(e,t){return(0,_.recoverAddress)((0,d.r)(e),t)}function R(e,t,r,n){return(0,_.recoverAddress)(p.E.hash(e,t,r),n)}},5889:function(e,t,r){"use strict";r.r(t),r.d(t,{_fetchData:function(){return v},fetchJson:function(){return y},poll:function(){return g}});var n=r(4165),i=r(5101),o=r(9716),a=r(520),s=r(3374),u=r(9502),c=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(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())}))};function l(e,t){return c(this,void 0,void 0,(0,n.Z)().mark((function r(){var i,a,s,u;return(0,n.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t={}),i={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0},!0!==t.skipFetchSetup&&(i.mode="cors",i.cache="no-cache",i.credentials="same-origin",i.redirect="follow",i.referrer="client"),r.next=6,fetch(e,i);case 6:return a=r.sent,r.next=9,a.arrayBuffer();case 9:return s=r.sent,u={},a.headers.forEach?a.headers.forEach((function(e,t){u[t.toLowerCase()]=e})):a.headers.keys().forEach((function(e){u[e.toLowerCase()]=a.headers.get(e)})),r.abrupt("return",{headers:u,statusCode:a.status,statusMessage:a.statusText,body:(0,o.arrayify)(new Uint8Array(s))});case 13:case"end":return r.stop()}}),r)})))}var f=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(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())}))},h=new u.Logger("web/5.6.1");function d(e){return new Promise((function(t){setTimeout(t,e)}))}function p(e,t){if(null==e)return null;if("string"===typeof e)return e;if((0,o.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,s.ZN)(e)}catch(r){}return(0,o.hexlify)(e)}return e}function v(e,t,r){var o="object"===typeof e&&null!=e.throttleLimit?e.throttleLimit:12;h.assertArgument(o>0&&o%1===0,"invalid connection throttle limit","connection.throttleLimit",o);var a="object"===typeof e?e.throttleCallback:null,c="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;h.assertArgument(c>0&&c%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",c);var v="object"===typeof e&&!!e.errorPassThrough,y={},g=null,m={method:"GET"},b=!1,w=12e4;if("string"===typeof e)g=e;else if("object"===typeof e){if(null!=e&&null!=e.url||h.throwArgumentError("missing URL","connection.url",e),g=e.url,"number"===typeof e.timeout&&e.timeout>0&&(w=e.timeout),e.headers)for(var k in e.headers)y[k.toLowerCase()]={key:k,value:String(e.headers[k])},["if-none-match","if-modified-since"].indexOf(k.toLowerCase())>=0&&(b=!0);if(m.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==g.substring(0,6)&&!0!==e.allowInsecureAuthentication&&h.throwError("basic authentication requires a secure https url",u.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:g,user:e.user,password:"[REDACTED]"});var _=e.user+":"+e.password;y.authorization={key:"Authorization",value:"Basic "+(0,i.c)((0,s.Y0)(_))}}null!=e.skipFetchSetup&&(m.skipFetchSetup=!!e.skipFetchSetup)}var E=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),S=g?g.match(E):null;if(S)try{var x={statusCode:200,statusMessage:"OK",headers:{"content-type":S[1]},body:(0,i.J)(S[2])},A=x.body;return r&&(A=r(x.body,x)),Promise.resolve(A)}catch(I){h.throwError("processing response error",u.Logger.errors.SERVER_ERROR,{body:p(S[1],S[2]),error:I,requestBody:null,requestMethod:"GET",url:g})}t&&(m.method="POST",m.body=t,null==y["content-type"]&&(y["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==y["content-length"]&&(y["content-length"]={key:"Content-Length",value:String(t.length)}));var T={};Object.keys(y).forEach((function(e){var t=y[e];T[t.key]=t.value})),m.headers=T;var R=function(){var e=null;return{promise:new Promise((function(t,r){w&&(e=setTimeout((function(){null!=e&&(e=null,r(h.makeError("timeout",u.Logger.errors.TIMEOUT,{requestBody:p(m.body,T["content-type"]),requestMethod:m.method,timeout:w,url:g})))}),w))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),O=function(){return f(this,void 0,void 0,(0,n.Z)().mark((function e(){var t,i,s,f,y,w,k,_,E,S;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t=300)&&(R.cancel(),h.throwError("bad response",u.Logger.errors.SERVER_ERROR,{status:i.statusCode,headers:i.headers,body:p(k,i.headers?i.headers["content-type"]:null),requestBody:p(m.body,T["content-type"]),requestMethod:m.method,url:g})),!r){e.next=60;break}return e.prev=37,e.next=40,r(k,i);case 40:return _=e.sent,R.cancel(),e.abrupt("return",_);case 45:if(e.prev=45,e.t1=e.catch(37),!(e.t1.throttleRetry&&ts)return void(a()&&n(new Error("retry limit reached")));var c=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));ct.ceiling&&(c=t.ceiling),setTimeout(i,c)}return null}),(function(e){a()&&n(e)}))}()}))}},4848:function(e,t,r){"use strict";var n=r(4704).default;function i(e){if(!Number.isSafeInteger(e))throw new Error("Wrong integer: ".concat(e))}function o(){for(var e=function(e,t){return function(r){return e(t(r))}},t=arguments.length,r=new Array(t),n=0;n=e.length)throw new Error("Digit index outside alphabet: ".concat(t," (alphabet: ").concat(e.length,")"));return e[t]}))},decode:function(t){if(!Array.isArray(t)||t.length&&"string"!==typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((function(t){if("string"!==typeof t)throw new Error("alphabet.decode: not string element=".concat(t));var r=e.indexOf(t);if(-1===r)throw new Error('Unknown letter: "'.concat(t,'". Allowed: ').concat(e));return r}))}}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("string"!==typeof e)throw new Error("join separator should be string");return{encode:function(t){if(!Array.isArray(t)||t.length&&"string"!==typeof t[0])throw new Error("join.encode input should be array of strings");var r,i=n(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;if("string"!==typeof o)throw new Error("join.encode: non-string input=".concat(o))}}catch(a){i.e(a)}finally{i.f()}return t.join(e)},decode:function(t){if("string"!==typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"=";if(i(e),"string"!==typeof t)throw new Error("padding chr should be string");return{encode:function(r){if(!Array.isArray(r)||r.length&&"string"!==typeof r[0])throw new Error("padding.encode input should be array of strings");var i,o=n(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;if("string"!==typeof a)throw new Error("padding.encode: non-string input=".concat(a))}}catch(s){o.e(s)}finally{o.f()}for(;r.length*e%8;)r.push(t);return r},decode:function(r){if(!Array.isArray(r)||r.length&&"string"!==typeof r[0])throw new Error("padding.encode input should be array of strings");var i,o=n(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;if("string"!==typeof a)throw new Error("padding.decode: non-string input=".concat(a))}}catch(u){o.e(u)}finally{o.f()}var s=r.length;if(s*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;s>0&&r[s-1]===t;s--)if(!((s-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,s)}}}function c(e){if("function"!==typeof e)throw new Error("normalize fn should be function");return{encode:function(e){return e},decode:function(t){return e(t)}}}function l(e,t,r){if(t<2)throw new Error("convertRadix: wrong from=".concat(t,", base cannot be less than 2"));if(r<2)throw new Error("convertRadix: wrong to=".concat(r,", base cannot be less than 2"));if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];var n=0,o=[],a=Array.from(e);for(a.forEach((function(e){if(i(e),e<0||e>=t)throw new Error("Wrong integer: ".concat(e))}));;){for(var s=0,u=!0,c=n;c32)throw new Error("convertRadix2: wrong from=".concat(t));if(r<=0||r>32)throw new Error("convertRadix2: wrong to=".concat(r));if(h(t,r)>32)throw new Error("convertRadix2: carry overflow from=".concat(t," to=").concat(r," carryBits=").concat(h(t,r)));var a,s=0,u=0,c=Math.pow(2,r)-1,l=[],f=n(e);try{for(f.s();!(a=f.n()).done;){var d=a.value;if(i(d),d>=Math.pow(2,t))throw new Error("convertRadix2: invalid data word=".concat(d," from=").concat(t));if(s=s<32)throw new Error("convertRadix2: carry overflow pos=".concat(u," from=").concat(t));for(u+=t;u>=r;u-=r)l.push((s>>u-r&c)>>>0);s&=Math.pow(2,u)-1}}catch(p){f.e(p)}finally{f.f()}if(s=s<=t)throw new Error("Excess padding");if(!o&&s)throw new Error("Non-zero padding: ".concat(s));return o&&u>0&&l.push(s>>>0),l}function p(e){return i(e),{encode:function(t){if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return l(Array.from(t),Math.pow(2,8),e)},decode:function(t){if(!Array.isArray(t)||t.length&&"number"!==typeof t[0])throw new Error("radix.decode input should be array of strings");return Uint8Array.from(l(t,e,Math.pow(2,8)))}}}function v(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(i(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(h(8,e)>32||h(e,8)>32)throw new Error("radix2: carry overflow");return{encode:function(r){if(!(r instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return d(Array.from(r),8,e,!t)},decode:function(r){if(!Array.isArray(r)||r.length&&"number"!==typeof r[0])throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(d(r,e,8,t))}}}function y(e){if("function"!==typeof e)throw new Error("unsafeWrapper fn should be function");return function(){try{for(var t=arguments.length,r=new Array(t),n=0;n>25,r=(33554431&e)<<5,n=0;n>n&1)&&(r^=k[n]);return r}function E(e,t){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=e.length,o=1,a=0;a126)throw new Error("Invalid prefix (".concat(e,")"));o=_(o)^s>>5}o=_(o);for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:90;if("string"!==typeof e)throw new Error("bech32.decode input should be string, not ".concat(typeof e));if(e.length<8||!1!==r&&e.length>r)throw new TypeError("Wrong string length: ".concat(e.length," (").concat(e,"). Expected (8..").concat(r,")"));var n=e.toLowerCase();if(e!==n&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");var i=(e=n).lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');var o=e.slice(0,i),a=e.slice(i+1);if(a.length<6)throw new Error("Data must be at least 6 characters long");var s=w.decode(a).slice(0,-6),u=E(o,s,t);if(!a.endsWith(u))throw new Error("Invalid checksum in ".concat(e,': expected "').concat(u,'"'));return{prefix:o,words:s}}return{encode:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:90;if("string"!==typeof e)throw new Error("bech32.encode prefix should be string, not ".concat(typeof e));if(!Array.isArray(r)||r.length&&"number"!==typeof r[0])throw new Error("bech32.encode words should be array of numbers, not ".concat(typeof r));var i=e.length+7+r.length;if(!1!==n&&i>n)throw new TypeError("Length ".concat(i," exceeds limit ").concat(n));return e=e.toLowerCase(),"".concat(e,"1").concat(w.encode(r)).concat(E(e,r,t))},decode:a,decodeToBytes:function(e){var t=a(e,!1),r=t.prefix,i=t.words;return{prefix:r,words:i,bytes:n(i)}},decodeUnsafe:y(a),fromWords:n,fromWordsUnsafe:o,toWords:i}}t.bech32=S("bech32"),t.bech32m=S("bech32m"),t.utf8={encode:function(e){return(new TextDecoder).decode(e)},decode:function(e){return(new TextEncoder).encode(e)}},t.hex=o(v(4),a("0123456789abcdef"),s(""),c((function(e){if("string"!==typeof e||e.length%2)throw new TypeError("hex.decode: expected string, got ".concat(typeof e," with length ").concat(e.length));return e.toLowerCase()})));var x={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},A="Invalid encoding type. Available types: ".concat(Object.keys(x).join(", "));t.bytesToString=function(e,t){if("string"!==typeof e||!x.hasOwnProperty(e))throw new TypeError(A);if(!(t instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return x[e].encode(t)},t.str=t.bytesToString;t.stringToBytes=function(e,t){if(!x.hasOwnProperty(e))throw new TypeError(A);if("string"!==typeof t)throw new TypeError("stringToBytes() expects string");return x[e].decode(t)},t.bytes=t.stringToBytes},4924:function(e,t,r){"use strict";t.Z1=void 0;var n=r(3031),i=r(1814),o=r(1786),a=r(7745),s=r(5410),u=r(4848);function c(e){if("string"!==typeof e)throw new TypeError("Invalid mnemonic type: ".concat(typeof e));return e.normalize("NFKD")}function l(e){var t=c(e),r=t.split(" ");if(![12,15,18,21,24].includes(r.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:r}}function f(e){n.default.bytes(e,16,20,24,28,32)}var h=function(e){var t=8-e.length/4;return new Uint8Array([(0,o.sha256)(e)[0]>>t<1&&void 0!==arguments[1]?arguments[1]:"";return(0,i.pbkdf2)(a.sha512,l(e).nfkd,y(t),{c:2048,dkLen:64})}},3031:function(e,t){"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Wrong positive integer: ".concat(e))}function n(e){if("boolean"!==typeof e)throw new Error("Expected boolean, not ".concat(e))}function i(e){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n0&&!r.includes(e.length))throw new TypeError("Expected Uint8Array of length ".concat(r,", not of length=").concat(e.length))}function o(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){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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){i(e);var r=t.outputLen;if(e.lengthn-o&&(this.process(r,0),o=0);for(var a=o;a>i&o),s=Number(r&o),u=n?4:0,c=n?0:4;e.setUint32(t+u,a,n),e.setUint32(t+c,s,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);var s=(0,c.createView)(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");var f=l/4,h=this.get();if(f>h.length)throw new Error("_sha2: outputLen bigger than state");for(var d=0;d1&&void 0!==arguments[1]&&arguments[1];return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function o(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=new Uint32Array(e.length),n=new Uint32Array(e.length),o=0;o>>0)<>>0)};function a(e,t,r,n){var i=(t>>>0)+(n>>>0);return{h:e+r+(i/Math.pow(2,32)|0)|0,l:0|i}}t.add=a;var s={fromBig:i,split:o,toBig:t.toBig,shrSH:function(e,t,r){return e>>>r},shrSL:function(e,t,r){return e<<32-r|t>>>r},rotrSH:function(e,t,r){return e>>>r|t<<32-r},rotrSL:function(e,t,r){return e<<32-r|t>>>r},rotrBH:function(e,t,r){return e<<64-r|t>>>r-32},rotrBL:function(e,t,r){return e>>>r-32|t<<64-r},rotr32H:function(e,t){return t},rotr32L:function(e,t){return e},rotlSH:function(e,t,r){return e<>>32-r},rotlSL:function(e,t,r){return t<>>32-r},rotlBH:function(e,t,r){return t<>>64-r},rotlBL:function(e,t,r){return e<>>64-r},add:a,add3L:function(e,t,r){return(e>>>0)+(t>>>0)+(r>>>0)},add3H:function(e,t,r,n){return t+r+n+(e/Math.pow(2,32)|0)|0},add4L:function(e,t,r,n){return(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)},add4H:function(e,t,r,n,i){return t+r+n+i+(e/Math.pow(2,32)|0)|0},add5H:function(e,t,r,n,i,o){return t+r+n+i+o+(e/Math.pow(2,32)|0)|0},add5L:function(e,t,r,n,i){return(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)}};t.default=s},4872:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto={node:void 0,web:"object"===typeof self&&"crypto"in self?self.crypto:void 0}},8536:function(e,t,r){"use strict";var n=r(6690).default,i=r(9728).default,o=r(1655).default,a=r(6389).default;Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=void 0;var s=r(3031),u=r(5410),c=function(e){o(r,e);var t=a(r);function r(e,i){var o;n(this,r),(o=t.call(this)).finished=!1,o.destroyed=!1,s.default.hash(e);var a=(0,u.toBytes)(i);if(o.iHash=e.create(),"function"!==typeof o.iHash.update)throw new TypeError("Expected instance of class which extends utils.Hash");o.blockLen=o.iHash.blockLen,o.outputLen=o.iHash.outputLen;var c=o.blockLen,l=new Uint8Array(c);l.set(a.length>c?e.create().update(a).digest():a);for(var f=0;f= 1");var f=(0,s.toBytes)(t),h=(0,s.toBytes)(r),d=new Uint8Array(c),p=a.hmac.create(e,f),v=p._cloneInto().update(h);return{c:u,dkLen:c,asyncTick:l,DK:d,PRF:p,PRFSalt:v}}function c(e,t,r,n,i){return e.destroy(),t.destroy(),n&&n.destroy(),i.fill(0),r}function l(){return(l=i(n().mark((function e(t,r,i,o){var a,l,f,h,d,p,v,y,g,m,b,w,k,_;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=u(t,r,i,o),l=a.c,f=a.dkLen,h=a.asyncTick,d=a.DK,p=a.PRF,v=a.PRFSalt,g=new Uint8Array(4),m=(0,s.createView)(g),b=new Uint8Array(p.outputLen),w=n().mark((function e(t,r){var i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=d.subarray(r,r+p.outputLen),m.setInt32(0,t,!1),(y=v._cloneInto(y)).update(g).digestInto(b),i.set(b.subarray(0,i.length)),e.next=6,(0,s.asyncLoop)(l-1,h,(function(e){p._cloneInto(y).update(b).digestInto(b);for(var t=0;t>>3,s=(0,u.rotr)(o,17)^(0,u.rotr)(o,19)^o>>>10;h[n]=s+h[n-7]+a+h[n-16]|0}var f,d=this.A,p=this.B,v=this.C,y=this.D,g=this.E,m=this.F,b=this.G,w=this.H;for(r=0;r<64;r++){var k=w+((0,u.rotr)(g,6)^(0,u.rotr)(g,11)^(0,u.rotr)(g,25))+((f=g)&m^~f&b)+l[r]+h[r]|0,_=((0,u.rotr)(d,2)^(0,u.rotr)(d,13)^(0,u.rotr)(d,22))+c(d,p,v)|0;w=b,b=m,m=g,g=y+k|0,y=v,v=p,p=d,d=k+_|0}d=d+this.A|0,p=p+this.B|0,v=v+this.C|0,y=y+this.D|0,g=g+this.E|0,m=m+this.F|0,b=b+this.G|0,w=w+this.H|0,this.set(d,p,v,y,g,m,b,w)}},{key:"roundClean",value:function(){h.fill(0)}},{key:"destroy",value:function(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}]),r}(s.SHA2),p=function(e){o(r,e);var t=a(r);function r(){var e;return n(this,r),(e=t.call(this)).A=-1056596264,e.B=914150663,e.C=812702999,e.D=-150054599,e.E=-4191439,e.F=1750603025,e.G=1694076839,e.H=-1090891868,e.outputLen=28,e}return i(r)}(d);t.sha256=(0,u.wrapConstructor)((function(){return new d})),t.sha224=(0,u.wrapConstructor)((function(){return new p}))},7745:function(e,t,r){"use strict";var n=r(6690).default,i=r(9728).default,o=r(1655).default,a=r(6389).default,s=r(7424).default;Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512_224=t.sha512=t.SHA512=void 0;var u=r(6687),c=r(1857),l=r(5410),f=s(c.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((function(e){return BigInt(e)}))),2),h=f[0],d=f[1],p=new Uint32Array(80),v=new Uint32Array(80),y=function(e){o(r,e);var t=a(r);function r(){var e;return n(this,r),(e=t.call(this,128,64,16,!1)).Ah=1779033703,e.Al=-205731576,e.Bh=-1150833019,e.Bl=-2067093701,e.Ch=1013904242,e.Cl=-23791573,e.Dh=-1521486534,e.Dl=1595750129,e.Eh=1359893119,e.El=-1377402159,e.Fh=-1694144372,e.Fl=725511199,e.Gh=528734635,e.Gl=-79577749,e.Hh=1541459225,e.Hl=327033209,e}return i(r,[{key:"get",value:function(){return[this.Ah,this.Al,this.Bh,this.Bl,this.Ch,this.Cl,this.Dh,this.Dl,this.Eh,this.El,this.Fh,this.Fl,this.Gh,this.Gl,this.Hh,this.Hl]}},{key:"set",value:function(e,t,r,n,i,o,a,s,u,c,l,f,h,d,p,v){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|l,this.Fl=0|f,this.Gh=0|h,this.Gl=0|d,this.Hh=0|p,this.Hl=0|v}},{key:"process",value:function(e,t){for(var r=0;r<16;r++,t+=4)p[r]=e.getUint32(t),v[r]=e.getUint32(t+=4);for(var n=16;n<80;n++){var i=0|p[n-15],o=0|v[n-15],a=c.default.rotrSH(i,o,1)^c.default.rotrSH(i,o,8)^c.default.shrSH(i,o,7),s=c.default.rotrSL(i,o,1)^c.default.rotrSL(i,o,8)^c.default.shrSL(i,o,7),u=0|p[n-2],l=0|v[n-2],f=c.default.rotrSH(u,l,19)^c.default.rotrBH(u,l,61)^c.default.shrSH(u,l,6),y=c.default.rotrSL(u,l,19)^c.default.rotrBL(u,l,61)^c.default.shrSL(u,l,6),g=c.default.add4L(s,y,v[n-7],v[n-16]),m=c.default.add4H(g,a,f,p[n-7],p[n-16]);p[n]=0|m,v[n]=0|g}var b=this.Ah,w=this.Al,k=this.Bh,_=this.Bl,E=this.Ch,S=this.Cl,x=this.Dh,A=this.Dl,T=this.Eh,R=this.El,O=this.Fh,I=this.Fl,N=this.Gh,P=this.Gl,C=this.Hh,M=this.Hl;for(r=0;r<80;r++){var B=c.default.rotrSH(T,R,14)^c.default.rotrSH(T,R,18)^c.default.rotrBH(T,R,41),L=c.default.rotrSL(T,R,14)^c.default.rotrSL(T,R,18)^c.default.rotrBL(T,R,41),U=T&O^~T&N,Z=R&I^~R&P,D=c.default.add5L(M,L,Z,d[r],v[r]),F=c.default.add5H(D,C,B,U,h[r],p[r]),j=0|D,z=c.default.rotrSH(b,w,28)^c.default.rotrBH(b,w,34)^c.default.rotrBH(b,w,39),H=c.default.rotrSL(b,w,28)^c.default.rotrBL(b,w,34)^c.default.rotrBL(b,w,39),V=b&k^b&E^k&E,q=w&_^w&S^_&S;C=0|N,M=0|P,N=0|O,P=0|I,O=0|T,I=0|R;var K=c.default.add(0|x,0|A,0|F,0|j);T=K.h,R=K.l,x=0|E,A=0|S,E=0|k,S=0|_,k=0|b,_=0|w;var W=c.default.add3L(j,H,q);b=c.default.add3H(W,F,z,V),w=0|W}var G=c.default.add(0|this.Ah,0|this.Al,0|b,0|w);b=G.h,w=G.l;var $=c.default.add(0|this.Bh,0|this.Bl,0|k,0|_);k=$.h,_=$.l;var J=c.default.add(0|this.Ch,0|this.Cl,0|E,0|S);E=J.h,S=J.l;var Y=c.default.add(0|this.Dh,0|this.Dl,0|x,0|A);x=Y.h,A=Y.l;var X=c.default.add(0|this.Eh,0|this.El,0|T,0|R);T=X.h,R=X.l;var Q=c.default.add(0|this.Fh,0|this.Fl,0|O,0|I);O=Q.h,I=Q.l;var ee=c.default.add(0|this.Gh,0|this.Gl,0|N,0|P);N=ee.h,P=ee.l;var te=c.default.add(0|this.Hh,0|this.Hl,0|C,0|M);C=te.h,M=te.l,this.set(b,w,k,_,E,S,x,A,T,R,O,I,N,P,C,M)}},{key:"roundClean",value:function(){p.fill(0),v.fill(0)}},{key:"destroy",value:function(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}]),r}(u.SHA2);t.SHA512=y;var g=function(e){o(r,e);var t=a(r);function r(){var e;return n(this,r),(e=t.call(this)).Ah=-1942145080,e.Al=424955298,e.Bh=1944164710,e.Bl=-1982016298,e.Ch=502970286,e.Cl=855612546,e.Dh=1738396948,e.Dl=1479516111,e.Eh=258812777,e.El=2077511080,e.Fh=2011393907,e.Fl=79989058,e.Gh=1067287976,e.Gl=1780299464,e.Hh=286451373,e.Hl=-1848208735,e.outputLen=28,e}return i(r)}(y),m=function(e){o(r,e);var t=a(r);function r(){var e;return n(this,r),(e=t.call(this)).Ah=573645204,e.Al=-64227540,e.Bh=-1621794909,e.Bl=-934517566,e.Ch=596883563,e.Cl=1867755857,e.Dh=-1774684391,e.Dl=1497426621,e.Eh=-1775747358,e.El=-1467023389,e.Fh=-1101128155,e.Fl=1401305490,e.Gh=721525244,e.Gl=746961066,e.Hh=246885852,e.Hl=-2117784414,e.outputLen=32,e}return i(r)}(y),b=function(e){o(r,e);var t=a(r);function r(){var e;return n(this,r),(e=t.call(this)).Ah=-876896931,e.Al=-1056596264,e.Bh=1654270250,e.Bl=914150663,e.Ch=-1856437926,e.Cl=812702999,e.Dh=355462360,e.Dl=-150054599,e.Eh=1731405415,e.El=-4191439,e.Fh=-1900787065,e.Fl=1750603025,e.Gh=-619958771,e.Gl=1694076839,e.Hh=1203062813,e.Hl=-1090891868,e.outputLen=48,e}return i(r)}(y);t.sha512=(0,l.wrapConstructor)((function(){return new y})),t.sha512_224=(0,l.wrapConstructor)((function(){return new g})),t.sha512_256=(0,l.wrapConstructor)((function(){return new m})),t.sha384=(0,l.wrapConstructor)((function(){return new b}))},5410:function(e,t,r){"use strict";var n=r(6690).default,i=r(9728).default,o=r(7061).default,a=r(7156).default;Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;var s=r(4872);t.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)};t.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))};t.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)};if(t.rotr=function(e,t){return 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");var u=Array.from({length:256},(function(e,t){return t.toString(16).padStart(2,"0")}));t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");for(var t="",r=0;r=0&&u0&&void 0!==arguments[0]?arguments[0]:32;if(s.crypto.web)return s.crypto.web.getRandomValues(new Uint8Array(e));if(s.crypto.node)return new Uint8Array(s.crypto.node.randomBytes(e).buffer);throw new Error("The environment doesn't have randomBytes function")}},2576:function(e,t,r){"use strict";var n=r(1588).default,i=r(3808).default,o=r(6115).default,a=r(4704).default,s=r(1655).default,u=r(6389).default,c=r(6690).default,l=r(9728).default;t._O=t.Jq=t.KB=t.u8=t.cv=void 0,t.Ik=t.A9=t.n_=t.gM=void 0;var f=r(9778);function h(e){if(!(e instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}function d(e){return h(e),f.Buffer.from(e.buffer,e.byteOffset,e.length)}var p=function(){function e(t,r){if(c(this,e),!Number.isInteger(t))throw new TypeError("span must be an integer");this.span=t,this.property=r}return l(e,[{key:"makeDestinationObject",value:function(){return{}}},{key:"getSpan",value:function(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}},{key:"replicate",value:function(e){var t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}},{key:"fromArray",value:function(e){}}]),e}();function v(e,t){return t.property?e+"["+t.property+"]":e}var y=function(e){s(r,e);var t=u(r);function r(){return c(this,r),t.apply(this,arguments)}return l(r,[{key:"isCount",value:function(){throw new Error("ExternalLayout is abstract")}}]),r}(p);var g=function(e){s(r,e);var t=u(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1?arguments[1]:void 0;if(c(this,r),!Number.isInteger(n)||0>=n)throw new TypeError("elementSpan must be a (positive) integer");return(e=t.call(this,-1,i)).elementSpan=n,e}return l(r,[{key:"isCount",value:function(){return!0}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;h(e);var r=e.length-t;return Math.floor(r/this.elementSpan)}},{key:"encode",value:function(e,t,r){return 0}}]),r}(y);var m=function(e){s(r,e);var t=u(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2?arguments[2]:void 0;if(c(this,r),!(e instanceof p))throw new TypeError("layout must be a Layout");if(!Number.isInteger(i))throw new TypeError("offset must be integer or undefined");return(n=t.call(this,e.span,o||e.property)).layout=e,n.offset=i,n}return l(r,[{key:"isCount",value:function(){return this.layout instanceof b||this.layout instanceof w}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.layout.decode(e,t+this.offset)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.layout.encode(e,t,r+this.offset)}}]),r}(y);var b=function(e){s(r,e);var t=u(r);function r(e,n){var i;if(c(this,r),6<(i=t.call(this,e,n)).span)throw new RangeError("span must not exceed 6 bytes");return i}return l(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return d(e).readUIntLE(t,this.span)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return d(t).writeUIntLE(e,r,this.span),this.span}}]),r}(p);var w=function(e){s(r,e);var t=u(r);function r(e,n){var i;if(c(this,r),6<(i=t.call(this,e,n)).span)throw new RangeError("span must not exceed 6 bytes");return i}return l(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return d(e).readUIntBE(t,this.span)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return d(t).writeUIntBE(e,r,this.span),this.span}}]),r}(p);var k=function(e){s(r,e);var t=u(r);function r(e,n){var i;if(c(this,r),6<(i=t.call(this,e,n)).span)throw new RangeError("span must not exceed 6 bytes");return i}return l(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return d(e).readIntLE(t,this.span)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return d(t).writeIntLE(e,r,this.span),this.span}}]),r}(p);var _=function(e){s(r,e);var t=u(r);function r(e,n){var i;if(c(this,r),6<(i=t.call(this,e,n)).span)throw new RangeError("span must not exceed 6 bytes");return i}return l(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return d(e).readIntBE(t,this.span)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return d(t).writeIntBE(e,r,this.span),this.span}}]),r}(p);var E=Math.pow(2,32);function S(e){var t=Math.floor(e/E);return{hi32:t,lo32:e-t*E}}function x(e,t){return e*E+t}var A=function(e){s(r,e);var t=u(r);function r(e){return c(this,r),t.call(this,8,e)}return l(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=d(e),n=r.readUInt32LE(t),i=r.readUInt32LE(t+4);return x(i,n)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=S(e),i=d(t);return i.writeUInt32LE(n.lo32,r),i.writeUInt32LE(n.hi32,r+4),8}}]),r}(p);var T=function(e){s(r,e);var t=u(r);function r(e){return c(this,r),t.call(this,8,e)}return l(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=d(e),n=r.readUInt32BE(t),i=r.readUInt32BE(t+4);return x(n,i)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=S(e),i=d(t);return i.writeUInt32BE(n.hi32,r),i.writeUInt32BE(n.lo32,r+4),8}}]),r}(p);var R=function(e){s(r,e);var t=u(r);function r(e){return c(this,r),t.call(this,8,e)}return l(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=d(e),n=r.readUInt32LE(t),i=r.readInt32LE(t+4);return x(i,n)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=S(e),i=d(t);return i.writeUInt32LE(n.lo32,r),i.writeInt32LE(n.hi32,r+4),8}}]),r}(p);var O=function(e){s(r,e);var t=u(r);function r(e){return c(this,r),t.call(this,8,e)}return l(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=d(e),n=r.readInt32BE(t),i=r.readUInt32BE(t+4);return x(n,i)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=S(e),i=d(t);return i.writeInt32BE(n.hi32,r),i.writeUInt32BE(n.lo32,r+4),8}}]),r}(p);var I=function(e){s(r,e);var t=u(r);function r(e){return c(this,r),t.call(this,4,e)}return l(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return d(e).readFloatLE(t)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return d(t).writeFloatLE(e,r),4}}]),r}(p);var N=function(e){s(r,e);var t=u(r);function r(e){return c(this,r),t.call(this,4,e)}return l(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return d(e).readFloatBE(t)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return d(t).writeFloatBE(e,r),4}}]),r}(p);var P=function(e){s(r,e);var t=u(r);function r(e){return c(this,r),t.call(this,8,e)}return l(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return d(e).readDoubleLE(t)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return d(t).writeDoubleLE(e,r),8}}]),r}(p);var C=function(e){s(r,e);var t=u(r);function r(e){return c(this,r),t.call(this,8,e)}return l(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return d(e).readDoubleBE(t)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return d(t).writeDoubleBE(e,r),8}}]),r}(p);var M=function(e){s(r,e);var t=u(r);function r(e,n,i){var o;if(c(this,r),!(e instanceof p))throw new TypeError("elementLayout must be a Layout");if(!(n instanceof y&&n.isCount()||Number.isInteger(n)&&0<=n))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");var a=-1;return!(n instanceof y)&&01&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var r=0,n=this.count;if(n instanceof y&&(n=n.decode(e,t)),01&&void 0!==arguments[1]?arguments[1]:0,r=[],n=0,i=this.count;for(i instanceof y&&(i=i.decode(e,t));n2&&void 0!==arguments[2]?arguments[2]:0,n=this.elementLayout,i=e.reduce((function(e,i){return e+n.encode(i,t,r+e)}),0);return this.count instanceof y&&this.count.encode(e.length,t,r),i}}]),r}(p);var B=function(e){s(r,e);var t=u(r);function r(e,n,i){var o;if(c(this,r),!Array.isArray(e)||!e.reduce((function(e,t){return e&&t instanceof p}),!0))throw new TypeError("fields must be array of Layout instances");"boolean"===typeof n&&void 0===i&&(i=n,n=void 0);var s,u=a(e);try{for(u.s();!(s=u.n()).done;){var l=s.value;if(0>l.span&&void 0===l.property)throw new Error("fields cannot contain unnamed variable-length layout")}}catch(h){u.e(h)}finally{u.f()}var f=-1;try{f=e.reduce((function(e,t){return e+t.getSpan()}),0)}catch(d){}return(o=t.call(this,f,n)).fields=e,o.decodePrefixes=!!i,o}return l(r,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var r=0;try{r=this.fields.reduce((function(r,n){var i=n.getSpan(e,t);return t+=i,r+i}),0)}catch(n){throw new RangeError("indeterminate span")}return r}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;h(e);var r,n=this.makeDestinationObject(),i=a(this.fields);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(void 0!==o.property&&(n[o.property]=o.decode(e,t)),t+=o.getSpan(e,t),this.decodePrefixes&&e.length===t)break}}catch(s){i.e(s)}finally{i.f()}return n}},{key:"encode",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=n,o=0,s=0,u=a(this.fields);try{for(u.s();!(r=u.n()).done;){var c=r.value,l=c.span;if(s=0l&&(l=c.getSpan(t,n)))}o=n,n+=l}}catch(h){u.e(h)}finally{u.f()}return o+s-i}},{key:"fromArray",value:function(e){var t,r=this.makeDestinationObject(),n=a(this.fields);try{for(n.s();!(t=n.n()).done;){var i=t.value;void 0!==i.property&&0i.span?r=-1:0<=r&&(r+=i.span)}}catch(o){n.e(o)}finally{n.f()}}}]),r}(p);var L=function(){function e(t){c(this,e),this.property=t}return l(e,[{key:"decode",value:function(e,t){throw new Error("UnionDiscriminator is abstract")}},{key:"encode",value:function(e,t,r){throw new Error("UnionDiscriminator is abstract")}}]),e}();var U=function(e){s(r,e);var t=u(r);function r(e,n){var i;if(c(this,r),!(e instanceof y&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");return(i=t.call(this,n||e.property||"variant")).layout=e,i}return l(r,[{key:"decode",value:function(e,t){return this.layout.decode(e,t)}},{key:"encode",value:function(e,t,r){return this.layout.encode(e,t,r)}}]),r}(L);var Z=function(e){s(r,e);var t=u(r);function r(e,n,i){var a,s;if(c(this,r),e instanceof b||e instanceof w)s=new U(new m(e));else if(e instanceof y&&e.isCount())s=new U(e);else{if(!(e instanceof L))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");s=e}if(void 0===n&&(n=null),!(null===n||n instanceof p))throw new TypeError("defaultLayout must be null or a Layout");if(null!==n){if(0>n.span)throw new Error("defaultLayout must have constant span");void 0===n.property&&(n=n.replicate("content"))}var u=-1;n&&0<=(u=n.span)&&(e instanceof b||e instanceof w)&&(u+=s.layout.span),(a=t.call(this,u,i)).discriminator=s,a.usesPrefixDiscriminator=e instanceof b||e instanceof w,a.defaultLayout=n,a.registry={};var l=a.defaultGetSourceVariant.bind(o(a));return a.getSourceVariant=function(e){return l(e)},a.configGetSourceVariant=function(e){l=e.bind(this)},a}return l(r,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var r=this.getVariant(e,t);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,t)}},{key:"defaultGetSourceVariant",value:function(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;var t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(var r in this.registry){var n=this.registry[r];if(n.property&&Object.prototype.hasOwnProperty.call(e,n.property))return n}throw new Error("unable to infer src variant")}},{key:"decode",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.discriminator,i=n.decode(e,r),o=this.registry[i];if(void 0===o){var a=this.defaultLayout,s=0;this.usesPrefixDiscriminator&&(s=n.layout.span),(t=this.makeDestinationObject())[n.property]=i,t[a.property]=a.decode(e,r+s)}else t=o.decode(e,r);return t}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.getSourceVariant(e);if(void 0===n){var i=this.discriminator,o=this.defaultLayout,a=0;return this.usesPrefixDiscriminator&&(a=i.layout.span),i.encode(e[i.property],t,r),a+o.encode(e[o.property],t,r+a)}return n.encode(e,t,r)}},{key:"addVariant",value:function(e,t,r){var n=new D(this,e,t,r);return this.registry[e]=n,n}},{key:"getVariant",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t=e instanceof Uint8Array?this.discriminator.decode(e,r):e,this.registry[t]}}]),r}(p);var D=function(e){s(r,e);var t=u(r);function r(e,n,i,o){var a;if(c(this,r),!(e instanceof Z))throw new TypeError("union must be a Union");if(!Number.isInteger(n)||0>n)throw new TypeError("variant must be a (non-negative) integer");if("string"===typeof i&&void 0===o&&(o=i,i=null),i){if(!(i instanceof p))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=i.span&&i.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!==typeof o)throw new TypeError("variant must have a String property")}var s=e.span;return 0>e.span&&0<=(s=i?i.span:0)&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span),(a=t.call(this,s,o)).union=e,a.variant=n,a.layout=i||null,a}return l(r,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);var n=0;return this.layout&&(n=this.layout.getSpan(e,t+r)),r+n}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");var n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,t+n):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=0;if(this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,r);var i=n;if(this.layout&&(this.layout.encode(e[this.property],t,r+n),i+=this.layout.getSpan(t,r+n),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}},{key:"fromArray",value:function(e){if(this.layout)return this.layout.fromArray(e)}}]),r}(p);function F(e){return 0>e&&(e+=4294967296),e}var j=function(e){s(r,e);var t=u(r);function r(e,n,i){var o;if(c(this,r),!(e instanceof b||e instanceof w))throw new TypeError("word must be a UInt or UIntBE layout");if("string"===typeof n&&void 0===i&&(i=n,n=!1),41&&void 0!==arguments[1]?arguments[1]:0,r=this.makeDestinationObject(),n=this.word.decode(e,t);this._packedSetValue(n);var i,o=a(this.fields);try{for(o.s();!(i=o.n()).done;){var s=i.value;void 0!==s.property&&(r[s.property]=s.decode(e))}}catch(u){o.e(u)}finally{o.f()}return r}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.word.decode(t,r);this._packedSetValue(n);var i,o=a(this.fields);try{for(o.s();!(i=o.n()).done;){var s=i.value;if(void 0!==s.property){var u=e[s.property];void 0!==u&&s.encode(u)}}}catch(c){o.e(c)}finally{o.f()}return this.word.encode(this._packedGetValue(),t,r)}},{key:"addField",value:function(e,t){var r=new z(this,e,t);return this.fields.push(r),r}},{key:"addBoolean",value:function(e){var t=new H(this,e);return this.fields.push(t),t}},{key:"fieldFor",value:function(e){if("string"!==typeof e)throw new TypeError("property must be string");var t,r=a(this.fields);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.property===e)return n}}catch(i){r.e(i)}finally{r.f()}}}]),r}(p);var z=function(){function e(t,r,n){if(c(this,e),!(t instanceof j))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(r)||0>=r)throw new TypeError("bits must be positive integer");var i=8*t.span,o=t.fields.reduce((function(e,t){return e+t.bits}),0);if(r+o>i)throw new Error("bits too long for span remainder ("+(i-o)+" of "+i+" remain)");this.container=t,this.bits=r,this.valueMask=(1<>>this.start}},{key:"encode",value:function(e){if("number"!==typeof e||!Number.isInteger(e)||e!==F(e&this.valueMask))throw new TypeError(v("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);var t=this.container._packedGetValue(),r=F(e<r&&(r=this.length.decode(e,t)),r}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.span;return 0>r&&(r=this.length.decode(e,t)),d(e).slice(t,t+r)}},{key:"encode",value:function(e,t,r){var n=this.length;if(this.length instanceof y&&(n=e.length),!(e instanceof Uint8Array&&n===e.length))throw new TypeError(v("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>t.length)throw new RangeError("encoding overruns Uint8Array");var i=d(e);return d(t).write(i.toString("hex"),r,n,"hex"),this.length instanceof y&&this.length.encode(n,t,r),n}}]),r}(p);var q=function(e){s(r,e);var t=u(r);function r(e){return c(this,r),t.call(this,-1,e)}return l(r,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;h(e);for(var r=t;r1&&void 0!==arguments[1]?arguments[1]:0,r=this.getSpan(e,t);return d(e).slice(t,t+r-1).toString("utf-8")}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;"string"!==typeof e&&(e=String(e));var n=f.Buffer.from(e,"utf8"),i=n.length;if(r+i>t.length)throw new RangeError("encoding overruns Buffer");var o=d(t);return n.copy(o,r),o[r+i]=0,i+1}}]),r}(p);var K=function(e){s(r,e);var t=u(r);function r(e,n){var i;if(c(this,r),"string"===typeof e&&void 0===n&&(n=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");return(i=t.call(this,-1,n)).maxSpan=e,i}return l(r,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return h(e),e.length-t}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan2&&void 0!==arguments[2]?arguments[2]:0;"string"!==typeof e&&(e=String(e));var n=f.Buffer.from(e,"utf8"),i=n.length;if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return n.copy(d(t),r),i}}]),r}(p);var W=function(e){s(r,e);var t=u(r);function r(e,n){var i;return c(this,r),(i=t.call(this,0,n)).value=e,i}return l(r,[{key:"decode",value:function(e,t){return this.value}},{key:"encode",value:function(e,t,r){return 0}}]),r}(p);t.cv=function(e,t,r){return new m(e,t,r)},t.u8=function(e){return new b(1,e)},t.KB=function(e){return new b(2,e)},t.Jq=function(e){return new b(4,e)},t._O=function(e){return new A(e)},t.gM=function(e){return new R(e)},t.n_=function(e,t,r){return new B(e,t,r)},t.A9=function(e,t,r){return new M(e,t,r)},t.Ik=function(e,t){return new V(e,t)}},468:function(e){"use strict";!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function a(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var s={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},u=function(){var e="0123456789abcdef";return{toBytes:function(e){for(var t=[],r=0;r>4]+e[15&i])}return r.join("")}}}(),c={16:10,24:12,32:14},l=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],f=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],d=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],v=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],m=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],b=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],k=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],_=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],E=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],S=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function x(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,u=i;u>16&255]<<24^f[a>>8&255]<<16^f[255&a]<<8^f[a>>24&255]^l[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^f[a>>16&255]<<16^f[a>>24&255]<<24;for(t=i/2+1;t>2,d=u%4,this._Ke[h][d]=o[t],this._Kd[e-h][d]=o[t++],u++}for(var h=1;h>24&255]^_[a>>16&255]^E[a>>8&255]^S[255&a]},A.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a>24&255]^p[n[(i+1)%4]>>16&255]^v[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[a][i];n=r.slice()}var s,u=o(16);for(i=0;i<4;i++)s=this._Ke[t][i],u[4*i]=255&(f[n[i]>>24&255]^s>>24),u[4*i+1]=255&(f[n[(i+1)%4]>>16&255]^s>>16),u[4*i+2]=255&(f[n[(i+2)%4]>>8&255]^s>>8),u[4*i+3]=255&(f[255&n[(i+3)%4]]^s);return u},A.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a>24&255]^m[n[(i+3)%4]>>16&255]^b[n[(i+2)%4]>>8&255]^w[255&n[(i+1)%4]]^this._Kd[a][i];n=r.slice()}var s,u=o(16);for(i=0;i<4;i++)s=this._Kd[t][i],u[4*i]=255&(h[n[i]>>24&255]^s>>24),u[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^s>>16),u[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),u[4*i+3]=255&(h[255&n[(i+1)%4]]^s);return u};var T=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new A(t)};T.prototype.encrypt=function(e){if((e=i(e)).length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},N.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},N.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var P=function e(t,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",r instanceof N||(r=new N(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new A(t)};P.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){l.headers[e]=n.merge(u)})),e.exports=l},6789:function(e){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},7600:function(e){e.exports={version:"0.27.2"}},4049:function(e){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}})),a):a}},6261:function(e){"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},8089:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},1397:function(e,t,r){"use strict";var n=r(9778).Buffer,i=r(3589);e.exports=function(e,t){t=t||new FormData;var r=[];function o(e){return null===e?"":i.isDate(e)?e.toISOString():i.isArrayBuffer(e)||i.isTypedArray(e)?"function"===typeof Blob?new Blob([e]):n.from(e):e}return function e(n,a){if(i.isPlainObject(n)||i.isArray(n)){if(-1!==r.indexOf(n))throw Error("Circular reference detected in "+a);r.push(n),i.forEach(n,(function(r,n){if(!i.isUndefined(r)){var s,u=a?a+"."+n:n;if(r&&!a&&"object"===typeof r)if(i.endsWith(n,"{}"))r=JSON.stringify(r);else if(i.endsWith(n,"[]")&&(s=i.toArray(r)))return void s.forEach((function(e){!i.isUndefined(e)&&t.append(u,o(e))}));e(r,u)}})),r.pop()}else t.append(a,o(n))}(e),t}},7835:function(e,t,r){"use strict";var n=r(7600).version,i=r(4531),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var a={};o.transitional=function(e,t,r){function o(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new i(o(n," has been removed"+(t?" in "+t:"")),i.ERR_DEPRECATED);return t&&!a[n]&&(a[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},e.exports={assertOptions:function(e,t,r){if("object"!==typeof e)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var a=n[o],s=t[a];if(s){var u=e[a],c=void 0===u||s(u,a,e);if(!0!==c)throw new i("option "+a+" must be "+c,i.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new i("Unknown option "+a,i.ERR_BAD_OPTION)}},validators:o}},3589:function(e,t,r){"use strict";var n,i=r(4049),o=Object.prototype.toString,a=(n=Object.create(null),function(e){var t=o.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())});function s(e){return e=e.toLowerCase(),function(t){return a(t)===e}}function u(e){return Array.isArray(e)}function c(e){return"undefined"===typeof e}var l=s("ArrayBuffer");function f(e){return null!==e&&"object"===typeof e}function h(e){if("object"!==a(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var d=s("Date"),p=s("File"),v=s("Blob"),y=s("FileList");function g(e){return"[object Function]"===o.call(e)}var m=s("URLSearchParams");function b(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),u(e))for(var r=0,n=e.length;r0;)a[o=n[i]]||(t[o]=e[o],a[o]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:s,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;var t=e.length;if(c(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:k,isFileList:y}},2307:function(e,t,r){"use strict";var n=r(2543).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,l=new Uint8Array(a);e[r];){var f=t[e.charCodeAt(r)];if(255===f)return;for(var h=0,d=a-1;(0!==f||h>>0,l[d]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");o=h,r++}for(var p=a-o;p!==a&&0===l[p];)p++;var v=n.allocUnsafe(i+(a-p));v.fill(0,0,i);for(var y=i;p!==a;)v[y++]=l[p++];return v}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,a=t.length;o!==a&&0===t[o];)o++,r++;for(var c=(a-o)*l+1>>>0,f=new Uint8Array(c);o!==a;){for(var h=t[o],d=0,p=c-1;(0!==h||d>>0,f[p]=h%s>>>0,h=h/s>>>0;if(0!==h)throw new Error("Non-zero carry");i=d,o++}for(var v=c-i;v!==c&&0===f[v];)v++;for(var y=u.repeat(r);v0?a-4:a;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,u=n-i;su?u:s+a));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a0)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 c(e,t,n){for(var i,o,a=[],s=t;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},1360:function(e){"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function a(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=o(t)^n>>5}for(t=o(t),r=0;rt)return"Exceeds length limit";var n=e.toLowerCase(),i=e.toUpperCase();if(e!==n&&e!==i)return"Mixed-case string "+e;var s=(e=n).lastIndexOf("1");if(-1===s)return"No separator character for "+e;if(0===s)return"Missing prefix for "+e;var u=e.slice(0,s),c=e.slice(s+1);if(c.length<6)return"Data too short";var l=a(u);if("string"===typeof l)return l;for(var f=[],h=0;h=c.length||f.push(p)}return 1!==l?"Invalid checksum for "+e:{prefix:u,words:f}}function u(e,t,r,n){for(var i=0,o=0,a=(1<=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<=t)return"Excess padding";if(i<n)throw new TypeError("Exceeds length limit");var i=a(e=e.toLowerCase());if("string"===typeof i)throw new Error(i);for(var s=e+"1",u=0;u>5!==0)throw new Error("Non 5-bit word");i=o(i)^c,s+=t.charAt(c)}for(u=0;u<6;++u)i=o(i);for(i^=1,u=0;u<6;++u){s+=t.charAt(i>>5*(5-u)&31)}return s},toWordsUnsafe:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},6070:function(e,t,r){"use strict";var n=r(9778).Buffer;t.oU=function(e){var t=n.from(e);t.reverse();var r=t.toString("hex");return 0===r.length?BigInt(0):BigInt("0x".concat(r))},t.k$=function(e,t){var r=e.toString(16),i=n.from(r.padStart(2*t,"0").slice(0,2*t),"hex");return i.reverse(),i}},518:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.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=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(6601).Buffer}catch(R){}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,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.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 i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=u(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(R){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var h=["","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"],d=[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];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.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=d[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var v=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?v+r:h[c-v.length]+v+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")},o.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},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function v(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.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},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.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 i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.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,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,v=d>>>13,y=0|a[2],g=8191&y,m=y>>>13,b=0|a[3],w=8191&b,k=b>>>13,_=0|a[4],E=8191&_,S=_>>>13,x=0|a[5],A=8191&x,T=x>>>13,R=0|a[6],O=8191&R,I=R>>>13,N=0|a[7],P=8191&N,C=N>>>13,M=0|a[8],B=8191&M,L=M>>>13,U=0|a[9],Z=8191&U,D=U>>>13,F=0|s[0],j=8191&F,z=F>>>13,H=0|s[1],V=8191&H,q=H>>>13,K=0|s[2],W=8191&K,G=K>>>13,$=0|s[3],J=8191&$,Y=$>>>13,X=0|s[4],Q=8191&X,ee=X>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,ve=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(c+(n=Math.imul(f,j))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(h,j)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,j),i=(i=Math.imul(p,z))+Math.imul(v,j)|0,o=Math.imul(v,z);var ge=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,q)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,j),i=(i=Math.imul(g,z))+Math.imul(m,j)|0,o=Math.imul(m,z),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,q)|0;var me=(c+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,W)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(w,j),i=(i=Math.imul(w,z))+Math.imul(k,j)|0,o=Math.imul(k,z),n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,q)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,G)|0;var be=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(E,j),i=(i=Math.imul(E,z))+Math.imul(S,j)|0,o=Math.imul(S,z),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Y)|0;var we=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,j),i=(i=Math.imul(A,z))+Math.imul(T,j)|0,o=Math.imul(T,z),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0;var ke=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(O,j),i=(i=Math.imul(O,z))+Math.imul(I,j)|0,o=Math.imul(I,z),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var _e=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,j),i=(i=Math.imul(P,z))+Math.imul(C,j)|0,o=Math.imul(C,z),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var Ee=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(B,j),i=(i=Math.imul(B,z))+Math.imul(L,j)|0,o=Math.imul(L,z),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,q)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,Y)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var Se=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(Z,j),i=(i=Math.imul(Z,z))+Math.imul(D,j)|0,o=Math.imul(D,z),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,q)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,Y)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,he)|0;var xe=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ve)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,ve)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(Z,V),i=(i=Math.imul(Z,q))+Math.imul(D,V)|0,o=Math.imul(D,q),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0;var Ae=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(Z,W),i=(i=Math.imul(Z,G))+Math.imul(D,W)|0,o=Math.imul(D,G),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,Y)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(k,fe)|0,o=o+Math.imul(k,he)|0;var Te=(c+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,ve)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(Z,J),i=(i=Math.imul(Z,Y))+Math.imul(D,J)|0,o=Math.imul(D,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,n=n+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,he)|0;var Re=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(Z,Q),i=(i=Math.imul(Z,ee))+Math.imul(D,Q)|0,o=Math.imul(D,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(I,ue)|0,o=o+Math.imul(I,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(T,fe)|0,o=o+Math.imul(T,he)|0;var Oe=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ve)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,ve)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(Z,re),i=(i=Math.imul(Z,ne))+Math.imul(D,re)|0,o=Math.imul(D,ne),n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,n=n+Math.imul(O,fe)|0,i=(i=i+Math.imul(O,he)|0)+Math.imul(I,fe)|0,o=o+Math.imul(I,he)|0;var Ie=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ve)|0)+Math.imul(T,pe)|0))<<13)|0;c=((o=o+Math.imul(T,ve)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(Z,oe),i=(i=Math.imul(Z,ae))+Math.imul(D,oe)|0,o=Math.imul(D,ae),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,ce)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,ce)|0,n=n+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,he)|0)+Math.imul(C,fe)|0,o=o+Math.imul(C,he)|0;var Ne=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ve)|0)+Math.imul(I,pe)|0))<<13)|0;c=((o=o+Math.imul(I,ve)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(Z,ue),i=(i=Math.imul(Z,ce))+Math.imul(D,ue)|0,o=Math.imul(D,ce),n=n+Math.imul(B,fe)|0,i=(i=i+Math.imul(B,he)|0)+Math.imul(L,fe)|0,o=o+Math.imul(L,he)|0;var Pe=(c+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ve)|0)+Math.imul(C,pe)|0))<<13)|0;c=((o=o+Math.imul(C,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(Z,fe),i=(i=Math.imul(Z,he))+Math.imul(D,fe)|0,o=Math.imul(D,he);var Ce=(c+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,ve)|0)+Math.imul(L,pe)|0))<<13)|0;c=((o=o+Math.imul(L,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Me=(c+(n=Math.imul(Z,pe))|0)+((8191&(i=(i=Math.imul(Z,ve))+Math.imul(D,pe)|0))<<13)|0;return c=((o=Math.imul(D,ve))+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,u[0]=ye,u[1]=ge,u[2]=me,u[3]=be,u[4]=we,u[5]=ke,u[6]=_e,u[7]=Ee,u[8]=Se,u[9]=xe,u[10]=Ae,u[11]=Te,u[12]=Re,u[13]=Oe,u[14]=Ie,u[15]=Ne,u[16]=Pe,u[17]=Ce,u[18]=Me,0!==c&&(u[19]=c,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function m(e,t,r){return g(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(y=v),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):r<63?v(this,e,t):r<1024?g(this,e,t):m(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=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 i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.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>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(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 o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.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),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.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 i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,v=1;0===(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.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 i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,h=1;0===(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >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(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.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 i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(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 i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new A(e)},o.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)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function k(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){k.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){k.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){k.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"===typeof e){var t=o._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 T(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}k.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},k.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=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},k.prototype.split=function(e,t){e.iushrn(this.n,0,t)},k.prototype.imulK=function(e){return e.imul(this.k)},i(_,k),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},_.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>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new E;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return w[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.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)},A.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},A.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)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.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 o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var v=d,y=0;0!==v.cmp(s);y++)v=v.redSqr();n(y=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===n&&0===l)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},i(T,A),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.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),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},5127:function(e,t,r){"use strict";var n=r(9778).Buffer,i=r(8416).default,o=r(7424).default,a=r(4704).default,s=r(6690).default,u=r(9728).default,c=r(1655).default,l=r(6389).default,f=r(3496).default,h=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),d=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),p=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<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--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},v=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&h(t,e,r);return d(t,e),t},y=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeUnchecked=t.deserialize=t.serialize=t.BinaryReader=t.BinaryWriter=t.BorshError=t.baseDecode=t.baseEncode=void 0;var g=y(r(518)),m=y(r(6315)),b=v(r(9344)),w=new("function"!==typeof TextDecoder?b.TextDecoder:TextDecoder)("utf-8",{fatal:!0});t.baseEncode=function(e){return"string"===typeof e&&(e=n.from(e,"utf8")),m.default.encode(n.from(e))},t.baseDecode=function(e){return n.from(m.default.decode(e))};var k=1024,_=function(e){c(r,e);var t=l(r);function r(e){var n;return s(this,r),(n=t.call(this,e)).fieldPath=[],n.originalMessage=e,n}return u(r,[{key:"addToFieldPath",value:function(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}]),r}(f(Error));t.BorshError=_;var E=function(){function e(){s(this,e),this.buf=n.alloc(k),this.length=0}return u(e,[{key:"maybeResize",value:function(){this.buf.length<16+this.length&&(this.buf=n.concat([this.buf,n.alloc(k)]))}},{key:"writeU8",value:function(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}},{key:"writeU16",value:function(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}},{key:"writeU32",value:function(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}},{key:"writeU64",value:function(e){this.maybeResize(),this.writeBuffer(n.from(new g.default(e).toArray("le",8)))}},{key:"writeU128",value:function(e){this.maybeResize(),this.writeBuffer(n.from(new g.default(e).toArray("le",16)))}},{key:"writeU256",value:function(e){this.maybeResize(),this.writeBuffer(n.from(new g.default(e).toArray("le",32)))}},{key:"writeU512",value:function(e){this.maybeResize(),this.writeBuffer(n.from(new g.default(e).toArray("le",64)))}},{key:"writeBuffer",value:function(e){this.buf=n.concat([n.from(this.buf.subarray(0,this.length)),e,n.alloc(k)]),this.length+=e.length}},{key:"writeString",value:function(e){this.maybeResize();var t=n.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}},{key:"writeFixedArray",value:function(e){this.writeBuffer(n.from(e))}},{key:"writeArray",value:function(e,t){this.maybeResize(),this.writeU32(e.length);var r,n=a(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;this.maybeResize(),t(i)}}catch(o){n.e(o)}finally{n.f()}}},{key:"toArray",value:function(){return this.buf.subarray(0,this.length)}}]),e}();function S(e,t,r){var n=r.value;r.value=function(){try{for(var e=arguments.length,t=new Array(e),r=0;r=0)throw new _("Reached the end of buffer when deserializing")}throw o}}}t.BinaryWriter=E;var x=function(){function e(t){s(this,e),this.buf=t,this.offset=0}return u(e,[{key:"readU8",value:function(){var e=this.buf.readUInt8(this.offset);return this.offset+=1,e}},{key:"readU16",value:function(){var e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}},{key:"readU32",value:function(){var e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}},{key:"readU64",value:function(){var e=this.readBuffer(8);return new g.default(e,"le")}},{key:"readU128",value:function(){var e=this.readBuffer(16);return new g.default(e,"le")}},{key:"readU256",value:function(){var e=this.readBuffer(32);return new g.default(e,"le")}},{key:"readU512",value:function(){var e=this.readBuffer(64);return new g.default(e,"le")}},{key:"readBuffer",value:function(e){if(this.offset+e>this.buf.length)throw new _("Expected buffer length ".concat(e," isn't within bounds"));var t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}},{key:"readString",value:function(){var e=this.readU32(),t=this.readBuffer(e);try{return w.decode(t)}catch(r){throw new _("Error decoding UTF-8 string: ".concat(r))}}},{key:"readFixedArray",value:function(e){return new Uint8Array(this.readBuffer(e))}},{key:"readArray",value:function(e){for(var t=this.readU32(),r=Array(),n=0;n=n.values.length)throw new _("Enum index: ".concat(d," is out of range"));var p=o(n.values[d],2),v=p[0],y=O(e,v,p[1],r);return new t(i({},v,y))}throw new _("Unexpected schema kind: ".concat(n.kind," for ").concat(t.constructor.name))}p([S],x.prototype,"readU8",null),p([S],x.prototype,"readU16",null),p([S],x.prototype,"readU32",null),p([S],x.prototype,"readU64",null),p([S],x.prototype,"readU128",null),p([S],x.prototype,"readU256",null),p([S],x.prototype,"readU512",null),p([S],x.prototype,"readString",null),p([S],x.prototype,"readFixedArray",null),p([S],x.prototype,"readArray",null),t.BinaryReader=x,t.serialize=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E,n=new r;return R(e,t,n),n.toArray()},t.deserialize=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:x,i=new n(r),o=I(e,t,i);if(i.offset3&&void 0!==arguments[3]?arguments[3]:x,i=new n(r);return I(e,t,i)}},6315:function(e,t,r){var n=r(2307);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},9778:function(e,t,r){"use strict";var n=r(6690).default,i=r(9728).default,o=r(6115).default,a=r(1655).default,s=r(6389).default,u=r(2009),c=r(4038),l="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=d,t.SlowBuffer=function(e){+e!=e&&(e=0);return d.alloc(+e)},t.INSPECT_MAX_BYTES=50;var f=2147483647;function h(e){if(e>f)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,d.prototype),t}function d(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 y(e)}return p(e,t,r)}function p(e,t,r){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!d.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|w(e,t),n=h(r),i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(ee(e,Uint8Array)){var t=new Uint8Array(e);return m(t.buffer,t.byteOffset,t.byteLength)}return g(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(ee(e,ArrayBuffer)||e&&ee(e.buffer,ArrayBuffer))return m(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&(ee(e,SharedArrayBuffer)||e&&ee(e.buffer,SharedArrayBuffer)))return m(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return d.from(n,t,r);var i=function(e){if(d.isBuffer(e)){var t=0|b(e.length),r=h(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!==typeof e.length||te(e.length)?h(0):g(e);if("Buffer"===e.type&&Array.isArray(e.data))return g(e.data)}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return d.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 v(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 y(e){return v(e),h(e<0?0:0|b(e))}function g(e){for(var t=e.length<0?0:0|b(e.length),r=h(t),n=0;n=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|e}function w(e,t){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ee(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);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return X(e).length;default:if(i)return n?-1:Y(e).length;t=(""+t).toLowerCase(),i=!0}}function k(e,t,r){var 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 B(this,t,r);case"utf8":case"utf-8":return N(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return M(this,t,r);case"base64":return I(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function _(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function E(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),te(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=d.from(t,n)),d.isBuffer(t))return 0===t.length?-1:S(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):S(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function S(e,t,r,n,i){var o,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(i){var l=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var f=!0,h=0;hi&&(n=i):n=i;var o,a=t.length;for(n>a/2&&(n=a/2),o=0;o>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function I(e,t,r){return 0===t&&r===e.length?u.fromByteArray(e):u.fromByteArray(e.slice(t,r))}function N(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:o>223?3:o>191?2:1;if(i+s<=r){var u=void 0,c=void 0,l=void 0,f=void 0;switch(s){case 1:o<128&&(a=o);break;case 2:128===(192&(u=e[i+1]))&&(f=(31&o)<<6|63&u)>127&&(a=f);break;case 3:u=e[i+1],c=e[i+2],128===(192&u)&&128===(192&c)&&(f=(15&o)<<12|(63&u)<<6|63&c)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:u=e[i+1],c=e[i+2],l=e[i+3],128===(192&u)&&128===(192&c)&&128===(192&l)&&(f=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&l)>65535&&f<1114112&&(a=f)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nn.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else{if(!d.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},d.byteLength=w,d.prototype._isBuffer=!0,d.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},l&&(d.prototype[l]=d.prototype.inspect),d.prototype.compare=function(e,t,r,n,i){if(ee(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=e.slice(t,r),l=0;l>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return R(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function C(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function Z(e,t,r,n,i,o){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function D(e,t,r,n,i){W(t,n,i,e,r,7);var o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;var 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 F(e,t,r,n,i){W(t,n,i,e,r,7);var o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;var 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 j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function z(e,t,r,n,i){return t=+t,r>>>=0,i||j(e,0,r,4),c.write(e,t,r,n,23,4),r+4}function H(e,t,r,n,i){return t=+t,r>>>=0,i||j(e,0,r,8),c.write(e,t,r,n,52,8),r+8}d.prototype.slice=function(e,t){var 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>>=0,t>>>=0,r||U(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||U(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},d.prototype.readUint8=d.prototype.readUInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readBigUInt64LE=ne((function(e){G(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),i=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],i=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,t>>>=0,r||U(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},d.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},d.prototype.readInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||U(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt16BE=function(e,t){e>>>=0,t||U(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readBigInt64LE=ne((function(e){G(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<>>=0,t||U(e,4,this.length),c.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||U(e,4,this.length),c.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||U(e,8,this.length),c.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||U(e,8,this.length),c.read(this,e,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||Z(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n)||Z(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},d.prototype.writeUint8=d.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,1,255,0),this[t]=255&e,t+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||Z(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},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||Z(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},d.prototype.writeBigUInt64LE=ne((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeBigUInt64BE=ne((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);Z(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},d.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);Z(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},d.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},d.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||Z(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},d.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||Z(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},d.prototype.writeBigInt64LE=ne((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeBigInt64BE=ne((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeFloatLE=function(e,t,r){return z(this,e,t,!0,r)},d.prototype.writeFloatBE=function(e,t,r){return z(this,e,t,!1,r)},d.prototype.writeDoubleLE=function(e,t,r){return H(this,e,t,!0,r)},d.prototype.writeDoubleBE=function(e,t,r){return H(this,e,t,!1,r)},d.prototype.copy=function(e,t,r,n){if(!d.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=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>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(o=t;o=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function W(e,t,r,n,i,o){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(o+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(o+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(o+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(r).concat(s),new V.ERR_OUT_OF_RANGE("value",a,e)}!function(e,t,r){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||$(t,e.length-(r+1))}(n,i,o)}function G(e,t){if("number"!==typeof e)throw new V.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,r){if(Math.floor(e)!==e)throw G(e,r),new V.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new V.ERR_BUFFER_OUT_OF_BOUNDS;throw new V.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(typeof t)}),TypeError),q("ERR_OUT_OF_RANGE",(function(e,t,r){var n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=K(String(r)):"bigint"===typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=K(i)),i+="n"),n+=" It must be ".concat(t,". Received ").concat(i)}),RangeError);var J=/[^+/0-9A-Za-z-_]/g;function Y(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(e){return u.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function Q(e,t,r,n){var i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function ee(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function te(e){return e!==e}var re=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}();function ne(e){return"undefined"===typeof BigInt?ie:e}function ie(){throw new Error("BigInt not supported")}},4057:function(e,t,r){r(1330).check("es5")},1330:function(e,t,r){r(2083),e.exports=r(7078)},7652:function(e){var t=function(){this.tests={},this.cache={}};t.prototype={constructor:t,define:function(e,t){if("string"!=typeof e||!(t instanceof Function))throw new Error("Invalid capability definition.");if(this.tests[e])throw new Error('Duplicated capability definition by "'+e+'".');this.tests[e]=t},check:function(e){if(!this.test(e))throw new Error('The current environment does not support "'+e+'", therefore we cannot continue.')},test:function(e){if(void 0!==this.cache[e])return this.cache[e];if(!this.tests[e])throw new Error('Unknown capability with name "'+e+'".');var t=this.tests[e];return this.cache[e]=!!t(),this.cache[e]}},e.exports=t},2083:function(e,t,r){var n=r(7078),i=n.define,o=n.test;i("strict mode",(function(){return void 0===this})),i("arguments.callee.caller",(function(){try{return function(){return arguments.callee.caller}()===arguments.callee}catch(e){return!1}})),i("es5",(function(){return o("Array.prototype.forEach")&&o("Array.prototype.map")&&o("Function.prototype.bind")&&o("Object.create")&&o("Object.defineProperties")&&o("Object.defineProperty")&&o("Object.prototype.hasOwnProperty")})),i("Array.prototype.forEach",(function(){return Array.prototype.forEach})),i("Array.prototype.map",(function(){return Array.prototype.map})),i("Function.prototype.bind",(function(){return Function.prototype.bind})),i("Object.create",(function(){return Object.create})),i("Object.defineProperties",(function(){return Object.defineProperties})),i("Object.defineProperty",(function(){return Object.defineProperty})),i("Object.prototype.hasOwnProperty",(function(){return Object.prototype.hasOwnProperty})),i("Error.captureStackTrace",(function(){return Error.captureStackTrace})),i("Error.prototype.stack",(function(){try{throw new Error}catch(e){return e.stack||e.stacktrace}}))},7078:function(e,t,r){var n=new(r(7652)),i=function(e){return n.test(e)};i.define=function(e,t){n.define(e,t)},i.check=function(e){n.check(e)},i.test=i,e.exports=i},4031:function(e){"use strict";function t(e,t){if("function"!==typeof e)throw new TypeError("argument fn must be a function");return e}function r(e,t,r){if(!e||"object"!==typeof e&&"function"!==typeof e)throw new TypeError("argument obj must be object");var n=Object.getOwnPropertyDescriptor(e,t);if(!n)throw new TypeError("must call property on owner object");if(!n.configurable)throw new TypeError("property must be configurable")}e.exports=function(e){if(!e)throw new TypeError("argument namespace is required");function n(e){}return n._file=void 0,n._ignored=!0,n._namespace=e,n._traced=!1,n._warned=Object.create(null),n.function=t,n.property=r,n}},1890:function(e,t,r){e.exports=r(1351)},1351:function(e,t,r){r(4057);var n,i=r(1330);n=i("Error.captureStackTrace")?r(5049):i("Error.prototype.stack")?r(792):r(5419),e.exports=n()},7574:function(e,t,r){var n=r(4381).Class,i=r(4381).abstractMethod,o=n(Object,{prototype:{init:n.prototype.merge,frameString:void 0,toString:function(){return this.frameString},functionValue:void 0,getThis:i,getTypeName:i,getFunction:function(){return this.functionValue},getFunctionName:i,getMethodName:i,getFileName:i,getLineNumber:i,getColumnNumber:i,getEvalOrigin:i,isTopLevel:i,isEval:i,isNative:i,isConstructor:i}});e.exports=o},5981:function(e,t,r){var n=r(4381).Class,i=r(7574),o=r(1710).cache,a=n(Object,{prototype:{stackParser:null,frameParser:null,locationParsers:null,constructor:function(e){n.prototype.merge.call(this,e)},getFrames:function(e,t){for(var r=[],n=0,i=e.length;n0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){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 f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[e];if(void 0===u)return!1;if("function"===typeof u)n(u,this,t);else{var c=u.length,l=p(u,c);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},3125:function(e,t,r){var n=t;n.utils=r(9046),n.common=r(9684),n.sha=r(9194),n.ripemd=r(6645),n.hmac=r(3609),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},9684:function(e,t,r){"use strict";var n=r(9046),i=r(2325);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.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 i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;othis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},9046:function(e,t,r){"use strict";var n=r(2325),i=r(2534);function o(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=i,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),i=0;i>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,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,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t;return u+=(c=c+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var l=0,f=t;return l+=(f=f+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+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}},4038:function(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+e[t+f],f+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=c}return(d?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,v=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=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,c-=8);e[r+d-p]|=128*v}},2534:function(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}}},9976:function(e,t,r){"use strict";var n=r(3431).v4,i=r(9353),o=function e(t,r){if(!(this instanceof e))return new e(t,r);r||(r={}),this.options={reviver:"undefined"!==typeof r.reviver?r.reviver:null,replacer:"undefined"!==typeof r.replacer?r.replacer:null,generator:"undefined"!==typeof r.generator?r.generator:function(){return n()},version:"undefined"!==typeof r.version?r.version:2,notificationIdNull:"boolean"===typeof r.notificationIdNull&&r.notificationIdNull},this.callServer=t};e.exports=o,o.prototype.request=function(e,t,r,n){var o,a=this,s=null,u=Array.isArray(e)&&"function"===typeof t;if(1===this.options.version&&u)throw new TypeError("JSON-RPC 1.0 does not support batching");if(u||!u&&e&&"object"===typeof e&&"function"===typeof t)n=t,s=e;else{"function"===typeof r&&(n=r,r=void 0);var c="function"===typeof n;try{s=i(e,t,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(l){if(c)return n(l);throw l}if(!c)return s}try{o=JSON.stringify(s,this.options.replacer)}catch(l){return n(l)}return this.callServer(o,(function(e,t){a._parseResponse(e,t,n)})),s},o.prototype._parseResponse=function(e,t,r){if(e)r(e);else{if(!t)return r();var n;try{n=JSON.parse(t,this.options.reviver)}catch(e){return r(e)}if(3===r.length){if(Array.isArray(n)){var i=function(e){return"undefined"!==typeof e.error};return r(null,n.filter(i),n.filter((function(e){return!i(e)})))}return r(null,n.error,n.result)}r(null,n)}}},9353:function(e,t,r){"use strict";var n=r(3431).v4;e.exports=function(e,t,r,i){if("string"!==typeof e)throw new TypeError(e+" must be a string");var o="number"===typeof(i=i||{}).version?i.version:2;if(1!==o&&2!==o)throw new TypeError(o+" must be 1 or 2");var a={method:e};if(2===o&&(a.jsonrpc="2.0"),t){if("object"!==typeof t&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");a.params=t}if("undefined"===typeof r){var s="function"===typeof i.generator?i.generator:function(){return n()};a.id=s(a,i)}else 2===o&&null===r?i.notificationIdNull&&(a.id=null):a.id=r;return a}},4981:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_RESULT__;(function(){"use strict";var ERROR="input is invalid type",WINDOW="object"===typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"===typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"===typeof process&&process.versions&&process.versions.node;NODE_JS?root=__webpack_require__.g:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,AMD=__webpack_require__.amdO,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e,t){return function(r){return new Sha256(t,!0).update(r)[e]()}},createMethod=function(e){var t=createOutputMethod("hex",e);NODE_JS&&(t=nodeWrap(t,e)),t.create=function(){return new Sha256(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r>6,a[u++]=128|63&o):o<55296||o>=57344?(a[u++]=224|o>>12,a[u++]=128|o>>6&63,a[u++]=128|63&o):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++n)),a[u++]=240|o>>18,a[u++]=128|o>>12&63,a[u++]=128|o>>6&63,a[u++]=128|63&o);e=a}else{if("object"!==i)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw new Error(ERROR)}e.length>64&&(e=new Sha256(t,!0).update(e).array());var c=[],l=[];for(n=0;n<64;++n){var f=e[n]||0;c[n]=92^f,l[n]=54^f}Sha256.call(this,t,r),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw new Error(ERROR);t=!0}for(var n,i,o=0,a=e.length,s=this.blocks;o>2]|=e[o]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[i>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=64?(this.block=s[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var e,t,r,n,i,o,a,s,u,c=this.h0,l=this.h1,f=this.h2,h=this.h3,d=this.h4,p=this.h5,v=this.h6,y=this.h7,g=this.blocks;for(e=16;e<64;++e)t=((i=g[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,r=((i=g[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,g[e]=g[e-16]+t+g[e-7]+r<<0;for(u=l&f,e=0;e<64;e+=4)this.first?(this.is224?(o=300032,y=(i=g[0]-1413257819)-150054599<<0,h=i+24177077<<0):(o=704751109,y=(i=g[0]-210244248)-1521486534<<0,h=i+143694565<<0),this.first=!1):(t=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),n=(o=c&l)^c&f^u,y=h+(i=y+(r=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&p^~d&v)+K[e]+g[e])<<0,h=i+(t+n)<<0),t=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),n=(a=h&c)^h&l^o,v=f+(i=v+(r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&d^~y&p)+K[e+1]+g[e+1])<<0,t=((f=i+(t+n)<<0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(s=f&h)^f&c^a,p=l+(i=p+(r=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&y^~v&d)+K[e+2]+g[e+2])<<0,t=((l=i+(t+n)<<0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(u=l&f)^l&h^s,d=c+(i=d+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&v^~p&y)+K[e+3]+g[e+3])<<0,c=i+(t+n)<<0;this.h0=this.h0+c<<0,this.h1=this.h1+l<<0,this.h2=this.h2+f<<0,this.h3=this.h3+h<<0,this.h4=this.h4+d<<0,this.h5=this.h5+p<<0,this.h6=this.h6+v<<0,this.h7=this.h7+y<<0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,u=HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a];return this.is224||(u+=HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]),u},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,u=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,a>>24&255,a>>16&255,a>>8&255,255&a];return this.is224||u.push(s>>24&255,s>>16&255,s>>8&255,255&s),u},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()},7898:function(e,t,r){var n;!function(){"use strict";var i="input is invalid type",o="object"===typeof window,a=o?window:{};a.JS_SHA3_NO_WINDOW&&(o=!1);var s=!o&&"object"===typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"===typeof process&&process.versions&&process.versions.node?a=r.g:s&&(a=self);var u=!a.JS_SHA3_NO_COMMON_JS&&e.exports,c=r.amdO,l=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,f="0123456789abcdef".split(""),h=[4,1024,262144,67108864],d=[0,8,16,24],p=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],y=[128,256],g=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var b=function(e,t,r){return function(n){return new M(e,t,e).update(n)[r]()}},w=function(e,t,r){return function(n,i){return new M(e,t,i).update(n)[r]()}},k=function(e,t,r){return function(t,n,i,o){return A["cshake"+e].update(t,n,i,o)[r]()}},_=function(e,t,r){return function(t,n,i,o){return A["kmac"+e].update(t,n,i,o)[r]()}},E=function(e,t,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function B(e,t,r){M.call(this,e,t,r)}M.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var n,o,a=this.blocks,s=this.byteCount,u=e.length,c=this.blockCount,f=0,h=this.s;f>2]|=e[f]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[n>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=s){for(this.start=n-s,this.block=a[c],n=0;n>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},M.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}var n=0,o=e.length;if(t)n=o;else for(var a=0;a=57344?n+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(e),n},M.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];a%t===0&&(L(r),o=0)}return i&&(e=r[o],s+=f[e>>4&15]+f[15&e],i>1&&(s+=f[e>>12&15]+f[e>>8&15]),i>2&&(s+=f[e>>20&15]+f[e>>16&15])),s},M.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r===0&&L(n)}return o&&(e=s<<2,t=n[a],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},B.prototype=new M,B.prototype.finalize=function(){return this.encode(this.outputBits,!0),M.prototype.finalize.call(this)};var L=function(e){var t,r,n,i,o,a,s,u,c,l,f,h,d,v,y,g,m,b,w,k,_,E,S,x,A,T,R,O,I,N,P,C,M,B,L,U,Z,D,F,j,z,H,V,q,K,W,G,$,J,Y,X,Q,ee,te,re,ne,ie,oe,ae,se,ue,ce,le;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(l<<1|f>>>31),r=s^(f<<1|l>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(h<<1|d>>>31),r=c^(d<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=l^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],y=e[1],W=e[11]<<4|e[10]>>>28,G=e[10]<<4|e[11]>>>28,O=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,N=e[33]<<13|e[32]>>>19,P=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,U=e[14]<<6|e[15]>>>26,Z=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,C=e[45]<<29|e[44]>>>3,M=e[44]<<29|e[45]>>>3,x=e[6]<<28|e[7]>>>4,A=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,D=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,k=e[36]<<21|e[37]>>>11,_=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,q=e[8]<<27|e[9]>>>5,K=e[9]<<27|e[8]>>>5,T=e[18]<<20|e[19]>>>12,R=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,j=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=v^~g&b,e[1]=y^~m&w,e[10]=x^~T&O,e[11]=A^~R&I,e[20]=B^~U&D,e[21]=L^~Z&F,e[30]=q^~W&$,e[31]=K^~G&J,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=g^~b&k,e[3]=m^~w&_,e[12]=T^~O&N,e[13]=R^~I&P,e[22]=U^~D&j,e[23]=Z^~F&z,e[32]=W^~$&Y,e[33]=G^~J&X,e[42]=ne^~oe&se,e[43]=ie^~ae&ue,e[4]=b^~k&E,e[5]=w^~_&S,e[14]=O^~N&C,e[15]=I^~P&M,e[24]=D^~j&H,e[25]=F^~z&V,e[34]=$^~Y&Q,e[35]=J^~X&ee,e[44]=oe^~se&ce,e[45]=ae^~ue&le,e[6]=k^~E&v,e[7]=_^~S&y,e[16]=N^~C&x,e[17]=P^~M&A,e[26]=j^~H&B,e[27]=z^~V&L,e[36]=Y^~Q&q,e[37]=X^~ee&K,e[46]=se^~ce&te,e[47]=ue^~le&re,e[8]=E^~v&g,e[9]=S^~y&m,e[18]=C^~x&T,e[19]=M^~A&R,e[28]=H^~B&U,e[29]=V^~L&Z,e[38]=Q^~q&W,e[39]=ee^~K&G,e[48]=ce^~te&ne,e[49]=le^~re&ie,e[0]^=p[n],e[1]^=p[n+1]};if(u)e.exports=A;else{for(R=0;R":">",'"':""","'":"'","/":"/","`":"`","=":"="};function h(e){return String(e).replace(/[&<>"'`=\/]/g,(function(e){return f[e]}))}var d=/\s*/,p=/\s+/,v=/\s*=/,y=/\s*\}/,g=/#|\^|\/|>|\{|&|=|!/;function m(e,r){if(!e)return[];var n,o,a,s=!1,u=[],c=[],f=[],h=!1,m=!1,_="",E=0;function x(){if(h&&!m)for(;f.length;)delete c[f.pop()];else f=[];h=!1,m=!1}function A(e){if("string"===typeof e&&(e=e.split(p,2)),!t(e)||2!==e.length)throw new Error("Invalid tags: "+e);n=new RegExp(i(e[0])+"\\s*"),o=new RegExp("\\s*"+i(e[1])),a=new RegExp("\\s*"+i("}"+e[1]))}A(r||S.tags);for(var T,R,O,I,N,P,C=new k(e);!C.eos();){if(T=C.pos,O=C.scanUntil(n))for(var M=0,B=O.length;M0?i[i.length-1][4]:r;break;default:n.push(t)}return r}function k(e){this.string=e,this.tail=e,this.pos=0}function _(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function E(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}k.prototype.eos=function(){return""===this.tail},k.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r},k.prototype.scanUntil=function(e){var t,r=this.tail.search(e);switch(r){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t},_.prototype.push=function(e){return new _(e,this)},_.prototype.lookup=function(e){var t,n=this.cache;if(n.hasOwnProperty(e))t=n[e];else{for(var i,s,u,c=this,l=!1;c;){if(e.indexOf(".")>0)for(i=c.view,s=e.split("."),u=0;null!=i&&u"===a?s=this.renderPartial(o,t,r,i):"&"===a?s=this.unescapedValue(o,t):"name"===a?s=this.escapedValue(o,t,i):"text"===a&&(s=this.rawValue(o)),void 0!==s&&(u+=s);return u},E.prototype.renderSection=function(e,n,i,o,a){var s=this,u="",c=n.lookup(e[1]);function l(e){return s.render(e,n,i,a)}if(c){if(t(c))for(var f=0,h=c.length;f0||!r)&&(i[o]=n+i[o]);return i.join("\n")},E.prototype.renderPartial=function(e,t,n,i){if(n){var o=this.getConfigTags(i),a=r(n)?n(e[1]):n[e[1]];if(null!=a){var s=e[6],u=e[5],c=e[4],l=a;0==u&&c&&(l=this.indentPartial(a,c,s));var f=this.parse(l,o);return this.renderTokens(f,t,n,l,i)}}},E.prototype.unescapedValue=function(e,t){var r=t.lookup(e[1]);if(null!=r)return r},E.prototype.escapedValue=function(e,t,r){var n=this.getConfigEscape(r)||S.escape,i=t.lookup(e[1]);if(null!=i)return"number"===typeof i&&n===S.escape?String(i):n(i)},E.prototype.rawValue=function(e){return e[1]},E.prototype.getConfigTags=function(e){return t(e)?e:e&&"object"===typeof e?e.tags:void 0},E.prototype.getConfigEscape=function(e){return e&&"object"===typeof e&&!t(e)?e.escape:void 0};var S={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){x.templateCache=e},get templateCache(){return x.templateCache}},x=new E;return S.clearCache=function(){return x.clearCache()},S.parse=function(e,t){return x.parse(e,t)},S.render=function(e,t,r,i){if("string"!==typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+n(e)+'" was given as the first argument for mustache#render(template, view, partials)');return x.render(e,t,r,i)},S.escape=h,S.Scanner=k,S.Context=_,S.Writer=E,S}()},5458:function(e,t,r){"use strict";var n=r(9778).Buffer,i=r(861).default,o=r(7424).default,a=r(4704).default,s=r(7061).default,u=r(6690).default,c=r(9728).default,l=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(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())}))},f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;var h=f(r(518)),d=f(r(4031)),p=r(2362),v=r(9170),y=r(5127),g=r(3950),m=r(4024),b=r(1502),w=r(324),k=f(r(6437));function _(e){return JSON.parse(n.from(e).toString())}function E(e){return n.from(JSON.stringify(e))}var S=function(){function e(t,r){u(this,e),this.accessKeyByPublicKeyCache={},this.connection=t,this.accountId=r}return c(e,[{key:"state",value:function(){return l(this,void 0,void 0,s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connection.provider.query({request_type:"view_account",account_id:this.accountId,finality:"optimistic"}));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"printLogsAndFailures",value:function(e,t){if(!{NODE_ENV:"production",PUBLIC_URL:"/face-sample-dapp",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NEAR_NO_LOGS){var r,n=a(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;console.log("Receipt".concat(i.receiptIds.length>1?"s":"",": ").concat(i.receiptIds.join(", "))),this.printLogs(e,i.logs,"\t"),i.failure&&console.warn("\tFailure [".concat(e,"]: ").concat(i.failure))}}catch(o){n.e(o)}finally{n.f()}}}},{key:"printLogs",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(!{NODE_ENV:"production",PUBLIC_URL:"/face-sample-dapp",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NEAR_NO_LOGS){var n,i=a(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;console.log("".concat(r,"Log [").concat(e,"]: ").concat(o))}}catch(s){i.e(s)}finally{i.f()}}}},{key:"signTransaction",value:function(e,t){return l(this,void 0,void 0,s().mark((function r(){var n,i,o,a,u;return s().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.findAccessKey(e,t);case 2:if(n=r.sent){r.next=5;break}throw new v.TypedError("Can not sign transactions for account ".concat(this.accountId," on network ").concat(this.connection.networkId,", no matching key pair exists for this account"),"KeyNotFound");case 5:return i=n.accessKey,r.next=8,this.connection.provider.block({finality:"final"});case 8:return o=r.sent,a=o.header.hash,u=i.nonce.add(new h.default(1)),r.next=13,(0,p.signTransaction)(e,u,t,(0,y.baseDecode)(a),this.connection.signer,this.accountId,this.connection.networkId);case 13:return r.abrupt("return",r.sent);case 14:case"end":return r.stop()}}),r,this)})))}},{key:"signAndSendTransaction",value:function(e){var t=e.receiverId,r=e.actions,n=e.returnError;return l(this,void 0,void 0,s().mark((function e(){var a,u,c,f,h=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,k.default)(500,12,1.5,(function(){return l(h,void 0,void 0,s().mark((function e(){var n,i,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.signTransaction(t,r);case 2:return n=e.sent,i=o(n,2),a=i[0],u=i[1],c=u.transaction.publicKey,e.prev=7,e.next=10,this.connection.provider.sendTransaction(u);case 10:return e.abrupt("return",e.sent);case 13:if(e.prev=13,e.t0=e.catch(7),"InvalidNonce"!==e.t0.type){e.next=19;break}return(0,m.logWarning)("Retrying transaction ".concat(t,":").concat((0,y.baseEncode)(a)," with new nonce.")),delete this.accessKeyByPublicKeyCache[c.toString()],e.abrupt("return",null);case 19:if("Expired"!==e.t0.type){e.next=22;break}return(0,m.logWarning)("Retrying transaction ".concat(t,":").concat((0,y.baseEncode)(a)," due to expired block hash")),e.abrupt("return",null);case 22:throw e.t0.context=new v.ErrorContext((0,y.baseEncode)(a)),e.t0;case 24:case"end":return e.stop()}}),e,this,[[7,13]])})))}));case 2:if(c=e.sent){e.next=5;break}throw new v.TypedError("nonce retries exceeded for transaction. This usually means there are too many parallel requests with the same access key.","RetriesExceeded");case 5:if(f=[c.transaction_outcome].concat(i(c.receipts_outcome)).reduce((function(e,t){return t.outcome.logs.length||"object"===typeof t.outcome.status&&"object"===typeof t.outcome.status.Failure?e.concat({receiptIds:t.outcome.receipt_ids,logs:t.outcome.logs,failure:"undefined"!=typeof t.outcome.status.Failure?(0,b.parseRpcError)(t.outcome.status.Failure):null}):e}),[]),this.printLogsAndFailures(u.transaction.receiverId,f),n||"object"!==typeof c.status||"object"!==typeof c.status.Failure||null===c.status.Failure){e.next=13;break}if(!c.status.Failure.error_message||!c.status.Failure.error_type){e.next=12;break}throw new v.TypedError("Transaction ".concat(c.transaction_outcome.id," failed. ").concat(c.status.Failure.error_message),c.status.Failure.error_type);case 12:throw(0,b.parseResultError)(c);case 13:return e.abrupt("return",c);case 14:case"end":return e.stop()}}),e,this)})))}},{key:"findAccessKey",value:function(e,t){return l(this,void 0,void 0,s().mark((function e(){var t,r,n,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.connection.signer.getPublicKey(this.accountId,this.connection.networkId);case 2:if(t=e.sent){e.next=5;break}throw new v.TypedError("no matching key pair found in ".concat(this.connection.signer),"PublicKeyNotFound");case 5:if(void 0===(r=this.accessKeyByPublicKeyCache[t.toString()])){e.next=8;break}return e.abrupt("return",{publicKey:t,accessKey:r});case 8:return e.prev=8,e.next=11,this.connection.provider.query({request_type:"view_access_key",account_id:this.accountId,public_key:t.toString(),finality:"optimistic"});case 11:if(n=e.sent,i=Object.assign(Object.assign({},n),{nonce:new h.default(n.nonce)}),!this.accessKeyByPublicKeyCache[t.toString()]){e.next=15;break}return e.abrupt("return",{publicKey:t,accessKey:this.accessKeyByPublicKeyCache[t.toString()]});case 15:return this.accessKeyByPublicKeyCache[t.toString()]=i,e.abrupt("return",{publicKey:t,accessKey:i});case 19:if(e.prev=19,e.t0=e.catch(8),"AccessKeyDoesNotExist"!=e.t0.type){e.next=23;break}return e.abrupt("return",null);case 23:throw e.t0;case 24:case"end":return e.stop()}}),e,this,[[8,19]])})))}},{key:"createAndDeployContract",value:function(t,r,n,i){return l(this,void 0,void 0,s().mark((function o(){var a,u;return s().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return a=(0,p.fullAccessKey)(),o.next=3,this.signAndSendTransaction({receiverId:t,actions:[(0,p.createAccount)(),(0,p.transfer)(i),(0,p.addKey)(g.PublicKey.from(r),a),(0,p.deployContract)(n)]});case 3:return u=new e(this.connection,t),o.abrupt("return",u);case 5:case"end":return o.stop()}}),o,this)})))}},{key:"sendMoney",value:function(e,t){return l(this,void 0,void 0,s().mark((function r(){return s().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.signAndSendTransaction({receiverId:e,actions:[(0,p.transfer)(t)]}));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"createAccount",value:function(e,t,r){return l(this,void 0,void 0,s().mark((function n(){var i;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=(0,p.fullAccessKey)(),n.abrupt("return",this.signAndSendTransaction({receiverId:e,actions:[(0,p.createAccount)(),(0,p.transfer)(r),(0,p.addKey)(g.PublicKey.from(t),i)]}));case 2:case"end":return n.stop()}}),n,this)})))}},{key:"deleteAccount",value:function(e){return l(this,void 0,void 0,s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return{NODE_ENV:"production",PUBLIC_URL:"/face-sample-dapp",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NEAR_NO_LOGS||console.log("Deleting an account does not automatically transfer NFTs and FTs to the beneficiary address. Ensure to transfer assets before deleting."),t.abrupt("return",this.signAndSendTransaction({receiverId:this.accountId,actions:[(0,p.deleteAccount)(e)]}));case 2:case"end":return t.stop()}}),t,this)})))}},{key:"deployContract",value:function(e){return l(this,void 0,void 0,s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.signAndSendTransaction({receiverId:this.accountId,actions:[(0,p.deployContract)(e)]}));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"encodeJSContractArgs",value:function(e,t,r){return n.concat([n.from(e),n.from([0]),n.from(t),n.from([0]),n.from(r)])}},{key:"functionCall",value:function(e){var t=e.contractId,r=e.methodName,n=e.args,i=void 0===n?{}:n,o=e.gas,a=void 0===o?w.DEFAULT_FUNCTION_CALL_GAS:o,u=e.attachedDeposit,c=e.walletMeta,f=e.walletCallbackUrl,h=e.stringify,d=e.jsContract;return l(this,void 0,void 0,s().mark((function e(){var n,o,l;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.validateArgs(i),d?(o=this.encodeJSContractArgs(t,r,JSON.stringify(i)),n=["call_js_contract",o,a,u,null,!0]):(l=void 0===h?p.stringifyJsonOrBytes:h,n=[r,i,a,u,l,!1]),e.abrupt("return",this.signAndSendTransaction({receiverId:d?this.connection.jsvmAccountId:t,actions:[p.functionCall.apply(void 0,n)],walletMeta:c,walletCallbackUrl:f}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"addKey",value:function(e,t,r,n){return l(this,void 0,void 0,s().mark((function i(){var o;return s().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return r||(r=[]),Array.isArray(r)||(r=[r]),o=t?(0,p.functionCallAccessKey)(t,r,n):(0,p.fullAccessKey)(),i.abrupt("return",this.signAndSendTransaction({receiverId:this.accountId,actions:[(0,p.addKey)(g.PublicKey.from(e),o)]}));case 4:case"end":return i.stop()}}),i,this)})))}},{key:"deleteKey",value:function(e){return l(this,void 0,void 0,s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.signAndSendTransaction({receiverId:this.accountId,actions:[(0,p.deleteKey)(g.PublicKey.from(e))]}));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"stake",value:function(e,t){return l(this,void 0,void 0,s().mark((function r(){return s().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.signAndSendTransaction({receiverId:this.accountId,actions:[(0,p.stake)(t,g.PublicKey.from(e))]}));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"validateArgs",value:function(e){if(!(void 0!==e.byteLength&&e.byteLength===e.length)&&(Array.isArray(e)||"object"!==typeof e))throw new m.PositionalArgsError}},{key:"viewFunction",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n.parse,o=void 0===i?_:i,a=n.stringify,u=void 0===a?E:a,c=n.jsContract,f=void 0!==c&&c,h=n.blockQuery,p=void 0===h?{finality:"optimistic"}:h;return l(this,void 0,void 0,s().mark((function n(){return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return(0,d.default)("Account.viewFunction(contractId, methodName, args, options)")("use `Account.viewFunction(ViewFunctionCallOptions)` instead"),n.abrupt("return",this.viewFunctionV2({contractId:e,methodName:t,args:r,parse:o,stringify:u,jsContract:f,blockQuery:p}));case 3:case"end":return n.stop()}}),n,this)})))}},{key:"viewFunctionV2",value:function(e){var t=e.contractId,r=e.methodName,i=e.args,o=e.parse,a=void 0===o?_:o,u=e.stringify,c=void 0===u?E:u,f=e.jsContract,h=void 0!==f&&f,d=e.blockQuery,p=void 0===d?{finality:"optimistic"}:d;return l(this,void 0,void 0,s().mark((function e(){var o,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.validateArgs(i),o=h?this.encodeJSContractArgs(t,r,Object.keys(i).length>0?JSON.stringify(i):""):c(i),e.next=4,this.connection.provider.query(Object.assign(Object.assign({request_type:"call_function"},p),{account_id:h?this.connection.jsvmAccountId:t,method_name:h?"view_js_contract":r,args_base64:o.toString("base64")}));case 4:return(u=e.sent).logs&&this.printLogs(t,u.logs),e.abrupt("return",u.result&&u.result.length>0&&a(n.from(u.result)));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"viewState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{finality:"optimistic"};return l(this,void 0,void 0,s().mark((function r(){var i,o;return s().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.connection.provider.query(Object.assign(Object.assign({request_type:"view_state"},t),{account_id:this.accountId,prefix_base64:n.from(e).toString("base64")}));case 2:return i=r.sent,o=i.values,r.abrupt("return",o.map((function(e){var t=e.key,r=e.value;return{key:n.from(t,"base64"),value:n.from(r,"base64")}})));case 5:case"end":return r.stop()}}),r,this)})))}},{key:"getAccessKeys",value:function(){var e;return l(this,void 0,void 0,s().mark((function t(){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.connection.provider.query({request_type:"view_access_key_list",account_id:this.accountId,finality:"optimistic"});case 2:return r=t.sent,t.abrupt("return",null===(e=null===r||void 0===r?void 0:r.keys)||void 0===e?void 0:e.map((function(e){return Object.assign(Object.assign({},e),{access_key:Object.assign(Object.assign({},e.access_key),{nonce:new h.default(e.access_key.nonce)})})})));case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getAccountDetails",value:function(){return l(this,void 0,void 0,s().mark((function e(){var t,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccessKeys();case 2:return t=e.sent,r=t.filter((function(e){return"FullAccess"!==e.access_key.permission})).map((function(e){var t=e.access_key.permission;return{contractId:t.FunctionCall.receiver_id,amount:t.FunctionCall.allowance,publicKey:e.public_key}})),e.abrupt("return",{authorizedApps:r});case 5:case"end":return e.stop()}}),e,this)})))}},{key:"getAccountBalance",value:function(){return l(this,void 0,void 0,s().mark((function e(){var t,r,n,i,o,a,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.connection.provider.experimental_protocolConfig({finality:"final"});case 2:return t=e.sent,e.next=5,this.state();case 5:return r=e.sent,n=new h.default(t.runtime_config.storage_amount_per_byte),i=new h.default(r.storage_usage).mul(n),o=new h.default(r.locked),a=new h.default(r.amount).add(o),u=a.sub(h.default.max(o,i)),e.abrupt("return",{total:a.toString(),stateStaked:i.toString(),staked:o.toString(),available:u.toString()});case 12:case"end":return e.stop()}}),e,this)})))}},{key:"getActiveDelegatedStakeBalance",value:function(){return l(this,void 0,void 0,s().mark((function e(){var t,r,n,o,a,u,c,l,f,d,p,v,y=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.connection.provider.block({finality:"final"});case 2:return t=e.sent,r=t.header.hash,n=t.header.epoch_id,e.next=7,this.connection.provider.validators(n);case 7:return o=e.sent,a=o.current_validators,u=o.next_validators,c=o.current_proposals,l=new Set,[].concat(i(a),i(u),i(c)).forEach((function(e){return l.add(e.account_id)})),f=i(l),d=f.map((function(e){return y.viewFunction({contractId:e,methodName:"get_account_total_balance",args:{account_id:y.accountId},blockQuery:{blockId:r}})})),e.next=17,Promise.allSettled(d);case 17:if(p=e.sent,!p.some((function(e){return"rejected"===e.status&&"TimeoutError"===e.reason.type}))){e.next=21;break}throw new Error("Failed to get delegated stake balance");case 21:return v=p.reduce((function(e,t,r){var n=f[r];if("fulfilled"===t.status){var o=new h.default(t.value);if(!o.isZero())return Object.assign(Object.assign({},e),{stakedValidators:[].concat(i(e.stakedValidators),[{validatorId:n,amount:o.toString()}]),total:e.total.add(o)})}return"rejected"===t.status?Object.assign(Object.assign({},e),{failedValidators:[].concat(i(e.failedValidators),[{validatorId:n,error:t.reason}])}):e}),{stakedValidators:[],failedValidators:[],total:new h.default(0)}),e.abrupt("return",Object.assign(Object.assign({},v),{total:v.total.toString()}));case 23:case"end":return e.stop()}}),e,this)})))}}]),e}();t.Account=S},2742:function(e,t,r){"use strict";var n=r(7061).default,i=r(1655).default,o=r(6389).default,a=r(9728).default,s=r(6690).default,u=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(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())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UrlAccountCreator=t.LocalAccountCreator=t.AccountCreator=void 0;var c=r(8833),l=a((function e(){s(this,e)}));t.AccountCreator=l;var f=function(e){i(r,e);var t=o(r);function r(e,n){var i;return s(this,r),(i=t.call(this)).masterAccount=e,i.initialBalance=n,i}return a(r,[{key:"createAccount",value:function(e,t){return u(this,void 0,void 0,n().mark((function r(){return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.masterAccount.createAccount(e,t,this.initialBalance);case 2:case"end":return r.stop()}}),r,this)})))}}]),r}(l);t.LocalAccountCreator=f;var h=function(e){i(r,e);var t=o(r);function r(e,n){var i;return s(this,r),(i=t.call(this)).connection=e,i.helperUrl=n,i}return a(r,[{key:"createAccount",value:function(e,t){return u(this,void 0,void 0,n().mark((function r(){return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,c.fetchJson)("".concat(this.helperUrl,"/account"),JSON.stringify({newAccountId:e,newAccountPublicKey:t.toString()}));case 2:case"end":return r.stop()}}),r,this)})))}}]),r}(l);t.UrlAccountCreator=h},2198:function(e,t,r){"use strict";var n=r(9778).Buffer,i=r(861).default,o=r(4704).default,a=r(7061).default,s=r(6690).default,u=r(9728).default,c=r(1588).default,l=r(3808).default,f=r(1655).default,h=r(6389).default,d=r(8416).default,p=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(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())}))},v=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Account2FA=t.AccountMultisig=t.MultisigStateStatus=t.MultisigDeleteRequestRejectionError=t.MULTISIG_CONFIRM_METHODS=t.MULTISIG_CHANGE_METHODS=t.MULTISIG_DEPOSIT=t.MULTISIG_GAS=t.MULTISIG_ALLOWANCE=t.MULTISIG_STORAGE_KEY=void 0;var y,g,m,b=v(r(518)),w=r(5458),k=r(1708),_=r(3950),E=r(2362),S=r(9170),x=r(8833);t.MULTISIG_STORAGE_KEY="__multisigRequest",t.MULTISIG_ALLOWANCE=new b.default((0,k.parseNearAmount)("1")),t.MULTISIG_GAS=new b.default("100000000000000"),t.MULTISIG_DEPOSIT=new b.default("0"),t.MULTISIG_CHANGE_METHODS=["add_request","add_request_and_confirm","delete_request","confirm"],t.MULTISIG_CONFIRM_METHODS=["confirm"],function(e){e.CANNOT_DESERIALIZE_STATE="Cannot deserialize the contract state",e.MULTISIG_NOT_INITIALIZED="Smart contract panicked: Multisig contract should be initialized before usage",e.NO_SUCH_REQUEST="Smart contract panicked: panicked at 'No such request: either wrong number or already confirmed'",e.REQUEST_COOLDOWN_ERROR="Request cannot be deleted immediately after creation.",e.METHOD_NOT_FOUND="Contract method is not found"}(y=t.MultisigDeleteRequestRejectionError||(t.MultisigDeleteRequestRejectionError={})),function(e){e[e.INVALID_STATE=0]="INVALID_STATE",e[e.STATE_NOT_INITIALIZED=1]="STATE_NOT_INITIALIZED",e[e.VALID_STATE=2]="VALID_STATE",e[e.UNKNOWN_STATE=3]="UNKNOWN_STATE"}(g=t.MultisigStateStatus||(t.MultisigStateStatus={})),function(e){e[e.INVALID_CODE=0]="INVALID_CODE",e[e.VALID_CODE=1]="VALID_CODE",e[e.UNKNOWN_CODE=2]="UNKNOWN_CODE"}(m||(m={}));var A=d({},t.MULTISIG_STORAGE_KEY,null),T=function(e){f(i,e);var r=h(i);function i(e,t,n){var o;return s(this,i),(o=r.call(this,e,t)).storage=n.storage,o.onAddRequestResult=n.onAddRequestResult,o}return u(i,[{key:"signAndSendTransactionWithAccount",value:function(e,t){var r=this,n=Object.create(null,{signAndSendTransaction:{get:function(){return c(l(i.prototype),"signAndSendTransaction",r)}}});return p(this,void 0,void 0,a().mark((function r(){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",n.signAndSendTransaction.call(this,{receiverId:e,actions:t}));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"signAndSendTransaction",value:function(e){var r=this,o=e.receiverId,s=e.actions,u=Object.create(null,{signAndSendTransaction:{get:function(){return c(l(i.prototype),"signAndSendTransaction",r)}}});return p(this,void 0,void 0,a().mark((function e(){var r,i,c,l;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.accountId,i=n.from(JSON.stringify({request:{receiver_id:o,actions:I(s,r,o)}})),e.prev=2,e.next=5,u.signAndSendTransaction.call(this,{receiverId:r,actions:[(0,E.functionCall)("add_request_and_confirm",i,t.MULTISIG_GAS,t.MULTISIG_DEPOSIT)]});case 5:c=e.sent,e.next=17;break;case 8:if(e.prev=8,e.t0=e.catch(2),!e.t0.toString().includes("Account has too many active requests. Confirm or delete some")){e.next=16;break}return e.next=13,this.deleteUnconfirmedRequests();case 13:return e.next=15,this.signAndSendTransaction({receiverId:o,actions:s});case 15:return e.abrupt("return",e.sent);case 16:throw e.t0;case 17:if(c.status){e.next=19;break}throw new Error("Request failed");case 19:if((l=Object.assign({},c.status)).SuccessValue&&"string"===typeof l.SuccessValue){e.next=22;break}throw new Error("Request failed");case 22:if(this.setRequest({accountId:r,actions:s,requestId:parseInt(n.from(l.SuccessValue,"base64").toString("ascii"),10)}),!this.onAddRequestResult){e.next=26;break}return e.next=26,this.onAddRequestResult(c);case 26:return this.deleteUnconfirmedRequests(),e.abrupt("return",c);case 28:case"end":return e.stop()}}),e,this,[[2,8]])})))}},{key:"checkMultisigCodeAndStateStatus",value:function(e){var r=this,n=Object.create(null,{signAndSendTransaction:{get:function(){return c(l(i.prototype),"signAndSendTransaction",r)}}});return p(this,void 0,void 0,a().mark((function r(){var i,o;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=4294967295,o=e?m.UNKNOWN_CODE:m.VALID_CODE,r.prev=2,!e){r.next=8;break}return r.next=6,n.signAndSendTransaction.call(this,{receiverId:this.accountId,actions:[(0,E.deployContract)(e),(0,E.functionCall)("delete_request",{request_id:i},t.MULTISIG_GAS,t.MULTISIG_DEPOSIT)]});case 6:r.next=10;break;case 8:return r.next=10,this.deleteRequest(i);case 10:return r.abrupt("return",{codeStatus:m.VALID_CODE,stateStatus:g.VALID_STATE});case 13:if(r.prev=13,r.t0=r.catch(2),!new RegExp(y.CANNOT_DESERIALIZE_STATE).test(r.t0&&r.t0.kind&&r.t0.kind.ExecutionError)){r.next=19;break}return r.abrupt("return",{codeStatus:o,stateStatus:g.INVALID_STATE});case 19:if(!new RegExp(y.MULTISIG_NOT_INITIALIZED).test(r.t0&&r.t0.kind&&r.t0.kind.ExecutionError)){r.next=23;break}return r.abrupt("return",{codeStatus:o,stateStatus:g.STATE_NOT_INITIALIZED});case 23:if(!new RegExp(y.NO_SUCH_REQUEST).test(r.t0&&r.t0.kind&&r.t0.kind.ExecutionError)){r.next=27;break}return r.abrupt("return",{codeStatus:o,stateStatus:g.VALID_STATE});case 27:if(!new RegExp(y.METHOD_NOT_FOUND).test(r.t0&&r.t0.message)){r.next=29;break}return r.abrupt("return",{codeStatus:m.INVALID_CODE,stateStatus:g.UNKNOWN_STATE});case 29:throw r.t0;case 30:case"end":return r.stop()}}),r,this,[[2,13]])})))}},{key:"deleteRequest",value:function(e){return c(l(i.prototype),"signAndSendTransaction",this).call(this,{receiverId:this.accountId,actions:[(0,E.functionCall)("delete_request",{request_id:e},t.MULTISIG_GAS,t.MULTISIG_DEPOSIT)]})}},{key:"deleteAllRequests",value:function(){return p(this,void 0,void 0,a().mark((function e(){var t,r=this;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRequestIds();case 2:if(!(t=e.sent).length){e.next=6;break}return e.next=6,Promise.all(t.map((function(e){return r.deleteRequest(e)})));case 6:case"end":return e.stop()}}),e,this)})))}},{key:"deleteUnconfirmedRequests",value:function(){var e=this,r=Object.create(null,{signAndSendTransaction:{get:function(){return c(l(i.prototype),"signAndSendTransaction",e)}}});return p(this,void 0,void 0,a().mark((function e(){var n,i,s,u,c,l;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRequestIds();case 2:n=e.sent,i=this.getRequest(),s=i.requestId,u=o(n),e.prev=5,u.s();case 7:if((c=u.n()).done){e.next=21;break}if((l=c.value)!=s){e.next=11;break}return e.abrupt("continue",19);case 11:return e.prev=11,e.next=14,r.signAndSendTransaction.call(this,{receiverId:this.accountId,actions:[(0,E.functionCall)("delete_request",{request_id:l},t.MULTISIG_GAS,t.MULTISIG_DEPOSIT)]});case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(11),console.warn("Attempt to delete an earlier request before 15 minutes failed. Will try again.");case 19:e.next=7;break;case 21:e.next=26;break;case 23:e.prev=23,e.t1=e.catch(5),u.e(e.t1);case 26:return e.prev=26,u.f(),e.finish(26);case 29:case"end":return e.stop()}}),e,this,[[5,23,26,29],[11,16]])})))}},{key:"getRequestIds",value:function(){return p(this,void 0,void 0,a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.viewFunction(this.accountId,"list_request_ids"));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getRequest",value:function(){return this.storage?JSON.parse(this.storage.getItem(t.MULTISIG_STORAGE_KEY)||"{}"):A[t.MULTISIG_STORAGE_KEY]}},{key:"setRequest",value:function(e){if(this.storage)return this.storage.setItem(t.MULTISIG_STORAGE_KEY,JSON.stringify(e));A[t.MULTISIG_STORAGE_KEY]=e}}]),i}(w.Account);t.AccountMultisig=T;var R=function(e){f(o,e);var r=h(o);function o(e,t,n){var i;return s(this,o),(i=r.call(this,e,t,n)).helperUrl="https://helper.testnet.near.org",i.helperUrl=n.helperUrl||i.helperUrl,i.storage=n.storage,i.sendCode=n.sendCode||i.sendCodeDefault,i.getCode=n.getCode||i.getCodeDefault,i.verifyCode=n.verifyCode||i.verifyCodeDefault,i.onConfirmResult=n.onConfirmResult,i}return u(o,[{key:"signAndSendTransaction",value:function(e){var t=this,r=e.receiverId,n=e.actions,i=Object.create(null,{signAndSendTransaction:{get:function(){return c(l(o.prototype),"signAndSendTransaction",t)}}});return p(this,void 0,void 0,a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.signAndSendTransaction.call(this,{receiverId:r,actions:n});case 2:return e.next=4,this.sendCode();case 4:return e.next=6,this.promptAndVerify();case 6:if(t=e.sent,!this.onConfirmResult){e.next=10;break}return e.next=10,this.onConfirmResult(t);case 10:return e.abrupt("return",t);case 11:case"end":return e.stop()}}),e,this)})))}},{key:"deployMultisig",value:function(e){var r=this,s=Object.create(null,{signAndSendTransactionWithAccount:{get:function(){return c(l(o.prototype),"signAndSendTransactionWithAccount",r)}}});return p(this,void 0,void 0,a().mark((function r(){var o,u,c,l,f,h,d,p,v;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o=this.accountId,r.next=3,this.getRecoveryMethods();case 3:return u=r.sent.data.filter((function(e){var t=e.kind,r=e.publicKey;return("phrase"===t||"ledger"===t)&&null!==r})).map((function(e){return e.publicKey})),r.next=6,this.getAccessKeys();case 6:return c=r.sent.filter((function(e){var t=e.public_key;return"FullAccess"===e.access_key.permission&&!u.includes(t)})).map((function(e){return e.public_key})).map(O),r.t0=O,r.next=10,this.postSignedJson("/2fa/getAccessKey",{accountId:o});case 10:return r.t1=r.sent.publicKey,l=(0,r.t0)(r.t1),f=n.from(JSON.stringify({num_confirmations:2})),h=[].concat(i(c.map((function(e){return(0,E.deleteKey)(e)}))),i(c.map((function(e){return(0,E.addKey)(e,(0,E.functionCallAccessKey)(o,t.MULTISIG_CHANGE_METHODS,null))}))),[(0,E.addKey)(l,(0,E.functionCallAccessKey)(o,t.MULTISIG_CONFIRM_METHODS,null)),(0,E.deployContract)(e)]),d=h.concat((0,E.functionCall)("new",f,t.MULTISIG_GAS,t.MULTISIG_DEPOSIT)),console.log("deploying multisig contract for",o),r.next=18,this.checkMultisigCodeAndStateStatus(e);case 18:p=r.sent,v=p.stateStatus,r.t2=v,r.next=r.t2===g.STATE_NOT_INITIALIZED?23:r.t2===g.VALID_STATE?26:r.t2===g.INVALID_STATE?29:30;break;case 23:return r.next=25,s.signAndSendTransactionWithAccount.call(this,o,d);case 25:case 28:return r.abrupt("return",r.sent);case 26:return r.next=28,s.signAndSendTransactionWithAccount.call(this,o,h);case 29:throw new S.TypedError("Can not deploy a contract to account ".concat(this.accountId," on network ").concat(this.connection.networkId,", the account has existing state."),"ContractHasExistingState");case 30:throw new S.TypedError("Can not deploy a contract to account ".concat(this.accountId," on network ").concat(this.connection.networkId,", the account state could not be verified."),"ContractStateUnknown");case 31:case"end":return r.stop()}}),r,this)})))}},{key:"disableWithFAK",value:function(e){var t=e.contractBytes,r=e.cleanupContractBytes;return p(this,void 0,void 0,a().mark((function e(){var n,o,s,u;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!r){e.next=7;break}return e.next=4,this.deleteAllRequests().catch((function(e){return e}));case 4:return e.next=6,this.get2faDisableCleanupActions(r);case 6:n=e.sent;case 7:return e.next=9,this.get2faDisableKeyConversionActions();case 9:return o=e.sent,s=[].concat(i(n),i(o),[(0,E.deployContract)(t)]),e.next=13,this.findAccessKey(this.accountId,s);case 13:if(!(u=e.sent)||!u.accessKey||"FullAccess"===u.accessKey.permission){e.next=16;break}throw new S.TypedError("No full access key found in keystore. Unable to bypass multisig","NoFAKFound");case 16:return e.abrupt("return",this.signAndSendTransactionWithAccount(this.accountId,s));case 17:case"end":return e.stop()}}),e,this)})))}},{key:"get2faDisableCleanupActions",value:function(e){return p(this,void 0,void 0,a().mark((function r(){var n,i,o=this;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.viewState("").catch((function(e){var t=e.cause&&e.cause.name;if("NO_CONTRACT_CODE"==t)return[];throw"TOO_LARGE_CONTRACT_STATE"==t?new S.TypedError("Can not deploy a contract to account ".concat(o.accountId," on network ").concat(o.connection.networkId,", the account has existing state."),"ContractHasExistingState"):e}));case 2:return n=r.sent,i=n.map((function(e){return e.key.toString("base64")})),r.abrupt("return",n.length?[(0,E.deployContract)(e),(0,E.functionCall)("clean",{keys:i},t.MULTISIG_GAS,new b.default("0"))]:[]);case 5:case"end":return r.stop()}}),r,this)})))}},{key:"get2faDisableKeyConversionActions",value:function(){return p(this,void 0,void 0,a().mark((function e(){var t,r,n,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.accountId,e.next=3,this.getAccessKeys();case 3:return r=e.sent,n=r.filter((function(e){return"FullAccess"!==e.access_key.permission})).filter((function(e){var r=e.access_key.permission.FunctionCall;return r.receiver_id===t&&4===r.method_names.length&&r.method_names.includes("add_request_and_confirm")})),e.t0=_.PublicKey,e.next=8,this.postSignedJson("/2fa/getAccessKey",{accountId:t});case 8:return e.t1=e.sent.publicKey,o=e.t0.from.call(e.t0,e.t1),e.abrupt("return",[(0,E.deleteKey)(o)].concat(i(n.map((function(e){var t=e.public_key;return(0,E.deleteKey)(_.PublicKey.from(t))}))),i(n.map((function(e){var t=e.public_key;return(0,E.addKey)(_.PublicKey.from(t),(0,E.fullAccessKey)())})))));case 11:case"end":return e.stop()}}),e,this)})))}},{key:"disable",value:function(e,t){return p(this,void 0,void 0,a().mark((function r(){var n,o,s,u,c;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.checkMultisigCodeAndStateStatus();case 2:if(n=r.sent,(o=n.stateStatus)===g.VALID_STATE||o===g.STATE_NOT_INITIALIZED){r.next=6;break}throw new S.TypedError("Can not deploy a contract to account ".concat(this.accountId," on network ").concat(this.connection.networkId,", the account state could not be verified."),"ContractStateUnknown");case 6:return r.next=8,this.deleteAllRequests().catch((function(e){return s=e}));case 8:return r.next=10,this.get2faDisableCleanupActions(t).catch((function(e){if("ContractHasExistingState"===e.type)throw s||e;throw e}));case 10:return u=r.sent,r.t0=[],r.t1=i(u),r.t2=i,r.next=16,this.get2faDisableKeyConversionActions();case 16:return r.t3=r.sent,r.t4=(0,r.t2)(r.t3),r.t5=[(0,E.deployContract)(e)],c=r.t0.concat.call(r.t0,r.t1,r.t4,r.t5),console.log("disabling 2fa for",this.accountId),r.next=23,this.signAndSendTransaction({receiverId:this.accountId,actions:c});case 23:return r.abrupt("return",r.sent);case 24:case"end":return r.stop()}}),r,this)})))}},{key:"sendCodeDefault",value:function(){return p(this,void 0,void 0,a().mark((function e(){var t,r,n,i;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.accountId,r=this.getRequest(),n=r.requestId,e.next=4,this.get2faMethod();case 4:return i=e.sent,e.next=7,this.postSignedJson("/2fa/send",{accountId:t,method:i,requestId:n});case 7:return e.abrupt("return",n);case 8:case"end":return e.stop()}}),e,this)})))}},{key:"getCodeDefault",value:function(){return p(this,void 0,void 0,a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error('There is no getCode callback provided. Please provide your own in AccountMultisig constructor options. It has a parameter method where method.kind is "email" or "phone".');case 1:case"end":return e.stop()}}),e)})))}},{key:"promptAndVerify",value:function(){return p(this,void 0,void 0,a().mark((function e(){var t,r,n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.get2faMethod();case 2:return t=e.sent,e.next=5,this.getCode(t);case 5:return r=e.sent,e.prev=6,e.next=9,this.verifyCode(r);case 9:return n=e.sent,e.abrupt("return",n);case 13:if(e.prev=13,e.t0=e.catch(6),console.warn("Error validating security code:",e.t0),!e.t0.toString().includes("invalid 2fa code provided")&&!e.t0.toString().includes("2fa code not valid")){e.next=20;break}return e.next=19,this.promptAndVerify();case 19:return e.abrupt("return",e.sent);case 20:throw e.t0;case 21:case"end":return e.stop()}}),e,this,[[6,13]])})))}},{key:"verifyCodeDefault",value:function(e){return p(this,void 0,void 0,a().mark((function t(){var r,n,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.accountId,n=this.getRequest()){t.next=4;break}throw new Error("no request pending");case 4:return i=n.requestId,t.next=7,this.postSignedJson("/2fa/verify",{accountId:r,securityCode:e,requestId:i});case 7:return t.abrupt("return",t.sent);case 8:case"end":return t.stop()}}),t,this)})))}},{key:"getRecoveryMethods",value:function(){return p(this,void 0,void 0,a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.accountId,e.t0=t,e.next=4,this.postSignedJson("/account/recoveryMethods",{accountId:t});case 4:return e.t1=e.sent,e.abrupt("return",{accountId:e.t0,data:e.t1});case 6:case"end":return e.stop()}}),e,this)})))}},{key:"get2faMethod",value:function(){return p(this,void 0,void 0,a().mark((function e(){var t,r,n,i,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRecoveryMethods();case 2:if(t=e.sent,(r=t.data)&&r.length&&(r=r.find((function(e){return 0===e.kind.indexOf("2fa-")}))),r){e.next=7;break}return e.abrupt("return",null);case 7:return i=(n=r).kind,o=n.detail,e.abrupt("return",{kind:i,detail:o});case 9:case"end":return e.stop()}}),e,this)})))}},{key:"signatureFor",value:function(){return p(this,void 0,void 0,a().mark((function e(){var t,r,i,o,s;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.accountId,e.next=3,this.connection.provider.block({finality:"final"});case 3:return r=e.sent,i=r.header.height.toString(),e.next=7,this.connection.signer.signMessage(n.from(i),t,this.connection.networkId);case 7:return o=e.sent,s=n.from(o.signature).toString("base64"),e.abrupt("return",{blockNumber:i,blockNumberSignature:s});case 10:case"end":return e.stop()}}),e,this)})))}},{key:"postSignedJson",value:function(e,t){return p(this,void 0,void 0,a().mark((function r(){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=x.fetchJson,r.t1=this.helperUrl+e,r.t2=JSON,r.t3=Object,r.t4=Object.assign({},t),r.next=7,this.signatureFor();case 7:return r.t5=r.sent,r.t6=r.t3.assign.call(r.t3,r.t4,r.t5),r.t7=r.t2.stringify.call(r.t2,r.t6),r.next=12,(0,r.t0)(r.t1,r.t7);case 12:return r.abrupt("return",r.sent);case 13:case"end":return r.stop()}}),r,this)})))}}]),o}(T);t.Account2FA=R;var O=function(e){return _.PublicKey.from(e)},I=function(e,r,i){return e.map((function(e){var o,a=e.enum,s=e[a],u=s.gas,c=s.publicKey,l=s.methodName,f=s.args,h=s.deposit,d=s.accessKey,p=s.code,v={type:a[0].toUpperCase()+a.substr(1),gas:u&&u.toString()||void 0,public_key:c&&(o=c,o.toString().replace("ed25519:",""))||void 0,method_name:l,args:f&&n.from(f).toString("base64")||void 0,code:p&&n.from(p).toString("base64")||void 0,amount:h&&h.toString()||void 0,deposit:h&&h.toString()||"0",permission:void 0};if(d&&(i===r&&"fullAccess"!==d.permission.enum&&(v.permission={receiver_id:r,allowance:t.MULTISIG_ALLOWANCE.toString(),method_names:t.MULTISIG_CHANGE_METHODS}),"functionCall"===d.permission.enum)){var y=d.permission.functionCall,g=y.receiverId,m=y.methodNames,b=y.allowance;v.permission={receiver_id:g,allowance:b&&b.toString()||void 0,method_names:m}}return v}))}},3397:function(e,t,r){"use strict";var n=r(7061).default,i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(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())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;var o=r(6366);t.connect=function(e){return i(this,void 0,void 0,n().mark((function t(){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new o.Near(e));case 1:case"end":return t.stop()}}),t)})))}},8963:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}: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}),o=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 i(t,e),t},a=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}),t.keyStores=void 0,t.keyStores=o(r(4871)),a(r(54),t),a(r(3397),t),r(1890)},54:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}: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}),o=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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletConnection=t.ConnectedWalletAccount=t.Near=t.KeyPair=t.Signer=t.InMemorySigner=t.Contract=t.Connection=t.Account=t.multisig=t.validators=t.transactions=t.utils=t.providers=t.accountCreator=void 0;var a=o(r(9170));t.providers=a;var s=o(r(5287));t.utils=s;var u=o(r(2362));t.transactions=u;var c=o(r(1678));t.validators=c;var l=r(5458);Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return l.Account}});var f=o(r(2198));t.multisig=f;var h=o(r(2742));t.accountCreator=h;var d=r(1784);Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return d.Connection}});var p=r(4116);Object.defineProperty(t,"Signer",{enumerable:!0,get:function(){return p.Signer}}),Object.defineProperty(t,"InMemorySigner",{enumerable:!0,get:function(){return p.InMemorySigner}});var v=r(2496);Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return v.Contract}});var y=r(3950);Object.defineProperty(t,"KeyPair",{enumerable:!0,get:function(){return y.KeyPair}});var g=r(6366);Object.defineProperty(t,"Near",{enumerable:!0,get:function(){return g.Near}});var m=r(715);Object.defineProperty(t,"ConnectedWalletAccount",{enumerable:!0,get:function(){return m.ConnectedWalletAccount}}),Object.defineProperty(t,"WalletConnection",{enumerable:!0,get:function(){return m.WalletConnection}})},1784:function(e,t,r){"use strict";var n=r(6690).default,i=r(9728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Connection=void 0;var o=r(9170),a=r(4116);var s=function(){function e(t,r,i,o){n(this,e),this.networkId=t,this.provider=r,this.signer=i,this.jsvmAccountId=o}return i(e,null,[{key:"fromConfig",value:function(t){var r=function(e){switch(e.type){case void 0:return e;case"JsonRpcProvider":return new o.JsonRpcProvider(Object.assign({},e.args));default:throw new Error("Unknown provider type ".concat(e.type))}}(t.provider),n=function(e){switch(e.type){case void 0:return e;case"InMemorySigner":return new a.InMemorySigner(e.keyStore);default:throw new Error("Unknown signer type ".concat(e.type))}}(t.signer);return new e(t.networkId,r,n,t.jsvmAccountId)}}]),e}();t.Connection=s},324:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FUNCTION_CALL_GAS=void 0;var i=n(r(518));t.DEFAULT_FUNCTION_CALL_GAS=new i.default("30000000000000")},2496:function(e,t,r){"use strict";var n=r(7061).default,i=r(6690).default,o=r(9728).default,a=r(8416).default,s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(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.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;var c=u(r(518)),l=u(r(4031)),f=r(9170),h=r(4024);function d(e,t){return a({},e,(function(){return t.apply(void 0,arguments)}))[e]}var p=function(e){return e&&void 0!==e.byteLength&&e.byteLength===e.length},v=function(e){return"[object Object]"===Object.prototype.toString.call(e)},y=function(){function e(t,r,o){var a=this;i(this,e),this.account=t,this.contractId=r;var u=o.viewMethods,c=void 0===u?[]:u,f=o.changeMethods,y=void 0===f?[]:f;c.forEach((function(e){Object.defineProperty(a,e,{writable:!1,enumerable:!0,value:d(e,(function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length,o=new Array(i>2?i-2:0),u=2;u3||!v(r[0])&&!p(r[0]))){t.next=2;break}throw new h.PositionalArgsError;case 2:if(!(r.length>1)&&r[0]&&r[0].args){t.next=6;break}return(0,l.default)("contract.methodName(args, gas, amount)")("use `contract.methodName({ args, gas?, amount?, callbackUrl?, meta? })` instead"),t.abrupt("return",this._changeMethod({methodName:e,args:r[0],gas:r[1],amount:r[2]}));case 6:return t.abrupt("return",this._changeMethod(Object.assign({methodName:e},r[0])));case 7:case"end":return t.stop()}}),t,this)})))}))})}))}return o(e,[{key:"_changeMethod",value:function(e){var t=e.args,r=e.methodName,i=e.gas,o=e.amount,a=e.meta,u=e.callbackUrl;return s(this,void 0,void 0,n().mark((function e(){var s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g({gas:i,amount:o}),e.next=3,this.account.functionCall({contractId:this.contractId,methodName:r,args:t,gas:i,attachedDeposit:o,walletMeta:a,walletCallbackUrl:u});case 3:return s=e.sent,e.abrupt("return",(0,f.getTransactionLastResult)(s));case 5:case"end":return e.stop()}}),e,this)})))}}]),e}();function g(e){for(var t=0,r=Object.keys(e);t0&&void 0!==arguments[0]?arguments[0]:window.localStorage,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;return o(this,r),(e=t.call(this)).localStorage=n,e.prefix=i,e}return a(r,[{key:"setKey",value:function(e,t,r){return c(this,void 0,void 0,i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:this.localStorage.setItem(this.storageKeyForSecretKey(e,t),r.toString());case 1:case"end":return n.stop()}}),n,this)})))}},{key:"getKey",value:function(e,t){return c(this,void 0,void 0,i().mark((function r(){var n;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=this.localStorage.getItem(this.storageKeyForSecretKey(e,t))){r.next=3;break}return r.abrupt("return",null);case 3:return r.abrupt("return",f.KeyPair.fromString(n));case 4:case"end":return r.stop()}}),r,this)})))}},{key:"removeKey",value:function(e,t){return c(this,void 0,void 0,i().mark((function r(){return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:this.localStorage.removeItem(this.storageKeyForSecretKey(e,t));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"clear",value:function(){return c(this,void 0,void 0,i().mark((function e(){var t,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=n(this.storageKeys());try{for(t.s();!(r=t.n()).done;)(o=r.value).startsWith(this.prefix)&&this.localStorage.removeItem(o)}catch(i){t.e(i)}finally{t.f()}case 2:case"end":return e.stop()}}),e,this)})))}},{key:"getNetworks",value:function(){return c(this,void 0,void 0,i().mark((function e(){var t,r,o,a,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=new Set,r=n(this.storageKeys());try{for(r.s();!(o=r.n()).done;)(a=o.value).startsWith(this.prefix)&&(s=a.substring(this.prefix.length).split(":"),t.add(s[1]))}catch(i){r.e(i)}finally{r.f()}return e.abrupt("return",Array.from(t.values()));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"getAccounts",value:function(e){return c(this,void 0,void 0,i().mark((function t(){var r,o,a,s,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new Array,o=n(this.storageKeys());try{for(o.s();!(a=o.n()).done;)(s=a.value).startsWith(this.prefix)&&(u=s.substring(this.prefix.length).split(":"))[1]===e&&r.push(u[0])}catch(i){o.e(i)}finally{o.f()}return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"storageKeyForSecretKey",value:function(e,t){return"".concat(this.prefix).concat(t,":").concat(e)}},{key:"storageKeys",value:i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t1&&void 0!==arguments[1]?arguments[1]:{writeKeyStoreIndex:0};return o(this,r),(n=t.call(this)).options=i,n.keyStores=e,n}return a(r,[{key:"setKey",value:function(e,t,r){return c(this,void 0,void 0,i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.keyStores[this.options.writeKeyStoreIndex].setKey(e,t,r);case 2:case"end":return n.stop()}}),n,this)})))}},{key:"getKey",value:function(e,t){return c(this,void 0,void 0,i().mark((function r(){var o,a,s,u;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o=n(this.keyStores),r.prev=1,o.s();case 3:if((a=o.n()).done){r.next=12;break}return s=a.value,r.next=7,s.getKey(e,t);case 7:if(!(u=r.sent)){r.next=10;break}return r.abrupt("return",u);case 10:r.next=3;break;case 12:r.next=17;break;case 14:r.prev=14,r.t0=r.catch(1),o.e(r.t0);case 17:return r.prev=17,o.f(),r.finish(17);case 20:return r.abrupt("return",null);case 21:case"end":return r.stop()}}),r,this,[[1,14,17,20]])})))}},{key:"removeKey",value:function(e,t){return c(this,void 0,void 0,i().mark((function r(){var o,a,s;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o=n(this.keyStores),r.prev=1,o.s();case 3:if((a=o.n()).done){r.next=9;break}return s=a.value,r.next=7,s.removeKey(e,t);case 7:r.next=3;break;case 9:r.next=14;break;case 11:r.prev=11,r.t0=r.catch(1),o.e(r.t0);case 14:return r.prev=14,o.f(),r.finish(14);case 17:case"end":return r.stop()}}),r,this,[[1,11,14,17]])})))}},{key:"clear",value:function(){return c(this,void 0,void 0,i().mark((function e(){var t,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=n(this.keyStores),e.prev=1,t.s();case 3:if((r=t.n()).done){e.next=9;break}return o=r.value,e.next=7,o.clear();case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,this,[[1,11,14,17]])})))}},{key:"getNetworks",value:function(){return c(this,void 0,void 0,i().mark((function e(){var t,r,o,a,s,u,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=new Set,r=n(this.keyStores),e.prev=2,r.s();case 4:if((o=r.n()).done){e.next=14;break}return a=o.value,e.t0=n,e.next=9,a.getNetworks();case 9:e.t1=e.sent,s=(0,e.t0)(e.t1);try{for(s.s();!(u=s.n()).done;)c=u.value,t.add(c)}catch(i){s.e(i)}finally{s.f()}case 12:e.next=4;break;case 14:e.next=19;break;case 16:e.prev=16,e.t2=e.catch(2),r.e(e.t2);case 19:return e.prev=19,r.f(),e.finish(19);case 22:return e.abrupt("return",Array.from(t));case 23:case"end":return e.stop()}}),e,this,[[2,16,19,22]])})))}},{key:"getAccounts",value:function(e){return c(this,void 0,void 0,i().mark((function t(){var r,o,a,s,u,c,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new Set,o=n(this.keyStores),t.prev=2,o.s();case 4:if((a=o.n()).done){t.next=14;break}return s=a.value,t.t0=n,t.next=9,s.getAccounts(e);case 9:t.t1=t.sent,u=(0,t.t0)(t.t1);try{for(u.s();!(c=u.n()).done;)l=c.value,r.add(l)}catch(i){u.e(i)}finally{u.f()}case 12:t.next=4;break;case 14:t.next=19;break;case 16:t.prev=16,t.t2=t.catch(2),o.e(t.t2);case 19:return t.prev=19,o.f(),t.finish(19);case 22:return t.abrupt("return",Array.from(r));case 23:case"end":return t.stop()}}),t,this,[[2,16,19,22]])})))}},{key:"toString",value:function(){return"MergeKeyStore(".concat(this.keyStores.join(", "),")")}}]),r}(r(5489).KeyStore);t.MergeKeyStore=l},6366:function(e,t,r){"use strict";var n=r(7061).default,i=r(6690).default,o=r(9728).default,a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(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())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Near=void 0;var u=s(r(518)),c=r(5458),l=r(1784),f=r(2742),h=function(){function e(t){if(i(this,e),this.config=t,this.connection=l.Connection.fromConfig({networkId:t.networkId,provider:{type:"JsonRpcProvider",args:{url:t.nodeUrl,headers:t.headers}},signer:t.signer||{type:"InMemorySigner",keyStore:t.keyStore},jsvmAccountId:t.jsvmAccountId||"jsvm.".concat(t.networkId)}),t.masterAccount){var r=t.initialBalance?new u.default(t.initialBalance):new u.default("500000000000000000000000000");this.accountCreator=new f.LocalAccountCreator(new c.Account(this.connection,t.masterAccount),r)}else t.helperUrl?this.accountCreator=new f.UrlAccountCreator(this.connection,t.helperUrl):this.accountCreator=null}return o(e,[{key:"account",value:function(e){return a(this,void 0,void 0,n().mark((function t(){var r;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new c.Account(this.connection,e),t.abrupt("return",r);case 2:case"end":return t.stop()}}),t,this)})))}},{key:"createAccount",value:function(e,t){return a(this,void 0,void 0,n().mark((function r(){return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(this.accountCreator){r.next=2;break}throw new Error("Must specify account creator, either via masterAccount or helperUrl configuration settings.");case 2:return r.next=4,this.accountCreator.createAccount(e,t);case 4:return r.abrupt("return",new c.Account(this.connection,e));case 5:case"end":return r.stop()}}),r,this)})))}}]),e}();t.Near=h},9170:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorContext=t.TypedError=t.getTransactionLastResult=t.FinalExecutionStatusBasic=t.JsonRpcProvider=t.Provider=void 0;var n=r(9883);Object.defineProperty(t,"Provider",{enumerable:!0,get:function(){return n.Provider}}),Object.defineProperty(t,"getTransactionLastResult",{enumerable:!0,get:function(){return n.getTransactionLastResult}}),Object.defineProperty(t,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return n.FinalExecutionStatusBasic}});var i=r(1367);Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return i.JsonRpcProvider}}),Object.defineProperty(t,"TypedError",{enumerable:!0,get:function(){return i.TypedError}}),Object.defineProperty(t,"ErrorContext",{enumerable:!0,get:function(){return i.ErrorContext}})},1367:function(e,t,r){"use strict";var n=r(9778).Buffer,i=r(7061).default,o=r(6690).default,a=r(9728).default,s=r(1655).default,u=r(6389).default,c=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(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())}))},l=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i2&&void 0!==arguments[2]?arguments[2]:"";return c(this,void 0,void 0,i().mark((function n(){var o,a;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=t.finality,a=t.blockId,n.abrupt("return",this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"data_changes",account_ids:e,key_prefix_base64:r,block_id:a,finality:o}));case 3:case"end":return n.stop()}}),n,this)})))}},{key:"contractCodeChanges",value:function(e,t){return c(this,void 0,void 0,i().mark((function r(){var n,o;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=t.finality,o=t.blockId,r.abrupt("return",this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"contract_code_changes",account_ids:e,block_id:o,finality:n}));case 3:case"end":return r.stop()}}),r,this)})))}},{key:"gasPrice",value:function(e){return c(this,void 0,void 0,i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sendJsonRpc("gas_price",[e]);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))}},{key:"sendJsonRpc",value:function(e,t){return c(this,void 0,void 0,i().mark((function r(){var n,o,a=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,y.default)(500,12,1.5,(function(){return c(a,void 0,void 0,i().mark((function r(){var n,o,a;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,n={method:e,params:t,id:m++,jsonrpc:"2.0"},r.next=4,(0,d.fetchJson)(this.connection,JSON.stringify(n));case 4:if(!(o=r.sent).error){r.next=16;break}if("object"!==typeof o.error.data){r.next=12;break}if("string"!==typeof o.error.data.error_message||"string"!==typeof o.error.data.error_type){r.next=9;break}throw new p.TypedError(o.error.data.error_message,o.error.data.error_type);case 9:throw(0,g.parseRpcError)(o.error.data);case 12:if(a="[".concat(o.error.code,"] ").concat(o.error.message,": ").concat(o.error.data),"Timeout"!==o.error.data&&!a.includes("Timeout error")&&!a.includes("query has timed out")){r.next=15;break}throw new p.TypedError(a,"TimeoutError");case 15:throw new p.TypedError(a,o.error.name);case 16:return r.abrupt("return",o);case 19:if(r.prev=19,r.t0=r.catch(0),"TimeoutError"!==r.t0.type){r.next=24;break}return{NODE_ENV:"production",PUBLIC_URL:"/face-sample-dapp",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NEAR_NO_LOGS||console.warn("Retrying request to ".concat(e," as it has timed out"),t),r.abrupt("return",null);case 24:throw r.t0;case 25:case"end":return r.stop()}}),r,this,[[0,19]])})))}));case 2:if(n=r.sent,"undefined"!==typeof(o=n.result)){r.next=6;break}throw new p.TypedError("Exceeded ".concat(12," attempts for request to ").concat(e,"."),"RetriesExceeded");case 6:return r.abrupt("return",o);case 7:case"end":return r.stop()}}),r)})))}}]),r}(h.Provider);t.JsonRpcProvider=b},9883:function(e,t,r){"use strict";var n=r(9778).Buffer,i=r(9728).default,o=r(6690).default;Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionLastResult=t.Provider=t.IdType=t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(t.ExecutionStatusBasic||(t.ExecutionStatusBasic={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(t.FinalExecutionStatusBasic||(t.FinalExecutionStatusBasic={})),function(e){e.Transaction="transaction",e.Receipt="receipt"}(t.IdType||(t.IdType={}));var a=i((function e(){o(this,e)}));t.Provider=a,t.getTransactionLastResult=function(e){if("object"===typeof e.status&&"string"===typeof e.status.SuccessValue){var t=n.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(r){return t}}return null}},4116:function(e,t,r){"use strict";var n=r(7061).default,i=r(1655).default,o=r(6389).default,a=r(9728).default,s=r(6690).default,u=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(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())}))},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InMemorySigner=t.Signer=void 0;var l=c(r(4981)),f=r(3950),h=r(5488),d=a((function e(){s(this,e)}));t.Signer=d;var p=function(e){i(r,e);var t=o(r);function r(e){var n;return s(this,r),(n=t.call(this)).keyStore=e,n}return a(r,[{key:"createKey",value:function(e,t){return u(this,void 0,void 0,n().mark((function r(){var i;return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=f.KeyPair.fromRandom("ed25519"),r.next=3,this.keyStore.setKey(t,e,i);case 3:return r.abrupt("return",i.getPublicKey());case 4:case"end":return r.stop()}}),r,this)})))}},{key:"getPublicKey",value:function(e,t){return u(this,void 0,void 0,n().mark((function r(){var i;return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.keyStore.getKey(t,e);case 2:if(null!==(i=r.sent)){r.next=5;break}return r.abrupt("return",null);case 5:return r.abrupt("return",i.getPublicKey());case 6:case"end":return r.stop()}}),r,this)})))}},{key:"signMessage",value:function(e,t,r){return u(this,void 0,void 0,n().mark((function i(){var o,a;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=new Uint8Array(l.default.sha256.array(e)),t){n.next=3;break}throw new Error("InMemorySigner requires provided account id");case 3:return n.next=5,this.keyStore.getKey(r,t);case 5:if(null!==(a=n.sent)){n.next=8;break}throw new Error("Key for ".concat(t," not found in ").concat(r));case 8:return n.abrupt("return",a.sign(o));case 9:case"end":return n.stop()}}),i,this)})))}},{key:"toString",value:function(){return"InMemorySigner(".concat(this.keyStore,")")}}],[{key:"fromKeyPair",value:function(e,t,i){return u(this,void 0,void 0,n().mark((function o(){var a;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=new h.InMemoryKeyStore,n.next=3,a.setKey(e,t,i);case 3:return n.abrupt("return",new r(a));case 4:case"end":return n.stop()}}),o)})))}}]),r}(d);t.InMemorySigner=p},2362:function(e,t,r){"use strict";var n=r(9778).Buffer,i=r(7061).default,o=r(9728).default,a=r(6690).default,s=r(1655).default,u=r(6389).default,c=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(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())}))},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.signTransaction=t.createTransaction=t.SCHEMA=t.Action=t.SignedTransaction=t.Transaction=t.Signature=t.deleteAccount=t.deleteKey=t.addKey=t.stake=t.transfer=t.functionCall=t.stringifyJsonOrBytes=t.deployContract=t.createAccount=t.DeleteAccount=t.DeleteKey=t.AddKey=t.Stake=t.Transfer=t.FunctionCall=t.DeployContract=t.CreateAccount=t.IAction=t.functionCallAccessKey=t.fullAccessKey=t.AccessKey=t.AccessKeyPermission=t.FullAccessPermission=t.FunctionCallPermission=void 0;var f=l(r(4981)),h=r(1287),d=r(5127),p=r(3950),v=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(h.Assignable);t.FunctionCallPermission=v;var y=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(h.Assignable);t.FullAccessPermission=y;var g=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(h.Enum);t.AccessKeyPermission=g;var m=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(h.Assignable);t.AccessKey=m,t.fullAccessKey=function(){return new m({permission:new g({fullAccess:new y({})})})},t.functionCallAccessKey=function(e,t,r){return new m({permission:new g({functionCall:new v({receiverId:e,allowance:r,methodNames:t})})})};var b=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(h.Assignable);t.IAction=b;var w=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(b);t.CreateAccount=w;var k=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(b);t.DeployContract=k;var _=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(b);t.FunctionCall=_;var E=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(b);t.Transfer=E;var S=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(b);t.Stake=S;var x=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(b);t.AddKey=x;var A=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(b);t.DeleteKey=A;var T=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(b);function R(e){return void 0!==e.byteLength&&e.byteLength===e.length?e:n.from(JSON.stringify(e))}t.DeleteAccount=T,t.createAccount=function(){return new P({createAccount:new w({})})},t.deployContract=function(e){return new P({deployContract:new k({code:e})})},t.stringifyJsonOrBytes=R,t.functionCall=function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:R,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return new P(o?{functionCall:new _({methodName:e,args:t,gas:r,deposit:n})}:{functionCall:new _({methodName:e,args:i(t),gas:r,deposit:n})})},t.transfer=function(e){return new P({transfer:new E({deposit:e})})},t.stake=function(e,t){return new P({stake:new S({stake:e,publicKey:t})})},t.addKey=function(e,t){return new P({addKey:new x({publicKey:e,accessKey:t})})},t.deleteKey=function(e){return new P({deleteKey:new A({publicKey:e})})},t.deleteAccount=function(e){return new P({deleteAccount:new T({beneficiaryId:e})})};var O=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(h.Assignable);t.Signature=O;var I=function(e){s(n,e);var r=u(n);function n(){return a(this,n),r.apply(this,arguments)}return o(n,[{key:"encode",value:function(){return(0,d.serialize)(t.SCHEMA,this)}}],[{key:"decode",value:function(e){return(0,d.deserialize)(t.SCHEMA,n,e)}}]),n}(h.Assignable);t.Transaction=I;var N=function(e){s(n,e);var r=u(n);function n(){return a(this,n),r.apply(this,arguments)}return o(n,[{key:"encode",value:function(){return(0,d.serialize)(t.SCHEMA,this)}}],[{key:"decode",value:function(e){return(0,d.deserialize)(t.SCHEMA,n,e)}}]),n}(h.Assignable);t.SignedTransaction=N;var P=function(e){s(r,e);var t=u(r);function r(){return a(this,r),t.apply(this,arguments)}return o(r)}(h.Enum);function C(e,t,r,n,i,o){return new I({signerId:e,publicKey:t,nonce:n,receiverId:r,actions:i,blockHash:o})}function M(e,r,n,o){return c(this,void 0,void 0,i().mark((function a(){var s,u,c,l;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return s=(0,d.serialize)(t.SCHEMA,e),u=new Uint8Array(f.default.sha256.array(s)),i.next=4,r.signMessage(s,n,o);case 4:return c=i.sent,l=new N({transaction:e,signature:new O({keyType:e.publicKey.keyType,data:c.signature})}),i.abrupt("return",[u,l]);case 7:case"end":return i.stop()}}),a)})))}t.Action=P,t.SCHEMA=new Map([[O,{kind:"struct",fields:[["keyType","u8"],["data",[64]]]}],[N,{kind:"struct",fields:[["transaction",I],["signature",O]]}],[I,{kind:"struct",fields:[["signerId","string"],["publicKey",p.PublicKey],["nonce","u64"],["receiverId","string"],["blockHash",[32]],["actions",[P]]]}],[p.PublicKey,{kind:"struct",fields:[["keyType","u8"],["data",[32]]]}],[m,{kind:"struct",fields:[["nonce","u64"],["permission",g]]}],[g,{kind:"enum",field:"enum",values:[["functionCall",v],["fullAccess",y]]}],[v,{kind:"struct",fields:[["allowance",{kind:"option",type:"u128"}],["receiverId","string"],["methodNames",["string"]]]}],[y,{kind:"struct",fields:[]}],[P,{kind:"enum",field:"enum",values:[["createAccount",w],["deployContract",k],["functionCall",_],["transfer",E],["stake",S],["addKey",x],["deleteKey",A],["deleteAccount",T]]}],[w,{kind:"struct",fields:[]}],[k,{kind:"struct",fields:[["code",["u8"]]]}],[_,{kind:"struct",fields:[["methodName","string"],["args",["u8"]],["gas","u64"],["deposit","u128"]]}],[E,{kind:"struct",fields:[["deposit","u128"]]}],[S,{kind:"struct",fields:[["stake","u128"],["publicKey",p.PublicKey]]}],[x,{kind:"struct",fields:[["publicKey",p.PublicKey],["accessKey",m]]}],[A,{kind:"struct",fields:[["publicKey",p.PublicKey]]}],[T,{kind:"struct",fields:[["beneficiaryId","string"]]}]]),t.createTransaction=C,t.signTransaction=function(){for(var e=arguments.length,t=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:t.NEAR_NOMINATION_EXP,n=new i.default(e,10);if(r!==t.NEAR_NOMINATION_EXP){var a=t.NEAR_NOMINATION_EXP-r-1;a>0&&n.iadd(o[a])}var s=(e=n.toString()).substring(0,e.length-t.NEAR_NOMINATION_EXP)||"0",u=e.substring(e.length-t.NEAR_NOMINATION_EXP).padStart(t.NEAR_NOMINATION_EXP,"0").substring(0,r);return c("".concat(l(s),".").concat(u))},t.parseNearAmount=function(e){if(!e)return null;var r=(e=e.replace(/,/g,"").trim()).split("."),n=r[0],i=r[1]||"";if(r.length>2||i.length>t.NEAR_NOMINATION_EXP)throw new Error("Cannot parse '".concat(e,"' as NEAR amount"));return function(e){if(""===(e=e.replace(/^0+/,"")))return"0";return e}(n+i.padEnd(t.NEAR_NOMINATION_EXP,"0"))}},5287:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}: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}),o=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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.logWarning=t.rpc_errors=t.KeyPairEd25519=t.KeyPair=t.PublicKey=t.format=t.enums=t.web=t.serialize=t.key_pair=void 0;var a=o(r(3950));t.key_pair=a;var s=o(r(5721));t.serialize=s;var u=o(r(8833));t.web=u;var c=o(r(1287));t.enums=c;var l=o(r(1708));t.format=l;var f=o(r(1502));t.rpc_errors=f;var h=r(3950);Object.defineProperty(t,"PublicKey",{enumerable:!0,get:function(){return h.PublicKey}}),Object.defineProperty(t,"KeyPair",{enumerable:!0,get:function(){return h.KeyPair}}),Object.defineProperty(t,"KeyPairEd25519",{enumerable:!0,get:function(){return h.KeyPairEd25519}});var d=r(4024);Object.defineProperty(t,"logWarning",{enumerable:!0,get:function(){return d.logWarning}})},3950:function(e,t,r){"use strict";var n=r(6690).default,i=r(9728).default,o=r(1655).default,a=r(6389).default,s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPairEd25519=t.KeyPair=t.PublicKey=t.KeyType=void 0;var u,c=s(r(2826)),l=r(5721),f=r(1287);function h(e){if("ed25519"===e.toLowerCase())return u.ED25519;throw new Error("Unknown key type ".concat(e))}!function(e){e[e.ED25519=0]="ED25519"}(u=t.KeyType||(t.KeyType={}));var d=function(e){o(r,e);var t=a(r);function r(){return n(this,r),t.apply(this,arguments)}return i(r,[{key:"toString",value:function(){return"".concat(function(e){if(e===u.ED25519)return"ed25519";throw new Error("Unknown key type ".concat(e))}(this.keyType),":").concat((0,l.base_encode)(this.data))}},{key:"verify",value:function(e,t){if(this.keyType===u.ED25519)return c.default.sign.detached.verify(e,t,this.data);throw new Error("Unknown key type ".concat(this.keyType))}}],[{key:"from",value:function(e){return"string"===typeof e?r.fromString(e):e}},{key:"fromString",value:function(e){var t=e.split(":");if(1===t.length)return new r({keyType:u.ED25519,data:(0,l.base_decode)(t[0])});if(2===t.length)return new r({keyType:h(t[0]),data:(0,l.base_decode)(t[1])});throw new Error("Invalid encoded key format, must be :")}}]),r}(f.Assignable);t.PublicKey=d;var p=function(){function e(){n(this,e)}return i(e,null,[{key:"fromRandom",value:function(e){if("ED25519"===e.toUpperCase())return v.fromRandom();throw new Error("Unknown curve ".concat(e))}},{key:"fromString",value:function(e){var t=e.split(":");if(1===t.length)return new v(t[0]);if(2===t.length){if("ED25519"===t[0].toUpperCase())return new v(t[1]);throw new Error("Unknown curve: ".concat(t[0]))}throw new Error("Invalid encoded key format, must be :")}}]),e}();t.KeyPair=p;var v=function(e){o(r,e);var t=a(r);function r(e){var i;n(this,r),i=t.call(this);var o=c.default.sign.keyPair.fromSecretKey((0,l.base_decode)(e));return i.publicKey=new d({keyType:u.ED25519,data:o.publicKey}),i.secretKey=e,i}return i(r,[{key:"sign",value:function(e){return{signature:c.default.sign.detached(e,(0,l.base_decode)(this.secretKey)),publicKey:this.publicKey}}},{key:"verify",value:function(e,t){return this.publicKey.verify(e,t)}},{key:"toString",value:function(){return"ed25519:".concat(this.secretKey)}},{key:"getPublicKey",value:function(){return this.publicKey}}],[{key:"fromRandom",value:function(){var e=c.default.sign.keyPair();return new r((0,l.base_encode)(e.secretKey))}}]),r}(p);t.KeyPairEd25519=v},1502:function(e,t,r){"use strict";var n=r(9728).default,i=r(6690).default,o=r(1655).default,a=r(6389).default,s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.formatError=t.parseResultError=t.parseRpcError=t.ServerError=void 0;var u=s(r(7598)),c=s(r(6527)),l=s(r(7930)),f=r(54),h=r(4024),d={formatNear:function(){return function(e,t){return f.utils.format.formatNearAmount(t(e))}}},p=function(e){o(r,e);var t=a(r);function r(){return i(this,r),t.apply(this,arguments)}return n(r)}(h.TypedError);t.ServerError=p;var v=function(e){o(r,e);var t=a(r);function r(){return i(this,r),t.apply(this,arguments)}return n(r)}(p);function y(e){var t={},r=m(e,c.default.schema,t,""),n=new p(g(r,t),r);return Object.assign(n,t),n}function g(e,t){return"string"===typeof l.default[e]?u.default.render(l.default[e],Object.assign(Object.assign({},t),d)):JSON.stringify(t)}function m(e,t,r,n){var i,o,a,s;for(var u in t){if(s=e[u],"[object String]"===Object.prototype.toString.call(s))return e[u];if(b(e[u]))i=e[u],o=t[u],a=u;else{if(!b(e.kind)||!b(e.kind[u]))continue;i=e.kind[u],o=t[u],a=u}}if(i&&o){for(var c=0,l=Object.keys(o.props);c=600)&&i("non-error status code; use only 4xx or 5xx status codes");("number"!==typeof n||!a[n]&&(n<400||n>=600))&&(n=500);var l=e[n]||e[c(n)];t||(t=l?new l(r):new Error(r||a[n]),Error.captureStackTrace(t,e));l&&t instanceof l&&t.status===n||(t.expose=n<500,t.status=t.statusCode=n);for(var f in o)"status"!==f&&"statusCode"!==f&&(t[f]=o[f]);return t},e.exports.HttpError=function(){function e(){throw new TypeError("cannot construct abstract class")}return s(e,Error),e}(),e.exports.isHttpError=(n=e.exports.HttpError,function(e){return!(!e||"object"!==typeof e)&&(e instanceof n||e instanceof Error&&"boolean"===typeof e.expose&&"number"===typeof e.statusCode&&e.status===e.statusCode)}),function(e,t,r){t.forEach((function(t){var n,i=u(a[t]);switch(c(t)){case 400:n=function(e,t,r){var n=f(t);function i(e){var t=null!=e?e:a[r],s=new Error(t);return Error.captureStackTrace(s,i),o(s,i.prototype),Object.defineProperty(s,"message",{enumerable:!0,configurable:!0,value:t,writable:!0}),Object.defineProperty(s,"name",{enumerable:!1,configurable:!0,value:n,writable:!0}),s}return s(i,e),l(i,n),i.prototype.status=r,i.prototype.statusCode=r,i.prototype.expose=!0,i}(r,i,t);break;case 500:n=function(e,t,r){var n=f(t);function i(e){var t=null!=e?e:a[r],s=new Error(t);return Error.captureStackTrace(s,i),o(s,i.prototype),Object.defineProperty(s,"message",{enumerable:!0,configurable:!0,value:t,writable:!0}),Object.defineProperty(s,"name",{enumerable:!1,configurable:!0,value:n,writable:!0}),s}return s(i,e),l(i,n),i.prototype.status=r,i.prototype.statusCode=r,i.prototype.expose=!1,i}(r,i,t)}n&&(e[t]=n,e[i]=n)})),e["I'mateapot"]=i.function(e.ImATeapot,'"I\'mateapot"; use "ImATeapot" instead')}(e.exports,a.codes,e.exports.HttpError)},7775:function(e){"use strict";function t(e,t){if("function"!==typeof e)throw new TypeError("argument fn must be a function");return e}function r(e,t,r){if(!e||"object"!==typeof e&&"function"!==typeof e)throw new TypeError("argument obj must be object");var n=Object.getOwnPropertyDescriptor(e,t);if(!n)throw new TypeError("must call property on owner object");if(!n.configurable)throw new TypeError("property must be configurable")}e.exports=function(e){if(!e)throw new TypeError("argument namespace is required");function n(e){}return n._file=void 0,n._ignored=!0,n._namespace=e,n._traced=!1,n._warned=Object.create(null),n.function=t,n.property=r,n}},8269:function(e,t,r){"use strict";var n=r(798);function i(e){if("number"===typeof e){if(!i[e])throw new Error("invalid status code: "+e);return e}if("string"!==typeof e)throw new TypeError("code must be a number or string");var t=parseInt(e,10);if(!isNaN(t)){if(!i[t])throw new Error("invalid status code: "+t);return t}if(!(t=i[e.toLowerCase()]))throw new Error('invalid status message: "'+e+'"');return t}e.exports=i,i.STATUS_CODES=n,i.codes=function(e,t){var r=[];return Object.keys(t).forEach((function(n){var i=t[n],o=Number(n);e[o]=i,e[i]=o,e[i.toLowerCase()]=o,r.push(o)})),r}(i,n),i.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},i.empty={204:!0,205:!0,304:!0},i.retry={502:!0,503:!0,504:!0}},4381:function(e,t,r){r(4057),e.exports=r(3905)},8937:function(e){var t=function e(){var t=Object.create({Source:Object,config:{},buildArgs:[]});function r(e){var r="config";if(e instanceof Function)r="Source";else if(e instanceof Array)r="buildArgs";else{if(!(e instanceof Object))throw new Error("Invalid configuration option.");r="config"}if(t.hasOwnProperty(r))throw new Error("Duplicated configuration option: "+r+".");t[r]=e}for(var n=0,i=arguments.length;n