@onekeyfe/cross-inpage-provider-injected 0.0.10 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,2 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(window,(function(){return(()=>{var e={378:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var s=o[i];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},563:(e,t,r)=>{var n=r(19).Symbol;e.exports=n},325:(e,t,r)=>{var n=r(563),i=r(544),o=r(252),s=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},8:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},723:(e,t,r)=>{var n=r(539)(Object.getPrototypeOf,Object);e.exports=n},544:(e,t,r)=>{var n=r(563),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var i=s.call(e);return n&&(t?e[a]=r:delete e[a]),i}},252:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},539:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},19:(e,t,r)=>{var n=r(8),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},906:e=>{var t=Array.isArray;e.exports=t},920:(e,t,r)=>{var n=r(325),i=r(464);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},464:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},612:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},395:(e,t,r)=>{var n=r(325),i=r(723),o=r(612),s=Function.prototype,a=Object.prototype,c=s.toString,d=a.hasOwnProperty,u=c.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=d.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==u}},788:(e,t,r)=>{var n=r(325),i=r(906),o=r(612);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==n(e)}},554:e=>{var t=1e3,r=60*t,n=60*r,i=24*n;function o(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var a,c,d=typeof e;if("string"===d&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===d&&isFinite(e))return s.long?(a=e,(c=Math.abs(a))>=i?o(a,c,i,"day"):c>=n?o(a,c,n,"hour"):c>=r?o(a,c,r,"minute"):c>=t?o(a,c,t,"second"):a+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},439:e=>{e.exports=s,s.default=s,s.stable=u,s.stableStringify=u;var t="[...]",r="[Circular]",n=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,r,s){var a;void 0===s&&(s=o()),c(e,"",0,[],void 0,0,s);try{a=0===i.length?JSON.stringify(e,t,r):JSON.stringify(e,h(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var d=n.pop();4===d.length?Object.defineProperty(d[0],d[1],d[3]):d[0][d[1]]=d[2]}}return a}function a(e,t,r,o){var s=Object.getOwnPropertyDescriptor(o,r);void 0!==s.get?s.configurable?(Object.defineProperty(o,r,{value:e}),n.push([o,r,t,s])):i.push([t,r,e]):(o[r]=e,n.push([o,r,t]))}function c(e,n,i,o,s,d,u){var l;if(d+=1,"object"==typeof e&&null!==e){for(l=0;l<o.length;l++)if(o[l]===e)return void a(r,e,n,s);if(void 0!==u.depthLimit&&d>u.depthLimit)return void a(t,e,n,s);if(void 0!==u.edgesLimit&&i+1>u.edgesLimit)return void a(t,e,n,s);if(o.push(e),Array.isArray(e))for(l=0;l<e.length;l++)c(e[l],l,l,o,e,d,u);else{var h=Object.keys(e);for(l=0;l<h.length;l++){var g=h[l];c(e[g],g,l,o,e,d,u)}}o.pop()}}function d(e,t){return e<t?-1:e>t?1:0}function u(e,t,r,s){void 0===s&&(s=o());var a,c=l(e,"",0,[],void 0,0,s)||e;try{a=0===i.length?JSON.stringify(c,t,r):JSON.stringify(c,h(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var d=n.pop();4===d.length?Object.defineProperty(d[0],d[1],d[3]):d[0][d[1]]=d[2]}}return a}function l(e,i,o,s,c,u,h){var g;if(u+=1,"object"==typeof e&&null!==e){for(g=0;g<s.length;g++)if(s[g]===e)return void a(r,e,i,c);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==h.depthLimit&&u>h.depthLimit)return void a(t,e,i,c);if(void 0!==h.edgesLimit&&o+1>h.edgesLimit)return void a(t,e,i,c);if(s.push(e),Array.isArray(e))for(g=0;g<e.length;g++)l(e[g],g,g,s,e,u,h);else{var f={},p=Object.keys(e).sort(d);for(g=0;g<p.length;g++){var v=p[g];l(e[v],v,g,s,e,u,h),f[v]=e[v]}if(void 0===c)return f;n.push([c,i,e]),c[i]=f}s.pop()}}function h(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(i.length>0)for(var n=0;n<i.length;n++){var o=i[n];if(o[1]===t&&o[0]===r){r=o[2],i.splice(n,1);break}}return e.call(this,t,r)}}},298:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}p(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&p(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,s,d;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,d=u,console&&console.warn&&console.warn(d)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.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;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):f(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function p(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var d=c.length,u=f(c,d);for(r=0;r<d;++r)n(u[r],this,t)}return!0},o.prototype.addListener=function(e,t){return d(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return d(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},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):g.call(e,t)},o.prototype.listenerCount=g,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},744:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.EthereumRpcError=void 0;const n=r(990);class i extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return n.default(this.serialize(),o,2)}}function o(e,t){if("[Circular]"!==t)return t}t.EthereumRpcError=i,t.EthereumProviderError=class extends i{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}},770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},620:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;const n=r(744),i=r(649),o=r(770);function s(e,t){const[r,o]=c(t);return new n.EthereumRpcError(e,r||i.getMessageFromCode(e),o)}function a(e,t){const[r,o]=c(t);return new n.EthereumProviderError(e,r||i.getMessageFromCode(e),o)}function c(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}t.ethErrors={rpc:{parse:e=>s(o.errorCodes.rpc.parse,e),invalidRequest:e=>s(o.errorCodes.rpc.invalidRequest,e),invalidParams:e=>s(o.errorCodes.rpc.invalidParams,e),methodNotFound:e=>s(o.errorCodes.rpc.methodNotFound,e),internal:e=>s(o.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return s(t,e)},invalidInput:e=>s(o.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>s(o.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>s(o.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>s(o.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>s(o.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>s(o.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>a(o.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>a(o.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>a(o.errorCodes.provider.unsupportedMethod,e),disconnected:e=>a(o.errorCodes.provider.disconnected,e),chainDisconnected:e=>a(o.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:i}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new n.EthereumProviderError(t,r,i)}}}},429:(e,t,r)=>{"use strict";t.Cg=t.Sy=void 0;const n=r(744);Object.defineProperty(t,"Cg",{enumerable:!0,get:function(){return n.EthereumRpcError}});r(649);const i=r(620);Object.defineProperty(t,"Sy",{enumerable:!0,get:function(){return i.ethErrors}});r(770)},649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=r(770),i=r(744),o=n.errorCodes.rpc.internal,s={code:o,message:a(o)};function a(e,r="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){const r=e.toString();if(l(n.errorValues,r))return n.errorValues[r].message;if(d(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function c(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!n.errorValues[t]||!!d(e)}function d(e){return e>=-32099&&e<=-32e3}function u(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=a,t.isValidCode=c,t.serializeError=function(e,{fallbackError:t=s,shouldIncludeStack:r=!1}={}){var n,o;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof i.EthereumRpcError)return e.serialize();const d={};if(e&&"object"==typeof e&&!Array.isArray(e)&&l(e,"code")&&c(e.code)){const t=e;d.code=t.code,t.message&&"string"==typeof t.message?(d.message=t.message,l(t,"data")&&(d.data=t.data)):(d.message=a(d.code),d.data={originalError:u(e)})}else{d.code=t.code;const r=null===(n=e)||void 0===n?void 0:n.message;d.message=r&&"string"==typeof r?r:t.message,d.data={originalError:u(e)}}const h=null===(o=e)||void 0===o?void 0:o.stack;return r&&e&&h&&"string"==typeof h&&(d.stack=h),d}},990:e=>{e.exports=s,s.default=s,s.stable=u,s.stableStringify=u;var t="[...]",r="[Circular]",n=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,r,s){var a;void 0===s&&(s=o()),c(e,"",0,[],void 0,0,s);try{a=0===i.length?JSON.stringify(e,t,r):JSON.stringify(e,h(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var d=n.pop();4===d.length?Object.defineProperty(d[0],d[1],d[3]):d[0][d[1]]=d[2]}}return a}function a(e,t,r,o){var s=Object.getOwnPropertyDescriptor(o,r);void 0!==s.get?s.configurable?(Object.defineProperty(o,r,{value:e}),n.push([o,r,t,s])):i.push([t,r,e]):(o[r]=e,n.push([o,r,t]))}function c(e,n,i,o,s,d,u){var l;if(d+=1,"object"==typeof e&&null!==e){for(l=0;l<o.length;l++)if(o[l]===e)return void a(r,e,n,s);if(void 0!==u.depthLimit&&d>u.depthLimit)return void a(t,e,n,s);if(void 0!==u.edgesLimit&&i+1>u.edgesLimit)return void a(t,e,n,s);if(o.push(e),Array.isArray(e))for(l=0;l<e.length;l++)c(e[l],l,l,o,e,d,u);else{var h=Object.keys(e);for(l=0;l<h.length;l++){var g=h[l];c(e[g],g,l,o,e,d,u)}}o.pop()}}function d(e,t){return e<t?-1:e>t?1:0}function u(e,t,r,s){void 0===s&&(s=o());var a,c=l(e,"",0,[],void 0,0,s)||e;try{a=0===i.length?JSON.stringify(c,t,r):JSON.stringify(c,h(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var d=n.pop();4===d.length?Object.defineProperty(d[0],d[1],d[3]):d[0][d[1]]=d[2]}}return a}function l(e,i,o,s,c,u,h){var g;if(u+=1,"object"==typeof e&&null!==e){for(g=0;g<s.length;g++)if(s[g]===e)return void a(r,e,i,c);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==h.depthLimit&&u>h.depthLimit)return void a(t,e,i,c);if(void 0!==h.edgesLimit&&o+1>h.edgesLimit)return void a(t,e,i,c);if(s.push(e),Array.isArray(e))for(g=0;g<e.length;g++)l(e[g],g,g,s,e,u,h);else{var f={},p=Object.keys(e).sort(d);for(g=0;g<p.length;g++){var v=p[g];l(e[v],v,g,s,e,u,h),f[v]=e[v]}if(void 0===c)return f;n.push([c,i,e]),c[i]=f}s.pop()}}function h(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(i.length>0)for(var n=0;n<i.length;n++){var o=i[n];if(o[1]===t&&o[0]===r){r=o[2],i.splice(n,1);break}}return e.call(this,t,r)}}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n);var e={};r.r(e),r.d(e,{DEBUG_LOGGER_STORAGE_KEY:()=>m,EXT_PORT_CS_TO_BG:()=>p,EXT_PORT_UI_TO_BG:()=>v,JS_BRIDGE_MESSAGE_DIRECTION:()=>f,JS_BRIDGE_MESSAGE_EXT_CHANNEL:()=>h,JS_BRIDGE_MESSAGE_EXT_PING:()=>g,JS_BRIDGE_MESSAGE_IPC_CHANNEL:()=>l});var t=r(298);function i(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout((()=>{throw e}))}}class o extends t{emit(e,...t){return super.emit(e,...t)}addListener(e,t){return super.addListener(e,t),this}on(e,t){return super.on(e,t),this}once(e,t){return super.once(e,t),this}removeListener(e,t){return super.removeListener(e,t),this}off(e,t){return super.off(e,t),this}removeAllListeners(e){return super.removeAllListeners(e),this}setMaxListeners(e){return super.setMaxListeners(e),this}getMaxListeners(){return super.getMaxListeners()}listeners(e){return super.listeners(e)}rawListeners(e){return super.rawListeners(e)}listenerCount(e){return super.listenerCount(e)}prependListener(e,t){return super.prependListener(e,t),this}prependOnceListener(e,t){return super.prependOnceListener(e,t),this}eventNames(){return super.eventNames()}}class s extends o{emit(e,...t){let r="error"===e;const n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const o=n[e];if(void 0===o)return!1;if("function"==typeof o)i(o,this,t);else{const e=o.length,r=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(o);for(let n=0;n<e;n+=1)i(r[n],this,t)}return!0}}var a=r(395),c=r(788),d=r(554),u=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const l="onekey@JS_BRIDGE_MESSAGE_IPC_CHANNEL",h="onekey@JS_BRIDGE_MESSAGE_EXT_CHANNEL",g="onekey@JS_BRIDGE_MESSAGE_EXT_PING",f={HOST_TO_INPAGE:"onekey@JS_BRIDGE_MESSAGE_DIRECTION-HOST_TO_INPAGE",INPAGE_TO_HOST:"onekey@JS_BRIDGE_MESSAGE_DIRECTION-INPAGE_TO_HOST"},p="onekey@EXT_PORT_CS_TO_BG",v="onekey@EXT_PORT_UI_TO_BG",m="$$ONEKEY_DEBUG_LOGGER";var y=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const b=m,w={formatArgs:function(e){if(e[0]=`${(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")}+${w.humanize(this.diff)}`,!this.useColors)return;const t=`color: ${this.color}`;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r+=1,"%c"===e&&(n=r))})),e.splice(n,0,t)},save:function(e){return y(this,void 0,void 0,(function*(){try{e?yield w.storage.setItem(b,e):yield w.storage.removeItem(b)}catch(e){console.error("debug logger storage error",e)}}))},load:function(){return y(this,void 0,void 0,(function*(){let e;try{e=yield w.storage.getItem(b)}catch(e){console.error("debug logger storage error",e)}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}))},useColors:function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}};w.storage=function(){try{return"undefined"!=typeof global&&global.$$onekeyAppStorage?global.$$onekeyAppStorage:"undefined"!=typeof window&&window.localStorage?window.localStorage:(console.warn("debugLogger init warning, neither `global.$$onekeyAppStorage` nor `window.localStorage` found."),{getItem(){return y(this,void 0,void 0,(function*(){return""}))},setItem(){return y(this,void 0,void 0,(function*(){}))},removeItem(){return y(this,void 0,void 0,(function*(){}))}})}catch(e){console.error("debug logger storage error",e)}}(),w.humanize=d,w.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),w.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],w.log=(...e)=>{console.debug?console.debug(...e):console.log&&console.log(...e)};const _=w;const C=function(){return e=this,t=void 0,n=function*(){return function(e){return u(this,void 0,void 0,(function*(){function t(e){let n,i,o,s=null;function a(...e){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];n=o.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map((e=>`-${e}`))].join(",");return t.enable(""),e},t.enable=function(e){return u(this,void 0,void 0,(function*(){let r;yield t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp(`^${e.substr(1)}$`)):t.names.push(new RegExp(`^${e}$`)))}))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=d,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={j(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: ${e.message}`}}},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]};const i=yield t.load();return yield t.enable(i),t}))}(_)},new((r=void 0)||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}));var e,t,r,n};function E(...e){"undefined"!=typeof localStorage&&localStorage.getItem(m)&&console.error(...e)}const S={_isFakeLogger:!0,log:(...e)=>{},warn:(...e)=>{},error:(...e)=>{},debug:(...e)=>{},info:(...e)=>{},trace:(...e)=>{}};var O;!function(e){e.jsBridge="jsBridge",e.providerBase="providerBase",e.extInjected="extInjected",e.extContentScripts="extContentScripts",e.webview="webview",e.desktopInjected="desktopInjected",e.ethereum="ethereum"}(O||(O={}));class k extends s{constructor(){super(),this.jsBridge=(...e)=>null,this.providerBase=(...e)=>null,this.extInjected=(...e)=>null,this.extContentScripts=(...e)=>null,this.webview=(...e)=>null,this.desktopInjected=(...e)=>null,this.ethereum=(...e)=>null,this._debug={enable(e){}},this._externalLogger=S,this._createExternalLog=e=>(...t)=>{var r,n;return this.once("debugReady",(()=>{var r;null===(r=this[e])||void 0===r||r.call(this,...t)})),null===(n=null===(r=this._externalLogger)||void 0===r?void 0:r.log)||void 0===n?void 0:n.call(r,e+" >>> ",...t)},this.initExternalLogInstances()}initExternalLogInstances(){Object.keys(O).forEach((e=>{this[e]=this._createExternalLog(e)}))}isDebugReady(){return this._debug&&"function"==typeof this._debug}_attachExternalLogger(e){e&&(this._externalLogger=e)}_createDebugInstance(e){}}const R=new k,j=new class extends k{constructor(){super(),this._debugInstanceCreatedMap={},C().then((e=>{this._debug=e,this.initDebugInstances(),this.emit("debugReady")}))}initDebugInstances(){this.isDebugReady()&&Object.keys(O).forEach((e=>{this[e]=this._debug(e)}))}_createDebugInstance(e){if(!this._debugInstanceCreatedMap[e]&&(this._debugInstanceCreatedMap[e]=!0,e&&this._debug&&"function"==typeof this._debug)){const t=this._debug(e),r=this[e];this[e]=(...e)=>{t(...e),r&&"function"==typeof r&&r(...e)}}}};var I,x;!function(e){e.RESPONSE="RESPONSE",e.REQUEST="REQUEST"}(I||(I={})),function(e){e.ethereum="ethereum",e.conflux="conflux",e.solana="solana",e.sollet="sollet",e.near="near",e.$private="$private"}(x||(x={}));var P=r(439);class M extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return P(this.serialize(),A,2)}}class L extends M{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function A(e,t){if("[Circular]"!==t)return t}const N=4500,F={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Web3 provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4500:{standard:"",message:"The request by this Web3 provider is timeout."}};function T(e,t="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){const t=e.toString();if(r=F,n=t,Object.prototype.hasOwnProperty.call(r,n))return F[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return"Unspecified server error."}var r,n;return t}T(-32603);const q=e=>D(N,e);function D(e,t){const[r,n]=function(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(t);return new L(e,r||T(e),n)}const J="0.0.10";const B="message",U="error";class $ extends s{constructor(e={}){var t,r;super(),this._requestPayloadCache={},this.isExtUi=!1,this.isInjected=!1,this.sendAsString=!0,this.globalOnMessageEnabled=!0,this.providersHub={},this.globalOnMessage=e=>{return t=this,r=void 0,i=function*(){try{if(this.config.receiveHandler&&this.globalOnMessageEnabled){const t=yield this.config.receiveHandler(e,this);e.id&&this.response({id:e.id,scope:e.scope,remoteId:e.remoteId,data:t})}}catch(t){e.id&&e.type===I.REQUEST&&this.responseError({id:e.id,scope:e.scope,remoteId:e.remoteId,error:t}),this.emit(U,t)}},new((n=void 0)||(n=Promise))((function(e,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(s,a)}c((i=i.apply(t,r||[])).next())}));var t,r,n,i},this.version=J,this.remoteInfo={origin:"",remoteId:""},this.callbacksExpireTimeout=6e5,this.debugLogger=j,this.callbacks=[],this.callbackId=1,this.config=e,this.callbacksExpireTimeout=null!==(t=e.timeout)&&void 0!==t?t:this.callbacksExpireTimeout,this.debugLogger=e.debugLogger||j,this.sendAsString=null!==(r=e.sendAsString)&&void 0!==r?r:this.sendAsString,this.config.receiveHandler&&this.on(B,this.globalOnMessage),this.on(U,(e=>{var t;E("JsBridge ERROR: ",e,{code:null===(t=e)||void 0===t?void 0:t.code})})),this.rejectExpiredCallbacks()}attachProviderInstance(e){var t;const r=e.providerName;r&&(this.providersHub[r]=null!==(t=this.providersHub[r])&&void 0!==t?t:[],this.providersHub[r].push(e))}createCallbackId(){return this.callbackId+=1,this.callbackId}createPayload(e,{resolve:t,reject:r}){const{id:n,type:i}=e;if(t&&r&&n&&i===I.REQUEST){if(this.callbacks[n])throw new Error(`JsBridge ERROR: callback exists, id=${n}`);this.callbacks[n]={id:n,resolve:t,reject:r,created:Date.now()}}if(e.error){const t=e.error;e.error=function(e){return{name:e.name,message:e.message,stack:e.stack,code:e.code,data:e.data,key:e.key,info:e.info,className:e.className}}(t)}return null==e||delete e.resolve,null==e||delete e.reject,e}send({type:e,data:t,error:r,id:n,remoteId:i,sync:o=!1,scope:s}){const a=(a,c)=>{var d,u,l;let h=n;o||e!==I.REQUEST||(h=this.createCallbackId());try{const n=this.createPayload({id:h,data:t,error:r,type:e,origin:(null===(d=null===global||void 0===global?void 0:global.location)||void 0===d?void 0:d.origin)||"",remoteId:i,scope:s},{resolve:a,reject:c});let o=n;this.sendAsString&&(o=JSON.stringify(n)),(null===(u=this.debugLogger.jsBridge)||void 0===u?void 0:u.enabled)&&n&&n.id&&n.type===I.REQUEST&&(this._requestPayloadCache[n.id]=n,n.id%100==0&&(this._requestPayloadCache={})),this.debugLogger.jsBridge("send",n,"\r\n ------\x3e ",n.data,"\r\n ------\x3e ",null===(l=n.data)||void 0===l?void 0:l.result),this.sendPayload(o)}catch(e){h?this.rejectCallback(h,e):this.emit(U,e)}};if(!o)return new Promise(a);a()}rejectCallback(e,t){this.processCallback({method:"reject",id:e,error:t})}resolveCallback(e,t){this.processCallback({method:"resolve",id:e,data:t})}processCallback({method:e,id:t,data:r,error:n}){const i=this.callbacks[t];i&&("reject"===e&&(i.reject&&i.reject(n),this.emit(U,n)),"resolve"===e&&i.resolve&&i.resolve(r),this.clearCallbackCache(t))}rejectExpiredCallbacks(){if(!this.callbacksExpireTimeout)return;const e=Date.now();for(const t in this.callbacks){const r=this.callbacks[t];if(r&&r.created&&e-r.created>this.callbacksExpireTimeout){const e=q();this.rejectCallback(t,e)}}setTimeout((()=>{this.rejectExpiredCallbacks()}),this.callbacksExpireTimeout)}clearCallbackCache(e){delete this.callbacks[e]}receive(e="",t){var r,n,i,o,s;let d={data:null};if(a(e)&&(d=e),c(e))try{d=JSON.parse(e)}catch(f){throw this.emit(U,f),new Error("JsBridge ERROR: JSON.parse payloadReceived failed")}if(d.origin=null==t?void 0:t.origin,d.internal=Boolean(null==t?void 0:t.internal),(null==t?void 0:t.internal)&&this.isExtUi&&function(e){const t=e;return Boolean(t.name)&&["onekey-provider-eth","onekey-provider-cfx","publicConfig"].includes(t.name)}(d))return;if(!d.origin&&!this.isInjected)throw E(null===(r=null==this?void 0:this.constructor)||void 0===r?void 0:r.name,"[payload.origin] is missing.",this),new Error("JsBridge ERROR: receive message [payload.origin] is required.");if(!d.internal&&!d.scope)throw new Error("JsBridge ERROR: receive message [payload.scope] is required for non-internal method call.");const u=null!==(i=this._requestPayloadCache[null!==(n=null==d?void 0:d.id)&&void 0!==n?n:""])&&void 0!==i?i:null;this.debugLogger.jsBridge("receive",d,{sender:t},"\r\n -----\x3e ",null!==(s=null===(o=d.data)||void 0===o?void 0:o.result)&&void 0!==s?s:d.data,"\r\n <----- ",null==u?void 0:u.data);const{type:l,id:h,data:g,error:f,origin:p,remoteId:v}=d;if(this.remoteInfo={origin:p,remoteId:v},l===I.RESPONSE){if(null==h)throw new Error("JsBridge ERROR: parameter [id] is required in JsBridge.receive() when REQUEST type message");if(this.callbacks[h])try{f?this.rejectCallback(h,f):this.resolveCallback(h,g)}catch(e){this.emit(U,e)}}else{if(l!==I.REQUEST)throw new Error(`JsBridge ERROR: payload type not support yet (type=${l||"undefined"})`);{const e=Object.assign(Object.assign({},d),{created:Date.now()});this.emit(B,e)}}}requestSync({data:e,scope:t,remoteId:r}){this.send({id:void 0,type:I.REQUEST,scope:t,data:e,remoteId:r,sync:!0})}request(e){const{data:t,remoteId:r,scope:n}=e;return void 0===t&&console.warn("JsBridge ERROR: data required. Call like `bridge.request({ data: {...} });`"),this.send({type:I.REQUEST,data:t,remoteId:r,sync:!1,scope:n})}response({id:e,data:t,remoteId:r,scope:n}){this.send({type:I.RESPONSE,data:t,id:e,remoteId:r,scope:n,sync:!0})}responseError({id:e,error:t,scope:r,remoteId:n}){this.send({type:I.RESPONSE,error:t,id:e,remoteId:n,scope:r,sync:!0})}}var G=r(920),z=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};function V(e){return new Promise(((t,r)=>{try{const r=document.createElement("img");r.onload=()=>t(!0),r.onerror=()=>t(!1),r.src=e}catch(e){r(e)}}))}function H(e){const{document:t}=e,r=t.querySelector('head > meta[property="og:site_name"]');if(r)return r.content;const n=t.querySelector('head > meta[name="title"]');return n?n.content:t.title&&t.title.length>0?t.title:window.location.hostname}function W(e){return z(this,void 0,void 0,(function*(){const{document:t}=e,r=t.querySelectorAll('head > link[rel~="icon"]');for(const e of r)if(e&&(yield V(e.href)))return e.href;return null}))}const X={getSiteMetadata:function(){return z(this,void 0,void 0,(function*(){return{name:H(window),icon:yield W(window)}}))},getSiteIcon:W,getSiteName:H,imgExists:V};var K=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};class Q extends s{constructor(e){var t,r,n;if(super(),this.version=J,this.isOneKey=!0,this.debugLogger=R,this.logger=S,!e.bridge)throw new Error("ProviderBase init error: bridge required.");this.config=e,this.bridge=e.bridge,this.logger=e.logger||S,this.debugLogger=(null===(t=this.bridge)||void 0===t?void 0:t.debugLogger)||R,null===(n=null===(r=this.bridge)||void 0===r?void 0:r.debugLogger)||void 0===n||n._attachExternalLogger(this.logger),setTimeout((()=>{this.bridge.attachProviderInstance(this)}),0)}configDebugLogger(e){try{if(!e||!this.bridge.debugLogger)return;const t=this.bridge.debugLogger;(e.enabledKeys||[]).forEach((e=>{t._createDebugInstance(e)})),e.config&&t._debug.enable(e.config),window.$onekey=window.$onekey||{},window.$onekey.$debugLogger=t}catch(e){E("configDebugLogger ERROR:",e)}}getConnectWalletInfo({timeout:e=3e3}={}){return K(this,void 0,void 0,(function*(){return new Promise(((t,r)=>K(this,void 0,void 0,(function*(){const r=setTimeout((()=>{t(null)}),e);try{const e=yield this.bridgeRequest({method:"wallet_getConnectWalletInfo",params:[{time:Date.now()}]});e&&(e.providerState=e.providerState||{}),e&&e.debugLoggerConfig&&this.configDebugLogger(e.debugLoggerConfig),e&&e.walletInfo&&(window.$onekey=window.$onekey||{},window.$onekey.$walletInfo=e.walletInfo),t(e||null)}catch(e){E("getConnectWalletInfo: ERROR",e),t(null)}finally{clearTimeout(r)}}))))}))}bridgeRequest(e,t){var r,n,i,o;return K(this,void 0,void 0,(function*(){let s=!1;t&&G(t)&&(s=!0);try{const a={data:null!=e?e:{},scope:this.providerName};this.debugLogger.providerBase("bridgeRequest:",a,"\r\n -----\x3e ",a.data);const c=yield this.bridge.request(a);c&&(c.id=null!==(n=null!==(r=null==e?void 0:e.id)&&void 0!==r?r:c.id)&&void 0!==n?n:void 0,c.jsonrpc=null!==(o=null!==(i=null==e?void 0:e.jsonrpc)&&void 0!==i?i:c.jsonrpc)&&void 0!==o?o:"2.0");const d=c?c.result:void 0;return t&&s&&t(null,c),this.debugLogger.providerBase("bridgeRequest RETURN:",{req:a,res:c},"\r\n -----\x3e ",a.data,"\r\n -----\x3e ",d),d}catch(e){throw t&&s&&t(e),e}}))}sendSiteMetadataDomReady(){if("complete"===document.readyState)this.sendSiteMetadata();else{const e=()=>{this.sendSiteMetadata(),window.removeEventListener("DOMContentLoaded",e)};window.addEventListener("DOMContentLoaded",e)}}sendSiteMetadata(){return K(this,void 0,void 0,(function*(){const e=yield X.getSiteMetadata();return yield this.bridgeRequest({method:"wallet_sendSiteMetadata",params:e})}))}}function Y(e,t){const r=(null==t?void 0:t.providersHub)||window.$onekey,n=e.scope,i=e.data;if(!n)return void E("providerName (scope) is required in injectedProviderReceiveHandler.");const o=[].concat(r[n]).filter(Boolean);o&&o.length?o.forEach((e=>{e&&e.emit&&e.emit("message_low_level",i)})):E(`[${n}] provider is NOT injected to document or bridge.`)}const{JS_BRIDGE_MESSAGE_DIRECTION:Z,JS_BRIDGE_MESSAGE_EXT_CHANNEL:ee}=e;let te=!1;class re extends ${constructor(e){super(e),this.sendAsString=!1,this.isInjected=!0,function(e={}){const t=e.debugLogger||R;te||(te=!0,window.addEventListener("message",(e=>{var r;if(e.source!==window)return;const n=e.data;if(n.channel===ee&&n.direction===Z.HOST_TO_INPAGE){t.extInjected("onWindowPostMessage",n);const e=n.payload,i=null===(r=null===window||void 0===window?void 0:window.$onekey)||void 0===r?void 0:r.jsBridge;i&&i.receive(e)}}),!1))}({debugLogger:this.debugLogger})}sendPayload(e){window.postMessage({channel:ee,direction:Z.INPAGE_TO_HOST,payload:e})}}var ne=r(429),ie=r(378);const oe={errors:{disconnected:()=>"MetaMask: Disconnected from chain. Attempting to connect.",permanentlyDisconnected:()=>"MetaMask: Disconnected from MetaMask background. Page reload required.",sendSiteMetadata:()=>"MetaMask: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:e=>`MetaMask: The MetaMask Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`},info:{connected:e=>`MetaMask: Connected to chain with ID "${e}".`},warnings:{enableDeprecation:"MetaMask: 'ethereum.enable()' is deprecated and may be removed in the future. Please use the 'eth_requestAccounts' RPC method instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1102",sendDeprecation:"MetaMask: 'ethereum.send(...)' is deprecated and may be removed in the future. Please use 'ethereum.sendAsync(...)' or 'ethereum.request(...)' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193",events:{close:"MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect",data:"MetaMask: The event 'data' is deprecated and will be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message",networkChanged:"MetaMask: The event 'networkChanged' is deprecated and may be removed in the future. Use 'chainChanged' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#chainchanged",notification:"MetaMask: The event 'notification' is deprecated and may be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message"},experimentalMethods:"MetaMask: 'ethereum._metamask' exposes non-standard, experimental methods. They may be removed or changed without warning."}},se=()=>{},ae=["eth_subscription"];var ce=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};class de extends Q{constructor(e){var t;super(e),this.providerName=x.ethereum,this.isMetaMask=!0,this._log=null!==(t=e.logger)&&void 0!==t?t:window.console,this._state=Object.assign({},de._defaultState),this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleConnect=this._handleConnect.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this.request=this.request.bind(this),this._handleStreamDisconnect.bind(this,"OneKey"),this.on("connect",(()=>{this._state.isConnected=!0})),this._handleStreamDisconnect.bind(this,"OneKey RpcProvider"),this._initializeState(),this.on("message_low_level",(e=>{const{method:t,params:r}=e;"metamask_accountsChanged"===t?this._handleAccountsChanged(r):"metamask_unlockStateChanged"===t?this._handleUnlockStateChanged(r):"metamask_chainChanged"===t?this._handleChainChanged(r):ae.includes(t)?this.emit("message",{type:t,data:r}):"METAMASK_STREAM_FAILURE"===t&&new Error(oe.errors.permanentlyDisconnected())}))}isConnected(){return this._state.isConnected}request(e){return ce(this,void 0,void 0,(function*(){if(j.ethereum("request",e),!e||"object"!=typeof e||Array.isArray(e))throw ne.Sy.rpc.invalidRequest({message:oe.errors.invalidRequestArgs(),data:e});const{method:t,params:r,id:n}=e;if(!t||"string"!=typeof t||0===t.length)throw ne.Sy.rpc.invalidRequest({message:oe.errors.invalidRequestMethod(),data:e});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw ne.Sy.rpc.invalidRequest({message:oe.errors.invalidRequestParams(),data:e});const i=yield this._rpcRequest({method:t,params:r,id:n});return j.ethereum("request->response","\n",e,"\n ---\x3e ",i),i}))}_initializeState(){return ce(this,void 0,void 0,(function*(){try{const e=yield this.request({method:"metamask_getProviderState"}),{accounts:t,chainId:r,isUnlocked:n,networkVersion:i}=e;this.emit("connect",{chainId:r}),this._handleChainChanged({chainId:r,networkVersion:i}),this._handleUnlockStateChanged({accounts:t,isUnlocked:n}),this._handleAccountsChanged(t)}catch(e){this._log.error("MetaMask: Failed to get initial state. Please report this bug.",e)}finally{this._state.initialized=!0,this.emit("_initialized")}}))}_rpcRequest(e,t){return ce(this,void 0,void 0,(function*(){if(!Array.isArray(e)){e.jsonrpc||(e.jsonrpc="2.0");const r=yield this.bridgeRequest(e,t);return"eth_accounts"!==e.method&&"eth_requestAccounts"!==e.method||this._handleAccountsChanged(r||[],"eth_accounts"===e.method),r}return this.bridgeRequest(e,t)}))}_handleConnect(e){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:e}),this._log.debug(oe.info.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){let r;this._state.isConnected=!1,e?(r=new ne.Cg(1013,t||oe.errors.disconnected()),this._log.debug(r)):(r=new ne.Cg(1011,t||oe.errors.permanentlyDisconnected()),this._log.error(r),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",r)}}_handleStreamDisconnect(e,t){!function(e,t,r,n){let i=`MetaMask: Lost connection to "${t}".`;(null==r?void 0:r.stack)&&(i+=`\n${r.stack}`),e.warn(i),n&&n.listenerCount("error")>0&&n.emit("error",i)}(this._log,e,t,this),this._handleDisconnect(!1,t?t.message:void 0)}_handleChainChanged({chainId:e,networkVersion:t}={}){e&&"string"==typeof e&&e.startsWith("0x")&&t&&"string"==typeof t?"loading"===t?this._handleDisconnect(!0):(this._handleConnect(e),e!==this.chainId&&(this.chainId=e,this._state.initialized&&this.emit("chainChanged",this.chainId))):this._log.error("MetaMask: Received invalid network parameters. Please report this bug.",{chainId:e,networkVersion:t})}_handleAccountsChanged(e,t=!1){let r=e;Array.isArray(e)||(this._log.error("MetaMask: Received invalid accounts parameter. Please report this bug.",e),r=[]);for(const t of e)if("string"!=typeof t){this._log.error("MetaMask: Received non-string account. Please report this bug.",e),r=[];break}ie(this._state.accounts,r)||(t&&null!==this._state.accounts&&this._log.error("MetaMask: 'eth_accounts' unexpectedly updated accounts. Please report this bug.",r),this._state.accounts=r,this.selectedAddress!==r[0]&&(this.selectedAddress=r[0]||null),this._state.initialized&&this.emit("accountsChanged",r))}_handleUnlockStateChanged({accounts:e,isUnlocked:t}={}){"boolean"==typeof t?t!==this._state.isUnlocked&&(this._state.isUnlocked=t,this._handleAccountsChanged(e||[])):this._log.error("MetaMask: Received invalid isUnlocked parameter. Please report this bug.")}}de._defaultState={accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1};var ue,le,he=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};class ge extends de{constructor(e){super(e),this._sentWarnings={enable:!1,experimentalMethods:!1,send:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}},this.networkVersion=null,this.isMetaMask=!0,this._sendSync=this._sendSync.bind(this),this.enable=this.enable.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this._warnOfDeprecation=this._warnOfDeprecation.bind(this),this._metamask=this._getExperimentalApi(),this.bridge.on("notification",(e=>{const{method:t}=e;if(ae.includes(t)){this.emit("data",e);const t=e.params;this.emit("notification",t.result)}}))}sendAsync(e,t){this._rpcRequest(e,t)}addListener(e,t){return this._warnOfDeprecation(e),super.addListener(e,t)}on(e,t){return this._warnOfDeprecation(e),super.on(e,t)}once(e,t){return this._warnOfDeprecation(e),super.once(e,t)}prependListener(e,t){return this._warnOfDeprecation(e),super.prependListener(e,t)}prependOnceListener(e,t){return this._warnOfDeprecation(e),super.prependOnceListener(e,t)}_handleDisconnect(e,t){super._handleDisconnect(e,t),this.networkVersion&&!e&&(this.networkVersion=null)}_warnOfDeprecation(e){var t;!1===(null===(t=this._sentWarnings)||void 0===t?void 0:t.events[e])&&(this._log.warn(oe.warnings.events[e]),this._sentWarnings.events[e]=!0)}enable(){return he(this,void 0,void 0,(function*(){return this._sentWarnings.enable||(this._log.warn(oe.warnings.enableDeprecation),this._sentWarnings.enable=!0),yield this._rpcRequest({method:"eth_requestAccounts",params:[]})}))}_rpcResult(e,t){var r,n;return{id:null!==(r=null==t?void 0:t.id)&&void 0!==r?r:void 0,jsonrpc:null!==(n=null==t?void 0:t.jsonrpc)&&void 0!==n?n:"2.0",result:e}}send(e,t){return this._sentWarnings.send||(this._log.warn(oe.warnings.sendDeprecation),this._sentWarnings.send=!0),"string"!=typeof e||t&&!Array.isArray(t)?e&&"object"==typeof e&&"function"==typeof t?this._rpcRequest(e,t):this._sendSync(e):this._rpcRequest({method:e,params:t}).then((e=>this._rpcResult(e)))}_sendSync(e){let t;switch(e.method){case"eth_accounts":t=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":t=this.selectedAddress||null;break;case"eth_uninstallFilter":this._rpcRequest(e,se),t=!0;break;case"net_version":t=this.networkVersion||null;break;default:throw new Error(oe.errors.unsupportedSync(e.method))}return this._rpcResult(t,e)}_getExperimentalApi(){return new Proxy({isUnlocked:()=>he(this,void 0,void 0,(function*(){return this._state.initialized||(yield new Promise((e=>{this.on("_initialized",(()=>e()))}))),this._state.isUnlocked})),requestBatch:e=>he(this,void 0,void 0,(function*(){if(!Array.isArray(e))throw ne.Sy.rpc.invalidRequest({message:"Batch requests must be made with an array of request objects.",data:e});return this._rpcRequest(e)}))},{get:(e,t,...r)=>(this._sentWarnings.experimentalMethods||(this._log.warn(oe.warnings.experimentalMethods),this._sentWarnings.experimentalMethods=!0),Reflect.get(e,t,...r))})}_handleChainChanged({chainId:e,networkVersion:t}={}){super._handleChainChanged({chainId:e,networkVersion:t}),t&&"loading"!==t&&t!==this.networkVersion&&(this.networkVersion=t,this._state.initialized&&this.emit("networkChanged",this.networkVersion))}}class fe extends ge{}class pe extends Q{constructor(e){super(e),this.providerName=x.$private;try{this.getConnectWalletInfo()}catch(e){console.error(e)}try{this.sendSiteMetadataDomReady()}catch(e){console.error(e)}}request(e){return this.bridgeRequest(e)}}ue=()=>new re({receiveHandler:Y}),window.global=window.global||window||window.globalThis,window.global=window.global||window||window.globalThis,(null===(le=null===window||void 0===window?void 0:window.$onekey)||void 0===le?void 0:le.jsBridge)||(window.$onekey=window.$onekey||{},window.$onekey.jsBridge=ue(),"undefined"!=typeof localStorage&&localStorage.getItem(m)&&console.log("===== jsBridge injected success! >>>>> ",performance.now())),window.$onekey.jsBridge,function(){var e,t;if(!(null===(e=null===window||void 0===window?void 0:window.$onekey)||void 0===e?void 0:e.jsBridge))throw new Error("OneKey jsBridge not found.");const r=null===(t=null===window||void 0===window?void 0:window.$onekey)||void 0===t?void 0:t.jsBridge,n=new fe({bridge:r}),i=new pe({bridge:r}),o=Object.assign(Object.assign({},window.$onekey),{jsBridge:r,ethereum:n,$private:i,solana:null,conflux:null,sollet:null});window.$onekey=o,window.ethereum=n,function(e,t=console){let r=!1,n=!1;if(!window.web3){const i="__isMetaMaskShim__",o="__isOneKeyShim__";let s={currentProvider:e};Object.defineProperty(s,i,{value:!0,enumerable:!0,configurable:!1,writable:!1}),Object.defineProperty(s,o,{value:!0,enumerable:!0,configurable:!1,writable:!1}),s=new Proxy(s,{get:(o,s,...a)=>("currentProvider"!==s||r?"currentProvider"===s||s===i||n||(n=!0,t.error("MetaMask no longer injects web3. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),e.request({method:"metamask_logWeb3ShimUsage"}).catch((e=>{t.debug("MetaMask: Failed to log web3 shim usage.",e)}))):(r=!0,t.warn("You are accessing the MetaMask window.web3.currentProvider shim. This property is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3")),Reflect.get(o,s,...a)),set:(...e)=>(t.warn("You are accessing the MetaMask window.web3 shim. This object is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),Reflect.set(...e))}),Object.defineProperty(window,"web3",{value:s,enumerable:!1,configurable:!0,writable:!0})}}(n),window.dispatchEvent(new Event("ethereum#initialized"))}(),console.log("======== injected.js in extension done! >>>>>>> ",performance.now())})(),n})()}));
1
+ /*! For license information please see injectedExtension.js.LICENSE.txt */
2
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(){return(()=>{var t={9378:t=>{"use strict";t.exports=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if((n=e.length)!=r.length)return!1;for(i=n;0!=i--;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var s=o[i];if(!t(e[s],r[s]))return!1}return!0}return e!=e&&r!=r}},4563:(t,e,r)=>{var n=r(19).Symbol;t.exports=n},2325:(t,e,r)=>{var n=r(4563),i=r(6544),o=r(9252),s=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?i(t):o(t)}},6008:(t,e,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=n},9723:(t,e,r)=>{var n=r(1539)(Object.getPrototypeOf,Object);t.exports=n},6544:(t,e,r)=>{var n=r(4563),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=n?n.toStringTag:void 0;t.exports=function(t){var e=o.call(t,a),r=t[a];try{t[a]=void 0;var n=!0}catch(t){}var i=s.call(t);return n&&(e?t[a]=r:delete t[a]),i}},9252:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},1539:t=>{t.exports=function(t,e){return function(r){return t(e(r))}}},19:(t,e,r)=>{var n=r(6008),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();t.exports=o},9906:t=>{var e=Array.isArray;t.exports=e},5920:(t,e,r)=>{var n=r(2325),i=r(6464);t.exports=function(t){if(!i(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},6464:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},2612:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},8395:(t,e,r)=>{var n=r(2325),i=r(9723),o=r(2612),s=Function.prototype,a=Object.prototype,u=s.toString,f=a.hasOwnProperty,h=u.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=n(t))return!1;var e=i(t);if(null===e)return!0;var r=f.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==h}},2788:(t,e,r)=>{var n=r(2325),i=r(9906),o=r(2612);t.exports=function(t){return"string"==typeof t||!i(t)&&o(t)&&"[object String]"==n(t)}},4554:t=>{var e=1e3,r=60*e,n=60*r,i=24*n;function o(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}t.exports=function(t,s){s=s||{};var a,u,f=typeof t;if("string"===f&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===f&&isFinite(t))return s.long?(a=t,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=n?o(a,u,n,"hour"):u>=r?o(a,u,r,"minute"):u>=e?o(a,u,e,"second"):a+" ms"):function(t){var o=Math.abs(t);return o>=i?Math.round(t/i)+"d":o>=n?Math.round(t/n)+"h":o>=r?Math.round(t/r)+"m":o>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},9439:t=>{t.exports=s,s.default=s,s.stable=h,s.stableStringify=h;var e="[...]",r="[Circular]",n=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(t,e,r,s){var a;void 0===s&&(s=o()),u(t,"",0,[],void 0,0,s);try{a=0===i.length?JSON.stringify(t,e,r):JSON.stringify(t,d(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var f=n.pop();4===f.length?Object.defineProperty(f[0],f[1],f[3]):f[0][f[1]]=f[2]}}return a}function a(t,e,r,o){var s=Object.getOwnPropertyDescriptor(o,r);void 0!==s.get?s.configurable?(Object.defineProperty(o,r,{value:t}),n.push([o,r,e,s])):i.push([e,r,t]):(o[r]=t,n.push([o,r,e]))}function u(t,n,i,o,s,f,h){var c;if(f+=1,"object"==typeof t&&null!==t){for(c=0;c<o.length;c++)if(o[c]===t)return void a(r,t,n,s);if(void 0!==h.depthLimit&&f>h.depthLimit)return void a(e,t,n,s);if(void 0!==h.edgesLimit&&i+1>h.edgesLimit)return void a(e,t,n,s);if(o.push(t),Array.isArray(t))for(c=0;c<t.length;c++)u(t[c],c,c,o,t,f,h);else{var d=Object.keys(t);for(c=0;c<d.length;c++){var l=d[c];u(t[l],l,c,o,t,f,h)}}o.pop()}}function f(t,e){return t<e?-1:t>e?1:0}function h(t,e,r,s){void 0===s&&(s=o());var a,u=c(t,"",0,[],void 0,0,s)||t;try{a=0===i.length?JSON.stringify(u,e,r):JSON.stringify(u,d(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var f=n.pop();4===f.length?Object.defineProperty(f[0],f[1],f[3]):f[0][f[1]]=f[2]}}return a}function c(t,i,o,s,u,h,d){var l;if(h+=1,"object"==typeof t&&null!==t){for(l=0;l<s.length;l++)if(s[l]===t)return void a(r,t,i,u);try{if("function"==typeof t.toJSON)return}catch(t){return}if(void 0!==d.depthLimit&&h>d.depthLimit)return void a(e,t,i,u);if(void 0!==d.edgesLimit&&o+1>d.edgesLimit)return void a(e,t,i,u);if(s.push(t),Array.isArray(t))for(l=0;l<t.length;l++)c(t[l],l,l,s,t,h,d);else{var p={},b=Object.keys(t).sort(f);for(l=0;l<b.length;l++){var g=b[l];c(t[g],g,l,s,t,h,d),p[g]=t[g]}if(void 0===u)return p;n.push([u,i,t]),u[i]=p}s.pop()}}function d(t){return t=void 0!==t?t:function(t,e){return e},function(e,r){if(i.length>0)for(var n=0;n<i.length;n++){var o=i[n];if(o[1]===e&&o[0]===r){r=o[2],i.splice(n,1);break}}return t.call(this,e,r)}}},8298:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}b(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&b(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function f(t,e,r,n){var i,o,s,f;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(t))>0&&s.length>i&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=s.length,f=h,console&&console.warn&&console.warn(f)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function d(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):p(i,i.length)}function l(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function b(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){n.once&&t.removeEventListener(e,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else{var f=u.length,h=p(u,f);for(r=0;r<f;++r)n(h[r],this,e)}return!0},o.prototype.addListener=function(t,e){return f(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return f(this,t,e,!0)},o.prototype.once=function(t,e){return a(e),this.on(t,c(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,c(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,n,i,o,s;if(a(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return d(this,t,!0)},o.prototype.rawListeners=function(t){return d(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):l.call(t,e)},o.prototype.listenerCount=l,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},3744:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EthereumProviderError=e.EthereumRpcError=void 0;const n=r(990);class i extends Error{constructor(t,e,r){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw new Error('"message" must be a nonempty string.');super(e),this.code=t,void 0!==r&&(this.data=r)}serialize(){const t={code:this.code,message:this.message};return void 0!==this.data&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return n.default(this.serialize(),o,2)}}function o(t,e){if("[Circular]"!==e)return e}e.EthereumRpcError=i,e.EthereumProviderError=class extends i{constructor(t,e,r){if(!function(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,e,r)}}},1770:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.errorValues=e.errorCodes=void 0,e.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},e.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},9620:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ethErrors=void 0;const n=r(3744),i=r(8649),o=r(1770);function s(t,e){const[r,o]=u(e);return new n.EthereumRpcError(t,r||i.getMessageFromCode(t),o)}function a(t,e){const[r,o]=u(e);return new n.EthereumProviderError(t,r||i.getMessageFromCode(t),o)}function u(t){if(t){if("string"==typeof t)return[t];if("object"==typeof t&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&"string"!=typeof e)throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}e.ethErrors={rpc:{parse:t=>s(o.errorCodes.rpc.parse,t),invalidRequest:t=>s(o.errorCodes.rpc.invalidRequest,t),invalidParams:t=>s(o.errorCodes.rpc.invalidParams,t),methodNotFound:t=>s(o.errorCodes.rpc.methodNotFound,t),internal:t=>s(o.errorCodes.rpc.internal,t),server:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return s(e,t)},invalidInput:t=>s(o.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>s(o.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>s(o.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>s(o.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>s(o.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>s(o.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>a(o.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>a(o.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>a(o.errorCodes.provider.unsupportedMethod,t),disconnected:t=>a(o.errorCodes.provider.disconnected,t),chainDisconnected:t=>a(o.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:i}=t;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new n.EthereumProviderError(e,r,i)}}}},8429:(t,e,r)=>{"use strict";e.Cg=e.Sy=void 0;const n=r(3744);Object.defineProperty(e,"Cg",{enumerable:!0,get:function(){return n.EthereumRpcError}});r(8649);const i=r(9620);Object.defineProperty(e,"Sy",{enumerable:!0,get:function(){return i.ethErrors}});r(1770)},8649:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=r(1770),i=r(3744),o=n.errorCodes.rpc.internal,s={code:o,message:a(o)};function a(t,r="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(t)){const r=t.toString();if(c(n.errorValues,r))return n.errorValues[r].message;if(f(t))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function u(t){if(!Number.isInteger(t))return!1;const e=t.toString();return!!n.errorValues[e]||!!f(t)}function f(t){return t>=-32099&&t<=-32e3}function h(t){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign({},t):t}function c(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=a,e.isValidCode=u,e.serializeError=function(t,{fallbackError:e=s,shouldIncludeStack:r=!1}={}){var n,o;if(!e||!Number.isInteger(e.code)||"string"!=typeof e.message)throw new Error("Must provide fallback error with integer number code and string message.");if(t instanceof i.EthereumRpcError)return t.serialize();const f={};if(t&&"object"==typeof t&&!Array.isArray(t)&&c(t,"code")&&u(t.code)){const e=t;f.code=e.code,e.message&&"string"==typeof e.message?(f.message=e.message,c(e,"data")&&(f.data=e.data)):(f.message=a(f.code),f.data={originalError:h(t)})}else{f.code=e.code;const r=null===(n=t)||void 0===n?void 0:n.message;f.message=r&&"string"==typeof r?r:e.message,f.data={originalError:h(t)}}const d=null===(o=t)||void 0===o?void 0:o.stack;return r&&t&&d&&"string"==typeof d&&(f.stack=d),f}},990:t=>{t.exports=s,s.default=s,s.stable=h,s.stableStringify=h;var e="[...]",r="[Circular]",n=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(t,e,r,s){var a;void 0===s&&(s=o()),u(t,"",0,[],void 0,0,s);try{a=0===i.length?JSON.stringify(t,e,r):JSON.stringify(t,d(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var f=n.pop();4===f.length?Object.defineProperty(f[0],f[1],f[3]):f[0][f[1]]=f[2]}}return a}function a(t,e,r,o){var s=Object.getOwnPropertyDescriptor(o,r);void 0!==s.get?s.configurable?(Object.defineProperty(o,r,{value:t}),n.push([o,r,e,s])):i.push([e,r,t]):(o[r]=t,n.push([o,r,e]))}function u(t,n,i,o,s,f,h){var c;if(f+=1,"object"==typeof t&&null!==t){for(c=0;c<o.length;c++)if(o[c]===t)return void a(r,t,n,s);if(void 0!==h.depthLimit&&f>h.depthLimit)return void a(e,t,n,s);if(void 0!==h.edgesLimit&&i+1>h.edgesLimit)return void a(e,t,n,s);if(o.push(t),Array.isArray(t))for(c=0;c<t.length;c++)u(t[c],c,c,o,t,f,h);else{var d=Object.keys(t);for(c=0;c<d.length;c++){var l=d[c];u(t[l],l,c,o,t,f,h)}}o.pop()}}function f(t,e){return t<e?-1:t>e?1:0}function h(t,e,r,s){void 0===s&&(s=o());var a,u=c(t,"",0,[],void 0,0,s)||t;try{a=0===i.length?JSON.stringify(u,e,r):JSON.stringify(u,d(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var f=n.pop();4===f.length?Object.defineProperty(f[0],f[1],f[3]):f[0][f[1]]=f[2]}}return a}function c(t,i,o,s,u,h,d){var l;if(h+=1,"object"==typeof t&&null!==t){for(l=0;l<s.length;l++)if(s[l]===t)return void a(r,t,i,u);try{if("function"==typeof t.toJSON)return}catch(t){return}if(void 0!==d.depthLimit&&h>d.depthLimit)return void a(e,t,i,u);if(void 0!==d.edgesLimit&&o+1>d.edgesLimit)return void a(e,t,i,u);if(s.push(t),Array.isArray(t))for(l=0;l<t.length;l++)c(t[l],l,l,s,t,h,d);else{var p={},b=Object.keys(t).sort(f);for(l=0;l<b.length;l++){var g=b[l];c(t[g],g,l,s,t,h,d),p[g]=t[g]}if(void 0===u)return p;n.push([u,i,t]),u[i]=p}s.pop()}}function d(t){return t=void 0!==t?t:function(t,e){return e},function(e,r){if(i.length>0)for(var n=0;n<i.length;n++){var o=i[n];if(o[1]===e&&o[0]===r){r=o[2],i.splice(n,1);break}}return t.call(this,e,r)}}},7550:t=>{t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports},9012:t=>{function e(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}t.exports=function(t){return function(){var r=this,n=arguments;return new Promise((function(i,o){var s=t.apply(r,n);function a(t){e(s,i,o,a,u,"next",t)}function u(t){e(s,i,o,a,u,"throw",t)}a(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},6852:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},7599:t=>{function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},2905:t=>{function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},3729:(t,e,r)=>{var n=r(7190);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports},3148:t=>{t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.__esModule=!0,t.exports.default=t.exports},7972:(t,e,r)=>{var n=r(9444).default,i=r(7550);t.exports=function(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return i(t)},t.exports.__esModule=!0,t.exports.default=t.exports},7190:t=>{function e(r,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r,n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},9444:t=>{function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},9963:(t,e,r)=>{t.exports=r(6770)},4920:(t,e,r)=>{"use strict";e._O=e.Jq=e.KB=e.u8=e.cv=void 0,e.Ik=e.A9=e.n_=e.gM=void 0;const n=r(7487);function i(t){if(!(t instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}function o(t){return i(t),n.Buffer.from(t.buffer,t.byteOffset,t.length)}class s{constructor(t,e){if(!Number.isInteger(t))throw new TypeError("span must be an integer");this.span=t,this.property=e}makeDestinationObject(){return{}}getSpan(t,e){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(t){const e=Object.create(this.constructor.prototype);return Object.assign(e,this),e.property=t,e}fromArray(t){}}function a(t,e){return e.property?t+"["+e.property+"]":t}class u extends s{isCount(){throw new Error("ExternalLayout is abstract")}}class f extends u{constructor(t,e=0,r){if(!(t instanceof s))throw new TypeError("layout must be a Layout");if(!Number.isInteger(e))throw new TypeError("offset must be integer or undefined");super(t.span,r||t.property),this.layout=t,this.offset=e}isCount(){return this.layout instanceof h||this.layout instanceof c}decode(t,e=0){return this.layout.decode(t,e+this.offset)}encode(t,e,r=0){return this.layout.encode(t,e,r+this.offset)}}class h extends s{constructor(t,e){if(super(t,e),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntLE(e,this.span)}encode(t,e,r=0){return o(e).writeUIntLE(t,r,this.span),this.span}}class c extends s{constructor(t,e){if(super(t,e),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntBE(e,this.span)}encode(t,e,r=0){return o(e).writeUIntBE(t,r,this.span),this.span}}const d=Math.pow(2,32);function l(t){const e=Math.floor(t/d);return{hi32:e,lo32:t-e*d}}function p(t,e){return t*d+e}class b extends s{constructor(t){super(8,t)}decode(t,e=0){const r=o(t),n=r.readUInt32LE(e);return p(r.readUInt32LE(e+4),n)}encode(t,e,r=0){const n=l(t),i=o(e);return i.writeUInt32LE(n.lo32,r),i.writeUInt32LE(n.hi32,r+4),8}}class g extends s{constructor(t){super(8,t)}decode(t,e=0){const r=o(t),n=r.readUInt32LE(e);return p(r.readInt32LE(e+4),n)}encode(t,e,r=0){const n=l(t),i=o(e);return i.writeUInt32LE(n.lo32,r),i.writeInt32LE(n.hi32,r+4),8}}class y extends s{constructor(t,e,r){if(!(t instanceof s))throw new TypeError("elementLayout must be a Layout");if(!(e instanceof u&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let n=-1;!(e instanceof u)&&0<t.span&&(n=e*t.span),super(n,r),this.elementLayout=t,this.count=e}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0,n=this.count;if(n instanceof u&&(n=n.decode(t,e)),0<this.elementLayout.span)r=n*this.elementLayout.span;else{let i=0;for(;i<n;)r+=this.elementLayout.getSpan(t,e+r),++i}return r}decode(t,e=0){const r=[];let n=0,i=this.count;for(i instanceof u&&(i=i.decode(t,e));n<i;)r.push(this.elementLayout.decode(t,e)),e+=this.elementLayout.getSpan(t,e),n+=1;return r}encode(t,e,r=0){const n=this.elementLayout,i=t.reduce(((t,i)=>t+n.encode(i,e,r+t)),0);return this.count instanceof u&&this.count.encode(t.length,e,r),i}}class m extends s{constructor(t,e,r){if(!Array.isArray(t)||!t.reduce(((t,e)=>t&&e instanceof s),!0))throw new TypeError("fields must be array of Layout instances");"boolean"==typeof e&&void 0===r&&(r=e,e=void 0);for(const e of t)if(0>e.span&&void 0===e.property)throw new Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=t.reduce(((t,e)=>t+e.getSpan()),0)}catch(t){}super(n,e),this.fields=t,this.decodePrefixes=!!r}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce(((r,n)=>{const i=n.getSpan(t,e);return e+=i,r+i}),0)}catch(t){throw new RangeError("indeterminate span")}return r}decode(t,e=0){i(t);const r=this.makeDestinationObject();for(const n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(t,e)),e+=n.getSpan(t,e),this.decodePrefixes&&t.length===e)break;return r}encode(t,e,r=0){const n=r;let i=0,o=0;for(const n of this.fields){let s=n.span;if(o=0<s?s:0,void 0!==n.property){const i=t[n.property];void 0!==i&&(o=n.encode(i,e,r),0>s&&(s=n.getSpan(e,r)))}i=r,r+=s}return i+o-n}fromArray(t){const e=this.makeDestinationObject();for(const r of this.fields)void 0!==r.property&&0<t.length&&(e[r.property]=t.shift());return e}layoutFor(t){if("string"!=typeof t)throw new TypeError("property must be string");for(const e of this.fields)if(e.property===t)return e}offsetOf(t){if("string"!=typeof t)throw new TypeError("property must be string");let e=0;for(const r of this.fields){if(r.property===t)return e;0>r.span?e=-1:0<=e&&(e+=r.span)}}}class v extends s{constructor(t,e){if(!(t instanceof u&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;t instanceof u||(r=t),super(r,e),this.length=t}getSpan(t,e){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),r}decode(t,e=0){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),o(t).slice(e,e+r)}encode(t,e,r){let n=this.length;if(this.length instanceof u&&(n=t.length),!(t instanceof Uint8Array&&n===t.length))throw new TypeError(a("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>e.length)throw new RangeError("encoding overruns Uint8Array");const i=o(t);return o(e).write(i.toString("hex"),r,n,"hex"),this.length instanceof u&&this.length.encode(n,e,r),n}}e.cv=(t,e,r)=>new f(t,e,r),e.u8=t=>new h(1,t),e.KB=t=>new h(2,t),e.Jq=t=>new h(4,t),e._O=t=>new b(t),e.gM=t=>new g(t),e.n_=(t,e,r)=>new m(t,e,r),e.A9=(t,e,r)=>new y(t,e,r),e.Ik=(t,e)=>new v(t,e)},7487:(t,e,r)=>{"use strict";const n=r(3350),i=r(3575),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return f(t,e,r)}function f(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|b(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(H(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(H(t,ArrayBuffer)||t&&H(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(H(t,SharedArrayBuffer)||t&&H(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Z(t.length)?a(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return h(t),a(t<0?0:0|p(t))}function d(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function p(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function b(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(i)return n?-1:$(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<a;o++)if(f(t,o)===f(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(f(t,o+n)!==f(e,n)){r=!1;break}if(r)return o}return-1}function w(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if(Z(n))return s;t[r+s]=n}return s}function M(t,e,r,n){return V($(e,t.length-r),t,r,n)}function _(t,e,r,n){return V(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return V(G(e),t,r,n)}function A(t,e,r,n){return V(function(t,e){let r,n,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=x));return r}(n)}e.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return f(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},u.allocUnsafe=function(t){return c(t)},u.allocUnsafeSlow=function(t){return c(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(H(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),H(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=u.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(H(e,Uint8Array))i+e.length>n.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=b,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)y(this,e,e+1);return this},u.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},u.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?k(this,0,t):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(H(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),f=this.slice(n,i),h=t.slice(e,r);for(let t=0;t<a;++t)if(f[t]!==h[t]){o=f[t],s=h[t];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return M(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function I(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function R(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=Y[t[n]];return i}function O(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function P(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function T(t,e,r,n,i){D(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function U(t,e,r,n,i){D(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function z(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=X((function(t){K(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(t){K(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=X((function(t){K(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),u.prototype.readBigInt64BE=X((function(t){K(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=X((function(t,e=0){return T(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=X((function(t,e=0){return T(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return z(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return z(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=u.isBuffer(t)?t:u.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};const j={};function q(t,e,r){j[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function F(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function D(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){K(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||W(e,t.length-(r+1))}(n,i,o)}function K(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function W(t,e,r){if(Math.floor(t)!==t)throw K(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),q("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=F(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const J=/[^+/0-9A-Za-z-_]/g;function $(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function H(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Z(t){return t!=t}const Y=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function X(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},6565:(t,e,r)=>{var n=r(6504);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},6504:(t,e,r)=>{"use strict";var n=r(7547).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(255!==e[s])throw new TypeError(o+" is ambiguous");e[s]=i}var a=t.length,u=t.charAt(0),f=Math.log(a)/Math.log(256),h=Math.log(256)/Math.log(a);function c(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,i=0,o=0;t[r]===u;)i++,r++;for(var s=(t.length-r)*f+1>>>0,h=new Uint8Array(s);t[r];){var c=e[t.charCodeAt(r)];if(255===c)return;for(var d=0,l=s-1;(0!==c||d<o)&&-1!==l;l--,d++)c+=a*h[l]>>>0,h[l]=c%256>>>0,c=c/256>>>0;if(0!==c)throw new Error("Non-zero carry");o=d,r++}for(var p=s-o;p!==s&&0===h[p];)p++;var b=n.allocUnsafe(i+(s-p));b.fill(0,0,i);for(var g=i;p!==s;)b[g++]=h[p++];return b}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,s=e.length;o!==s&&0===e[o];)o++,r++;for(var f=(s-o)*h+1>>>0,c=new Uint8Array(f);o!==s;){for(var d=e[o],l=0,p=f-1;(0!==d||l<i)&&-1!==p;p--,l++)d+=256*c[p]>>>0,c[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");i=l,o++}for(var b=f-i;b!==f&&0===c[b];)b++;for(var g=u.repeat(r);b<f;++b)g+=t.charAt(c[b]);return g},decodeUnsafe:c,decode:function(t){var e=c(t);if(e)return e;throw new Error("Non-base"+a+" character")}}}},3350:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],f=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),h=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],f[h++]=e>>16&255,f[h++]=e>>8&255,f[h++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,f[h++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,f[h++]=e>>8&255,f[h++]=255&e),f},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(f(t,a,a+s>u?u:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},7543:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(5377).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);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 "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function f(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var f=t.charCodeAt(u)-48;o*=i,s=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&s<i,"Invalid character"),o+=s}return o}function h(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype._move=function(t){h(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){o.prototype.inspect=c}else o.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function b(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var f=1;f<n;f++){for(var h=u>>>26,c=67108863&u,d=Math.min(f,e.length-1),l=Math.max(0,f-t.length+1);l<=d;l++){var p=f-l|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&s}r.words[f]=0|c,u=0|h}return 0!==u?r.words[f]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?d[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var f=l[t],h=p[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var b=c.modrn(h).toString(t);r=(c=c.idivn(h)).isZero()?b+r:d[f-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,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 s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,f=0,h=0|s[0],c=8191&h,d=h>>>13,l=0|s[1],p=8191&l,b=l>>>13,g=0|s[2],y=8191&g,m=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,_=0|s[4],S=8191&_,A=_>>>13,E=0|s[5],k=8191&E,x=E>>>13,I=0|s[6],B=8191&I,R=I>>>13,O=0|s[7],P=8191&O,C=O>>>13,T=0|s[8],U=8191&T,L=T>>>13,N=0|s[9],z=8191&N,j=N>>>13,q=0|a[0],F=8191&q,D=q>>>13,K=0|a[1],W=8191&K,J=K>>>13,$=0|a[2],G=8191&$,V=$>>>13,H=0|a[3],Z=8191&H,Y=H>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ft=at>>>13,ht=0|a[8],ct=8191&ht,dt=ht>>>13,lt=0|a[9],pt=8191&lt,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(f+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,D))+Math.imul(d,F)|0))<<13)|0;f=((o=Math.imul(d,D))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,D))+Math.imul(b,F)|0,o=Math.imul(b,D);var yt=(f+(n=n+Math.imul(c,W)|0)|0)+((8191&(i=(i=i+Math.imul(c,J)|0)+Math.imul(d,W)|0))<<13)|0;f=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,D))+Math.imul(m,F)|0,o=Math.imul(m,D),n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,J)|0;var mt=(f+(n=n+Math.imul(c,G)|0)|0)+((8191&(i=(i=i+Math.imul(c,V)|0)+Math.imul(d,G)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,D))+Math.imul(M,F)|0,o=Math.imul(M,D),n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,J)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,V)|0;var vt=(f+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(d,Z)|0))<<13)|0;f=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,D))+Math.imul(A,F)|0,o=Math.imul(A,D),n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,V)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,Y)|0;var wt=(f+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,D))+Math.imul(x,F)|0,o=Math.imul(x,D),n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var Mt=(f+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(d,rt)|0))<<13)|0;f=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,D))+Math.imul(R,F)|0,o=Math.imul(R,D),n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var _t=(f+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(d,ot)|0))<<13)|0;f=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,D))+Math.imul(C,F)|0,o=Math.imul(C,D),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(k,G)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,V)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0;var St=(f+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((o=o+Math.imul(d,ft)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,F),i=(i=Math.imul(U,D))+Math.imul(L,F)|0,o=Math.imul(L,D),n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(B,G)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0;var At=(f+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;f=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(z,F),i=(i=Math.imul(z,D))+Math.imul(j,F)|0,o=Math.imul(j,D),n=n+Math.imul(U,W)|0,i=(i=i+Math.imul(U,J)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,Y)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ft)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,dt)|0;var Et=(f+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,bt)|0)+Math.imul(d,pt)|0))<<13)|0;f=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(z,W),i=(i=Math.imul(z,J))+Math.imul(j,W)|0,o=Math.imul(j,J),n=n+Math.imul(U,G)|0,i=(i=i+Math.imul(U,V)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,V)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ft)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,dt)|0;var kt=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,G),i=(i=Math.imul(z,V))+Math.imul(j,G)|0,o=Math.imul(j,V),n=n+Math.imul(U,Z)|0,i=(i=i+Math.imul(U,Y)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,Y)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ft)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,dt)|0;var xt=(f+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,bt)|0)+Math.imul(m,pt)|0))<<13)|0;f=((o=o+Math.imul(m,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(z,Z),i=(i=Math.imul(z,Y))+Math.imul(j,Z)|0,o=Math.imul(j,Y),n=n+Math.imul(U,Q)|0,i=(i=i+Math.imul(U,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ft)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,dt)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,dt)|0;var It=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(M,pt)|0))<<13)|0;f=((o=o+Math.imul(M,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(U,rt)|0,i=(i=i+Math.imul(U,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ft)|0,n=n+Math.imul(k,ct)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,dt)|0;var Bt=(f+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,bt)|0)+Math.imul(A,pt)|0))<<13)|0;f=((o=o+Math.imul(A,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(z,rt),i=(i=Math.imul(z,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(U,ot)|0,i=(i=i+Math.imul(U,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ft)|0,n=n+Math.imul(B,ct)|0,i=(i=i+Math.imul(B,dt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,dt)|0;var Rt=(f+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,bt)|0)+Math.imul(x,pt)|0))<<13)|0;f=((o=o+Math.imul(x,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(z,ot),i=(i=Math.imul(z,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(U,ut)|0,i=(i=i+Math.imul(U,ft)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ft)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,dt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,dt)|0;var Ot=(f+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,bt)|0)+Math.imul(R,pt)|0))<<13)|0;f=((o=o+Math.imul(R,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(z,ut),i=(i=Math.imul(z,ft))+Math.imul(j,ut)|0,o=Math.imul(j,ft),n=n+Math.imul(U,ct)|0,i=(i=i+Math.imul(U,dt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,dt)|0;var Pt=(f+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,bt)|0)+Math.imul(C,pt)|0))<<13)|0;f=((o=o+Math.imul(C,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(z,ct),i=(i=Math.imul(z,dt))+Math.imul(j,ct)|0,o=Math.imul(j,dt);var Ct=(f+(n=n+Math.imul(U,pt)|0)|0)+((8191&(i=(i=i+Math.imul(U,bt)|0)+Math.imul(L,pt)|0))<<13)|0;f=((o=o+Math.imul(L,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Tt=(f+(n=Math.imul(z,pt))|0)+((8191&(i=(i=Math.imul(z,bt))+Math.imul(j,pt)|0))<<13)|0;return f=((o=Math.imul(j,bt))+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,u[0]=gt,u[1]=yt,u[2]=mt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=St,u[8]=At,u[9]=Et,u[10]=kt,u[11]=xt,u[12]=It,u[13]=Bt,u[14]=Rt,u[15]=Ot,u[16]=Pt,u[17]=Ct,u[18]=Tt,0!==f&&(u[19]=f,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),f=Math.max(0,o-t.length+1);f<=u;f++){var h=o-f,c=(0|t.words[h])*(0|e.words[f]),d=67108863&c;a=67108863&(d=d+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function m(t,e,r){return y(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(g=b),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?b(this,t,e):r<1024?y(this,t,e):m(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},v.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},v.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),f=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var c=u,d=f,l=0;l<s;l++){var p=r[h+l],b=n[h+l],g=r[h+l+s],y=n[h+l+s],m=c*g-d*y;y=c*y+d*g,g=m,r[h+l]=p+g,n[h+l]=b+y,r[h+l+s]=p-g,n[h+l+s]=b-y,l!==a&&(m=u*c-f*d,d=u*d+f*c,c=m)}},v.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},v.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},v.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},v.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},v.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),f=new Array(n),h=new Array(n),c=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,f,n),this.transform(s,o,a,u,n,i),this.transform(f,o,h,c,n,i);for(var l=0;l<n;l++){var p=a[l]*h[l]-u[l]*c[l];u[l]=a[l]*c[l]+u[l]*h[l],a[l]=p}return this.conjugate(a,u,n),this.transform(a,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var f=0;f<s;f++)u.words[f]=this.words[f];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,f=0;f<this.length;f++)this.words[f]=this.words[f+s];else this.words[0]=0,this.length=1;var h=0;for(f=this.length-1;f>=0&&(0!==h||f>=i);f--){var c=0|this.words[f];this.words[f]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var f=0;f<a.length;f++)a.words[f]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var d=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,c);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=d)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function M(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}M.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},M.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},M.prototype.split=function(t,e){t.iushrn(this.n,0,e)},M.prototype.imulK=function(t){return t.imul(this.k)},i(_,M),_.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(S,M),i(A,M),i(E,M),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new S;else if("p192"===t)e=new A;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return w[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,f).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=s;0!==l.cmp(a);){for(var b=l,g=0;0!==b.cmp(a);g++)b=b.redSqr();n(g<p);var y=this.pow(c,new o(1).iushln(p-g-1));d=d.redMul(y),c=y.redSqr(),l=l.redMul(c),p=g}return d},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var f=e.words[n],h=u-1;h>=0;h--){var c=f>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new x(t)},i(x,k),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},9989:function(t,e,r){"use strict";var n=r(5326).Buffer,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeUnchecked=e.deserialize=e.serialize=e.BinaryReader=e.BinaryWriter=e.BorshError=e.baseDecode=e.baseEncode=void 0;const f=u(r(7543)),h=u(r(3534)),c=a(r(9967)),d=new("function"!=typeof TextDecoder?c.TextDecoder:TextDecoder)("utf-8",{fatal:!0});e.baseEncode=function(t){return"string"==typeof t&&(t=n.from(t,"utf8")),h.default.encode(n.from(t))},e.baseDecode=function(t){return n.from(h.default.decode(t))};const l=1024;class p extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}e.BorshError=p;class b{constructor(){this.buf=n.alloc(l),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=n.concat([this.buf,n.alloc(l)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(n.from(new f.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(n.from(new f.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(n.from(new f.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(n.from(new f.default(t).toArray("le",64)))}writeBuffer(t){this.buf=n.concat([n.from(this.buf.subarray(0,this.length)),t,n.alloc(l)]),this.length+=t.length}writeString(t){this.maybeResize();const e=n.from(t,"utf8");this.writeU32(e.length),this.writeBuffer(e)}writeFixedArray(t){this.writeBuffer(n.from(t))}writeArray(t,e){this.maybeResize(),this.writeU32(t.length);for(const r of t)this.maybeResize(),e(r)}toArray(){return this.buf.subarray(0,this.length)}}function g(t,e,r){const n=r.value;r.value=function(...t){try{return n.apply(this,t)}catch(t){if(t instanceof RangeError){const e=t.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(e)>=0)throw new p("Reached the end of buffer when deserializing")}throw t}}}e.BinaryWriter=b;class y{constructor(t){this.buf=t,this.offset=0}readU8(){const t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){const t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){const t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){const t=this.readBuffer(8);return new f.default(t,"le")}readU128(){const t=this.readBuffer(16);return new f.default(t,"le")}readU256(){const t=this.readBuffer(32);return new f.default(t,"le")}readU512(){const t=this.readBuffer(64);return new f.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new p(`Expected buffer length ${t} isn't within bounds`);const e=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,e}readString(){const t=this.readU32(),e=this.readBuffer(t);try{return d.decode(e)}catch(t){throw new p(`Error decoding UTF-8 string: ${t}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){const e=this.readU32(),r=Array();for(let n=0;n<e;++n)r.push(t());return r}}function m(t){return t.charAt(0).toUpperCase()+t.slice(1)}function v(t,e,r,n,i){try{if("string"==typeof n)i[`write${m(n)}`](r);else if(n instanceof Array)if("number"==typeof n[0]){if(r.length!==n[0])throw new p(`Expecting byte array of length ${n[0]}, but got ${r.length} bytes`);i.writeFixedArray(r)}else if(2===n.length&&"number"==typeof n[1]){if(r.length!==n[1])throw new p(`Expecting byte array of length ${n[1]}, but got ${r.length} bytes`);for(let e=0;e<n[1];e++)v(t,null,r[e],n[0],i)}else i.writeArray(r,(r=>{v(t,e,r,n[0],i)}));else if(void 0!==n.kind)switch(n.kind){case"option":null==r?i.writeU8(0):(i.writeU8(1),v(t,e,r,n.type,i));break;case"map":i.writeU32(r.size),r.forEach(((r,o)=>{v(t,e,o,n.key,i),v(t,e,r,n.value,i)}));break;default:throw new p(`FieldType ${n} unrecognized`)}else w(t,r,i)}catch(t){throw t instanceof p&&t.addToFieldPath(e),t}}function w(t,e,r){if("function"==typeof e.borshSerialize)return void e.borshSerialize(r);const n=t.get(e.constructor);if(!n)throw new p(`Class ${e.constructor.name} is missing in schema`);if("struct"===n.kind)n.fields.map((([n,i])=>{v(t,n,e[n],i,r)}));else{if("enum"!==n.kind)throw new p(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`);{const i=e[n.field];for(let o=0;o<n.values.length;++o){const[s,a]=n.values[o];if(s===i){r.writeU8(o),v(t,s,e[s],a,r);break}}}}}function M(t,e,r,n){try{if("string"==typeof r)return n[`read${m(r)}`]();if(r instanceof Array){if("number"==typeof r[0])return n.readFixedArray(r[0]);if("number"==typeof r[1]){const e=[];for(let i=0;i<r[1];i++)e.push(M(t,null,r[0],n));return e}return n.readArray((()=>M(t,e,r[0],n)))}if("option"===r.kind)return n.readU8()?M(t,e,r.type,n):void 0;if("map"===r.kind){let i=new Map;const o=n.readU32();for(let s=0;s<o;s++){const o=M(t,e,r.key,n),s=M(t,e,r.value,n);i.set(o,s)}return i}return _(t,r,n)}catch(t){throw t instanceof p&&t.addToFieldPath(e),t}}function _(t,e,r){if("function"==typeof e.borshDeserialize)return e.borshDeserialize(r);const n=t.get(e);if(!n)throw new p(`Class ${e.name} is missing in schema`);if("struct"===n.kind){const n={};for(const[i,o]of t.get(e).fields)n[i]=M(t,i,o,r);return new e(n)}if("enum"===n.kind){const i=r.readU8();if(i>=n.values.length)throw new p(`Enum index: ${i} is out of range`);const[o,s]=n.values[i];return new e({[o]:M(t,o,s,r)})}throw new p(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`)}s([g],y.prototype,"readU8",null),s([g],y.prototype,"readU16",null),s([g],y.prototype,"readU32",null),s([g],y.prototype,"readU64",null),s([g],y.prototype,"readU128",null),s([g],y.prototype,"readU256",null),s([g],y.prototype,"readU512",null),s([g],y.prototype,"readString",null),s([g],y.prototype,"readFixedArray",null),s([g],y.prototype,"readArray",null),e.BinaryReader=y,e.serialize=function(t,e,r=b){const n=new r;return w(t,e,n),n.toArray()},e.deserialize=function(t,e,r,n=y){const i=new n(r),o=_(t,e,i);if(i.offset<r.length)throw new p(`Unexpected ${r.length-i.offset} bytes after deserialized data`);return o},e.deserializeUnchecked=function(t,e,r,n=y){return _(t,e,new n(r))}},3534:(t,e,r)=>{var n=r(6504);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},2017:(t,e,r)=>{var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(3325);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){}},5973:(t,e,r)=>{const n=r(5705);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},5705:t=>{"use strict";t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var i=t.charAt(n),o=i.charCodeAt(0);if(255!==e[o])throw new TypeError(i+" is ambiguous");e[o]=n}var s=t.length,a=t.charAt(0),u=Math.log(s)/Math.log(256),f=Math.log(256)/Math.log(s);function h(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return new Uint8Array;for(var r=0,n=0,i=0;t[r]===a;)n++,r++;for(var o=(t.length-r)*u+1>>>0,f=new Uint8Array(o);t[r];){var h=e[t.charCodeAt(r)];if(255===h)return;for(var c=0,d=o-1;(0!==h||c<i)&&-1!==d;d--,c++)h+=s*f[d]>>>0,f[d]=h%256>>>0,h=h/256>>>0;if(0!==h)throw new Error("Non-zero carry");i=c,r++}for(var l=o-i;l!==o&&0===f[l];)l++;for(var p=new Uint8Array(n+(o-l)),b=n;l!==o;)p[b++]=f[l++];return p}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===e.length)return"";for(var r=0,n=0,i=0,o=e.length;i!==o&&0===e[i];)i++,r++;for(var u=(o-i)*f+1>>>0,h=new Uint8Array(u);i!==o;){for(var c=e[i],d=0,l=u-1;(0!==c||d<n)&&-1!==l;l--,d++)c+=256*h[l]>>>0,h[l]=c%s>>>0,c=c/s>>>0;if(0!==c)throw new Error("Non-zero carry");n=d,i++}for(var p=u-n;p!==u&&0===h[p];)p++;for(var b=a.repeat(r);p<u;++p)b+=t.charAt(h[p]);return b},decodeUnsafe:h,decode:function(t){var e=h(t);if(e)return e;throw new Error("Non-base"+s+" character")}}}},5326:(t,e,r)=>{"use strict";const n=r(3350),i=r(3575),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return f(t,e,r)}function f(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|b(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(H(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(H(t,ArrayBuffer)||t&&H(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(H(t,SharedArrayBuffer)||t&&H(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Z(t.length)?a(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return h(t),a(t<0?0:0|p(t))}function d(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function p(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function b(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(i)return n?-1:$(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<a;o++)if(f(t,o)===f(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(f(t,o+n)!==f(e,n)){r=!1;break}if(r)return o}return-1}function w(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if(Z(n))return s;t[r+s]=n}return s}function M(t,e,r,n){return V($(e,t.length-r),t,r,n)}function _(t,e,r,n){return V(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return V(G(e),t,r,n)}function A(t,e,r,n){return V(function(t,e){let r,n,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=x));return r}(n)}e.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return f(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},u.allocUnsafe=function(t){return c(t)},u.allocUnsafeSlow=function(t){return c(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(H(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),H(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=u.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(H(e,Uint8Array))i+e.length>n.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=b,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)y(this,e,e+1);return this},u.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},u.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?k(this,0,t):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(H(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),f=this.slice(n,i),h=t.slice(e,r);for(let t=0;t<a;++t)if(f[t]!==h[t]){o=f[t],s=h[t];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return M(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function I(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function R(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=Y[t[n]];return i}function O(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function P(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function T(t,e,r,n,i){D(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function U(t,e,r,n,i){D(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function z(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=X((function(t){K(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(t){K(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=X((function(t){K(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),u.prototype.readBigInt64BE=X((function(t){K(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=X((function(t,e=0){return T(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=X((function(t,e=0){return T(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return z(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return z(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=u.isBuffer(t)?t:u.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};const j={};function q(t,e,r){j[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function F(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function D(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){K(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||W(e,t.length-(r+1))}(n,i,o)}function K(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function W(t,e,r){if(Math.floor(t)!==t)throw K(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),q("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=F(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const J=/[^+/0-9A-Za-z-_]/g;function $(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function H(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Z(t){return t!=t}const Y=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function X(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},2272:(t,e,r)=>{"use strict";var n=e;n.version=r(7330).i8,n.utils=r(7445),n.rand=r(2017),n.curve=r(3401),n.curves=r(3673),n.ec=r(2995),n.eddsa=r(303)},7017:(t,e,r)=>{"use strict";var n=r(2616),i=r(7445),o=i.getNAF,s=i.getJSF,a=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function f(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var s,u,f=[];for(s=0;s<n.length;s+=r.step){u=0;for(var h=s+r.step-1;h>=s;h--)u=(u<<1)+n[h];f.push(u)}for(var c=this.jpoint(null,null,null),d=this.jpoint(null,null,null),l=i;l>0;l--){for(s=0;s<f.length;s++)(u=f[s])===l?d=d.mixedAdd(r.points[s]):u===-l&&(d=d.mixedAdd(r.points[s].neg()));c=c.add(d)}return c.toP()},u.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(e,r,this._bitLength),u=this.jpoint(null,null,null),f=s.length-1;f>=0;f--){for(var h=0;f>=0&&0===s[f];f--)h++;if(f>=0&&h++,u=u.dblp(h),f<0)break;var c=s[f];a(0!==c),u="affine"===t.type?c>0?u.mixedAdd(i[c-1>>1]):u.mixedAdd(i[-c-1>>1].neg()):c>0?u.add(i[c-1>>1]):u.add(i[-c-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){var a,u,f,h=this._wnafT1,c=this._wnafT2,d=this._wnafT3,l=0;for(a=0;a<n;a++){var p=(f=e[a])._getNAFPoints(t);h[a]=p.wnd,c[a]=p.points}for(a=n-1;a>=1;a-=2){var b=a-1,g=a;if(1===h[b]&&1===h[g]){var y=[e[b],null,null,e[g]];0===e[b].y.cmp(e[g].y)?(y[1]=e[b].add(e[g]),y[2]=e[b].toJ().mixedAdd(e[g].neg())):0===e[b].y.cmp(e[g].y.redNeg())?(y[1]=e[b].toJ().mixedAdd(e[g]),y[2]=e[b].add(e[g].neg())):(y[1]=e[b].toJ().mixedAdd(e[g]),y[2]=e[b].toJ().mixedAdd(e[g].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[b],r[g]);for(l=Math.max(v[0].length,l),d[b]=new Array(l),d[g]=new Array(l),u=0;u<l;u++){var w=0|v[0][u],M=0|v[1][u];d[b][u]=m[3*(w+1)+(M+1)],d[g][u]=0,c[b]=y}}else d[b]=o(r[b],h[b],this._bitLength),d[g]=o(r[g],h[g],this._bitLength),l=Math.max(d[b].length,l),l=Math.max(d[g].length,l)}var _=this.jpoint(null,null,null),S=this._wnafT4;for(a=l;a>=0;a--){for(var A=0;a>=0;){var E=!0;for(u=0;u<n;u++)S[u]=0|d[u][a],0!==S[u]&&(E=!1);if(!E)break;A++,a--}if(a>=0&&A++,_=_.dblp(A),a<0)break;for(u=0;u<n;u++){var k=S[u];0!==k&&(k>0?f=c[u][k-1>>1]:k<0&&(f=c[u][-k-1>>1].neg()),_="affine"===f.type?_.mixedAdd(f):_.add(f))}}for(a=0;a<n;a++)c[a]=null;return i?_:_.toP()},u.BasePoint=f,f.prototype.eq=function(){throw new Error("Not implemented")},f.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},f.prototype.encodeCompressed=function(t){return this.encode(t,!0)},f.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},f.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},f.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},f.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},f.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},f.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},f.prototype._getBeta=function(){return null},f.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},2418:(t,e,r)=>{"use strict";var n=r(7445),i=r(2616),o=r(3717),s=r(7017),a=n.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function f(t,e,r,n,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,s),t.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(e&&!u||!e&&u)&&(a=a.redNeg()),this.point(t,a)},u.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(f,s.BasePoint),u.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},u.prototype.point=function(t,e,r,n){return new f(this,t,e,r,n)},f.fromJSON=function(t,e){return new f(t,e[0],e[1],e[2])},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),s=o.redSub(r),a=n.redSub(e),u=i.redMul(s),f=o.redMul(a),h=i.redMul(a),c=s.redMul(o);return this.curve.point(u,f,c,h)},f.prototype._projDbl=function(){var t,e,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var f=(n=this.curve._mulA(a)).redAdd(u);this.zOne?(t=s.redSub(a).redSub(u).redMul(f.redSub(this.curve.two)),e=f.redMul(n.redSub(u)),r=f.redSqr().redSub(f).redSub(f)):(i=this.z.redSqr(),o=f.redSub(i).redISub(i),t=s.redSub(a).redISub(u).redMul(o),e=f.redMul(n.redSub(u)),r=f.redMul(o))}else n=a.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(s.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(a.redISub(u)),r=n.redMul(o);return this.curve.point(t,e,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=i.redSub(n),a=i.redAdd(n),u=r.redAdd(e),f=o.redMul(s),h=a.redMul(u),c=o.redMul(u),d=s.redMul(a);return this.curve.point(f,h,d,c)},f.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),f=i.redAdd(a),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),c=n.redMul(u).redMul(h);return this.curve.twisted?(e=n.redMul(f).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(f)):(e=n.redMul(f).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(f)),this.curve.point(c,e,r)},f.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},f.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},f.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},f.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},3401:(t,e,r)=>{"use strict";var n=e;n.base=r(7017),n.short=r(1164),n.mont=r(7732),n.edwards=r(2418)},7732:(t,e,r)=>{"use strict";var n=r(2616),i=r(3717),o=r(7017),s=r(7445);function a(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new u(this,t,e)},a.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=i.redMul(n),a=e.z.redMul(o.redAdd(s).redSqr()),u=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},1164:(t,e,r)=>{"use strict";var n=r(7445),i=r(2616),o=r(3717),s=r(7017),a=n.assert;function u(t){s.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function f(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,s),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,o,s,a,u,f,h,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,l=this.n.clone(),p=new i(1),b=new i(0),g=new i(0),y=new i(1),m=0;0!==d.cmpn(0);){var v=l.div(d);f=l.sub(v.mul(d)),h=g.sub(v.mul(p));var w=y.sub(v.mul(b));if(!n&&f.cmp(c)<0)e=u.neg(),r=p,n=f.neg(),o=h;else if(n&&2==++m)break;u=f,l=d,d=f,g=p,p=h,y=b,b=w}s=f.neg(),a=h;var M=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(M)>=0&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),f=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:u.add(f).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var f=this._wnafMulAdd(1,n,i,2*o,r),h=0;h<2*o;h++)n[h]=null,i[h]=null;return f},o(f,s.BasePoint),u.prototype.point=function(t,e,r){return new f(this,t,e,r)},u.prototype.pointFromJSON=function(t,e){return f.fromJSON(this,t,e)},f.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},f.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},f.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},f.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},f.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},f.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},f.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(h,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new h(this,t,e,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=a.redSqr(),h=f.redMul(a),c=n.redMul(f),d=u.redSqr().redIAdd(h).redISub(c).redISub(c),l=u.redMul(c.redISub(d)).redISub(o.redMul(h)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,l,p)},h.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),h=r.redMul(u),c=a.redSqr().redIAdd(f).redISub(h).redISub(h),d=a.redMul(h.redISub(c)).redISub(i.redMul(f)),l=this.z.redMul(s);return this.curve.jpoint(c,d,l)},h.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),f=s.redAdd(s);for(e=0;e<t;e++){var h=o.redSqr(),c=f.redSqr(),d=c.redSqr(),l=h.redAdd(h).redIAdd(h).redIAdd(n.redMul(u)),p=o.redMul(c),b=l.redSqr().redISub(p.redAdd(p)),g=p.redISub(b),y=l.redMul(g);y=y.redIAdd(y).redISub(d);var m=f.redMul(a);e+1<t&&(u=u.redMul(d)),o=b,a=m,f=y}return this.curve.jpoint(o,f.redMul(i),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),f=o.redIAdd(o);f=(f=f.redIAdd(f)).redIAdd(f),t=u,e=a.redMul(s.redISub(u)).redISub(f),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),c=this.y.redSqr(),d=c.redSqr(),l=this.x.redAdd(c).redSqr().redISub(h).redISub(d);l=l.redIAdd(l);var p=h.redAdd(h).redIAdd(h),b=p.redSqr(),g=d.redIAdd(d);g=(g=g.redIAdd(g)).redIAdd(g),t=b.redISub(l).redISub(l),e=p.redMul(l.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},h.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);t=u;var f=o.redIAdd(o);f=(f=f.redIAdd(f)).redIAdd(f),e=a.redMul(s.redISub(u)).redISub(f),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),c=this.y.redSqr(),d=this.x.redMul(c),l=this.x.redSub(h).redMul(this.x.redAdd(h));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),b=(p=p.redIAdd(p)).redAdd(p);t=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(h);var g=c.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=l.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},h.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),f=(u=u.redIAdd(u)).redMul(s),h=a.redSqr().redISub(f.redAdd(f)),c=f.redISub(h),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=a.redMul(c).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(h,l,p)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var f=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),h=e.redMul(f);h=(h=h.redIAdd(h)).redIAdd(h);var c=this.x.redMul(a).redISub(h);c=(c=c.redIAdd(c)).redIAdd(c);var d=this.y.redMul(f.redMul(u.redISub(f)).redISub(s.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(c,d,l)},h.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},h.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},h.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},3673:(t,e,r)=>{"use strict";var n,i=e,o=r(1568),s=r(3401),a=r(7445).assert;function u(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,f("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),f("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),f("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(6517)}catch(t){n=void 0}f("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},2995:(t,e,r)=>{"use strict";var n=r(2616),i=r(7905),o=r(7445),s=r(3673),a=r(2017),u=o.assert,f=r(5467),h=r(309);function c(t){if(!(this instanceof c))return new c(t);"string"==typeof t&&(u(Object.prototype.hasOwnProperty.call(s,t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=c,c.prototype.keyPair=function(t){return new f(this,t)},c.prototype.keyFromPrivate=function(t,e){return f.fromPrivate(this,t,e)},c.prototype.keyFromPublic=function(t,e){return f.fromPublic(this,t,e)},c.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},c.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},c.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),u=t.toArray("be",s),f=new i({hash:this.hash,entropy:a,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),c=this.n.sub(new n(1)),d=0;;d++){var l=o.k?o.k(d):new n(f.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(c)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),g=b.umod(this.n);if(0!==g.cmpn(0)){var y=l.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(y=y.umod(this.n)).cmpn(0)){var m=(p.getY().isOdd()?1:0)|(0!==b.cmp(g)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),m^=1),new h({r:g,s:y,recoveryParam:m})}}}}}},c.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new h(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,u=s.invm(this.n),f=u.mul(t).umod(this.n),c=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(f,r.getPublic(),c)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(f,r.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},c.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,"The recovery param is more than two bits"),e=new h(e,i);var o=this.n,s=new n(t),a=e.r,f=e.s,c=1&r,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var l=e.r.invm(o),p=o.sub(s).mul(l).umod(o),b=f.mul(l).umod(o);return this.g.mulAdd(p,a,b)},c.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new h(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},5467:(t,e,r)=>{"use strict";var n=r(2616),i=r(7445).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},309:(t,e,r)=>{"use strict";var n=r(2616),i=r(7445),o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=e.place;o<n;o++,s++)i<<=8,i|=t[s],i>>>=0;return!(i<=127)&&(e.place=s,i)}function f(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function h(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var o=u(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var s=u(t,r);if(!1===s)return!1;var f=t.slice(r.place,s+r.place);if(r.place+=s,2!==t[r.place++])return!1;var h=u(t,r);if(!1===h)return!1;if(t.length!==h+r.place)return!1;var c=t.slice(r.place,h+r.place);if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}return this.r=new n(f),this.s=new n(c),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=f(e),r=f(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];h(n,e.length),(n=n.concat(e)).push(2),h(n,r.length);var o=n.concat(r),s=[48];return h(s,o.length),s=s.concat(o),i.encode(s,t)}},303:(t,e,r)=>{"use strict";var n=r(1568),i=r(3673),o=r(7445),s=o.assert,a=o.parseBytes,u=r(5624),f=r(3891);function h(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof h))return new h(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=h,h.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},h.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},h.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(t){return u.fromPublic(this,t)},h.prototype.keyFromSecret=function(t){return u.fromSecret(this,t)},h.prototype.makeSignature=function(t){return t instanceof f?t:new f(this,t)},h.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},h.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},h.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(t){return o.intFromLE(t)},h.prototype.isPoint=function(t){return t instanceof this.pointClass}},5624:(t,e,r)=>{"use strict";var n=r(7445),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},a.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=a},3891:(t,e,r)=>{"use strict";var n=r(2616),i=r(7445),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function u(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}s(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=u},6517:t=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},7445:(t,e,r)=>{"use strict";var n=e,i=r(2616),o=r(4076),s=r(1784);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,u=t.andln(3)+i&3,f=e.andln(3)+o&3;3===u&&(u=-1),3===f&&(f=-1),s=0==(1&u)?0:3!=(n=t.andln(7)+i&7)&&5!==n||2!==f?u:-u,r[0].push(s),a=0==(1&f)?0:3!=(n=e.andln(7)+o&7)&&5!==n||2!==u?f:-f,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},2616:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(9312).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function f(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var 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"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var f=1;f<n;f++){for(var h=u>>>26,c=67108863&u,d=Math.min(f,e.length-1),l=Math.max(0,f-t.length+1);l<=d;l++){var p=f-l|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&s}r.words[f]=0|c,u=0|h}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var f=c[t],l=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:h[f-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,f=new t(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),f[a]=s;for(;a<o;a++)f[a]=0}else{for(a=0;a<o-i;a++)f[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),f[o-a-1]=s}return f},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,f=0,h=0|s[0],c=8191&h,d=h>>>13,l=0|s[1],p=8191&l,b=l>>>13,g=0|s[2],y=8191&g,m=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,_=0|s[4],S=8191&_,A=_>>>13,E=0|s[5],k=8191&E,x=E>>>13,I=0|s[6],B=8191&I,R=I>>>13,O=0|s[7],P=8191&O,C=O>>>13,T=0|s[8],U=8191&T,L=T>>>13,N=0|s[9],z=8191&N,j=N>>>13,q=0|a[0],F=8191&q,D=q>>>13,K=0|a[1],W=8191&K,J=K>>>13,$=0|a[2],G=8191&$,V=$>>>13,H=0|a[3],Z=8191&H,Y=H>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ft=at>>>13,ht=0|a[8],ct=8191&ht,dt=ht>>>13,lt=0|a[9],pt=8191&lt,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(f+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,D))+Math.imul(d,F)|0))<<13)|0;f=((o=Math.imul(d,D))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,D))+Math.imul(b,F)|0,o=Math.imul(b,D);var yt=(f+(n=n+Math.imul(c,W)|0)|0)+((8191&(i=(i=i+Math.imul(c,J)|0)+Math.imul(d,W)|0))<<13)|0;f=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,D))+Math.imul(m,F)|0,o=Math.imul(m,D),n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,J)|0;var mt=(f+(n=n+Math.imul(c,G)|0)|0)+((8191&(i=(i=i+Math.imul(c,V)|0)+Math.imul(d,G)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,D))+Math.imul(M,F)|0,o=Math.imul(M,D),n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,J)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,V)|0;var vt=(f+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(d,Z)|0))<<13)|0;f=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,D))+Math.imul(A,F)|0,o=Math.imul(A,D),n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,V)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,Y)|0;var wt=(f+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,D))+Math.imul(x,F)|0,o=Math.imul(x,D),n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var Mt=(f+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(d,rt)|0))<<13)|0;f=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,D))+Math.imul(R,F)|0,o=Math.imul(R,D),n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var _t=(f+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(d,ot)|0))<<13)|0;f=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,D))+Math.imul(C,F)|0,o=Math.imul(C,D),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(k,G)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,V)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0;var St=(f+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((o=o+Math.imul(d,ft)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,F),i=(i=Math.imul(U,D))+Math.imul(L,F)|0,o=Math.imul(L,D),n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(B,G)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0;var At=(f+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;f=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(z,F),i=(i=Math.imul(z,D))+Math.imul(j,F)|0,o=Math.imul(j,D),n=n+Math.imul(U,W)|0,i=(i=i+Math.imul(U,J)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,Y)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ft)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,dt)|0;var Et=(f+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,bt)|0)+Math.imul(d,pt)|0))<<13)|0;f=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(z,W),i=(i=Math.imul(z,J))+Math.imul(j,W)|0,o=Math.imul(j,J),n=n+Math.imul(U,G)|0,i=(i=i+Math.imul(U,V)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,V)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ft)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,dt)|0;var kt=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,G),i=(i=Math.imul(z,V))+Math.imul(j,G)|0,o=Math.imul(j,V),n=n+Math.imul(U,Z)|0,i=(i=i+Math.imul(U,Y)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,Y)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ft)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,dt)|0;var xt=(f+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,bt)|0)+Math.imul(m,pt)|0))<<13)|0;f=((o=o+Math.imul(m,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(z,Z),i=(i=Math.imul(z,Y))+Math.imul(j,Z)|0,o=Math.imul(j,Y),n=n+Math.imul(U,Q)|0,i=(i=i+Math.imul(U,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ft)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,dt)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,dt)|0;var It=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(M,pt)|0))<<13)|0;f=((o=o+Math.imul(M,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(U,rt)|0,i=(i=i+Math.imul(U,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ft)|0,n=n+Math.imul(k,ct)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,dt)|0;var Bt=(f+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,bt)|0)+Math.imul(A,pt)|0))<<13)|0;f=((o=o+Math.imul(A,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(z,rt),i=(i=Math.imul(z,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(U,ot)|0,i=(i=i+Math.imul(U,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ft)|0,n=n+Math.imul(B,ct)|0,i=(i=i+Math.imul(B,dt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,dt)|0;var Rt=(f+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,bt)|0)+Math.imul(x,pt)|0))<<13)|0;f=((o=o+Math.imul(x,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(z,ot),i=(i=Math.imul(z,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(U,ut)|0,i=(i=i+Math.imul(U,ft)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ft)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,dt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,dt)|0;var Ot=(f+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,bt)|0)+Math.imul(R,pt)|0))<<13)|0;f=((o=o+Math.imul(R,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(z,ut),i=(i=Math.imul(z,ft))+Math.imul(j,ut)|0,o=Math.imul(j,ft),n=n+Math.imul(U,ct)|0,i=(i=i+Math.imul(U,dt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,dt)|0;var Pt=(f+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,bt)|0)+Math.imul(C,pt)|0))<<13)|0;f=((o=o+Math.imul(C,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(z,ct),i=(i=Math.imul(z,dt))+Math.imul(j,ct)|0,o=Math.imul(j,dt);var Ct=(f+(n=n+Math.imul(U,pt)|0)|0)+((8191&(i=(i=i+Math.imul(U,bt)|0)+Math.imul(L,pt)|0))<<13)|0;f=((o=o+Math.imul(L,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Tt=(f+(n=Math.imul(z,pt))|0)+((8191&(i=(i=Math.imul(z,bt))+Math.imul(j,pt)|0))<<13)|0;return f=((o=Math.imul(j,bt))+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,u[0]=gt,u[1]=yt,u[2]=mt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=St,u[8]=At,u[9]=Et,u[10]=kt,u[11]=xt,u[12]=It,u[13]=Bt,u[14]=Rt,u[15]=Ot,u[16]=Pt,u[17]=Ct,u[18]=Tt,0!==f&&(u[19]=f,r.length++),r};function b(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=l),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?l(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),f=Math.max(0,o-t.length+1);f<=u;f++){var h=o-f,c=(0|t.words[h])*(0|e.words[f]),d=67108863&c;a=67108863&(d=d+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):b(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),f=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var c=u,d=f,l=0;l<s;l++){var p=r[h+l],b=n[h+l],g=r[h+l+s],y=n[h+l+s],m=c*g-d*y;y=c*y+d*g,g=m,r[h+l]=p+g,n[h+l]=b+y,r[h+l+s]=p-g,n[h+l+s]=b-y,l!==a&&(m=u*c-f*d,d=u*d+f*c,c=m)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),f=new Array(n),h=new Array(n),c=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,f,n),this.transform(s,o,a,u,n,i),this.transform(f,o,h,c,n,i);for(var l=0;l<n;l++){var p=a[l]*h[l]-u[l]*c[l];u[l]=a[l]*c[l]+u[l]*h[l],a[l]=p}return this.conjugate(a,u,n),this.transform(a,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),b(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var f=0;f<s;f++)u.words[f]=this.words[f];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,f=0;f<this.length;f++)this.words[f]=this.words[f+s];else this.words[0]=0,this.length=1;var h=0;for(f=this.length-1;f>=0&&(0!==h||f>=i);f--){var c=0|this.words[f];this.words[f]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var f=0;f<a.length;f++)a.words[f]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var d=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,c);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=d)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(v,m),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,m),i(M,m),i(_,m),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return y[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,f).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=s;0!==l.cmp(a);){for(var b=l,g=0;0!==b.cmp(a);g++)b=b.redSqr();n(g<p);var y=this.pow(c,new o(1).iushln(p-g-1));d=d.redMul(y),c=y.redSqr(),l=l.redMul(c),p=g}return d},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var f=e.words[n],h=u-1;h>=0;h--){var c=f>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,S),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},8236:t=>{"use strict";var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||t,s),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s},a.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,i,o,s){var a=r?r+t:t;if(!this._events[a])return!1;var u,f,h=this._events[a],c=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),c){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,n),!0;case 4:return h.fn.call(h.context,e,n,i),!0;case 5:return h.fn.call(h.context,e,n,i,o),!0;case 6:return h.fn.call(h.context,e,n,i,o,s),!0}for(f=1,u=new Array(c-1);f<c;f++)u[f-1]=arguments[f];h.fn.apply(h.context,u)}else{var d,l=h.length;for(f=0;f<l;f++)switch(h[f].once&&this.removeListener(t,h[f].fn,void 0,!0),c){case 1:h[f].fn.call(h[f].context);break;case 2:h[f].fn.call(h[f].context,e);break;case 3:h[f].fn.call(h[f].context,e,n);break;case 4:h[f].fn.call(h[f].context,e,n,i);break;default:if(!u)for(d=1,u=new Array(c-1);d<c;d++)u[d-1]=arguments[d];h[f].fn.apply(h[f].context,u)}}return!0},a.prototype.on=function(t,e,r){return o(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return o(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,n,i){var o=r?r+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||i&&!a.once||n&&a.context!==n||s(this,o);else{for(var u=0,f=[],h=a.length;u<h;u++)(a[u].fn!==e||i&&!a[u].once||n&&a[u].context!==n)&&f.push(a[u]);f.length?this._events[o]=1===f.length?f[0]:f:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&s(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a},1568:(t,e,r)=>{var n=e;n.utils=r(886),n.common=r(6925),n.sha=r(1036),n.ripemd=r(3020),n.hmac=r(9147),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},6925:(t,e,r)=>{"use strict";var n=r(886),i=r(4076);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},9147:(t,e,r)=>{"use strict";var n=r(886),i=r(4076);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},3020:(t,e,r)=>{"use strict";var n=r(886),i=r(6925),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,f=i.BlockHash;function h(){if(!(this instanceof h))return new h;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function d(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function l(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(h,f),e.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],f=this.h[3],h=this.h[4],m=r,v=n,w=i,M=f,_=h,S=0;S<80;S++){var A=s(o(u(r,c(S,n,i,f),t[p[S]+e],d(S)),g[S]),h);r=h,h=f,f=o(i,10),i=n,n=A,A=s(o(u(m,c(79-S,v,w,M),t[b[S]+e],l(S)),y[S]),_),m=_,_=M,M=o(w,10),w=v,v=A}A=a(this.h[1],i,M),this.h[1]=a(this.h[2],f,_),this.h[2]=a(this.h[3],h,m),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=A},h.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},1036:(t,e,r)=>{"use strict";e.sha1=r(5654),e.sha224=r(8513),e.sha256=r(8221),e.sha384=r(7212),e.sha512=r(6439)},5654:(t,e,r)=>{"use strict";var n=r(886),i=r(6925),o=r(4389),s=n.rotl32,a=n.sum32,u=n.sum32_5,f=o.ft_1,h=i.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,h),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],h=this.h[2],d=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=u(s(i,5),f(p,o,h,d),l,r[n],c[p]);l=d,d=h,h=s(o,30),o=i,i=b}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],h),this.h[3]=a(this.h[3],d),this.h[4]=a(this.h[4],l)},d.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},8513:(t,e,r)=>{"use strict";var n=r(886),i=r(8221);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},8221:(t,e,r)=>{"use strict";var n=r(886),i=r(6925),o=r(4389),s=r(4076),a=n.sum32,u=n.sum32_4,f=n.sum32_5,h=o.ch32,c=o.maj32,d=o.s0_256,l=o.s1_256,p=o.g0_256,b=o.g1_256,g=i.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function m(){if(!(this instanceof m))return new m;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(m,g),t.exports=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=u(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],g=this.h[2],y=this.h[3],m=this.h[4],v=this.h[5],w=this.h[6],M=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var _=f(M,l(m),h(m,v,w),this.k[n],r[n]),S=a(d(i),c(i,o,g));M=w,w=v,v=m,m=a(y,_),y=g,g=o,o=i,i=a(_,S)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],y),this.h[4]=a(this.h[4],m),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],M)},m.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},7212:(t,e,r)=>{"use strict";var n=r(886),i=r(6439);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},6439:(t,e,r)=>{"use strict";var n=r(886),i=r(6925),o=r(4076),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,f=n.shr64_lo,h=n.sum64,c=n.sum64_hi,d=n.sum64_lo,l=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,g=n.sum64_5_lo,y=i.BlockHash,m=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=new Array(160)}function w(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function M(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function _(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function S(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function A(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function E(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function k(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function x(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,1)^a(t,e,8)^f(t,e,7);return r<0&&(r+=4294967296),r}function B(t,e){var r=a(t,e,19)^a(e,t,29)^f(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(v,y),t.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=(g=r[n-4],y=r[n-3],m=void 0,(m=s(g,y,19)^s(y,g,29)^u(g,y,6))<0&&(m+=4294967296),m),o=B(r[n-4],r[n-3]),a=r[n-14],f=r[n-13],h=x(r[n-30],r[n-29]),c=I(r[n-30],r[n-29]),d=r[n-32],b=r[n-31];r[n]=l(i,o,a,f,h,c,d,b),r[n+1]=p(i,o,a,f,h,c,d,b)}var g,y,m},v.prototype._update=function(t,e){this._prepareBlock(t,e);var r,n,i,a=this.W,u=this.h[0],f=this.h[1],l=this.h[2],p=this.h[3],y=this.h[4],m=this.h[5],v=this.h[6],x=this.h[7],I=this.h[8],B=this.h[9],R=this.h[10],O=this.h[11],P=this.h[12],C=this.h[13],T=this.h[14],U=this.h[15];o(this.k.length===a.length);for(var L=0;L<a.length;L+=2){var N=T,z=U,j=(i=void 0,(i=s(r=I,n=B,14)^s(r,n,18)^s(n,r,9))<0&&(i+=4294967296),i),q=k(I,B),F=w(I,0,R,0,P),D=M(0,B,0,O,0,C),K=this.k[L],W=this.k[L+1],J=a[L],$=a[L+1],G=b(N,z,j,q,F,D,K,W,J,$),V=g(N,z,j,q,F,D,K,W,J,$);N=A(u,f),z=E(u,f),j=_(u,0,l,0,y),q=S(0,f,0,p,0,m);var H=c(N,z,j,q),Z=d(N,z,j,q);T=P,U=C,P=R,C=O,R=I,O=B,I=c(v,x,G,V),B=d(x,x,G,V),v=y,x=m,y=l,m=p,l=u,p=f,u=c(G,V,H,Z),f=d(G,V,H,Z)}h(this.h,0,u,f),h(this.h,2,l,p),h(this.h,4,y,m),h(this.h,6,v,x),h(this.h,8,I,B),h(this.h,10,R,O),h(this.h,12,P,C),h(this.h,14,T,U)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},4389:(t,e,r)=>{"use strict";var n=r(886).rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},e.ch32=i,e.maj32=o,e.p32=s,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},886:(t,e,r)=>{"use strict";var n=r(4076),i=r(3717);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(t,i)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=s(i)),r+=u(i.toString(16))}return r},e.zero2=a,e.zero8=u,e.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var s=new Array(o/4),a=0,u=e;a<s.length;a++,u+=4){var f;f="big"===i?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=f>>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u=0,f=e;return u+=(f=f+n>>>0)<e?1:0,u+=(f=f+o>>>0)<o?1:0,t+r+i+s+(u+=(f=f+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,f){var h=0,c=e;return h+=(c=c+n>>>0)<e?1:0,h+=(c=c+o>>>0)<o?1:0,h+=(c=c+a>>>0)<a?1:0,t+r+i+s+u+(h+=(c=c+f>>>0)<f?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,f){return e+n+o+a+f>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},7905:(t,e,r)=>{"use strict";var n=r(1568),i=r(1784),o=r(4076);function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=s,s.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,t);return this._update(r),this._reseed++,i.encode(s,e)}},3575:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,f=u>>1,h=-7,c=r?i-1:0,d=r?-1:1,l=t[e+c];for(c+=d,o=l&(1<<-h)-1,l>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=d,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=d,h-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),o-=f}return(l?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,f=8*o-i-1,h=(1<<f)-1,c=h>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?d/u:d*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+l]=255&a,l+=p,a/=256,i-=8);for(s=s<<i|a,f+=i;f>0;t[r+l]=255&s,l+=p,s/=256,f-=8);t[r+l-p]|=128*b}},3717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},6350:(t,e,r)=>{"use strict";const n=r(3141).v4,i=r(6661),o=function(t,e){if(!(this instanceof o))return new o(t,e);e||(e={}),this.options={reviver:void 0!==e.reviver?e.reviver:null,replacer:void 0!==e.replacer?e.replacer:null,generator:void 0!==e.generator?e.generator:function(){return n()},version:void 0!==e.version?e.version:2,notificationIdNull:"boolean"==typeof e.notificationIdNull&&e.notificationIdNull},this.callServer=t};t.exports=o,o.prototype.request=function(t,e,r,n){const o=this;let s=null;const a=Array.isArray(t)&&"function"==typeof e;if(1===this.options.version&&a)throw new TypeError("JSON-RPC 1.0 does not support batching");if(a||!a&&t&&"object"==typeof t&&"function"==typeof e)n=e,s=t;else{"function"==typeof r&&(n=r,r=void 0);const o="function"==typeof n;try{s=i(t,e,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(t){if(o)return n(t);throw t}if(!o)return s}let u;try{u=JSON.stringify(s,this.options.replacer)}catch(t){return n(t)}return this.callServer(u,(function(t,e){o._parseResponse(t,e,n)})),s},o.prototype._parseResponse=function(t,e,r){if(t)return void r(t);if(!e)return r();let n;try{n=JSON.parse(e,this.options.reviver)}catch(t){return r(t)}if(3===r.length){if(Array.isArray(n)){const t=function(t){return void 0!==t.error},e=function(e){return!t(e)};return r(null,n.filter(t),n.filter(e))}return r(null,n.error,n.result)}r(null,n)}},6661:(t,e,r)=>{"use strict";const n=r(3141).v4;t.exports=function(t,e,r,i){if("string"!=typeof t)throw new TypeError(t+" must be a string");const o="number"==typeof(i=i||{}).version?i.version:2;if(1!==o&&2!==o)throw new TypeError(o+" must be 1 or 2");const s={method:t};if(2===o&&(s.jsonrpc="2.0"),e){if("object"!=typeof e&&!Array.isArray(e))throw new TypeError(e+" must be an object, array or omitted");s.params=e}if(void 0===r){const t="function"==typeof i.generator?i.generator:function(){return n()};s.id=t(s,i)}else 2===o&&null===r?i.notificationIdNull&&(s.id=null):s.id=r;return s}},5498:(t,e,r)=>{var n;!function(){"use strict";var i="input is invalid type",o="object"==typeof window,s=o?window:{};s.JS_SHA3_NO_WINDOW&&(o=!1);var a=!o&&"object"==typeof self;!s.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?s=r.g:a&&(s=self);var u=!s.JS_SHA3_NO_COMMON_JS&&t.exports,f=r.amdO,h=!s.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),d=[4,1024,262144,67108864],l=[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],b=[224,256,384,512],g=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!s.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!h||!s.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var v=function(t,e,r){return function(n){return new T(t,e,t).update(n)[r]()}},w=function(t,e,r){return function(n,i){return new T(t,e,i).update(n)[r]()}},M=function(t,e,r){return function(e,n,i,o){return k["cshake"+t].update(e,n,i,o)[r]()}},_=function(t,e,r){return function(e,n,i,o){return k["kmac"+t].update(e,n,i,o)[r]()}},S=function(t,e,r,n){for(var i=0;i<y.length;++i){var o=y[i];t[o]=e(r,n,o)}return t},A=function(t,e){var r=v(t,e,"hex");return r.create=function(){return new T(t,e,t)},r.update=function(t){return r.create().update(t)},S(r,v,t,e)},E=[{name:"keccak",padding:[1,256,65536,16777216],bits:b,createMethod:A},{name:"sha3",padding:[6,1536,393216,100663296],bits:b,createMethod:A},{name:"shake",padding:[31,7936,2031616,520093696],bits:g,createMethod:function(t,e){var r=w(t,e,"hex");return r.create=function(r){return new T(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},S(r,w,t,e)}},{name:"cshake",padding:d,bits:g,createMethod:function(t,e){var r=m[t],n=M(t,0,"hex");return n.create=function(n,i,o){return i||o?new T(t,e,n).bytepad([i,o],r):k["shake"+t].create(n)},n.update=function(t,e,r,i){return n.create(e,r,i).update(t)},S(n,M,t,e)}},{name:"kmac",padding:d,bits:g,createMethod:function(t,e){var r=m[t],n=_(t,0,"hex");return n.create=function(n,i,o){return new U(t,e,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(t,e,r,i){return n.create(t,r,i).update(e)},S(n,_,t,e)}}],k={},x=[],I=0;I<E.length;++I)for(var B=E[I],R=B.bits,O=0;O<R.length;++O){var P=B.name+"_"+R[O];if(x.push(P),k[P]=B.createMethod(R[O],B.padding),"sha3"!==B.name){var C=B.name+R[O];x.push(C),k[C]=k[P]}}function T(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>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 U(t,e,r){T.call(this,t,e,r)}T.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(i);if(null===t)throw new Error(i);if(h&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||h&&ArrayBuffer.isView(t)))throw new Error(i);e=!0}for(var n,o,s=this.blocks,a=this.byteCount,u=t.length,f=this.blockCount,c=0,d=this.s;c<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,n=1;n<f+1;++n)s[n]=0;if(e)for(n=this.start;c<u&&n<a;++c)s[n>>2]|=t[c]<<l[3&n++];else for(n=this.start;c<u&&n<a;++c)(o=t.charCodeAt(c))<128?s[n>>2]|=o<<l[3&n++]:o<2048?(s[n>>2]|=(192|o>>6)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]):o<55296||o>=57344?(s[n>>2]|=(224|o>>12)<<l[3&n++],s[n>>2]|=(128|o>>6&63)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++c)),s[n>>2]|=(240|o>>18)<<l[3&n++],s[n>>2]|=(128|o>>12&63)<<l[3&n++],s[n>>2]|=(128|o>>6&63)<<l[3&n++],s[n>>2]|=(128|63&o)<<l[3&n++]);if(this.lastByteIndex=n,n>=a){for(this.start=n-a,this.block=s[f],n=0;n<f;++n)d[n]^=s[n];L(d),this.reset=!0}else this.start=n}return this},T.prototype.encode=function(t,e){var r=255&t,n=1,i=[r];for(r=255&(t>>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},T.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(i);if(null===t)throw new Error(i);if(h&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||h&&ArrayBuffer.isView(t)))throw new Error(i);e=!0}var n=0,o=t.length;if(e)n=o;else for(var s=0;s<t.length;++s){var a=t.charCodeAt(s);a<128?n+=1:a<2048?n+=2:a<55296||a>=57344?n+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(t),n},T.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n<t.length;++n)r+=this.encodeString(t[n]);var i=e-r%e,o=[];return o.length=i,this.update(o),this},T.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];L(n)}},T.prototype.toString=T.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<e&&s<n;++o,++s)t=r[o],a+=c[t>>4&15]+c[15&t]+c[t>>12&15]+c[t>>8&15]+c[t>>20&15]+c[t>>16&15]+c[t>>28&15]+c[t>>24&15];s%e==0&&(L(r),o=0)}return i&&(t=r[o],a+=c[t>>4&15]+c[15&t],i>1&&(a+=c[t>>12&15]+c[t>>8&15]),i>2&&(a+=c[t>>20&15]+c[t>>16&15])),a},T.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s<n;){for(o=0;o<e&&s<n;++o,++s)u[s]=r[o];s%e==0&&L(r)}return i&&(u[o]=r[o],t=t.slice(0,a)),t},T.prototype.buffer=T.prototype.arrayBuffer,T.prototype.digest=T.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)t=a<<2,e=n[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&L(n)}return o&&(t=a<<2,e=n[s],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},U.prototype=new T,U.prototype.finalize=function(){return this.encode(this.outputBits,!0),T.prototype.finalize.call(this)};var L=function(t){var e,r,n,i,o,s,a,u,f,h,c,d,l,b,g,y,m,v,w,M,_,S,A,E,k,x,I,B,R,O,P,C,T,U,L,N,z,j,q,F,D,K,W,J,$,G,V,H,Z,Y,X,Q,tt,et,rt,nt,it,ot,st,at,ut,ft,ht;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(l=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|f>>>31),r=o^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(h<<1|c>>>31),r=a^(c<<1|h>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(d<<1|l>>>31),r=f^(l<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=h^(i<<1|o>>>31),r=c^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,b=t[0],g=t[1],G=t[11]<<4|t[10]>>>28,V=t[10]<<4|t[11]>>>28,B=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,K=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,U=t[2]<<1|t[3]>>>31,L=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,Z=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ft=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,N=t[14]<<6|t[15]>>>26,z=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,Y=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,C=t[45]<<29|t[44]>>>3,T=t[44]<<29|t[45]>>>3,E=t[6]<<28|t[7]>>>4,k=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,j=t[26]<<25|t[27]>>>7,q=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,J=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,x=t[18]<<20|t[19]>>>12,I=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,D=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=b^~y&v,t[1]=g^~m&w,t[10]=E^~x&B,t[11]=k^~I&R,t[20]=U^~N&j,t[21]=L^~z&q,t[30]=J^~G&H,t[31]=$^~V&Z,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~v&M,t[3]=m^~w&_,t[12]=x^~B&O,t[13]=I^~R&P,t[22]=N^~j&F,t[23]=z^~q&D,t[32]=G^~H&Y,t[33]=V^~Z&X,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=v^~M&S,t[5]=w^~_&A,t[14]=B^~O&C,t[15]=R^~P&T,t[24]=j^~F&K,t[25]=q^~D&W,t[34]=H^~Y&Q,t[35]=Z^~X&tt,t[44]=ot^~at&ft,t[45]=st^~ut&ht,t[6]=M^~S&b,t[7]=_^~A&g,t[16]=O^~C&E,t[17]=P^~T&k,t[26]=F^~K&U,t[27]=D^~W&L,t[36]=Y^~Q&J,t[37]=X^~tt&$,t[46]=at^~ft&et,t[47]=ut^~ht&rt,t[8]=S^~b&y,t[9]=A^~g&m,t[18]=C^~E&x,t[19]=T^~k&I,t[28]=K^~U&N,t[29]=W^~L&z,t[38]=Q^~J&G,t[39]=tt^~$&V,t[48]=ft^~et&nt,t[49]=ht^~rt&it,t[0]^=p[n],t[1]^=p[n+1]};if(u)t.exports=k;else{for(I=0;I<x.length;++I)s[x[I]]=k[x[I]];f&&(void 0===(n=function(){return k}.call(e,r,e,t))||(t.exports=n))}}()},4076:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},1784:(t,e)=>{"use strict";var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r<t.length;r++)e+=n(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16));else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},6770:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,o=Object.create(i.prototype),s=new I(n||[]);return o._invoke=function(t,e,r){var n=c;return function(i,o){if(n===l)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw o;return R()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=E(s,r);if(a){if(a===b)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===c)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=l;var u=h(t,e,r);if("normal"===u.type){if(n=r.done?p:d,u.arg===b)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(t,r,s),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var c="suspendedStart",d="suspendedYield",l="executing",p="completed",b={};function g(){}function y(){}function m(){}var v={};u(v,o,(function(){return this}));var w=Object.getPrototypeOf,M=w&&w(w(B([])));M&&M!==r&&n.call(M,o)&&(v=M);var _=m.prototype=g.prototype=Object.create(v);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(i,o,s,a){var u=h(t[i],t,o);if("throw"!==u.type){var f=u.arg,c=f.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(c).then((function(t){f.value=t,s(f)}),(function(t){return r("throw",t,s,a)}))}a(u.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function E(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method))return b;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return b}var i=h(n,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,b;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function B(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,s=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return s.next=s}}return{next:R}}function R(){return{value:e,done:!0}}return y.prototype=m,u(_,"constructor",m),u(m,"constructor",y),y.displayName=u(m,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,a,"GeneratorFunction")),t.prototype=Object.create(_),t},t.awrap=function(t){return{__await:t}},S(A.prototype),u(A.prototype,s,(function(){return this})),t.AsyncIterator=A,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new A(f(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},S(_),u(_,a,"Generator"),u(_,o,(function(){return this})),u(_,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=B,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return a.type="throw",a.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),f=n.call(s,"finallyLoc");if(u&&f){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:B(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},4217:(t,e,r)=>{"use strict";var n=r(3148),i=n(r(7599)),o=n(r(6852)),s=n(r(3729)),a=n(r(7972)),u=n(r(2905)),f=n(r(8721));n(r(2666)).default},2666:(t,e,r)=>{"use strict";var n=r(5326).Buffer,i=r(3148);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i(r(9963)),s=i(r(9012)),a=i(r(9444)),u=i(r(6852)),f=i(r(7599)),h=i(r(3729)),c=i(r(7972)),d=i(r(2905)),l=r(8236);var p=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r},b=function(t){(0,h.default)(m,t);var e,r,i,l,b,g,y=(b=m,g=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,d.default)(b);if(g){var r=(0,d.default)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,c.default)(this,t)});function m(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ws://localhost:8080",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;(0,u.default)(this,m);var o=n.autoconnect,s=void 0===o||o,a=n.reconnect,f=void 0===a||a,h=n.reconnect_interval,c=void 0===h?1e3:h,d=n.max_reconnects,l=void 0===d?5:d,b=p(n,["autoconnect","reconnect","reconnect_interval","max_reconnects"]);return(e=y.call(this)).webSocketFactory=t,e.queue={},e.rpc_id=0,e.address=r,e.autoconnect=s,e.ready=!1,e.reconnect=f,e.reconnect_interval=c,e.max_reconnects=l,e.rest_options=b,e.current_reconnects=0,e.generate_request_id=i||function(){return++e.rpc_id},e.autoconnect&&e._connect(e.address,Object.assign({autoconnect:e.autoconnect,reconnect:e.reconnect,reconnect_interval:e.reconnect_interval,max_reconnects:e.max_reconnects},e.rest_options)),e}return(0,f.default)(m,[{key:"connect",value:function(){this.socket||this._connect(this.address,Object.assign({autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects},this.rest_options))}},{key:"call",value:function(t,e,r,n){var i=this;return n||"object"!==(0,a.default)(r)||(n=r,r=null),new Promise((function(o,s){if(!i.ready)return s(new Error("socket not ready"));var a=i.generate_request_id(t,e),u={jsonrpc:"2.0",method:t,params:e||null,id:a};i.socket.send(JSON.stringify(u),n,(function(t){if(t)return s(t);i.queue[a]={promise:[o,s]},r&&(i.queue[a].timeout=setTimeout((function(){delete i.queue[a],s(new Error("reply timeout"))}),r))}))}))}},{key:"login",value:(l=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.call("rpc.login",e);case 2:if(r=t.sent){t.next=5;break}throw new Error("authentication failed");case 5:return t.abrupt("return",r);case 6:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"listMethods",value:(i=(0,s.default)(o.default.mark((function t(){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.call("__listMethods");case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"notify",value:function(t,e){var r=this;return new Promise((function(n,i){if(!r.ready)return i(new Error("socket not ready"));var o={jsonrpc:"2.0",method:t,params:e||null};r.socket.send(JSON.stringify(o),(function(t){if(t)return i(t);n()}))}))}},{key:"subscribe",value:(r=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return"string"==typeof e&&(e=[e]),t.next=3,this.call("rpc.on",e);case 3:if(r=t.sent,"string"!=typeof e||"ok"===r[e]){t.next=6;break}throw new Error("Failed subscribing to an event '"+e+"' with: "+r[e]);case 6:return t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"unsubscribe",value:(e=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return"string"==typeof e&&(e=[e]),t.next=3,this.call("rpc.off",e);case 3:if(r=t.sent,"string"!=typeof e||"ok"===r[e]){t.next=6;break}throw new Error("Failed unsubscribing from an event with: "+r);case 6:return t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"close",value:function(t,e){this.socket.close(t||1e3,e)}},{key:"_connect",value:function(t,e){var r=this;this.socket=this.webSocketFactory(t,e),this.socket.addEventListener("open",(function(){r.ready=!0,r.emit("open"),r.current_reconnects=0})),this.socket.addEventListener("message",(function(t){var e=t.data;e instanceof ArrayBuffer&&(e=n.from(e).toString());try{e=JSON.parse(e)}catch(t){return}if(e.notification&&r.listeners(e.notification).length){if(!Object.keys(e.params).length)return r.emit(e.notification);var i=[e.notification];if(e.params.constructor===Object)i.push(e.params);else for(var o=0;o<e.params.length;o++)i.push(e.params[o]);return Promise.resolve().then((function(){r.emit.apply(r,i)}))}if(!r.queue[e.id])return e.method&&e.params?Promise.resolve().then((function(){r.emit(e.method,e.params)})):void 0;"error"in e=="result"in e&&r.queue[e.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),r.queue[e.id].timeout&&clearTimeout(r.queue[e.id].timeout),e.error?r.queue[e.id].promise[1](e.error):r.queue[e.id].promise[0](e.result),delete r.queue[e.id]})),this.socket.addEventListener("error",(function(t){return r.emit("error",t)})),this.socket.addEventListener("close",(function(n){var i=n.code,o=n.reason;r.ready&&setTimeout((function(){return r.emit("close",i,o)}),0),r.ready=!1,r.socket=void 0,1e3!==i&&(r.current_reconnects++,r.reconnect&&(r.max_reconnects>r.current_reconnects||0===r.max_reconnects)&&setTimeout((function(){return r._connect(t,e)}),r.reconnect_interval))}))}}]),m}(l.EventEmitter);e.default=b},8721:(t,e,r)=>{"use strict";var n=r(3148);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return new f(t,e)};var i=n(r(6852)),o=n(r(7599)),s=n(r(3729)),a=n(r(7972)),u=n(r(2905));var f=function(t){(0,s.default)(f,t);var e,r,n=(e=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=(0,u.default)(e);if(r){var i=(0,u.default)(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return(0,a.default)(this,t)});function f(t,e,r){var o;return(0,i.default)(this,f),(o=n.call(this)).socket=new window.WebSocket(t,r),o.socket.onopen=function(){return o.emit("open")},o.socket.onmessage=function(t){return o.emit("message",t.data)},o.socket.onerror=function(t){return o.emit("error",t)},o.socket.onclose=function(t){o.emit("close",t.code,t.reason)},o}return(0,o.default)(f,[{key:"send",value:function(t,e,r){var n=r||e;try{this.socket.send(t),n()}catch(t){n(t)}}},{key:"close",value:function(t,e){this.socket.close(t,e)}},{key:"addEventListener",value:function(t,e,r){this.socket.addEventListener(t,e,r)}}]),f}(r(8236).EventEmitter)},7547:(t,e,r)=>{var n=r(5326),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},5293:(t,e,r)=>{t.exports=r(150)(r(4701))},4701:(t,e,r)=>{const n=new(0,r(2272).ec)("secp256k1"),i=n.curve,o=i.n.constructor;function s(t){const e=t[0];switch(e){case 2:case 3:return 33!==t.length?null:function(t,e){let r=new o(e);if(r.cmp(i.p)>=0)return null;r=r.toRed(i.red);let s=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===t!==s.isOdd()&&(s=s.redNeg()),n.keyPair({pub:{x:r,y:s}})}(e,t.subarray(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){let s=new o(e),a=new o(r);if(s.cmp(i.p)>=0||a.cmp(i.p)>=0)return null;if(s=s.toRed(i.red),a=a.toRed(i.red),(6===t||7===t)&&a.isOdd()!==(7===t))return null;const u=s.redSqr().redIMul(s);return a.redSqr().redISub(u.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:s,y:a}}):null}(e,t.subarray(1,33),t.subarray(33,65));default:return null}}function a(t,e){const r=e.encode(null,33===t.length);for(let e=0;e<t.length;++e)t[e]=r[e]}t.exports={contextRandomize:()=>0,privateKeyVerify(t){const e=new o(t);return e.cmp(i.n)<0&&!e.isZero()?0:1},privateKeyNegate(t){const e=new o(t),r=i.n.sub(e).umod(i.n).toArrayLike(Uint8Array,"be",32);return t.set(r),0},privateKeyTweakAdd(t,e){const r=new o(e);if(r.cmp(i.n)>=0)return 1;if(r.iadd(new o(t)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},privateKeyTweakMul(t,e){let r=new o(e);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(t)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},publicKeyVerify:t=>null===s(t)?1:0,publicKeyCreate(t,e){const r=new o(e);return r.cmp(i.n)>=0||r.isZero()?1:(a(t,n.keyFromPrivate(e).getPublic()),0)},publicKeyConvert(t,e){const r=s(e);return null===r?1:(a(t,r.getPublic()),0)},publicKeyNegate(t,e){const r=s(e);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),a(t,n),0},publicKeyCombine(t,e){const r=new Array(e.length);for(let t=0;t<e.length;++t)if(r[t]=s(e[t]),null===r[t])return 1;let n=r[0].getPublic();for(let t=1;t<r.length;++t)n=n.add(r[t].pub);return n.isInfinity()?2:(a(t,n),0)},publicKeyTweakAdd(t,e,r){const n=s(e);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0)return 2;const u=n.getPublic().add(i.g.mul(r));return u.isInfinity()?2:(a(t,u),0)},publicKeyTweakMul(t,e,r){const n=s(e);return null===n?1:(r=new o(r)).cmp(i.n)>=0||r.isZero()?2:(a(t,n.getPublic().mul(r)),0)},signatureNormalize(t){const e=new o(t.subarray(0,32)),r=new o(t.subarray(32,64));return e.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&t.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(t,e){const r=e.subarray(0,32),n=e.subarray(32,64);if(new o(r).cmp(i.n)>=0)return 1;if(new o(n).cmp(i.n)>=0)return 1;const{output:s}=t;let a=s.subarray(4,37);a[0]=0,a.set(r,1);let u=33,f=0;for(;u>1&&0===a[f]&&!(128&a[f+1]);--u,++f);if(a=a.subarray(f),128&a[0])return 1;if(u>1&&0===a[0]&&!(128&a[1]))return 1;let h=s.subarray(39,72);h[0]=0,h.set(n,1);let c=33,d=0;for(;c>1&&0===h[d]&&!(128&h[d+1]);--c,++d);return h=h.subarray(d),128&h[0]||c>1&&0===h[0]&&!(128&h[1])?1:(t.outputlen=6+u+c,s[0]=48,s[1]=t.outputlen-2,s[2]=2,s[3]=a.length,s.set(a,4),s[4+u]=2,s[5+u]=h.length,s.set(h,6+u),0)},signatureImport(t,e){if(e.length<8)return 1;if(e.length>72)return 1;if(48!==e[0])return 1;if(e[1]!==e.length-2)return 1;if(2!==e[2])return 1;const r=e[3];if(0===r)return 1;if(5+r>=e.length)return 1;if(2!==e[4+r])return 1;const n=e[5+r];if(0===n)return 1;if(6+r+n!==e.length)return 1;if(128&e[4])return 1;if(r>1&&0===e[4]&&!(128&e[5]))return 1;if(128&e[r+6])return 1;if(n>1&&0===e[r+6]&&!(128&e[r+7]))return 1;let s=e.subarray(4,4+r);if(33===s.length&&0===s[0]&&(s=s.subarray(1)),s.length>32)return 1;let a=e.subarray(6+r);if(33===a.length&&0===a[0]&&(a=a.slice(1)),a.length>32)throw new Error("S length is too long");let u=new o(s);u.cmp(i.n)>=0&&(u=new o(0));let f=new o(e.subarray(6+r));return f.cmp(i.n)>=0&&(f=new o(0)),t.set(u.toArrayLike(Uint8Array,"be",32),0),t.set(f.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(t,e,r,s,a){if(a){const t=a;a=n=>{const i=t(e,r,null,s,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new o(i)}}const u=new o(r);if(u.cmp(i.n)>=0||u.isZero())return 1;let f;try{f=n.sign(e,r,{canonical:!0,k:a,pers:s})}catch(t){return 1}return t.signature.set(f.r.toArrayLike(Uint8Array,"be",32),0),t.signature.set(f.s.toArrayLike(Uint8Array,"be",32),32),t.recid=f.recoveryParam,0},ecdsaVerify(t,e,r){const a={r:t.subarray(0,32),s:t.subarray(32,64)},u=new o(a.r),f=new o(a.s);if(u.cmp(i.n)>=0||f.cmp(i.n)>=0)return 1;if(1===f.cmp(n.nh)||u.isZero()||f.isZero())return 3;const h=s(r);if(null===h)return 2;const c=h.getPublic();return n.verify(e,a,c)?0:3},ecdsaRecover(t,e,r,s){const u={r:e.slice(0,32),s:e.slice(32,64)},f=new o(u.r),h=new o(u.s);if(f.cmp(i.n)>=0||h.cmp(i.n)>=0)return 1;if(f.isZero()||h.isZero())return 2;let c;try{c=n.recoverPubKey(s,u,r)}catch(t){return 2}return a(t,c),0},ecdh(t,e,r,a,u,f,h){const c=s(e);if(null===c)return 1;const d=new o(r);if(d.cmp(i.n)>=0||d.isZero())return 2;const l=c.getPublic().mul(d);if(void 0===u){const e=l.encode(null,!0),r=n.hash().update(e).digest();for(let e=0;e<32;++e)t[e]=r[e]}else{f||(f=new Uint8Array(32));const e=l.getX().toArray("be",32);for(let t=0;t<32;++t)f[t]=e[t];h||(h=new Uint8Array(32));const r=l.getY().toArray("be",32);for(let t=0;t<32;++t)h[t]=r[t];const n=u(f,h,a);if(!(n instanceof Uint8Array&&n.length===t.length))return 2;t.set(n)}return 0}}},150:t=>{const e="Impossible case. Please create issue.",r="The tweak was out of range or the resulted private key is invalid",n="The tweak was out of range or equal to zero",i="Public Key could not be parsed",o="Public Key serialization error",s="Signature could not be parsed";function a(t,e){if(!t)throw new Error(e)}function u(t,e,r){if(a(e instanceof Uint8Array,`Expected ${t} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const n=`Expected ${t} to be an Uint8Array with length [${r.join(", ")}]`;a(r.includes(e.length),n)}else{const n=`Expected ${t} to be an Uint8Array with length ${r}`;a(e.length===r,n)}}function f(t){a("Boolean"===c(t),"Expected compressed to be a Boolean")}function h(t=(t=>new Uint8Array(t)),e){return"function"==typeof t&&(t=t(e)),u("output",t,e),t}function c(t){return Object.prototype.toString.call(t).slice(8,-1)}t.exports=t=>({contextRandomize(e){if(a(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&u("seed",e,32),1===t.contextRandomize(e))throw new Error("Unknow error on context randomization")},privateKeyVerify:e=>(u("private key",e,32),0===t.privateKeyVerify(e)),privateKeyNegate(r){switch(u("private key",r,32),t.privateKeyNegate(r)){case 0:return r;case 1:throw new Error(e)}},privateKeyTweakAdd(e,n){switch(u("private key",e,32),u("tweak",n,32),t.privateKeyTweakAdd(e,n)){case 0:return e;case 1:throw new Error(r)}},privateKeyTweakMul(e,r){switch(u("private key",e,32),u("tweak",r,32),t.privateKeyTweakMul(e,r)){case 0:return e;case 1:throw new Error(n)}},publicKeyVerify:e=>(u("public key",e,[33,65]),0===t.publicKeyVerify(e)),publicKeyCreate(e,r=!0,n){switch(u("private key",e,32),f(r),n=h(n,r?33:65),t.publicKeyCreate(n,e)){case 0:return n;case 1:throw new Error("Private Key is invalid");case 2:throw new Error(o)}},publicKeyConvert(e,r=!0,n){switch(u("public key",e,[33,65]),f(r),n=h(n,r?33:65),t.publicKeyConvert(n,e)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error(o)}},publicKeyNegate(r,n=!0,s){switch(u("public key",r,[33,65]),f(n),s=h(s,n?33:65),t.publicKeyNegate(s,r)){case 0:return s;case 1:throw new Error(i);case 2:throw new Error(e);case 3:throw new Error(o)}},publicKeyCombine(e,r=!0,n){a(Array.isArray(e),"Expected public keys to be an Array"),a(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)u("public key",t,[33,65]);switch(f(r),n=h(n,r?33:65),t.publicKeyCombine(n,e)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error("The sum of the public keys is not valid");case 3:throw new Error(o)}},publicKeyTweakAdd(e,n,o=!0,s){switch(u("public key",e,[33,65]),u("tweak",n,32),f(o),s=h(s,o?33:65),t.publicKeyTweakAdd(s,e,n)){case 0:return s;case 1:throw new Error(i);case 2:throw new Error(r)}},publicKeyTweakMul(e,r,o=!0,s){switch(u("public key",e,[33,65]),u("tweak",r,32),f(o),s=h(s,o?33:65),t.publicKeyTweakMul(s,e,r)){case 0:return s;case 1:throw new Error(i);case 2:throw new Error(n)}},signatureNormalize(e){switch(u("signature",e,64),t.signatureNormalize(e)){case 0:return e;case 1:throw new Error(s)}},signatureExport(r,n){u("signature",r,64);const i={output:n=h(n,72),outputlen:72};switch(t.signatureExport(i,r)){case 0:return n.slice(0,i.outputlen);case 1:throw new Error(s);case 2:throw new Error(e)}},signatureImport(r,n){switch(u("signature",r),n=h(n,64),t.signatureImport(n,r)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(e)}},ecdsaSign(r,n,i={},o){u("message",r,32),u("private key",n,32),a("Object"===c(i),"Expected options to be an Object"),void 0!==i.data&&u("options.data",i.data),void 0!==i.noncefn&&a("Function"===c(i.noncefn),"Expected options.noncefn to be a Function");const s={signature:o=h(o,64),recid:null};switch(t.ecdsaSign(s,r,n,i.data,i.noncefn)){case 0:return s;case 1:throw new Error("The nonce generation function failed, or the private key was invalid");case 2:throw new Error(e)}},ecdsaVerify(e,r,n){switch(u("signature",e,64),u("message",r,32),u("public key",n,[33,65]),t.ecdsaVerify(e,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(s);case 2:throw new Error(i)}},ecdsaRecover(r,n,i,o=!0,d){switch(u("signature",r,64),a("Number"===c(n)&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),u("message",i,32),f(o),d=h(d,o?33:65),t.ecdsaRecover(d,r,n,i)){case 0:return d;case 1:throw new Error(s);case 2:throw new Error("Public key could not be recover");case 3:throw new Error(e)}},ecdh(e,r,n={},o){switch(u("public key",e,[33,65]),u("private key",r,32),a("Object"===c(n),"Expected options to be an Object"),void 0!==n.data&&u("options.data",n.data),void 0!==n.hashfn?(a("Function"===c(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&u("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&u("options.ybuf",n.ybuf,32),u("output",o)):o=h(o,32),t.ecdh(o,e,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return o;case 1:throw new Error(i);case 2:throw new Error("Scalar was invalid (zero or overflow)")}}})},9967:(t,e)=>{"use strict";function r(t,e,r){return e<=t&&t<=r}function n(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function i(t){this.tokens=[].slice.call(t)}i.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.shift());else this.tokens.push(t)}};var o=-1;function s(t,e){if(t)throw TypeError("Decoder error");return e||65533}var a="utf-8";function u(t,e){if(!(this instanceof u))return new u(t,e);if((t=void 0!==t?String(t).toLowerCase():a)!==a)throw new Error("Encoding not supported. Only utf-8 is supported");e=n(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(e.fatal),this._ignoreBOM=Boolean(e.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function f(t,e){if(!(this instanceof f))return new f(t,e);if((t=void 0!==t?String(t).toLowerCase():a)!==a)throw new Error("Encoding not supported. Only utf-8 is supported");e=n(e),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(e.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}function h(t){var e=t.fatal,n=0,i=0,a=0,u=128,f=191;this.handler=function(t,h){if(-1===h&&0!==a)return a=0,s(e);if(-1===h)return o;if(0===a){if(r(h,0,127))return h;if(r(h,194,223))a=1,n=h-192;else if(r(h,224,239))224===h&&(u=160),237===h&&(f=159),a=2,n=h-224;else{if(!r(h,240,244))return s(e);240===h&&(u=144),244===h&&(f=143),a=3,n=h-240}return n<<=6*a,null}if(!r(h,u,f))return n=a=i=0,u=128,f=191,t.prepend(h),s(e);if(u=128,f=191,n+=h-128<<6*(a-(i+=1)),i!==a)return null;var c=n;return n=a=i=0,c}}function c(t){t.fatal,this.handler=function(t,e){if(-1===e)return o;if(r(e,0,127))return e;var n,i;r(e,128,2047)?(n=1,i=192):r(e,2048,65535)?(n=2,i=224):r(e,65536,1114111)&&(n=3,i=240);for(var s=[(e>>6*n)+i];n>0;){var a=e>>6*(n-1);s.push(128|63&a),n-=1}return s}}u.prototype={decode:function(t,e){var r;r="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=n(e),this._streaming||(this._decoder=new h({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(e.stream);for(var s,a=new i(r),u=[];!a.endOfStream()&&(s=this._decoder.handler(a,a.read()))!==o;)null!==s&&(Array.isArray(s)?u.push.apply(u,s):u.push(s));if(!this._streaming){do{if((s=this._decoder.handler(a,a.read()))===o)break;null!==s&&(Array.isArray(s)?u.push.apply(u,s):u.push(s))}while(!a.endOfStream());this._decoder=null}return u.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===u[0]?(this._BOMseen=!0,u.shift()):this._BOMseen=!0)),function(t){for(var e="",r=0;r<t.length;++r){var n=t[r];n<=65535?e+=String.fromCharCode(n):(n-=65536,e+=String.fromCharCode(55296+(n>>10),56320+(1023&n)))}return e}(u)}},f.prototype={encode:function(t,e){t=t?String(t):"",e=n(e),this._streaming||(this._encoder=new c(this._options)),this._streaming=Boolean(e.stream);for(var r,s=[],a=new i(function(t){for(var e=String(t),r=e.length,n=0,i=[];n<r;){var o=e.charCodeAt(n);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(n===r-1)i.push(65533);else{var s=t.charCodeAt(n+1);if(56320<=s&&s<=57343){var a=1023&o,u=1023&s;i.push(65536+(a<<10)+u),n+=1}else i.push(65533)}n+=1}return i}(t));!a.endOfStream()&&(r=this._encoder.handler(a,a.read()))!==o;)Array.isArray(r)?s.push.apply(s,r):s.push(r);if(!this._streaming){for(;(r=this._encoder.handler(a,a.read()))!==o;)Array.isArray(r)?s.push.apply(s,r):s.push(r);this._encoder=null}return new Uint8Array(s)}},e.TextEncoder=f,e.TextDecoder=u},5474:(t,e,r)=>{!function(t){"use strict";var e=function(t){var e,r=new Float64Array(16);if(t)for(e=0;e<t.length;e++)r[e]=t[e];return r},n=function(){throw new Error("no PRNG")},i=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var s=e(),a=e([1]),u=e([56129,1]),f=e([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=e([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),c=e([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=e([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),l=e([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(t,e,r,n){t[e]=r>>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r,t[e+4]=n>>24&255,t[e+5]=n>>16&255,t[e+6]=n>>8&255,t[e+7]=255&n}function b(t,e,r,n,i){var o,s=0;for(o=0;o<i;o++)s|=t[e+o]^r[n+o];return(1&s-1>>>8)-1}function g(t,e,r,n){return b(t,e,r,n,16)}function y(t,e,r,n){return b(t,e,r,n,32)}function m(t,e,r,n){!function(t,e,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,f=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,h=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,d=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,l=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,b=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,y=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,M=o,_=s,S=a,A=u,E=f,k=h,x=c,I=d,B=l,R=p,O=b,P=g,C=y,T=m,U=v,L=w,N=0;N<20;N+=2)M^=(i=(C^=(i=(B^=(i=(E^=(i=M+C|0)<<7|i>>>25)+M|0)<<9|i>>>23)+E|0)<<13|i>>>19)+B|0)<<18|i>>>14,k^=(i=(_^=(i=(T^=(i=(R^=(i=k+_|0)<<7|i>>>25)+k|0)<<9|i>>>23)+R|0)<<13|i>>>19)+T|0)<<18|i>>>14,O^=(i=(x^=(i=(S^=(i=(U^=(i=O+x|0)<<7|i>>>25)+O|0)<<9|i>>>23)+U|0)<<13|i>>>19)+S|0)<<18|i>>>14,L^=(i=(P^=(i=(I^=(i=(A^=(i=L+P|0)<<7|i>>>25)+L|0)<<9|i>>>23)+A|0)<<13|i>>>19)+I|0)<<18|i>>>14,M^=(i=(A^=(i=(S^=(i=(_^=(i=M+A|0)<<7|i>>>25)+M|0)<<9|i>>>23)+_|0)<<13|i>>>19)+S|0)<<18|i>>>14,k^=(i=(E^=(i=(I^=(i=(x^=(i=k+E|0)<<7|i>>>25)+k|0)<<9|i>>>23)+x|0)<<13|i>>>19)+I|0)<<18|i>>>14,O^=(i=(R^=(i=(B^=(i=(P^=(i=O+R|0)<<7|i>>>25)+O|0)<<9|i>>>23)+P|0)<<13|i>>>19)+B|0)<<18|i>>>14,L^=(i=(U^=(i=(T^=(i=(C^=(i=L+U|0)<<7|i>>>25)+L|0)<<9|i>>>23)+C|0)<<13|i>>>19)+T|0)<<18|i>>>14;M=M+o|0,_=_+s|0,S=S+a|0,A=A+u|0,E=E+f|0,k=k+h|0,x=x+c|0,I=I+d|0,B=B+l|0,R=R+p|0,O=O+b|0,P=P+g|0,C=C+y|0,T=T+m|0,U=U+v|0,L=L+w|0,t[0]=M>>>0&255,t[1]=M>>>8&255,t[2]=M>>>16&255,t[3]=M>>>24&255,t[4]=_>>>0&255,t[5]=_>>>8&255,t[6]=_>>>16&255,t[7]=_>>>24&255,t[8]=S>>>0&255,t[9]=S>>>8&255,t[10]=S>>>16&255,t[11]=S>>>24&255,t[12]=A>>>0&255,t[13]=A>>>8&255,t[14]=A>>>16&255,t[15]=A>>>24&255,t[16]=E>>>0&255,t[17]=E>>>8&255,t[18]=E>>>16&255,t[19]=E>>>24&255,t[20]=k>>>0&255,t[21]=k>>>8&255,t[22]=k>>>16&255,t[23]=k>>>24&255,t[24]=x>>>0&255,t[25]=x>>>8&255,t[26]=x>>>16&255,t[27]=x>>>24&255,t[28]=I>>>0&255,t[29]=I>>>8&255,t[30]=I>>>16&255,t[31]=I>>>24&255,t[32]=B>>>0&255,t[33]=B>>>8&255,t[34]=B>>>16&255,t[35]=B>>>24&255,t[36]=R>>>0&255,t[37]=R>>>8&255,t[38]=R>>>16&255,t[39]=R>>>24&255,t[40]=O>>>0&255,t[41]=O>>>8&255,t[42]=O>>>16&255,t[43]=O>>>24&255,t[44]=P>>>0&255,t[45]=P>>>8&255,t[46]=P>>>16&255,t[47]=P>>>24&255,t[48]=C>>>0&255,t[49]=C>>>8&255,t[50]=C>>>16&255,t[51]=C>>>24&255,t[52]=T>>>0&255,t[53]=T>>>8&255,t[54]=T>>>16&255,t[55]=T>>>24&255,t[56]=U>>>0&255,t[57]=U>>>8&255,t[58]=U>>>16&255,t[59]=U>>>24&255,t[60]=L>>>0&255,t[61]=L>>>8&255,t[62]=L>>>16&255,t[63]=L>>>24&255}(t,e,r,n)}function v(t,e,r,n){!function(t,e,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,f=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,h=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,d=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,l=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,b=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,y=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,M=0;M<20;M+=2)o^=(i=(y^=(i=(l^=(i=(f^=(i=o+y|0)<<7|i>>>25)+o|0)<<9|i>>>23)+f|0)<<13|i>>>19)+l|0)<<18|i>>>14,h^=(i=(s^=(i=(m^=(i=(p^=(i=h+s|0)<<7|i>>>25)+h|0)<<9|i>>>23)+p|0)<<13|i>>>19)+m|0)<<18|i>>>14,b^=(i=(c^=(i=(a^=(i=(v^=(i=b+c|0)<<7|i>>>25)+b|0)<<9|i>>>23)+v|0)<<13|i>>>19)+a|0)<<18|i>>>14,w^=(i=(g^=(i=(d^=(i=(u^=(i=w+g|0)<<7|i>>>25)+w|0)<<9|i>>>23)+u|0)<<13|i>>>19)+d|0)<<18|i>>>14,o^=(i=(u^=(i=(a^=(i=(s^=(i=o+u|0)<<7|i>>>25)+o|0)<<9|i>>>23)+s|0)<<13|i>>>19)+a|0)<<18|i>>>14,h^=(i=(f^=(i=(d^=(i=(c^=(i=h+f|0)<<7|i>>>25)+h|0)<<9|i>>>23)+c|0)<<13|i>>>19)+d|0)<<18|i>>>14,b^=(i=(p^=(i=(l^=(i=(g^=(i=b+p|0)<<7|i>>>25)+b|0)<<9|i>>>23)+g|0)<<13|i>>>19)+l|0)<<18|i>>>14,w^=(i=(v^=(i=(m^=(i=(y^=(i=w+v|0)<<7|i>>>25)+w|0)<<9|i>>>23)+y|0)<<13|i>>>19)+m|0)<<18|i>>>14;t[0]=o>>>0&255,t[1]=o>>>8&255,t[2]=o>>>16&255,t[3]=o>>>24&255,t[4]=h>>>0&255,t[5]=h>>>8&255,t[6]=h>>>16&255,t[7]=h>>>24&255,t[8]=b>>>0&255,t[9]=b>>>8&255,t[10]=b>>>16&255,t[11]=b>>>24&255,t[12]=w>>>0&255,t[13]=w>>>8&255,t[14]=w>>>16&255,t[15]=w>>>24&255,t[16]=c>>>0&255,t[17]=c>>>8&255,t[18]=c>>>16&255,t[19]=c>>>24&255,t[20]=d>>>0&255,t[21]=d>>>8&255,t[22]=d>>>16&255,t[23]=d>>>24&255,t[24]=l>>>0&255,t[25]=l>>>8&255,t[26]=l>>>16&255,t[27]=l>>>24&255,t[28]=p>>>0&255,t[29]=p>>>8&255,t[30]=p>>>16&255,t[31]=p>>>24&255}(t,e,r,n)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function M(t,e,r,n,i,o,s){var a,u,f=new Uint8Array(16),h=new Uint8Array(64);for(u=0;u<16;u++)f[u]=0;for(u=0;u<8;u++)f[u]=o[u];for(;i>=64;){for(m(h,f,s,w),u=0;u<64;u++)t[e+u]=r[n+u]^h[u];for(a=1,u=8;u<16;u++)a=a+(255&f[u])|0,f[u]=255&a,a>>>=8;i-=64,e+=64,n+=64}if(i>0)for(m(h,f,s,w),u=0;u<i;u++)t[e+u]=r[n+u]^h[u];return 0}function _(t,e,r,n,i){var o,s,a=new Uint8Array(16),u=new Uint8Array(64);for(s=0;s<16;s++)a[s]=0;for(s=0;s<8;s++)a[s]=n[s];for(;r>=64;){for(m(u,a,i,w),s=0;s<64;s++)t[e+s]=u[s];for(o=1,s=8;s<16;s++)o=o+(255&a[s])|0,a[s]=255&o,o>>>=8;r-=64,e+=64}if(r>0)for(m(u,a,i,w),s=0;s<r;s++)t[e+s]=u[s];return 0}function S(t,e,r,n,i){var o=new Uint8Array(32);v(o,n,i,w);for(var s=new Uint8Array(8),a=0;a<8;a++)s[a]=n[a+16];return _(t,e,r,s,o)}function A(t,e,r,n,i,o,s){var a=new Uint8Array(32);v(a,o,s,w);for(var u=new Uint8Array(8),f=0;f<8;f++)u[f]=o[f+16];return M(t,e,r,n,i,u,a)}var E=function(t){var e,r,n,i,o,s,a,u;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,e=255&t[0]|(255&t[1])<<8,this.r[0]=8191&e,r=255&t[2]|(255&t[3])<<8,this.r[1]=8191&(e>>>13|r<<3),n=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(n>>>7|i<<9),o=255&t[8]|(255&t[9])<<8,this.r[4]=255&(i>>>4|o<<12),this.r[5]=o>>>1&8190,s=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(o>>>14|s<<2),a=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(s>>>11|a<<5),u=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(a>>>8|u<<8),this.r[9]=u>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function k(t,e,r,n,i,o){var s=new E(o);return s.update(r,n,i),s.finish(t,e),0}function x(t,e,r,n,i,o){var s=new Uint8Array(16);return k(s,0,r,n,i,o),g(t,e,s,0)}function I(t,e,r,n,i){var o;if(r<32)return-1;for(A(t,0,e,0,r,n,i),k(t,16,t,32,r-32,t),o=0;o<16;o++)t[o]=0;return 0}function B(t,e,r,n,i){var o,s=new Uint8Array(32);if(r<32)return-1;if(S(s,0,32,n,i),0!==x(e,16,e,32,r-32,s))return-1;for(A(t,0,e,0,r,n,i),o=0;o<32;o++)t[o]=0;return 0}function R(t,e){var r;for(r=0;r<16;r++)t[r]=0|e[r]}function O(t){var e,r,n=1;for(e=0;e<16;e++)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-65536*n;t[0]+=n-1+37*(n-1)}function P(t,e,r){for(var n,i=~(r-1),o=0;o<16;o++)n=i&(t[o]^e[o]),t[o]^=n,e[o]^=n}function C(t,r){var n,i,o,s=e(),a=e();for(n=0;n<16;n++)a[n]=r[n];for(O(a),O(a),O(a),i=0;i<2;i++){for(s[0]=a[0]-65517,n=1;n<15;n++)s[n]=a[n]-65535-(s[n-1]>>16&1),s[n-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,P(a,s,1-o)}for(n=0;n<16;n++)t[2*n]=255&a[n],t[2*n+1]=a[n]>>8}function T(t,e){var r=new Uint8Array(32),n=new Uint8Array(32);return C(r,t),C(n,e),y(r,0,n,0)}function U(t){var e=new Uint8Array(32);return C(e,t),1&e[0]}function L(t,e){var r;for(r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}function N(t,e,r){for(var n=0;n<16;n++)t[n]=e[n]+r[n]}function z(t,e,r){for(var n=0;n<16;n++)t[n]=e[n]-r[n]}function j(t,e,r){var n,i,o=0,s=0,a=0,u=0,f=0,h=0,c=0,d=0,l=0,p=0,b=0,g=0,y=0,m=0,v=0,w=0,M=0,_=0,S=0,A=0,E=0,k=0,x=0,I=0,B=0,R=0,O=0,P=0,C=0,T=0,U=0,L=r[0],N=r[1],z=r[2],j=r[3],q=r[4],F=r[5],D=r[6],K=r[7],W=r[8],J=r[9],$=r[10],G=r[11],V=r[12],H=r[13],Z=r[14],Y=r[15];o+=(n=e[0])*L,s+=n*N,a+=n*z,u+=n*j,f+=n*q,h+=n*F,c+=n*D,d+=n*K,l+=n*W,p+=n*J,b+=n*$,g+=n*G,y+=n*V,m+=n*H,v+=n*Z,w+=n*Y,s+=(n=e[1])*L,a+=n*N,u+=n*z,f+=n*j,h+=n*q,c+=n*F,d+=n*D,l+=n*K,p+=n*W,b+=n*J,g+=n*$,y+=n*G,m+=n*V,v+=n*H,w+=n*Z,M+=n*Y,a+=(n=e[2])*L,u+=n*N,f+=n*z,h+=n*j,c+=n*q,d+=n*F,l+=n*D,p+=n*K,b+=n*W,g+=n*J,y+=n*$,m+=n*G,v+=n*V,w+=n*H,M+=n*Z,_+=n*Y,u+=(n=e[3])*L,f+=n*N,h+=n*z,c+=n*j,d+=n*q,l+=n*F,p+=n*D,b+=n*K,g+=n*W,y+=n*J,m+=n*$,v+=n*G,w+=n*V,M+=n*H,_+=n*Z,S+=n*Y,f+=(n=e[4])*L,h+=n*N,c+=n*z,d+=n*j,l+=n*q,p+=n*F,b+=n*D,g+=n*K,y+=n*W,m+=n*J,v+=n*$,w+=n*G,M+=n*V,_+=n*H,S+=n*Z,A+=n*Y,h+=(n=e[5])*L,c+=n*N,d+=n*z,l+=n*j,p+=n*q,b+=n*F,g+=n*D,y+=n*K,m+=n*W,v+=n*J,w+=n*$,M+=n*G,_+=n*V,S+=n*H,A+=n*Z,E+=n*Y,c+=(n=e[6])*L,d+=n*N,l+=n*z,p+=n*j,b+=n*q,g+=n*F,y+=n*D,m+=n*K,v+=n*W,w+=n*J,M+=n*$,_+=n*G,S+=n*V,A+=n*H,E+=n*Z,k+=n*Y,d+=(n=e[7])*L,l+=n*N,p+=n*z,b+=n*j,g+=n*q,y+=n*F,m+=n*D,v+=n*K,w+=n*W,M+=n*J,_+=n*$,S+=n*G,A+=n*V,E+=n*H,k+=n*Z,x+=n*Y,l+=(n=e[8])*L,p+=n*N,b+=n*z,g+=n*j,y+=n*q,m+=n*F,v+=n*D,w+=n*K,M+=n*W,_+=n*J,S+=n*$,A+=n*G,E+=n*V,k+=n*H,x+=n*Z,I+=n*Y,p+=(n=e[9])*L,b+=n*N,g+=n*z,y+=n*j,m+=n*q,v+=n*F,w+=n*D,M+=n*K,_+=n*W,S+=n*J,A+=n*$,E+=n*G,k+=n*V,x+=n*H,I+=n*Z,B+=n*Y,b+=(n=e[10])*L,g+=n*N,y+=n*z,m+=n*j,v+=n*q,w+=n*F,M+=n*D,_+=n*K,S+=n*W,A+=n*J,E+=n*$,k+=n*G,x+=n*V,I+=n*H,B+=n*Z,R+=n*Y,g+=(n=e[11])*L,y+=n*N,m+=n*z,v+=n*j,w+=n*q,M+=n*F,_+=n*D,S+=n*K,A+=n*W,E+=n*J,k+=n*$,x+=n*G,I+=n*V,B+=n*H,R+=n*Z,O+=n*Y,y+=(n=e[12])*L,m+=n*N,v+=n*z,w+=n*j,M+=n*q,_+=n*F,S+=n*D,A+=n*K,E+=n*W,k+=n*J,x+=n*$,I+=n*G,B+=n*V,R+=n*H,O+=n*Z,P+=n*Y,m+=(n=e[13])*L,v+=n*N,w+=n*z,M+=n*j,_+=n*q,S+=n*F,A+=n*D,E+=n*K,k+=n*W,x+=n*J,I+=n*$,B+=n*G,R+=n*V,O+=n*H,P+=n*Z,C+=n*Y,v+=(n=e[14])*L,w+=n*N,M+=n*z,_+=n*j,S+=n*q,A+=n*F,E+=n*D,k+=n*K,x+=n*W,I+=n*J,B+=n*$,R+=n*G,O+=n*V,P+=n*H,C+=n*Z,T+=n*Y,w+=(n=e[15])*L,s+=38*(_+=n*z),a+=38*(S+=n*j),u+=38*(A+=n*q),f+=38*(E+=n*F),h+=38*(k+=n*D),c+=38*(x+=n*K),d+=38*(I+=n*W),l+=38*(B+=n*J),p+=38*(R+=n*$),b+=38*(O+=n*G),g+=38*(P+=n*V),y+=38*(C+=n*H),m+=38*(T+=n*Z),v+=38*(U+=n*Y),o=(n=(o+=38*(M+=n*N))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),t[0]=o,t[1]=s,t[2]=a,t[3]=u,t[4]=f,t[5]=h,t[6]=c,t[7]=d,t[8]=l,t[9]=p,t[10]=b,t[11]=g,t[12]=y,t[13]=m,t[14]=v,t[15]=w}function q(t,e){j(t,e,e)}function F(t,r){var n,i=e();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)q(i,i),2!==n&&4!==n&&j(i,i,r);for(n=0;n<16;n++)t[n]=i[n]}function D(t,r){var n,i=e();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)q(i,i),1!==n&&j(i,i,r);for(n=0;n<16;n++)t[n]=i[n]}function K(t,r,n){var i,o,s=new Uint8Array(32),a=new Float64Array(80),f=e(),h=e(),c=e(),d=e(),l=e(),p=e();for(o=0;o<31;o++)s[o]=r[o];for(s[31]=127&r[31]|64,s[0]&=248,L(a,n),o=0;o<16;o++)h[o]=a[o],d[o]=f[o]=c[o]=0;for(f[0]=d[0]=1,o=254;o>=0;--o)P(f,h,i=s[o>>>3]>>>(7&o)&1),P(c,d,i),N(l,f,c),z(f,f,c),N(c,h,d),z(h,h,d),q(d,l),q(p,f),j(f,c,f),j(c,h,l),N(l,f,c),z(f,f,c),q(h,f),z(c,d,p),j(f,c,u),N(f,f,d),j(c,c,f),j(f,d,p),j(d,h,a),q(h,l),P(f,h,i),P(c,d,i);for(o=0;o<16;o++)a[o+16]=f[o],a[o+32]=c[o],a[o+48]=h[o],a[o+64]=d[o];var b=a.subarray(32),g=a.subarray(16);return F(b,b),j(g,g,b),C(t,g),0}function W(t,e){return K(t,e,o)}function J(t,e){return n(e,32),W(t,e)}function $(t,e,r){var n=new Uint8Array(32);return K(n,r,e),v(t,i,n,w)}E.prototype.blocks=function(t,e,r){for(var n,i,o,s,a,u,f,h,c,d,l,p,b,g,y,m,v,w,M,_=this.fin?0:2048,S=this.h[0],A=this.h[1],E=this.h[2],k=this.h[3],x=this.h[4],I=this.h[5],B=this.h[6],R=this.h[7],O=this.h[8],P=this.h[9],C=this.r[0],T=this.r[1],U=this.r[2],L=this.r[3],N=this.r[4],z=this.r[5],j=this.r[6],q=this.r[7],F=this.r[8],D=this.r[9];r>=16;)d=c=0,d+=(S+=8191&(n=255&t[e+0]|(255&t[e+1])<<8))*C,d+=(A+=8191&(n>>>13|(i=255&t[e+2]|(255&t[e+3])<<8)<<3))*(5*D),d+=(E+=8191&(i>>>10|(o=255&t[e+4]|(255&t[e+5])<<8)<<6))*(5*F),d+=(k+=8191&(o>>>7|(s=255&t[e+6]|(255&t[e+7])<<8)<<9))*(5*q),c=(d+=(x+=8191&(s>>>4|(a=255&t[e+8]|(255&t[e+9])<<8)<<12))*(5*j))>>>13,d&=8191,d+=(I+=a>>>1&8191)*(5*z),d+=(B+=8191&(a>>>14|(u=255&t[e+10]|(255&t[e+11])<<8)<<2))*(5*N),d+=(R+=8191&(u>>>11|(f=255&t[e+12]|(255&t[e+13])<<8)<<5))*(5*L),d+=(O+=8191&(f>>>8|(h=255&t[e+14]|(255&t[e+15])<<8)<<8))*(5*U),l=c+=(d+=(P+=h>>>5|_)*(5*T))>>>13,l+=S*T,l+=A*C,l+=E*(5*D),l+=k*(5*F),c=(l+=x*(5*q))>>>13,l&=8191,l+=I*(5*j),l+=B*(5*z),l+=R*(5*N),l+=O*(5*L),c+=(l+=P*(5*U))>>>13,l&=8191,p=c,p+=S*U,p+=A*T,p+=E*C,p+=k*(5*D),c=(p+=x*(5*F))>>>13,p&=8191,p+=I*(5*q),p+=B*(5*j),p+=R*(5*z),p+=O*(5*N),b=c+=(p+=P*(5*L))>>>13,b+=S*L,b+=A*U,b+=E*T,b+=k*C,c=(b+=x*(5*D))>>>13,b&=8191,b+=I*(5*F),b+=B*(5*q),b+=R*(5*j),b+=O*(5*z),g=c+=(b+=P*(5*N))>>>13,g+=S*N,g+=A*L,g+=E*U,g+=k*T,c=(g+=x*C)>>>13,g&=8191,g+=I*(5*D),g+=B*(5*F),g+=R*(5*q),g+=O*(5*j),y=c+=(g+=P*(5*z))>>>13,y+=S*z,y+=A*N,y+=E*L,y+=k*U,c=(y+=x*T)>>>13,y&=8191,y+=I*C,y+=B*(5*D),y+=R*(5*F),y+=O*(5*q),m=c+=(y+=P*(5*j))>>>13,m+=S*j,m+=A*z,m+=E*N,m+=k*L,c=(m+=x*U)>>>13,m&=8191,m+=I*T,m+=B*C,m+=R*(5*D),m+=O*(5*F),v=c+=(m+=P*(5*q))>>>13,v+=S*q,v+=A*j,v+=E*z,v+=k*N,c=(v+=x*L)>>>13,v&=8191,v+=I*U,v+=B*T,v+=R*C,v+=O*(5*D),w=c+=(v+=P*(5*F))>>>13,w+=S*F,w+=A*q,w+=E*j,w+=k*z,c=(w+=x*N)>>>13,w&=8191,w+=I*L,w+=B*U,w+=R*T,w+=O*C,M=c+=(w+=P*(5*D))>>>13,M+=S*D,M+=A*F,M+=E*q,M+=k*j,c=(M+=x*z)>>>13,M&=8191,M+=I*N,M+=B*L,M+=R*U,M+=O*T,S=d=8191&(c=(c=((c+=(M+=P*C)>>>13)<<2)+c|0)+(d&=8191)|0),A=l+=c>>>=13,E=p&=8191,k=b&=8191,x=g&=8191,I=y&=8191,B=m&=8191,R=v&=8191,O=w&=8191,P=M&=8191,e+=16,r-=16;this.h[0]=S,this.h[1]=A,this.h[2]=E,this.h[3]=k,this.h[4]=x,this.h[5]=I,this.h[6]=B,this.h[7]=R,this.h[8]=O,this.h[9]=P},E.prototype.finish=function(t,e){var r,n,i,o,s=new Uint16Array(10);if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,s[0]=this.h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this.h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this.h[o]=this.h[o]&n|s[o];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,o=1;o<8;o++)i=(this.h[o]+this.pad[o]|0)+(i>>>16)|0,this.h[o]=65535&i;t[e+0]=this.h[0]>>>0&255,t[e+1]=this.h[0]>>>8&255,t[e+2]=this.h[1]>>>0&255,t[e+3]=this.h[1]>>>8&255,t[e+4]=this.h[2]>>>0&255,t[e+5]=this.h[2]>>>8&255,t[e+6]=this.h[3]>>>0&255,t[e+7]=this.h[3]>>>8&255,t[e+8]=this.h[4]>>>0&255,t[e+9]=this.h[4]>>>8&255,t[e+10]=this.h[5]>>>0&255,t[e+11]=this.h[5]>>>8&255,t[e+12]=this.h[6]>>>0&255,t[e+13]=this.h[6]>>>8&255,t[e+14]=this.h[7]>>>0&255,t[e+15]=this.h[7]>>>8&255},E.prototype.update=function(t,e,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n<i;n++)this.buffer[this.leftover+n]=t[e+n];if(r-=i,e+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(i=r-r%16,this.blocks(t,e,i),e+=i,r-=i),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=t[e+n];this.leftover+=r}};var G=I,V=B,H=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Z(t,e,r,n){for(var i,o,s,a,u,f,h,c,d,l,p,b,g,y,m,v,w,M,_,S,A,E,k,x,I,B,R=new Int32Array(16),O=new Int32Array(16),P=t[0],C=t[1],T=t[2],U=t[3],L=t[4],N=t[5],z=t[6],j=t[7],q=e[0],F=e[1],D=e[2],K=e[3],W=e[4],J=e[5],$=e[6],G=e[7],V=0;n>=128;){for(_=0;_<16;_++)S=8*_+V,R[_]=r[S+0]<<24|r[S+1]<<16|r[S+2]<<8|r[S+3],O[_]=r[S+4]<<24|r[S+5]<<16|r[S+6]<<8|r[S+7];for(_=0;_<80;_++)if(i=P,o=C,s=T,a=U,u=L,f=N,h=z,d=q,l=F,p=D,b=K,g=W,y=J,m=$,k=65535&(E=G),x=E>>>16,I=65535&(A=j),B=A>>>16,k+=65535&(E=(W>>>14|L<<18)^(W>>>18|L<<14)^(L>>>9|W<<23)),x+=E>>>16,I+=65535&(A=(L>>>14|W<<18)^(L>>>18|W<<14)^(W>>>9|L<<23)),B+=A>>>16,k+=65535&(E=W&J^~W&$),x+=E>>>16,I+=65535&(A=L&N^~L&z),B+=A>>>16,k+=65535&(E=H[2*_+1]),x+=E>>>16,I+=65535&(A=H[2*_]),B+=A>>>16,A=R[_%16],x+=(E=O[_%16])>>>16,I+=65535&A,B+=A>>>16,I+=(x+=(k+=65535&E)>>>16)>>>16,k=65535&(E=M=65535&k|x<<16),x=E>>>16,I=65535&(A=w=65535&I|(B+=I>>>16)<<16),B=A>>>16,k+=65535&(E=(q>>>28|P<<4)^(P>>>2|q<<30)^(P>>>7|q<<25)),x+=E>>>16,I+=65535&(A=(P>>>28|q<<4)^(q>>>2|P<<30)^(q>>>7|P<<25)),B+=A>>>16,x+=(E=q&F^q&D^F&D)>>>16,I+=65535&(A=P&C^P&T^C&T),B+=A>>>16,c=65535&(I+=(x+=(k+=65535&E)>>>16)>>>16)|(B+=I>>>16)<<16,v=65535&k|x<<16,k=65535&(E=b),x=E>>>16,I=65535&(A=a),B=A>>>16,x+=(E=M)>>>16,I+=65535&(A=w),B+=A>>>16,C=i,T=o,U=s,L=a=65535&(I+=(x+=(k+=65535&E)>>>16)>>>16)|(B+=I>>>16)<<16,N=u,z=f,j=h,P=c,F=d,D=l,K=p,W=b=65535&k|x<<16,J=g,$=y,G=m,q=v,_%16==15)for(S=0;S<16;S++)A=R[S],k=65535&(E=O[S]),x=E>>>16,I=65535&A,B=A>>>16,A=R[(S+9)%16],k+=65535&(E=O[(S+9)%16]),x+=E>>>16,I+=65535&A,B+=A>>>16,w=R[(S+1)%16],k+=65535&(E=((M=O[(S+1)%16])>>>1|w<<31)^(M>>>8|w<<24)^(M>>>7|w<<25)),x+=E>>>16,I+=65535&(A=(w>>>1|M<<31)^(w>>>8|M<<24)^w>>>7),B+=A>>>16,w=R[(S+14)%16],x+=(E=((M=O[(S+14)%16])>>>19|w<<13)^(w>>>29|M<<3)^(M>>>6|w<<26))>>>16,I+=65535&(A=(w>>>19|M<<13)^(M>>>29|w<<3)^w>>>6),B+=A>>>16,B+=(I+=(x+=(k+=65535&E)>>>16)>>>16)>>>16,R[S]=65535&I|B<<16,O[S]=65535&k|x<<16;k=65535&(E=q),x=E>>>16,I=65535&(A=P),B=A>>>16,A=t[0],x+=(E=e[0])>>>16,I+=65535&A,B+=A>>>16,B+=(I+=(x+=(k+=65535&E)>>>16)>>>16)>>>16,t[0]=P=65535&I|B<<16,e[0]=q=65535&k|x<<16,k=65535&(E=F),x=E>>>16,I=65535&(A=C),B=A>>>16,A=t[1],x+=(E=e[1])>>>16,I+=65535&A,B+=A>>>16,B+=(I+=(x+=(k+=65535&E)>>>16)>>>16)>>>16,t[1]=C=65535&I|B<<16,e[1]=F=65535&k|x<<16,k=65535&(E=D),x=E>>>16,I=65535&(A=T),B=A>>>16,A=t[2],x+=(E=e[2])>>>16,I+=65535&A,B+=A>>>16,B+=(I+=(x+=(k+=65535&E)>>>16)>>>16)>>>16,t[2]=T=65535&I|B<<16,e[2]=D=65535&k|x<<16,k=65535&(E=K),x=E>>>16,I=65535&(A=U),B=A>>>16,A=t[3],x+=(E=e[3])>>>16,I+=65535&A,B+=A>>>16,B+=(I+=(x+=(k+=65535&E)>>>16)>>>16)>>>16,t[3]=U=65535&I|B<<16,e[3]=K=65535&k|x<<16,k=65535&(E=W),x=E>>>16,I=65535&(A=L),B=A>>>16,A=t[4],x+=(E=e[4])>>>16,I+=65535&A,B+=A>>>16,B+=(I+=(x+=(k+=65535&E)>>>16)>>>16)>>>16,t[4]=L=65535&I|B<<16,e[4]=W=65535&k|x<<16,k=65535&(E=J),x=E>>>16,I=65535&(A=N),B=A>>>16,A=t[5],x+=(E=e[5])>>>16,I+=65535&A,B+=A>>>16,B+=(I+=(x+=(k+=65535&E)>>>16)>>>16)>>>16,t[5]=N=65535&I|B<<16,e[5]=J=65535&k|x<<16,k=65535&(E=$),x=E>>>16,I=65535&(A=z),B=A>>>16,A=t[6],x+=(E=e[6])>>>16,I+=65535&A,B+=A>>>16,B+=(I+=(x+=(k+=65535&E)>>>16)>>>16)>>>16,t[6]=z=65535&I|B<<16,e[6]=$=65535&k|x<<16,k=65535&(E=G),x=E>>>16,I=65535&(A=j),B=A>>>16,A=t[7],x+=(E=e[7])>>>16,I+=65535&A,B+=A>>>16,B+=(I+=(x+=(k+=65535&E)>>>16)>>>16)>>>16,t[7]=j=65535&I|B<<16,e[7]=G=65535&k|x<<16,V+=128,n-=128}return n}function Y(t,e,r){var n,i=new Int32Array(8),o=new Int32Array(8),s=new Uint8Array(256),a=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,Z(i,o,e,r),r%=128,n=0;n<r;n++)s[n]=e[a-r+n];for(s[r]=128,s[(r=256-128*(r<112?1:0))-9]=0,p(s,r-8,a/536870912|0,a<<3),Z(i,o,s,r),n=0;n<8;n++)p(t,8*n,i[n],o[n]);return 0}function X(t,r){var n=e(),i=e(),o=e(),s=e(),a=e(),u=e(),f=e(),c=e(),d=e();z(n,t[1],t[0]),z(d,r[1],r[0]),j(n,n,d),N(i,t[0],t[1]),N(d,r[0],r[1]),j(i,i,d),j(o,t[3],r[3]),j(o,o,h),j(s,t[2],r[2]),N(s,s,s),z(a,i,n),z(u,s,o),N(f,s,o),N(c,i,n),j(t[0],a,u),j(t[1],c,f),j(t[2],f,u),j(t[3],a,c)}function Q(t,e,r){var n;for(n=0;n<4;n++)P(t[n],e[n],r)}function tt(t,r){var n=e(),i=e(),o=e();F(o,r[2]),j(n,r[0],o),j(i,r[1],o),C(t,i),t[31]^=U(n)<<7}function et(t,e,r){var n,i;for(R(t[0],s),R(t[1],a),R(t[2],a),R(t[3],s),i=255;i>=0;--i)Q(t,e,n=r[i/8|0]>>(7&i)&1),X(e,t),X(t,t),Q(t,e,n)}function rt(t,r){var n=[e(),e(),e(),e()];R(n[0],c),R(n[1],d),R(n[2],a),j(n[3],c,d),et(t,n,r)}function nt(t,r,i){var o,s=new Uint8Array(64),a=[e(),e(),e(),e()];for(i||n(r,32),Y(s,r,32),s[0]&=248,s[31]&=127,s[31]|=64,rt(a,s),tt(t,a),o=0;o<32;o++)r[o+32]=t[o];return 0}var it=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ot(t,e){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)e[i]+=r-16*e[n]*it[i-(n-32)],r=Math.floor((e[i]+128)/256),e[i]-=256*r;e[i]+=r,e[n]=0}for(r=0,i=0;i<32;i++)e[i]+=r-(e[31]>>4)*it[i],r=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=r*it[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,t[n]=255&e[n]}function st(t){var e,r=new Float64Array(64);for(e=0;e<64;e++)r[e]=t[e];for(e=0;e<64;e++)t[e]=0;ot(t,r)}function at(t,r,n,i){var o,s,a=new Uint8Array(64),u=new Uint8Array(64),f=new Uint8Array(64),h=new Float64Array(64),c=[e(),e(),e(),e()];Y(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var d=n+64;for(o=0;o<n;o++)t[64+o]=r[o];for(o=0;o<32;o++)t[32+o]=a[32+o];for(Y(f,t.subarray(32),n+32),st(f),rt(c,f),tt(t,c),o=32;o<64;o++)t[o]=i[o];for(Y(u,t,n+64),st(u),o=0;o<64;o++)h[o]=0;for(o=0;o<32;o++)h[o]=f[o];for(o=0;o<32;o++)for(s=0;s<32;s++)h[o+s]+=u[o]*a[s];return ot(t.subarray(32),h),d}function ut(t,r,n,i){var o,u=new Uint8Array(32),h=new Uint8Array(64),c=[e(),e(),e(),e()],d=[e(),e(),e(),e()];if(n<64)return-1;if(function(t,r){var n=e(),i=e(),o=e(),u=e(),h=e(),c=e(),d=e();return R(t[2],a),L(t[1],r),q(o,t[1]),j(u,o,f),z(o,o,t[2]),N(u,t[2],u),q(h,u),q(c,h),j(d,c,h),j(n,d,o),j(n,n,u),D(n,n),j(n,n,o),j(n,n,u),j(n,n,u),j(t[0],n,u),q(i,t[0]),j(i,i,u),T(i,o)&&j(t[0],t[0],l),q(i,t[0]),j(i,i,u),T(i,o)?-1:(U(t[0])===r[31]>>7&&z(t[0],s,t[0]),j(t[3],t[0],t[1]),0)}(d,i))return-1;for(o=0;o<n;o++)t[o]=r[o];for(o=0;o<32;o++)t[o+32]=i[o];if(Y(h,t,n),st(h),et(c,d,h),rt(d,r.subarray(32)),X(c,d),tt(u,c),n-=64,y(r,0,u,0)){for(o=0;o<n;o++)t[o]=0;return-1}for(o=0;o<n;o++)t[o]=r[o+64];return n}var ft=64,ht=32,ct=64;function dt(t,e){if(32!==t.length)throw new Error("bad key size");if(24!==e.length)throw new Error("bad nonce size")}function lt(){for(var t=0;t<arguments.length;t++)if(!(arguments[t]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function pt(t){for(var e=0;e<t.length;e++)t[e]=0}t.lowlevel={crypto_core_hsalsa20:v,crypto_stream_xor:A,crypto_stream:S,crypto_stream_salsa20_xor:M,crypto_stream_salsa20:_,crypto_onetimeauth:k,crypto_onetimeauth_verify:x,crypto_verify_16:g,crypto_verify_32:y,crypto_secretbox:I,crypto_secretbox_open:B,crypto_scalarmult:K,crypto_scalarmult_base:W,crypto_box_beforenm:$,crypto_box_afternm:G,crypto_box:function(t,e,r,n,i,o){var s=new Uint8Array(32);return $(s,i,o),G(t,e,r,n,s)},crypto_box_open:function(t,e,r,n,i,o){var s=new Uint8Array(32);return $(s,i,o),V(t,e,r,n,s)},crypto_box_keypair:J,crypto_hash:Y,crypto_sign:at,crypto_sign_keypair:nt,crypto_sign_open:ut,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:ft,crypto_sign_PUBLICKEYBYTES:ht,crypto_sign_SECRETKEYBYTES:ct,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:e,D:f,L:it,pack25519:C,unpack25519:L,M:j,A:N,S:q,Z:z,pow2523:D,add:X,set25519:R,modL:ot,scalarmult:et,scalarbase:rt},t.randomBytes=function(t){var e=new Uint8Array(t);return n(e,t),e},t.secretbox=function(t,e,r){lt(t,e,r),dt(r,e);for(var n=new Uint8Array(32+t.length),i=new Uint8Array(n.length),o=0;o<t.length;o++)n[o+32]=t[o];return I(i,n,n.length,e,r),i.subarray(16)},t.secretbox.open=function(t,e,r){lt(t,e,r),dt(r,e);for(var n=new Uint8Array(16+t.length),i=new Uint8Array(n.length),o=0;o<t.length;o++)n[o+16]=t[o];return n.length<32||0!==B(i,n,n.length,e,r)?null:i.subarray(32)},t.secretbox.keyLength=32,t.secretbox.nonceLength=24,t.secretbox.overheadLength=16,t.scalarMult=function(t,e){if(lt(t,e),32!==t.length)throw new Error("bad n size");if(32!==e.length)throw new Error("bad p size");var r=new Uint8Array(32);return K(r,t,e),r},t.scalarMult.base=function(t){if(lt(t),32!==t.length)throw new Error("bad n size");var e=new Uint8Array(32);return W(e,t),e},t.scalarMult.scalarLength=32,t.scalarMult.groupElementLength=32,t.box=function(e,r,n,i){var o=t.box.before(n,i);return t.secretbox(e,r,o)},t.box.before=function(t,e){lt(t,e),function(t,e){if(32!==t.length)throw new Error("bad public key size");if(32!==e.length)throw new Error("bad secret key size")}(t,e);var r=new Uint8Array(32);return $(r,t,e),r},t.box.after=t.secretbox,t.box.open=function(e,r,n,i){var o=t.box.before(n,i);return t.secretbox.open(e,r,o)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var t=new Uint8Array(32),e=new Uint8Array(32);return J(t,e),{publicKey:t,secretKey:e}},t.box.keyPair.fromSecretKey=function(t){if(lt(t),32!==t.length)throw new Error("bad secret key size");var e=new Uint8Array(32);return W(e,t),{publicKey:e,secretKey:new Uint8Array(t)}},t.box.publicKeyLength=32,t.box.secretKeyLength=32,t.box.sharedKeyLength=32,t.box.nonceLength=24,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(t,e){if(lt(t,e),e.length!==ct)throw new Error("bad secret key size");var r=new Uint8Array(ft+t.length);return at(r,t,t.length,e),r},t.sign.open=function(t,e){if(lt(t,e),e.length!==ht)throw new Error("bad public key size");var r=new Uint8Array(t.length),n=ut(r,t,t.length,e);if(n<0)return null;for(var i=new Uint8Array(n),o=0;o<i.length;o++)i[o]=r[o];return i},t.sign.detached=function(e,r){for(var n=t.sign(e,r),i=new Uint8Array(ft),o=0;o<i.length;o++)i[o]=n[o];return i},t.sign.detached.verify=function(t,e,r){if(lt(t,e,r),e.length!==ft)throw new Error("bad signature size");if(r.length!==ht)throw new Error("bad public key size");var n,i=new Uint8Array(ft+t.length),o=new Uint8Array(ft+t.length);for(n=0;n<ft;n++)i[n]=e[n];for(n=0;n<t.length;n++)i[n+ft]=t[n];return ut(o,i,i.length,r)>=0},t.sign.keyPair=function(){var t=new Uint8Array(ht),e=new Uint8Array(ct);return nt(t,e),{publicKey:t,secretKey:e}},t.sign.keyPair.fromSecretKey=function(t){if(lt(t),t.length!==ct)throw new Error("bad secret key size");for(var e=new Uint8Array(ht),r=0;r<e.length;r++)e[r]=t[32+r];return{publicKey:e,secretKey:new Uint8Array(t)}},t.sign.keyPair.fromSeed=function(t){if(lt(t),32!==t.length)throw new Error("bad seed size");for(var e=new Uint8Array(ht),r=new Uint8Array(ct),n=0;n<32;n++)r[n]=t[n];return nt(e,r,!0),{publicKey:e,secretKey:r}},t.sign.publicKeyLength=ht,t.sign.secretKeyLength=ct,t.sign.seedLength=32,t.sign.signatureLength=ft,t.hash=function(t){lt(t);var e=new Uint8Array(64);return Y(e,t,t.length),e},t.hash.hashLength=64,t.verify=function(t,e){return lt(t,e),0!==t.length&&0!==e.length&&t.length===e.length&&0===b(t,0,e,0,t.length)},t.setPRNG=function(t){n=t},function(){var e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&e.getRandomValues?t.setPRNG((function(t,r){var n,i=new Uint8Array(r);for(n=0;n<r;n+=65536)e.getRandomValues(i.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)t[n]=i[n];pt(i)})):(e=r(6835))&&e.randomBytes&&t.setPRNG((function(t,r){var n,i=e.randomBytes(r);for(n=0;n<r;n++)t[n]=i[n];pt(i)}))}()}(t.exports?t.exports:self.nacl=self.nacl||{})},3141:(t,e,r)=>{"use strict";var n;r.d(e,{v4:()=>h});var i=new Uint8Array(16);function o(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,a=function(t){return"string"==typeof t&&s.test(t)};for(var u=[],f=0;f<256;++f)u.push((f+256).toString(16).substr(1));const h=function(t,e,r){var n=(t=t||{}).random||(t.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(u[t[e+0]]+u[t[e+1]]+u[t[e+2]]+u[t[e+3]]+"-"+u[t[e+4]]+u[t[e+5]]+"-"+u[t[e+6]]+u[t[e+7]]+"-"+u[t[e+8]]+u[t[e+9]]+"-"+u[t[e+10]]+u[t[e+11]]+u[t[e+12]]+u[t[e+13]]+u[t[e+14]]+u[t[e+15]]).toLowerCase();if(!a(r))throw TypeError("Stringified UUID is invalid");return r}(n)}},5377:()=>{},3325:()=>{},9312:()=>{},6835:()=>{},7330:t=>{"use strict";t.exports={i8:"6.5.4"}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.amdO={},r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};return(()=>{"use strict";r.r(n);var t={};r.r(t),r.d(t,{DEBUG_LOGGER_STORAGE_KEY:()=>y,EXT_PORT_CS_TO_BG:()=>b,EXT_PORT_UI_TO_BG:()=>g,JS_BRIDGE_MESSAGE_DIRECTION:()=>p,JS_BRIDGE_MESSAGE_EXT_CHANNEL:()=>d,JS_BRIDGE_MESSAGE_EXT_PING:()=>l,JS_BRIDGE_MESSAGE_IPC_CHANNEL:()=>c});var e=r(8298);function i(t,e,r){try{Reflect.apply(t,e,r)}catch(t){setTimeout((()=>{throw t}))}}class o extends e{emit(t,...e){return super.emit(t,...e)}addListener(t,e){return super.addListener(t,e),this}on(t,e){return super.on(t,e),this}once(t,e){return super.once(t,e),this}removeListener(t,e){return super.removeListener(t,e),this}off(t,e){return super.off(t,e),this}removeAllListeners(t){return super.removeAllListeners(t),this}setMaxListeners(t){return super.setMaxListeners(t),this}getMaxListeners(){return super.getMaxListeners()}listeners(t){return super.listeners(t)}rawListeners(t){return super.rawListeners(t)}listenerCount(t){return super.listenerCount(t)}prependListener(t,e){return super.prependListener(t,e),this}prependOnceListener(t,e){return super.prependOnceListener(t,e),this}eventNames(){return super.eventNames()}}class s extends o{emit(t,...e){let r="error"===t;const n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let t;if(e.length>0&&([t]=e),t instanceof Error)throw t;const r=new Error("Unhandled error."+(t?` (${t.message})`:""));throw r.context=t,r}const o=n[t];if(void 0===o)return!1;if("function"==typeof o)i(o,this,e);else{const t=o.length,r=function(t){const e=t.length,r=new Array(e);for(let n=0;n<e;n+=1)r[n]=t[n];return r}(o);for(let n=0;n<t;n+=1)i(r[n],this,e)}return!0}}var a=r(8395),u=r(2788),f=r(4554),h=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const c="onekey@JS_BRIDGE_MESSAGE_IPC_CHANNEL",d="onekey@JS_BRIDGE_MESSAGE_EXT_CHANNEL",l="onekey@JS_BRIDGE_MESSAGE_EXT_PING",p={HOST_TO_INPAGE:"onekey@JS_BRIDGE_MESSAGE_DIRECTION-HOST_TO_INPAGE",INPAGE_TO_HOST:"onekey@JS_BRIDGE_MESSAGE_DIRECTION-INPAGE_TO_HOST"},b="onekey@EXT_PORT_CS_TO_BG",g="onekey@EXT_PORT_UI_TO_BG",y="$$ONEKEY_DEBUG_LOGGER";var m=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const v=y,w={formatArgs:function(t){if(t[0]=`${(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")}+${w.humanize(this.diff)}`,!this.useColors)return;const e=`color: ${this.color}`;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r+=1,"%c"===t&&(n=r))})),t.splice(n,0,e)},save:function(t){return m(this,void 0,void 0,(function*(){try{t?yield w.storage.setItem(v,t):yield w.storage.removeItem(v)}catch(t){console.error("debug logger storage error",t)}}))},load:function(){return m(this,void 0,void 0,(function*(){let t;try{t=yield w.storage.getItem(v)}catch(t){console.error("debug logger storage error",t)}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t}))},useColors:function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}};w.storage=function(){try{return"undefined"!=typeof global&&global.$$onekeyAppStorage?global.$$onekeyAppStorage:"undefined"!=typeof window&&window.localStorage?window.localStorage:(console.warn("debugLogger init warning, neither `global.$$onekeyAppStorage` nor `window.localStorage` found."),{getItem(){return m(this,void 0,void 0,(function*(){return""}))},setItem(){return m(this,void 0,void 0,(function*(){}))},removeItem(){return m(this,void 0,void 0,(function*(){}))}})}catch(t){console.error("debug logger storage error",t)}}(),w.humanize=f,w.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),w.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],w.log=(...t)=>{console.debug?console.debug(...t):console.log&&console.log(...t)};const M=w;const _=function(){return t=this,e=void 0,n=function*(){return function(t){return h(this,void 0,void 0,(function*(){function e(t){let n,i,o,s=null;function a(...t){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];n=o.call(r,e),t.splice(s,1),s--}return n})),e.formatArgs.call(r,t),(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,r){const n=e(this.namespace+(void 0===r?":":r)+t);return n.log=this.log,n}function n(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){const t=[...e.names.map(n),...e.skips.map(n).map((t=>`-${t}`))].join(",");return e.enable(""),t},e.enable=function(t){return h(this,void 0,void 0,(function*(){let r;yield e.save(t),e.namespaces=t,e.names=[],e.skips=[];const n=("string"==typeof t?t:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp(`^${t.substr(1)}$`)):e.names.push(new RegExp(`^${t}$`)))}))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=f,e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((r=>{e[r]=t[r]})),e.names=[],e.skips=[],e.formatters={j(t){try{return JSON.stringify(t)}catch(t){return`[UnexpectedJSONParseError]: ${t.message}`}}},e.selectColor=function(t){let r=0;for(let e=0;e<t.length;e++)r=(r<<5)-r+t.charCodeAt(e),r|=0;return e.colors[Math.abs(r)%e.colors.length]};const i=yield e.load();return yield e.enable(i),e}))}(M)},new((r=void 0)||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}));var t,e,r,n};function S(...t){"undefined"!=typeof localStorage&&localStorage.getItem(y)&&console.error(...t)}const A={_isFakeLogger:!0,log:(...t)=>{},warn:(...t)=>{},error:(...t)=>{},debug:(...t)=>{},info:(...t)=>{},trace:(...t)=>{}};var E;!function(t){t.jsBridge="jsBridge",t.providerBase="providerBase",t.extInjected="extInjected",t.extContentScripts="extContentScripts",t.webview="webview",t.desktopInjected="desktopInjected",t.ethereum="ethereum"}(E||(E={}));class k extends s{constructor(){super(),this.jsBridge=(...t)=>null,this.providerBase=(...t)=>null,this.extInjected=(...t)=>null,this.extContentScripts=(...t)=>null,this.webview=(...t)=>null,this.desktopInjected=(...t)=>null,this.ethereum=(...t)=>null,this._debug={enable(t){}},this._externalLogger=A,this._createExternalLog=t=>(...e)=>{var r,n;return this.once("debugReady",(()=>{var r;null===(r=this[t])||void 0===r||r.call(this,...e)})),null===(n=null===(r=this._externalLogger)||void 0===r?void 0:r.log)||void 0===n?void 0:n.call(r,`${t} >>> `,...e)},this.initExternalLogInstances()}initExternalLogInstances(){Object.keys(E).forEach((t=>{this[t]=this._createExternalLog(t)}))}isDebugReady(){return this._debug&&"function"==typeof this._debug}_attachExternalLogger(t){t&&(this._externalLogger=t)}_createDebugInstance(t){}}const x=new k,I=new class extends k{constructor(){super(),this._debugInstanceCreatedMap={},_().then((t=>{this._debug=t,this.initDebugInstances(),this.emit("debugReady")}))}initDebugInstances(){this.isDebugReady()&&Object.keys(E).forEach((t=>{this[t]=this._debug(t)}))}_createDebugInstance(t){if(!this._debugInstanceCreatedMap[t]&&(this._debugInstanceCreatedMap[t]=!0,t&&this._debug&&"function"==typeof this._debug)){const e=this._debug(t),r=this[t];this[t]=(...t)=>{e(...t),r&&"function"==typeof r&&r(...t)}}}};var B,R;!function(t){t.RESPONSE="RESPONSE",t.REQUEST="REQUEST"}(B||(B={})),function(t){t.ethereum="ethereum",t.conflux="conflux",t.solana="solana",t.sollet="sollet",t.near="near",t.$private="$private",t.$hardware_sdk="$hardware_sdk"}(R||(R={}));var O=r(9439);class P extends Error{constructor(t,e,r){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw new Error('"message" must be a nonempty string.');super(e),this.code=t,void 0!==r&&(this.data=r)}serialize(){const t={code:this.code,message:this.message};return void 0!==this.data&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return O(this.serialize(),T,2)}}class C extends P{constructor(t,e,r){if(!function(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,e,r)}}function T(t,e){if("[Circular]"!==e)return e}const U=4500,L={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Web3 provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4500:{standard:"",message:"The request by this Web3 provider is timeout."}};function N(t,e="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(t)){const e=t.toString();if(r=L,n=e,Object.prototype.hasOwnProperty.call(r,n))return L[e].message;if(function(t){return t>=-32099&&t<=-32e3}(t))return"Unspecified server error."}var r,n;return e}N(-32603);const z=t=>j(U,t);function j(t,e){const[r,n]=function(t){if(t){if("string"==typeof t)return[t];if("object"==typeof t&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&"string"!=typeof e)throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(e);return new C(t,r||N(t),n)}const q="0.0.13";const F="undefined"!=typeof window?window:global,D="message",K="error";class W extends s{constructor(t={}){var e,r;super(),this._requestPayloadCache={},this.isExtUi=!1,this.isInjected=!1,this.sendAsString=!0,this.globalOnMessageEnabled=!0,this.providersHub={},this.globalOnMessage=t=>{return e=this,r=void 0,i=function*(){try{if(this.config.receiveHandler&&this.globalOnMessageEnabled){const e=yield this.config.receiveHandler(t,this);t.id&&this.response({id:t.id,scope:t.scope,remoteId:t.remoteId,data:e})}}catch(e){t.id&&t.type===B.REQUEST&&this.responseError({id:t.id,scope:t.scope,remoteId:t.remoteId,error:e}),this.emit(K,e)}},new((n=void 0)||(n=Promise))((function(t,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(t){t(r)}))).then(s,a)}u((i=i.apply(e,r||[])).next())}));var e,r,n,i},this.version=q,this.remoteInfo={origin:"",remoteId:""},this.callbacksExpireTimeout=6e5,this.debugLogger=I,this.callbacks=[],this.callbackId=1,this.config=t,this.callbacksExpireTimeout=null!==(e=t.timeout)&&void 0!==e?e:this.callbacksExpireTimeout,this.debugLogger=t.debugLogger||I,this.sendAsString=null!==(r=t.sendAsString)&&void 0!==r?r:this.sendAsString,this.config.receiveHandler&&this.on(D,this.globalOnMessage),this.on(K,(t=>{var e;S("JsBridge ERROR: ",t,{code:null===(e=t)||void 0===e?void 0:e.code})})),this.rejectExpiredCallbacks()}attachProviderInstance(t){var e;const r=t.providerName;r&&(this.providersHub[r]=null!==(e=this.providersHub[r])&&void 0!==e?e:[],this.providersHub[r].push(t))}createCallbackId(){return this.callbackId+=1,this.callbackId}createPayload(t,{resolve:e,reject:r}){const{id:n,type:i}=t;if(e&&r&&n&&i===B.REQUEST){if(this.callbacks[n])throw new Error(`JsBridge ERROR: callback exists, id=${n}`);this.callbacks[n]={id:n,resolve:e,reject:r,created:Date.now()}}if(t.error){const e=t.error;t.error=function(t){return{name:t.name,message:t.message,stack:t.stack,code:t.code,data:t.data,key:t.key,info:t.info,className:t.className}}(e)}return null==t||delete t.resolve,null==t||delete t.reject,t}send({type:t,data:e,error:r,id:n,remoteId:i,sync:o=!1,scope:s}){const a=(a,u)=>{var f,h,c;let d=n;o||t!==B.REQUEST||(d=this.createCallbackId());try{const n=this.createPayload({id:d,data:e,error:r,type:t,origin:(null===(f=null==F?void 0:F.location)||void 0===f?void 0:f.origin)||"",remoteId:i,scope:s},{resolve:a,reject:u});let o=n;this.sendAsString&&(o=JSON.stringify(n)),(null===(h=this.debugLogger.jsBridge)||void 0===h?void 0:h.enabled)&&n&&n.id&&n.type===B.REQUEST&&(this._requestPayloadCache[n.id]=n,n.id%100==0&&(this._requestPayloadCache={})),this.debugLogger.jsBridge("send",n,"\r\n ------\x3e ",n.data,"\r\n ------\x3e ",null===(c=n.data)||void 0===c?void 0:c.result),this.sendPayload(o)}catch(t){d?this.rejectCallback(d,t):this.emit(K,t)}};if(!o)return new Promise(a);a()}rejectCallback(t,e){this.processCallback({method:"reject",id:t,error:e})}resolveCallback(t,e){this.processCallback({method:"resolve",id:t,data:e})}processCallback({method:t,id:e,data:r,error:n}){const i=this.callbacks[e];i&&("reject"===t&&(i.reject&&i.reject(n),this.emit(K,n)),"resolve"===t&&i.resolve&&i.resolve(r),this.clearCallbackCache(e))}rejectExpiredCallbacks(){if(!this.callbacksExpireTimeout)return;const t=Date.now();for(const e in this.callbacks){const r=this.callbacks[e];if(r&&r.created&&t-r.created>this.callbacksExpireTimeout){const t=z();this.rejectCallback(e,t)}}setTimeout((()=>{this.rejectExpiredCallbacks()}),this.callbacksExpireTimeout)}clearCallbackCache(t){delete this.callbacks[t]}receive(t="",e){var r,n,i,o,s;let f={data:null};if(a(t)&&(f=t),u(t))try{f=JSON.parse(t)}catch(p){throw this.emit(K,p),new Error("JsBridge ERROR: JSON.parse payloadReceived failed")}if(f.origin=null==e?void 0:e.origin,f.internal=Boolean(null==e?void 0:e.internal),(null==e?void 0:e.internal)&&this.isExtUi&&function(t){const e=t;return Boolean(e.name)&&["onekey-provider-eth","onekey-provider-cfx","publicConfig"].includes(e.name)}(f))return;if(!f.origin&&!this.isInjected)throw S(null===(r=null==this?void 0:this.constructor)||void 0===r?void 0:r.name,"[payload.origin] is missing.",this),new Error("JsBridge ERROR: receive message [payload.origin] is required.");if(!f.internal&&!f.scope)throw new Error("JsBridge ERROR: receive message [payload.scope] is required for non-internal method call.");const h=null!==(i=this._requestPayloadCache[null!==(n=null==f?void 0:f.id)&&void 0!==n?n:""])&&void 0!==i?i:null;this.debugLogger.jsBridge("receive",f,{sender:e},"\r\n -----\x3e ",null!==(s=null===(o=f.data)||void 0===o?void 0:o.result)&&void 0!==s?s:f.data,"\r\n <----- ",null==h?void 0:h.data);const{type:c,id:d,data:l,error:p,origin:b,remoteId:g}=f;if(this.remoteInfo={origin:b,remoteId:g},c===B.RESPONSE){if(null==d)throw new Error("JsBridge ERROR: parameter [id] is required in JsBridge.receive() when REQUEST type message");if(this.callbacks[d])try{p?this.rejectCallback(d,p):this.resolveCallback(d,l)}catch(t){this.emit(K,t)}}else{if(c!==B.REQUEST)throw new Error(`JsBridge ERROR: payload type not support yet (type=${c||"undefined"})`);{const t=Object.assign(Object.assign({},f),{created:Date.now()});this.emit(D,t)}}}requestSync({data:t,scope:e,remoteId:r}){this.send({id:void 0,type:B.REQUEST,scope:e,data:t,remoteId:r,sync:!0})}request(t){const{data:e,remoteId:r,scope:n}=t;return void 0===e&&console.warn("JsBridge ERROR: data required. Call like `bridge.request({ data: {...} });`"),this.send({type:B.REQUEST,data:e,remoteId:r,sync:!1,scope:n})}response({id:t,data:e,remoteId:r,scope:n}){this.send({type:B.RESPONSE,data:e,id:t,remoteId:r,scope:n,sync:!0})}responseError({id:t,error:e,scope:r,remoteId:n}){this.send({type:B.RESPONSE,error:e,id:t,remoteId:n,scope:r,sync:!0})}}var J=r(5920),$=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};function G(t){return new Promise(((e,r)=>{try{const r=document.createElement("img");r.onload=()=>e(!0),r.onerror=()=>e(!1),r.src=t}catch(t){r(t)}}))}function V(t){const{document:e}=t,r=e.querySelector('head > meta[property="og:site_name"]');if(r)return r.content;const n=e.querySelector('head > meta[name="title"]');return n?n.content:e.title&&e.title.length>0?e.title:window.location.hostname}function H(t){return $(this,void 0,void 0,(function*(){const{document:e}=t,r=e.querySelectorAll('head > link[rel~="icon"]');for(const t of r)if(t&&(yield G(t.href)))return t.href;return null}))}const Z={getSiteMetadata:function(){return $(this,void 0,void 0,(function*(){return{name:V(window),icon:yield H(window)}}))},getSiteIcon:H,getSiteName:V,imgExists:G};var Y=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};class X extends s{constructor(t){var e,r,n;if(super(),this.version=q,this.isOneKey=!0,this.debugLogger=x,this.logger=A,!t.bridge)throw new Error("ProviderBase init error: bridge required.");this.config=t,this.bridge=t.bridge,this.logger=t.logger||A,this.debugLogger=(null===(e=this.bridge)||void 0===e?void 0:e.debugLogger)||x,null===(n=null===(r=this.bridge)||void 0===r?void 0:r.debugLogger)||void 0===n||n._attachExternalLogger(this.logger),setTimeout((()=>{this.bridge.attachProviderInstance(this)}),0)}configDebugLogger(t){try{if(!t||!this.bridge.debugLogger)return;const e=this.bridge.debugLogger;(t.enabledKeys||[]).forEach((t=>{e._createDebugInstance(t)})),t.config&&e._debug.enable(t.config),window.$onekey=window.$onekey||{},window.$onekey.$debugLogger=e}catch(t){S("configDebugLogger ERROR:",t)}}getConnectWalletInfo({timeout:t=3e3}={}){return Y(this,void 0,void 0,(function*(){return new Promise(((e,r)=>Y(this,void 0,void 0,(function*(){const r=setTimeout((()=>{e(null)}),t);try{const t=yield this.bridgeRequest({method:"wallet_getConnectWalletInfo",params:[{time:Date.now()}]});t&&(t.providerState=t.providerState||{}),t&&t.debugLoggerConfig&&this.configDebugLogger(t.debugLoggerConfig),t&&t.walletInfo&&(window.$onekey=window.$onekey||{},window.$onekey.$walletInfo=t.walletInfo),e(t||null)}catch(t){S("getConnectWalletInfo: ERROR",t),e(null)}finally{clearTimeout(r)}}))))}))}bridgeRequest(t,e){var r,n,i,o;return Y(this,void 0,void 0,(function*(){let s=!1;e&&J(e)&&(s=!0);try{const a={data:null!=t?t:{},scope:this.providerName};this.debugLogger.providerBase("bridgeRequest:",a,"\r\n -----\x3e ",a.data);const u=yield this.bridge.request(a);u&&(u.id=null!==(n=null!==(r=null==t?void 0:t.id)&&void 0!==r?r:u.id)&&void 0!==n?n:void 0,u.jsonrpc=null!==(o=null!==(i=null==t?void 0:t.jsonrpc)&&void 0!==i?i:u.jsonrpc)&&void 0!==o?o:"2.0");const f=u?u.result:void 0;return e&&s&&e(null,u),this.debugLogger.providerBase("bridgeRequest RETURN:",{req:a,res:u},"\r\n -----\x3e ",a.data,"\r\n -----\x3e ",f),f}catch(t){throw e&&s&&e(t),t}}))}sendSiteMetadataDomReady(){if("complete"===document.readyState)this.sendSiteMetadata();else{const t=()=>{this.sendSiteMetadata(),window.removeEventListener("DOMContentLoaded",t)};window.addEventListener("DOMContentLoaded",t)}}sendSiteMetadata(){return Y(this,void 0,void 0,(function*(){const t=yield Z.getSiteMetadata();return yield this.bridgeRequest({method:"wallet_sendSiteMetadata",params:t})}))}}function Q(t){var e;return window.global=window.global||window||window.globalThis,window.global=window.global||window||window.globalThis,(null===(e=null===window||void 0===window?void 0:window.$onekey)||void 0===e?void 0:e.jsBridge)||(window.$onekey=window.$onekey||{},window.$onekey.jsBridge=t(),"undefined"!=typeof localStorage&&localStorage.getItem(y)&&console.log("===== jsBridge injected success! >>>>> ",performance.now())),window.$onekey.jsBridge}function tt(t,e){const r=(null==e?void 0:e.providersHub)||window.$onekey,n=t.scope,i=t.data;if(!n)return void S("providerName (scope) is required in injectedProviderReceiveHandler.");const o=[].concat(r[n]).filter(Boolean);o&&o.length?o.forEach((t=>{t&&t.emit&&t.emit("message_low_level",i)})):S(`[${n}] provider is NOT injected to document or bridge.`)}const{JS_BRIDGE_MESSAGE_DIRECTION:et,JS_BRIDGE_MESSAGE_EXT_CHANNEL:rt}=t;function nt(t={}){return Q((()=>new ot(Object.assign(Object.assign({},t),{receiveHandler:tt}))))}let it=!1;class ot extends W{constructor(t){super(t),this.sendAsString=!1,this.isInjected=!0,function(t={}){const e=t.debugLogger||x;it||(it=!0,window.addEventListener("message",(r=>{var n,i;if(r.source!==window)return;const o=r.data;if(o.channel===rt&&o.direction===et.HOST_TO_INPAGE){e.extInjected("onWindowPostMessage",o);const r=o.payload,s=null!==(n=t.bridge)&&void 0!==n?n:null===(i=null===window||void 0===window?void 0:window.$onekey)||void 0===i?void 0:i.jsBridge;s&&s.receive(r)}}),!1))}({debugLogger:this.debugLogger,bridge:this})}sendPayload(t){window.postMessage({channel:rt,direction:et.INPAGE_TO_HOST,payload:t})}}var st=r(8429),at=r(9378);const ut={errors:{disconnected:()=>"MetaMask: Disconnected from chain. Attempting to connect.",permanentlyDisconnected:()=>"MetaMask: Disconnected from MetaMask background. Page reload required.",sendSiteMetadata:()=>"MetaMask: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:t=>`MetaMask: The MetaMask Ethereum provider does not support synchronous methods like ${t} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:t=>`'args.logger' must include required method '${t}'.`},info:{connected:t=>`MetaMask: Connected to chain with ID "${t}".`},warnings:{enableDeprecation:"MetaMask: 'ethereum.enable()' is deprecated and may be removed in the future. Please use the 'eth_requestAccounts' RPC method instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1102",sendDeprecation:"MetaMask: 'ethereum.send(...)' is deprecated and may be removed in the future. Please use 'ethereum.sendAsync(...)' or 'ethereum.request(...)' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193",events:{close:"MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect",data:"MetaMask: The event 'data' is deprecated and will be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message",networkChanged:"MetaMask: The event 'networkChanged' is deprecated and may be removed in the future. Use 'chainChanged' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#chainchanged",notification:"MetaMask: The event 'notification' is deprecated and may be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message"},experimentalMethods:"MetaMask: 'ethereum._metamask' exposes non-standard, experimental methods. They may be removed or changed without warning."}},ft=()=>{},ht=["eth_subscription"];var ct=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};class dt extends X{constructor(t){var e;super(t),this.providerName=R.ethereum,this.isMetaMask=!0,this._log=null!==(e=t.logger)&&void 0!==e?e:window.console,this._state=Object.assign({},dt._defaultState),this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleConnect=this._handleConnect.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this.request=this.request.bind(this),this._handleStreamDisconnect.bind(this,"OneKey"),this.on("connect",(()=>{this._state.isConnected=!0})),this._handleStreamDisconnect.bind(this,"OneKey RpcProvider"),this._initializeState(),this.on("message_low_level",(t=>{const{method:e,params:r}=t;"metamask_accountsChanged"===e?this._handleAccountsChanged(r):"metamask_unlockStateChanged"===e?this._handleUnlockStateChanged(r):"metamask_chainChanged"===e?this._handleChainChanged(r):ht.includes(e)?this.emit("message",{type:e,data:r}):"METAMASK_STREAM_FAILURE"===e&&new Error(ut.errors.permanentlyDisconnected())}))}isConnected(){return this._state.isConnected}request(t){return ct(this,void 0,void 0,(function*(){if(I.ethereum("request",t),!t||"object"!=typeof t||Array.isArray(t))throw st.Sy.rpc.invalidRequest({message:ut.errors.invalidRequestArgs(),data:t});const{method:e,params:r,id:n}=t;if(!e||"string"!=typeof e||0===e.length)throw st.Sy.rpc.invalidRequest({message:ut.errors.invalidRequestMethod(),data:t});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw st.Sy.rpc.invalidRequest({message:ut.errors.invalidRequestParams(),data:t});const i=yield this._rpcRequest({method:e,params:r,id:n});return I.ethereum("request->response","\n",t,"\n ---\x3e ",i),i}))}_initializeState(){return ct(this,void 0,void 0,(function*(){try{const t=yield this.request({method:"metamask_getProviderState"}),{accounts:e,chainId:r,isUnlocked:n,networkVersion:i}=t;this.emit("connect",{chainId:r}),this._handleChainChanged({chainId:r,networkVersion:i}),this._handleUnlockStateChanged({accounts:e,isUnlocked:n}),this._handleAccountsChanged(e)}catch(t){this._log.error("MetaMask: Failed to get initial state. Please report this bug.",t)}finally{this._state.initialized=!0,this.emit("_initialized")}}))}_rpcRequest(t,e){return ct(this,void 0,void 0,(function*(){if(!Array.isArray(t)){t.jsonrpc||(t.jsonrpc="2.0");const r=yield this.bridgeRequest(t,e);return"eth_accounts"!==t.method&&"eth_requestAccounts"!==t.method||this._handleAccountsChanged(r||[],"eth_accounts"===t.method),r}return this.bridgeRequest(t,e)}))}_handleConnect(t){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:t}),this._log.debug(ut.info.connected(t)))}_handleDisconnect(t,e){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!t){let r;this._state.isConnected=!1,t?(r=new st.Cg(1013,e||ut.errors.disconnected()),this._log.debug(r)):(r=new st.Cg(1011,e||ut.errors.permanentlyDisconnected()),this._log.error(r),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",r)}}_handleStreamDisconnect(t,e){!function(t,e,r,n){let i=`MetaMask: Lost connection to "${e}".`;(null==r?void 0:r.stack)&&(i+=`\n${r.stack}`),t.warn(i),n&&n.listenerCount("error")>0&&n.emit("error",i)}(this._log,t,e,this),this._handleDisconnect(!1,e?e.message:void 0)}_handleChainChanged({chainId:t,networkVersion:e}={}){t&&"string"==typeof t&&t.startsWith("0x")&&e&&"string"==typeof e?"loading"===e?this._handleDisconnect(!0):(this._handleConnect(t),t!==this.chainId&&(this.chainId=t,this._state.initialized&&this.emit("chainChanged",this.chainId))):this._log.error("MetaMask: Received invalid network parameters. Please report this bug.",{chainId:t,networkVersion:e})}_handleAccountsChanged(t,e=!1){let r=t;Array.isArray(t)||(this._log.error("MetaMask: Received invalid accounts parameter. Please report this bug.",t),r=[]);for(const e of t)if("string"!=typeof e){this._log.error("MetaMask: Received non-string account. Please report this bug.",t),r=[];break}at(this._state.accounts,r)||(e&&null!==this._state.accounts&&this._log.error("MetaMask: 'eth_accounts' unexpectedly updated accounts. Please report this bug.",r),this._state.accounts=r,this.selectedAddress!==r[0]&&(this.selectedAddress=r[0]||null),this._state.initialized&&this.emit("accountsChanged",r))}_handleUnlockStateChanged({accounts:t,isUnlocked:e}={}){"boolean"==typeof e?e!==this._state.isUnlocked&&(this._state.isUnlocked=e,this._handleAccountsChanged(t||[])):this._log.error("MetaMask: Received invalid isUnlocked parameter. Please report this bug.")}}dt._defaultState={accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1};var lt=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};class pt extends dt{constructor(t){super(t),this._sentWarnings={enable:!1,experimentalMethods:!1,send:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}},this.networkVersion=null,this.isMetaMask=!0,this._sendSync=this._sendSync.bind(this),this.enable=this.enable.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this._warnOfDeprecation=this._warnOfDeprecation.bind(this),this._metamask=this._getExperimentalApi(),this.bridge.on("notification",(t=>{const{method:e}=t;if(ht.includes(e)){this.emit("data",t);const e=t.params;this.emit("notification",e.result)}}))}sendAsync(t,e){this._rpcRequest(t,e)}addListener(t,e){return this._warnOfDeprecation(t),super.addListener(t,e)}on(t,e){return this._warnOfDeprecation(t),super.on(t,e)}once(t,e){return this._warnOfDeprecation(t),super.once(t,e)}prependListener(t,e){return this._warnOfDeprecation(t),super.prependListener(t,e)}prependOnceListener(t,e){return this._warnOfDeprecation(t),super.prependOnceListener(t,e)}_handleDisconnect(t,e){super._handleDisconnect(t,e),this.networkVersion&&!t&&(this.networkVersion=null)}_warnOfDeprecation(t){var e;!1===(null===(e=this._sentWarnings)||void 0===e?void 0:e.events[t])&&(this._log.warn(ut.warnings.events[t]),this._sentWarnings.events[t]=!0)}enable(){return lt(this,void 0,void 0,(function*(){return this._sentWarnings.enable||(this._log.warn(ut.warnings.enableDeprecation),this._sentWarnings.enable=!0),yield this._rpcRequest({method:"eth_requestAccounts",params:[]})}))}_rpcResult(t,e){var r,n;return{id:null!==(r=null==e?void 0:e.id)&&void 0!==r?r:void 0,jsonrpc:null!==(n=null==e?void 0:e.jsonrpc)&&void 0!==n?n:"2.0",result:t}}send(t,e){return this._sentWarnings.send||(this._log.warn(ut.warnings.sendDeprecation),this._sentWarnings.send=!0),"string"!=typeof t||e&&!Array.isArray(e)?t&&"object"==typeof t&&"function"==typeof e?this._rpcRequest(t,e):this._sendSync(t):this._rpcRequest({method:t,params:e}).then((t=>this._rpcResult(t)))}_sendSync(t){let e;switch(t.method){case"eth_accounts":e=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":e=this.selectedAddress||null;break;case"eth_uninstallFilter":this._rpcRequest(t,ft),e=!0;break;case"net_version":e=this.networkVersion||null;break;default:throw new Error(ut.errors.unsupportedSync(t.method))}return this._rpcResult(e,t)}_getExperimentalApi(){return new Proxy({isUnlocked:()=>lt(this,void 0,void 0,(function*(){return this._state.initialized||(yield new Promise((t=>{this.on("_initialized",(()=>t()))}))),this._state.isUnlocked})),requestBatch:t=>lt(this,void 0,void 0,(function*(){if(!Array.isArray(t))throw st.Sy.rpc.invalidRequest({message:"Batch requests must be made with an array of request objects.",data:t});return this._rpcRequest(t)}))},{get:(t,e,...r)=>(this._sentWarnings.experimentalMethods||(this._log.warn(ut.warnings.experimentalMethods),this._sentWarnings.experimentalMethods=!0),Reflect.get(t,e,...r))})}_handleChainChanged({chainId:t,networkVersion:e}={}){super._handleChainChanged({chainId:t,networkVersion:e}),e&&"loading"!==e&&e!==this.networkVersion&&(this.networkVersion=e,this._state.initialized&&this.emit("networkChanged",this.networkVersion))}}class bt extends pt{}class gt extends X{constructor(t){super(t),this.providerName=R.$private;try{this.getConnectWalletInfo()}catch(t){console.error(t)}try{this.sendSiteMetadataDomReady()}catch(t){console.error(t)}}request(t){return this.bridgeRequest(t)}}var yt=r(5474),mt=r.n(yt),vt=r(5326),wt=r(7543),Mt=r.n(wt),_t=r(6565),St=r.n(_t),At=r(9989),Et=r(4920);class kt extends TypeError{constructor(t,e){let r;const{message:n,...i}=t,{path:o}=t;super(0===o.length?n:"At path: "+o.join(".")+" -- "+n),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[t,...e()]}}}function xt(t){return"object"==typeof t&&null!=t}function It(t){return"string"==typeof t?JSON.stringify(t):""+t}function Bt(t,e,r,n){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:i,branch:o}=e,{type:s}=r,{refinement:a,message:u="Expected a value of type `"+s+"`"+(a?" with refinement `"+a+"`":"")+", but received: `"+It(n)+"`"}=t;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...t,message:u}}function*Rt(t,e,r,n){var i;xt(i=t)&&"function"==typeof i[Symbol.iterator]||(t=[t]);for(const i of t){const t=Bt(i,e,r,n);t&&(yield t)}}function*Ot(t,e,r={}){const{path:n=[],branch:i=[t],coerce:o=!1,mask:s=!1}=r,a={path:n,branch:i};if(o&&(t=e.coercer(t,a),s&&"type"!==e.type&&xt(e.schema)&&xt(t)&&!Array.isArray(t)))for(const r in t)void 0===e.schema[r]&&delete t[r];let u=!0;for(const r of e.validator(t,a))u=!1,yield[r,void 0];for(let[r,f,h]of e.entries(t,a)){const e=Ot(f,h,{path:void 0===r?n:[...n,r],branch:void 0===r?i:[...i,f],coerce:o,mask:s});for(const n of e)n[0]?(u=!1,yield[n[0],void 0]):o&&(f=n[1],void 0===r?t=f:t instanceof Map?t.set(r,f):t instanceof Set?t.add(f):xt(t)&&(t[r]=f))}if(u)for(const r of e.refiner(t,a))u=!1,yield[r,void 0];u&&(yield[void 0,t])}class Pt{constructor(t){const{type:e,schema:r,validator:n,refiner:i,coercer:o=(t=>t),entries:s=function*(){}}=t;this.type=e,this.schema=r,this.entries=s,this.coercer=o,this.validator=n?(t,e)=>Rt(n(t,e),e,this,t):()=>[],this.refiner=i?(t,e)=>Rt(i(t,e),e,this,t):()=>[]}assert(t){return function(t,e){const r=Ut(t,e);if(r[0])throw r[0]}(t,this)}create(t){return Ct(t,this)}is(t){return Tt(t,this)}mask(t){return function(t,e){const r=Ut(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(t,this)}validate(t,e={}){return Ut(t,this,e)}}function Ct(t,e){const r=Ut(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function Tt(t,e){return!Ut(t,e)[0]}function Ut(t,e,r={}){const n=Ot(t,e,r),i=function(t){const{done:e,value:r}=t.next();return e?void 0:r}(n);return i[0]?[new kt(i[0],(function*(){for(const t of n)t[0]&&(yield t[0])})),void 0]:[void 0,i[1]]}function Lt(t,e){return new Pt({type:t,schema:null,validator:e})}function Nt(t){return new Pt({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||"Expected an array value, but received: "+It(t)})}function zt(){return Lt("boolean",(t=>"boolean"==typeof t))}function jt(t){return Lt("instance",(e=>e instanceof t||"Expected a `"+t.name+"` instance, but received: "+It(e)))}function qt(t){const e=It(t),r=typeof t;return new Pt({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?t:null,validator:r=>r===t||"Expected the literal `"+e+"`, but received: "+It(r)})}function Ft(t){return new Pt({...t,validator:(e,r)=>null===e||t.validator(e,r),refiner:(e,r)=>null===e||t.refiner(e,r)})}function Dt(){return Lt("number",(t=>"number"==typeof t&&!isNaN(t)||"Expected a number, but received: "+It(t)))}function Kt(t){return new Pt({...t,validator:(e,r)=>void 0===e||t.validator(e,r),refiner:(e,r)=>void 0===e||t.refiner(e,r)})}function Wt(t,e){return new Pt({type:"record",schema:null,*entries(r){if(xt(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator:t=>xt(t)||"Expected an object, but received: "+It(t)})}function Jt(){return Lt("string",(t=>"string"==typeof t||"Expected a string, but received: "+It(t)))}function $t(t){const e=Lt("never",(()=>!1));return new Pt({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator:t=>Array.isArray(t)||"Expected an array, but received: "+It(t)})}function Gt(t){const e=Object.keys(t);return new Pt({type:"type",schema:t,*entries(r){if(xt(r))for(const n of e)yield[n,r[n],t[n]]},validator:t=>xt(t)||"Expected an object, but received: "+It(t)})}function Vt(t){const e=t.map((t=>t.type)).join(" | ");return new Pt({type:"union",schema:null,validator(r,n){const i=[];for(const e of t){const[...t]=Ot(r,e,n),[o]=t;if(!o[0])return[];for(const[e]of t)e&&i.push(e)}return["Expected the value to satisfy a union of `"+e+"`, but received: "+It(r),...i]}})}function Ht(){return Lt("unknown",(()=>!0))}function Zt(t,e,r){return new Pt({...t,coercer:(n,i)=>Tt(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}r(4217),r(6350);var Yt=r(5293),Xt=r.n(Yt),Qt=r(5498),te=r.n(Qt);const ee=t=>vt.Buffer.isBuffer(t)?t:t instanceof Uint8Array?vt.Buffer.from(t.buffer,t.byteOffset,t.byteLength):vt.Buffer.from(t);var re="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{},ne={},ie={},oe=se;function se(t,e){if(!t)throw new Error(e||"Assertion failed")}se.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var ae={exports:{}};"function"==typeof Object.create?ae.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ae.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var ue=oe,fe=ae.exports;function he(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function ce(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function de(t){return 1===t.length?"0"+t:t}function le(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}ie.inherits=fe,ie.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var o=t.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):he(t,i)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},ie.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=de(t[r].toString(16));return e},ie.htonl=ce,ie.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=ce(i)),r+=le(i.toString(16))}return r},ie.zero2=de,ie.zero8=le,ie.join32=function(t,e,r,n){var i=r-e;ue(i%4==0);for(var o=new Array(i/4),s=0,a=e;s<o.length;s++,a+=4){var u;u="big"===n?t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3]:t[a+3]<<24|t[a+2]<<16|t[a+1]<<8|t[a],o[s]=u>>>0}return o},ie.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>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},ie.rotr32=function(t,e){return t>>>e|t<<32-e},ie.rotl32=function(t,e){return t<<e|t>>>32-e},ie.sum32=function(t,e){return t+e>>>0},ie.sum32_3=function(t,e,r){return t+e+r>>>0},ie.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},ie.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},ie.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},ie.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},ie.sum64_lo=function(t,e,r,n){return e+n>>>0},ie.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u=0,f=e;return u+=(f=f+n>>>0)<e?1:0,u+=(f=f+o>>>0)<o?1:0,t+r+i+s+(u+=(f=f+a>>>0)<a?1:0)>>>0},ie.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},ie.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,f){var h=0,c=e;return h+=(c=c+n>>>0)<e?1:0,h+=(c=c+o>>>0)<o?1:0,h+=(c=c+a>>>0)<a?1:0,t+r+i+s+u+(h+=(c=c+f>>>0)<f?1:0)>>>0},ie.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,f){return e+n+o+a+f>>>0},ie.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},ie.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},ie.shr64_hi=function(t,e,r){return t>>>r},ie.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};var pe={},be=ie,ge=oe;function ye(){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}pe.BlockHash=ye,ye.prototype.update=function(t,e){if(t=be.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=be.join32(t,0,t.length-r,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},ye.prototype.digest=function(t){return this.update(this._pad()),ge(null===this.pending),this._digest(t)},ye.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n};var me={},ve={},we=ie.rotr32;function Me(t,e,r){return t&e^~t&r}function _e(t,e,r){return t&e^t&r^e&r}function Se(t,e,r){return t^e^r}ve.ft_1=function(t,e,r,n){return 0===t?Me(e,r,n):1===t||3===t?Se(e,r,n):2===t?_e(e,r,n):void 0},ve.ch32=Me,ve.maj32=_e,ve.p32=Se,ve.s0_256=function(t){return we(t,2)^we(t,13)^we(t,22)},ve.s1_256=function(t){return we(t,6)^we(t,11)^we(t,25)},ve.g0_256=function(t){return we(t,7)^we(t,18)^t>>>3},ve.g1_256=function(t){return we(t,17)^we(t,19)^t>>>10};var Ae=ie,Ee=pe,ke=ve,xe=Ae.rotl32,Ie=Ae.sum32,Be=Ae.sum32_5,Re=ke.ft_1,Oe=Ee.BlockHash,Pe=[1518500249,1859775393,2400959708,3395469782];function Ce(){if(!(this instanceof Ce))return new Ce;Oe.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ae.inherits(Ce,Oe);var Te=Ce;Ce.blockSize=512,Ce.outSize=160,Ce.hmacStrength=80,Ce.padLength=64,Ce.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=xe(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4];for(n=0;n<r.length;n++){var f=~~(n/20),h=Be(xe(i,5),Re(f,o,s,a),u,r[n],Pe[f]);u=a,a=s,s=xe(o,30),o=i,i=h}this.h[0]=Ie(this.h[0],i),this.h[1]=Ie(this.h[1],o),this.h[2]=Ie(this.h[2],s),this.h[3]=Ie(this.h[3],a),this.h[4]=Ie(this.h[4],u)},Ce.prototype._digest=function(t){return"hex"===t?Ae.toHex32(this.h,"big"):Ae.split32(this.h,"big")};var Ue=ie,Le=pe,Ne=ve,ze=oe,je=Ue.sum32,qe=Ue.sum32_4,Fe=Ue.sum32_5,De=Ne.ch32,Ke=Ne.maj32,We=Ne.s0_256,Je=Ne.s1_256,$e=Ne.g0_256,Ge=Ne.g1_256,Ve=Le.BlockHash,He=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Ze(){if(!(this instanceof Ze))return new Ze;Ve.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=He,this.W=new Array(64)}Ue.inherits(Ze,Ve);var Ye=Ze;Ze.blockSize=512,Ze.outSize=256,Ze.hmacStrength=192,Ze.padLength=64,Ze.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=qe(Ge(r[n-2]),r[n-7],$e(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],f=this.h[5],h=this.h[6],c=this.h[7];for(ze(this.k.length===r.length),n=0;n<r.length;n++){var d=Fe(c,Je(u),De(u,f,h),this.k[n],r[n]),l=je(We(i),Ke(i,o,s));c=h,h=f,f=u,u=je(a,d),a=s,s=o,o=i,i=je(d,l)}this.h[0]=je(this.h[0],i),this.h[1]=je(this.h[1],o),this.h[2]=je(this.h[2],s),this.h[3]=je(this.h[3],a),this.h[4]=je(this.h[4],u),this.h[5]=je(this.h[5],f),this.h[6]=je(this.h[6],h),this.h[7]=je(this.h[7],c)},Ze.prototype._digest=function(t){return"hex"===t?Ue.toHex32(this.h,"big"):Ue.split32(this.h,"big")};var Xe=ie,Qe=Ye;function tr(){if(!(this instanceof tr))return new tr;Qe.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Xe.inherits(tr,Qe);var er=tr;tr.blockSize=512,tr.outSize=224,tr.hmacStrength=192,tr.padLength=64,tr.prototype._digest=function(t){return"hex"===t?Xe.toHex32(this.h.slice(0,7),"big"):Xe.split32(this.h.slice(0,7),"big")};var rr=ie,nr=pe,ir=oe,or=rr.rotr64_hi,sr=rr.rotr64_lo,ar=rr.shr64_hi,ur=rr.shr64_lo,fr=rr.sum64,hr=rr.sum64_hi,cr=rr.sum64_lo,dr=rr.sum64_4_hi,lr=rr.sum64_4_lo,pr=rr.sum64_5_hi,br=rr.sum64_5_lo,gr=nr.BlockHash,yr=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function mr(){if(!(this instanceof mr))return new mr;gr.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=yr,this.W=new Array(160)}rr.inherits(mr,gr);var vr=mr;function wr(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function Mr(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function _r(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function Sr(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function Ar(t,e){var r=or(t,e,28)^or(e,t,2)^or(e,t,7);return r<0&&(r+=4294967296),r}function Er(t,e){var r=sr(t,e,28)^sr(e,t,2)^sr(e,t,7);return r<0&&(r+=4294967296),r}function kr(t,e){var r=or(t,e,14)^or(t,e,18)^or(e,t,9);return r<0&&(r+=4294967296),r}function xr(t,e){var r=sr(t,e,14)^sr(t,e,18)^sr(e,t,9);return r<0&&(r+=4294967296),r}function Ir(t,e){var r=or(t,e,1)^or(t,e,8)^ar(t,e,7);return r<0&&(r+=4294967296),r}function Br(t,e){var r=sr(t,e,1)^sr(t,e,8)^ur(t,e,7);return r<0&&(r+=4294967296),r}function Rr(t,e){var r=or(t,e,19)^or(e,t,29)^ar(t,e,6);return r<0&&(r+=4294967296),r}function Or(t,e){var r=sr(t,e,19)^sr(e,t,29)^ur(t,e,6);return r<0&&(r+=4294967296),r}mr.blockSize=1024,mr.outSize=512,mr.hmacStrength=192,mr.padLength=128,mr.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=Rr(r[n-4],r[n-3]),o=Or(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=Ir(r[n-30],r[n-29]),f=Br(r[n-30],r[n-29]),h=r[n-32],c=r[n-31];r[n]=dr(i,o,s,a,u,f,h,c),r[n+1]=lr(i,o,s,a,u,f,h,c)}},mr.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],s=this.h[3],a=this.h[4],u=this.h[5],f=this.h[6],h=this.h[7],c=this.h[8],d=this.h[9],l=this.h[10],p=this.h[11],b=this.h[12],g=this.h[13],y=this.h[14],m=this.h[15];ir(this.k.length===r.length);for(var v=0;v<r.length;v+=2){var w=y,M=m,_=kr(c,d),S=xr(c,d),A=wr(c,0,l,0,b),E=Mr(0,d,0,p,0,g),k=this.k[v],x=this.k[v+1],I=r[v],B=r[v+1],R=pr(w,M,_,S,A,E,k,x,I,B),O=br(w,M,_,S,A,E,k,x,I,B);w=Ar(n,i),M=Er(n,i),_=_r(n,0,o,0,a),S=Sr(0,i,0,s,0,u);var P=hr(w,M,_,S),C=cr(w,M,_,S);y=b,m=g,b=l,g=p,l=c,p=d,c=hr(f,h,R,O),d=cr(h,h,R,O),f=a,h=u,a=o,u=s,o=n,s=i,n=hr(R,O,P,C),i=cr(R,O,P,C)}fr(this.h,0,n,i),fr(this.h,2,o,s),fr(this.h,4,a,u),fr(this.h,6,f,h),fr(this.h,8,c,d),fr(this.h,10,l,p),fr(this.h,12,b,g),fr(this.h,14,y,m)},mr.prototype._digest=function(t){return"hex"===t?rr.toHex32(this.h,"big"):rr.split32(this.h,"big")};var Pr=ie,Cr=vr;function Tr(){if(!(this instanceof Tr))return new Tr;Cr.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Pr.inherits(Tr,Cr);var Ur=Tr;Tr.blockSize=1024,Tr.outSize=384,Tr.hmacStrength=192,Tr.padLength=128,Tr.prototype._digest=function(t){return"hex"===t?Pr.toHex32(this.h.slice(0,12),"big"):Pr.split32(this.h.slice(0,12),"big")},me.sha1=Te,me.sha224=er,me.sha256=Ye,me.sha384=Ur,me.sha512=vr;var Lr={},Nr=ie,zr=pe,jr=Nr.rotl32,qr=Nr.sum32,Fr=Nr.sum32_3,Dr=Nr.sum32_4,Kr=zr.BlockHash;function Wr(){if(!(this instanceof Wr))return new Wr;Kr.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function Jr(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function $r(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Gr(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}Nr.inherits(Wr,Kr),Lr.ripemd160=Wr,Wr.blockSize=512,Wr.outSize=160,Wr.hmacStrength=192,Wr.padLength=64,Wr.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],s=this.h[4],a=r,u=n,f=i,h=o,c=s,d=0;d<80;d++){var l=qr(jr(Dr(r,Jr(d,n,i,o),t[Vr[d]+e],$r(d)),Zr[d]),s);r=s,s=o,o=jr(i,10),i=n,n=l,l=qr(jr(Dr(a,Jr(79-d,u,f,h),t[Hr[d]+e],Gr(d)),Yr[d]),c),a=c,c=h,h=jr(f,10),f=u,u=l}l=Fr(this.h[1],i,h),this.h[1]=Fr(this.h[2],o,c),this.h[2]=Fr(this.h[3],s,a),this.h[3]=Fr(this.h[4],r,u),this.h[4]=Fr(this.h[0],n,f),this.h[0]=l},Wr.prototype._digest=function(t){return"hex"===t?Nr.toHex32(this.h,"little"):Nr.split32(this.h,"little")};var Vr=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Hr=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Zr=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Yr=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Xr=ie,Qr=oe;function tn(t,e,r){if(!(this instanceof tn))return new tn(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(Xr.toArray(e,r))}var en=tn;tn.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),Qr(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},tn.prototype.update=function(t,e){return this.inner.update(t,e),this},tn.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},function(t){var e=t;e.utils=ie,e.common=pe,e.sha=me,e.ripemd=Lr,e.hmac=en,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(ne);var rn=ne;let nn=!1,on=!1;const sn={debug:1,default:2,info:2,warning:3,error:4,off:5};let an=sn.default,un=null;const fn=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(r){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var hn,cn;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(hn||(hn={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(cn||(cn={}));const dn="0123456789abcdef";class ln{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const r=t.toLowerCase();null==sn[r]&&this.throwArgumentError("invalid log level name","logLevel",t),an>sn[r]||console.log.apply(console,e)}debug(...t){this._log(ln.levels.DEBUG,t)}info(...t){this._log(ln.levels.INFO,t)}warn(...t){this._log(ln.levels.WARNING,t)}makeError(t,e,r){if(on)return this.makeError("censored error",e,{});e||(e=ln.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((t=>{const e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t<e.length;t++)r+=dn[e[t]>>4],r+=dn[15&e[t]];n.push(t+"=Uint8Array(0x"+r+")")}else n.push(t+"="+JSON.stringify(e))}catch(e){n.push(t+"="+JSON.stringify(r[t].toString()))}})),n.push(`code=${e}`),n.push(`version=${this.version}`);const i=t;let o="";switch(e){case cn.NUMERIC_FAULT:{o="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case cn.CALL_EXCEPTION:case cn.INSUFFICIENT_FUNDS:case cn.MISSING_NEW:case cn.NONCE_EXPIRED:case cn.REPLACEMENT_UNDERPRICED:case cn.TRANSACTION_REPLACED:case cn.UNPREDICTABLE_GAS_LIMIT:o=e}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(t+=" ("+n.join(", ")+")");const s=new Error(t);return s.reason=i,s.code=e,Object.keys(r).forEach((function(t){s[t]=r[t]})),s}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,ln.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,n){t||this.throwError(e,r,n)}assertArgument(t,e,r,n){t||this.throwArgumentError(e,r,n)}checkNormalize(t){fn&&this.throwError("platform missing String.prototype.normalize",ln.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:fn})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,ln.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,ln.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",t<e&&this.throwError("missing argument"+r,ln.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+r,ln.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",ln.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",ln.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",ln.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return un||(un=new ln("logger/5.6.0")),un}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",ln.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),nn){if(!t)return;this.globalLogger().throwError("error censorship permanent",ln.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}on=!!t,nn=!!e}static setLogLevel(t){const e=sn[t.toLowerCase()];null!=e?an=e:ln.globalLogger().warn("invalid log level - "+t)}static from(t){return new ln(t)}}ln.errors=cn,ln.levels=hn;const pn=new ln("bytes/5.6.0");function bn(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return bn(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function gn(t){return"number"==typeof t&&t==t&&t%1==0}function yn(t){return"0x"+rn.sha256().update(function(t,e){if(e||(e={}),"number"==typeof t){pn.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),bn(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),function(t){return!!t.toHexString}(t)&&(t=t.toHexString()),function(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))}(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0x0"+r.substring(2):"right"===e.hexPad?r+="0":pn.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let t=0;t<r.length;t+=2)n.push(parseInt(r.substring(t,t+2),16));return bn(new Uint8Array(n))}return function(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!gn(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(!gn(r)||r<0||r>=256)return!1}return!0}(t)?bn(new Uint8Array(t)):pn.throwArgumentError("invalid arrayify value","value",t)}(t)).digest("hex")}new ln("sha2/5.6.0");const mn=new Map;class vn extends class{constructor(t){Object.assign(this,t)}encode(){return vt.Buffer.from((0,At.serialize)(mn,this))}static decode(t){return(0,At.deserialize)(mn,this,t)}static decodeUnchecked(t){return(0,At.deserializeUnchecked)(mn,this,t)}}{constructor(t){if(super({}),this._bn=void 0,function(t){return void 0!==t._bn}(t))this._bn=t._bn;else{if("string"==typeof t){const e=St().decode(t);if(32!=e.length)throw new Error("Invalid public key input");this._bn=new(Mt())(e)}else this._bn=new(Mt())(t);if(this._bn.byteLength()>32)throw new Error("Invalid public key input")}}equals(t){return this._bn.eq(t._bn)}toBase58(){return St().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){return this.toBuffer()}toBuffer(){const t=this._bn.toArrayLike(vt.Buffer);if(32===t.length)return t;const e=vt.Buffer.alloc(32);return t.copy(e,32-t.length),e}toString(){return this.toBase58()}static async createWithSeed(t,e,r){const n=vt.Buffer.concat([t.toBuffer(),vt.Buffer.from(e),r.toBuffer()]),i=yn(new Uint8Array(n)).slice(2);return new vn(vt.Buffer.from(i,"hex"))}static createProgramAddressSync(t,e){let r=vt.Buffer.alloc(0);t.forEach((function(t){if(t.length>32)throw new TypeError("Max seed length exceeded");r=vt.Buffer.concat([r,ee(t)])})),r=vt.Buffer.concat([r,e.toBuffer(),vt.Buffer.from("ProgramDerivedAddress")]);let n=yn(new Uint8Array(r)).slice(2),i=new(Mt())(n,16).toArray(void 0,32);if(Mn(i))throw new Error("Invalid seeds, address must fall off the curve");return new vn(i)}static async createProgramAddress(t,e){return this.createProgramAddressSync(t,e)}static findProgramAddressSync(t,e){let r,n=255;for(;0!=n;){try{const i=t.concat(vt.Buffer.from([n]));r=this.createProgramAddressSync(i,e)}catch(t){if(t instanceof TypeError)throw t;n--;continue}return[r,n]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,e){return this.findProgramAddressSync(t,e)}static isOnCurve(t){return 1==Mn(new vn(t).toBytes())}}vn.default=new vn("11111111111111111111111111111111"),mn.set(vn,{kind:"struct",fields:[["_bn","u256"]]});let wn=mt().lowlevel;function Mn(t){var e=[wn.gf(),wn.gf(),wn.gf(),wn.gf()],r=wn.gf(),n=wn.gf(),i=wn.gf(),o=wn.gf(),s=wn.gf(),a=wn.gf(),u=wn.gf();return wn.set25519(e[2],_n),wn.unpack25519(e[1],t),wn.S(i,e[1]),wn.M(o,i,wn.D),wn.Z(i,i,e[2]),wn.A(o,e[2],o),wn.S(s,o),wn.S(a,s),wn.M(u,a,s),wn.M(r,u,i),wn.M(r,r,o),wn.pow2523(r,r),wn.M(r,r,i),wn.M(r,r,o),wn.M(r,r,o),wn.M(e[0],r,o),wn.S(n,e[0]),wn.M(n,n,o),An(n,i)&&wn.M(e[0],e[0],Sn),wn.S(n,e[0]),wn.M(n,n,o),An(n,i)?0:1}let _n=wn.gf([1]),Sn=wn.gf([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function An(t,e){var r=new Uint8Array(32),n=new Uint8Array(32);return wn.pack25519(r,t),wn.pack25519(n,e),wn.crypto_verify_32(r,0,n,0)}new vn("BPFLoader1111111111111111111111111111111111");const En=(t="publicKey")=>Et.Ik(32,t),kn=(t="string")=>{const e=Et.n_([Et.Jq("length"),Et.Jq("lengthPadding"),Et.Ik(Et.cv(Et.Jq(),-8),"chars")],t),r=e.decode.bind(e),n=e.encode.bind(e),i=e;return i.decode=(t,e)=>r(t,e).chars.toString(),i.encode=(t,e,r)=>{const i={chars:vt.Buffer.from(t,"utf8")};return n(i,e,r)},i.alloc=t=>Et.Jq().span+Et.Jq().span+vt.Buffer.from(t,"utf8").length,i};function xn(t){let e=0,r=0;for(;;){let n=t.shift();if(e|=(127&n)<<7*r,r+=1,0==(128&n))break}return e}function In(t,e){let r=e;for(;;){let e=127&r;if(r>>=7,0==r){t.push(e);break}e|=128,t.push(e)}}class Bn{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map((t=>new vn(t))),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach((t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex])))}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){return t<this.header.numRequiredSignatures-this.header.numReadonlySignedAccounts||t>=this.header.numRequiredSignatures&&t<this.accountKeys.length-this.header.numReadonlyUnsignedAccounts}isProgramId(t){return this.indexToProgramIds.has(t)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter(((t,e)=>!this.isProgramId(e)))}serialize(){const t=this.accountKeys.length;let e=[];In(e,t);const r=this.instructions.map((t=>{const{accounts:e,programIdIndex:r}=t,n=Array.from(St().decode(t.data));let i=[];In(i,e.length);let o=[];return In(o,n.length),{programIdIndex:r,keyIndicesCount:vt.Buffer.from(i),keyIndices:e,dataLength:vt.Buffer.from(o),data:n}}));let n=[];In(n,r.length);let i=vt.Buffer.alloc(1232);vt.Buffer.from(n).copy(i);let o=n.length;r.forEach((t=>{const e=Et.n_([Et.u8("programIdIndex"),Et.Ik(t.keyIndicesCount.length,"keyIndicesCount"),Et.A9(Et.u8("keyIndex"),t.keyIndices.length,"keyIndices"),Et.Ik(t.dataLength.length,"dataLength"),Et.A9(Et.u8("userdatum"),t.data.length,"data")]).encode(t,i,o);o+=e})),i=i.slice(0,o);const s=Et.n_([Et.Ik(1,"numRequiredSignatures"),Et.Ik(1,"numReadonlySignedAccounts"),Et.Ik(1,"numReadonlyUnsignedAccounts"),Et.Ik(e.length,"keyCount"),Et.A9(En("key"),t,"keys"),En("recentBlockhash")]),a={numRequiredSignatures:vt.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:vt.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:vt.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:vt.Buffer.from(e),keys:this.accountKeys.map((t=>ee(t.toBytes()))),recentBlockhash:St().decode(this.recentBlockhash)};let u=vt.Buffer.alloc(2048);const f=s.encode(a,u);return i.copy(u,f),u.slice(0,f+i.length)}static from(t){let e=[...t];const r=e.shift(),n=e.shift(),i=e.shift(),o=xn(e);let s=[];for(let t=0;t<o;t++){const t=e.slice(0,32);e=e.slice(32),s.push(St().encode(vt.Buffer.from(t)))}const a=e.slice(0,32);e=e.slice(32);const u=xn(e);let f=[];for(let t=0;t<u;t++){const t=e.shift(),r=xn(e),n=e.slice(0,r);e=e.slice(r);const i=xn(e),o=e.slice(0,i),s=St().encode(vt.Buffer.from(o));e=e.slice(i),f.push({programIdIndex:t,accounts:n,data:s})}const h={header:{numRequiredSignatures:r,numReadonlySignedAccounts:n,numReadonlyUnsignedAccounts:i},recentBlockhash:St().encode(vt.Buffer.from(a)),accountKeys:s,instructions:f};return new Bn(h)}}function Rn(t,e){if(!t)throw new Error(e||"Assertion failed")}const On=vt.Buffer.alloc(64).fill(0);class Pn{constructor(t){this.keys=void 0,this.programId=void 0,this.data=vt.Buffer.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}toJSON(){return{keys:this.keys.map((({pubkey:t,isSigner:e,isWritable:r})=>({pubkey:t.toJSON(),isSigner:e,isWritable:r}))),programId:this.programId.toJSON(),data:[...this.data]}}}class Cn{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.nonceInfo=void 0,this._message=void 0,this._json=void 0,t&&Object.assign(this,t)}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map((t=>t.toJSON())),signers:this.signatures.map((({publicKey:t})=>t.toJSON()))}}add(...t){if(0===t.length)throw new Error("No instructions");return t.forEach((t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new Pn(t))})),this}compileMessage(){if(this._message){if(JSON.stringify(this.toJSON())!==JSON.stringify(this._json))throw new Error("Transaction message mutated after being populated from Message");return this._message}const{nonceInfo:t}=this;t&&this.instructions[0]!=t.nonceInstruction&&(this.recentBlockhash=t.nonce,this.instructions.unshift(t.nonceInstruction));const{recentBlockhash:e}=this;if(!e)throw new Error("Transaction recentBlockhash required");let r;if(this.instructions.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");r=this.signatures[0].publicKey}for(let t=0;t<this.instructions.length;t++)if(void 0===this.instructions[t].programId)throw new Error(`Transaction instruction index ${t} has undefined program id`);const n=[],i=[];this.instructions.forEach((t=>{t.keys.forEach((t=>{i.push({...t})}));const e=t.programId.toString();n.includes(e)||n.push(e)})),n.forEach((t=>{i.push({pubkey:new vn(t),isSigner:!1,isWritable:!1})})),i.sort((function(t,e){const r=t.pubkey.toBase58().localeCompare(e.pubkey.toBase58()),n=t.isSigner===e.isSigner?0:t.isSigner?-1:1,i=t.isWritable===e.isWritable?r:t.isWritable?-1:1;return n||i}));const o=[];i.forEach((t=>{const e=t.pubkey.toString(),r=o.findIndex((t=>t.pubkey.toString()===e));r>-1?o[r].isWritable=o[r].isWritable||t.isWritable:o.push(t)}));const s=o.findIndex((t=>t.pubkey.equals(r)));if(s>-1){const[t]=o.splice(s,1);t.isSigner=!0,t.isWritable=!0,o.unshift(t)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const t of this.signatures){const e=o.findIndex((e=>e.pubkey.equals(t.publicKey)));if(!(e>-1))throw new Error(`unknown signer: ${t.publicKey.toString()}`);o[e].isSigner||(o[e].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."))}let a=0,u=0,f=0;const h=[],c=[];o.forEach((({pubkey:t,isSigner:e,isWritable:r})=>{e?(h.push(t.toString()),a+=1,r||(u+=1)):(c.push(t.toString()),r||(f+=1))}));const d=h.concat(c),l=this.instructions.map((t=>{const{data:e,programId:r}=t;return{programIdIndex:d.indexOf(r.toString()),accounts:t.keys.map((t=>d.indexOf(t.pubkey.toString()))),data:St().encode(e)}}));return l.forEach((t=>{Rn(t.programIdIndex>=0),t.accounts.forEach((t=>Rn(t>=0)))})),new Bn({header:{numRequiredSignatures:a,numReadonlySignedAccounts:u,numReadonlyUnsignedAccounts:f},accountKeys:d,recentBlockhash:e,instructions:l})}_compile(){const t=this.compileMessage(),e=t.accountKeys.slice(0,t.header.numRequiredSignatures);return this.signatures.length===e.length&&this.signatures.every(((t,r)=>e[r].equals(t.publicKey)))||(this.signatures=e.map((t=>({signature:null,publicKey:t})))),t}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(0===t.length)throw new Error("No signers");const e=new Set;this.signatures=t.filter((t=>{const r=t.toString();return!e.has(r)&&(e.add(r),!0)})).map((t=>({signature:null,publicKey:t})))}sign(...t){if(0===t.length)throw new Error("No signers");const e=new Set,r=[];for(const n of t){const t=n.publicKey.toString();e.has(t)||(e.add(t),r.push(n))}this.signatures=r.map((t=>({signature:null,publicKey:t.publicKey})));const n=this._compile();this._partialSign(n,...r),this._verifySignatures(n.serialize(),!0)}partialSign(...t){if(0===t.length)throw new Error("No signers");const e=new Set,r=[];for(const n of t){const t=n.publicKey.toString();e.has(t)||(e.add(t),r.push(n))}const n=this._compile();this._partialSign(n,...r)}_partialSign(t,...e){const r=t.serialize();e.forEach((t=>{const e=mt().sign.detached(r,t.secretKey);this._addSignature(t.publicKey,ee(e))}))}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){Rn(64===e.length);const r=this.signatures.findIndex((e=>t.equals(e.publicKey)));if(r<0)throw new Error(`unknown signer: ${t.toString()}`);this.signatures[r].signature=vt.Buffer.from(e)}verifySignatures(){return this._verifySignatures(this.serializeMessage(),!0)}_verifySignatures(t,e){for(const{signature:r,publicKey:n}of this.signatures)if(null===r){if(e)return!1}else if(!mt().sign.detached.verify(t,r,n.toBuffer()))return!1;return!0}serialize(t){const{requireAllSignatures:e,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),n=this.serializeMessage();if(r&&!this._verifySignatures(n,e))throw new Error("Signature verification failed");return this._serialize(n)}_serialize(t){const{signatures:e}=this,r=[];In(r,e.length);const n=r.length+64*e.length+t.length,i=vt.Buffer.alloc(n);return Rn(e.length<256),vt.Buffer.from(r).copy(i,0),e.forEach((({signature:t},e)=>{null!==t&&(Rn(64===t.length,"signature has invalid length"),vt.Buffer.from(t).copy(i,r.length+64*e))})),t.copy(i,r.length+64*e.length),Rn(i.length<=1232,`Transaction too large: ${i.length} > 1232`),i}get keys(){return Rn(1===this.instructions.length),this.instructions[0].keys.map((t=>t.pubkey))}get programId(){return Rn(1===this.instructions.length),this.instructions[0].programId}get data(){return Rn(1===this.instructions.length),this.instructions[0].data}static from(t){let e=[...t];const r=xn(e);let n=[];for(let t=0;t<r;t++){const t=e.slice(0,64);e=e.slice(64),n.push(St().encode(vt.Buffer.from(t)))}return Cn.populate(Bn.from(e),n)}static populate(t,e=[]){const r=new Cn;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),e.forEach(((e,n)=>{const i={signature:e==St().encode(On)?null:St().decode(e),publicKey:t.accountKeys[n]};r.signatures.push(i)})),t.instructions.forEach((e=>{const n=e.accounts.map((e=>{const n=t.accountKeys[e];return{pubkey:n,isSigner:r.signatures.some((t=>t.publicKey.toString()===n.toString()))||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}}));r.instructions.push(new Pn({keys:n,programId:t.accountKeys[e.programIdIndex],data:St().decode(e.data)}))})),r._message=t,r._json=r.toJSON(),r}}const Tn=new vn("SysvarC1ock11111111111111111111111111111111"),Un=(new vn("SysvarEpochSchedu1e111111111111111111111111"),new vn("Sysvar1nstructions1111111111111111111111111"),new vn("SysvarRecentB1ockHashes11111111111111111111")),Ln=new vn("SysvarRent111111111111111111111111111111111"),Nn=(new vn("SysvarRewards111111111111111111111111111111"),new vn("SysvarS1otHashes111111111111111111111111111"),new vn("SysvarS1otHistory11111111111111111111111111"),new vn("SysvarStakeHistory1111111111111111111111111"));async function zn(t,e,r,n){const i=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries},o=await t.sendTransaction(e,r,i),s=(await t.confirmTransaction(o,n&&n.commitment)).value;if(s.err)throw new Error(`Transaction ${o} failed (${JSON.stringify(s)})`);return o}function jn(t){return new Promise((e=>setTimeout(e,t)))}function qn(t,e){const r=t.layout.span>=0?t.layout.span:function(t,e){let r=0;return t.layout.fields.forEach((t=>{t.span>=0?r+=t.span:"function"==typeof t.alloc&&(r+=t.alloc(e[t.property]))})),r}(t,e),n=vt.Buffer.alloc(r),i=Object.assign({instruction:t.index},e);return t.layout.encode(i,n),n}const Fn=Et._O("lamportsPerSignature"),Dn=Et.n_([Et.Jq("version"),Et.Jq("state"),En("authorizedPubkey"),En("nonce"),Et.n_([Fn],"feeCalculator")]).span,Kn=Object.freeze({Create:{index:0,layout:Et.n_([Et.Jq("instruction"),Et.gM("lamports"),Et.gM("space"),En("programId")])},Assign:{index:1,layout:Et.n_([Et.Jq("instruction"),En("programId")])},Transfer:{index:2,layout:Et.n_([Et.Jq("instruction"),Et.gM("lamports")])},CreateWithSeed:{index:3,layout:Et.n_([Et.Jq("instruction"),En("base"),kn("seed"),Et.gM("lamports"),Et.gM("space"),En("programId")])},AdvanceNonceAccount:{index:4,layout:Et.n_([Et.Jq("instruction")])},WithdrawNonceAccount:{index:5,layout:Et.n_([Et.Jq("instruction"),Et.gM("lamports")])},InitializeNonceAccount:{index:6,layout:Et.n_([Et.Jq("instruction"),En("authorized")])},AuthorizeNonceAccount:{index:7,layout:Et.n_([Et.Jq("instruction"),En("authorized")])},Allocate:{index:8,layout:Et.n_([Et.Jq("instruction"),Et.gM("space")])},AllocateWithSeed:{index:9,layout:Et.n_([Et.Jq("instruction"),En("base"),kn("seed"),Et.gM("space"),En("programId")])},AssignWithSeed:{index:10,layout:Et.n_([Et.Jq("instruction"),En("base"),kn("seed"),En("programId")])},TransferWithSeed:{index:11,layout:Et.n_([Et.Jq("instruction"),Et.gM("lamports"),kn("seed"),En("programId")])}});class Wn{constructor(){}static createAccount(t){const e=qn(Kn.Create,{lamports:t.lamports,space:t.space,programId:ee(t.programId.toBuffer())});return new Pn({keys:[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:e})}static transfer(t){let e,r;return"basePubkey"in t?(e=qn(Kn.TransferWithSeed,{lamports:t.lamports,seed:t.seed,programId:ee(t.programId.toBuffer())}),r=[{pubkey:t.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]):(e=qn(Kn.Transfer,{lamports:t.lamports}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]),new Pn({keys:r,programId:this.programId,data:e})}static assign(t){let e,r;return"basePubkey"in t?(e=qn(Kn.AssignWithSeed,{base:ee(t.basePubkey.toBuffer()),seed:t.seed,programId:ee(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=qn(Kn.Assign,{programId:ee(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new Pn({keys:r,programId:this.programId,data:e})}static createAccountWithSeed(t){const e=qn(Kn.CreateWithSeed,{base:ee(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:ee(t.programId.toBuffer())});let r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!1,isWritable:!0}];return t.basePubkey!=t.fromPubkey&&r.push({pubkey:t.basePubkey,isSigner:!0,isWritable:!1}),new Pn({keys:r,programId:this.programId,data:e})}static createNonceAccount(t){const e=new Cn;"basePubkey"in t&&"seed"in t?e.add(Wn.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:Dn,programId:this.programId})):e.add(Wn.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:Dn,programId:this.programId}));const r={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return e.add(this.nonceInitialize(r)),e}static nonceInitialize(t){const e=qn(Kn.InitializeNonceAccount,{authorized:ee(t.authorizedPubkey.toBuffer())}),r={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Un,isSigner:!1,isWritable:!1},{pubkey:Ln,isSigner:!1,isWritable:!1}],programId:this.programId,data:e};return new Pn(r)}static nonceAdvance(t){const e=qn(Kn.AdvanceNonceAccount),r={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Un,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e};return new Pn(r)}static nonceWithdraw(t){const e=qn(Kn.WithdrawNonceAccount,{lamports:t.lamports});return new Pn({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Un,isSigner:!1,isWritable:!1},{pubkey:Ln,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceAuthorize(t){const e=qn(Kn.AuthorizeNonceAccount,{authorized:ee(t.newAuthorizedPubkey.toBuffer())});return new Pn({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static allocate(t){let e,r;return"basePubkey"in t?(e=qn(Kn.AllocateWithSeed,{base:ee(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:ee(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=qn(Kn.Allocate,{space:t.space}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new Pn({keys:r,programId:this.programId,data:e})}}Wn.programId=new vn("11111111111111111111111111111111");class Jn{constructor(){}static getMinNumSignatures(t){return 2*(Math.ceil(t/Jn.chunkSize)+1+1)}static async load(t,e,r,n,i){{const o=await t.getMinimumBalanceForRentExemption(i.length),s=await t.getAccountInfo(r.publicKey,"confirmed");let a=null;if(null!==s){if(s.executable)return console.error("Program load failed, account is already executable"),!1;s.data.length!==i.length&&(a=a||new Cn,a.add(Wn.allocate({accountPubkey:r.publicKey,space:i.length}))),s.owner.equals(n)||(a=a||new Cn,a.add(Wn.assign({accountPubkey:r.publicKey,programId:n}))),s.lamports<o&&(a=a||new Cn,a.add(Wn.transfer({fromPubkey:e.publicKey,toPubkey:r.publicKey,lamports:o-s.lamports})))}else a=(new Cn).add(Wn.createAccount({fromPubkey:e.publicKey,newAccountPubkey:r.publicKey,lamports:o>0?o:1,space:i.length,programId:n}));null!==a&&await zn(t,a,[e,r],{commitment:"confirmed"})}const o=Et.n_([Et.Jq("instruction"),Et.Jq("offset"),Et.Jq("bytesLength"),Et.Jq("bytesLengthPadding"),Et.A9(Et.u8("byte"),Et.cv(Et.Jq(),-8),"bytes")]),s=Jn.chunkSize;let a=0,u=i,f=[];for(;u.length>0;){const i=u.slice(0,s),h=vt.Buffer.alloc(s+16);o.encode({instruction:0,offset:a,bytes:i,bytesLength:0,bytesLengthPadding:0},h);const c=(new Cn).add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:n,data:h});if(f.push(zn(t,c,[e,r],{commitment:"confirmed"})),t._rpcEndpoint.includes("solana.com")){const t=4;await jn(1e3/t)}a+=s,u=u.slice(s)}await Promise.all(f);{const i=Et.n_([Et.Jq("instruction")]),o=vt.Buffer.alloc(i.span);i.encode({instruction:1},o);const s=(new Cn).add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:Ln,isSigner:!1,isWritable:!1}],programId:n,data:o});await zn(t,s,[e,r],{commitment:"confirmed"})}return!0}}Jn.chunkSize=932,new vn("BPFLoader2111111111111111111111111111111111");Object.freeze({RequestUnits:{index:0,layout:Et.n_([Et.u8("instruction"),Et.Jq("units"),Et.Jq("additionalFee")])},RequestHeapFrame:{index:1,layout:Et.n_([Et.u8("instruction"),Et.Jq("bytes")])}});new vn("ComputeBudget111111111111111111111111111111");var $n={exports:{}};!function(t,e){var r="undefined"!=typeof self?self:re,n=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,s="ArrayBuffer"in t;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function f(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function c(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function l(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function b(t){var e=new FileReader,r=p(e);return e.readAsArrayBuffer(t),r}function g(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():s&&i&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=g(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=g(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=l(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var t,e,r,n=l(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,r=p(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(t,e){t=f(t),e=h(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},d.prototype.delete=function(t){delete this.map[f(t)]},d.prototype.get=function(t){return t=f(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(f(t))},d.prototype.set=function(t,e){this.map[f(t)]=h(e)},d.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},d.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),c(t)},d.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),c(t)},d.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),c(t)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(t,e){var r,n,i=(e=e||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new d(e.headers)),this.method=(n=(r=e.method||this.method||"GET").toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function M(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},y.call(v.prototype),y.call(M.prototype),M.prototype.clone=function(){return new M(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},M.error=function(){var t=new M(null,{status:0,statusText:""});return t.type="error",t};var _=[301,302,303,307,308];M.redirect=function(t,e){if(-1===_.indexOf(e))throw new RangeError("Invalid status code");return new M(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function S(t,r){return new Promise((function(n,o){var s=new v(t,r);if(s.signal&&s.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new d,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new M(i,r))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),s.signal&&(s.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",u)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}S.polyfill=!0,t.fetch||(t.fetch=S,t.Headers=d,t.Request=v,t.Response=M),e.Headers=d,e.Request=v,e.Response=M,e.fetch=S,Object.defineProperty(e,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(e=i.fetch).default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e}($n,$n.exports),Object.prototype.toString,Object.keys,Error;const Gn=Zt(jt(vn),Jt(),(t=>new vn(t))),Vn=$t([Jt(),qt("base64")]),Hn=Zt(jt(vt.Buffer),Vn,(t=>vt.Buffer.from(t[0],"base64")));function Zn(t){return Vt([Gt({jsonrpc:qt("2.0"),id:Jt(),result:t}),Gt({jsonrpc:qt("2.0"),id:Jt(),error:Gt({code:Ht(),message:Jt(),data:Kt(Lt("any",(()=>!0)))})})])}const Yn=Zn(Ht());function Xn(t){return Zt(Zn(t),Yn,(e=>"error"in e?e:{...e,result:Ct(e.result,t)}))}function Qn(t){return Xn(Gt({context:Gt({slot:Dt()}),value:t}))}function ti(t){return Gt({context:Gt({slot:Dt()}),value:t})}const ei=Gt({foundation:Dt(),foundationTerm:Dt(),initial:Dt(),taper:Dt(),terminal:Dt()}),ri=(Xn(Nt(Ft(Gt({epoch:Dt(),effectiveSlot:Dt(),amount:Dt(),postBalance:Dt()})))),Gt({epoch:Dt(),slotIndex:Dt(),slotsInEpoch:Dt(),absoluteSlot:Dt(),blockHeight:Kt(Dt()),transactionCount:Kt(Dt())})),ni=Gt({slotsPerEpoch:Dt(),leaderScheduleSlotOffset:Dt(),warmup:zt(),firstNormalEpoch:Dt(),firstNormalSlot:Dt()}),ii=Wt(Jt(),Nt(Dt())),oi=Ft(Vt([Gt({}),Jt()])),si=Gt({err:oi}),ai=qt("receivedSignature");Gt({"solana-core":Jt(),"feature-set":Kt(Dt())}),Qn(Gt({err:Ft(Vt([Gt({}),Jt()])),logs:Ft(Nt(Jt())),accounts:Kt(Ft(Nt(Ft(Gt({executable:zt(),owner:Jt(),lamports:Dt(),data:Nt(Jt()),rentEpoch:Kt(Dt())}))))),unitsConsumed:Kt(Dt())})),Qn(Gt({byIdentity:Wt(Jt(),Nt(Dt())),range:Gt({firstSlot:Dt(),lastSlot:Dt()})})),Xn(ei),Xn(ri),Xn(ni),Xn(ii),Xn(Dt()),Qn(Gt({total:Dt(),circulating:Dt(),nonCirculating:Dt(),nonCirculatingAccounts:Nt(Gn)}));const ui=Gt({amount:Jt(),uiAmount:Ft(Dt()),decimals:Dt(),uiAmountString:Kt(Jt())}),fi=(Qn(Nt(Gt({address:Gn,amount:Jt(),uiAmount:Ft(Dt()),decimals:Dt(),uiAmountString:Kt(Jt())}))),Qn(Nt(Gt({pubkey:Gn,account:Gt({executable:zt(),owner:Gn,lamports:Dt(),data:Hn,rentEpoch:Dt()})}))),Gt({program:Jt(),parsed:Ht(),space:Dt()})),hi=(Qn(Nt(Gt({pubkey:Gn,account:Gt({executable:zt(),owner:Gn,lamports:Dt(),data:fi,rentEpoch:Dt()})}))),Qn(Nt(Gt({lamports:Dt(),address:Gn}))),Gt({executable:zt(),owner:Gn,lamports:Dt(),data:Hn,rentEpoch:Dt()})),ci=(Gt({pubkey:Gn,account:hi}),Zt(Vt([jt(vt.Buffer),fi]),Vt([Vn,fi]),(t=>Array.isArray(t)?Ct(t,Hn):t))),di=Gt({executable:zt(),owner:Gn,lamports:Dt(),data:ci,rentEpoch:Dt()}),li=(Gt({pubkey:Gn,account:di}),Gt({state:Vt([qt("active"),qt("inactive"),qt("activating"),qt("deactivating")]),active:Dt(),inactive:Dt()}),Xn(Nt(Gt({signature:Jt(),slot:Dt(),err:oi,memo:Ft(Jt()),blockTime:Kt(Ft(Dt()))}))),Xn(Nt(Gt({signature:Jt(),slot:Dt(),err:oi,memo:Ft(Jt()),blockTime:Kt(Ft(Dt()))}))),Gt({subscription:Dt(),result:ti(hi)}),Gt({pubkey:Gn,account:hi})),pi=(Gt({subscription:Dt(),result:ti(li)}),Gt({parent:Dt(),slot:Dt(),root:Dt()})),bi=(Gt({subscription:Dt(),result:pi}),Vt([Gt({type:Vt([qt("firstShredReceived"),qt("completed"),qt("optimisticConfirmation"),qt("root")]),slot:Dt(),timestamp:Dt()}),Gt({type:qt("createdBank"),parent:Dt(),slot:Dt(),timestamp:Dt()}),Gt({type:qt("frozen"),slot:Dt(),timestamp:Dt(),stats:Gt({numTransactionEntries:Dt(),numSuccessfulTransactions:Dt(),numFailedTransactions:Dt(),maxTransactionsPerEntry:Dt()})}),Gt({type:qt("dead"),slot:Dt(),timestamp:Dt(),err:Jt()})])),gi=(Gt({subscription:Dt(),result:bi}),Gt({subscription:Dt(),result:ti(Vt([si,ai]))}),Gt({subscription:Dt(),result:Dt()}),Gt({pubkey:Jt(),gossip:Ft(Jt()),tpu:Ft(Jt()),rpc:Ft(Jt()),version:Ft(Jt())}),Gt({votePubkey:Jt(),nodePubkey:Jt(),activatedStake:Dt(),epochVoteAccount:zt(),epochCredits:Nt($t([Dt(),Dt(),Dt()])),commission:Dt(),lastVote:Dt(),rootSlot:Ft(Dt())})),yi=(Xn(Gt({current:Nt(gi),delinquent:Nt(gi)})),Vt([qt("processed"),qt("confirmed"),qt("finalized")])),mi=Gt({slot:Dt(),confirmations:Ft(Dt()),err:oi,confirmationStatus:Kt(yi)}),vi=(Qn(Nt(Ft(mi))),Xn(Dt()),Gt({signatures:Nt(Jt()),message:Gt({accountKeys:Nt(Jt()),header:Gt({numRequiredSignatures:Dt(),numReadonlySignedAccounts:Dt(),numReadonlyUnsignedAccounts:Dt()}),instructions:Nt(Gt({accounts:Nt(Dt()),data:Jt(),programIdIndex:Dt()})),recentBlockhash:Jt()})})),wi=Gt({parsed:Ht(),program:Jt(),programId:Gn}),Mi=Gt({accounts:Nt(Gn),data:Jt(),programId:Gn}),_i=Zt(Vt([Mi,wi]),Vt([Gt({parsed:Ht(),program:Jt(),programId:Jt()}),Gt({accounts:Nt(Jt()),data:Jt(),programId:Jt()})]),(t=>Ct(t,"accounts"in t?Mi:wi))),Si=Gt({signatures:Nt(Jt()),message:Gt({accountKeys:Nt(Gt({pubkey:Gn,signer:zt(),writable:zt()})),instructions:Nt(_i),recentBlockhash:Jt()})}),Ai=Gt({accountIndex:Dt(),mint:Jt(),owner:Kt(Jt()),uiTokenAmount:ui}),Ei=Gt({err:oi,fee:Dt(),innerInstructions:Kt(Ft(Nt(Gt({index:Dt(),instructions:Nt(Gt({accounts:Nt(Dt()),data:Jt(),programIdIndex:Dt()}))})))),preBalances:Nt(Dt()),postBalances:Nt(Dt()),logMessages:Kt(Ft(Nt(Jt()))),preTokenBalances:Kt(Ft(Nt(Ai))),postTokenBalances:Kt(Ft(Nt(Ai)))}),ki=Gt({err:oi,fee:Dt(),innerInstructions:Kt(Ft(Nt(Gt({index:Dt(),instructions:Nt(_i)})))),preBalances:Nt(Dt()),postBalances:Nt(Dt()),logMessages:Kt(Ft(Nt(Jt()))),preTokenBalances:Kt(Ft(Nt(Ai))),postTokenBalances:Kt(Ft(Nt(Ai)))}),xi=(Xn(Ft(Gt({blockhash:Jt(),previousBlockhash:Jt(),parentSlot:Dt(),transactions:Nt(Gt({transaction:vi,meta:Ft(Ei)})),rewards:Kt(Nt(Gt({pubkey:Jt(),lamports:Dt(),postBalance:Ft(Dt()),rewardType:Ft(Jt())}))),blockTime:Ft(Dt()),blockHeight:Ft(Dt())}))),Xn(Ft(Gt({blockhash:Jt(),previousBlockhash:Jt(),parentSlot:Dt(),transactions:Nt(Gt({transaction:vi,meta:Ft(Ei)})),rewards:Kt(Nt(Gt({pubkey:Jt(),lamports:Dt(),postBalance:Ft(Dt()),rewardType:Ft(Jt())}))),blockTime:Ft(Dt())}))),Xn(Ft(Gt({blockhash:Jt(),previousBlockhash:Jt(),parentSlot:Dt(),signatures:Nt(Jt()),blockTime:Ft(Dt())}))),Xn(Ft(Gt({slot:Dt(),meta:Ei,blockTime:Kt(Ft(Dt())),transaction:vi}))),Xn(Ft(Gt({slot:Dt(),transaction:Si,meta:Ft(ki),blockTime:Kt(Ft(Dt()))}))),Qn(Gt({blockhash:Jt(),feeCalculator:Gt({lamportsPerSignature:Dt()})})),Qn(Gt({blockhash:Jt(),lastValidBlockHeight:Dt()})),Xn(Nt(Gt({slot:Dt(),numTransactions:Dt(),numSlots:Dt(),samplePeriodSecs:Dt()}))),Qn(Ft(Gt({feeCalculator:Gt({lamportsPerSignature:Dt()})}))),Xn(Jt()),Xn(Jt()),Gt({err:oi,logs:Nt(Jt()),signature:Jt()}));Gt({result:ti(xi),subscription:Dt()});class Ii{constructor(t){this._keypair=void 0,this._keypair=t||mt().sign.keyPair()}static generate(){return new Ii(mt().sign.keyPair())}static fromSecretKey(t,e){const r=mt().sign.keyPair.fromSecretKey(t);if(!e||!e.skipValidation){const t=(new TextEncoder).encode("@solana/web3.js-validation-v1"),e=mt().sign.detached(t,r.secretKey);if(!mt().sign.detached.verify(t,e,r.publicKey))throw new Error("provided secretKey is invalid")}return new Ii(r)}static fromSeed(t){return new Ii(mt().sign.keyPair.fromSeed(t))}get publicKey(){return new vn(this._keypair.publicKey)}get secretKey(){return this._keypair.secretKey}}const Bi=Et.n_([Et.u8("numSignatures"),Et.u8("padding"),Et.KB("signatureOffset"),Et.KB("signatureInstructionIndex"),Et.KB("publicKeyOffset"),Et.KB("publicKeyInstructionIndex"),Et.KB("messageDataOffset"),Et.KB("messageDataSize"),Et.KB("messageInstructionIndex")]);class Ri{constructor(){}static createInstructionWithPublicKey(t){const{publicKey:e,message:r,signature:n,instructionIndex:i}=t;Rn(32===e.length,`Public Key must be 32 bytes but received ${e.length} bytes`),Rn(64===n.length,`Signature must be 64 bytes but received ${n.length} bytes`);const o=Bi.span,s=o+e.length,a=s+n.length,u=vt.Buffer.alloc(a+r.length),f=null==i?65535:i;return Bi.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:f,publicKeyOffset:o,publicKeyInstructionIndex:f,messageDataOffset:a,messageDataSize:r.length,messageInstructionIndex:f},u),u.fill(e,o),u.fill(n,s),u.fill(r,a),new Pn({keys:[],programId:Ri.programId,data:u})}static createInstructionWithPrivateKey(t){const{privateKey:e,message:r,instructionIndex:n}=t;Rn(64===e.length,`Private key must be 64 bytes but received ${e.length} bytes`);try{const t=Ii.fromSecretKey(e),i=t.publicKey.toBytes(),o=mt().sign.detached(r,t.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:o,instructionIndex:n})}catch(t){throw new Error(`Error creating instruction; ${t}`)}}}Ri.programId=new vn("Ed25519SigVerify111111111111111111111111111");const Oi=new vn("StakeConfig11111111111111111111111111111111");class Pi{constructor(t,e,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=e,this.custodian=r}}Pi.default=new Pi(0,0,vn.default);const Ci=Object.freeze({Initialize:{index:0,layout:Et.n_([Et.Jq("instruction"),((t="authorized")=>Et.n_([En("staker"),En("withdrawer")],t))(),((t="lockup")=>Et.n_([Et.gM("unixTimestamp"),Et.gM("epoch"),En("custodian")],t))()])},Authorize:{index:1,layout:Et.n_([Et.Jq("instruction"),En("newAuthorized"),Et.Jq("stakeAuthorizationType")])},Delegate:{index:2,layout:Et.n_([Et.Jq("instruction")])},Split:{index:3,layout:Et.n_([Et.Jq("instruction"),Et.gM("lamports")])},Withdraw:{index:4,layout:Et.n_([Et.Jq("instruction"),Et.gM("lamports")])},Deactivate:{index:5,layout:Et.n_([Et.Jq("instruction")])},Merge:{index:7,layout:Et.n_([Et.Jq("instruction")])},AuthorizeWithSeed:{index:8,layout:Et.n_([Et.Jq("instruction"),En("newAuthorized"),Et.Jq("stakeAuthorizationType"),kn("authoritySeed"),En("authorityOwner")])}});Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class Ti{constructor(){}static initialize(t){const{stakePubkey:e,authorized:r,lockup:n}=t,i=n||Pi.default,o=qn(Ci.Initialize,{authorized:{staker:ee(r.staker.toBuffer()),withdrawer:ee(r.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:ee(i.custodian.toBuffer())}}),s={keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:Ln,isSigner:!1,isWritable:!1}],programId:this.programId,data:o};return new Pn(s)}static createAccountWithSeed(t){const e=new Cn;e.add(Wn.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:n,lockup:i}=t;return e.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static createAccount(t){const e=new Cn;e.add(Wn.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,lamports:t.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:n,lockup:i}=t;return e.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static delegate(t){const{stakePubkey:e,authorizedPubkey:r,votePubkey:n}=t,i=qn(Ci.Delegate);return(new Cn).add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:Tn,isSigner:!1,isWritable:!1},{pubkey:Nn,isSigner:!1,isWritable:!1},{pubkey:Oi,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(t){const{stakePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:n,stakeAuthorizationType:i,custodianPubkey:o}=t,s=qn(Ci.Authorize,{newAuthorized:ee(n.toBuffer()),stakeAuthorizationType:i.index}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:Tn,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!1,isWritable:!1}),(new Cn).add({keys:a,programId:this.programId,data:s})}static authorizeWithSeed(t){const{stakePubkey:e,authorityBase:r,authoritySeed:n,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:s,custodianPubkey:a}=t,u=qn(Ci.AuthorizeWithSeed,{newAuthorized:ee(o.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:n,authorityOwner:ee(i.toBuffer())}),f=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:Tn,isSigner:!1,isWritable:!1}];return a&&f.push({pubkey:a,isSigner:!1,isWritable:!1}),(new Cn).add({keys:f,programId:this.programId,data:u})}static splitInstruction(t){const{stakePubkey:e,authorizedPubkey:r,splitStakePubkey:n,lamports:i}=t,o=qn(Ci.Split,{lamports:i});return new Pn({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static split(t){const e=new Cn;return e.add(Wn.createAccount({fromPubkey:t.authorizedPubkey,newAccountPubkey:t.splitStakePubkey,lamports:0,space:this.space,programId:this.programId})),e.add(this.splitInstruction(t))}static splitWithSeed(t){const{stakePubkey:e,authorizedPubkey:r,splitStakePubkey:n,basePubkey:i,seed:o,lamports:s}=t,a=new Cn;return a.add(Wn.allocate({accountPubkey:n,basePubkey:i,seed:o,space:this.space,programId:this.programId})),a.add(this.splitInstruction({stakePubkey:e,authorizedPubkey:r,splitStakePubkey:n,lamports:s}))}static merge(t){const{stakePubkey:e,sourceStakePubKey:r,authorizedPubkey:n}=t,i=qn(Ci.Merge);return(new Cn).add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Tn,isSigner:!1,isWritable:!1},{pubkey:Nn,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(t){const{stakePubkey:e,authorizedPubkey:r,toPubkey:n,lamports:i,custodianPubkey:o}=t,s=qn(Ci.Withdraw,{lamports:i}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Tn,isSigner:!1,isWritable:!1},{pubkey:Nn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!1,isWritable:!1}),(new Cn).add({keys:a,programId:this.programId,data:s})}static deactivate(t){const{stakePubkey:e,authorizedPubkey:r}=t,n=qn(Ci.Deactivate);return(new Cn).add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:Tn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}}Ti.programId=new vn("Stake11111111111111111111111111111111111111"),Ti.space=200;const{publicKeyCreate:Ui,ecdsaSign:Li}=Xt(),Ni=Et.n_([Et.u8("numSignatures"),Et.KB("signatureOffset"),Et.u8("signatureInstructionIndex"),Et.KB("ethAddressOffset"),Et.u8("ethAddressInstructionIndex"),Et.KB("messageDataOffset"),Et.KB("messageDataSize"),Et.u8("messageInstructionIndex"),Et.Ik(20,"ethAddress"),Et.Ik(64,"signature"),Et.u8("recoveryId")]);class zi{constructor(){}static publicKeyToEthAddress(t){Rn(64===t.length,`Public key must be 64 bytes but received ${t.length} bytes`);try{return vt.Buffer.from(te().keccak_256.update(ee(t)).digest()).slice(-20)}catch(t){throw new Error(`Error constructing Ethereum address: ${t}`)}}static createInstructionWithPublicKey(t){const{publicKey:e,message:r,signature:n,recoveryId:i,instructionIndex:o}=t;return zi.createInstructionWithEthAddress({ethAddress:zi.publicKeyToEthAddress(e),message:r,signature:n,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(t){const{ethAddress:e,message:r,signature:n,recoveryId:i,instructionIndex:o=0}=t;let s;s="string"==typeof e?e.startsWith("0x")?vt.Buffer.from(e.substr(2),"hex"):vt.Buffer.from(e,"hex"):e,Rn(20===s.length,`Address must be 20 bytes but received ${s.length} bytes`);const a=12+s.length,u=a+n.length+1,f=vt.Buffer.alloc(Ni.span+r.length);return Ni.encode({numSignatures:1,signatureOffset:a,signatureInstructionIndex:o,ethAddressOffset:12,ethAddressInstructionIndex:o,messageDataOffset:u,messageDataSize:r.length,messageInstructionIndex:o,signature:ee(n),ethAddress:ee(s),recoveryId:i},f),f.fill(ee(r),Ni.span),new Pn({keys:[],programId:zi.programId,data:f})}static createInstructionWithPrivateKey(t){const{privateKey:e,message:r,instructionIndex:n}=t;Rn(32===e.length,`Private key must be 32 bytes but received ${e.length} bytes`);try{const t=ee(e),i=Ui(t,!1).slice(1),o=vt.Buffer.from(te().keccak_256.update(ee(r)).digest()),{signature:s,recid:a}=Li(o,t);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:s,recoveryId:a,instructionIndex:n})}catch(t){throw new Error(`Error creating instruction; ${t}`)}}}zi.programId=new vn("KeccakSecp256k11111111111111111111111111111"),new vn("Va1idator1nfo111111111111111111111111111111"),Gt({name:Jt(),website:Kt(Jt()),details:Kt(Jt()),keybaseUsername:Kt(Jt())}),new vn("Vote111111111111111111111111111111111111111"),Et.n_([En("nodePubkey"),En("authorizedWithdrawer"),Et.u8("commission"),Et._O(),Et.A9(Et.n_([Et._O("slot"),Et.Jq("confirmationCount")]),Et.cv(Et.Jq(),-8),"votes"),Et.u8("rootSlotValid"),Et._O("rootSlot"),Et._O(),Et.A9(Et.n_([Et._O("epoch"),En("authorizedVoter")]),Et.cv(Et.Jq(),-8),"authorizedVoters"),Et.n_([Et.A9(Et.n_([En("authorizedPubkey"),Et._O("epochOfLastAuthorizedSwitch"),Et._O("targetEpoch")]),32,"buf"),Et._O("idx"),Et.u8("isEmpty")],"priorVoters"),Et._O(),Et.A9(Et.n_([Et._O("epoch"),Et._O("credits"),Et._O("prevCredits")]),Et.cv(Et.Jq(),-8),"epochCredits"),Et.n_([Et._O("slot"),Et._O("timestamp")],"lastTimestamp")]);const ji=Object.freeze({InitializeAccount:{index:0,layout:Et.n_([Et.Jq("instruction"),((t="voteInit")=>Et.n_([En("nodePubkey"),En("authorizedVoter"),En("authorizedWithdrawer"),Et.u8("commission")],t))()])},Authorize:{index:1,layout:Et.n_([Et.Jq("instruction"),En("newAuthorized"),Et.Jq("voteAuthorizationType")])},Withdraw:{index:3,layout:Et.n_([Et.Jq("instruction"),Et.gM("lamports")])}});Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class qi{constructor(){}static initializeAccount(t){const{votePubkey:e,nodePubkey:r,voteInit:n}=t,i=qn(ji.InitializeAccount,{voteInit:{nodePubkey:ee(n.nodePubkey.toBuffer()),authorizedVoter:ee(n.authorizedVoter.toBuffer()),authorizedWithdrawer:ee(n.authorizedWithdrawer.toBuffer()),commission:n.commission}}),o={keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:Ln,isSigner:!1,isWritable:!1},{pubkey:Tn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new Pn(o)}static createAccount(t){const e=new Cn;return e.add(Wn.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.votePubkey,lamports:t.lamports,space:this.space,programId:this.programId})),e.add(this.initializeAccount({votePubkey:t.votePubkey,nodePubkey:t.voteInit.nodePubkey,voteInit:t.voteInit}))}static authorize(t){const{votePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:n,voteAuthorizationType:i}=t,o=qn(ji.Authorize,{newAuthorized:ee(n.toBuffer()),voteAuthorizationType:i.index}),s=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:Tn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return(new Cn).add({keys:s,programId:this.programId,data:o})}static withdraw(t){const{votePubkey:e,authorizedWithdrawerPubkey:r,lamports:n,toPubkey:i}=t,o=qn(ji.Withdraw,{lamports:n}),s=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return(new Cn).add({keys:s,programId:this.programId,data:o})}}qi.programId=new vn("Vote111111111111111111111111111111111111111"),qi.space=3731;var Fi=r(5973);class Di extends X{constructor(t){super(t),this.providerName=R.solana}request(t){return this.bridgeRequest(t)}}const Ki=t=>Fi.encode(t.serializeMessage()),Wi=t=>Cn.from(Fi.decode(t));var Ji=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};class $i extends Di{constructor(t){super(Object.assign(Object.assign({},t),{bridge:t.bridge||nt({timeout:t.timeout})})),this.isPhantom=!0,this._publicKey=null,this._registerEvents()}get publicKey(){return this._publicKey}get isConnected(){return null!==this._publicKey}_registerEvents(){window.addEventListener("onekey_bridge_disconnect",(()=>{this._handleDisconnected()})),this.on("message_low_level",(t=>{const{method:e,params:r}=t;(function(t,e){return t===`metamask_${e}`||t===`wallet_events_${e}`})(e,"accountChanged")&&this._handleAccountChange(r)}))}_callBridge(t){return this.bridgeRequest(t)}connect(t){return Ji(this,void 0,void 0,(function*(){if(this.publicKey)return{publicKey:this.publicKey};const e=yield this._callBridge({method:"connect",params:t}),r=new vn(e.publicKey);return this._handleConnected(r),{publicKey:r}}))}_handleConnected(t,e={emit:!0}){this._publicKey=t,e.emit&&this.emit("connect",t)}disconnect(){return Ji(this,void 0,void 0,(function*(){yield this._callBridge({method:"disconnect",params:void 0}),this._handleDisconnected()}))}_handleDisconnected(t={emit:!0}){this._publicKey=null,t.emit&&this.emit("disconnect")}_handleAccountChange(t){const e=t.accounts[0];if(!e)return this.emit("accountChanged",null);const r=new vn(e.publicKey);this._handleConnected(r,{emit:!1}),this.emit("accountChanged",r)}signAndSendTransaction(t,e){return Ji(this,void 0,void 0,(function*(){return this._handleSignAndSendTransaction({message:Ki(t),options:e})}))}_handleSignAndSendTransaction(t){return Ji(this,void 0,void 0,(function*(){return yield this._callBridge({method:"signAndSendTransaction",params:t})}))}signTransaction(t){return Ji(this,void 0,void 0,(function*(){return this._handleSignTransaction({message:Ki(t)})}))}_handleSignTransaction(t){return Ji(this,void 0,void 0,(function*(){const e=yield this._callBridge({method:"signTransaction",params:t});return Wi(e)}))}signAllTransactions(t){return Ji(this,void 0,void 0,(function*(){return this._handleSignAllTransactions({message:t.map(Ki)})}))}_handleSignAllTransactions(t){return Ji(this,void 0,void 0,(function*(){return(yield this._callBridge({method:"signAllTransactions",params:t})).map(Wi)}))}signMessage(t,e){return Ji(this,void 0,void 0,(function*(){return this._handleSignMessage({message:t,display:e})}))}_handleSignMessage(t){return Ji(this,void 0,void 0,(function*(){const{message:e,display:r}=t,n=yield this._callBridge({method:"signMessage",params:{message:"string"==typeof e?e:Fi.encode(e),display:r}});return{signature:Fi.decode(n.signature),publicKey:new vn(n.publicKey)}}))}request(...t){let e,r;if("string"==typeof t[0])e=t[0],r=t[1];else{const n=t[0];e=n.method,r=n.params}switch(e){case"connect":return this.connect(r);case"disconnect":return this.disconnect();case"signTransaction":return this._handleSignTransaction(r);case"signAllTransactions":return this._handleSignAllTransactions(r);case"signMessage":return this._handleSignMessage(r);case"signAndSendTransaction":return this._handleSignAndSendTransaction(r)}return this._callBridge({method:e,params:r})}on(t,e){return super.on(t,e)}emit(t,...e){return super.emit(t,...e)}}Q((()=>new ot({receiveHandler:tt}))),function(){var t,e;if(!(null===(t=null===window||void 0===window?void 0:window.$onekey)||void 0===t?void 0:t.jsBridge))throw new Error("OneKey jsBridge not found.");const r=null===(e=null===window||void 0===window?void 0:window.$onekey)||void 0===e?void 0:e.jsBridge,n=new bt({bridge:r}),i=new gt({bridge:r}),o=new $i({bridge:r}),s=Object.assign(Object.assign({},window.$onekey),{jsBridge:r,ethereum:n,$private:i,solana:o,conflux:null,sollet:null});window.$onekey=s,window.ethereum=n,window.solana=o,function(t,e=console){let r=!1,n=!1;if(!window.web3){const i="__isMetaMaskShim__",o="__isOneKeyShim__";let s={currentProvider:t};Object.defineProperty(s,i,{value:!0,enumerable:!0,configurable:!1,writable:!1}),Object.defineProperty(s,o,{value:!0,enumerable:!0,configurable:!1,writable:!1}),s=new Proxy(s,{get:(o,s,...a)=>("currentProvider"!==s||r?"currentProvider"===s||s===i||n||(n=!0,e.error("MetaMask no longer injects web3. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),t.request({method:"metamask_logWeb3ShimUsage"}).catch((t=>{e.debug("MetaMask: Failed to log web3 shim usage.",t)}))):(r=!0,e.warn("You are accessing the MetaMask window.web3.currentProvider shim. This property is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3")),Reflect.get(o,s,...a)),set:(...t)=>(e.warn("You are accessing the MetaMask window.web3 shim. This object is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),Reflect.set(...t))}),Object.defineProperty(window,"web3",{value:s,enumerable:!1,configurable:!0,writable:!0})}}(n),window.dispatchEvent(new Event("ethereum#initialized"))}(),console.log("======== injected.js in extension done! >>>>>>> ",performance.now())})(),n})()}));