/*! For license information please see 2.76be9077.chunk.js.LICENSE.txt */ (this["webpackJsonpsatoshi-simple"]=this["webpackJsonpsatoshi-simple"]||[]).push([[2],[function(e,t,o){"use strict";e.exports=o(307)},function(e,t,o){"use strict";o.d(t,"a",(function(){return l}));var r=o(3),n=o.n(r),i={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},a=n.a.createContext&&n.a.createContext(i),s=function(){return s=Object.assign||function(e){for(var t,o=1,r=arguments.length;o=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===e)return this.complete(o.completion,o.afterLoc),A(o),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===e){var r=o.completion;if("throw"===r.type){var n=r.arg;A(o)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,o){return this.delegate={iterator:I(e),resultName:t,nextLoc:o},"next"===this.method&&(this.arg=void 0),d}},e}},function(e,t,o){"use strict";e.exports=o(295)},function(e,t,o){"use strict";o.d(t,"k",(function(){return a})),o.d(t,"j",(function(){return c})),o.d(t,"a",(function(){return u})),o.d(t,"b",(function(){return l})),o.d(t,"o",(function(){return m})),o.d(t,"p",(function(){return f})),o.d(t,"l",(function(){return d})),o.d(t,"i",(function(){return p})),o.d(t,"d",(function(){return g})),o.d(t,"e",(function(){return b})),o.d(t,"c",(function(){return y})),o.d(t,"g",(function(){return v})),o.d(t,"f",(function(){return k})),o.d(t,"h",(function(){return w})),o.d(t,"n",(function(){return x})),o.d(t,"m",(function(){return z}));var r=new(o(5).b)("bytes/5.7.0");function n(e){return!!e.toHexString}function i(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return i(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return d(e)&&!(e.length%2)||c(e)}function s(e){return"number"===typeof e&&e==e&&e%1===0}function c(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"===typeof e)return!1;if(!s(e.length)||e.length<0)return!1;for(var t=0;t=256)return!1}return!0}function u(e,t){if(t||(t={}),"number"===typeof e){r.checkSafeUint53(e,"invalid arrayify value");for(var o=[];e;)o.unshift(255&e),e=parseInt(String(e/256));return 0===o.length&&o.push(0),i(new Uint8Array(o))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),n(e)&&(e=e.toHexString()),d(e)){var a=e.substring(2);a.length%2&&("left"===t.hexPad?a="0"+a:"right"===t.hexPad?a+="0":r.throwArgumentError("hex data is odd-length","value",e));for(var s=[],u=0;ut&&r.throwArgumentError("value out of range","value",arguments[0]);var o=new Uint8Array(t);return o.set(e,t-e.length),i(o)}function d(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}var h="0123456789abcdef";function p(e,t){if(t||(t={}),"number"===typeof e){r.checkSafeUint53(e,"invalid hexlify value");for(var o="";e;)o=h[15&e]+o,e=Math.floor(e/16);return o.length?(o.length%2&&(o="0"+o),"0x"+o):"0x00"}if("bigint"===typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),n(e))return e.toHexString();if(d(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":r.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(c(e)){for(var i="0x",a=0;a>4]+h[15&s]}return i}return r.throwArgumentError("invalid hexlify value","value",e)}function g(e){if("string"!==typeof e)e=p(e);else if(!d(e)||e.length%2)return null;return(e.length-2)/2}function b(e,t,o){return"string"!==typeof e?e=p(e):(!d(e)||e.length%2)&&r.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=o?"0x"+e.substring(t,2+2*o):"0x"+e.substring(t)}function y(e){var t="0x";return e.forEach((function(e){t+=p(e).substring(2)})),t}function v(e){var t=k(p(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function k(e){"string"!==typeof e&&(e=p(e)),d(e)||r.throwArgumentError("invalid hex string","value",e),e=e.substring(2);for(var t=0;t2*t+2&&r.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function x(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(e)){var o=u(e);64===o.length?(t.v=27+(o[32]>>7),o[32]&=127,t.r=p(o.slice(0,32)),t.s=p(o.slice(32,64))):65===o.length?(t.r=p(o.slice(0,32)),t.s=p(o.slice(32,64)),t.v=o[64]):r.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:r.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(o[32]|=128),t._vs=p(o.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){var n=f(u(t._vs),32);t._vs=p(n);var i=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&r.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;var s=p(n);null==t.s?t.s=s:t.s!==s&&r.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?r.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{var c=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==c&&r.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&d(t.r)?t.r=w(t.r,32):r.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&d(t.s)?t.s=w(t.s,32):r.throwArgumentError("signature missing or invalid s","signature",e);var l=u(t.s);l[0]>=128&&r.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(l[0]|=128);var m=p(l);t._vs&&(d(t._vs)||r.throwArgumentError("signature invalid _vs","signature",e),t._vs=w(t._vs,32)),null==t._vs?t._vs=m:t._vs!==m&&r.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function z(e){return p(l([(e=x(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},function(e,t,o){"use strict";o.d(t,"a",(function(){return m})),o.d(t,"b",(function(){return h}));var r=o(8),n=o(9),i=!1,a=!1,s={debug:1,default:2,info:2,warning:3,error:4,off:5},c=s.default,u=null;var l,m,f=function(){try{var e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(o){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(l||(l={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(m||(m={}));var d="0123456789abcdef",h=function(){function e(t){Object(r.a)(this,e),Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}return Object(n.a)(e,[{key:"_log",value:function(e,t){var o=e.toLowerCase();null==s[o]&&this.throwArgumentError("invalid log level name","logLevel",e),c>s[o]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,o=new Array(t),r=0;r>4],o+=d[15&t[i]];n.push(e+"=Uint8Array(0x"+o+")")}else n.push(e+"="+JSON.stringify(t))}catch(u){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push("code=".concat(o)),n.push("version=".concat(this.version));var i=t,s="";switch(o){case m.NUMERIC_FAULT:s="NUMERIC_FAULT";var c=t;switch(c){case"overflow":case"underflow":case"division-by-zero":s+="-"+c;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break;case m.CALL_EXCEPTION:case m.INSUFFICIENT_FUNDS:case m.MISSING_NEW:case m.NONCE_EXPIRED:case m.REPLACEMENT_UNDERPRICED:case m.TRANSACTION_REPLACED:case m.UNPREDICTABLE_GAS_LIMIT:s=o}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(t+=" ("+n.join(", ")+")");var u=new Error(t);return u.reason=i,u.code=o,Object.keys(r).forEach((function(e){u[e]=r[e]})),u}},{key:"throwError",value:function(e,t,o){throw this.makeError(e,t,o)}},{key:"throwArgumentError",value:function(t,o,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:o,value:r})}},{key:"assert",value:function(e,t,o,r){e||this.throwError(t,o,r)}},{key:"assertArgument",value:function(e,t,o,r){e||this.throwArgumentError(t,o,r)}},{key:"checkNormalize",value:function(t){null==t&&(t="platform missing String.prototype.normalize"),f&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:f})}},{key:"checkSafeUint53",value:function(t,o){"number"===typeof t&&(null==o&&(o="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(o,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(o,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,o,r){r=r?": "+r:"",to&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:o})}},{key:"checkNew",value:function(t,o){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:o.name})}},{key:"checkAbstract",value:function(t,o){t===o?this.throwError("cannot instantiate abstract class "+JSON.stringify(o.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:o.name})}}],[{key:"globalLogger",value:function(){return u||(u=new e("logger/5.7.0")),u}},{key:"setCensorship",value:function(t,o){if(!t&&o&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),i){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}a=!!t,i=!!o}},{key:"setLogLevel",value:function(t){var o=s[t.toLowerCase()];null!=o?c=o:e.globalLogger().warn("invalid log level - "+t)}},{key:"from",value:function(t){return new e(t)}}]),e}();h.errors=m,h.levels=l},function(e,t,o){"use strict";function r(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}o.d(t,"a",(function(){return r}))},function(e,t,o){"use strict";(function(e){o.d(t,"a",(function(){return Oe})),o.d(t,"b",(function(){return ye})),o.d(t,"d",(function(){return Ce}));var r=o(159),n=o(3),i=o.n(n),a=o(265),s=o.n(a),c=o(266),u=o(267),l=o(169),m=o(69),f=o.n(m);function d(){return(d=Object.assign||function(e){for(var t=1;t1?t-1:0),r=1;r0?" Args: "+o.join(", "):""))}var A=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,o=0;o=this.groupSizes.length){for(var o=this.groupSizes,r=o.length,n=r;e>=n;)(n<<=1)<0&&M(16,""+e);this.groupSizes=new Uint32Array(n),this.groupSizes.set(o),this.length=n;for(var i=r;i=this.length||0===this.groupSizes[e])return t;for(var o=this.groupSizes[e],r=this.indexOfGroup(e),n=r+o,i=r;i=E&&(E=t+1),q.set(e,t),I.set(t,e)},T="style["+w+'][data-styled-version="5.3.11"]',O=new RegExp("^"+w+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),C=function(e,t,o){for(var r,n=o.split(","),i=0,a=n.length;i=0;o--){var r=t[o];if(r&&1===r.nodeType&&r.hasAttribute(w))return r}}(o),i=void 0!==n?n.nextSibling:null;r.setAttribute(w,"active"),r.setAttribute("data-styled-version","5.3.11");var a=L();return a&&r.setAttribute("nonce",a),o.insertBefore(r,i),r},R=function(){function e(e){var t=this.element=P(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,o=0,r=t.length;o=0){var o=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(o,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(u+=e+",")})),r+=""+s+c+'{content:"'+u+'"}/*!sc*/\n'}}}return r}(this)},e}(),H=/(a)(d)/gi,G=function(e){return String.fromCharCode(e+(e>25?39:97))};function W(e){var t,o="";for(t=Math.abs(e);t>52;t=t/52|0)o=G(t%52)+o;return(G(t%52)+o).replace(H,"$1-$2")}var Z=function(e,t){for(var o=t.length;o;)e=33*e^t.charCodeAt(--o);return e},V=function(e){return Z(5381,e)};function K(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var s=o(i,"."+a,void 0,r);t.insertRules(r,a,s)}n.push(a),this.staticRulesId=a}else{for(var c=this.rules.length,u=Z(this.baseHash,o.hash),l="",m=0;m>>0);if(!t.hasNameForId(r,p)){var g=o(l,"."+p,void 0,r);t.insertRules(r,p,g)}n.push(p)}}return n.join(" ")},e}(),$=/^\s*\/\/.*$/gm,ee=[":","[",".","#"];function te(e){var t,o,r,n,i=void 0===e?b:e,a=i.options,s=void 0===a?b:a,u=i.plugins,l=void 0===u?g:u,m=new c.a(s),f=[],d=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(o,r,n,i,a,s,c,u,l,m){switch(o){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(n[0]+r),"";default:return r+(0===m?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),h=function(e,r,i){return 0===r&&-1!==ee.indexOf(i[o.length])||i.match(n)?e:"."+t};function p(e,i,a,s){void 0===s&&(s="&");var c=e.replace($,""),u=i&&a?a+" "+i+" { "+c+" }":c;return t=s,o=i,r=new RegExp("\\"+o+"\\b","g"),n=new RegExp("(\\"+o+"\\b){2,}"),m(a||!i?"":i,u)}return m.use([].concat(l,[function(e,t,n){2===e&&n.length&&n[0].lastIndexOf(o)>0&&(n[0]=n[0].replace(r,h))},d,function(e){if(-2===e){var t=f;return f=[],t}}])),p.hash=l.length?l.reduce((function(e,t){return t.name||M(15),Z(e,t.name)}),5381).toString():"",p}var oe=i.a.createContext(),re=(oe.Consumer,i.a.createContext()),ne=(re.Consumer,new Y),ie=te();function ae(){return Object(n.useContext)(oe)||ne}function se(){return Object(n.useContext)(re)||ie}function ce(e){var t=Object(n.useState)(e.stylisPlugins),o=t[0],r=t[1],a=ae(),c=Object(n.useMemo)((function(){var t=a;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),u=Object(n.useMemo)((function(){return te({options:{prefix:!e.disableVendorPrefixes},plugins:o})}),[e.disableVendorPrefixes,o]);return Object(n.useEffect)((function(){s()(o,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),i.a.createElement(oe.Provider,{value:c},i.a.createElement(re.Provider,{value:u},e.children))}var ue=function(){function e(e,t){var o=this;this.inject=function(e,t){void 0===t&&(t=ie);var r=o.name+t.hash;e.hasNameForId(o.id,r)||e.insertRules(o.id,r,t(o.rules,r,"@keyframes"))},this.toString=function(){return M(12,String(o.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=ie),this.name+e.hash},e}(),le=/([A-Z])/,me=/([A-Z])/g,fe=/^ms-/,de=function(e){return"-"+e.toLowerCase()};function he(e){return le.test(e)?e.replace(me,de).replace(fe,"-ms-"):e}var pe=function(e){return null==e||!1===e||""===e};function ge(e,t,o,r){if(Array.isArray(e)){for(var n,i=[],a=0,s=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,we=/(^-|-$)/g;function xe(e){return e.replace(ke,"-").replace(we,"")}var ze=function(e){return W(V(e)>>>0)};function je(e){return"string"==typeof e&&!0}var Me=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Ae=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function qe(e,t,o){var r=e[o];Me(t)&&Me(r)?Ie(r,t):e[o]=t}function Ie(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r=0||(n[o]=e[o]);return n}(t,["componentId"]),i=r&&r+"-"+(je(e)?e:xe(v(e)));return Ne(e,d({},n,{attrs:x,componentId:i}),o)},Object.defineProperty(j,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Ie({},e.defaultProps,t):t}}),Object.defineProperty(j,"toString",{value:function(){return"."+j.styledComponentId}}),a&&f()(j,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),j}var _e=function(e){return function e(t,o,n){if(void 0===n&&(n=b),!Object(r.isValidElementType)(o))return M(1,String(o));var i=function(){return t(o,n,ye.apply(void 0,arguments))};return i.withConfig=function(r){return e(t,o,d({},n,{},r))},i.attrs=function(r){return e(t,o,d({},n,{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},i}(Ne,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){_e[e]=_e(e)}));var Te=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=K(e),Y.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,o,r){var n=r(ge(this.rules,t,o,r).join(""),""),i=this.componentId+e;o.insertRules(i,i,n)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,o,r){e>2&&Y.registerId(this.componentId+e),this.removeStyles(e,o),this.createStyles(e,t,o,r)},e}();function Oe(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r"+t+""},this.getStyleTags=function(){return e.sealed?M(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return M(2);var o=((t={})[w]="",t["data-styled-version"]="5.3.11",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=L();return r&&(o.nonce=r),[i.a.createElement("style",d({},o,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Y({isServer:!0}),this.sealed=!1}var t=e.prototype;t.collectStyles=function(e){return this.sealed?M(2):i.a.createElement(ce,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return M(3)}}();t.c=_e}).call(this,o(27))},function(e,t,o){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}o.d(t,"a",(function(){return r}))},function(e,t,o){"use strict";o.d(t,"a",(function(){return i}));var r=o(123);function n(e,t){for(var o=0;o=0;r--){var n=t[r](e);if(n)return n}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+o+" argument when connecting component "+r.wrappedComponentName+".")}}function F(e,t){return e===t}function Q(e){var t=void 0===e?{}:e,o=t.connectHOC,r=void 0===o?A:o,n=t.mapStateToPropsFactories,i=void 0===n?T:n,a=t.mapDispatchToPropsFactories,s=void 0===a?_:a,c=t.mergePropsFactories,u=void 0===c?C:c,l=t.selectorFactory,m=void 0===l?R:l;return function(e,t,o,n){void 0===n&&(n={});var a=n,c=a.pure,l=void 0===c||c,h=a.areStatesEqual,p=void 0===h?F:h,g=a.areOwnPropsEqual,b=void 0===g?I:g,y=a.areStatePropsEqual,v=void 0===y?I:y,k=a.areMergedPropsEqual,w=void 0===k?I:k,x=Object(d.a)(a,B),z=U(e,i,"mapStateToProps"),j=U(t,s,"mapDispatchToProps"),M=U(o,u,"mergeProps");return r(m,Object(f.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:z,initMapDispatchToProps:j,initMergeProps:M,pure:l,areStatesEqual:p,areOwnPropsEqual:b,areStatePropsEqual:v,areMergedPropsEqual:w},x))}}var Y=Q();function H(){return Object(r.useContext)(i)}function G(e){void 0===e&&(e=i);var t=e===i?H:function(){return Object(r.useContext)(e)};return function(){return t().store}}var W=G();function Z(e){void 0===e&&(e=i);var t=e===i?W:G(e);return function(){return t().dispatch}}var V=Z(),K=function(e,t){return e===t};function J(e){void 0===e&&(e=i);var t=e===i?H:function(){return Object(r.useContext)(e)};return function(e,o){void 0===o&&(o=K);var n=t(),i=function(e,t,o,n){var i,a=Object(r.useReducer)((function(e){return e+1}),0)[1],s=Object(r.useMemo)((function(){return u(o,n)}),[o,n]),c=Object(r.useRef)(),m=Object(r.useRef)(),f=Object(r.useRef)(),d=Object(r.useRef)(),h=o.getState();try{if(e!==m.current||h!==f.current||c.current){var p=e(h);i=void 0!==d.current&&t(p,d.current)?d.current:p}else i=d.current}catch(g){throw c.current&&(g.message+="\nThe error may be correlated with this previous error:\n"+c.current.stack+"\n\n"),g}return l((function(){m.current=e,f.current=h,d.current=i,c.current=void 0})),l((function(){function e(){try{var e=o.getState();if(e===f.current)return;var r=m.current(e);if(t(r,d.current))return;d.current=r,f.current=e}catch(g){c.current=g}a()}return s.onStateChange=e,s.trySubscribe(),e(),function(){return s.tryUnsubscribe()}}),[o,s]),i}(e,o,n.store,n.subscription);return Object(r.useDebugValue)(i),i}}var X,$=J(),ee=o(52);X=ee.unstable_batchedUpdates,a=X},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,n=o(3),i=(r=n)&&"object"===typeof r&&"default"in r?r.default:r,a=o(330),s=new a,c=s.getBrowser(),u=s.getCPU(),l=s.getDevice(),m=s.getEngine(),f=s.getOS(),d=s.getUA(),h=function(e){return s.setUA(e)},p=function(e){if(e){var t=new a(e);return{UA:t,browser:t.getBrowser(),cpu:t.getCPU(),device:t.getDevice(),engine:t.getEngine(),os:t.getOS(),ua:t.getUA(),setUserAgent:function(e){return t.setUA(e)}}}console.error("No userAgent string was provided")},g=Object.freeze({ClientUAInstance:s,browser:c,cpu:u,device:l,engine:m,os:f,ua:d,setUa:h,parseUserAgent:p});function b(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function y(e){return y="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function v(e,t){for(var o=0;o=0||(n[o]=e[o]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function M(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var r,n,i=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(c){s=!0,n=c}finally{try{a||null==o.return||o.return()}finally{if(s)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return q(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return q(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o1&&void 0!==arguments[1]?arguments[1]:"none")},R=function(){return!("undefined"===typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},B=function(e){var t=R();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)},U=function(e,t,o,r){return function(e){for(var t=1;t1)&&!window.MSStream},Me=function(){return B("iPad")},Ae=function(){return B("iPhone")},qe=function(){return B("iPod")},Ie=function(e){return P(e)};function Ee(e){var t=e||g,o=t.device,r=t.browser,n=t.os,i=t.engine,a=t.ua;return{isSmartTV:H(o),isConsole:Z(o),isWearable:W(o),isEmbedded:V(o),isMobileSafari:fe(r)||Me(),isChromium:ce(r),isMobile:Y(o)||Me(),isMobileOnly:F(o),isTablet:Q(o)||Me(),isBrowser:G(o),isDesktop:G(o),isAndroid:$(n),isWinPhone:oe(n),isIOS:re(n)||Me(),isChrome:ae(r),isFirefox:se(r),isSafari:me(r),isOpera:de(r),isIE:he(r),osVersion:ne(n),osName:ie(n),fullBrowserVersion:be(r),browserVersion:ye(r),browserName:ve(r),mobileVendor:K(o),mobileModel:J(o),engineName:ke(i),engineVersion:we(i),getUA:Ie(a),isEdge:ue(r)||ze(a),isYandex:le(r),deviceType:X(o),isIOS13:je(),isIPad13:Me(),isIPhone13:Ae(),isIPod13:qe(),isElectron:xe(),isEdgeChromium:ze(a),isLegacyEdge:ue(r)&&!ze(a),isWindows:ee(n),isMacOs:te(n),isMIUI:pe(r),isSamsungBrowser:ge(r)}}var Se=H(l),Ne=Z(l),_e=W(l),Te=V(l),Oe=fe(c)||Me(),Ce=ce(c),De=Y(l)||Me(),Le=F(l),Pe=Q(l)||Me(),Re=G(l),Be=G(l),Ue=$(f),Fe=oe(f),Qe=re(f)||Me(),Ye=ae(c),He=se(c),Ge=me(c),We=de(c),Ze=he(c),Ve=ne(f),Ke=ie(f),Je=be(c),Xe=ye(c),$e=ve(c),et=K(l),tt=J(l),ot=ke(m),rt=we(m),nt=Ie(d),it=ue(c)||ze(d),at=le(c),st=X(l),ct=je(),ut=Me(),lt=Ae(),mt=qe(),ft=xe(),dt=ze(d),ht=ue(c)&&!ze(d),pt=ee(f),gt=te(f),bt=pe(c),yt=ge(c);function vt(e){var t=e||window.navigator.userAgent;return p(t)}t.AndroidView=function(e){var t=e.renderWithFragment,o=e.children,r=j(e,["renderWithFragment","children"]);return Ue?t?i.createElement(n.Fragment,null,o):i.createElement("div",r,o):null},t.BrowserTypes=C,t.BrowserView=function(e){var t=e.renderWithFragment,o=e.children,r=j(e,["renderWithFragment","children"]);return Re?t?i.createElement(n.Fragment,null,o):i.createElement("div",r,o):null},t.ConsoleView=function(e){var t=e.renderWithFragment,o=e.children,r=j(e,["renderWithFragment","children"]);return Ne?t?i.createElement(n.Fragment,null,o):i.createElement("div",r,o):null},t.CustomView=function(e){var t=e.renderWithFragment,o=e.children,r=(e.viewClassName,e.style,e.condition),a=j(e,["renderWithFragment","children","viewClassName","style","condition"]);return r?t?i.createElement(n.Fragment,null,o):i.createElement("div",a,o):null},t.IEView=function(e){var t=e.renderWithFragment,o=e.children,r=j(e,["renderWithFragment","children"]);return Ze?t?i.createElement(n.Fragment,null,o):i.createElement("div",r,o):null},t.IOSView=function(e){var t=e.renderWithFragment,o=e.children,r=j(e,["renderWithFragment","children"]);return Qe?t?i.createElement(n.Fragment,null,o):i.createElement("div",r,o):null},t.MobileOnlyView=function(e){var t=e.renderWithFragment,o=e.children,r=(e.viewClassName,e.style,j(e,["renderWithFragment","children","viewClassName","style"]));return Le?t?i.createElement(n.Fragment,null,o):i.createElement("div",r,o):null},t.MobileView=function(e){var t=e.renderWithFragment,o=e.children,r=j(e,["renderWithFragment","children"]);return De?t?i.createElement(n.Fragment,null,o):i.createElement("div",r,o):null},t.OsTypes=D,t.SmartTVView=function(e){var t=e.renderWithFragment,o=e.children,r=j(e,["renderWithFragment","children"]);return Se?t?i.createElement(n.Fragment,null,o):i.createElement("div",r,o):null},t.TabletView=function(e){var t=e.renderWithFragment,o=e.children,r=j(e,["renderWithFragment","children"]);return Pe?t?i.createElement(n.Fragment,null,o):i.createElement("div",r,o):null},t.WearableView=function(e){var t=e.renderWithFragment,o=e.children,r=j(e,["renderWithFragment","children"]);return _e?t?i.createElement(n.Fragment,null,o):i.createElement("div",r,o):null},t.WinPhoneView=function(e){var t=e.renderWithFragment,o=e.children,r=j(e,["renderWithFragment","children"]);return Fe?t?i.createElement(n.Fragment,null,o):i.createElement("div",r,o):null},t.browserName=$e,t.browserVersion=Xe,t.deviceDetect=function(e){var t=e?p(e):g,o=t.device,r=t.browser,n=t.engine,i=t.os,a=t.ua,s=function(e){switch(e){case I:return{isMobile:!0};case E:return{isTablet:!0};case S:return{isSmartTV:!0};case N:return{isConsole:!0};case _:return{isWearable:!0};case O:return{isBrowser:!0};case T:return{isEmbedded:!0};default:return L}}(o.type),c=s.isBrowser,u=s.isMobile,l=s.isTablet,m=s.isSmartTV,f=s.isConsole,d=s.isWearable,h=s.isEmbedded;return c?function(e,t,o,r,n){return{isBrowser:e,browserMajorVersion:P(t.major),browserFullVersion:P(t.version),browserName:P(t.name),engineName:P(o.name),engineVersion:P(o.version),osName:P(r.name),osVersion:P(r.version),userAgent:P(n)}}(c,r,n,i,a):m?function(e,t,o,r){return{isSmartTV:e,engineName:P(t.name),engineVersion:P(t.version),osName:P(o.name),osVersion:P(o.version),userAgent:P(r)}}(m,n,i,a):f?function(e,t,o,r){return{isConsole:e,engineName:P(t.name),engineVersion:P(t.version),osName:P(o.name),osVersion:P(o.version),userAgent:P(r)}}(f,n,i,a):u||l?U(s,o,i,a):d?function(e,t,o,r){return{isWearable:e,engineName:P(t.name),engineVersion:P(t.version),osName:P(o.name),osVersion:P(o.version),userAgent:P(r)}}(d,n,i,a):h?function(e,t,o,r,n){return{isEmbedded:e,vendor:P(t.vendor),model:P(t.model),engineName:P(o.name),engineVersion:P(o.version),osName:P(r.name),osVersion:P(r.version),userAgent:P(n)}}(h,o,n,i,a):void 0},t.deviceType=st,t.engineName=ot,t.engineVersion=rt,t.fullBrowserVersion=Je,t.getSelectorsByUserAgent=function(e){if(e&&"string"===typeof e){var t=p(e);return Ee({device:t.device,browser:t.browser,os:t.os,engine:t.engine,ua:t.ua})}console.error("No valid user agent string was provided")},t.getUA=nt,t.isAndroid=Ue,t.isBrowser=Re,t.isChrome=Ye,t.isChromium=Ce,t.isConsole=Ne,t.isDesktop=Be,t.isEdge=it,t.isEdgeChromium=dt,t.isElectron=ft,t.isEmbedded=Te,t.isFirefox=He,t.isIE=Ze,t.isIOS=Qe,t.isIOS13=ct,t.isIPad13=ut,t.isIPhone13=lt,t.isIPod13=mt,t.isLegacyEdge=ht,t.isMIUI=bt,t.isMacOs=gt,t.isMobile=De,t.isMobileOnly=Le,t.isMobileSafari=Oe,t.isOpera=We,t.isSafari=Ge,t.isSamsungBrowser=yt,t.isSmartTV=Se,t.isTablet=Pe,t.isWearable=_e,t.isWinPhone=Fe,t.isWindows=pt,t.isYandex=at,t.mobileModel=tt,t.mobileVendor=et,t.osName=Ke,t.osVersion=Ve,t.parseUserAgent=p,t.setUserAgent=function(e){return h(e)},t.useDeviceData=vt,t.useDeviceSelectors=function(e){var t=vt(e||window.navigator.userAgent);return[Ee(t),t]},t.useMobileOrientation=function(){var e=A(n.useState((function(){var e=window.innerWidth>window.innerHeight?90:0;return{isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"}})),2),t=e[0],o=e[1],r=n.useCallback((function(){var e=window.innerWidth>window.innerHeight?90:0,r={isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"};t.orientation!==r.orientation&&o(r)}),[t.orientation]);return n.useEffect((function(){return void 0!==("undefined"===typeof window?"undefined":y(window))&&De&&(r(),window.addEventListener("load",r,!1),window.addEventListener("resize",r,!1)),function(){window.removeEventListener("resize",r,!1),window.removeEventListener("load",r,!1)}}),[r]),t},t.withOrientationChange=function(e){return function(t){function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return M(e)}(this,x(o).call(this,e))).isEventListenerAdded=!1,t.handleOrientationChange=t.handleOrientationChange.bind(M(t)),t.onOrientationChange=t.onOrientationChange.bind(M(t)),t.onPageLoad=t.onPageLoad.bind(M(t)),t.state={isLandscape:!1,isPortrait:!1},t}var r,n,a;return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&z(e,t)}(o,t),r=o,(n=[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var e=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:0===e,isLandscape:90===e})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){void 0!==("undefined"===typeof window?"undefined":y(window))&&De&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return i.createElement(e,w({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}])&&v(r.prototype,n),a&&v(r,a),o}(i.Component)}},function(e,t,o){"use strict";o.d(t,"g",(function(){return r.detectEnv})),o.d(t,"t",(function(){return r.isMobile})),o.d(t,"o",(function(){return r.isBrowser})),o.d(t,"j",(function(){return r.getFromWindow})),o.d(t,"l",(function(){return r.getLocation})),o.d(t,"i",(function(){return r.getClientMeta})),o.d(t,"D",(function(){return r.setLocal})),o.d(t,"k",(function(){return r.getLocal})),o.d(t,"C",(function(){return r.removeLocal})),o.d(t,"x",(function(){return r.mobileLinkChoiceKey})),o.d(t,"E",(function(){return i})),o.d(t,"b",(function(){return l})),o.d(t,"c",(function(){return m})),o.d(t,"d",(function(){return f})),o.d(t,"e",(function(){return d})),o.d(t,"f",(function(){return h})),o.d(t,"y",(function(){return E})),o.d(t,"z",(function(){return S})),o.d(t,"B",(function(){return b})),o.d(t,"F",(function(){return y})),o.d(t,"n",(function(){return v})),o.d(t,"h",(function(){return N})),o.d(t,"w",(function(){return D})),o.d(t,"A",(function(){return L})),o.d(t,"m",(function(){return T})),o.d(t,"a",(function(){return O})),o.d(t,"q",(function(){return w})),o.d(t,"s",(function(){return x})),o.d(t,"r",(function(){return z})),o.d(t,"p",(function(){return j})),o.d(t,"u",(function(){return M})),o.d(t,"v",(function(){return A}));var r=o(157),n=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],i=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],a={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"},s=o(36),c=o.n(s),u=o(17);function l(e){return u.arrayToBuffer(new Uint8Array(e))}function m(e,t){return u.arrayToHex(new Uint8Array(e),!t)}function f(e){return u.bufferToArray(e).buffer}function d(e){return u.hexToArray(e).buffer}function h(e,t){var o=u.removeHexPrefix(u.sanitizeHex(new c.a(e).toString(16)));return t?o:u.addHexPrefix(o)}var p=o(122);function g(e){return u.sanitizeHex(e)}var b=o(280).payloadId;function y(){return function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t}()}function v(e,t){var o,r=function(e,t){var o,r=a[e];return r&&(o="https://".concat(r,".infura.io/v3/").concat(t)),o}(e,t.infuraId);return t.custom&&t.custom[e]?o=t.custom[e]:r&&(o=r),o}function k(e,t){return u.isHexString(e,t)}function w(e){return"undefined"!==typeof e.method}function x(e){return"undefined"!==typeof e.result}function z(e){return"undefined"!==typeof e.error}function j(e){return"undefined"!==typeof e.event}function M(e){return n.includes(e)||e.startsWith("wc_")}function A(e){return!!e.method.startsWith("wc_")||!i.includes(e.method)}function q(e){e=Object(u.removeHexPrefix)(e.toLowerCase());for(var t,o=Object(u.removeHexPrefix)(Object(p.keccak_256)((t=e,u.utf8ToBuffer(t)))),r="",n=0;n7?r+=e[n].toUpperCase():r+=e[n];return Object(u.addHexPrefix)(r)}var I=function(e){return!!e&&("0x"===e.toLowerCase().substring(0,2)&&(!!/^(0x)?[0-9a-f]{40}$/i.test(e)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(e)&&!/^(0x)?[0-9A-F]{40}$/.test(e))||e===q(e))))};function E(e){var t,o,r;return(r=e)&&r.length&&!k(e[0])&&(e[0]=(t=e[0],u.utf8ToHex(t,!o))),e}function S(e){if("undefined"!==typeof e.type&&"0"!==e.type)return e;if("undefined"===typeof e.from||!I(e.from))throw new Error("Transaction object must include a valid 'from' value.");function t(e){var t,o=e;return("number"===typeof e||"string"===typeof e&&!function(e){return""===e||"string"===typeof e&&""===e.trim()}(e))&&(k(e)?"string"===typeof e&&(o=g(e)):o=h(e)),"string"===typeof o&&(t=o,o=u.removeHexLeadingZeros(u.addHexPrefix(t))),o}var o={from:g(e.from),to:"undefined"===typeof e.to?void 0:g(e.to),gasPrice:"undefined"===typeof e.gasPrice?"":t(e.gasPrice),gas:"undefined"===typeof e.gas?"undefined"===typeof e.gasLimit?"":t(e.gasLimit):t(e.gas),value:"undefined"===typeof e.value?"":t(e.value),nonce:"undefined"===typeof e.nonce?"":t(e.nonce),data:"undefined"===typeof e.data?"":g(e.data)||"0x"},r=["gasPrice","gas","value","nonce"];return Object.keys(o).forEach((function(e){("undefined"===typeof o[e]||"string"===typeof o[e]&&!o[e].trim().length)&&r.includes(e)&&delete o[e]})),o}o(2),o(11);function N(e){var t=e.message||"Failed or Rejected Request",o=-32e3;if(e&&!e.code)switch(t){case"Parse error":o=-32700;break;case"Invalid request":o=-32600;break;case"Method not found":o=-32601;break;case"Invalid params":o=-32602;break;case"Internal error":o=-32603;break;default:o=-32e3}var r={code:o,message:t};return e.data&&(r.data=e.data),r}var _=o(168);function T(e){var t=-1!==e.indexOf("?")?e.indexOf("?"):void 0;return"undefined"!==typeof t?e.substr(t):""}function O(e,t){var o=C(e);return e=function(e){return _.stringify(e)}(o=Object.assign(Object.assign({},o),t))}function C(e){return _.parse(e)}function D(e){return"undefined"!==typeof e.bridge}function L(e){var t=e.indexOf(":"),o=-1!==e.indexOf("?")?e.indexOf("?"):void 0,r=e.substring(0,t);var n=function(e){var t=e.split("@");return{handshakeTopic:t[0],version:parseInt(t[1],10)}}(e.substring(t+1,o));var i=function(e){var t=C(e);return{key:t.key||"",bridge:t.bridge||""}}("undefined"!==typeof o?e.substr(o):"");return Object.assign(Object.assign({protocol:r},n),i)}},function(e,t,o){"use strict";o.r(t),function(e){o.d(t,"bufferToArray",(function(){return g})),o.d(t,"bufferToHex",(function(){return b})),o.d(t,"bufferToUtf8",(function(){return y})),o.d(t,"bufferToNumber",(function(){return v})),o.d(t,"bufferToBinary",(function(){return k})),o.d(t,"arrayToBuffer",(function(){return w})),o.d(t,"arrayToHex",(function(){return x})),o.d(t,"arrayToUtf8",(function(){return z})),o.d(t,"arrayToNumber",(function(){return j})),o.d(t,"arrayToBinary",(function(){return M})),o.d(t,"hexToBuffer",(function(){return A})),o.d(t,"hexToArray",(function(){return q})),o.d(t,"hexToUtf8",(function(){return I})),o.d(t,"hexToNumber",(function(){return E})),o.d(t,"hexToBinary",(function(){return S})),o.d(t,"utf8ToBuffer",(function(){return N})),o.d(t,"utf8ToArray",(function(){return _})),o.d(t,"utf8ToHex",(function(){return T})),o.d(t,"utf8ToNumber",(function(){return O})),o.d(t,"utf8ToBinary",(function(){return C})),o.d(t,"numberToBuffer",(function(){return D})),o.d(t,"numberToArray",(function(){return L})),o.d(t,"numberToHex",(function(){return P})),o.d(t,"numberToUtf8",(function(){return R})),o.d(t,"numberToBinary",(function(){return B})),o.d(t,"binaryToBuffer",(function(){return U})),o.d(t,"binaryToArray",(function(){return F})),o.d(t,"binaryToHex",(function(){return Q})),o.d(t,"binaryToUtf8",(function(){return Y})),o.d(t,"binaryToNumber",(function(){return H})),o.d(t,"isBinaryString",(function(){return G})),o.d(t,"isHexString",(function(){return W})),o.d(t,"isBuffer",(function(){return Z})),o.d(t,"isTypedArray",(function(){return V})),o.d(t,"isArrayBuffer",(function(){return K})),o.d(t,"getType",(function(){return J})),o.d(t,"getEncoding",(function(){return X})),o.d(t,"concatBuffers",(function(){return $})),o.d(t,"concatArrays",(function(){return ee})),o.d(t,"trimLeft",(function(){return te})),o.d(t,"trimRight",(function(){return oe})),o.d(t,"calcByteLength",(function(){return re})),o.d(t,"splitBytes",(function(){return ne})),o.d(t,"swapBytes",(function(){return ie})),o.d(t,"swapHex",(function(){return ae})),o.d(t,"sanitizeBytes",(function(){return se})),o.d(t,"padLeft",(function(){return ce})),o.d(t,"padRight",(function(){return ue})),o.d(t,"removeHexPrefix",(function(){return le})),o.d(t,"addHexPrefix",(function(){return me})),o.d(t,"sanitizeHex",(function(){return fe})),o.d(t,"removeHexLeadingZeros",(function(){return de}));var r=o(24),n=o(158),i=o.n(n),a=o(279),s=o.n(a),c="hex",u="utf8",l="binary",m="buffer",f="array",d="typed-array",h="array-buffer",p="0";function g(e){return new Uint8Array(e)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=e.toString(c);return t?me(o):o}function y(e){return e.toString(u)}function v(e){return e.readUIntBE(0,e.length)}function k(e){return M(g(e))}function w(e){return s()(e)}function x(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return b(w(e),t)}function z(e){return y(w(e))}function j(e){return v(w(e))}function M(e){return Array.from(e).map(B).join("")}function A(t){return e.from(le(t),c)}function q(e){return g(A(e))}function I(e){return y(A(e))}function E(e){return j(q(e))}function S(e){return M(q(e))}function N(t){return e.from(t,u)}function _(e){return g(N(e))}function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return b(N(e),t)}function O(e){var t=parseInt(e,10);return function(e,t){if(!e)throw new Error(t)}(!function(e){return"undefined"===typeof e}(t),"Number can only safely store up to 53 bits"),t}function C(e){return M(_(e))}function D(e){return U(B(e))}function L(e){return F(B(e))}function P(e,t){return Q(B(e),t)}function R(e){return"".concat(e)}function B(e){return se((e>>>0).toString(2))}function U(e){return w(F(e))}function F(e){return new Uint8Array(ne(e).map((function(e){return parseInt(e,2)})))}function Q(e,t){return x(F(e),t)}function Y(e){return z(F(e))}function H(e){return j(F(e))}function G(e){return!("string"!==typeof e||!new RegExp(/^[01]+$/).test(e))&&e.length%8===0}function W(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}function Z(t){return e.isBuffer(t)}function V(e){return i.a.strict(e)&&!Z(e)}function K(e){return!V(e)&&!Z(e)&&"undefined"!==typeof e.byteLength}function J(e){return Z(e)?m:V(e)?d:K(e)?h:Array.isArray(e)?f:typeof e}function X(e){return G(e)?l:W(e)?c:u}function $(){for(var t=arguments.length,o=new Array(t),r=0;r0&&(e=e.slice(o)),e}function oe(e,t){return e.slice(0,t)}function re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,o=e%t;return o?(e-o)/t*t+t:e}function ne(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,o=se(e).match(new RegExp(".{".concat(t,"}"),"gi"));return Array.from(o||[])}function ie(e){return ne(e).map(he).join("")}function ae(e){return Q(ie(S(e)))}function se(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p;return ce(e,re(e.length,t),o)}function ce(e,t){return pe(e,t,!0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:p)}function ue(e,t){return pe(e,t,!1,arguments.length>2&&void 0!==arguments[2]?arguments[2]:p)}function le(e){return e.replace(/^0x/,"")}function me(e){return e.startsWith("0x")?e:"0x".concat(e)}function fe(e){return(e=se(e=le(e),2))&&(e=me(e)),e}function de(e){var t=e.startsWith("0x");return e=(e=le(e)).startsWith(p)?e.substring(1):e,t?me(e):e}function he(e){return e.split("").reverse().join("")}function pe(e,t,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:p,n=t-e.length,i=e;if(n>0){var a=r.repeat(n);i=o?a+e:e+a}return i}}.call(this,o(20).Buffer)},function(e,t,o){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}o.d(t,"a",(function(){return r}))},function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));var r=o(88);function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r,n,i,a,s=[],c=!0,u=!1;try{if(i=(o=o.call(e)).next,0===t){if(Object(o)!==o)return;c=!1}else for(;!(c=(r=i.call(o)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(l){u=!0,n=l}finally{try{if(!c&&null!=o.return&&(a=o.return(),Object(a)!==a))return}finally{if(u)throw n}}return s}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,o){"use strict";(function(e){var r=o(390),n=o(391),i=o(392);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(c.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var o=e.length;if(0===o)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*o;case"hex":return o>>>1;case"base64":return F(e).length;default:if(r)return U(e).length;t=(""+t).toLowerCase(),r=!0}}function p(e,t,o){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===o||o>this.length)&&(o=this.length),o<=0)return"";if((o>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,o);case"utf8":case"utf-8":return A(this,t,o);case"ascii":return I(this,t,o);case"latin1":case"binary":return E(this,t,o);case"base64":return M(this,t,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,o);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,o){var r=e[t];e[t]=e[o],e[o]=r}function b(e,t,o,r,n){if(0===e.length)return-1;if("string"===typeof o?(r=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),o=+o,isNaN(o)&&(o=n?0:e.length-1),o<0&&(o=e.length+o),o>=e.length){if(n)return-1;o=e.length-1}else if(o<0){if(!n)return-1;o=0}if("string"===typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:y(e,t,o,r,n);if("number"===typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,o):Uint8Array.prototype.lastIndexOf.call(e,t,o):y(e,[t],o,r,n);throw new TypeError("val must be string, number or Buffer")}function y(e,t,o,r,n){var i,a=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,o/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var l=-1;for(i=o;is&&(o=s-c),i=o;i>=0;i--){for(var m=!0,f=0;fn&&(r=n):r=n;var i=t.length;if(i%2!==0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,n=o%256,i.push(n),i.push(r);return i}(t,e.length-o),e,o,r)}function M(e,t,o){return 0===t&&o===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,o))}function A(e,t,o){o=Math.min(e.length,o);for(var r=[],n=t;n239?4:u>223?3:u>191?2:1;if(n+m<=o)switch(m){case 1:u<128&&(l=u);break;case 2:128===(192&(i=e[n+1]))&&(c=(31&u)<<6|63&i)>127&&(l=c);break;case 3:i=e[n+1],a=e[n+2],128===(192&i)&&128===(192&a)&&(c=(15&u)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:i=e[n+1],a=e[n+2],s=e[n+3],128===(192&i)&&128===(192&a)&&128===(192&s)&&(c=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(l=c)}null===l?(l=65533,m=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),n+=m}return function(e){var t=e.length;if(t<=q)return String.fromCharCode.apply(String,e);var o="",r=0;for(;r0&&(e=this.toString("hex",0,o).match(/.{2}/g).join(" "),this.length>o&&(e+=" ... ")),""},c.prototype.compare=function(e,t,o,r,n){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===o&&(o=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||o>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=o)return 0;if(r>=n)return-1;if(t>=o)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(r>>>=0),a=(o>>>=0)-(t>>>=0),s=Math.min(i,a),u=this.slice(r,n),l=e.slice(t,o),m=0;mn)&&(o=n),e.length>0&&(o<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return v(this,e,t,o);case"utf8":case"utf-8":return k(this,e,t,o);case"ascii":return w(this,e,t,o);case"latin1":case"binary":return x(this,e,t,o);case"base64":return z(this,e,t,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,o);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var q=4096;function I(e,t,o){var r="";o=Math.min(e.length,o);for(var n=t;nr)&&(o=r);for(var n="",i=t;io)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,o,r,n,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function O(e,t,o,r){t<0&&(t=65535+t+1);for(var n=0,i=Math.min(e.length-o,2);n>>8*(r?n:1-n)}function C(e,t,o,r){t<0&&(t=4294967295+t+1);for(var n=0,i=Math.min(e.length-o,4);n>>8*(r?n:3-n)&255}function D(e,t,o,r,n,i){if(o+r>e.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function L(e,t,o,r,i){return i||D(e,0,o,4),n.write(e,t,o,r,23,4),o+4}function P(e,t,o,r,i){return i||D(e,0,o,8),n.write(e,t,o,r,52,8),o+8}c.prototype.slice=function(e,t){var o,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(n*=256);)r+=this[e+--t]*n;return r},c.prototype.readUInt8=function(e,t){return t||_(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||_(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||_(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||_(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||_(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,o){e|=0,t|=0,o||_(e,t,this.length);for(var r=this[e],n=1,i=0;++i=(n*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,o){e|=0,t|=0,o||_(e,t,this.length);for(var r=t,n=1,i=this[e+--r];r>0&&(n*=256);)i+=this[e+--r]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||_(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||_(e,2,this.length);var o=this[e]|this[e+1]<<8;return 32768&o?4294901760|o:o},c.prototype.readInt16BE=function(e,t){t||_(e,2,this.length);var o=this[e+1]|this[e]<<8;return 32768&o?4294901760|o:o},c.prototype.readInt32LE=function(e,t){return t||_(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||_(e,4,this.length),n.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||_(e,4,this.length),n.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||_(e,8,this.length),n.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||_(e,8,this.length),n.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,o,r){(e=+e,t|=0,o|=0,r)||T(this,e,t,o,Math.pow(2,8*o)-1,0);var n=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+n]=e/i&255;return t+o},c.prototype.writeUInt8=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,o,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*o-1);T(this,e,t,o,n-1,-n)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+o},c.prototype.writeIntBE=function(e,t,o,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*o-1);T(this,e,t,o,n-1,-n)}var i=o-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+o},c.prototype.writeInt8=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,o){return L(this,e,t,!0,o)},c.prototype.writeFloatBE=function(e,t,o){return L(this,e,t,!1,o)},c.prototype.writeDoubleLE=function(e,t,o){return P(this,e,t,!0,o)},c.prototype.writeDoubleBE=function(e,t,o){return P(this,e,t,!1,o)},c.prototype.copy=function(e,t,o,r){if(o||(o=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--n)e[n+t]=this[n+o];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,o=void 0===o?this.length:o>>>0,e||(e=0),"number"===typeof e)for(i=t;i55295&&o<57344){if(!n){if(o>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}n=o;continue}if(o<56320){(t-=3)>-1&&i.push(239,191,189),n=o;continue}o=65536+(n-55296<<10|o-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,o<128){if((t-=1)<0)break;i.push(o)}else if(o<2048){if((t-=2)<0)break;i.push(o>>6|192,63&o|128)}else if(o<65536){if((t-=3)<0)break;i.push(o>>12|224,o>>6&63|128,63&o|128)}else{if(!(o<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}}return i}function F(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(R,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function Q(e,t,o,r){for(var n=0;n=t.length||n>=e.length);++n)t[n+o]=e[n];return n}}).call(this,o(29))},function(e,t,o){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var o=function(){};o.prototype=t.prototype,e.prototype=new o,e.prototype.constructor=e}function i(e,t,o){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(o=t,t=10),this._init(e||0,t||10,o||"be"))}var a;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:o(380).Buffer}catch(I){}function s(e,t){var o=e.charCodeAt(t);return o>=48&&o<=57?o-48:o>=65&&o<=70?o-55:o>=97&&o<=102?o-87:void r(!1,"Invalid character in "+e)}function c(e,t,o){var r=s(e,o);return o-1>=t&&(r|=s(e,o-1)<<4),r}function u(e,t,o,n){for(var i=0,a=0,s=Math.min(e.length,o),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,o){if("number"===typeof e)return this._initNumber(e,t,o);if("object"===typeof e)return this._initArray(e,t,o);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===o)for(n=0,i=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,o){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=c(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=n>>>26):i+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=n>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,o){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-o,a=i%r,s=Math.min(i,i-a)+o,c=0,l=o;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=m}catch(I){i.prototype.inspect=m}else i.prototype.inspect=m;function m(){return(this.red?""}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(e,t){var o;if(t=0|t||1,16===(e=e||10)||"hex"===e){o="";for(var n=0,i=0,a=0;a>>24-n&16777215,(n+=2)>=26&&(n-=26,a--),o=0!==i||a!==this.length-1?f[6-c.length]+c+o:c+o}for(0!==i&&(o=i.toString(16)+o);o.length%t!==0;)o="0"+o;return 0!==this.negative&&(o="-"+o),o}if(e===(0|e)&&e>=2&&e<=36){var u=d[e],l=h[e];o="";var m=this.clone();for(m.negative=0;!m.isZero();){var p=m.modrn(l).toString(e);o=(m=m.idivn(l)).isZero()?p+o:f[u-p.length]+p+o}for(this.isZero()&&(o="0"+o);o.length%t!==0;)o="0"+o;return 0!==this.negative&&(o="-"+o),o}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function p(e,t,o){o.negative=t.negative^e.negative;var r=e.length+t.length|0;o.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],a=n*i,s=67108863&a,c=a/67108864|0;o.words[0]=s;for(var u=1;u>>26,m=67108863&c,f=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=f;d++){var h=u-d|0;l+=(a=(n=0|e.words[h])*(i=0|t.words[d])+m)/67108864|0,m=67108863&a}o.words[u]=0|m,c=0|l}return 0!==c?o.words[u]=0|c:o.length--,o._strip()}i.prototype.toArrayLike=function(e,t,o){this._strip();var n=this.byteLength(),i=o||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,n),a},i.prototype._toArrayLikeLE=function(e,t){for(var o=0,r=0,n=0,i=0;n>8&255),o>16&255),6===i?(o>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(o=0&&(e[o--]=a>>8&255),o>=0&&(e[o--]=a>>16&255),6===i?(o>=0&&(e[o--]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(o>=0)for(e[o--]=r;o>=0;)e[o--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,o=0;return t>=4096&&(o+=13,t>>>=13),t>=64&&(o+=7,t>>>=7),t>=8&&(o+=4,t>>>=4),t>=2&&(o+=2,t>>>=2),o+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,o=0;return 0===(8191&t)&&(o+=13,t>>>=13),0===(127&t)&&(o+=7,t>>>=7),0===(15&t)&&(o+=4,t>>>=4),0===(3&t)&&(o+=2,t>>>=2),0===(1&t)&&o++,o},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var o=0;oe.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,o;this.length>e.length?(t=this,o=e):(t=e,o=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),o=e%26;this._expand(t),o>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-o),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var o=e/26|0,n=e%26;return this._expand(o+1),this.words[o]=t?this.words[o]|1<e.length?(o=this,r=e):(o=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=o.length,0!==n)this.words[this.length]=n,this.length++;else if(o!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var o,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(o=this,r=e):(o=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],h=8191&d,p=d>>>13,g=0|a[2],b=8191&g,y=g>>>13,v=0|a[3],k=8191&v,w=v>>>13,x=0|a[4],z=8191&x,j=x>>>13,M=0|a[5],A=8191&M,q=M>>>13,I=0|a[6],E=8191&I,S=I>>>13,N=0|a[7],_=8191&N,T=N>>>13,O=0|a[8],C=8191&O,D=O>>>13,L=0|a[9],P=8191&L,R=L>>>13,B=0|s[0],U=8191&B,F=B>>>13,Q=0|s[1],Y=8191&Q,H=Q>>>13,G=0|s[2],W=8191&G,Z=G>>>13,V=0|s[3],K=8191&V,J=V>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],oe=8191&te,re=te>>>13,ne=0|s[6],ie=8191&ne,ae=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,le=0|s[8],me=8191&le,fe=le>>>13,de=0|s[9],he=8191&de,pe=de>>>13;o.negative=e.negative^t.negative,o.length=19;var ge=(u+(r=Math.imul(m,U))|0)+((8191&(n=(n=Math.imul(m,F))+Math.imul(f,U)|0))<<13)|0;u=((i=Math.imul(f,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(h,U),n=(n=Math.imul(h,F))+Math.imul(p,U)|0,i=Math.imul(p,F);var be=(u+(r=r+Math.imul(m,Y)|0)|0)+((8191&(n=(n=n+Math.imul(m,H)|0)+Math.imul(f,Y)|0))<<13)|0;u=((i=i+Math.imul(f,H)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(b,U),n=(n=Math.imul(b,F))+Math.imul(y,U)|0,i=Math.imul(y,F),r=r+Math.imul(h,Y)|0,n=(n=n+Math.imul(h,H)|0)+Math.imul(p,Y)|0,i=i+Math.imul(p,H)|0;var ye=(u+(r=r+Math.imul(m,W)|0)|0)+((8191&(n=(n=n+Math.imul(m,Z)|0)+Math.imul(f,W)|0))<<13)|0;u=((i=i+Math.imul(f,Z)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(k,U),n=(n=Math.imul(k,F))+Math.imul(w,U)|0,i=Math.imul(w,F),r=r+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(y,Y)|0,i=i+Math.imul(y,H)|0,r=r+Math.imul(h,W)|0,n=(n=n+Math.imul(h,Z)|0)+Math.imul(p,W)|0,i=i+Math.imul(p,Z)|0;var ve=(u+(r=r+Math.imul(m,K)|0)|0)+((8191&(n=(n=n+Math.imul(m,J)|0)+Math.imul(f,K)|0))<<13)|0;u=((i=i+Math.imul(f,J)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(z,U),n=(n=Math.imul(z,F))+Math.imul(j,U)|0,i=Math.imul(j,F),r=r+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,H)|0)+Math.imul(w,Y)|0,i=i+Math.imul(w,H)|0,r=r+Math.imul(b,W)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,Z)|0,r=r+Math.imul(h,K)|0,n=(n=n+Math.imul(h,J)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,J)|0;var ke=(u+(r=r+Math.imul(m,$)|0)|0)+((8191&(n=(n=n+Math.imul(m,ee)|0)+Math.imul(f,$)|0))<<13)|0;u=((i=i+Math.imul(f,ee)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(A,U),n=(n=Math.imul(A,F))+Math.imul(q,U)|0,i=Math.imul(q,F),r=r+Math.imul(z,Y)|0,n=(n=n+Math.imul(z,H)|0)+Math.imul(j,Y)|0,i=i+Math.imul(j,H)|0,r=r+Math.imul(k,W)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(w,W)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(b,K)|0,n=(n=n+Math.imul(b,J)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,J)|0,r=r+Math.imul(h,$)|0,n=(n=n+Math.imul(h,ee)|0)+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0;var we=(u+(r=r+Math.imul(m,oe)|0)|0)+((8191&(n=(n=n+Math.imul(m,re)|0)+Math.imul(f,oe)|0))<<13)|0;u=((i=i+Math.imul(f,re)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,U),n=(n=Math.imul(E,F))+Math.imul(S,U)|0,i=Math.imul(S,F),r=r+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,H)|0)+Math.imul(q,Y)|0,i=i+Math.imul(q,H)|0,r=r+Math.imul(z,W)|0,n=(n=n+Math.imul(z,Z)|0)+Math.imul(j,W)|0,i=i+Math.imul(j,Z)|0,r=r+Math.imul(k,K)|0,n=(n=n+Math.imul(k,J)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,J)|0,r=r+Math.imul(b,$)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,ee)|0,r=r+Math.imul(h,oe)|0,n=(n=n+Math.imul(h,re)|0)+Math.imul(p,oe)|0,i=i+Math.imul(p,re)|0;var xe=(u+(r=r+Math.imul(m,ie)|0)|0)+((8191&(n=(n=n+Math.imul(m,ae)|0)+Math.imul(f,ie)|0))<<13)|0;u=((i=i+Math.imul(f,ae)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(_,U),n=(n=Math.imul(_,F))+Math.imul(T,U)|0,i=Math.imul(T,F),r=r+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(S,Y)|0,i=i+Math.imul(S,H)|0,r=r+Math.imul(A,W)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,W)|0,i=i+Math.imul(q,Z)|0,r=r+Math.imul(z,K)|0,n=(n=n+Math.imul(z,J)|0)+Math.imul(j,K)|0,i=i+Math.imul(j,J)|0,r=r+Math.imul(k,$)|0,n=(n=n+Math.imul(k,ee)|0)+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(b,oe)|0,n=(n=n+Math.imul(b,re)|0)+Math.imul(y,oe)|0,i=i+Math.imul(y,re)|0,r=r+Math.imul(h,ie)|0,n=(n=n+Math.imul(h,ae)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,ae)|0;var ze=(u+(r=r+Math.imul(m,ce)|0)|0)+((8191&(n=(n=n+Math.imul(m,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((i=i+Math.imul(f,ue)|0)+(n>>>13)|0)+(ze>>>26)|0,ze&=67108863,r=Math.imul(C,U),n=(n=Math.imul(C,F))+Math.imul(D,U)|0,i=Math.imul(D,F),r=r+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,H)|0)+Math.imul(T,Y)|0,i=i+Math.imul(T,H)|0,r=r+Math.imul(E,W)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,Z)|0,r=r+Math.imul(A,K)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,K)|0,i=i+Math.imul(q,J)|0,r=r+Math.imul(z,$)|0,n=(n=n+Math.imul(z,ee)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,ee)|0,r=r+Math.imul(k,oe)|0,n=(n=n+Math.imul(k,re)|0)+Math.imul(w,oe)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(b,ie)|0,n=(n=n+Math.imul(b,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0,r=r+Math.imul(h,ce)|0,n=(n=n+Math.imul(h,ue)|0)+Math.imul(p,ce)|0,i=i+Math.imul(p,ue)|0;var je=(u+(r=r+Math.imul(m,me)|0)|0)+((8191&(n=(n=n+Math.imul(m,fe)|0)+Math.imul(f,me)|0))<<13)|0;u=((i=i+Math.imul(f,fe)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(P,U),n=(n=Math.imul(P,F))+Math.imul(R,U)|0,i=Math.imul(R,F),r=r+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,H)|0)+Math.imul(D,Y)|0,i=i+Math.imul(D,H)|0,r=r+Math.imul(_,W)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(T,W)|0,i=i+Math.imul(T,Z)|0,r=r+Math.imul(E,K)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(S,K)|0,i=i+Math.imul(S,J)|0,r=r+Math.imul(A,$)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,$)|0,i=i+Math.imul(q,ee)|0,r=r+Math.imul(z,oe)|0,n=(n=n+Math.imul(z,re)|0)+Math.imul(j,oe)|0,i=i+Math.imul(j,re)|0,r=r+Math.imul(k,ie)|0,n=(n=n+Math.imul(k,ae)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,ae)|0,r=r+Math.imul(b,ce)|0,n=(n=n+Math.imul(b,ue)|0)+Math.imul(y,ce)|0,i=i+Math.imul(y,ue)|0,r=r+Math.imul(h,me)|0,n=(n=n+Math.imul(h,fe)|0)+Math.imul(p,me)|0,i=i+Math.imul(p,fe)|0;var Me=(u+(r=r+Math.imul(m,he)|0)|0)+((8191&(n=(n=n+Math.imul(m,pe)|0)+Math.imul(f,he)|0))<<13)|0;u=((i=i+Math.imul(f,pe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(P,Y),n=(n=Math.imul(P,H))+Math.imul(R,Y)|0,i=Math.imul(R,H),r=r+Math.imul(C,W)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(D,W)|0,i=i+Math.imul(D,Z)|0,r=r+Math.imul(_,K)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(T,K)|0,i=i+Math.imul(T,J)|0,r=r+Math.imul(E,$)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,r=r+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,re)|0)+Math.imul(q,oe)|0,i=i+Math.imul(q,re)|0,r=r+Math.imul(z,ie)|0,n=(n=n+Math.imul(z,ae)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,ae)|0,r=r+Math.imul(k,ce)|0,n=(n=n+Math.imul(k,ue)|0)+Math.imul(w,ce)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(b,me)|0,n=(n=n+Math.imul(b,fe)|0)+Math.imul(y,me)|0,i=i+Math.imul(y,fe)|0;var Ae=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(n=(n=n+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;u=((i=i+Math.imul(p,pe)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(P,W),n=(n=Math.imul(P,Z))+Math.imul(R,W)|0,i=Math.imul(R,Z),r=r+Math.imul(C,K)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,J)|0,r=r+Math.imul(_,$)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,r=r+Math.imul(E,oe)|0,n=(n=n+Math.imul(E,re)|0)+Math.imul(S,oe)|0,i=i+Math.imul(S,re)|0,r=r+Math.imul(A,ie)|0,n=(n=n+Math.imul(A,ae)|0)+Math.imul(q,ie)|0,i=i+Math.imul(q,ae)|0,r=r+Math.imul(z,ce)|0,n=(n=n+Math.imul(z,ue)|0)+Math.imul(j,ce)|0,i=i+Math.imul(j,ue)|0,r=r+Math.imul(k,me)|0,n=(n=n+Math.imul(k,fe)|0)+Math.imul(w,me)|0,i=i+Math.imul(w,fe)|0;var qe=(u+(r=r+Math.imul(b,he)|0)|0)+((8191&(n=(n=n+Math.imul(b,pe)|0)+Math.imul(y,he)|0))<<13)|0;u=((i=i+Math.imul(y,pe)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,r=Math.imul(P,K),n=(n=Math.imul(P,J))+Math.imul(R,K)|0,i=Math.imul(R,J),r=r+Math.imul(C,$)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(D,$)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,re)|0)+Math.imul(T,oe)|0,i=i+Math.imul(T,re)|0,r=r+Math.imul(E,ie)|0,n=(n=n+Math.imul(E,ae)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,r=r+Math.imul(A,ce)|0,n=(n=n+Math.imul(A,ue)|0)+Math.imul(q,ce)|0,i=i+Math.imul(q,ue)|0,r=r+Math.imul(z,me)|0,n=(n=n+Math.imul(z,fe)|0)+Math.imul(j,me)|0,i=i+Math.imul(j,fe)|0;var Ie=(u+(r=r+Math.imul(k,he)|0)|0)+((8191&(n=(n=n+Math.imul(k,pe)|0)+Math.imul(w,he)|0))<<13)|0;u=((i=i+Math.imul(w,pe)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(P,$),n=(n=Math.imul(P,ee))+Math.imul(R,$)|0,i=Math.imul(R,ee),r=r+Math.imul(C,oe)|0,n=(n=n+Math.imul(C,re)|0)+Math.imul(D,oe)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(_,ie)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,ae)|0,r=r+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,i=i+Math.imul(S,ue)|0,r=r+Math.imul(A,me)|0,n=(n=n+Math.imul(A,fe)|0)+Math.imul(q,me)|0,i=i+Math.imul(q,fe)|0;var Ee=(u+(r=r+Math.imul(z,he)|0)|0)+((8191&(n=(n=n+Math.imul(z,pe)|0)+Math.imul(j,he)|0))<<13)|0;u=((i=i+Math.imul(j,pe)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(P,oe),n=(n=Math.imul(P,re))+Math.imul(R,oe)|0,i=Math.imul(R,re),r=r+Math.imul(C,ie)|0,n=(n=n+Math.imul(C,ae)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,ae)|0,r=r+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(T,ce)|0,i=i+Math.imul(T,ue)|0,r=r+Math.imul(E,me)|0,n=(n=n+Math.imul(E,fe)|0)+Math.imul(S,me)|0,i=i+Math.imul(S,fe)|0;var Se=(u+(r=r+Math.imul(A,he)|0)|0)+((8191&(n=(n=n+Math.imul(A,pe)|0)+Math.imul(q,he)|0))<<13)|0;u=((i=i+Math.imul(q,pe)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(P,ie),n=(n=Math.imul(P,ae))+Math.imul(R,ie)|0,i=Math.imul(R,ae),r=r+Math.imul(C,ce)|0,n=(n=n+Math.imul(C,ue)|0)+Math.imul(D,ce)|0,i=i+Math.imul(D,ue)|0,r=r+Math.imul(_,me)|0,n=(n=n+Math.imul(_,fe)|0)+Math.imul(T,me)|0,i=i+Math.imul(T,fe)|0;var Ne=(u+(r=r+Math.imul(E,he)|0)|0)+((8191&(n=(n=n+Math.imul(E,pe)|0)+Math.imul(S,he)|0))<<13)|0;u=((i=i+Math.imul(S,pe)|0)+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(P,ce),n=(n=Math.imul(P,ue))+Math.imul(R,ce)|0,i=Math.imul(R,ue),r=r+Math.imul(C,me)|0,n=(n=n+Math.imul(C,fe)|0)+Math.imul(D,me)|0,i=i+Math.imul(D,fe)|0;var _e=(u+(r=r+Math.imul(_,he)|0)|0)+((8191&(n=(n=n+Math.imul(_,pe)|0)+Math.imul(T,he)|0))<<13)|0;u=((i=i+Math.imul(T,pe)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(P,me),n=(n=Math.imul(P,fe))+Math.imul(R,me)|0,i=Math.imul(R,fe);var Te=(u+(r=r+Math.imul(C,he)|0)|0)+((8191&(n=(n=n+Math.imul(C,pe)|0)+Math.imul(D,he)|0))<<13)|0;u=((i=i+Math.imul(D,pe)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863;var Oe=(u+(r=Math.imul(P,he))|0)+((8191&(n=(n=Math.imul(P,pe))+Math.imul(R,he)|0))<<13)|0;return u=((i=Math.imul(R,pe))+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,c[0]=ge,c[1]=be,c[2]=ye,c[3]=ve,c[4]=ke,c[5]=we,c[6]=xe,c[7]=ze,c[8]=je,c[9]=Me,c[10]=Ae,c[11]=qe,c[12]=Ie,c[13]=Ee,c[14]=Se,c[15]=Ne,c[16]=_e,c[17]=Te,c[18]=Oe,0!==u&&(c[19]=u,o.length++),o};function b(e,t,o){o.negative=t.negative^e.negative,o.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0)>>>26,a&=67108863}o.words[i]=s,r=a,a=n}return 0!==r?o.words[i]=r:o.length--,o._strip()}function y(e,t,o){return b(e,t,o)}function v(e,t){this.x=e,this.y=t}Math.imul||(g=p),i.prototype.mulTo=function(e,t){var o=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):o<63?p(this,e,t):o<1024?b(this,e,t):y(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),o=i.prototype._countBits(e)-1,r=0;r>=1;return r},v.prototype.permute=function(e,t,o,r,n,i){for(var a=0;a>>=1)n++;return 1<>>=13,o[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,o+=i/67108864|0,o+=a>>>26,this.words[n]=67108863&a}return 0!==o&&(this.words[n]=o,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),o=0;o>>n&1}return t}(e);if(0===t.length)return new i(1);for(var o=this,r=0;r=0);var t,o=e%26,n=(e-o)/26,i=67108863>>>26-o<<26-o;if(0!==o){var a=0;for(t=0;t>>26-o}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=n);u--){var m=0|this.words[u];this.words[u]=l<<26-i|m>>>i,l=m&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,o){return r(0===this.negative),this.iushrn(e,t,o)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,o=(e-t)/26,n=1<=0);var t=e%26,o=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=o)return this;if(0!==t&&o++,this.length=Math.min(o,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[n+o]=67108863&i}for(;n>26,this.words[n+o]=67108863&i;if(0===s)return this._strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var o=(this.length,e.length),r=this.clone(),n=e,a=0|n.words[n.length-1];0!==(o=26-this._countBits(a))&&(n=n.ushln(o),r.iushln(o),a=0|n.words[n.length-1]);var s,c=r.length-n.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;m--){var f=67108864*(0|r.words[n.length+m])+(0|r.words[n.length+m-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(n,f,m);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(n,1,m),r.isZero()||(r.negative^=1);s&&(s.words[m]=f)}return s&&s._strip(),r._strip(),"div"!==t&&0!==o&&r.iushrn(o),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,o){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(a=s.mod.neg(),o&&0!==a.negative&&a.iadd(e)),{div:n,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),o&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var o=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=o.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var o=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(o*n+(0|this.words[i]))%e;return t?-n:n},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var o=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*o;this.words[n]=i/e|0,o=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,o=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&o.isEven();)t.iushrn(1),o.iushrn(1),++u;for(var l=o.clone(),m=t.clone();!t.isZero();){for(var f=0,d=1;0===(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(l),a.isub(m)),n.iushrn(1),a.iushrn(1);for(var h=0,p=1;0===(o.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(o.iushrn(h);h-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(m)),s.iushrn(1),c.iushrn(1);t.cmp(o)>=0?(t.isub(o),n.isub(s),a.isub(c)):(o.isub(t),s.isub(n),c.isub(a))}return{a:s,b:c,gcd:o.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,o=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,a=new i(1),s=new i(0),c=o.clone();t.cmpn(1)>0&&o.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var m=0,f=1;0===(o.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(o.iushrn(m);m-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(o)>=0?(t.isub(o),a.isub(s)):(o.isub(t),s.isub(a))}return(n=0===t.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),o=e.clone();t.negative=0,o.negative=0;for(var r=0;t.isEven()&&o.isEven();r++)t.iushrn(1),o.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;o.isEven();)o.iushrn(1);var n=t.cmp(o);if(n<0){var i=t;t=o,o=i}else if(0===n||0===o.cmpn(1))break;t.isub(o)}return o.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,o=(e-t)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,o=e<0;if(0!==this.negative&&!o)return-1;if(0===this.negative&&o)return 1;if(this._strip(),this.length>1)t=1;else{o&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;o--){var r=0|this.words[o],n=0|e.words[o];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var k={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function z(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function j(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function q(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,o=e;do{this.split(o,this.tmp),t=(o=(o=this.imulK(o)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?o.isub(this.p):void 0!==o.strip?o.strip():o._strip(),o},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(x,w),x.prototype.split=function(e,t){for(var o=4194303,r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,o=0;o>>=26,e.words[o]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(k[e])return k[e];var t;if("k256"===e)t=new x;else if("p224"===e)t=new z;else if("p192"===e)t=new j;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return k[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var o=e.add(t);return o.cmp(this.m)>=0&&o.isub(this.m),o._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var o=e.iadd(t);return o.cmp(this.m)>=0&&o.isub(this.m),o},A.prototype.sub=function(e,t){this._verify2(e,t);var o=e.sub(t);return o.cmpn(0)<0&&o.iadd(this.m),o._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var o=e.isub(t);return o.cmpn(0)<0&&o.iadd(this.m),o},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var o=this.m.add(new i(1)).iushrn(2);return this.pow(e,o)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);r(!n.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var m=this.pow(l,n),f=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),h=a;0!==d.cmp(s);){for(var p=d,g=0;0!==p.cmp(s);g++)p=p.redSqr();r(g=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var m=u>>l&1;n!==o[0]&&(n=this.sqr(n)),0!==m||0!==a?(a<<=1,a|=m,(4===++s||0===r&&0===l)&&(n=this.mul(n,o[a]),s=0,a=0)):s=0}c=26}return n},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new q(e)},n(q,A),q.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},q.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},q.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var o=e.imul(t),r=o.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=o.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},q.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var o=e.mul(t),r=o.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=o.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},q.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,o(67)(e))},function(e,t,o){"use strict";o.d(t,"a",(function(){return m})),o.d(t,"b",(function(){return b}));var r=o(31),n=o(44),i=o(3),a=o.n(i),s=o(45),c=o(26),u=o(32),l=o(54),m=function(e){function t(){for(var t,o=arguments.length,r=new Array(o),n=0;n1)for(var o=1;o=0||(n[o]=e[o]);return n}o.d(t,"a",(function(){return r}))},function(e,t,o){var r=o(112).default;function n(){"use strict";e.exports=n=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(e,t,o){e[t]=o.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function m(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{m({},"")}catch(N){m=function(e,t,o){return e[t]=o}}function f(e,t,o,r){var n=t&&t.prototype instanceof p?t:p,i=Object.create(n.prototype),s=new I(r||[]);return a(i,"_invoke",{value:j(e,o,s)}),i}function d(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(N){return{type:"throw",arg:N}}}t.wrap=f;var h={};function p(){}function g(){}function b(){}var y={};m(y,c,(function(){return this}));var v=Object.getPrototypeOf,k=v&&v(v(E([])));k&&k!==o&&i.call(k,c)&&(y=k);var w=b.prototype=p.prototype=Object.create(y);function x(e){["next","throw","return"].forEach((function(t){m(e,t,(function(e){return this._invoke(t,e)}))}))}function z(e,t){function o(n,a,s,c){var u=d(e[n],e,a);if("throw"!==u.type){var l=u.arg,m=l.value;return m&&"object"==r(m)&&i.call(m,"__await")?t.resolve(m.__await).then((function(e){o("next",e,s,c)}),(function(e){o("throw",e,s,c)})):t.resolve(m).then((function(e){l.value=e,s(l)}),(function(e){return o("throw",e,s,c)}))}c(u.arg)}var n;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,n){o(e,r,t,n)}))}return n=n?n.then(i,i):i()}})}function j(e,t,o){var r="suspendedStart";return function(n,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===n)throw i;return S()}for(o.method=n,o.arg=i;;){var a=o.delegate;if(a){var s=M(a,o);if(s){if(s===h)continue;return s}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===r)throw r="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r="executing";var c=d(e,t,o);if("normal"===c.type){if(r=o.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:o.done}}"throw"===c.type&&(r="completed",o.method="throw",o.arg=c.arg)}}}function M(e,t){var o=t.method,r=e.iterator[o];if(void 0===r)return t.delegate=null,"throw"===o&&e.iterator.return&&(t.method="return",t.arg=void 0,M(e,t),"throw"===t.method)||"return"!==o&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+o+"' method")),h;var n=d(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function q(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function E(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,r=function t(){for(;++o=0;--r){var n=this.tryEntries[r],a=n.completion;if("root"===n.tryLoc)return o("end");if(n.tryLoc<=this.prev){var s=i.call(n,"catchLoc"),c=i.call(n,"finallyLoc");if(s&&c){if(this.prev=0;--o){var r=this.tryEntries[o];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===e)return this.complete(o.completion,o.afterLoc),q(o),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===e){var r=o.completion;if("throw"===r.type){var n=r.arg;q(o)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,o){return this.delegate={iterator:E(e),resultName:t,nextLoc:o},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,o){var r=t;r.utils=o(62),r.common=o(93),r.sha=o(381),r.ripemd=o(385),r.hmac=o(386),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},,function(e,t,o){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var o=function(){};o.prototype=t.prototype,e.prototype=new o,e.prototype.constructor=e}function i(e,t,o){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(o=t,t=10),this._init(e||0,t||10,o||"be"))}var a;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a=o(389).Buffer}catch(j){}function s(e,t,o){for(var r=0,n=Math.min(e.length,o),i=t;i=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function c(e,t,o,r){for(var n=0,i=Math.min(e.length,o),a=t;a=49?s-49+10:s>=17?s-17+10:s}return n}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,o){if("number"===typeof e)return this._initNumber(e,t,o);if("object"===typeof e)return this._initArray(e,t,o);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&n++,16===t?this._parseHex(e,n):this._parseBase(e,t,n),"-"===e[0]&&(this.negative=1),this.strip(),"le"===o&&this._initArray(this.toArray(),t,o)},i.prototype._initNumber=function(e,t,o){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===o&&this._initArray(this.toArray(),t,o)},i.prototype._initArray=function(e,t,o){if(r("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===o)for(n=0,i=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var o=0;o=t;o-=6)n=s(e,o,o+6),this.words[r]|=n<>>26-i&4194303,(i+=24)>=26&&(i-=26,r++);o+6!==t&&(n=s(e,t,o+6),this.words[r]|=n<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(e,t,o){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-o,a=i%r,s=Math.min(i,i-a)+o,u=0,l=o;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","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],m=[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 f(e,t,o){o.negative=t.negative^e.negative;var r=e.length+t.length|0;o.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],a=n*i,s=67108863&a,c=a/67108864|0;o.words[0]=s;for(var u=1;u>>26,m=67108863&c,f=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=f;d++){var h=u-d|0;l+=(a=(n=0|e.words[h])*(i=0|t.words[d])+m)/67108864|0,m=67108863&a}o.words[u]=0|m,c=0|l}return 0!==c?o.words[u]=0|c:o.length--,o.strip()}i.prototype.toString=function(e,t){var o;if(t=0|t||1,16===(e=e||10)||"hex"===e){o="";for(var n=0,i=0,a=0;a>>24-n&16777215)||a!==this.length-1?u[6-c.length]+c+o:c+o,(n+=2)>=26&&(n-=26,a--)}for(0!==i&&(o=i.toString(16)+o);o.length%t!==0;)o="0"+o;return 0!==this.negative&&(o="-"+o),o}if(e===(0|e)&&e>=2&&e<=36){var f=l[e],d=m[e];o="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(d).toString(e);o=(h=h.idivn(d)).isZero()?p+o:u[f-p.length]+p+o}for(this.isZero()&&(o="0"+o);o.length%t!==0;)o="0"+o;return 0!==this.negative&&(o="-"+o),o}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r("undefined"!==typeof a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,o){var n=this.byteLength(),i=o||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(i),l=this.clone();if(c){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[s]=a;for(;s=4096&&(o+=13,t>>>=13),t>=64&&(o+=7,t>>>=7),t>=8&&(o+=4,t>>>=4),t>=2&&(o+=2,t>>>=2),o+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,o=0;return 0===(8191&t)&&(o+=13,t>>>=13),0===(127&t)&&(o+=7,t>>>=7),0===(15&t)&&(o+=4,t>>>=4),0===(3&t)&&(o+=2,t>>>=2),0===(1&t)&&o++,o},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var o=0;oe.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,o;this.length>e.length?(t=this,o=e):(t=e,o=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),o=e%26;this._expand(t),o>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-o),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var o=e/26|0,n=e%26;return this._expand(o+1),this.words[o]=t?this.words[o]|1<e.length?(o=this,r=e):(o=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=o.length,0!==n)this.words[this.length]=n,this.length++;else if(o!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var o,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(o=this,r=e):(o=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],h=8191&d,p=d>>>13,g=0|a[2],b=8191&g,y=g>>>13,v=0|a[3],k=8191&v,w=v>>>13,x=0|a[4],z=8191&x,j=x>>>13,M=0|a[5],A=8191&M,q=M>>>13,I=0|a[6],E=8191&I,S=I>>>13,N=0|a[7],_=8191&N,T=N>>>13,O=0|a[8],C=8191&O,D=O>>>13,L=0|a[9],P=8191&L,R=L>>>13,B=0|s[0],U=8191&B,F=B>>>13,Q=0|s[1],Y=8191&Q,H=Q>>>13,G=0|s[2],W=8191&G,Z=G>>>13,V=0|s[3],K=8191&V,J=V>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],oe=8191&te,re=te>>>13,ne=0|s[6],ie=8191&ne,ae=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,le=0|s[8],me=8191&le,fe=le>>>13,de=0|s[9],he=8191&de,pe=de>>>13;o.negative=e.negative^t.negative,o.length=19;var ge=(u+(r=Math.imul(m,U))|0)+((8191&(n=(n=Math.imul(m,F))+Math.imul(f,U)|0))<<13)|0;u=((i=Math.imul(f,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(h,U),n=(n=Math.imul(h,F))+Math.imul(p,U)|0,i=Math.imul(p,F);var be=(u+(r=r+Math.imul(m,Y)|0)|0)+((8191&(n=(n=n+Math.imul(m,H)|0)+Math.imul(f,Y)|0))<<13)|0;u=((i=i+Math.imul(f,H)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(b,U),n=(n=Math.imul(b,F))+Math.imul(y,U)|0,i=Math.imul(y,F),r=r+Math.imul(h,Y)|0,n=(n=n+Math.imul(h,H)|0)+Math.imul(p,Y)|0,i=i+Math.imul(p,H)|0;var ye=(u+(r=r+Math.imul(m,W)|0)|0)+((8191&(n=(n=n+Math.imul(m,Z)|0)+Math.imul(f,W)|0))<<13)|0;u=((i=i+Math.imul(f,Z)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(k,U),n=(n=Math.imul(k,F))+Math.imul(w,U)|0,i=Math.imul(w,F),r=r+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(y,Y)|0,i=i+Math.imul(y,H)|0,r=r+Math.imul(h,W)|0,n=(n=n+Math.imul(h,Z)|0)+Math.imul(p,W)|0,i=i+Math.imul(p,Z)|0;var ve=(u+(r=r+Math.imul(m,K)|0)|0)+((8191&(n=(n=n+Math.imul(m,J)|0)+Math.imul(f,K)|0))<<13)|0;u=((i=i+Math.imul(f,J)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(z,U),n=(n=Math.imul(z,F))+Math.imul(j,U)|0,i=Math.imul(j,F),r=r+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,H)|0)+Math.imul(w,Y)|0,i=i+Math.imul(w,H)|0,r=r+Math.imul(b,W)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,Z)|0,r=r+Math.imul(h,K)|0,n=(n=n+Math.imul(h,J)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,J)|0;var ke=(u+(r=r+Math.imul(m,$)|0)|0)+((8191&(n=(n=n+Math.imul(m,ee)|0)+Math.imul(f,$)|0))<<13)|0;u=((i=i+Math.imul(f,ee)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(A,U),n=(n=Math.imul(A,F))+Math.imul(q,U)|0,i=Math.imul(q,F),r=r+Math.imul(z,Y)|0,n=(n=n+Math.imul(z,H)|0)+Math.imul(j,Y)|0,i=i+Math.imul(j,H)|0,r=r+Math.imul(k,W)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(w,W)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(b,K)|0,n=(n=n+Math.imul(b,J)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,J)|0,r=r+Math.imul(h,$)|0,n=(n=n+Math.imul(h,ee)|0)+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0;var we=(u+(r=r+Math.imul(m,oe)|0)|0)+((8191&(n=(n=n+Math.imul(m,re)|0)+Math.imul(f,oe)|0))<<13)|0;u=((i=i+Math.imul(f,re)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,U),n=(n=Math.imul(E,F))+Math.imul(S,U)|0,i=Math.imul(S,F),r=r+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,H)|0)+Math.imul(q,Y)|0,i=i+Math.imul(q,H)|0,r=r+Math.imul(z,W)|0,n=(n=n+Math.imul(z,Z)|0)+Math.imul(j,W)|0,i=i+Math.imul(j,Z)|0,r=r+Math.imul(k,K)|0,n=(n=n+Math.imul(k,J)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,J)|0,r=r+Math.imul(b,$)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,ee)|0,r=r+Math.imul(h,oe)|0,n=(n=n+Math.imul(h,re)|0)+Math.imul(p,oe)|0,i=i+Math.imul(p,re)|0;var xe=(u+(r=r+Math.imul(m,ie)|0)|0)+((8191&(n=(n=n+Math.imul(m,ae)|0)+Math.imul(f,ie)|0))<<13)|0;u=((i=i+Math.imul(f,ae)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(_,U),n=(n=Math.imul(_,F))+Math.imul(T,U)|0,i=Math.imul(T,F),r=r+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(S,Y)|0,i=i+Math.imul(S,H)|0,r=r+Math.imul(A,W)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,W)|0,i=i+Math.imul(q,Z)|0,r=r+Math.imul(z,K)|0,n=(n=n+Math.imul(z,J)|0)+Math.imul(j,K)|0,i=i+Math.imul(j,J)|0,r=r+Math.imul(k,$)|0,n=(n=n+Math.imul(k,ee)|0)+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(b,oe)|0,n=(n=n+Math.imul(b,re)|0)+Math.imul(y,oe)|0,i=i+Math.imul(y,re)|0,r=r+Math.imul(h,ie)|0,n=(n=n+Math.imul(h,ae)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,ae)|0;var ze=(u+(r=r+Math.imul(m,ce)|0)|0)+((8191&(n=(n=n+Math.imul(m,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((i=i+Math.imul(f,ue)|0)+(n>>>13)|0)+(ze>>>26)|0,ze&=67108863,r=Math.imul(C,U),n=(n=Math.imul(C,F))+Math.imul(D,U)|0,i=Math.imul(D,F),r=r+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,H)|0)+Math.imul(T,Y)|0,i=i+Math.imul(T,H)|0,r=r+Math.imul(E,W)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,Z)|0,r=r+Math.imul(A,K)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,K)|0,i=i+Math.imul(q,J)|0,r=r+Math.imul(z,$)|0,n=(n=n+Math.imul(z,ee)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,ee)|0,r=r+Math.imul(k,oe)|0,n=(n=n+Math.imul(k,re)|0)+Math.imul(w,oe)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(b,ie)|0,n=(n=n+Math.imul(b,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0,r=r+Math.imul(h,ce)|0,n=(n=n+Math.imul(h,ue)|0)+Math.imul(p,ce)|0,i=i+Math.imul(p,ue)|0;var je=(u+(r=r+Math.imul(m,me)|0)|0)+((8191&(n=(n=n+Math.imul(m,fe)|0)+Math.imul(f,me)|0))<<13)|0;u=((i=i+Math.imul(f,fe)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(P,U),n=(n=Math.imul(P,F))+Math.imul(R,U)|0,i=Math.imul(R,F),r=r+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,H)|0)+Math.imul(D,Y)|0,i=i+Math.imul(D,H)|0,r=r+Math.imul(_,W)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(T,W)|0,i=i+Math.imul(T,Z)|0,r=r+Math.imul(E,K)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(S,K)|0,i=i+Math.imul(S,J)|0,r=r+Math.imul(A,$)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,$)|0,i=i+Math.imul(q,ee)|0,r=r+Math.imul(z,oe)|0,n=(n=n+Math.imul(z,re)|0)+Math.imul(j,oe)|0,i=i+Math.imul(j,re)|0,r=r+Math.imul(k,ie)|0,n=(n=n+Math.imul(k,ae)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,ae)|0,r=r+Math.imul(b,ce)|0,n=(n=n+Math.imul(b,ue)|0)+Math.imul(y,ce)|0,i=i+Math.imul(y,ue)|0,r=r+Math.imul(h,me)|0,n=(n=n+Math.imul(h,fe)|0)+Math.imul(p,me)|0,i=i+Math.imul(p,fe)|0;var Me=(u+(r=r+Math.imul(m,he)|0)|0)+((8191&(n=(n=n+Math.imul(m,pe)|0)+Math.imul(f,he)|0))<<13)|0;u=((i=i+Math.imul(f,pe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(P,Y),n=(n=Math.imul(P,H))+Math.imul(R,Y)|0,i=Math.imul(R,H),r=r+Math.imul(C,W)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(D,W)|0,i=i+Math.imul(D,Z)|0,r=r+Math.imul(_,K)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(T,K)|0,i=i+Math.imul(T,J)|0,r=r+Math.imul(E,$)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,r=r+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,re)|0)+Math.imul(q,oe)|0,i=i+Math.imul(q,re)|0,r=r+Math.imul(z,ie)|0,n=(n=n+Math.imul(z,ae)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,ae)|0,r=r+Math.imul(k,ce)|0,n=(n=n+Math.imul(k,ue)|0)+Math.imul(w,ce)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(b,me)|0,n=(n=n+Math.imul(b,fe)|0)+Math.imul(y,me)|0,i=i+Math.imul(y,fe)|0;var Ae=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(n=(n=n+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;u=((i=i+Math.imul(p,pe)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(P,W),n=(n=Math.imul(P,Z))+Math.imul(R,W)|0,i=Math.imul(R,Z),r=r+Math.imul(C,K)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,J)|0,r=r+Math.imul(_,$)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,r=r+Math.imul(E,oe)|0,n=(n=n+Math.imul(E,re)|0)+Math.imul(S,oe)|0,i=i+Math.imul(S,re)|0,r=r+Math.imul(A,ie)|0,n=(n=n+Math.imul(A,ae)|0)+Math.imul(q,ie)|0,i=i+Math.imul(q,ae)|0,r=r+Math.imul(z,ce)|0,n=(n=n+Math.imul(z,ue)|0)+Math.imul(j,ce)|0,i=i+Math.imul(j,ue)|0,r=r+Math.imul(k,me)|0,n=(n=n+Math.imul(k,fe)|0)+Math.imul(w,me)|0,i=i+Math.imul(w,fe)|0;var qe=(u+(r=r+Math.imul(b,he)|0)|0)+((8191&(n=(n=n+Math.imul(b,pe)|0)+Math.imul(y,he)|0))<<13)|0;u=((i=i+Math.imul(y,pe)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,r=Math.imul(P,K),n=(n=Math.imul(P,J))+Math.imul(R,K)|0,i=Math.imul(R,J),r=r+Math.imul(C,$)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(D,$)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,re)|0)+Math.imul(T,oe)|0,i=i+Math.imul(T,re)|0,r=r+Math.imul(E,ie)|0,n=(n=n+Math.imul(E,ae)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,r=r+Math.imul(A,ce)|0,n=(n=n+Math.imul(A,ue)|0)+Math.imul(q,ce)|0,i=i+Math.imul(q,ue)|0,r=r+Math.imul(z,me)|0,n=(n=n+Math.imul(z,fe)|0)+Math.imul(j,me)|0,i=i+Math.imul(j,fe)|0;var Ie=(u+(r=r+Math.imul(k,he)|0)|0)+((8191&(n=(n=n+Math.imul(k,pe)|0)+Math.imul(w,he)|0))<<13)|0;u=((i=i+Math.imul(w,pe)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(P,$),n=(n=Math.imul(P,ee))+Math.imul(R,$)|0,i=Math.imul(R,ee),r=r+Math.imul(C,oe)|0,n=(n=n+Math.imul(C,re)|0)+Math.imul(D,oe)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(_,ie)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,ae)|0,r=r+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,i=i+Math.imul(S,ue)|0,r=r+Math.imul(A,me)|0,n=(n=n+Math.imul(A,fe)|0)+Math.imul(q,me)|0,i=i+Math.imul(q,fe)|0;var Ee=(u+(r=r+Math.imul(z,he)|0)|0)+((8191&(n=(n=n+Math.imul(z,pe)|0)+Math.imul(j,he)|0))<<13)|0;u=((i=i+Math.imul(j,pe)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(P,oe),n=(n=Math.imul(P,re))+Math.imul(R,oe)|0,i=Math.imul(R,re),r=r+Math.imul(C,ie)|0,n=(n=n+Math.imul(C,ae)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,ae)|0,r=r+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(T,ce)|0,i=i+Math.imul(T,ue)|0,r=r+Math.imul(E,me)|0,n=(n=n+Math.imul(E,fe)|0)+Math.imul(S,me)|0,i=i+Math.imul(S,fe)|0;var Se=(u+(r=r+Math.imul(A,he)|0)|0)+((8191&(n=(n=n+Math.imul(A,pe)|0)+Math.imul(q,he)|0))<<13)|0;u=((i=i+Math.imul(q,pe)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(P,ie),n=(n=Math.imul(P,ae))+Math.imul(R,ie)|0,i=Math.imul(R,ae),r=r+Math.imul(C,ce)|0,n=(n=n+Math.imul(C,ue)|0)+Math.imul(D,ce)|0,i=i+Math.imul(D,ue)|0,r=r+Math.imul(_,me)|0,n=(n=n+Math.imul(_,fe)|0)+Math.imul(T,me)|0,i=i+Math.imul(T,fe)|0;var Ne=(u+(r=r+Math.imul(E,he)|0)|0)+((8191&(n=(n=n+Math.imul(E,pe)|0)+Math.imul(S,he)|0))<<13)|0;u=((i=i+Math.imul(S,pe)|0)+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(P,ce),n=(n=Math.imul(P,ue))+Math.imul(R,ce)|0,i=Math.imul(R,ue),r=r+Math.imul(C,me)|0,n=(n=n+Math.imul(C,fe)|0)+Math.imul(D,me)|0,i=i+Math.imul(D,fe)|0;var _e=(u+(r=r+Math.imul(_,he)|0)|0)+((8191&(n=(n=n+Math.imul(_,pe)|0)+Math.imul(T,he)|0))<<13)|0;u=((i=i+Math.imul(T,pe)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(P,me),n=(n=Math.imul(P,fe))+Math.imul(R,me)|0,i=Math.imul(R,fe);var Te=(u+(r=r+Math.imul(C,he)|0)|0)+((8191&(n=(n=n+Math.imul(C,pe)|0)+Math.imul(D,he)|0))<<13)|0;u=((i=i+Math.imul(D,pe)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863;var Oe=(u+(r=Math.imul(P,he))|0)+((8191&(n=(n=Math.imul(P,pe))+Math.imul(R,he)|0))<<13)|0;return u=((i=Math.imul(R,pe))+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,c[0]=ge,c[1]=be,c[2]=ye,c[3]=ve,c[4]=ke,c[5]=we,c[6]=xe,c[7]=ze,c[8]=je,c[9]=Me,c[10]=Ae,c[11]=qe,c[12]=Ie,c[13]=Ee,c[14]=Se,c[15]=Ne,c[16]=_e,c[17]=Te,c[18]=Oe,0!==u&&(c[19]=u,o.length++),o};function h(e,t,o){return(new p).mulp(e,t,o)}function p(e,t){this.x=e,this.y=t}Math.imul||(d=f),i.prototype.mulTo=function(e,t){var o,r=this.length+e.length;return o=10===this.length&&10===e.length?d(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,o){o.negative=t.negative^e.negative,o.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0)>>>26,a&=67108863}o.words[i]=s,r=a,a=n}return 0!==r?o.words[i]=r:o.length--,o.strip()}(this,e,t):h(this,e,t),o},p.prototype.makeRBT=function(e){for(var t=new Array(e),o=i.prototype._countBits(e)-1,r=0;r>=1;return r},p.prototype.permute=function(e,t,o,r,n,i){for(var a=0;a>>=1)n++;return 1<>>=13,o[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=n/67108864|0,t+=i>>>26,this.words[o]=67108863&i}return 0!==t&&(this.words[o]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),o=0;o>>n}return t}(e);if(0===t.length)return new i(1);for(var o=this,r=0;r=0);var t,o=e%26,n=(e-o)/26,i=67108863>>>26-o<<26-o;if(0!==o){var a=0;for(t=0;t>>26-o}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=n);u--){var m=0|this.words[u];this.words[u]=l<<26-i|m>>>i,l=m&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,o){return r(0===this.negative),this.iushrn(e,t,o)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,o=(e-t)/26,n=1<=0);var t=e%26,o=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=o)return this;if(0!==t&&o++,this.length=Math.min(o,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[n+o]=67108863&i}for(;n>26,this.words[n+o]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var o=(this.length,e.length),r=this.clone(),n=e,a=0|n.words[n.length-1];0!==(o=26-this._countBits(a))&&(n=n.ushln(o),r.iushln(o),a=0|n.words[n.length-1]);var s,c=r.length-n.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;m--){var f=67108864*(0|r.words[n.length+m])+(0|r.words[n.length+m-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(n,f,m);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(n,1,m),r.isZero()||(r.negative^=1);s&&(s.words[m]=f)}return s&&s.strip(),r.strip(),"div"!==t&&0!==o&&r.iushrn(o),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,o){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(a=s.mod.neg(),o&&0!==a.negative&&a.iadd(e)),{div:n,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),o&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var o=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=o.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,o=0,n=this.length-1;n>=0;n--)o=(t*o+(0|this.words[n]))%e;return o},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,o=this.length-1;o>=0;o--){var n=(0|this.words[o])+67108864*t;this.words[o]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,o=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&o.isEven();)t.iushrn(1),o.iushrn(1),++u;for(var l=o.clone(),m=t.clone();!t.isZero();){for(var f=0,d=1;0===(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(l),a.isub(m)),n.iushrn(1),a.iushrn(1);for(var h=0,p=1;0===(o.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(o.iushrn(h);h-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(m)),s.iushrn(1),c.iushrn(1);t.cmp(o)>=0?(t.isub(o),n.isub(s),a.isub(c)):(o.isub(t),s.isub(n),c.isub(a))}return{a:s,b:c,gcd:o.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,o=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,a=new i(1),s=new i(0),c=o.clone();t.cmpn(1)>0&&o.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var m=0,f=1;0===(o.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(o.iushrn(m);m-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(o)>=0?(t.isub(o),a.isub(s)):(o.isub(t),s.isub(a))}return(n=0===t.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),o=e.clone();t.negative=0,o.negative=0;for(var r=0;t.isEven()&&o.isEven();r++)t.iushrn(1),o.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;o.isEven();)o.iushrn(1);var n=t.cmp(o);if(n<0){var i=t;t=o,o=i}else if(0===n||0===o.cmpn(1))break;t.isub(o)}return o.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,o=(e-t)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,o=e<0;if(0!==this.negative&&!o)return-1;if(0===this.negative&&o)return 1;if(this.strip(),this.length>1)t=1;else{o&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;o--){var r=0|this.words[o],n=0|e.words[o];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new x(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function z(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,o=e;do{this.split(o,this.tmp),t=(o=(o=this.imulK(o)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?o.isub(this.p):o.strip(),o},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},n(y,b),y.prototype.split=function(e,t){for(var o=4194303,r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,o=0;o>>=26,e.words[o]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new v;else if("p192"===e)t=new k;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return g[e]=t,t},x.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var o=e.add(t);return o.cmp(this.m)>=0&&o.isub(this.m),o._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var o=e.iadd(t);return o.cmp(this.m)>=0&&o.isub(this.m),o},x.prototype.sub=function(e,t){this._verify2(e,t);var o=e.sub(t);return o.cmpn(0)<0&&o.iadd(this.m),o._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var o=e.isub(t);return o.cmpn(0)<0&&o.iadd(this.m),o},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var o=this.m.add(new i(1)).iushrn(2);return this.pow(e,o)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);r(!n.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var m=this.pow(l,n),f=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),h=a;0!==d.cmp(s);){for(var p=d,g=0;0!==p.cmp(s);g++)p=p.redSqr();r(g=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var m=u>>l&1;n!==o[0]&&(n=this.sqr(n)),0!==m||0!==a?(a<<=1,a|=m,(4===++s||0===r&&0===l)&&(n=this.mul(n,o[a]),s=0,a=0)):s=0}c=26}return n},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new z(e)},n(z,x),z.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},z.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},z.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var o=e.imul(t),r=o.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=o.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},z.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var o=e.mul(t),r=o.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=o.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},z.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,o(67)(e))},function(e,t,o){"use strict";o.d(t,"b",(function(){return i})),o.d(t,"d",(function(){return a})),o.d(t,"c",(function(){return s})),o.d(t,"e",(function(){return c})),o.d(t,"f",(function(){return u})),o.d(t,"a",(function(){return l}));var r,n=o(25),i="INTERNAL_ERROR",a="SERVER_ERROR",s=[-32700,-32600,-32601,-32602,-32603],c=[-32e3,-32099],u=(r={},Object(n.a)(r,"PARSE_ERROR",{code:-32700,message:"Parse error"}),Object(n.a)(r,"INVALID_REQUEST",{code:-32600,message:"Invalid Request"}),Object(n.a)(r,"METHOD_NOT_FOUND",{code:-32601,message:"Method not found"}),Object(n.a)(r,"INVALID_PARAMS",{code:-32602,message:"Invalid params"}),Object(n.a)(r,i,{code:-32603,message:"Internal error"}),Object(n.a)(r,a,{code:-32e3,message:"Server error"}),r),l=a},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,o){var r=o(214);function n(e,t){for(var o=0;o=0;f--){var d=a[f];"."===d?i(a,f):".."===d?(i(a,f),m++):m&&(i(a,f),m--)}if(!u)for(;m--;m)a.unshift("..");!u||""===a[0]||a[0]&&n(a[0])||a.unshift("");var h=a.join("/");return o&&"/"!==h.substr(-1)&&(h+="/"),h};function s(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var c=function e(t,o){if(t===o)return!0;if(null==t||null==o)return!1;if(Array.isArray(t))return Array.isArray(o)&&t.length===o.length&&t.every((function(t,r){return e(t,o[r])}));if("object"===typeof t||"object"===typeof o){var r=s(t),n=s(o);return r!==t||n!==o?e(r,n):Object.keys(Object.assign({},t,o)).every((function(r){return e(t[r],o[r])}))}return!1},u=o(54);function l(e){return"/"===e.charAt(0)?e:"/"+e}function m(e){return"/"===e.charAt(0)?e.substr(1):e}function f(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function h(e){var t=e.pathname,o=e.search,r=e.hash,n=t||"/";return o&&"?"!==o&&(n+="?"===o.charAt(0)?o:"?"+o),r&&"#"!==r&&(n+="#"===r.charAt(0)?r:"#"+r),n}function p(e,t,o,n){var i;"string"===typeof e?(i=function(e){var t=e||"/",o="",r="",n=t.indexOf("#");-1!==n&&(r=t.substr(n),t=t.substr(0,n));var i=t.indexOf("?");return-1!==i&&(o=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===o?"":o,hash:"#"===r?"":r}}(e),i.state=t):(void 0===(i=Object(r.a)({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):s}return o&&(i.key=o),n?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=a(i.pathname,n.pathname)):i.pathname=n.pathname:i.pathname||(i.pathname="/"),i}function g(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&c(e.state,t.state)}function b(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,o,r,n){if(null!=e){var i="function"===typeof e?e(t,o):e;"string"===typeof i?"function"===typeof r?r(i,n):n(!0):n(!1!==i)}else n(!0)},appendListener:function(e){var o=!0;function r(){o&&e.apply(void 0,arguments)}return t.push(r),function(){o=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,o=new Array(e),r=0;rt?o.splice(t,o.length-t,n):o.push(n),m({action:r,location:n,index:t,entries:o})}}))},replace:function(e,t){var r="REPLACE",n=p(e,t,f(),k.location);l.confirmTransitionTo(n,r,o,(function(e){e&&(k.entries[k.index]=n,m({action:r,location:n}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=k.index+e;return t>=0&&t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==o.return||o.return()}finally{if(c)throw a}}}}},function(e,t,o){var r=o(20),n=r.Buffer;function i(e,t){for(var o in e)t[o]=e[o]}function a(e,t,o){return n(e,t,o)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),a.prototype=Object.create(n.prototype),i(n,a),a.from=function(e,t,o){if("number"===typeof e)throw new TypeError("Argument must not be a number");return n(e,t,o)},a.alloc=function(e,t,o){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"===typeof o?r.fill(t,o):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return n(e)},a.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t){function o(e,t,o,r,n,i,a){try{var s=e[i](a),c=s.value}catch(u){return void o(u)}s.done?t(c):Promise.resolve(c).then(r,n)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,c,"next",e)}function c(e){o(a,n,i,s,c,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,o){"use strict";function r(e){var t=void 0;return"undefined"!==typeof window&&"undefined"!==typeof window[e]&&(t=window[e]),t}function n(e){var t=r(e);if(!t)throw new Error("".concat(e," is not defined in Window"));return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=function(){return n("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return n("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return n("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return n("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return n("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},,function(e,t,o){"use strict";var r=o(174),n=Object.prototype.toString;function i(e){return"[object Array]"===n.call(e)}function a(e){return"undefined"===typeof e}function s(e){return null!==e&&"object"===typeof e}function c(e){if("[object Object]"!==n.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===n.call(e)}function l(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),i(e))for(var o=0,r=e.length;o0&&(10===arguments[0]?q||(q=!0,j.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?j.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",w.b.errors.UNEXPECTED_ARGUMENT,{}):j.throwError("BigNumber.toString does not accept parameters",w.b.errors.UNEXPECTED_ARGUMENT,{})),N(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}],[{key:"from",value:function(t){if(t instanceof e)return t;if("string"===typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(M,E(t)):t.match(/^-?[0-9]+$/)?new e(M,E(new z(t))):j.throwArgumentError("invalid BigNumber string","value",t);if("number"===typeof t)return t%1&&_("underflow","BigNumber.from",t),(t>=A||t<=-A)&&_("overflow","BigNumber.from",t),e.from(String(t));var o=t;if("bigint"===typeof o)return e.from(o.toString());if(Object(y.j)(o))return e.from(Object(y.i)(o));if(o)if(o.toHexString){var r=o.toHexString();if("string"===typeof r)return e.from(r)}else{var n=o._hex;if(null==n&&"BigNumber"===o.type&&(n=o.hex),"string"===typeof n&&(Object(y.l)(n)||"-"===n[0]&&Object(y.l)(n.substring(1))))return e.from(n)}return j.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}]),e}();function E(e){if("string"!==typeof e)return E(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&j.throwArgumentError("invalid hex","value",e),"0x00"===(e=E(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function S(e){return I.from(E(e))}function N(e){var t=I.from(e).toHexString();return"-"===t[0]?new z("-"+t.substring(3),16):new z(t.substring(2),16)}function _(e,t,o){var r={fault:e,operation:t};return null!=o&&(r.value=o),j.throwError(e,w.b.errors.NUMERIC_FAULT,r)}var T=function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(t){i(t)}}function s(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},O=new w.b("properties/5.7.0");function C(e,t,o){Object.defineProperty(e,t,{enumerable:!0,value:o,writable:!1})}function D(e,t){for(var o=0;o<32;o++){if(e[t])return e[t];if(!e.prototype||"object"!==typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function L(e){return T(this,void 0,void 0,Object(b.a)().mark((function t(){var o,r;return Object(b.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=Object.keys(e).map((function(t){var o=e[t];return Promise.resolve(o).then((function(e){return{key:t,value:e}}))})),t.next=3,Promise.all(o);case 3:return r=t.sent,t.abrupt("return",r.reduce((function(e,t){return e[t.key]=t.value,e}),{}));case 5:case"end":return t.stop()}}),t)})))}function P(e,t){e&&"object"===typeof e||O.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((function(o){t[o]||O.throwArgumentError("invalid object key - "+o,"transaction:"+o,e)}))}function R(e){var t={};for(var o in e)t[o]=e[o];return t}var B={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function U(e){if(void 0===e||null===e||B[typeof e])return!0;if(Array.isArray(e)||"object"===typeof e){if(!Object.isFrozen(e))return!1;for(var t=Object.keys(e),o=0;othis.wordSize&&G.throwError("value out-of-bounds",w.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(y.b)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(o){e._data[t]=e._getValue(o)}}}]),e}(),K=function(){function e(t,o,r,n){Object(p.a)(this,e),C(this,"_data",Object(y.a)(t)),C(this,"wordSize",o||32),C(this,"_coerceFunc",r),C(this,"allowLoose",n),this._offset=0}return Object(g.a)(e,[{key:"data",get:function(){return Object(y.i)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,o){return this._coerceFunc?this._coerceFunc(t,o):e.coerce(t,o)}},{key:"_peekBytes",value:function(e,t,o){var r=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+r>this._data.length&&(this.allowLoose&&o&&this._offset+t<=this._data.length?r=t:G.throwError("data out-of-bounds",w.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+r})),this._data.slice(this._offset,this._offset+r)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var o=this._peekBytes(0,e,!!t);return this._offset+=o.length,o.slice(0,e)}},{key:"readValue",value:function(){return I.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var o=e.match("^u?int([0-9]+)$");return o&&parseInt(o[1])<=48&&(t=t.toNumber()),t}}]),e}(),J=o(122),X=o.n(J);function $(e){return"0x"+X.a.keccak_256(Object(y.a)(e))}var ee=new w.b("rlp/5.7.0");function te(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function oe(e,t,o){for(var r=0,n=0;nt+1+r&&ee.throwError("child data too short",w.b.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:n}}function ae(e,t){if(0===e.length&&ee.throwError("data too short",w.b.errors.BUFFER_OVERRUN,{}),e[t]>=248){var o=e[t]-247;t+1+o>e.length&&ee.throwError("data short segment too short",w.b.errors.BUFFER_OVERRUN,{});var r=oe(e,t+1,o);return t+1+o+r>e.length&&ee.throwError("data long segment too short",w.b.errors.BUFFER_OVERRUN,{}),ie(e,t,t+1+o,o+r)}if(e[t]>=192){var n=e[t]-192;return t+1+n>e.length&&ee.throwError("data array too short",w.b.errors.BUFFER_OVERRUN,{}),ie(e,t,t+1,n)}if(e[t]>=184){var i=e[t]-183;t+1+i>e.length&&ee.throwError("data array too short",w.b.errors.BUFFER_OVERRUN,{});var a=oe(e,t+1,i);return t+1+i+a>e.length&&ee.throwError("data array too short",w.b.errors.BUFFER_OVERRUN,{}),{consumed:1+i+a,result:Object(y.i)(e.slice(t+1+i,t+1+i+a))}}if(e[t]>=128){var s=e[t]-128;return t+1+s>e.length&&ee.throwError("data too short",w.b.errors.BUFFER_OVERRUN,{}),{consumed:1+s,result:Object(y.i)(e.slice(t+1,t+1+s))}}return{consumed:1,result:Object(y.i)(e[t])}}function se(e){var t=Object(y.a)(e),o=ae(t,0);return o.consumed!==t.length&&ee.throwArgumentError("invalid rlp data","data",e),o.result}var ce=new w.b("address/5.7.0");function ue(e){Object(y.l)(e,20)||ce.throwArgumentError("invalid address","address",e);for(var t=(e=e.toLowerCase()).substring(2).split(""),o=new Uint8Array(40),r=0;r<40;r++)o[r]=t[r].charCodeAt(0);for(var n=Object(y.a)($(o)),i=0;i<40;i+=2)n[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&n[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}for(var le={},me=0;me<10;me++)le[String(me)]=String(me);for(var fe=0;fe<26;fe++)le[String.fromCharCode(65+fe)]=String(10+fe);var de,he=Math.floor((de=9007199254740991,Math.log10?Math.log10(de):Math.log(de)/Math.LN10));function pe(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return le[e]})).join("");t.length>=he;){var o=t.substring(0,he);t=parseInt(o,10)%97+t.substring(o.length)}for(var r=String(98-parseInt(t,10)%97);r.length<2;)r="0"+r;return r}function ge(e){var t,o=null;if("string"!==typeof e&&ce.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),o=ue(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&o!==e&&ce.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==pe(e)&&ce.throwArgumentError("bad icap checksum","address",e),t=e.substring(4),o=new z(t,36).toString(16);o.length<40;)o="0"+o;o=ue("0x"+o)}else ce.throwArgumentError("invalid address","address",e);return o}function be(e){try{return ge(e),!0}catch(t){}return!1}function ye(e){for(var t,o=(t=ge(e).substring(2),new z(t,16).toString(36)).toUpperCase();o.length<30;)o="0"+o;return"XE"+pe("XE00"+o)+o}function ve(e){var t=null;try{t=ge(e.from)}catch(r){ce.throwArgumentError("missing from address","transaction",e)}var o=Object(y.o)(Object(y.a)(I.from(e.nonce).toHexString()));return ge(Object(y.e)($(ne([t,o])),12))}function ke(e,t,o){return 32!==Object(y.d)(t)&&ce.throwArgumentError("salt must be 32 bytes","salt",t),32!==Object(y.d)(o)&&ce.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",o),ge(Object(y.e)($(Object(y.b)(["0xff",ge(e),t,o])),12))}var we,xe,ze=new w.b("strings/5.7.0");function je(e,t,o,r,n){if(e===xe.BAD_PREFIX||e===xe.UNEXPECTED_CONTINUE){for(var i=0,a=t+1;a>6===2;a++)i++;return i}return e===xe.OVERRUN?o.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(we||(we={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(xe||(xe={}));var Me=Object.freeze({error:function(e,t,o,r,n){return ze.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",o)},ignore:je,replace:function(e,t,o,r,n){return e===xe.OVERLONG?(r.push(n),0):(r.push(65533),je(e,t,o))}});function Ae(e,t){null==t&&(t=Me.error),e=Object(y.a)(e);for(var o=[],r=0;r>7!==0){var i=null,a=null;if(192===(224&n))i=1,a=127;else if(224===(240&n))i=2,a=2047;else{if(240!==(248&n)){r+=t(128===(192&n)?xe.UNEXPECTED_CONTINUE:xe.BAD_PREFIX,r-1,e,o);continue}i=3,a=65535}if(r-1+i>=e.length)r+=t(xe.OVERRUN,r-1,e,o);else{for(var s=n&(1<<8-i-1)-1,c=0;c1114111?r+=t(xe.OUT_OF_RANGE,r-1-i,e,o,s):s>=55296&&s<=57343?r+=t(xe.UTF16_SURROGATE,r-1-i,e,o,s):s<=a?r+=t(xe.OVERLONG,r-1-i,e,o,s):o.push(s))}}else o.push(n)}return o}function qe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:we.current;t!=we.current&&(ze.checkNormalize(),e=e.normalize(t));for(var o=[],r=0;r>6|192),o.push(63&n|128);else if(55296==(64512&n)){r++;var i=e.charCodeAt(r);if(r>=e.length||56320!==(64512&i))throw new Error("invalid utf-8 string");var a=65536+((1023&n)<<10)+(1023&i);o.push(a>>18|240),o.push(a>>12&63|128),o.push(a>>6&63|128),o.push(63&a|128)}else o.push(n>>12|224),o.push(n>>6&63|128),o.push(63&n|128)}return Object(y.a)(o)}function Ie(e){var t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Ee(e,t){return'"'+Ae(e,t).map((function(e){if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?Ie(e):Ie(55296+((e-=65536)>>10&1023))+Ie(56320+(1023&e))})).join("")+'"'}function Se(e){return e.map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function Ne(e,t){return Se(Ae(e,t))}function _e(e){return Ae(qe(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:we.current))}function Te(e){return $(qe(e))}var Oe=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e){return Object(p.a)(this,o),t.call(this,"address","address",e,!1)}return Object(g.a)(o,[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(e,t){try{t=ge(t)}catch(o){this._throwError(o.message,t)}return e.writeValue(t)}},{key:"decode",value:function(e){return ge(Object(y.h)(e.readValue().toHexString(),20))}}]),o}(Z),Ce=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e){var r;return Object(p.a)(this,o),(r=t.call(this,e.name,e.type,void 0,e.dynamic)).coder=e,r}return Object(g.a)(o,[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(e,t){return this.coder.encode(e,t)}},{key:"decode",value:function(e){return this.coder.decode(e)}}]),o}(Z),De=new w.b(H);function Le(e,t,o){var r=null;if(Array.isArray(o))r=o;else if(o&&"object"===typeof o){var n={};r=t.map((function(e){var t=e.localName;return t||De.throwError("cannot encode object for signature with missing names",w.b.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:o}),n[t]&&De.throwError("cannot encode object for signature with duplicate names",w.b.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:o}),n[t]=!0,o[t]}))}else De.throwArgumentError("invalid tuple value","tuple",o);t.length!==r.length&&De.throwArgumentError("types/value length mismatch","tuple",o);var i=new V(e.wordSize),a=new V(e.wordSize),s=[];t.forEach((function(e,t){var o=r[t];if(e.dynamic){var n=a.length;e.encode(a,o);var c=i.writeUpdatableValue();s.push((function(e){c(e+n)}))}else e.encode(i,o)})),s.forEach((function(e){e(i.length)}));var c=e.appendWriter(i);return c+=e.appendWriter(a)}function Pe(e,t){var o=[],r=e.subReader(0);t.forEach((function(t){var n=null;if(t.dynamic){var i=e.readValue(),a=r.subReader(i.toNumber());try{n=t.decode(a)}catch(s){if(s.code===w.b.errors.BUFFER_OVERRUN)throw s;(n=s).baseType=t.name,n.name=t.localName,n.type=t.type}}else try{n=t.decode(e)}catch(s){if(s.code===w.b.errors.BUFFER_OVERRUN)throw s;(n=s).baseType=t.name,n.name=t.localName,n.type=t.type}void 0!=n&&o.push(n)}));var n=t.reduce((function(e,t){var o=t.localName;return o&&(e[o]||(e[o]=0),e[o]++),e}),{});t.forEach((function(e,t){var r=e.localName;if(r&&1===n[r]&&("length"===r&&(r="_length"),null==o[r])){var i=o[t];i instanceof Error?Object.defineProperty(o,r,{enumerable:!0,get:function(){throw i}}):o[r]=i}}));for(var i=function(){var e=o[a];e instanceof Error&&Object.defineProperty(o,a,{enumerable:!0,get:function(){throw e}})},a=0;a=0?r:"")+"]",s=-1===r||e.dynamic;return(i=t.call(this,"array",a,n,s)).coder=e,i.length=r,i}return Object(g.a)(o,[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],o=0;oe._data.length&&De.throwError("insufficient data length",w.b.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var o=[],r=0;r=0||"tuple"===e)&&it[t])return!0;return(nt[t]||"payable"===t)&&ot.throwArgumentError("invalid modifier","name",t),!1}function st(e,t){for(var o in t)C(e,o,t[o])}var ct=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),ut=new RegExp(/^(.*)\[([0-9]*)\]$/),lt=function(){function e(t,o){Object(p.a)(this,e),t!==rt&&ot.throwError("use fromString",w.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),st(this,o);var r=this.type.match(ut);st(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:e.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return Object(g.a)(e,[{key:"format",value:function(e){if(e||(e=ct.sighash),ct[e]||ot.throwArgumentError("invalid format type","format",e),e===ct.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"===typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var o="";return"array"===this.baseType?(o+=this.arrayChildren.format(e),o+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==ct.sighash&&(o+=this.type),o+="("+this.components.map((function(t){return t.format(e)})).join(e===ct.full?", ":",")+")"):o+=this.type,e!==ct.sighash&&(!0===this.indexed&&(o+=" indexed"),e===ct.full&&this.name&&(o+=" "+this.name)),o}}],[{key:"from",value:function(t,o){return"string"===typeof t?e.fromString(t,o):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(rt,{name:t.name||null,type:wt(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,o){return r=function(e,t){var o=e;function r(t){ot.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function n(e){var o={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(o.indexed=!1),o}e=e.replace(/\s/g," ");for(var i={type:"",name:"",state:{allowType:!0}},a=i,s=0;s2&&ot.throwArgumentError("invalid human-readable ABI signature","value",e),o[1].match(/^[0-9]+$/)||ot.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=I.from(o[1]),o[0]):e}function pt(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function gt(e){var t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&ot.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&ot.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||ot.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&ot.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&ot.throwArgumentError("unable to determine stateMutability","value",e),t}var bt=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(p.a)(this,o),t.apply(this,arguments)}return Object(g.a)(o,[{key:"format",value:function(e){if(e||(e=ct.sighash),ct[e]||ot.throwArgumentError("invalid format type","format",e),e===ct.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});e===ct.sighash&&ot.throwError("cannot format a constructor for sighash",w.b.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===ct.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"===typeof e?o.fromString(e):o.fromObject(e)}},{key:"fromObject",value:function(e){if(o.isConstructorFragment(e))return e;"constructor"!==e.type&&ot.throwArgumentError("invalid constructor object","value",e);var t=gt(e);t.constant&&ot.throwArgumentError("constructor cannot be constant","value",e);var r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(lt.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?I.from(e.gas):null};return new o(rt,r)}},{key:"fromString",value:function(e){var t={type:"constructor"},r=(e=ht(e,t)).match(jt);return r&&"constructor"===r[1].trim()||ot.throwArgumentError("invalid constructor string","value",e),t.inputs=mt(r[2].trim(),!1),pt(r[3].trim(),t),o.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),o}(ft),yt=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(p.a)(this,o),t.apply(this,arguments)}return Object(g.a)(o,[{key:"format",value:function(e){if(e||(e=ct.sighash),ct[e]||ot.throwArgumentError("invalid format type","format",e),e===ct.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==ct.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===ct.full?", ":",")+") ",e!==ct.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"===typeof e?o.fromString(e):o.fromObject(e)}},{key:"fromObject",value:function(e){if(o.isFunctionFragment(e))return e;"function"!==e.type&&ot.throwArgumentError("invalid function object","value",e);var t=gt(e),r={type:e.type,name:zt(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(lt.fromObject):[],outputs:e.outputs?e.outputs.map(lt.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?I.from(e.gas):null};return new o(rt,r)}},{key:"fromString",value:function(e){var t={type:"function"},r=(e=ht(e,t)).split(" returns ");r.length>2&&ot.throwArgumentError("invalid function string","value",e);var n=r[0].match(jt);if(n||ot.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&zt(t.name),t.inputs=mt(n[2],!1),pt(n[3].trim(),t),r.length>1){var i=r[1].match(jt);""==i[1].trim()&&""==i[3].trim()||ot.throwArgumentError("unexpected tokens","value",e),t.outputs=mt(i[2],!1)}else t.outputs=[];return o.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),o}(bt);function vt(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||ot.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var kt=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(p.a)(this,o),t.apply(this,arguments)}return Object(g.a)(o,[{key:"format",value:function(e){if(e||(e=ct.sighash),ct[e]||ot.throwArgumentError("invalid format type","format",e),e===ct.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==ct.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===ct.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"===typeof e?o.fromString(e):o.fromObject(e)}},{key:"fromObject",value:function(e){if(o.isErrorFragment(e))return e;"error"!==e.type&&ot.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:zt(e.name),inputs:e.inputs?e.inputs.map(lt.fromObject):[]};return vt(new o(rt,t))}},{key:"fromString",value:function(e){var t={type:"error"},r=e.match(jt);return r||ot.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&zt(t.name),t.inputs=mt(r[2],!1),vt(o.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),o}(ft);function wt(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var xt=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function zt(e){return e&&e.match(xt)||ot.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var jt=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");var Mt=new w.b(H),At=new RegExp(/^bytes([0-9]*)$/),qt=new RegExp(/^(u?int)([0-9]*)$/),It=function(){function e(t){Object(p.a)(this,e),C(this,"coerceFunc",t||null)}return Object(g.a)(e,[{key:"_getCoder",value:function(e){var t=this;switch(e.baseType){case"address":return new Oe(e.name);case"bool":return new Be(e.name);case"string":return new et(e.name);case"bytes":return new Fe(e.name);case"array":return new Re(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new tt((e.components||[]).map((function(e){return t._getCoder(e)})),e.name);case"":return new Ye(e.name)}var o=e.type.match(qt);if(o){var r=parseInt(o[2]||"256");return(0===r||r>256||r%8!==0)&&Mt.throwArgumentError("invalid "+o[1]+" bit length","param",e),new $e(r/8,"int"===o[1],e.name)}if(o=e.type.match(At)){var n=parseInt(o[1]);return(0===n||n>32)&&Mt.throwArgumentError("invalid bytes length","param",e),new Qe(n,e.name)}return Mt.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new K(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new V(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,o=e.map((function(e){return t._getCoder(lt.from(e))}));return new tt(o,"_").defaultValue()}},{key:"encode",value:function(e,t){var o=this;e.length!==t.length&&Mt.throwError("types/values length mismatch",w.b.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var r=e.map((function(e){return o._getCoder(lt.from(e))})),n=new tt(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}},{key:"decode",value:function(e,t,o){var r=this,n=e.map((function(e){return r._getCoder(lt.from(e))}));return new tt(n,"_").decode(this._getReader(Object(y.a)(t),o))}}]),e}(),Et=new It,St=new w.b(H),Nt=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(p.a)(this,o),t.apply(this,arguments)}return Object(g.a)(o)}(Y),_t=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(p.a)(this,o),t.apply(this,arguments)}return Object(g.a)(o)}(Y),Tt=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(p.a)(this,o),t.apply(this,arguments)}return Object(g.a)(o)}(Y),Ot=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(p.a)(this,o),t.apply(this,arguments)}return Object(g.a)(o,null,[{key:"isIndexed",value:function(e){return!(!e||!e._isIndexed)}}]),o}(Y),Ct={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Dt(e,t){var o=new Error("deferred error during ABI decoding triggered accessing ".concat(e));return o.error=t,o}var Lt=function(){function e(t){var o=this;Object(p.a)(this,e);C(this,"fragments",("string"===typeof t?JSON.parse(t):t).map((function(e){return ft.from(e)})).filter((function(e){return null!=e}))),C(this,"_abiCoder",D(this instanceof e?this.constructor:void 0,"getAbiCoder")()),C(this,"functions",{}),C(this,"errors",{}),C(this,"events",{}),C(this,"structs",{}),this.fragments.forEach((function(e){var t=null;switch(e.type){case"constructor":return o.deploy?void St.warn("duplicate definition - constructor"):void C(o,"deploy",e);case"function":t=o.functions;break;case"event":t=o.events;break;case"error":t=o.errors;break;default:return}var r=e.format();t[r]?St.warn("duplicate definition - "+r):t[r]=e})),this.deploy||C(this,"deploy",bt.from({payable:!1,type:"constructor"})),C(this,"_isInterface",!0)}return Object(g.a)(e,[{key:"format",value:function(e){e||(e=ct.full),e===ct.sighash&&St.throwArgumentError("interface does not support formatting sighash","format",e);var t=this.fragments.map((function(t){return t.format(e)}));return e===ct.json?JSON.stringify(t.map((function(e){return JSON.parse(e)}))):t}},{key:"getFunction",value:function(e){if(Object(y.l)(e)){for(var t in this.functions)if(e===this.getSighash(t))return this.functions[t];St.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){var o=e.trim(),r=Object.keys(this.functions).filter((function(e){return e.split("(")[0]===o}));return 0===r.length?St.throwArgumentError("no matching function","name",o):r.length>1&&St.throwArgumentError("multiple matching functions","name",o),this.functions[r[0]]}var n=this.functions[yt.fromString(e).format()];return n||St.throwArgumentError("no matching function","signature",e),n}},{key:"getEvent",value:function(e){if(Object(y.l)(e)){var t=e.toLowerCase();for(var o in this.events)if(t===this.getEventTopic(o))return this.events[o];St.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var r=e.trim(),n=Object.keys(this.events).filter((function(e){return e.split("(")[0]===r}));return 0===n.length?St.throwArgumentError("no matching event","name",r):n.length>1&&St.throwArgumentError("multiple matching events","name",r),this.events[n[0]]}var i=this.events[dt.fromString(e).format()];return i||St.throwArgumentError("no matching event","signature",e),i}},{key:"getError",value:function(e){if(Object(y.l)(e)){var t=D(this.constructor,"getSighash");for(var o in this.errors){if(e===t(this.errors[o]))return this.errors[o]}St.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var r=e.trim(),n=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===r}));return 0===n.length?St.throwArgumentError("no matching error","name",r):n.length>1&&St.throwArgumentError("multiple matching errors","name",r),this.errors[n[0]]}var i=this.errors[yt.fromString(e).format()];return i||St.throwArgumentError("no matching error","signature",e),i}},{key:"getSighash",value:function(e){if("string"===typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(o){throw t}}return D(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"===typeof e&&(e=this.getEvent(e)),D(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"===typeof e&&(e=this.getError(e));var o=Object(y.a)(t);return Object(y.i)(o.slice(0,4))!==this.getSighash(e)&&St.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",Object(y.i)(o)),this._decodeParams(e.inputs,o.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"===typeof e&&(e=this.getError(e)),Object(y.i)(Object(y.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var o=Object(y.a)(t);return Object(y.i)(o.slice(0,4))!==this.getSighash(e)&&St.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",Object(y.i)(o)),this._decodeParams(e.inputs,o.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),Object(y.i)(Object(y.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var o=Object(y.a)(t),r=null,n="",i=null,a=null,s=null;switch(o.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,o)}catch(l){}break;case 4:var c=Object(y.i)(o.slice(0,4)),u=Ct[c];if(u)i=this._abiCoder.decode(u.inputs,o.slice(4)),a=u.name,s=u.signature,u.reason&&(r=i[0]),"Error"===a?n="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(i[0])):"Panic"===a&&(n="; VM Exception while processing transaction: reverted with panic code ".concat(i[0]));else try{var l=this.getError(c);i=this._abiCoder.decode(l.inputs,o.slice(4)),a=l.name,s=l.format()}catch(l){}}return St.throwError("call revert exception"+n,w.b.errors.CALL_EXCEPTION,{method:e.format(),data:Object(y.i)(t),errorArgs:i,errorName:a,errorSignature:s,reason:r})}},{key:"encodeFunctionResult",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),Object(y.i)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var o=this;"string"===typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&St.throwError("too many arguments for "+e.format(),w.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});var r=[];e.anonymous||r.push(this.getEventTopic(e));var n=function(e,t){return"string"===e.type?Te(t):"bytes"===e.type?$(Object(y.i)(t)):("bool"===e.type&&"boolean"===typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=I.from(t).toHexString()),"address"===e.type&&o._abiCoder.encode(["address"],[t]),Object(y.h)(Object(y.i)(t),32))};for(t.forEach((function(t,o){var i=e.inputs[o];i.indexed?null==t?r.push(null):"array"===i.baseType||"tuple"===i.baseType?St.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?r.push(t.map((function(e){return n(i,e)}))):r.push(n(i,t)):null!=t&&St.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}},{key:"encodeEventLog",value:function(e,t){var o=this;"string"===typeof e&&(e=this.getEvent(e));var r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&St.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,a){var s=t[a];if(e.indexed)if("string"===e.type)r.push(Te(s));else if("bytes"===e.type)r.push($(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(o._abiCoder.encode([e.type],[s]))}else n.push(e),i.push(s)})),{data:this._abiCoder.encode(n,i),topics:r}}},{key:"decodeEventLog",value:function(e,t,o){if("string"===typeof e&&(e=this.getEvent(e)),null!=o&&!e.anonymous){var r=this.getEventTopic(e);Object(y.l)(o[0],32)&&o[0].toLowerCase()===r||St.throwError("fragment/topic mismatch",w.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:r,value:o[0]}),o=o.slice(1)}var n=[],i=[],a=[];e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(lt.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(n.push(e),a.push(!1)):(i.push(e),a.push(!1))}));var s=null!=o?this._abiCoder.decode(n,Object(y.b)(o)):null,c=this._abiCoder.decode(i,t,!0),u=[],l=0,m=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==s)u[t]=new Ot({_isIndexed:!0,hash:null});else if(a[t])u[t]=new Ot({_isIndexed:!0,hash:s[m++]});else try{u[t]=s[m++]}catch(r){u[t]=r}else try{u[t]=c[l++]}catch(r){u[t]=r}if(e.name&&null==u[e.name]){var o=u[t];o instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:function(){throw Dt("property ".concat(JSON.stringify(e.name)),o)}}):u[e.name]=o}}));for(var f=function(e){var t=u[e];t instanceof Error&&Object.defineProperty(u,e,{enumerable:!0,get:function(){throw Dt("index ".concat(e),t)}})},d=0;d=0)throw e;return Qt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",w.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:o})}))),null==o.chainId?o.chainId=this.getChainId():o.chainId=Promise.all([Promise.resolve(o.chainId),this.getChainId()]).then((function(t){return 0!==t[1]&&t[0]!==t[1]&&Qt.throwArgumentError("chainId address mismatch","transaction",e),t[0]})),t.next=23,L(o);case 23:return t.abrupt("return",t.sent);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"_checkProvider",value:function(e){this.provider||Qt.throwError("missing provider",w.b.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),Wt=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e,r){var n;return Object(p.a)(this,o),n=t.call(this),C(Object(l.a)(n),"address",e),C(Object(l.a)(n),"provider",r||null),n}return Object(g.a)(o,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(e,t){return Promise.resolve().then((function(){Qt.throwError(e,w.b.errors.UNSUPPORTED_OPERATION,{operation:t})}))}},{key:"signMessage",value:function(e){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(e,t,o){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(e){return new o(this.address,e)}}]),o}(Gt),Zt=o(270),Vt=new w.b("signing-key/5.7.0"),Kt=null;function Jt(){return Kt||(Kt=new Zt.a("secp256k1")),Kt}var Xt=function(){function e(t){Object(p.a)(this,e),C(this,"curve","secp256k1"),C(this,"privateKey",Object(y.i)(t)),32!==Object(y.d)(this.privateKey)&&Vt.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var o=Jt().keyFromPrivate(Object(y.a)(this.privateKey));C(this,"publicKey","0x"+o.getPublic(!1,"hex")),C(this,"compressedPublicKey","0x"+o.getPublic(!0,"hex")),C(this,"_isSigningKey",!0)}return Object(g.a)(e,[{key:"_addPoint",value:function(e){var t=Jt().keyFromPublic(Object(y.a)(this.publicKey)),o=Jt().keyFromPublic(Object(y.a)(e));return"0x"+t.pub.add(o.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(e){var t=Jt().keyFromPrivate(Object(y.a)(this.privateKey)),o=Object(y.a)(e);32!==o.length&&Vt.throwArgumentError("bad digest length","digest",e);var r=t.sign(o,{canonical:!0});return Object(y.n)({recoveryParam:r.recoveryParam,r:Object(y.h)("0x"+r.r.toString(16),32),s:Object(y.h)("0x"+r.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(e){var t=Jt().keyFromPrivate(Object(y.a)(this.privateKey)),o=Jt().keyFromPublic(Object(y.a)(eo(e)));return Object(y.h)("0x"+t.derive(o.getPublic()).toString(16),32)}}],[{key:"isSigningKey",value:function(e){return!(!e||!e._isSigningKey)}}]),e}();function $t(e,t){var o=Object(y.n)(t),r={r:Object(y.a)(o.r),s:Object(y.a)(o.s)};return"0x"+Jt().recoverPubKey(Object(y.a)(e),r,o.recoveryParam).encode("hex",!1)}function eo(e,t){var o=Object(y.a)(e);if(32===o.length){var r=new Xt(o);return t?"0x"+Jt().keyFromPrivate(o).getPublic(!0,"hex"):r.publicKey}return 33===o.length?t?Object(y.i)(o):"0x"+Jt().keyFromPublic(o).getPublic(!1,"hex"):65===o.length?t?"0x"+Jt().keyFromPublic(o).getPublic(!0,"hex"):Object(y.i)(o):Vt.throwArgumentError("invalid public or private key","key","[REDACTED]")}var to,oo=new w.b("transactions/5.7.0");function ro(e){return"0x"===e?null:ge(e)}function no(e){return"0x"===e?Ge:I.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(to||(to={}));var io=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],ao={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function so(e){var t=eo(e);return ge(Object(y.e)($(Object(y.e)(t,1)),12))}function co(e,t){return so($t(Object(y.a)(e),t))}function uo(e,t){var o=Object(y.o)(I.from(e).toHexString());return o.length>32&&oo.throwArgumentError("invalid length for "+t,"transaction:"+t,e),o}function lo(e,t){return{address:ge(e),storageKeys:(t||[]).map((function(t,o){return 32!==Object(y.d)(t)&&oo.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(o,"]"),t),t.toLowerCase()}))}}function mo(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&oo.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),lo(e[0],e[1])):lo(e.address,e.storageKeys)}));var t=Object.keys(e).map((function(t){var o=e[t].reduce((function(e,t){return e[t]=!0,e}),{});return lo(t,Object.keys(o).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function fo(e){return mo(e).map((function(e){return[e.address,e.storageKeys]}))}function ho(e,t){if(null!=e.gasPrice){var o=I.from(e.gasPrice),r=I.from(e.maxFeePerGas||0);o.eq(r)||oo.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:o,maxFeePerGas:r})}var n=[uo(e.chainId||0,"chainId"),uo(e.nonce||0,"nonce"),uo(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),uo(e.maxFeePerGas||0,"maxFeePerGas"),uo(e.gasLimit||0,"gasLimit"),null!=e.to?ge(e.to):"0x",uo(e.value||0,"value"),e.data||"0x",fo(e.accessList||[])];if(t){var i=Object(y.n)(t);n.push(uo(i.recoveryParam,"recoveryParam")),n.push(Object(y.o)(i.r)),n.push(Object(y.o)(i.s))}return Object(y.c)(["0x02",ne(n)])}function po(e,t){var o=[uo(e.chainId||0,"chainId"),uo(e.nonce||0,"nonce"),uo(e.gasPrice||0,"gasPrice"),uo(e.gasLimit||0,"gasLimit"),null!=e.to?ge(e.to):"0x",uo(e.value||0,"value"),e.data||"0x",fo(e.accessList||[])];if(t){var r=Object(y.n)(t);o.push(uo(r.recoveryParam,"recoveryParam")),o.push(Object(y.o)(r.r)),o.push(Object(y.o)(r.s))}return Object(y.c)(["0x01",ne(o)])}function go(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&oo.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){P(e,ao);var o=[];io.forEach((function(t){var r=e[t.name]||[],n={};t.numeric&&(n.hexPad="left"),r=Object(y.a)(Object(y.i)(r,n)),t.length&&r.length!==t.length&&r.length>0&&oo.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,r),t.maxLength&&(r=Object(y.o)(r)).length>t.maxLength&&oo.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,r),o.push(Object(y.i)(r))}));var r=0;if(null!=e.chainId?"number"!==typeof(r=e.chainId)&&oo.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!Object(y.k)(t)&&t.v>28&&(r=Math.floor((t.v-35)/2)),0!==r&&(o.push(Object(y.i)(r)),o.push("0x"),o.push("0x")),!t)return ne(o);var n=Object(y.n)(t),i=27+n.recoveryParam;return 0!==r?(o.pop(),o.pop(),o.pop(),i+=2*r+8,n.v>28&&n.v!==i&&oo.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):n.v!==i&&oo.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),o.push(Object(y.i)(i)),o.push(Object(y.o)(Object(y.a)(n.r))),o.push(Object(y.o)(Object(y.a)(n.s))),ne(o)}(e,t);switch(e.type){case 1:return po(e,t);case 2:return ho(e,t)}return oo.throwError("unsupported transaction type: ".concat(e.type),w.b.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function bo(e,t,o){try{var r=no(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(i){oo.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Object(y.h)(t[1],32),e.s=Object(y.h)(t[2],32);try{var n=$(o(e));e.from=co(n,{r:e.r,s:e.s,recoveryParam:e.v})}catch(i){}}function yo(e){var t=Object(y.a)(e);if(t[0]>127)return function(e){var t=se(e);9!==t.length&&6!==t.length&&oo.throwArgumentError("invalid raw transaction","rawTransaction",e);var o={nonce:no(t[0]).toNumber(),gasPrice:no(t[1]),gasLimit:no(t[2]),to:ro(t[3]),value:no(t[4]),data:t[5],chainId:0};if(6===t.length)return o;try{o.v=I.from(t[6]).toNumber()}catch(a){return o}if(o.r=Object(y.h)(t[7],32),o.s=Object(y.h)(t[8],32),I.from(o.r).isZero()&&I.from(o.s).isZero())o.chainId=o.v,o.v=0;else{o.chainId=Math.floor((o.v-35)/2),o.chainId<0&&(o.chainId=0);var r=o.v-27,n=t.slice(0,6);0!==o.chainId&&(n.push(Object(y.i)(o.chainId)),n.push("0x"),n.push("0x"),r-=2*o.chainId+8);var i=$(ne(n));try{o.from=co(i,{r:Object(y.i)(o.r),s:Object(y.i)(o.s),recoveryParam:r})}catch(a){}o.hash=$(e)}return o.type=null,o}(t);switch(t[0]){case 1:return function(e){var t=se(e.slice(1));8!==t.length&&11!==t.length&&oo.throwArgumentError("invalid component count for transaction type: 1","payload",Object(y.i)(e));var o={type:1,chainId:no(t[0]).toNumber(),nonce:no(t[1]).toNumber(),gasPrice:no(t[2]),gasLimit:no(t[3]),to:ro(t[4]),value:no(t[5]),data:t[6],accessList:mo(t[7])};return 8===t.length||(o.hash=$(e),bo(o,t.slice(8),po)),o}(t);case 2:return function(e){var t=se(e.slice(1));9!==t.length&&12!==t.length&&oo.throwArgumentError("invalid component count for transaction type: 2","payload",Object(y.i)(e));var o=no(t[2]),r=no(t[3]),n={type:2,chainId:no(t[0]).toNumber(),nonce:no(t[1]).toNumber(),maxPriorityFeePerGas:o,maxFeePerGas:r,gasPrice:null,gasLimit:no(t[4]),to:ro(t[5]),value:no(t[6]),data:t[7],accessList:mo(t[8])};return 9===t.length||(n.hash=$(e),bo(n,t.slice(9),ho)),n}(t)}return oo.throwError("unsupported transaction type: ".concat(t[0]),w.b.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var vo=function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(t){i(t)}}function s(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},ko=new w.b("contracts/5.7.0"),wo={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function xo(e,t){return vo(this,void 0,void 0,Object(b.a)().mark((function o(){var r,n;return Object(b.a)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,t;case 2:return"string"!==typeof(r=o.sent)&&ko.throwArgumentError("invalid address or ENS name","name",r),o.prev=4,o.abrupt("return",ge(r));case 8:o.prev=8,o.t0=o.catch(4);case 10:return e||ko.throwError("a provider or signer is needed to resolve ENS names",w.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"}),o.next=13,e.resolveName(r);case 13:return null==(n=o.sent)&&ko.throwArgumentError("resolver or addr is not configured for ENS name","name",r),o.abrupt("return",n);case 16:case"end":return o.stop()}}),o,null,[[4,8]])})))}function zo(e,t,o){return vo(this,void 0,void 0,Object(b.a)().mark((function r(){return Object(b.a)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!Array.isArray(o)){r.next=4;break}return r.next=3,Promise.all(o.map((function(o,r){return zo(e,Array.isArray(t)?t[r]:t[o.name],o)})));case 3:case 7:case 11:case 17:return r.abrupt("return",r.sent);case 4:if("address"!==o.type){r.next=8;break}return r.next=7,xo(e,t);case 8:if("tuple"!==o.type){r.next=12;break}return r.next=11,zo(e,t,o.components);case 12:if("array"!==o.baseType){r.next=18;break}if(Array.isArray(t)){r.next=15;break}return r.abrupt("return",Promise.reject(ko.makeError("invalid value for array",w.b.errors.INVALID_ARGUMENT,{argument:"value",value:t})));case 15:return r.next=17,Promise.all(t.map((function(t){return zo(e,t,o.arrayChildren)})));case 18:return r.abrupt("return",t);case 19:case"end":return r.stop()}}),r)})))}function jo(e,t,o){return vo(this,void 0,void 0,Object(b.a)().mark((function r(){var n,i,a,s,c,u,l,m,f,d,h=this;return Object(b.a)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n={},o.length===t.inputs.length+1&&"object"===typeof o[o.length-1]&&(n=R(o.pop())),ko.checkArgumentCount(o.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=L({override:xo(e.signer,n.from),signer:e.signer.getAddress()}).then((function(e){return vo(h,void 0,void 0,Object(b.a)().mark((function t(){return Object(b.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ge(e.signer)!==e.override&&ko.throwError("Contract with a Signer cannot override from",w.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.abrupt("return",e.override);case 2:case"end":return t.stop()}}),t)})))})):n.from=e.signer.getAddress():n.from&&(n.from=xo(e.provider,n.from)),r.next=6,L({args:zo(e.signer||e.provider,o,t.inputs),address:e.resolvedAddress,overrides:L(n)||{}});case 6:if(i=r.sent,a=e.interface.encodeFunctionData(t,i.args),s={data:a,to:i.address},null!=(c=i.overrides).nonce&&(s.nonce=I.from(c.nonce).toNumber()),null!=c.gasLimit&&(s.gasLimit=I.from(c.gasLimit)),null!=c.gasPrice&&(s.gasPrice=I.from(c.gasPrice)),null!=c.maxFeePerGas&&(s.maxFeePerGas=I.from(c.maxFeePerGas)),null!=c.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=I.from(c.maxPriorityFeePerGas)),null!=c.from&&(s.from=c.from),null!=c.type&&(s.type=c.type),null!=c.accessList&&(s.accessList=mo(c.accessList)),null==s.gasLimit&&null!=t.gas){for(u=21e3,l=Object(y.a)(a),m=0;m1)){e=e.substring(1);var o=t[0];try{null==n[e]&&C(n,e,n[o])}catch(r){}null==n.functions[e]&&C(n.functions,e,n.functions[o]),null==n.callStatic[e]&&C(n.callStatic,e,n.callStatic[o]),null==n.populateTransaction[e]&&C(n.populateTransaction,e,n.populateTransaction[o]),null==n.estimateGas[e]&&C(n.estimateGas,e,n.estimateGas[o])}}))}return Object(g.a)(e,[{key:"deployed",value:function(){return this._deployed()}},{key:"_deployed",value:function(e){var t=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return t})):this._deployedPromise=this.provider.getCode(this.address,e).then((function(e){return"0x"===e&&ko.throwError("contract not deployed",w.b.errors.UNSUPPORTED_OPERATION,{contractAddress:t.address,operation:"getDeployed"}),t}))),this._deployedPromise}},{key:"fallback",value:function(e){var t=this;this.signer||ko.throwError("sending a transactions require a signer",w.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var o=R(e||{});return["from","to"].forEach((function(e){null!=o[e]&&ko.throwError("cannot override "+e,w.b.errors.UNSUPPORTED_OPERATION,{operation:e})})),o.to=this.resolvedAddress,this.deployed().then((function(){return t.signer.sendTransaction(o)}))}},{key:"connect",value:function(e){"string"===typeof e&&(e=new Wt(e,this.provider));var t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&C(t,"deployTransaction",this.deployTransaction),t}},{key:"attach",value:function(e){return new this.constructor(e,this.interface,this.signer||this.provider)}},{key:"_normalizeRunningEvent",value:function(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}},{key:"_getRunningEvent",value:function(e){if("string"===typeof e){if("error"===e)return this._normalizeRunningEvent(new So);if("event"===e)return this._normalizeRunningEvent(new Eo("event",null));if("*"===e)return this._normalizeRunningEvent(new _o(this.address,this.interface));var t=this.interface.getEvent(e);return this._normalizeRunningEvent(new No(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{var o=e.topics[0];if("string"!==typeof o)throw new Error("invalid topic");var r=this.interface.getEvent(o);return this._normalizeRunningEvent(new No(this.address,this.interface,r,e.topics))}catch(i){}var n={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Eo(Io(n),n))}return this._normalizeRunningEvent(new _o(this.address,this.interface))}},{key:"_checkRunningEvents",value:function(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];var t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}},{key:"_wrapEvent",value:function(e,t,o){var r=this,n=Q(t);return n.removeListener=function(){o&&(e.removeListener(o),r._checkRunningEvents(e))},n.getBlock=function(){return r.provider.getBlock(t.blockHash)},n.getTransaction=function(){return r.provider.getTransaction(t.transactionHash)},n.getTransactionReceipt=function(){return r.provider.getTransactionReceipt(t.transactionHash)},e.prepareEvent(n),n}},{key:"_addEventListener",value:function(e,t,o){var r=this;if(this.provider||ko.throwError("events require a provider or a signer with a provider",w.b.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,o),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){var n=function(o){var n=r._wrapEvent(e,o,t);if(null==n.decodeError)try{var i=e.getEmit(n);r.emit.apply(r,[e.filter].concat(Object(u.a)(i)))}catch(a){n.decodeError=a.error}null!=e.filter&&r.emit("event",n),null!=n.decodeError&&r.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=n,null!=e.filter&&this.provider.on(e.filter,n)}}},{key:"queryFilter",value:function(e,t,o){var r=this,n=this._getRunningEvent(e),i=R(n.filter);return"string"===typeof t&&Object(y.l)(t,32)?(null!=o&&ko.throwArgumentError("cannot specify toBlock with blockhash","toBlock",o),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=o?o:"latest"),this.provider.getLogs(i).then((function(e){return e.map((function(e){return r._wrapEvent(n,e,null)}))}))}},{key:"on",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}},{key:"once",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}},{key:"emit",value:function(e){if(!this.provider)return!1;for(var t=this._getRunningEvent(e),o=arguments.length,r=new Array(o>1?o-1:0),n=1;n0;return this._checkRunningEvents(t),i}},{key:"listenerCount",value:function(e){var t=this;return this.provider?null==e?Object.keys(this._runningEvents).reduce((function(e,o){return e+t._runningEvents[o].listenerCount()}),0):this._getRunningEvent(e).listenerCount():0}},{key:"listeners",value:function(e){if(!this.provider)return[];if(null==e){var t=[];for(var o in this._runningEvents)this._runningEvents[o].listeners().forEach((function(e){t.push(e)}));return t}return this._getRunningEvent(e).listeners()}},{key:"removeAllListeners",value:function(e){if(!this.provider)return this;if(null==e){for(var t in this._runningEvents){var o=this._runningEvents[t];o.removeAllListeners(),this._checkRunningEvents(o)}return this}var r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}},{key:"off",value:function(e,t){if(!this.provider)return this;var o=this._getRunningEvent(e);return o.removeListener(t),this._checkRunningEvents(o),this}},{key:"removeListener",value:function(e,t){return this.off(e,t)}}],[{key:"getContractAddress",value:function(e){return ve(e)}},{key:"getInterface",value:function(e){return Lt.isInterface(e)?e:new Lt(e)}},{key:"isIndexed",value:function(e){return Ot.isIndexed(e)}}]),e}(),Oo=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(p.a)(this,o),t.apply(this,arguments)}return Object(g.a)(o)}(To),Co=function(){function e(t,o,r){Object(p.a)(this,e);var n=null;"0x"!==(n="string"===typeof o?o:Object(y.j)(o)?Object(y.i)(o):o&&"string"===typeof o.object?o.object:"!").substring(0,2)&&(n="0x"+n),(!Object(y.l)(n)||n.length%2)&&ko.throwArgumentError("invalid bytecode","bytecode",o),r&&!Gt.isSigner(r)&&ko.throwArgumentError("invalid signer","signer",r),C(this,"bytecode",n),C(this,"interface",D(this instanceof e?this.constructor:void 0,"getInterface")(t)),C(this,"signer",r||null)}return Object(g.a)(e,[{key:"getDeployTransaction",value:function(){for(var e={},t=arguments.length,o=new Array(t),r=0;r=0&&e<=256&&!(e%1)?"1"+Uo.substring(0,e):Do.throwArgumentError("invalid decimal size","decimals",e)}function Qo(e,t){null==t&&(t=0);var o=Fo(t),r=(e=I.from(e)).lt(Po);r&&(e=e.mul(Ro));for(var n=e.mod(o).toString();n.length2&&Do.throwArgumentError("too many decimal points","value",e);var i=n[0],a=n[1];for(i||(i="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>o.length-1&&Bo("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length80&&Do.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new e(Lo,o,r,n)}}]),e}(),Go=function(){function e(t,o,r,n){Object(p.a)(this,e),t!==Lo&&Do.throwError("cannot use FixedNumber constructor; use FixedNumber.from",w.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=o,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}return Object(g.a)(e,[{key:"_checkFormat",value:function(e){this.format.name!==e.format.name&&Do.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}},{key:"addUnsafe",value:function(t){this._checkFormat(t);var o=Yo(this._value,this.format.decimals),r=Yo(t._value,t.format.decimals);return e.fromValue(o.add(r),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(t){this._checkFormat(t);var o=Yo(this._value,this.format.decimals),r=Yo(t._value,t.format.decimals);return e.fromValue(o.sub(r),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(t){this._checkFormat(t);var o=Yo(this._value,this.format.decimals),r=Yo(t._value,t.format.decimals);return e.fromValue(o.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(t){this._checkFormat(t);var o=Yo(this._value,this.format.decimals),r=Yo(t._value,t.format.decimals);return e.fromValue(o.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}},{key:"floor",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var o=e.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(o=o.subUnsafe(Wo.toFormat(o.format))),o}},{key:"ceiling",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var o=e.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(o=o.addUnsafe(Wo.toFormat(o.format))),o}},{key:"round",value:function(t){null==t&&(t=0);var o=this.toString().split(".");if(1===o.length&&o.push("0"),(t<0||t>80||t%1)&&Do.throwArgumentError("invalid decimal count","decimals",t),o[1].length<=t)return this;var r=e.from("1"+Uo.substring(0,t),this.format),n=Zo.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(e){if(null==e)return this._hex;e%8&&Do.throwArgumentError("invalid byte width","width",e);var t=I.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Object(y.h)(t,e/8)}},{key:"toUnsafeFloat",value:function(){return parseFloat(this.toString())}},{key:"toFormat",value:function(t){return e.fromString(this._value,t)}}],[{key:"fromValue",value:function(t,o,r){return null!=r||null==o||function(e){return null!=e&&(I.isBigNumber(e)||"number"===typeof e&&e%1===0||"string"===typeof e&&!!e.match(/^-?[0-9]+$/)||Object(y.l)(e)||"bigint"===typeof e||Object(y.j)(e))}(o)||(r=o,o=null),null==o&&(o=0),null==r&&(r="fixed"),e.fromString(Qo(t,o),Ho.from(r))}},{key:"fromString",value:function(t,o){null==o&&(o="fixed");var r=Ho.from(o),n=Yo(t,r.decimals);!r.signed&&n.lt(Po)&&Bo("unsigned value cannot be negative","overflow","value",t);var i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=Object(y.h)(i,r.width/8));var a=Qo(n,r.decimals);return new e(Lo,i,a,r)}},{key:"fromBytes",value:function(t,o){null==o&&(o="fixed");var r=Ho.from(o);if(Object(y.a)(t).length>r.width/8)throw new Error("overflow");var n=I.from(t);r.signed&&(n=n.fromTwos(r.width));var i=n.toTwos((r.signed?0:1)+r.width).toHexString(),a=Qo(n,r.decimals);return new e(Lo,i,a,r)}},{key:"from",value:function(t,o){if("string"===typeof t)return e.fromString(t,o);if(Object(y.j)(t))return e.fromBytes(t,o);try{return e.fromValue(t,0,o)}catch(r){if(r.code!==w.b.errors.INVALID_ARGUMENT)throw r}return Do.throwArgumentError("invalid FixedNumber value","value",t)}},{key:"isFixedNumber",value:function(e){return!(!e||!e._isFixedNumber)}}]),e}(),Wo=Go.from(1),Zo=Go.from("0.5"),Vo="\x19Ethereum Signed Message:\n";function Ko(e){return"string"===typeof e&&(e=qe(e)),$(Object(y.b)([qe(Vo),qe(String(e.length)),e]))}var Jo="hash/5.7.0",Xo=function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(t){i(t)}}function s(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},$o=new w.b(Jo),er=new Uint8Array(32);er.fill(0);var tr=I.from(-1),or=I.from(0),rr=I.from(1),nr=I.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var ir=Object(y.h)(rr.toHexString(),32),ar=Object(y.h)(or.toHexString(),32),sr={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},cr=["name","version","chainId","verifyingContract","salt"];function ur(e){return function(t){return"string"!==typeof t&&$o.throwArgumentError("invalid domain value for ".concat(JSON.stringify(e)),"domain.".concat(e),t),t}}var lr={name:ur("name"),version:ur("version"),chainId:function(e){try{return I.from(e).toString()}catch(t){}return $o.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return ge(e).toLowerCase()}catch(t){}return $o.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{var t=Object(y.a)(e);if(32!==t.length)throw new Error("bad length");return Object(y.i)(t)}catch(o){}return $o.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function mr(e){var t=e.match(/^(u?)int(\d*)$/);if(t){var o=""===t[1],r=parseInt(t[2]||"256");(r%8!==0||r>256||t[2]&&t[2]!==String(r))&&$o.throwArgumentError("invalid numeric width","type",e);var n=nr.mask(o?r-1:r),i=o?n.add(rr).mul(tr):or;return function(t){var o=I.from(t);return(o.lt(i)||o.gt(n))&&$o.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),Object(y.h)(o.toTwos(256).toHexString(),32)}}var a=e.match(/^bytes(\d+)$/);if(a){var s=parseInt(a[1]);return(0===s||s>32||a[1]!==String(s))&&$o.throwArgumentError("invalid bytes width","type",e),function(t){return Object(y.a)(t).length!==s&&$o.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=Object(y.a)(e),o=t.length%32;return o?Object(y.c)([t,er.slice(o)]):Object(y.i)(t)}(t)}}switch(e){case"address":return function(e){return Object(y.h)(ge(e),32)};case"bool":return function(e){return e?ir:ar};case"bytes":return function(e){return $(e)};case"string":return function(e){return Te(e)}}return null}function fr(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var dr,hr=function(){function e(t){Object(p.a)(this,e),C(this,"types",Object.freeze(Q(t))),C(this,"_encoderCache",{}),C(this,"_types",{});var o={},r={},n={};Object.keys(t).forEach((function(e){o[e]={},r[e]=[],n[e]={}}));var i=function(e){var n={};t[e].forEach((function(i){n[i.name]&&$o.throwArgumentError("duplicate variable name ".concat(JSON.stringify(i.name)," in ").concat(JSON.stringify(e)),"types",t),n[i.name]=!0;var a=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===e&&$o.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),mr(a)||(r[a]||$o.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",t),r[a].push(e),o[e][a]=!0)}))};for(var a in t)i(a);var s=Object.keys(r).filter((function(e){return 0===r[e].length}));for(var c in 0===s.length?$o.throwArgumentError("missing primary type","types",t):s.length>1&&$o.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),C(this,"primaryType",s[0]),function e(i,a){a[i]&&$o.throwArgumentError("circular type reference to ".concat(JSON.stringify(i)),"types",t),a[i]=!0,Object.keys(o[i]).forEach((function(t){r[t]&&(e(t,a),Object.keys(a).forEach((function(e){n[e][t]=!0})))})),delete a[i]}(this.primaryType,{}),n){var u=Object.keys(n[c]);u.sort(),this._types[c]=fr(c,t[c])+u.map((function(e){return fr(e,t[e])})).join("")}}return Object(g.a)(e,[{key:"getEncoder",value:function(e){var t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,o=mr(e);if(o)return o;var r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){var n=r[1],i=this.getEncoder(n),a=parseInt(r[3]);return function(e){a>=0&&e.length!==a&&$o.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var o=e.map(i);return t._types[n]&&(o=o.map($)),$(Object(y.c)(o))}}var s=this.types[e];if(s){var c=Te(this._types[e]);return function(e){var o=s.map((function(o){var r=o.name,n=o.type,i=t.getEncoder(n)(e[r]);return t._types[n]?$(i):i}));return o.unshift(c),Object(y.c)(o)}}return $o.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||$o.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return $(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,o){var r=this;if(mr(e))return o(e,t);var n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var i=n[1],a=parseInt(n[3]);return a>=0&&t.length!==a&&$o.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return r._visit(i,e,o)}))}var s=this.types[e];return s?s.reduce((function(e,n){var i=n.name,a=n.type;return e[i]=r._visit(a,t[i],o),e}),{}):$o.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}],[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,o,r){return e.from(o).hashStruct(t,r)}},{key:"hashDomain",value:function(t){var o=[];for(var r in t){var n=sr[r];n||$o.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(r)),"domain",t),o.push({name:r,type:n})}return o.sort((function(e,t){return cr.indexOf(e.name)-cr.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:o},t)}},{key:"encode",value:function(t,o,r){return Object(y.c)(["0x1901",e.hashDomain(t),e.from(o).hash(r)])}},{key:"hash",value:function(t,o,r){return $(e.encode(t,o,r))}},{key:"resolveNames",value:function(t,o,r,n){return Xo(this,void 0,void 0,Object(b.a)().mark((function i(){var a,s,c;return Object(b.a)().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:t=R(t),a={},t.verifyingContract&&!Object(y.l)(t.verifyingContract,20)&&(a[t.verifyingContract]="0x"),(s=e.from(o)).visit(r,(function(e,t){return"address"!==e||Object(y.l)(t,20)||(a[t]="0x"),t})),i.t0=Object(b.a)().keys(a);case 6:if((i.t1=i.t0()).done){i.next=13;break}return c=i.t1.value,i.next=10,n(c);case 10:a[c]=i.sent,i.next=6;break;case 13:return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),r=s.visit(r,(function(e,t){return"address"===e&&a[t]?a[t]:t})),i.abrupt("return",{domain:t,value:r});case 16:case"end":return i.stop()}}),i)})))}},{key:"getPayload",value:function(t,o,r){e.hashDomain(t);var n={},i=[];cr.forEach((function(e){var o=t[e];null!=o&&(n[e]=lr[e](o),i.push({name:e,type:sr[e]}))}));var a=e.from(o),s=R(o);return s.EIP712Domain?$o.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",o):s.EIP712Domain=i,a.encode(r),{types:s,domain:n,primaryType:a.primaryType,message:a.visit(r,(function(e,t){if(e.match(/^bytes(\d*)/))return Object(y.i)(Object(y.a)(t));if(e.match(/^u?int/))return I.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&$o.throwArgumentError("invalid string","value",t),t}return $o.throwArgumentError("unsupported type","type",e)}))}}}]),e}(),pr=function(){function e(t){Object(p.a)(this,e),C(this,"alphabet",t),C(this,"base",t.length),C(this,"_alphabetMap",{}),C(this,"_leader",t.charAt(0));for(var o=0;o0;)o.push(n%this.base),n=n/this.base|0}for(var a="",s=0;0===t[s]&&s=0;--c)a+=this.alphabet[o[c]];return a}},{key:"decode",value:function(e){if("string"!==typeof e)throw new TypeError("Expected String");var t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(var o=0;o>=8;for(;n>0;)t.push(255&n),n>>=8}for(var a=0;e[a]===this._leader&&a>24&255,l[t.length+1]=m>>16&255,l[t.length+2]=m>>8&255,l[t.length+3]=255&m;var f=Object(y.a)(zr(n,e,l));i||(i=f.length,s=new Uint8Array(i),a=r-((c=Math.ceil(r/i))-1)*i),s.set(f);for(var d=1;d=256)throw new Error("Depth too large!");return Lr(Object(y.b)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(y.i)(this.depth),this.parentFingerprint,Object(y.h)(Object(y.i)(this.index),4),this.chainCode,null!=this.privateKey?Object(y.b)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new e(Rr,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(t){if(t>4294967295)throw new Error("invalid index - "+String(t));var o=this.path;o&&(o+="/"+(t&~Or));var r=new Uint8Array(37);if(t&Or){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(Object(y.a)(this.privateKey),1),o&&(o+="'")}else r.set(Object(y.a)(this.publicKey));for(var n=24;n>=0;n-=8)r[33+(n>>3)]=t>>24-n&255;var i=Object(y.a)(zr(dr.sha512,this.chainCode,r)),a=i.slice(0,32),s=i.slice(32),c=null,u=null;this.privateKey?c=Dr(I.from(a).add(this.privateKey).mod(_r)):u=new Xt(Object(y.i)(a))._addPoint(this.publicKey);var l=o,m=this.mnemonic;return m&&(l=Object.freeze({phrase:m.phrase,path:o,locale:m.locale||"en"})),new e(Rr,c,u,this.fingerprint,Dr(s),t,this.depth+1,l)}},{key:"derivePath",value:function(e){var t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();for(var o=this,r=0;r=Or)throw new Error("invalid path index - "+n);o=o._derive(Or+i)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);var a=parseInt(n);if(a>=Or)throw new Error("invalid path index - "+n);o=o._derive(a)}}return o}}],[{key:"_fromSeed",value:function(t,o){var r=Object(y.a)(t);if(r.length<16||r.length>64)throw new Error("invalid seed");var n=Object(y.a)(zr(dr.sha512,Tr,r));return new e(Rr,Dr(n.slice(0,32)),null,"0x00000000",Dr(n.slice(32)),0,0,o)}},{key:"fromMnemonic",value:function(t,o,r){return t=Yr(Qr(t,r=Pr(r)),r),e._fromSeed(Fr(t,o),{phrase:t,path:"m",locale:r.locale})}},{key:"fromSeed",value:function(t){return e._fromSeed(t,null)}},{key:"fromExtendedKey",value:function(t){var o=gr.decode(t);82===o.length&&Lr(o.slice(0,78))===t||Nr.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var r=o[4],n=Object(y.i)(o.slice(5,9)),i=parseInt(Object(y.i)(o.slice(9,13)).substring(2),16),a=Object(y.i)(o.slice(13,45)),s=o.slice(45,78);switch(Object(y.i)(o.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new e(Rr,null,Object(y.i)(s),n,a,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==s[0])break;return new e(Rr,Object(y.i)(s.slice(1)),null,n,a,i,r,null)}return Nr.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}]),e}();function Fr(e,t){t||(t="");var o=qe("mnemonic"+t,we.NFKD);return jr(qe(e,we.NFKD),o,2048,64,"sha512")}function Qr(e,t){t=Pr(t),Nr.checkNormalize();var o=t.split(e);if(o.length%3!==0)throw new Error("invalid mnemonic");for(var r=Object(y.a)(new Uint8Array(Math.ceil(11*o.length/8))),n=0,i=0;i>3]|=1<<7-n%8),n++}var c=32*o.length/3,u=Cr(o.length/3);if((Object(y.a)(wr(r.slice(0,c/8)))[0]&u)!==(r[r.length-1]&u))throw new Error("invalid checksum");return Object(y.i)(r.slice(0,c/8))}function Yr(e,t){if(t=Pr(t),(e=Object(y.a)(e)).length%4!==0||e.length<16||e.length>32)throw new Error("invalid entropy");for(var o=[0],r=11,n=0;n8?(o[o.length-1]<<=8,o[o.length-1]|=e[n],r-=8):(o[o.length-1]<<=r,o[o.length-1]|=e[n]>>8-r,o.push(e[n]&(1<<8-r)-1),r+=3);var i=e.length/4,a=Object(y.a)(wr(e))[0]&Cr(i);return o[o.length-1]<<=i,o[o.length-1]|=a>>8-i,t.join(o.map((function(e){return t.getWord(e)})))}function Hr(e,t){try{return Qr(e,t),!0}catch(o){}return!1}function Gr(e){return("number"!==typeof e||e<0||e>=Or||e%1)&&Nr.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}var Wr=o(661),Zr=o(58),Vr=o.n(Zr),Kr=o(124),Jr=o.n(Kr);function Xr(e){return"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Object(y.a)(e)}function $r(e,t){for(e=String(e);e.length0&&Array.isArray(t)?e(t,n-1):o.push(t)}))}(e,t),o}function Un(e){return function(e){var t=0;return function(){return e[t++]}}(function(e){var t=0;function o(){return e[t++]<<8|e[t++]}for(var r=o(),n=1,i=[0,1],a=1;a>--u&1}for(var f=Math.pow(2,31),d=f>>>1,h=d>>1,p=f-1,g=0,b=0;b<31;b++)g=g<<1|m();for(var y=[],v=0,k=f;;){for(var w=Math.floor(((g-v+1)*n-1)/k),x=0,z=r;z-x>1;){var j=x+z>>>1;w>>1|m(),M=M<<1^d,A=(A^d)<<1|d|1;v=M,k=1+A-M}var q=r-4;return y.map((function(t){switch(t-q){case 3:return q+65792+(e[c++]<<16|e[c++]<<8|e[c++]);case 2:return q+256+(e[c++]<<8|e[c++]);case 1:return q+e[c++];default:return t-1}}))}(e))}function Fn(e){return 1&e?~e>>1:e>>1}function Qn(e,t){for(var o=Array(e),r=0,n=-1;r>=1),check:2==i}}()}(Vn),ei=45,ti=95;function oi(e){return _e(e)}function ri(e){return e.filter((function(e){return 65039!=e}))}function ni(e){var t,o=Object(Rn.a)(e.split("."));try{for(o.s();!(t=o.n()).done;){var r=t.value,n=oi(r);try{for(var i=n.lastIndexOf(ti)-1;i>=0;i--)if(n[i]!==ti)throw new Error("underscore only allowed at start");if(n.length>=4&&n.every((function(e){return e<128}))&&n[2]===ei&&n[3]===ei)throw new Error("invalid label extension")}catch(a){throw new Error('Invalid label "'.concat(r,'": ').concat(a.message))}}}catch(a){o.e(a)}finally{o.f()}return e}function ii(e){return ni(function(e,t){var o=oi(e).reverse(),r=[];for(;o.length;){var n=ai(o);if(n)r.push.apply(r,Object(u.a)(t(n)));else{var i=o.pop();if(Kn.has(i))r.push(i);else if(!Jn.has(i)){var a=Xn[i];if(!a)throw new Error("Disallowed codepoint: 0x".concat(i.toString(16).toUpperCase()));r.push.apply(r,Object(u.a)(a))}}}return ni((s=String.fromCodePoint.apply(String,r),s.normalize("NFC")));var s}(e,ri))}function ai(e,t){var o,r,n,i=$n,a=[],s=e.length;t&&(t.length=0);for(var c=function(){var c=e[--s];if(i=null===(o=i.branches.find((function(e){return e.set.has(c)})))||void 0===o?void 0:o.node,!i)return"break";if(i.save)n=c;else if(i.check&&c===n)return"break";a.push(c),i.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),i.valid&&(r=a.slice(),2==i.valid&&r.splice(1,1),t&&t.push.apply(t,Object(u.a)(e.slice(s).reverse())),e.length=s)};s;){if("break"===c())break}return r}var si=new w.b(Jo),ci=new Uint8Array(32);function ui(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function li(e){var t=qe(ii(e)),o=[];if(0===e.length)return o;for(var r=0,n=0;n=t.length)throw new Error("invalid ENS name; empty component");return o.push(ui(t.slice(r))),o}function mi(e){try{return 0!==li(e).length}catch(t){}return!1}function fi(e){"string"!==typeof e&&si.throwArgumentError("invalid ENS name; not a string","name",e);for(var t=ci,o=li(e);o.length;)t=$(Object(y.b)([t,$(o.pop())]));return Object(y.i)(t)}function di(e){return Object(y.i)(Object(y.b)(li(e).map((function(e){if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");var t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}ci.fill(0);var hi=function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(t){i(t)}}function s(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};function pi(e,t){return hi(this,void 0,void 0,Object(b.a)().mark((function o(){var r,n,i,a,s;return Object(b.a)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return null==t&&(t={}),r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0},!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions&&((n=t.fetchOptions).mode&&(r.mode=n.mode),n.cache&&(r.cache=n.cache),n.credentials&&(r.credentials=n.credentials),n.redirect&&(r.redirect=n.redirect),n.referrer&&(r.referrer=n.referrer)),o.next=7,fetch(e,r);case 7:return i=o.sent,o.next=10,i.arrayBuffer();case 10:return a=o.sent,s={},i.headers.forEach?i.headers.forEach((function(e,t){s[t.toLowerCase()]=e})):i.headers.keys().forEach((function(e){s[e.toLowerCase()]=i.headers.get(e)})),o.abrupt("return",{headers:s,statusCode:i.status,statusMessage:i.statusText,body:Object(y.a)(new Uint8Array(a))});case 14:case"end":return o.stop()}}),o)})))}var gi=function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(t){i(t)}}function s(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},bi=new w.b("web/5.7.1");function yi(e){return new Promise((function(t){setTimeout(t,e)}))}function vi(e,t){if(null==e)return null;if("string"===typeof e)return e;if(Object(y.k)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Ne(e)}catch(o){}return Object(y.i)(e)}return e}function ki(e,t,o){var r="object"===typeof e&&null!=e.throttleLimit?e.throttleLimit:12;bi.assertArgument(r>0&&r%1===0,"invalid connection throttle limit","connection.throttleLimit",r);var n="object"===typeof e?e.throttleCallback:null,i="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;bi.assertArgument(i>0&&i%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",i);var a="object"===typeof e&&!!e.errorPassThrough,s={},c=null,u={method:"GET"},l=!1,m=12e4;if("string"===typeof e)c=e;else if("object"===typeof e){if(null!=e&&null!=e.url||bi.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"===typeof e.timeout&&e.timeout>0&&(m=e.timeout),e.headers)for(var f in e.headers)s[f.toLowerCase()]={key:f,value:String(e.headers[f])},["if-none-match","if-modified-since"].indexOf(f.toLowerCase())>=0&&(l=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&bi.throwError("basic authentication requires a secure https url",w.b.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});var d=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+Pn(qe(d))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=R(e.fetchOptions))}var h,p=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),g=c?c.match(p):null;if(g)try{var y={statusCode:200,statusMessage:"OK",headers:{"content-type":g[1]||"text/plain"},body:g[2]?Ln(g[3]):(h=g[3],qe(h.replace(/%([0-9a-f][0-9a-f])/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))))},v=y.body;return o&&(v=o(y.body,y)),Promise.resolve(v)}catch(j){bi.throwError("processing response error",w.b.errors.SERVER_ERROR,{body:vi(g[1],g[2]),error:j,requestBody:null,requestMethod:"GET",url:c})}t&&(u.method="POST",u.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));var k={};Object.keys(s).forEach((function(e){var t=s[e];k[t.key]=t.value})),u.headers=k;var x=function(){var e=null;return{promise:new Promise((function(t,o){m&&(e=setTimeout((function(){null!=e&&(e=null,o(bi.makeError("timeout",w.b.errors.TIMEOUT,{requestBody:vi(u.body,k["content-type"]),requestMethod:u.method,timeout:m,url:c})))}),m))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),z=function(){return gi(this,void 0,void 0,Object(b.a)().mark((function e(){var t,s,m,f,d,h,p,g,y,v;return Object(b.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t=300)&&(x.cancel(),bi.throwError("bad response",w.b.errors.SERVER_ERROR,{status:s.statusCode,headers:s.headers,body:vi(p,s.headers?s.headers["content-type"]:null),requestBody:vi(u.body,k["content-type"]),requestMethod:u.method,url:c})),!o){e.next=60;break}return e.prev=37,e.next=40,o(p,s);case 40:return g=e.sent,x.cancel(),e.abrupt("return",g);case 45:if(e.prev=45,e.t1=e.catch(37),!(e.t1.throttleRetry&&ts)return void(a()&&r(new Error("retry limit reached")));var u=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));ut.ceiling&&(u=t.ceiling),setTimeout(n,u)}return null}),(function(e){a()&&r(e)}))}()}))}var zi=o(161),ji=o.n(zi),Mi="providers/5.7.2",Ai=new w.b(Mi),qi=function(){function e(){Object(p.a)(this,e),this.formats=this.getDefaultFormats()}return Object(g.a)(e,[{key:"getDefaultFormats",value:function(){var t=this,o={},r=this.address.bind(this),n=this.bigNumber.bind(this),i=this.blockTag.bind(this),a=this.data.bind(this),s=this.hash.bind(this),c=this.hex.bind(this),u=this.number.bind(this),l=this.type.bind(this);return o.transaction={hash:s,type:l,accessList:e.allowNull(this.accessList.bind(this),null),blockHash:e.allowNull(s,null),blockNumber:e.allowNull(u,null),transactionIndex:e.allowNull(u,null),confirmations:e.allowNull(u,null),from:r,gasPrice:e.allowNull(n),maxPriorityFeePerGas:e.allowNull(n),maxFeePerGas:e.allowNull(n),gasLimit:n,to:e.allowNull(r,null),value:n,nonce:u,data:a,r:e.allowNull(this.uint256),s:e.allowNull(this.uint256),v:e.allowNull(u),creates:e.allowNull(r,null),raw:e.allowNull(a)},o.transactionRequest={from:e.allowNull(r),nonce:e.allowNull(u),gasLimit:e.allowNull(n),gasPrice:e.allowNull(n),maxPriorityFeePerGas:e.allowNull(n),maxFeePerGas:e.allowNull(n),to:e.allowNull(r),value:e.allowNull(n),data:e.allowNull((function(e){return t.data(e,!0)})),type:e.allowNull(u),accessList:e.allowNull(this.accessList.bind(this),null)},o.receiptLog={transactionIndex:u,blockNumber:u,transactionHash:s,address:r,topics:e.arrayOf(s),data:a,logIndex:u,blockHash:s},o.receipt={to:e.allowNull(this.address,null),from:e.allowNull(this.address,null),contractAddress:e.allowNull(r,null),transactionIndex:u,root:e.allowNull(c),gasUsed:n,logsBloom:e.allowNull(a),blockHash:s,transactionHash:s,logs:e.arrayOf(this.receiptLog.bind(this)),blockNumber:u,confirmations:e.allowNull(u,null),cumulativeGasUsed:n,effectiveGasPrice:e.allowNull(n),status:e.allowNull(u),type:l},o.block={hash:e.allowNull(s),parentHash:s,number:u,timestamp:u,nonce:e.allowNull(c),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:e.allowNull(r),extraData:a,transactions:e.allowNull(e.arrayOf(s)),baseFeePerGas:e.allowNull(n)},o.blockWithTransactions=R(o.block),o.blockWithTransactions.transactions=e.allowNull(e.arrayOf(this.transactionResponse.bind(this))),o.filter={fromBlock:e.allowNull(i,void 0),toBlock:e.allowNull(i,void 0),blockHash:e.allowNull(s,void 0),address:e.allowNull(r,void 0),topics:e.allowNull(this.topics.bind(this),void 0)},o.filterLog={blockNumber:e.allowNull(u),blockHash:e.allowNull(s),transactionIndex:u,removed:e.allowNull(this.boolean.bind(this)),address:r,data:e.allowFalsish(a,"0x"),topics:e.arrayOf(s),transactionHash:s,logIndex:u},o}},{key:"accessList",value:function(e){return mo(e||[])}},{key:"number",value:function(e){return"0x"===e?0:I.from(e).toNumber()}},{key:"type",value:function(e){return"0x"===e||null==e?0:I.from(e).toNumber()}},{key:"bigNumber",value:function(e){return I.from(e)}},{key:"boolean",value:function(e){if("boolean"===typeof e)return e;if("string"===typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}},{key:"hex",value:function(e,t){return"string"===typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),Object(y.l)(e))?e.toLowerCase():Ai.throwArgumentError("invalid hash","value",e)}},{key:"data",value:function(e,t){var o=this.hex(e,t);if(o.length%2!==0)throw new Error("invalid data; odd-length - "+e);return o}},{key:"address",value:function(e){return ge(e)}},{key:"callAddress",value:function(e){if(!Object(y.l)(e,32))return null;var t=ge(Object(y.e)(e,12));return t===An?null:t}},{key:"contractAddress",value:function(e){return ve(e)}},{key:"blockTag",value:function(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"===typeof e||Object(y.l)(e))return Object(y.g)(e);throw new Error("invalid blockTag")}},{key:"hash",value:function(e,t){var o=this.hex(e,t);return 32!==Object(y.d)(o)?Ai.throwArgumentError("invalid hash","value",e):o}},{key:"difficulty",value:function(e){if(null==e)return null;var t=I.from(e);try{return t.toNumber()}catch(o){}return null}},{key:"uint256",value:function(e){if(!Object(y.l)(e))throw new Error("invalid uint256");return Object(y.h)(e,32)}},{key:"_block",value:function(t,o){null!=t.author&&null==t.miner&&(t.miner=t.author);var r=null!=t._difficulty?t._difficulty:t.difficulty,n=e.check(o,t);return n._difficulty=null==r?null:I.from(r),n}},{key:"block",value:function(e){return this._block(e,this.formats.block)}},{key:"blockWithTransactions",value:function(e){return this._block(e,this.formats.blockWithTransactions)}},{key:"transactionRequest",value:function(t){return e.check(this.formats.transactionRequest,t)}},{key:"transactionResponse",value:function(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&I.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);var o=e.check(this.formats.transaction,t);if(null!=t.chainId){var r=t.chainId;Object(y.l)(r)&&(r=I.from(r).toNumber()),o.chainId=r}else{var n=t.networkId;null==n&&null==o.v&&(n=t.chainId),Object(y.l)(n)&&(n=I.from(n).toNumber()),"number"!==typeof n&&null!=o.v&&((n=(o.v-35)/2)<0&&(n=0),n=parseInt(n)),"number"!==typeof n&&(n=0),o.chainId=n}return o.blockHash&&"x"===o.blockHash.replace(/0/g,"")&&(o.blockHash=null),o}},{key:"transaction",value:function(e){return yo(e)}},{key:"receiptLog",value:function(t){return e.check(this.formats.receiptLog,t)}},{key:"receipt",value:function(t){var o=e.check(this.formats.receipt,t);if(null!=o.root)if(o.root.length<=4){var r=I.from(o.root).toNumber();0===r||1===r?(null!=o.status&&o.status!==r&&Ai.throwArgumentError("alt-root-status/status mismatch","value",{root:o.root,status:o.status}),o.status=r,delete o.root):Ai.throwArgumentError("invalid alt-root-status","value.root",o.root)}else 66!==o.root.length&&Ai.throwArgumentError("invalid root hash","value.root",o.root);return null!=o.status&&(o.byzantium=!0),o}},{key:"topics",value:function(e){var t=this;return Array.isArray(e)?e.map((function(e){return t.topics(e)})):null!=e?this.hash(e,!0):null}},{key:"filter",value:function(t){return e.check(this.formats.filter,t)}},{key:"filterLog",value:function(t){return e.check(this.formats.filterLog,t)}}],[{key:"check",value:function(e,t){var o={};for(var r in e)try{var n=e[r](t[r]);void 0!==n&&(o[r]=n)}catch(i){throw i.checkKey=r,i.checkValue=t[r],i}return o}},{key:"allowNull",value:function(e,t){return function(o){return null==o?t:e(o)}}},{key:"allowFalsish",value:function(e,t){return function(o){return o?e(o):t}}},{key:"arrayOf",value:function(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");var o=[];return t.forEach((function(t){o.push(e(t))})),o}}}]),e}();function Ii(e){return e&&"function"===typeof e.isCommunityResource}function Ei(e){return Ii(e)&&e.isCommunityResource()}var Si=!1;function Ni(){Si||(Si=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var _i=function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(t){i(t)}}function s(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Ti=new w.b(Mi);function Oi(e){return null==e?"null":(32!==Object(y.d)(e)&&Ti.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Ci(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((function(e){if(Array.isArray(e)){var t={};e.forEach((function(e){t[Oi(e)]=!0}));var o=Object.keys(t);return o.sort(),o.join("|")}return Oi(e)})).join("&")}function Di(e){if("string"===typeof e){if(e=e.toLowerCase(),32===Object(y.d)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Ci(e);if(Bt.isForkEvent(e))throw Ti.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+Ci(e.topics||[])}throw new Error("invalid event - "+e)}function Li(){return(new Date).getTime()}function Pi(e){return new Promise((function(t){setTimeout(t,e)}))}var Ri=["block","network","pending","poll"],Bi=function(){function e(t,o,r){Object(p.a)(this,e),C(this,"tag",t),C(this,"listener",o),C(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}return Object(g.a)(e,[{key:"event",get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}},{key:"filter",get:function(){var e=this.tag.split(":");if("filter"!==e[0])return null;var t,o=e[1],r=""===(t=e[2])?[]:t.split(/&/g).map((function(e){if(""===e)return[];var t=e.split("|").map((function(e){return"null"===e?null:e}));return 1===t.length?t[0]:t})),n={};return r.length>0&&(n.topics=r),o&&"*"!==o&&(n.address=o),n}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||Ri.indexOf(this.tag)>=0}}]),e}(),Ui={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Fi(e){return Object(y.h)(I.from(e).toHexString(),32)}function Qi(e){return gr.encode(Object(y.b)([e,Object(y.e)(wr(wr(e)),0,4)]))}var Yi=new RegExp("^(ipfs)://(.*)$","i"),Hi=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Yi,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Gi(e,t){try{return Ne(Wi(e,t))}catch(o){}return null}function Wi(e,t){if("0x"===e)return null;var o=I.from(Object(y.e)(e,t,t+32)).toNumber(),r=I.from(Object(y.e)(e,o,o+32)).toNumber();return Object(y.e)(e,o+32,o+32+r)}function Zi(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Ti.throwArgumentError("unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}function Vi(e){var t=Object(y.a)(e);if(t.length>32)throw new Error("internal; should not happen");var o=new Uint8Array(32);return o.set(t,32-t.length),o}function Ki(e){if(e.length%32===0)return e;var t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function Ji(e){for(var t=[],o=0,r=0;r=1&&i<=75)return Qi(Object(y.b)([[o.p2pkh],"0x"+n[2]]))}}if(null!=o.p2sh){var a=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(a){var s=parseInt(a[1],16);if(a[2].length===2*s&&s>=1&&s<=75)return Qi(Object(y.b)([[o.p2sh],"0x"+a[2]]))}}if(null!=o.prefix){var c=r[1],u=r[0];if(0===u?20!==c&&32!==c&&(u=-1):u=-1,u>=0&&r.length===2+c&&c>=1&&c<=75){var l=ji.a.toWords(r.slice(2));return l.unshift(u),ji.a.encode(o.prefix,l)}}return null}},{key:"getAddress",value:function(e){return _i(this,void 0,void 0,Object(b.a)().mark((function t(){var o,r,n;return Object(b.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==e&&(e=60),60!==e){t.next=16;break}return t.prev=2,t.next=5,this._fetch("0x3b3b57de");case 5:if("0x"!==(o=t.sent)&&o!==qn){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",this.provider.formatter.callAddress(o));case 11:if(t.prev=11,t.t0=t.catch(2),t.t0.code!==w.b.errors.CALL_EXCEPTION){t.next=15;break}return t.abrupt("return",null);case 15:throw t.t0;case 16:return t.next=18,this._fetchBytes("0xf1cb7e06",Fi(e));case 18:if(null!=(r=t.sent)&&"0x"!==r){t.next=21;break}return t.abrupt("return",null);case 21:return null==(n=this._getAddress(e,r))&&Ti.throwError("invalid or unsupported coin data",w.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:r}),t.abrupt("return",n);case 24:case"end":return t.stop()}}),t,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return _i(this,void 0,void 0,Object(b.a)().mark((function e(){var t,o,r,n,i,a,s,c,u,l,m,f,d,h,p,g;return Object(b.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[{type:"name",content:this.name}],e.prev=1,e.next=4,this.getText("avatar");case 4:if(null!=(o=e.sent)){e.next=7;break}return e.abrupt("return",null);case 7:r=0;case 8:if(!(r=0?null:JSON.stringify({data:i,sender:n}),r.next=12,wi({url:u,errorPassThrough:!0},l,(function(e,t){return e.status=t.statusCode,e}));case 12:if(!(m=r.sent).data){r.next=15;break}return r.abrupt("return",m.data);case 15:if(f=m.message||"unknown error",!(m.status>=400&&m.status<500)){r.next=18;break}return r.abrupt("return",Ti.throwError("response not found during CCIP fetch: ".concat(f),w.b.errors.SERVER_ERROR,{url:c,errorMessage:f}));case 18:a.push(f);case 19:s++,r.next=6;break;case 22:return r.abrupt("return",Ti.throwError("error encountered during CCIP fetch: ".concat(a.map((function(e){return JSON.stringify(e)})).join(", ")),w.b.errors.SERVER_ERROR,{urls:o,errorMessages:a}));case 23:case"end":return r.stop()}}),r,this)})))}},{key:"_getInternalBlockNumber",value:function(e){return _i(this,void 0,void 0,Object(b.a)().mark((function t(){var o,r,n,i,a=this;return Object(b.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._ready();case 2:if(!(e>0)){t.next=20;break}case 3:if(!this._internalBlockNumber){t.next=20;break}return o=this._internalBlockNumber,t.prev=5,t.next=8,o;case 8:if(r=t.sent,!(Li()-r.respTime<=e)){t.next=11;break}return t.abrupt("return",r.blockNumber);case 11:return t.abrupt("break",20);case 14:if(t.prev=14,t.t0=t.catch(5),this._internalBlockNumber!==o){t.next=18;break}return t.abrupt("break",20);case 18:t.next=3;break;case 20:return n=Li(),i=L({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(e){return null}),(function(e){return e}))}).then((function(e){var t=e.blockNumber,o=e.networkError;if(o)throw a._internalBlockNumber===i&&(a._internalBlockNumber=null),o;var r=Li();return(t=I.from(t).toNumber())1e3)Ti.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(r,")")),this.emit("error",Ti.makeError("network block skew detected",w.b.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(n=this._emitted.block+1;n<=r;n++)this.emit("block",n);return this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((function(e){if("block"!==e){var t=i._emitted[e];"pending"!==t&&r-t>12&&delete i._emitted[e]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((function(e){switch(e.type){case"tx":var t=e.hash,n=i.getTransactionReceipt(t).then((function(e){return e&&null!=e.blockNumber?(i._emitted["t:"+t]=e.blockNumber,i.emit(t,e),null):null})).catch((function(e){i.emit("error",e)}));o.push(n);break;case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);var a=e.filter;a.fromBlock=e._lastBlockNumber+1,a.toBlock=r;var s=a.toBlock-i._maxFilterBlockRange;s>a.fromBlock&&(a.fromBlock=s),a.fromBlock<0&&(a.fromBlock=0);var c=i.getLogs(a).then((function(t){e._inflight=!1,0!==t.length&&t.forEach((function(t){t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),i._emitted["b:"+t.blockHash]=t.blockNumber,i._emitted["t:"+t.transactionHash]=t.blockNumber,i.emit(a,t)}))})).catch((function(t){i.emit("error",t),e._inflight=!1}));o.push(c)}}})),this._lastBlockNumber=r,Promise.all(o).then((function(){i.emit("didPoll",t)})).catch((function(e){i.emit("error",e)})),e.abrupt("return");case 26:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return _i(this,void 0,void 0,Object(b.a)().mark((function e(){return Object(b.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Ti.throwError("provider does not support network detection",w.b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return e.stop()}}),e)})))}},{key:"getNetwork",value:function(){return _i(this,void 0,void 0,Object(b.a)().mark((function e(){var t,o,r;return Object(b.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready();case 2:return t=e.sent,e.next=5,this.detectNetwork();case 5:if(o=e.sent,t.chainId===o.chainId){e.next=23;break}if(!this.anyNetwork){e.next=20;break}return this._network=o,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",o,t),e.next=19,Pi(0);case 19:return e.abrupt("return",this._network);case 20:throw r=Ti.makeError("underlying network changed",w.b.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:o}),this.emit("error",r),r;case 23:return e.abrupt("return",t);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"blockNumber",get:function(){var e=this;return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(t){e._setFastBlockNumber(t)}),(function(e){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(e){var t=this;e&&!this._poller?(this._poller=setInterval((function(){t.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){t.poll(),t._bootstrapPoll=setTimeout((function(){t._poller||t.poll(),t._bootstrapPoll=null}),t.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(e){var t=this;if("number"!==typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){t.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var e=this,t=Li();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((function(t){return(null==e._fastBlockNumber||t>e._fastBlockNumber)&&(e._fastBlockNumber=t),e._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}},{key:"waitForTransaction",value:function(e,t,o){return _i(this,void 0,void 0,Object(b.a)().mark((function r(){return Object(b.a)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._waitForTransaction(e,null==t?1:t,o||0,null));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"_waitForTransaction",value:function(e,t,o,r){return _i(this,void 0,void 0,Object(b.a)().mark((function n(){var i,a=this;return Object(b.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getTransactionReceipt(e);case 2:if(!(((i=n.sent)?i.confirmations:0)>=t)){n.next=5;break}return n.abrupt("return",i);case 5:return n.abrupt("return",new Promise((function(n,i){var s=[],c=!1,u=function(){return!!c||(c=!0,s.forEach((function(e){e()})),!1)},l=function(e){e.confirmations0){var h=setTimeout((function(){u()||i(Ti.makeError("timeout exceeded",w.b.errors.TIMEOUT,{timeout:o}))}),o);h.unref&&h.unref(),s.push((function(){clearTimeout(h)}))}})));case 6:case"end":return n.stop()}}),n,this)})))}},{key:"getBlockNumber",value:function(){return _i(this,void 0,void 0,Object(b.a)().mark((function e(){return Object(b.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getInternalBlockNumber(0));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return _i(this,void 0,void 0,Object(b.a)().mark((function e(){var t;return Object(b.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,this.perform("getGasPrice",{});case 4:return t=e.sent,e.prev=5,e.abrupt("return",I.from(t));case 9:return e.prev=9,e.t0=e.catch(5),e.abrupt("return",Ti.throwError("bad result from backend",w.b.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e.t0}));case 12:case"end":return e.stop()}}),e,this,[[5,9]])})))}},{key:"getBalance",value:function(e,t){return _i(this,void 0,void 0,Object(b.a)().mark((function o(){var r,n;return Object(b.a)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.getNetwork();case 2:return o.next=4,L({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=o.sent,o.next=7,this.perform("getBalance",r);case 7:return n=o.sent,o.prev=8,o.abrupt("return",I.from(n));case 12:return o.prev=12,o.t0=o.catch(8),o.abrupt("return",Ti.throwError("bad result from backend",w.b.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:o.t0}));case 15:case"end":return o.stop()}}),o,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(e,t){return _i(this,void 0,void 0,Object(b.a)().mark((function o(){var r,n;return Object(b.a)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.getNetwork();case 2:return o.next=4,L({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=o.sent,o.next=7,this.perform("getTransactionCount",r);case 7:return n=o.sent,o.prev=8,o.abrupt("return",I.from(n).toNumber());case 12:return o.prev=12,o.t0=o.catch(8),o.abrupt("return",Ti.throwError("bad result from backend",w.b.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:o.t0}));case 15:case"end":return o.stop()}}),o,this,[[8,12]])})))}},{key:"getCode",value:function(e,t){return _i(this,void 0,void 0,Object(b.a)().mark((function o(){var r,n;return Object(b.a)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.getNetwork();case 2:return o.next=4,L({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=o.sent,o.next=7,this.perform("getCode",r);case 7:return n=o.sent,o.prev=8,o.abrupt("return",Object(y.i)(n));case 12:return o.prev=12,o.t0=o.catch(8),o.abrupt("return",Ti.throwError("bad result from backend",w.b.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:o.t0}));case 15:case"end":return o.stop()}}),o,this,[[8,12]])})))}},{key:"getStorageAt",value:function(e,t,o){return _i(this,void 0,void 0,Object(b.a)().mark((function r(){var n,i;return Object(b.a)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,L({address:this._getAddress(e),blockTag:this._getBlockTag(o),position:Promise.resolve(t).then((function(e){return Object(y.g)(e)}))});case 4:return n=r.sent,r.next=7,this.perform("getStorageAt",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",Object(y.i)(i));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",Ti.throwError("bad result from backend",w.b.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(e,t,o){var r=this;if(null!=t&&32!==Object(y.d)(t))throw new Error("invalid response - sendTransaction");var n=e;return null!=t&&e.hash!==t&&Ti.throwError("Transaction hash mismatch from Provider.sendTransaction.",w.b.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=function(t,n){return _i(r,void 0,void 0,Object(b.a)().mark((function r(){var i,a;return Object(b.a)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t=1),null==n&&(n=0),i=void 0,0!==t&&null!=o&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:o}),r.next=6,this._waitForTransaction(e.hash,t,n,i);case 6:if(null!=(a=r.sent)||0!==t){r.next=9;break}return r.abrupt("return",null);case 9:return this._emitted["t:"+e.hash]=a.blockNumber,0===a.status&&Ti.throwError("transaction failed",w.b.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:a}),r.abrupt("return",a);case 12:case"end":return r.stop()}}),r,this)})))},n}},{key:"sendTransaction",value:function(e){return _i(this,void 0,void 0,Object(b.a)().mark((function t(){var o,r,n,i;return Object(b.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,Promise.resolve(e).then((function(e){return Object(y.i)(e)}));case 4:return o=t.sent,null==(r=this.formatter.transaction(e)).confirmations&&(r.confirmations=0),t.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval);case 9:return n=t.sent,t.prev=10,t.next=13,this.perform("sendTransaction",{signedTransaction:o});case 13:return i=t.sent,t.abrupt("return",this._wrapTransaction(r,i,n));case 17:throw t.prev=17,t.t0=t.catch(10),t.t0.transaction=r,t.t0.transactionHash=r.hash,t.t0;case 22:case"end":return t.stop()}}),t,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(e){return _i(this,void 0,void 0,Object(b.a)().mark((function t(){var o,r,n=this;return Object(b.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return o=t.sent,r={},["from","to"].forEach((function(e){null!=o[e]&&(r[e]=Promise.resolve(o[e]).then((function(e){return e?n._getAddress(e):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(e){null!=o[e]&&(r[e]=Promise.resolve(o[e]).then((function(e){return e?I.from(e):null})))})),["type"].forEach((function(e){null!=o[e]&&(r[e]=Promise.resolve(o[e]).then((function(e){return null!=e?e:null})))})),o.accessList&&(r.accessList=this.formatter.accessList(o.accessList)),["data"].forEach((function(e){null!=o[e]&&(r[e]=Promise.resolve(o[e]).then((function(e){return e?Object(y.i)(e):null})))})),t.t0=this.formatter,t.next=12,L(r);case 12:return t.t1=t.sent,t.abrupt("return",t.t0.transactionRequest.call(t.t0,t.t1));case 14:case"end":return t.stop()}}),t,this)})))}},{key:"_getFilter",value:function(e){return _i(this,void 0,void 0,Object(b.a)().mark((function t(){var o,r=this;return Object(b.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,o={},null!=e.address&&(o.address=this._getAddress(e.address)),["blockHash","topics"].forEach((function(t){null!=e[t]&&(o[t]=e[t])})),["fromBlock","toBlock"].forEach((function(t){null!=e[t]&&(o[t]=r._getBlockTag(e[t]))})),t.t0=this.formatter,t.next=10,L(o);case 10:return t.t1=t.sent,t.abrupt("return",t.t0.filter.call(t.t0,t.t1));case 12:case"end":return t.stop()}}),t,this)})))}},{key:"_call",value:function(e,t,o){return _i(this,void 0,void 0,Object(b.a)().mark((function r(){var n,i,a,s,c,u,l,m,f,d,h,p,g,v,k;return Object(b.a)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o>=10&&Ti.throwError("CCIP read exceeded maximum redirections",w.b.errors.SERVER_ERROR,{redirects:o,transaction:e}),n=e.to,r.next=4,this.perform("call",{transaction:e,blockTag:t});case 4:if(i=r.sent,!(o>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&Object(y.d)(i)%32===4)){r.next=31;break}for(r.prev=6,a=Object(y.e)(i,4),s=Object(y.e)(a,0,32),I.from(s).eq(n)||Ti.throwError("CCIP Read sender did not match",w.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i}),c=[],u=I.from(Object(y.e)(a,32,64)).toNumber(),l=I.from(Object(y.e)(a,u,u+32)).toNumber(),m=Object(y.e)(a,u+32),f=0;fthis._emitted.block)){e.next=10;break}return e.abrupt("return",null);case 10:return e.abrupt("return",void 0);case 11:if(!t){e.next=34;break}i=null,a=0;case 14:if(!(a0}},{key:"_stopEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_addEventListener",value:function(e,t,o){var r=new Bi(Di(e),t,o);return this._events.push(r),this._startEvent(r),this}},{key:"on",value:function(e,t){return this._addEventListener(e,t,!1)}},{key:"once",value:function(e,t){return this._addEventListener(e,t,!0)}},{key:"emit",value:function(e){for(var t=this,o=arguments.length,r=new Array(o>1?o-1:0),n=1;n=0&&a.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&na.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",w.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}function ca(e){return new Promise((function(t){setTimeout(t,e)}))}function ua(e){if(e.error){var t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function la(e){return e?e.toLowerCase():e}var ma={},fa=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e,r,n){var i;if(Object(p.a)(this,o),i=t.call(this),e!==ma)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return C(Object(l.a)(i),"provider",r),null==n&&(n=0),"string"===typeof n?(C(Object(l.a)(i),"_address",i.provider.formatter.address(n)),C(Object(l.a)(i),"_index",null)):"number"===typeof n?(C(Object(l.a)(i),"_index",n),C(Object(l.a)(i),"_address",null)):na.throwArgumentError("invalid address or index","addressOrIndex",n),i}return Object(g.a)(o,[{key:"connect",value:function(e){return na.throwError("cannot alter JSON-RPC Signer connection",w.b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new da(ma,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var e=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(t){return t.length<=e._index&&na.throwError("unknown account #"+e._index,w.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),e.provider.formatter.address(t[e._index])}))}},{key:"sendUncheckedTransaction",value:function(e){var t=this;e=R(e);var o=this.getAddress().then((function(e){return e&&(e=e.toLowerCase()),e}));if(null==e.gasLimit){var r=R(e);r.from=o,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((function(e){return ra(t,void 0,void 0,Object(b.a)().mark((function t(){var o;return Object(b.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",null);case 2:return t.next=4,this.provider.resolveName(e);case 4:return null==(o=t.sent)&&na.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",o);case 7:case"end":return t.stop()}}),t,this)})))}))),L({tx:L(e),sender:o}).then((function(o){var r=o.tx,n=o.sender;null!=r.from?r.from.toLowerCase()!==n&&na.throwArgumentError("from address mismatch","transaction",e):r.from=n;var i=t.provider.constructor.hexlifyTransaction(r,{from:!0});return t.provider.send("eth_sendTransaction",[i]).then((function(e){return e}),(function(e){return"string"===typeof e.message&&e.message.match(/user denied/i)&&na.throwError("user rejected transaction",w.b.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:r}),sa("sendTransaction",e,i)}))}))}},{key:"signTransaction",value:function(e){return na.throwError("signing transactions is unsupported",w.b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(e){return ra(this,void 0,void 0,Object(b.a)().mark((function t(){var o,r,n=this;return Object(b.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval);case 2:return o=t.sent,t.next=5,this.sendUncheckedTransaction(e);case 5:return r=t.sent,t.prev=6,t.next=9,xi((function(){return ra(n,void 0,void 0,Object(b.a)().mark((function e(){var t;return Object(b.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider.getTransaction(r);case 2:if(null!==(t=e.sent)){e.next=5;break}return e.abrupt("return",void 0);case 5:return e.abrupt("return",this.provider._wrapTransaction(t,r,o));case 6:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this.provider});case 9:return t.abrupt("return",t.sent);case 12:throw t.prev=12,t.t0=t.catch(6),t.t0.transactionHash=r,t.t0;case 16:case"end":return t.stop()}}),t,this,[[6,12]])})))}},{key:"signMessage",value:function(e){return ra(this,void 0,void 0,Object(b.a)().mark((function t(){var o,r;return Object(b.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o="string"===typeof e?qe(e):e,t.next=3,this.getAddress();case 3:return r=t.sent,t.prev=4,t.next=7,this.provider.send("personal_sign",[Object(y.i)(o),r.toLowerCase()]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"===typeof t.t0.message&&t.t0.message.match(/user denied/i)&&na.throwError("user rejected signing",w.b.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_legacySignMessage",value:function(e){return ra(this,void 0,void 0,Object(b.a)().mark((function t(){var o,r;return Object(b.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o="string"===typeof e?qe(e):e,t.next=3,this.getAddress();case 3:return r=t.sent,t.prev=4,t.next=7,this.provider.send("eth_sign",[r.toLowerCase(),Object(y.i)(o)]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"===typeof t.t0.message&&t.t0.message.match(/user denied/i)&&na.throwError("user rejected signing",w.b.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_signTypedData",value:function(e,t,o){return ra(this,void 0,void 0,Object(b.a)().mark((function r(){var n,i,a=this;return Object(b.a)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,hr.resolveNames(e,t,o,(function(e){return a.provider.resolveName(e)}));case 2:return n=r.sent,r.next=5,this.getAddress();case 5:return i=r.sent,r.prev=6,r.next=9,this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(hr.getPayload(n.domain,t,n.value))]);case 9:return r.abrupt("return",r.sent);case 12:throw r.prev=12,r.t0=r.catch(6),"string"===typeof r.t0.message&&r.t0.message.match(/user denied/i)&&na.throwError("user rejected signing",w.b.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),r.t0;case 16:case"end":return r.stop()}}),r,this,[[6,12]])})))}},{key:"unlock",value:function(e){return ra(this,void 0,void 0,Object(b.a)().mark((function t(){var o,r;return Object(b.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=this.provider,t.next=3,this.getAddress();case 3:return r=t.sent,t.abrupt("return",o.send("personal_unlockAccount",[r.toLowerCase(),e,null]));case 5:case"end":return t.stop()}}),t,this)})))}}]),o}(Gt),da=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(p.a)(this,o),t.apply(this,arguments)}return Object(g.a)(o,[{key:"sendTransaction",value:function(e){var t=this;return this.sendUncheckedTransaction(e).then((function(e){return{hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(o){return t.provider.waitForTransaction(e,o)}}}))}}]),o}(fa),ha={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},pa=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e,r){var n;Object(p.a)(this,o);var i=r;return null==i&&(i=new Promise((function(e,t){setTimeout((function(){n.detectNetwork().then((function(t){e(t)}),(function(e){t(e)}))}),0)}))),n=t.call(this,i),e||(e=D(n.constructor,"defaultUrl")()),C(Object(l.a)(n),"connection","string"===typeof e?Object.freeze({url:e}):Object.freeze(R(e))),n._nextId=42,n}return Object(g.a)(o,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var e=this;return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){e._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return ra(this,void 0,void 0,Object(b.a)().mark((function e(){var t,o;return Object(b.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ca(0);case 2:return t=null,e.prev=3,e.next=6,this.send("eth_chainId",[]);case 6:t=e.sent,e.next=19;break;case 9:return e.prev=9,e.t0=e.catch(3),e.prev=11,e.next=14,this.send("net_version",[]);case 14:t=e.sent,e.next=19;break;case 17:e.prev=17,e.t1=e.catch(11);case 19:if(null==t){e.next=28;break}return o=D(this.constructor,"getNetwork"),e.prev=21,e.abrupt("return",o(I.from(t).toNumber()));case 25:return e.prev=25,e.t2=e.catch(21),e.abrupt("return",na.throwError("could not detect network",w.b.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e.t2}));case 28:return e.abrupt("return",na.throwError("could not detect network",w.b.errors.NETWORK_ERROR,{event:"noNetwork"}));case 29:case"end":return e.stop()}}),e,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(e){return new fa(ma,this,e)}},{key:"getUncheckedSigner",value:function(e){return this.getSigner(e).connectUnchecked()}},{key:"listAccounts",value:function(){var e=this;return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return e.formatter.address(t)}))}))}},{key:"send",value:function(e,t){var o=this,r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Q(r),provider:this});var n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];var i=wi(this.connection,JSON.stringify(r),ua).then((function(e){return o.emit("debug",{action:"response",request:r,response:e,provider:o}),e}),(function(e){throw o.emit("debug",{action:"response",error:e,request:r,provider:o}),e}));return n&&(this._cache[e]=i,setTimeout((function(){o._cache[e]=null}),0)),i}},{key:"prepareRequest",value:function(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[la(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[la(t.address),t.blockTag]];case"getCode":return["eth_getCode",[la(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[la(t.address),Object(y.h)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[D(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[D(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=la(t.filter.address)),["eth_getLogs",[t.filter]]}return null}},{key:"perform",value:function(e,t){return ra(this,void 0,void 0,Object(b.a)().mark((function o(){var r,n,i;return Object(b.a)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if("call"!==e&&"estimateGas"!==e){o.next=8;break}if(!(r=t.transaction)||null==r.type||!I.from(r.type).isZero()){o.next=8;break}if(null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas){o.next=8;break}return o.next=6,this.getFeeData();case 6:null==(n=o.sent).maxFeePerGas&&null==n.maxPriorityFeePerGas&&((t=R(t)).transaction=R(r),delete t.transaction.type);case 8:return null==(i=this.prepareRequest(e,t))&&na.throwError(e+" not implemented",w.b.errors.NOT_IMPLEMENTED,{operation:e}),o.prev=10,o.next=13,this.send(i[0],i[1]);case 13:return o.abrupt("return",o.sent);case 16:return o.prev=16,o.t0=o.catch(10),o.abrupt("return",sa(e,o.t0,t));case 19:case"end":return o.stop()}}),o,this,[[10,16]])})))}},{key:"_startEvent",value:function(e){"pending"===e.tag&&this._startPending(),f(Object(m.a)(o.prototype),"_startEvent",this).call(this,e)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(o){return function r(){e.send("eth_getFilterChanges",[o]).then((function(o){if(e._pendingFilter!=t)return null;var r=Promise.resolve();return o.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",r=r.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),r.then((function(){return ca(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){r()}),0),null;e.send("eth_uninstallFilter",[o])})).catch((function(e){}))}(),o})).catch((function(e){}))}}},{key:"_stopEvent",value:function(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),f(Object(m.a)(o.prototype),"_stopEvent",this).call(this,e)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(e,t){var o=R(ha);if(t)for(var r in t)t[r]&&(o[r]=!0);P(e,o);var n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null!=e[t]){var o=Object(y.g)(I.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=o}})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=Object(y.i)(e[t]))})),e.accessList&&(n.accessList=mo(e.accessList)),n}}]),o}(ta),ga=null;try{if(null==(ga=WebSocket))throw new Error("inject please")}catch(oc){var ba=new w.b(Mi);ga=function(){ba.throwError("WebSockets not supported in this environment",w.b.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var ya=function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(t){i(t)}}function s(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},va=new w.b(Mi),ka=1,wa=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e,r){var n,i;Object(p.a)(this,o),"any"===r&&va.throwError("WebSocketProvider does not support 'any' network yet",w.b.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),(i="string"===typeof e?t.call(this,e,r):t.call(this,"_websocket",r))._pollingInterval=-1,i._wsReady=!1,C(Object(l.a)(i),"_websocket","string"===typeof e?new ga(i.connection.url):e),C(Object(l.a)(i),"_requests",{}),C(Object(l.a)(i),"_subs",{}),C(Object(l.a)(i),"_subIds",{}),C(Object(l.a)(i),"_detectNetwork",f((n=Object(l.a)(i),Object(m.a)(o.prototype)),"detectNetwork",n).call(n)),i.websocket.onopen=function(){i._wsReady=!0,Object.keys(i._requests).forEach((function(e){i.websocket.send(i._requests[e].payload)}))},i.websocket.onmessage=function(e){var t=e.data,o=JSON.parse(t);if(null!=o.id){var r=String(o.id),n=i._requests[r];if(delete i._requests[r],void 0!==o.result)n.callback(null,o.result),i.emit("debug",{action:"response",request:JSON.parse(n.payload),response:o.result,provider:Object(l.a)(i)});else{var a=null;o.error?(C(a=new Error(o.error.message||"unknown error"),"code",o.error.code||null),C(a,"response",t)):a=new Error("unknown error"),n.callback(a,void 0),i.emit("debug",{action:"response",error:a,request:JSON.parse(n.payload),provider:Object(l.a)(i)})}}else if("eth_subscription"===o.method){var s=i._subs[o.params.subscription];s&&s.processFunc(o.params.result)}else console.warn("this should not happen")};var a=setInterval((function(){i.emit("poll")}),1e3);return a.unref&&a.unref(),Object(oa.a)(i)}return Object(g.a)(o,[{key:"websocket",get:function(){return this._websocket}},{key:"detectNetwork",value:function(){return this._detectNetwork}},{key:"pollingInterval",get:function(){return 0},set:function(e){va.throwError("cannot set polling interval on WebSocketProvider",w.b.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}},{key:"resetEventsBlock",value:function(e){va.throwError("cannot reset events block on WebSocketProvider",w.b.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}},{key:"poll",value:function(){return ya(this,void 0,void 0,Object(b.a)().mark((function e(){return Object(b.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null);case 1:case"end":return e.stop()}}),e)})))}},{key:"polling",set:function(e){e&&va.throwError("cannot set polling on WebSocketProvider",w.b.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}},{key:"send",value:function(e,t){var o=this,r=ka++;return new Promise((function(n,i){var a=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});o.emit("debug",{action:"request",request:JSON.parse(a),provider:o}),o._requests[String(r)]={callback:function(e,t){return e?i(e):n(t)},payload:a},o._wsReady&&o.websocket.send(a)}))}},{key:"_subscribe",value:function(e,t,o){return ya(this,void 0,void 0,Object(b.a)().mark((function r(){var n,i,a=this;return Object(b.a)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==(n=this._subIds[e])&&(n=Promise.all(t).then((function(e){return a.send("eth_subscribe",e)})),this._subIds[e]=n),r.next=4,n;case 4:i=r.sent,this._subs[i]={tag:e,processFunc:o};case 6:case"end":return r.stop()}}),r,this)})))}},{key:"_startEvent",value:function(e){var t=this;switch(e.type){case"block":this._subscribe("block",["newHeads"],(function(e){var o=I.from(e.number).toNumber();t._emitted.block=o,t.emit("block",o)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(function(e){t.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(function(o){null==o.removed&&(o.removed=!1),t.emit(e.filter,t.formatter.filterLog(o))}));break;case"tx":var o=function(e){var o=e.hash;t.getTransactionReceipt(o).then((function(e){e&&t.emit(o,e)}))};o(e),this._subscribe("tx",["newHeads"],(function(e){t._events.filter((function(e){return"tx"===e.type})).forEach(o)}));break;case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}},{key:"_stopEvent",value:function(e){var t=this,o=e.tag;if("tx"===e.type){if(this._events.filter((function(e){return"tx"===e.type})).length)return;o="tx"}else if(this.listenerCount(e.event))return;var r=this._subIds[o];r&&(delete this._subIds[o],r.then((function(e){t._subs[e]&&(delete t._subs[e],t.send("eth_unsubscribe",[e]))})))}},{key:"destroy",value:function(){return ya(this,void 0,void 0,Object(b.a)().mark((function e(){var t=this;return Object(b.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.websocket.readyState!==ga.CONNECTING){e.next=3;break}return e.next=3,new Promise((function(e){t.websocket.onopen=function(){e(!0)},t.websocket.onerror=function(){e(!1)}}));case 3:this.websocket.close(1e3);case 4:case"end":return e.stop()}}),e,this)})))}}],[{key:"defaultUrl",value:function(){return"ws://localhost:8546"}}]),o}(pa),xa=function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(t){i(t)}}function s(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},za=new w.b(Mi),ja=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(p.a)(this,o),t.apply(this,arguments)}return Object(g.a)(o,[{key:"detectNetwork",value:function(){var e=this,t=Object.create(null,{detectNetwork:{get:function(){return f(Object(m.a)(o.prototype),"detectNetwork",e)}}});return xa(this,void 0,void 0,Object(b.a)().mark((function e(){var o;return Object(b.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(o=this.network)){e.next=7;break}return e.next=4,t.detectNetwork.call(this);case 4:(o=e.sent)||za.throwError("no network detected",w.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(C(this,"_network",o),this.emit("network",o,null));case 7:return e.abrupt("return",o);case 8:case"end":return e.stop()}}),e,this)})))}}]),o}(pa),Ma=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e,r){var n;Object(p.a)(this,o),za.checkAbstract(this instanceof o?this.constructor:void 0,o),e=D(this instanceof o?this.constructor:void 0,"getNetwork")(e),r=D(this instanceof o?this.constructor:void 0,"getApiKey")(r);var i=D(this instanceof o?this.constructor:void 0,"getUrl")(e,r);return n=t.call(this,i,e),"string"===typeof r?C(Object(l.a)(n),"apiKey",r):null!=r&&Object.keys(r).forEach((function(e){C(Object(l.a)(n),e,r[e])})),n}return Object(g.a)(o,[{key:"_startPending",value:function(){za.warn("WARNING: API provider does not support pending filters")}},{key:"isCommunityResource",value:function(){return!1}},{key:"getSigner",value:function(e){return za.throwError("API provider does not support signing",w.b.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}},{key:"listAccounts",value:function(){return Promise.resolve([])}}],[{key:"getApiKey",value:function(e){return e}},{key:"getUrl",value:function(e,t){return za.throwError("not implemented; sub-classes must override getUrl",w.b.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}]),o}(ja),Aa=new w.b(Mi),qa="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",Ia=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e,r){var n;Object(p.a)(this,o);var i=new Ea(e,r),a=i.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");return n=t.call(this,a,i.network),C(Object(l.a)(n),"apiKey",i.apiKey),n}return Object(g.a)(o,[{key:"isCommunityResource",value:function(){return this.apiKey===qa}}]),o}(wa),Ea=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(p.a)(this,o),t.apply(this,arguments)}return Object(g.a)(o,[{key:"isCommunityResource",value:function(){return this.apiKey===qa}}],[{key:"getWebSocketProvider",value:function(e,t){return new Ia(e,t)}},{key:"getApiKey",value:function(e){return null==e?qa:(e&&"string"!==typeof e&&Aa.throwArgumentError("invalid apiKey","apiKey",e),e)}},{key:"getUrl",value:function(e,t){var o=null;switch(e.name){case"homestead":o="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":o="eth-goerli.g.alchemy.com/v2/";break;case"matic":o="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":o="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":o="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":o="arb-goerli.g.alchemy.com/v2/";break;case"optimism":o="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":o="opt-goerli.g.alchemy.com/v2/";break;default:Aa.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+o+t,throttleCallback:function(e,o){return t===qa&&Ni(),Promise.resolve(!0)}}}}]),o}(Ma),Sa=new w.b(Mi),Na="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function _a(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return Sa.throwArgumentError("unsupported network","name",e)}var Ta=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(p.a)(this,o),t.apply(this,arguments)}return Object(g.a)(o,[{key:"isCommunityResource",value:function(){return this.apiKey===Na}}],[{key:"getApiKey",value:function(e){return null==e?Na:e}},{key:"getUrl",value:function(e,t){null==t&&(t=Na);var o={allowGzip:!0,url:"https://"+_a(e.name)+t,throttleCallback:function(e,o){return t.apiKey===Na&&Ni(),Promise.resolve(!0)}};return null!=t.projectSecret&&(o.user="",o.password=t.projectSecret),o}}]),o}(Ma),Oa=function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(t){i(t)}}function s(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Ca=new w.b(Mi),Da=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(p.a)(this,o),t.apply(this,arguments)}return Object(g.a)(o,[{key:"perform",value:function(e,t){var r=this,n=Object.create(null,{perform:{get:function(){return f(Object(m.a)(o.prototype),"perform",r)}}});return Oa(this,void 0,void 0,Object(b.a)().mark((function o(){var r;return Object(b.a)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if("getBlockNumber"!==e){o.next=5;break}return o.next=3,n.perform.call(this,"getBlock",{blockTag:"latest"});case 3:return r=o.sent,o.abrupt("return",r.number);case 5:return o.abrupt("return",n.perform.call(this,e,t));case 6:case"end":return o.stop()}}),o,this)})))}}],[{key:"getApiKey",value:function(e){return null!=e&&Ca.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}},{key:"getUrl",value:function(e,t){var o=null;if("homestead"===e.name)o="https://cloudflare-eth.com/";else Ca.throwArgumentError("unsupported network","network",arguments[0]);return o}}]),o}(Ma),La=function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(t){i(t)}}function s(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Pa=new w.b(Mi);function Ra(e){var t={};for(var o in e)if(null!=e[o]){var r=e[o];"type"===o&&0===r||(r={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[o]?Object(y.g)(Object(y.i)(r)):"accessList"===o?"["+mo(r).map((function(e){return'{address:"'.concat(e.address,'",storageKeys:["').concat(e.storageKeys.join('","'),'"]}')})).join(",")+"]":Object(y.i)(r),t[o]=r)}return t}function Ba(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!==typeof e.message||!e.message.match(/^OK/)){var t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function Ua(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){var t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){var o=new Error("invalid response");throw o.result=JSON.stringify(e),o}if(e.error){var r=new Error(e.error.message||"unknown error");throw e.error.code&&(r.code=e.error.code),e.error.data&&(r.data=e.error.data),r}return e.result}function Fa(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function Qa(e,t,o){if("call"===e&&t.code===w.b.errors.SERVER_ERROR){var r=t.error;if(r&&(r.message.match(/reverted/i)||r.message.match(/VM execution error/i))){var n=r.data;if(n&&(n="0x"+n.replace(/^.*0x/i,"")),Object(y.l)(n))return n;Pa.throwError("missing revert data in call exception",w.b.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}var i=t.message;throw t.code===w.b.errors.SERVER_ERROR&&(t.error&&"string"===typeof t.error.message?i=t.error.message:"string"===typeof t.body?i=t.body:"string"===typeof t.responseText&&(i=t.responseText)),(i=(i||"").toLowerCase()).match(/insufficient funds/)&&Pa.throwError("insufficient funds for intrinsic transaction cost",w.b.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:o}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&Pa.throwError("nonce has already been used",w.b.errors.NONCE_EXPIRED,{error:t,method:e,transaction:o}),i.match(/another transaction with same nonce/)&&Pa.throwError("replacement fee too low",w.b.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:o}),i.match(/execution failed due to an exception|execution reverted/)&&Pa.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",w.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:o}),t}var Ya=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e,r){var n;return Object(p.a)(this,o),n=t.call(this,e),C(Object(l.a)(n),"baseUrl",n.getBaseUrl()),C(Object(l.a)(n),"apiKey",r||null),n}return Object(g.a)(o,[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return Pa.throwArgumentError("unsupported network","network",this.network.name)}},{key:"getUrl",value:function(e,t){var o=Object.keys(t).reduce((function(e,o){var r=t[o];return null!=r&&(e+="&".concat(o,"=").concat(r)),e}),""),r=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(e).concat(o).concat(r)}},{key:"getPostUrl",value:function(){return"".concat(this.baseUrl,"/api")}},{key:"getPostData",value:function(e,t){return t.module=e,t.apikey=this.apiKey,t}},{key:"fetch",value:function(e,t,o){return La(this,void 0,void 0,Object(b.a)().mark((function r(){var n,i,a,s,c,u,l=this;return Object(b.a)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=o?this.getPostUrl():this.getUrl(e,t),i=o?this.getPostData(e,t):null,a="proxy"===e?Ua:Ba,this.emit("debug",{action:"request",request:n,provider:this}),s={url:n,throttleSlotInterval:1e3,throttleCallback:function(e,t){return l.isCommunityResource()&&Ni(),Promise.resolve(!0)}},c=null,i&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},c=Object.keys(i).map((function(e){return"".concat(e,"=").concat(i[e])})).join("&")),r.next=9,wi(s,c,a||Ua);case 9:return u=r.sent,this.emit("debug",{action:"response",request:n,response:Q(u),provider:this}),r.abrupt("return",u);case 12:case"end":return r.stop()}}),r,this)})))}},{key:"detectNetwork",value:function(){return La(this,void 0,void 0,Object(b.a)().mark((function e(){return Object(b.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.network);case 1:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){var r=this,n=Object.create(null,{perform:{get:function(){return f(Object(m.a)(o.prototype),"perform",r)}}});return La(this,void 0,void 0,Object(b.a)().mark((function o(){var r,i,a,s,c,u,l,m,f;return Object(b.a)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:o.t0=e,o.next="getBlockNumber"===o.t0?3:"getGasPrice"===o.t0?4:"getBalance"===o.t0?5:"getTransactionCount"===o.t0?6:"getCode"===o.t0?7:"getStorageAt"===o.t0?8:"sendTransaction"===o.t0?9:"getBlock"===o.t0?10:"getTransaction"===o.t0?13:"getTransactionReceipt"===o.t0?14:"call"===o.t0?15:"estimateGas"===o.t0?29:"getLogs"===o.t0?41:"getEtherPrice"===o.t0?65:72;break;case 3:return o.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"}));case 4:return o.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"}));case 5:return o.abrupt("return",this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag}));case 6:return o.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag}));case 7:return o.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag}));case 8:return o.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag}));case 9:return o.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((function(e){return Qa("sendTransaction",e,t.signedTransaction)})));case 10:if(!t.blockTag){o.next=12;break}return o.abrupt("return",this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"}));case 12:throw new Error("getBlock by blockHash not implemented");case 13:return o.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash}));case 14:return o.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash}));case 15:if("latest"===t.blockTag){o.next=17;break}throw new Error("EtherscanProvider does not support blockTag for call");case 17:return(r=Ra(t.transaction)).module="proxy",r.action="eth_call",o.prev=20,o.next=23,this.fetch("proxy",r,!0);case 23:return o.abrupt("return",o.sent);case 26:return o.prev=26,o.t1=o.catch(20),o.abrupt("return",Qa("call",o.t1,t.transaction));case 29:return(i=Ra(t.transaction)).module="proxy",i.action="eth_estimateGas",o.prev=32,o.next=35,this.fetch("proxy",i,!0);case 35:return o.abrupt("return",o.sent);case 38:return o.prev=38,o.t2=o.catch(32),o.abrupt("return",Qa("estimateGas",o.t2,t.transaction));case 41:return a={action:"getLogs"},t.filter.fromBlock&&(a.fromBlock=Fa(t.filter.fromBlock)),t.filter.toBlock&&(a.toBlock=Fa(t.filter.toBlock)),t.filter.address&&(a.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&Pa.throwError("unsupported topic count",w.b.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length&&("string"===typeof(s=t.filter.topics[0])&&66===s.length||Pa.throwError("unsupported topic format",w.b.errors.UNSUPPORTED_OPERATION,{topic0:s}),a.topic0=s)),o.next=48,this.fetch("logs",a);case 48:c=o.sent,u={},l=0;case 51:if(!(l0;t--){var o=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[o],e[o]=r}return e}var Ga=function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(t){i(t)}}function s(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Wa=new w.b(Mi);function Za(){return(new Date).getTime()}function Va(e){for(var t=null,o=0;ot?null:(r+n)/2}function Ja(e){if(null===e)return"null";if("number"===typeof e||"boolean"===typeof e)return JSON.stringify(e);if("string"===typeof e)return e;if(I.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((function(e){return Ja(e)})));if("object"===typeof e){var t=Object.keys(e);return t.sort(),"{"+t.map((function(t){var o=e[t];return o="function"===typeof o?"[function]":Ja(o),JSON.stringify(t)+":"+o})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}var Xa=1;function $a(e){var t=null,o=null,r=new Promise((function(r){t=function(){o&&(clearTimeout(o),o=null),r()},o=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return r},wait:function(e){return r=r.then(e)}}}var es=[w.b.errors.CALL_EXCEPTION,w.b.errors.INSUFFICIENT_FUNDS,w.b.errors.NONCE_EXPIRED,w.b.errors.REPLACEMENT_UNDERPRICED,w.b.errors.UNPREDICTABLE_GAS_LIMIT],ts=["address","args","errorArgs","errorSignature","method","transaction"];function os(e,t){var o={weight:e.weight};return Object.defineProperty(o,"provider",{get:function(){return e.provider}}),e.start&&(o.start=e.start),t&&(o.duration=t-e.start),e.done&&(e.error?o.error=e.error:o.result=e.result||null),o}function rs(e,t,o){var r=Ja;switch(t){case"getBlockNumber":return function(t){var o=t.map((function(e){return e.result})),r=Ka(t.map((function(e){return e.result})),2);if(null!=r)return r=Math.ceil(r),o.indexOf(r+1)>=0&&r++,r>=e._highestBlockNumber&&(e._highestBlockNumber=r),e._highestBlockNumber};case"getGasPrice":return function(e){var t=e.map((function(e){return e.result}));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return Ka(e.map((function(e){return e.result})))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":r=function(e){return null==e?null:((e=R(e)).confirmations=-1,Ja(e))};break;case"getBlock":r=o.includeTransactions?function(e){return null==e?null:((e=R(e)).transactions=e.transactions.map((function(e){return(e=R(e)).confirmations=-1,e})),Ja(e))}:function(e){return null==e?null:Ja(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(o){var r={};o.forEach((function(t){var o=e(t.result);r[o]||(r[o]={count:0,result:t.result}),r[o].count++}));for(var n=Object.keys(r),i=0;i=t)return a.result}}}(r,e.quorum)}function ns(e,t){return Ga(this,void 0,void 0,Object(b.a)().mark((function o(){var r;return Object(b.a)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(!(null!=(r=e.provider).blockNumber&&r.blockNumber>=t||-1===t)){o.next=3;break}return o.abrupt("return",r);case 3:return o.abrupt("return",xi((function(){return new Promise((function(o,n){setTimeout((function(){return r.blockNumber>=t?o(r):e.cancelled?o(null):o(void 0)}),0)}))}),{oncePoll:r}));case 4:case"end":return o.stop()}}),o)})))}function is(e,t,o,r){return Ga(this,void 0,void 0,Object(b.a)().mark((function n(){var i,a;return Object(b.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i=e.provider,n.t0=o,n.next="getBlockNumber"===n.t0||"getGasPrice"===n.t0?4:"getEtherPrice"===n.t0?5:"getBalance"===n.t0||"getTransactionCount"===n.t0||"getCode"===n.t0?8:"getStorageAt"===n.t0?13:"getBlock"===n.t0?18:"call"===n.t0||"estimateGas"===n.t0?23:"getTransaction"===n.t0||"getTransactionReceipt"===n.t0?30:"getLogs"===n.t0?31:37;break;case 4:return n.abrupt("return",i[o]());case 5:if(!i.getEtherPrice){n.next=7;break}return n.abrupt("return",i.getEtherPrice());case 7:return n.abrupt("break",37);case 8:if(!r.blockTag||!Object(y.l)(r.blockTag)){n.next=12;break}return n.next=11,ns(e,t);case 11:i=n.sent;case 12:return n.abrupt("return",i[o](r.address,r.blockTag||"latest"));case 13:if(!r.blockTag||!Object(y.l)(r.blockTag)){n.next=17;break}return n.next=16,ns(e,t);case 16:i=n.sent;case 17:return n.abrupt("return",i.getStorageAt(r.address,r.position,r.blockTag||"latest"));case 18:if(!r.blockTag||!Object(y.l)(r.blockTag)){n.next=22;break}return n.next=21,ns(e,t);case 21:i=n.sent;case 22:return n.abrupt("return",i[r.includeTransactions?"getBlockWithTransactions":"getBlock"](r.blockTag||r.blockHash));case 23:if(!r.blockTag||!Object(y.l)(r.blockTag)){n.next=27;break}return n.next=26,ns(e,t);case 26:i=n.sent;case 27:if("call"!==o||!r.blockTag){n.next=29;break}return n.abrupt("return",i[o](r.transaction,r.blockTag));case 29:return n.abrupt("return",i[o](r.transaction));case 30:return n.abrupt("return",i[o](r.transactionHash));case 31:if(!((a=r.filter).fromBlock&&Object(y.l)(a.fromBlock)||a.toBlock&&Object(y.l)(a.toBlock))){n.next=36;break}return n.next=35,ns(e,t);case 35:i=n.sent;case 36:return n.abrupt("return",i.getLogs(a));case 37:return n.abrupt("return",Wa.throwError("unknown method error",w.b.errors.UNKNOWN_ERROR,{method:o,params:r}));case 38:case"end":return n.stop()}}),n)})))}var as=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e,r){var n;Object(p.a)(this,o),0===e.length&&Wa.throwArgumentError("missing providers","providers",e);var i=e.map((function(e,t){if(Ut.isProvider(e)){var o=Ei(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:o,priority:1})}var r=R(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=Ei(e)?2e3:750),null==r.weight&&(r.weight=1);var n=r.weight;return(n%1||n>512||n<1)&&Wa.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),n),Object.freeze(r)})),a=i.reduce((function(e,t){return e+t.weight}),0);null==r?r=a/2:r>a&&Wa.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);var s=Va(i.map((function(e){return e.provider.network})));return null==s&&(s=new Promise((function(e,t){setTimeout((function(){n.detectNetwork().then(e,t)}),0)}))),n=t.call(this,s),C(Object(l.a)(n),"providerConfigs",Object.freeze(i)),C(Object(l.a)(n),"quorum",r),n._highestBlockNumber=-1,n}return Object(g.a)(o,[{key:"detectNetwork",value:function(){return Ga(this,void 0,void 0,Object(b.a)().mark((function e(){var t;return Object(b.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(this.providerConfigs.map((function(e){return e.provider.getNetwork()})));case 2:return t=e.sent,e.abrupt("return",Va(t));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){return Ga(this,void 0,void 0,Object(b.a)().mark((function o(){var r,n,i,a,s,c,u,l,m,f,d=this;return Object(b.a)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if("sendTransaction"!==e){o.next=13;break}return o.next=3,Promise.all(this.providerConfigs.map((function(e){return e.provider.sendTransaction(t.signedTransaction).then((function(e){return e.hash}),(function(e){return e}))})));case 3:r=o.sent,n=0;case 5:if(!(n=d.quorum)){o.next=22;break}if(void 0===(h=a(f))){o.next=18;break}return s.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),o.abrupt("return",{v:h});case 18:if(l){o.next=21;break}return o.next=21,$a(100).getPromise();case 21:l=!1;case 22:if(p=s.reduce((function(e,t){if(!t.done||null==t.error)return e;var o=t.error.code;return es.indexOf(o)>=0&&(e[o]||(e[o]={error:t.error,weight:0}),e[o].weight+=t.weight),e}),{}),Object.keys(p).forEach((function(e){var t=p[e];if(!(t.weight256)&&Is.throwArgumentError("invalid number type","type",e),o&&(n=256),t=I.from(t).toTwos(n),Object(y.p)(t,n/8)}if(r=e.match(js)){var i=parseInt(r[1]);return(String(i)!==r[1]||0===i||i>32)&&Is.throwArgumentError("invalid bytes type","type",e),Object(y.a)(t).byteLength!==i&&Is.throwArgumentError("invalid value for ".concat(e),"value",t),o?Object(y.a)((t+qs).substring(0,66)):t}if((r=e.match(As))&&Array.isArray(t)){var a=r[1];parseInt(r[2]||String(t.length))!=t.length&&Is.throwArgumentError("invalid array length for ".concat(e),"value",t);var s=[];return t.forEach((function(e){s.push(Es(a,e,!0))})),Object(y.b)(s)}return Is.throwArgumentError("invalid type","type",e)}function Ss(e,t){e.length!=t.length&&Is.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);var o=[];return e.forEach((function(e,r){o.push(Es(e,t[r]))})),Object(y.i)(Object(y.b)(o))}function Ns(e,t){return $(Ss(e,t))}function _s(e,t){return wr(Ss(e,t))}function Ts(e,t){t||(t=function(e){return[parseInt(e,16)]});var o=0,r={};return e.split(",").forEach((function(e){var n=e.split(":");o+=parseInt(n[0],16),r[o]=t(n[1])})),r}function Os(e){var t=0;return e.split(",").map((function(e){var o=e.split("-");return 1===o.length?o[1]="0":""===o[1]&&(o[1]="1"),{l:t+parseInt(o[0],16),h:t=parseInt(o[1],16)}}))}function Cs(e,t){for(var o=0,r=0;r=(o+=n.l)&&e<=o+n.h&&(e-o)%(n.d||1)===0){if(n.e&&-1!==n.e.indexOf(e-o))continue;return n}}return null}var Ds=Os("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Ls="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(e){return parseInt(e,16)})),Ps=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Rs=Ts("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Bs=Ts("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Us=Ts("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!==0)throw new Error("bad data");for(var t=[],o=0;o=0)return[];if(e>=65024&&e<=65039)return[];var t=function(e){var t=Cs(e,Ps);if(t)return[e+t.s];var o=Rs[e];if(o)return o;var r=Bs[e];return r?[e+r[0]]:Us[e]||null}(e);return t||[e]})),o=t.reduce((function(e,t){return t.forEach((function(t){e.push(t)})),e}),[]),(o=_e(Se(o),we.NFKC)).forEach((function(e){if(Cs(e,Fs))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),o.forEach((function(e){if(Cs(e,Ds))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var r=Se(o);if("-"===r.substring(0,1)||"--"===r.substring(2,4)||"-"===r.substring(r.length-1))throw new Error("invalid hyphen");return r}function Ys(e){var t=qe(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Object(y.i)(Object(y.b)([t,qn]).slice(0,32))}function Hs(e){var t=Object(y.a)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var o=31;0===t[o-1];)o--;return Ne(t.slice(0,o))}var Gs=new w.b("units/5.7.0"),Ws=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Zs(e){var t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Gs.throwArgumentError("invalid value","value",e);var o=t[0],r="";for("-"===o.substring(0,1)&&(r="-",o=o.substring(1));"0"===o.substring(0,1);)o=o.substring(1);""===o&&(o="0");var n="";for(2===t.length&&(n="."+(t[1]||"0"));n.length>2&&"0"===n[n.length-1];)n=n.substring(0,n.length-1);for(var i=[];o.length;){if(o.length<=3){i.unshift(o);break}var a=o.length-3;i.unshift(o.substring(a)),o=o.substring(0,a)}return r+i.join(",")+n}function Vs(e,t){if("string"===typeof t){var o=Ws.indexOf(t);-1!==o&&(t=3*o)}return Qo(e,null!=t?t:18)}function Ks(e,t){if("string"!==typeof e&&Gs.throwArgumentError("value must be a string","value",e),"string"===typeof t){var o=Ws.indexOf(t);-1!==o&&(t=3*o)}return Yo(e,null!=t?t:18)}function Js(e){return Vs(e,18)}function Xs(e){return Ks(e,18)}var $s="ethers/5.7.2",ec=new w.b($s);try{var tc=window;null==tc._ethers&&(tc._ethers=c)}catch(oc){}},function(e,t,o){"use strict";var r=t,n=o(64),i=o(71),a=o(225);r.assert=i,r.toArray=a.toArray,r.zero2=a.zero2,r.toHex=a.toHex,r.encode=a.encode,r.getNAF=function(e,t,o){var r=new Array(Math.max(e.bitLength(),o)+1);r.fill(0);for(var n=1<(n>>1)-1?(n>>1)-c:c,i.isubn(s)):s=0,r[a]=s,i.iushrn(1)}return r},r.getJSF=function(e,t){var o=[[],[]];e=e.clone(),t=t.clone();for(var r,n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var a,s,c=e.andln(3)+n&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),a=0===(1&c)?0:3!==(r=e.andln(7)+n&7)&&5!==r||2!==u?c:-c,o[0].push(a),s=0===(1&u)?0:3!==(r=t.andln(7)+i&7)&&5!==r||2!==c?u:-u,o[1].push(s),2*n===a+1&&(n=1-n),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return o},r.cachedProperty=function(e,t,o){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=o.call(this)}},r.parseBytes=function(e){return"string"===typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new n(e,"hex","le")}},function(e,t,o){"use strict";var r=o(3),n=o(52);function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t,o){return e===t||(e.correspondingElement?e.correspondingElement.classList.contains(o):e.classList.contains(o))}var c,u,l=(void 0===c&&(c=0),function(){return++c}),m={},f={},d=["touchstart","touchmove"];function h(e,t){var o={};return-1!==d.indexOf(t)&&u&&(o.passive=!e.props.preventDefault),o}t.a=function(e,t){var o,c,d=e.displayName||e.name||"Component";return c=o=function(o){var c,p;function g(e){var r;return(r=o.call(this,e)||this).__outsideClickHandler=function(e){if("function"!==typeof r.__clickOutsideHandlerProp){var t=r.getInstance();if("function"!==typeof t.props.handleClickOutside){if("function"!==typeof t.handleClickOutside)throw new Error("WrappedComponent: "+d+" lacks a handleClickOutside(event) function for processing outside click events.");t.handleClickOutside(e)}else t.props.handleClickOutside(e)}else r.__clickOutsideHandlerProp(e)},r.__getComponentNode=function(){var e=r.getInstance();return t&&"function"===typeof t.setClickOutsideRef?t.setClickOutsideRef()(e):"function"===typeof e.setClickOutsideRef?e.setClickOutsideRef():Object(n.findDOMNode)(e)},r.enableOnClickOutside=function(){if("undefined"!==typeof document&&!f[r._uid]){"undefined"===typeof u&&(u=function(){if("undefined"!==typeof window&&"function"===typeof window.addEventListener){var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}}),o=function(){};return window.addEventListener("testPassiveEventSupport",o,t),window.removeEventListener("testPassiveEventSupport",o,t),e}}()),f[r._uid]=!0;var e=r.props.eventTypes;e.forEach||(e=[e]),m[r._uid]=function(e){var t;null!==r.componentNode&&(r.props.preventDefault&&e.preventDefault(),r.props.stopPropagation&&e.stopPropagation(),r.props.excludeScrollbar&&(t=e,document.documentElement.clientWidth<=t.clientX||document.documentElement.clientHeight<=t.clientY)||function(e,t,o){if(e===t)return!0;for(;e.parentNode||e.host;){if(e.parentNode&&s(e,t,o))return!0;e=e.parentNode||e.host}return e}(e.composed&&e.composedPath&&e.composedPath().shift()||e.target,r.componentNode,r.props.outsideClickIgnoreClass)===document&&r.__outsideClickHandler(e))},e.forEach((function(e){document.addEventListener(e,m[r._uid],h(a(r),e))}))}},r.disableOnClickOutside=function(){delete f[r._uid];var e=m[r._uid];if(e&&"undefined"!==typeof document){var t=r.props.eventTypes;t.forEach||(t=[t]),t.forEach((function(t){return document.removeEventListener(t,e,h(a(r),t))})),delete m[r._uid]}},r.getRef=function(e){return r.instanceRef=e},r._uid=l(),r}p=o,(c=g).prototype=Object.create(p.prototype),c.prototype.constructor=c,i(c,p);var b=g.prototype;return b.getInstance=function(){if(e.prototype&&!e.prototype.isReactComponent)return this;var t=this.instanceRef;return t.getInstance?t.getInstance():t},b.componentDidMount=function(){if("undefined"!==typeof document&&document.createElement){var e=this.getInstance();if(t&&"function"===typeof t.handleClickOutside&&(this.__clickOutsideHandlerProp=t.handleClickOutside(e),"function"!==typeof this.__clickOutsideHandlerProp))throw new Error("WrappedComponent: "+d+" lacks a function for processing outside click events specified by the handleClickOutside config option.");this.componentNode=this.__getComponentNode(),this.props.disableOnClickOutside||this.enableOnClickOutside()}},b.componentDidUpdate=function(){this.componentNode=this.__getComponentNode()},b.componentWillUnmount=function(){this.disableOnClickOutside()},b.render=function(){var t=this.props;t.excludeScrollbar;var o=function(e,t){if(null==e)return{};var o,r,n={},i=Object.keys(e);for(r=0;r=0||(n[o]=e[o]);return n}(t,["excludeScrollbar"]);return e.prototype&&e.prototype.isReactComponent?o.ref=this.getRef:o.wrappedRef=this.getRef,o.disableOnClickOutside=this.disableOnClickOutside,o.enableOnClickOutside=this.enableOnClickOutside,Object(r.createElement)(e,o)},g}(r.Component),o.displayName="OnClickOutside("+d+")",o.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},o.getClass=function(){return e.getClass?e.getClass():e},c}},function(e,t,o){"use strict";!function(t){function o(e){return parseInt(e)===e}function r(e){if(!o(e.length))return!1;for(var t=0;t255)return!1;return!0}function n(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!r(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(o(e.length)&&r(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function i(e){return new Uint8Array(e)}function a(e,t,o,r,n){null==r&&null==n||(e=e.slice?e.slice(r,n):Array.prototype.slice.call(e,r,n)),t.set(e,o)}var s={toBytes:function(e){var t=[],o=0;for(e=encodeURI(e);o191&&r<224?(t.push(String.fromCharCode((31&r)<<6|63&e[o+1])),o+=2):(t.push(String.fromCharCode((15&r)<<12|(63&e[o+1])<<6|63&e[o+2])),o+=3)}return t.join("")}},c=function(){var e="0123456789abcdef";return{toBytes:function(e){for(var t=[],o=0;o>4]+e[15&n])}return o.join("")}}}(),u={16:10,24:12,32:14},l=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],m=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],f=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],d=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],h=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],p=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],g=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],b=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],y=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],v=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],k=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],w=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],x=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],z=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],j=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function M(e){for(var t=[],o=0;o>2,this._Ke[o][t%4]=i[t],this._Kd[e-o][t%4]=i[t];for(var a,s=0,c=n;c>16&255]<<24^m[a>>8&255]<<16^m[255&a]<<8^m[a>>24&255]^l[s]<<24,s+=1,8!=n)for(t=1;t>8&255]<<8^m[a>>16&255]<<16^m[a>>24&255]<<24;for(t=n/2+1;t>2,d=c%4,this._Ke[f][d]=i[t],this._Kd[e-f][d]=i[t++],c++}for(var f=1;f>24&255]^x[a>>16&255]^z[a>>8&255]^j[255&a]},A.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,o=[0,0,0,0],r=M(e),n=0;n<4;n++)r[n]^=this._Ke[0][n];for(var a=1;a>24&255]^h[r[(n+1)%4]>>16&255]^p[r[(n+2)%4]>>8&255]^g[255&r[(n+3)%4]]^this._Ke[a][n];r=o.slice()}var s,c=i(16);for(n=0;n<4;n++)s=this._Ke[t][n],c[4*n]=255&(m[r[n]>>24&255]^s>>24),c[4*n+1]=255&(m[r[(n+1)%4]>>16&255]^s>>16),c[4*n+2]=255&(m[r[(n+2)%4]>>8&255]^s>>8),c[4*n+3]=255&(m[255&r[(n+3)%4]]^s);return c},A.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,o=[0,0,0,0],r=M(e),n=0;n<4;n++)r[n]^=this._Kd[0][n];for(var a=1;a>24&255]^y[r[(n+3)%4]>>16&255]^v[r[(n+2)%4]>>8&255]^k[255&r[(n+1)%4]]^this._Kd[a][n];r=o.slice()}var s,c=i(16);for(n=0;n<4;n++)s=this._Kd[t][n],c[4*n]=255&(f[r[n]>>24&255]^s>>24),c[4*n+1]=255&(f[r[(n+3)%4]>>16&255]^s>>16),c[4*n+2]=255&(f[r[(n+2)%4]>>8&255]^s>>8),c[4*n+3]=255&(f[255&r[(n+1)%4]]^s);return c};var q=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new A(t)};q.prototype.encrypt=function(e){if((e=n(e)).length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),o=i(16),r=0;r=0;--t)this._counter[t]=e%256,e>>=8},N.prototype.setBytes=function(e){if(16!=(e=n(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},N.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var _=function e(t,o){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",o instanceof N||(o=new N(o)),this._counter=o,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new A(t)};_.prototype.encrypt=function(e){for(var t=n(e,!0),o=0;o16)throw new Error("PKCS#7 padding byte out of range");for(var o=e.length-t,r=0;r0&&a.length>n&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,o){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:o},n=f.bind(r);return n.listener=o,r.wrapFn=n,n}function h(e,t,o){var r=e._events;if(void 0===r)return[];var n=r[t];return void 0===n?[]:"function"===typeof n?o?[n.listener||n]:[n]:o?function(e){for(var t=new Array(e.length),o=0;o0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=n[e];if(void 0===c)return!1;if("function"===typeof c)i(c,this,t);else{var u=c.length,l=g(c,u);for(o=0;o=0;i--)if(o[i]===t||o[i].listener===t){a=o[i].listener,n=i;break}if(n<0)return this;0===n?o.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,o){"use strict";o.d(t,"b",(function(){return m})),o.d(t,"a",(function(){return d})),o.d(t,"c",(function(){return p})),o.d(t,"d",(function(){return b})),o.d(t,"e",(function(){return v})),o.d(t,"f",(function(){return w}));var r=o(2),n=o(11),i=o(40),a=o(28);function s(e){return e===a.a?{length:a.b,name:a.a}:{hash:{name:a.f},name:a.e}}function c(e){return e===a.a?[a.d,a.c]:[a.k,a.l]}function u(e){return l.apply(this,arguments)}function l(){return l=Object(n.a)(Object(r.a)().mark((function e(t){var o,n=arguments;return Object(r.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.length>1&&void 0!==n[1]?n[1]:a.a,e.abrupt("return",i.getSubtleCrypto().importKey("raw",t,s(o),!0,c(o)));case 2:case"end":return e.stop()}}),e)}))),l.apply(this,arguments)}function m(e,t,o){return f.apply(this,arguments)}function f(){return(f=Object(n.a)(Object(r.a)().mark((function e(t,o,n){var s,c,l;return Object(r.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=i.getSubtleCrypto(),e.next=3,u(o,a.a);case 3:return c=e.sent,e.next=6,s.encrypt({iv:t,name:a.a},c,n);case 6:return l=e.sent,e.abrupt("return",new Uint8Array(l));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function d(e,t,o){return h.apply(this,arguments)}function h(){return(h=Object(n.a)(Object(r.a)().mark((function e(t,o,n){var s,c,l;return Object(r.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=i.getSubtleCrypto(),e.next=3,u(o,a.a);case 3:return c=e.sent,e.next=6,s.decrypt({iv:t,name:a.a},c,n);case 6:return l=e.sent,e.abrupt("return",new Uint8Array(l));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e,t){return g.apply(this,arguments)}function g(){return(g=Object(n.a)(Object(r.a)().mark((function e(t,o){var n,s,c;return Object(r.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.getSubtleCrypto(),e.next=3,u(t,a.e);case 3:return s=e.sent,e.next=6,n.sign({length:a.g,name:a.e},s,o);case 6:return c=e.sent,e.abrupt("return",new Uint8Array(c));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(e,t){return y.apply(this,arguments)}function y(){return(y=Object(n.a)(Object(r.a)().mark((function e(t,o){var n,s,c;return Object(r.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.getSubtleCrypto(),e.next=3,u(t,a.e);case 3:return s=e.sent,e.next=6,n.sign({length:a.h,name:a.e},s,o);case 6:return c=e.sent,e.abrupt("return",new Uint8Array(c));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e){return k.apply(this,arguments)}function k(){return(k=Object(n.a)(Object(r.a)().mark((function e(t){var o,n;return Object(r.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.getSubtleCrypto(),e.next=3,o.digest({name:a.i},t);case 3:return n=e.sent,e.abrupt("return",new Uint8Array(n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function w(e){return x.apply(this,arguments)}function x(){return(x=Object(n.a)(Object(r.a)().mark((function e(t){var o,n;return Object(r.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.getSubtleCrypto(),e.next=3,o.digest({name:a.j},t);case 3:return n=e.sent,e.abrupt("return",new Uint8Array(n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},function(e,t,o){"use strict";var r=o(71),n=o(23);function i(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=n,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var o=[];if("string"===typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),n=0;n>6|192,o[r++]=63&a|128):i(e,n)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++n)),o[r++]=a>>18|240,o[r++]=a>>12&63|128,o[r++]=a>>6&63|128,o[r++]=63&a|128):(o[r++]=a>>12|224,o[r++]=a>>6&63|128,o[r++]=63&a|128)}else for(n=0;n>>0}return a},t.split32=function(e,t){for(var o=new Array(4*e.length),r=0,n=0;r>>24,o[n+1]=i>>>16&255,o[n+2]=i>>>8&255,o[n+3]=255&i):(o[n+3]=i>>>24,o[n+2]=i>>>16&255,o[n+1]=i>>>8&255,o[n]=255&i)}return o},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,o){return e+t+o>>>0},t.sum32_4=function(e,t,o,r){return e+t+o+r>>>0},t.sum32_5=function(e,t,o,r,n){return e+t+o+r+n>>>0},t.sum64=function(e,t,o,r){var n=e[t],i=r+e[t+1]>>>0,a=(i>>0,e[t+1]=i},t.sum64_hi=function(e,t,o,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,o,r){return t+r>>>0},t.sum64_4_hi=function(e,t,o,r,n,i,a,s){var c=0,u=t;return c+=(u=u+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,o,r,n,i,a,s){return t+r+i+s>>>0},t.sum64_5_hi=function(e,t,o,r,n,i,a,s,c,u){var l=0,m=t;return l+=(m=m+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,o,r,n,i,a,s,c,u){return t+r+i+s+u>>>0},t.rotr64_hi=function(e,t,o){return(t<<32-o|e>>>o)>>>0},t.rotr64_lo=function(e,t,o){return(e<<32-o|t>>>o)>>>0},t.shr64_hi=function(e,t,o){return e>>>o},t.shr64_lo=function(e,t,o){return(e<<32-o|t>>>o)>>>0}},function(e,t,o){var r;"undefined"!==typeof self&&self,r=function(){return function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/",o(o.s=7)}([function(e,t,o){"use strict";e.exports=function(e,t,o,r,n,i,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[o,r,n,i,a,s],l=0;(c=new Error(t.replace(/%s/g,(function(){return u[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,o){"use strict";function r(e){return function(){return e}}var n=function(){};n.thatReturns=r,n.thatReturnsFalse=r(!1),n.thatReturnsTrue=r(!0),n.thatReturnsNull=r(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e},e.exports=n},function(e,t,o){"use strict";var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},o=0;o<10;o++)t["_"+String.fromCharCode(o)]=o;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(n){return!1}}()?Object.assign:function(e,t){for(var o,a,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),c=1;c0},l(r,o)}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props.delay;this.state.delayed&&(this.timeout=setTimeout((function(){e.setState({delayed:!1})}),t))}},{key:"componentWillUnmount",value:function(){var e=this.timeout;e&&clearTimeout(e)}},{key:"render",value:function(){var e=this.props,t=e.color,o=(e.delay,e.type),n=e.height,i=e.width,s=function(e,t){var o={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(o[r]=e[r]);return o}(e,["color","delay","type","height","width"]),u=this.state.delayed?"blank":o,l=c[u],m={fill:t,height:n,width:i};return a.default.createElement("div",r({style:m,dangerouslySetInnerHTML:{__html:l}},s))}}]),t}(i.Component);m.propTypes={color:s.default.string,delay:s.default.number,type:s.default.string,height:s.default.oneOfType([s.default.string,s.default.number]),width:s.default.oneOfType([s.default.string,s.default.number])},m.defaultProps={color:"#fff",delay:0,type:"balls",height:64,width:64},t.default=m},function(e,t,o){"use strict";e.exports=o(9)},function(e,t,o){"use strict";var r=o(2),n=o(0),i=o(5),a=o(1),s="function"===typeof Symbol&&Symbol.for,c=s?Symbol.for("react.element"):60103,u=s?Symbol.for("react.portal"):60106,l=s?Symbol.for("react.fragment"):60107,m=s?Symbol.for("react.strict_mode"):60108,f=s?Symbol.for("react.provider"):60109,d=s?Symbol.for("react.context"):60110,h=s?Symbol.for("react.async_mode"):60111,p=s?Symbol.for("react.forward_ref"):60112,g="function"===typeof Symbol&&Symbol.iterator;function b(e){for(var t=arguments.length-1,o="http://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;rE.length&&E.push(e)}function _(e,t,o,r){var n=typeof e;"undefined"!==n&&"boolean"!==n||(e=null);var i=!1;if(null===e)i=!0;else switch(n){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case c:case u:i=!0}}if(i)return o(r,e,""===t?"."+T(e,0):t),1;if(i=0,t=""===t?".":t+":",Array.isArray(e))for(var a=0;a=65&&o<=70?o-55:o>=97&&o<=102?o-87:o-48&15}function c(e,t,o){var r=s(e,o);return o-1>=t&&(r|=s(e,o-1)<<4),r}function u(e,t,o,r){for(var n=0,i=Math.min(e.length,o),a=t;a=49?s-49+10:s>=17?s-17+10:s}return n}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,o){if("number"===typeof e)return this._initNumber(e,t,o);if("object"===typeof e)return this._initArray(e,t,o);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===o)for(n=0,i=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,o){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=c(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=n>>>26):i+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=n>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,o){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-o,a=i%r,s=Math.min(i,i-a)+o,c=0,l=o;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var l=["","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"],m=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,o){o.negative=t.negative^e.negative;var r=e.length+t.length|0;o.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],a=n*i,s=67108863&a,c=a/67108864|0;o.words[0]=s;for(var u=1;u>>26,m=67108863&c,f=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=f;d++){var h=u-d|0;l+=(a=(n=0|e.words[h])*(i=0|t.words[d])+m)/67108864|0,m=67108863&a}o.words[u]=0|m,c=0|l}return 0!==c?o.words[u]=0|c:o.length--,o.strip()}i.prototype.toString=function(e,t){var o;if(t=0|t||1,16===(e=e||10)||"hex"===e){o="";for(var n=0,i=0,a=0;a>>24-n&16777215)||a!==this.length-1?l[6-c.length]+c+o:c+o,(n+=2)>=26&&(n-=26,a--)}for(0!==i&&(o=i.toString(16)+o);o.length%t!==0;)o="0"+o;return 0!==this.negative&&(o="-"+o),o}if(e===(0|e)&&e>=2&&e<=36){var u=m[e],d=f[e];o="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(d).toString(e);o=(h=h.idivn(d)).isZero()?p+o:l[u-p.length]+p+o}for(this.isZero()&&(o="0"+o);o.length%t!==0;)o="0"+o;return 0!==this.negative&&(o="-"+o),o}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r("undefined"!==typeof a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,o){var n=this.byteLength(),i=o||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(i),l=this.clone();if(c){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[s]=a;for(;s=4096&&(o+=13,t>>>=13),t>=64&&(o+=7,t>>>=7),t>=8&&(o+=4,t>>>=4),t>=2&&(o+=2,t>>>=2),o+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,o=0;return 0===(8191&t)&&(o+=13,t>>>=13),0===(127&t)&&(o+=7,t>>>=7),0===(15&t)&&(o+=4,t>>>=4),0===(3&t)&&(o+=2,t>>>=2),0===(1&t)&&o++,o},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var o=0;oe.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,o;this.length>e.length?(t=this,o=e):(t=e,o=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),o=e%26;this._expand(t),o>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-o),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var o=e/26|0,n=e%26;return this._expand(o+1),this.words[o]=t?this.words[o]|1<e.length?(o=this,r=e):(o=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=o.length,0!==n)this.words[this.length]=n,this.length++;else if(o!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var o,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(o=this,r=e):(o=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],h=8191&d,p=d>>>13,g=0|a[2],b=8191&g,y=g>>>13,v=0|a[3],k=8191&v,w=v>>>13,x=0|a[4],z=8191&x,j=x>>>13,M=0|a[5],A=8191&M,q=M>>>13,I=0|a[6],E=8191&I,S=I>>>13,N=0|a[7],_=8191&N,T=N>>>13,O=0|a[8],C=8191&O,D=O>>>13,L=0|a[9],P=8191&L,R=L>>>13,B=0|s[0],U=8191&B,F=B>>>13,Q=0|s[1],Y=8191&Q,H=Q>>>13,G=0|s[2],W=8191&G,Z=G>>>13,V=0|s[3],K=8191&V,J=V>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],oe=8191&te,re=te>>>13,ne=0|s[6],ie=8191&ne,ae=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,le=0|s[8],me=8191&le,fe=le>>>13,de=0|s[9],he=8191&de,pe=de>>>13;o.negative=e.negative^t.negative,o.length=19;var ge=(u+(r=Math.imul(m,U))|0)+((8191&(n=(n=Math.imul(m,F))+Math.imul(f,U)|0))<<13)|0;u=((i=Math.imul(f,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(h,U),n=(n=Math.imul(h,F))+Math.imul(p,U)|0,i=Math.imul(p,F);var be=(u+(r=r+Math.imul(m,Y)|0)|0)+((8191&(n=(n=n+Math.imul(m,H)|0)+Math.imul(f,Y)|0))<<13)|0;u=((i=i+Math.imul(f,H)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(b,U),n=(n=Math.imul(b,F))+Math.imul(y,U)|0,i=Math.imul(y,F),r=r+Math.imul(h,Y)|0,n=(n=n+Math.imul(h,H)|0)+Math.imul(p,Y)|0,i=i+Math.imul(p,H)|0;var ye=(u+(r=r+Math.imul(m,W)|0)|0)+((8191&(n=(n=n+Math.imul(m,Z)|0)+Math.imul(f,W)|0))<<13)|0;u=((i=i+Math.imul(f,Z)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(k,U),n=(n=Math.imul(k,F))+Math.imul(w,U)|0,i=Math.imul(w,F),r=r+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(y,Y)|0,i=i+Math.imul(y,H)|0,r=r+Math.imul(h,W)|0,n=(n=n+Math.imul(h,Z)|0)+Math.imul(p,W)|0,i=i+Math.imul(p,Z)|0;var ve=(u+(r=r+Math.imul(m,K)|0)|0)+((8191&(n=(n=n+Math.imul(m,J)|0)+Math.imul(f,K)|0))<<13)|0;u=((i=i+Math.imul(f,J)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(z,U),n=(n=Math.imul(z,F))+Math.imul(j,U)|0,i=Math.imul(j,F),r=r+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,H)|0)+Math.imul(w,Y)|0,i=i+Math.imul(w,H)|0,r=r+Math.imul(b,W)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,Z)|0,r=r+Math.imul(h,K)|0,n=(n=n+Math.imul(h,J)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,J)|0;var ke=(u+(r=r+Math.imul(m,$)|0)|0)+((8191&(n=(n=n+Math.imul(m,ee)|0)+Math.imul(f,$)|0))<<13)|0;u=((i=i+Math.imul(f,ee)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(A,U),n=(n=Math.imul(A,F))+Math.imul(q,U)|0,i=Math.imul(q,F),r=r+Math.imul(z,Y)|0,n=(n=n+Math.imul(z,H)|0)+Math.imul(j,Y)|0,i=i+Math.imul(j,H)|0,r=r+Math.imul(k,W)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(w,W)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(b,K)|0,n=(n=n+Math.imul(b,J)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,J)|0,r=r+Math.imul(h,$)|0,n=(n=n+Math.imul(h,ee)|0)+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0;var we=(u+(r=r+Math.imul(m,oe)|0)|0)+((8191&(n=(n=n+Math.imul(m,re)|0)+Math.imul(f,oe)|0))<<13)|0;u=((i=i+Math.imul(f,re)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,U),n=(n=Math.imul(E,F))+Math.imul(S,U)|0,i=Math.imul(S,F),r=r+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,H)|0)+Math.imul(q,Y)|0,i=i+Math.imul(q,H)|0,r=r+Math.imul(z,W)|0,n=(n=n+Math.imul(z,Z)|0)+Math.imul(j,W)|0,i=i+Math.imul(j,Z)|0,r=r+Math.imul(k,K)|0,n=(n=n+Math.imul(k,J)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,J)|0,r=r+Math.imul(b,$)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,ee)|0,r=r+Math.imul(h,oe)|0,n=(n=n+Math.imul(h,re)|0)+Math.imul(p,oe)|0,i=i+Math.imul(p,re)|0;var xe=(u+(r=r+Math.imul(m,ie)|0)|0)+((8191&(n=(n=n+Math.imul(m,ae)|0)+Math.imul(f,ie)|0))<<13)|0;u=((i=i+Math.imul(f,ae)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(_,U),n=(n=Math.imul(_,F))+Math.imul(T,U)|0,i=Math.imul(T,F),r=r+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(S,Y)|0,i=i+Math.imul(S,H)|0,r=r+Math.imul(A,W)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,W)|0,i=i+Math.imul(q,Z)|0,r=r+Math.imul(z,K)|0,n=(n=n+Math.imul(z,J)|0)+Math.imul(j,K)|0,i=i+Math.imul(j,J)|0,r=r+Math.imul(k,$)|0,n=(n=n+Math.imul(k,ee)|0)+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(b,oe)|0,n=(n=n+Math.imul(b,re)|0)+Math.imul(y,oe)|0,i=i+Math.imul(y,re)|0,r=r+Math.imul(h,ie)|0,n=(n=n+Math.imul(h,ae)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,ae)|0;var ze=(u+(r=r+Math.imul(m,ce)|0)|0)+((8191&(n=(n=n+Math.imul(m,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((i=i+Math.imul(f,ue)|0)+(n>>>13)|0)+(ze>>>26)|0,ze&=67108863,r=Math.imul(C,U),n=(n=Math.imul(C,F))+Math.imul(D,U)|0,i=Math.imul(D,F),r=r+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,H)|0)+Math.imul(T,Y)|0,i=i+Math.imul(T,H)|0,r=r+Math.imul(E,W)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,Z)|0,r=r+Math.imul(A,K)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,K)|0,i=i+Math.imul(q,J)|0,r=r+Math.imul(z,$)|0,n=(n=n+Math.imul(z,ee)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,ee)|0,r=r+Math.imul(k,oe)|0,n=(n=n+Math.imul(k,re)|0)+Math.imul(w,oe)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(b,ie)|0,n=(n=n+Math.imul(b,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0,r=r+Math.imul(h,ce)|0,n=(n=n+Math.imul(h,ue)|0)+Math.imul(p,ce)|0,i=i+Math.imul(p,ue)|0;var je=(u+(r=r+Math.imul(m,me)|0)|0)+((8191&(n=(n=n+Math.imul(m,fe)|0)+Math.imul(f,me)|0))<<13)|0;u=((i=i+Math.imul(f,fe)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(P,U),n=(n=Math.imul(P,F))+Math.imul(R,U)|0,i=Math.imul(R,F),r=r+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,H)|0)+Math.imul(D,Y)|0,i=i+Math.imul(D,H)|0,r=r+Math.imul(_,W)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(T,W)|0,i=i+Math.imul(T,Z)|0,r=r+Math.imul(E,K)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(S,K)|0,i=i+Math.imul(S,J)|0,r=r+Math.imul(A,$)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,$)|0,i=i+Math.imul(q,ee)|0,r=r+Math.imul(z,oe)|0,n=(n=n+Math.imul(z,re)|0)+Math.imul(j,oe)|0,i=i+Math.imul(j,re)|0,r=r+Math.imul(k,ie)|0,n=(n=n+Math.imul(k,ae)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,ae)|0,r=r+Math.imul(b,ce)|0,n=(n=n+Math.imul(b,ue)|0)+Math.imul(y,ce)|0,i=i+Math.imul(y,ue)|0,r=r+Math.imul(h,me)|0,n=(n=n+Math.imul(h,fe)|0)+Math.imul(p,me)|0,i=i+Math.imul(p,fe)|0;var Me=(u+(r=r+Math.imul(m,he)|0)|0)+((8191&(n=(n=n+Math.imul(m,pe)|0)+Math.imul(f,he)|0))<<13)|0;u=((i=i+Math.imul(f,pe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(P,Y),n=(n=Math.imul(P,H))+Math.imul(R,Y)|0,i=Math.imul(R,H),r=r+Math.imul(C,W)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(D,W)|0,i=i+Math.imul(D,Z)|0,r=r+Math.imul(_,K)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(T,K)|0,i=i+Math.imul(T,J)|0,r=r+Math.imul(E,$)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,r=r+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,re)|0)+Math.imul(q,oe)|0,i=i+Math.imul(q,re)|0,r=r+Math.imul(z,ie)|0,n=(n=n+Math.imul(z,ae)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,ae)|0,r=r+Math.imul(k,ce)|0,n=(n=n+Math.imul(k,ue)|0)+Math.imul(w,ce)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(b,me)|0,n=(n=n+Math.imul(b,fe)|0)+Math.imul(y,me)|0,i=i+Math.imul(y,fe)|0;var Ae=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(n=(n=n+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;u=((i=i+Math.imul(p,pe)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(P,W),n=(n=Math.imul(P,Z))+Math.imul(R,W)|0,i=Math.imul(R,Z),r=r+Math.imul(C,K)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,J)|0,r=r+Math.imul(_,$)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,r=r+Math.imul(E,oe)|0,n=(n=n+Math.imul(E,re)|0)+Math.imul(S,oe)|0,i=i+Math.imul(S,re)|0,r=r+Math.imul(A,ie)|0,n=(n=n+Math.imul(A,ae)|0)+Math.imul(q,ie)|0,i=i+Math.imul(q,ae)|0,r=r+Math.imul(z,ce)|0,n=(n=n+Math.imul(z,ue)|0)+Math.imul(j,ce)|0,i=i+Math.imul(j,ue)|0,r=r+Math.imul(k,me)|0,n=(n=n+Math.imul(k,fe)|0)+Math.imul(w,me)|0,i=i+Math.imul(w,fe)|0;var qe=(u+(r=r+Math.imul(b,he)|0)|0)+((8191&(n=(n=n+Math.imul(b,pe)|0)+Math.imul(y,he)|0))<<13)|0;u=((i=i+Math.imul(y,pe)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,r=Math.imul(P,K),n=(n=Math.imul(P,J))+Math.imul(R,K)|0,i=Math.imul(R,J),r=r+Math.imul(C,$)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(D,$)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,re)|0)+Math.imul(T,oe)|0,i=i+Math.imul(T,re)|0,r=r+Math.imul(E,ie)|0,n=(n=n+Math.imul(E,ae)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,r=r+Math.imul(A,ce)|0,n=(n=n+Math.imul(A,ue)|0)+Math.imul(q,ce)|0,i=i+Math.imul(q,ue)|0,r=r+Math.imul(z,me)|0,n=(n=n+Math.imul(z,fe)|0)+Math.imul(j,me)|0,i=i+Math.imul(j,fe)|0;var Ie=(u+(r=r+Math.imul(k,he)|0)|0)+((8191&(n=(n=n+Math.imul(k,pe)|0)+Math.imul(w,he)|0))<<13)|0;u=((i=i+Math.imul(w,pe)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(P,$),n=(n=Math.imul(P,ee))+Math.imul(R,$)|0,i=Math.imul(R,ee),r=r+Math.imul(C,oe)|0,n=(n=n+Math.imul(C,re)|0)+Math.imul(D,oe)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(_,ie)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,ae)|0,r=r+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,i=i+Math.imul(S,ue)|0,r=r+Math.imul(A,me)|0,n=(n=n+Math.imul(A,fe)|0)+Math.imul(q,me)|0,i=i+Math.imul(q,fe)|0;var Ee=(u+(r=r+Math.imul(z,he)|0)|0)+((8191&(n=(n=n+Math.imul(z,pe)|0)+Math.imul(j,he)|0))<<13)|0;u=((i=i+Math.imul(j,pe)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(P,oe),n=(n=Math.imul(P,re))+Math.imul(R,oe)|0,i=Math.imul(R,re),r=r+Math.imul(C,ie)|0,n=(n=n+Math.imul(C,ae)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,ae)|0,r=r+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(T,ce)|0,i=i+Math.imul(T,ue)|0,r=r+Math.imul(E,me)|0,n=(n=n+Math.imul(E,fe)|0)+Math.imul(S,me)|0,i=i+Math.imul(S,fe)|0;var Se=(u+(r=r+Math.imul(A,he)|0)|0)+((8191&(n=(n=n+Math.imul(A,pe)|0)+Math.imul(q,he)|0))<<13)|0;u=((i=i+Math.imul(q,pe)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(P,ie),n=(n=Math.imul(P,ae))+Math.imul(R,ie)|0,i=Math.imul(R,ae),r=r+Math.imul(C,ce)|0,n=(n=n+Math.imul(C,ue)|0)+Math.imul(D,ce)|0,i=i+Math.imul(D,ue)|0,r=r+Math.imul(_,me)|0,n=(n=n+Math.imul(_,fe)|0)+Math.imul(T,me)|0,i=i+Math.imul(T,fe)|0;var Ne=(u+(r=r+Math.imul(E,he)|0)|0)+((8191&(n=(n=n+Math.imul(E,pe)|0)+Math.imul(S,he)|0))<<13)|0;u=((i=i+Math.imul(S,pe)|0)+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(P,ce),n=(n=Math.imul(P,ue))+Math.imul(R,ce)|0,i=Math.imul(R,ue),r=r+Math.imul(C,me)|0,n=(n=n+Math.imul(C,fe)|0)+Math.imul(D,me)|0,i=i+Math.imul(D,fe)|0;var _e=(u+(r=r+Math.imul(_,he)|0)|0)+((8191&(n=(n=n+Math.imul(_,pe)|0)+Math.imul(T,he)|0))<<13)|0;u=((i=i+Math.imul(T,pe)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(P,me),n=(n=Math.imul(P,fe))+Math.imul(R,me)|0,i=Math.imul(R,fe);var Te=(u+(r=r+Math.imul(C,he)|0)|0)+((8191&(n=(n=n+Math.imul(C,pe)|0)+Math.imul(D,he)|0))<<13)|0;u=((i=i+Math.imul(D,pe)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863;var Oe=(u+(r=Math.imul(P,he))|0)+((8191&(n=(n=Math.imul(P,pe))+Math.imul(R,he)|0))<<13)|0;return u=((i=Math.imul(R,pe))+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,c[0]=ge,c[1]=be,c[2]=ye,c[3]=ve,c[4]=ke,c[5]=we,c[6]=xe,c[7]=ze,c[8]=je,c[9]=Me,c[10]=Ae,c[11]=qe,c[12]=Ie,c[13]=Ee,c[14]=Se,c[15]=Ne,c[16]=_e,c[17]=Te,c[18]=Oe,0!==u&&(c[19]=u,o.length++),o};function p(e,t,o){return(new g).mulp(e,t,o)}function g(e,t){this.x=e,this.y=t}Math.imul||(h=d),i.prototype.mulTo=function(e,t){var o,r=this.length+e.length;return o=10===this.length&&10===e.length?h(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,o){o.negative=t.negative^e.negative,o.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0)>>>26,a&=67108863}o.words[i]=s,r=a,a=n}return 0!==r?o.words[i]=r:o.length--,o.strip()}(this,e,t):p(this,e,t),o},g.prototype.makeRBT=function(e){for(var t=new Array(e),o=i.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,o,r,n,i){for(var a=0;a>>=1)n++;return 1<>>=13,o[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=n/67108864|0,t+=i>>>26,this.words[o]=67108863&i}return 0!==t&&(this.words[o]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),o=0;o>>n}return t}(e);if(0===t.length)return new i(1);for(var o=this,r=0;r=0);var t,o=e%26,n=(e-o)/26,i=67108863>>>26-o<<26-o;if(0!==o){var a=0;for(t=0;t>>26-o}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=n);u--){var m=0|this.words[u];this.words[u]=l<<26-i|m>>>i,l=m&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,o){return r(0===this.negative),this.iushrn(e,t,o)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,o=(e-t)/26,n=1<=0);var t=e%26,o=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=o)return this;if(0!==t&&o++,this.length=Math.min(o,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[n+o]=67108863&i}for(;n>26,this.words[n+o]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var o=(this.length,e.length),r=this.clone(),n=e,a=0|n.words[n.length-1];0!==(o=26-this._countBits(a))&&(n=n.ushln(o),r.iushln(o),a=0|n.words[n.length-1]);var s,c=r.length-n.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;m--){var f=67108864*(0|r.words[n.length+m])+(0|r.words[n.length+m-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(n,f,m);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(n,1,m),r.isZero()||(r.negative^=1);s&&(s.words[m]=f)}return s&&s.strip(),r.strip(),"div"!==t&&0!==o&&r.iushrn(o),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,o){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(a=s.mod.neg(),o&&0!==a.negative&&a.iadd(e)),{div:n,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),o&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var o=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=o.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,o=0,n=this.length-1;n>=0;n--)o=(t*o+(0|this.words[n]))%e;return o},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,o=this.length-1;o>=0;o--){var n=(0|this.words[o])+67108864*t;this.words[o]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,o=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&o.isEven();)t.iushrn(1),o.iushrn(1),++u;for(var l=o.clone(),m=t.clone();!t.isZero();){for(var f=0,d=1;0===(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(l),a.isub(m)),n.iushrn(1),a.iushrn(1);for(var h=0,p=1;0===(o.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(o.iushrn(h);h-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(m)),s.iushrn(1),c.iushrn(1);t.cmp(o)>=0?(t.isub(o),n.isub(s),a.isub(c)):(o.isub(t),s.isub(n),c.isub(a))}return{a:s,b:c,gcd:o.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,o=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,a=new i(1),s=new i(0),c=o.clone();t.cmpn(1)>0&&o.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var m=0,f=1;0===(o.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(o.iushrn(m);m-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(o)>=0?(t.isub(o),a.isub(s)):(o.isub(t),s.isub(a))}return(n=0===t.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),o=e.clone();t.negative=0,o.negative=0;for(var r=0;t.isEven()&&o.isEven();r++)t.iushrn(1),o.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;o.isEven();)o.iushrn(1);var n=t.cmp(o);if(n<0){var i=t;t=o,o=i}else if(0===n||0===o.cmpn(1))break;t.isub(o)}return o.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,o=(e-t)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,o=e<0;if(0!==this.negative&&!o)return-1;if(0===this.negative&&o)return 1;if(this.strip(),this.length>1)t=1;else{o&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;o--){var r=0|this.words[o],n=0|e.words[o];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new z(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function z(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function j(e){z.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,o=e;do{this.split(o,this.tmp),t=(o=(o=this.imulK(o)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?o.isub(this.p):void 0!==o.strip?o.strip():o._strip(),o},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},n(v,y),v.prototype.split=function(e,t){for(var o=4194303,r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,o=0;o>>=26,e.words[o]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new k;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return b[e]=t,t},z.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},z.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},z.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},z.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},z.prototype.add=function(e,t){this._verify2(e,t);var o=e.add(t);return o.cmp(this.m)>=0&&o.isub(this.m),o._forceRed(this)},z.prototype.iadd=function(e,t){this._verify2(e,t);var o=e.iadd(t);return o.cmp(this.m)>=0&&o.isub(this.m),o},z.prototype.sub=function(e,t){this._verify2(e,t);var o=e.sub(t);return o.cmpn(0)<0&&o.iadd(this.m),o._forceRed(this)},z.prototype.isub=function(e,t){this._verify2(e,t);var o=e.isub(t);return o.cmpn(0)<0&&o.iadd(this.m),o},z.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},z.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},z.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},z.prototype.isqr=function(e){return this.imul(e,e.clone())},z.prototype.sqr=function(e){return this.mul(e,e)},z.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var o=this.m.add(new i(1)).iushrn(2);return this.pow(e,o)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);r(!n.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var m=this.pow(l,n),f=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),h=a;0!==d.cmp(s);){for(var p=d,g=0;0!==p.cmp(s);g++)p=p.redSqr();r(g=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var m=u>>l&1;n!==o[0]&&(n=this.sqr(n)),0!==m||0!==a?(a<<=1,a|=m,(4===++s||0===r&&0===l)&&(n=this.mul(n,o[a]),s=0,a=0)):s=0}c=26}return n},z.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},z.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new j(e)},n(j,z),j.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},j.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},j.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var o=e.imul(t),r=o.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=o.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},j.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var o=e.mul(t),r=o.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=o.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},j.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,o(67)(e))},function(e,t,o){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}o.d(t,"a",(function(){return r}))},function(e,t,o){e.exports=function(){"use strict";var e=1e3,t=6e4,o=36e5,r="millisecond",n="second",i="minute",a="hour",s="day",c="week",u="month",l="quarter",m="year",f="date",d="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],o=e%100;return"["+e+(t[(o-20)%10]||t[o]||t[0])+"]"}},b=function(e,t,o){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(o)+e},y={s:b,z:function(e){var t=-e.utcOffset(),o=Math.abs(t),r=Math.floor(o/60),n=o%60;return(t<=0?"+":"-")+b(r,2,"0")+":"+b(n,2,"0")},m:function e(t,o){if(t.date()1)return e(a[0])}else{var s=t.name;k[s]=t,n=s}return!r&&n&&(v=n),n||!r&&v},z=function(e,t){if(w(e))return e.clone();var o="object"==typeof t?t:{};return o.date=e,o.args=arguments,new M(o)},j=y;j.l=x,j.i=w,j.w=function(e,t){return z(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var M=function(){function g(e){this.$L=x(e.locale,null,!0),this.parse(e)}var b=g.prototype;return b.parse=function(e){this.$d=function(e){var t=e.date,o=e.utc;if(null===t)return new Date(NaN);if(j.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(h);if(r){var n=r[2]-1||0,i=(r[7]||"0").substring(0,3);return o?new Date(Date.UTC(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},b.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},b.$utils=function(){return j},b.isValid=function(){return!(this.$d.toString()===d)},b.isSame=function(e,t){var o=z(e);return this.startOf(t)<=o&&o<=this.endOf(t)},b.isAfter=function(e,t){return z(e)=0}))},intToBuffer:function(e){var o=a(e);return new t(i(o.slice(2)),"hex")},getBinarySize:function(e){if("string"!==typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return t.byteLength(e,"utf8")},isHexPrefixed:r,stripHexPrefix:n,padToEven:i,intToHex:a,fromAscii:function(e){for(var t="",o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}},function(e,t){function o(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=o,o.equal=function(e,t,o){if(e!=t)throw new Error(o||"Assertion failed: "+e+" != "+t)}},function(e,t){var o,r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return r[e]},t.getBCHDigit=function(e){for(var t=0;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!==typeof e)throw new Error('"toSJISFunc" is not a valid function.');o=e},t.isKanjiModeEnabled=function(){return"undefined"!==typeof o},t.toSJIS=function(e){return o(e)}},function(e,t,o){var r=o(203),n=o(204);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!r.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return n.testNumeric(e)?t.NUMERIC:n.testAlphanumeric(e)?t.ALPHANUMERIC:n.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,o){if(t.isValid(e))return e;try{return function(e){if("string"!==typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(r){return o}}},function(e,t,o){"use strict";var r=o(109),n=Object.keys||function(e){var t=[];for(var o in e)t.push(o);return t};e.exports=m;var i=Object.create(o(96));i.inherits=o(23);var a=o(209),s=o(132);i.inherits(m,a);for(var c=n(s.prototype),u=0;u>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,o=function(e,t,o){if(128!==(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==o?o:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2===0){var o=e.toString("utf16le",t);if(o){var r=o.charCodeAt(o.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],o.slice(0,-1)}return o}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var o=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,o)}return t}function l(e,t){var o=(e.length-t)%3;return 0===o?e.toString("base64",t):(this.lastNeed=3-o,this.lastTotal=3,1===o?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-o))}function m(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,o;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";o=this.lastNeed,this.lastNeed=0}else o=0;return o=0)return n>0&&(e.lastNeed=n-1),n;if(--r=0)return n>0&&(e.lastNeed=n-2),n;if(--r=0)return n>0&&(2===n?n=0:e.lastNeed=n-3),n;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=o;var r=e.length-(o-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,o){(function(e){var r=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),o={},r=0;r=i)return e;switch(e){case"%s":return String(r[o++]);case"%d":return Number(r[o++]);case"%j":try{return JSON.stringify(r[o++])}catch(t){return"[Circular]"}default:return e}})),c=r[o];o=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),h(o)?r.showHidden=o:o&&t._extend(r,o),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=c),l(r,e,r.depth)}function c(e,t){var o=s.styles[t];return o?"\x1b["+s.colors[o][0]+"m"+e+"\x1b["+s.colors[o][1]+"m":e}function u(e,t){return e}function l(e,o,r){if(e.customInspect&&o&&z(o.inspect)&&o.inspect!==t.inspect&&(!o.constructor||o.constructor.prototype!==o)){var n=o.inspect(r,e);return b(n)||(n=l(e,n,r)),n}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(b(t)){var o="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(o,"string")}if(g(t))return e.stylize(""+t,"number");if(h(t))return e.stylize(""+t,"boolean");if(p(t))return e.stylize("null","null")}(e,o);if(i)return i;var a=Object.keys(o),s=function(e){var t={};return e.forEach((function(e,o){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(o)),x(o)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return m(o);if(0===a.length){if(z(o)){var c=o.name?": "+o.name:"";return e.stylize("[Function"+c+"]","special")}if(v(o))return e.stylize(RegExp.prototype.toString.call(o),"regexp");if(w(o))return e.stylize(Date.prototype.toString.call(o),"date");if(x(o))return m(o)}var u,k="",j=!1,M=["{","}"];(d(o)&&(j=!0,M=["[","]"]),z(o))&&(k=" [Function"+(o.name?": "+o.name:"")+"]");return v(o)&&(k=" "+RegExp.prototype.toString.call(o)),w(o)&&(k=" "+Date.prototype.toUTCString.call(o)),x(o)&&(k=" "+m(o)),0!==a.length||j&&0!=o.length?r<0?v(o)?e.stylize(RegExp.prototype.toString.call(o),"regexp"):e.stylize("[Object]","special"):(e.seen.push(o),u=j?function(e,t,o,r,n){for(var i=[],a=0,s=t.length;a=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(r>60)return o[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+o[1];return o[0]+t+" "+e.join(", ")+" "+o[1]}(u,k,M)):M[0]+k+M[1]}function m(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,o,r,n,i){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),q(r,n)||(a="["+n+"]"),s||(e.seen.indexOf(c.value)<0?(s=p(o)?l(e,c.value,null):l(e,c.value,o-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(a)){if(i&&n.match(/^\d+$/))return s;(a=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function d(e){return Array.isArray(e)}function h(e){return"boolean"===typeof e}function p(e){return null===e}function g(e){return"number"===typeof e}function b(e){return"string"===typeof e}function y(e){return void 0===e}function v(e){return k(e)&&"[object RegExp]"===j(e)}function k(e){return"object"===typeof e&&null!==e}function w(e){return k(e)&&"[object Date]"===j(e)}function x(e){return k(e)&&("[object Error]"===j(e)||e instanceof Error)}function z(e){return"function"===typeof e}function j(e){return Object.prototype.toString.call(e)}function M(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(o){if(y(i)&&(i=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://d1kmk7xbdzoq9f.cloudfront.net/api2",REACT_APP_AWS_MEDIA_LINK:"https://d2eg5mcwzjkd4t.cloudfront.net/ImagesSatoshi",REACT_APP_CONTRACT_HELPER_API_URL:"https://d1kmk7xbdzoq9f.cloudfront.net/contract-helper-api"}).NODE_DEBUG||""),o=o.toUpperCase(),!a[o])if(new RegExp("\\b"+o+"\\b","i").test(i)){var r=e.pid;a[o]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",o,r,e)}}else a[o]=function(){};return a[o]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=h,t.isNull=p,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=b,t.isSymbol=function(e){return"symbol"===typeof e},t.isUndefined=y,t.isRegExp=v,t.isObject=k,t.isDate=w,t.isError=x,t.isFunction=z,t.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},t.isBuffer=o(457);var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function q(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",function(){var e=new Date,t=[M(e.getHours()),M(e.getMinutes()),M(e.getSeconds())].join(":");return[e.getDate(),A[e.getMonth()],t].join(" ")}(),t.format.apply(t,arguments))},t.inherits=o(458),t._extend=function(e,t){if(!t||!k(t))return e;for(var o=Object.keys(t),r=o.length;r--;)e[o[r]]=t[o[r]];return e};var I="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(e,t){if(!e){var o=new Error("Promise was rejected with a falsy value");o.reason=e,e=o}return t(e)}t.promisify=function(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');if(I&&e[I]){var t;if("function"!==typeof(t=e[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,I,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,o,r=new Promise((function(e,r){t=e,o=r})),n=[],i=0;i=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function s(e,t){var o;return i.TYPED_ARRAY_SUPPORT?(o=new Uint8Array(t)).__proto__=i.prototype:(null===(o=e)&&(o=new i(t)),o.length=t),o}function c(e,t){var o=s(e,t<0?0:0|a(t));if(!i.TYPED_ARRAY_SUPPORT)for(var r=0;r55295&&o<57344){if(!n){if(o>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}n=o;continue}if(o<56320){(t-=3)>-1&&i.push(239,191,189),n=o;continue}o=65536+(n-55296<<10|o-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,o<128){if((t-=1)<0)break;i.push(o)}else if(o<2048){if((t-=2)<0)break;i.push(o>>6|192,63&o|128)}else if(o<65536){if((t-=3)<0)break;i.push(o>>12|224,o>>6&63|128,63&o|128)}else{if(!(o<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}}return i}function m(e){return i.isBuffer(e)?e.length:"undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)?e.byteLength:("string"!==typeof e&&(e=""+e),0===e.length?0:l(e).length)}i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),i.prototype.write=function(e,t,o){void 0===t||void 0===o&&"string"===typeof t?(o=this.length,t=0):isFinite(t)&&(t|=0,isFinite(o)?o|=0:o=void 0);var r=this.length-t;if((void 0===o||o>r)&&(o=r),e.length>0&&(o<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(e,t,o,r){return function(e,t,o,r){for(var n=0;n=t.length||n>=e.length);++n)t[n+o]=e[n];return n}(l(t,e.length-o),e,o,r)}(this,e,t,o)},i.prototype.slice=function(e,t){var o,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--n)e[n+t]=this[n+o];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,o=void 0===o?this.length:o>>>0,e||(e=0),"number"===typeof e)for(n=t;n2?"one of ".concat(t," ").concat(e.slice(0,o-1).join(", "),", or ")+e[o-1]:2===o?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,o){var r,n,a,s;if("string"===typeof t&&(n="not ",t.substr(!a||a<0?0:+a,n.length)===n)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,o){return(void 0===o||o>e.length)&&(o=e.length),e.substring(o-t.length,o)===t}(e," argument"))s="The ".concat(e," ").concat(r," ").concat(i(t,"type"));else{var c=function(e,t,o){return"number"!==typeof o&&(o=0),!(o+t.length>e.length)&&-1!==e.indexOf(t,o)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(c," ").concat(r," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof o)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,o){"use strict";(function(t){var r=Object.keys||function(e){var t=[];for(var o in e)t.push(o);return t};e.exports=u;var n=o(218),i=o(222);o(23)(u,n);for(var a=r(i.prototype),s=0;st.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(a=t.slice(r,m)).length)throw new Error("invalid rlp, List has a invalid length");for(;a.length;)c=s(a),u.push(c.data),a=c.remainder;return{data:u,remainder:t.slice(m)}}function c(e){return"0x"===e.slice(0,2)}function u(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0"+t:t}function l(t){if(!e.isBuffer(t)){if("string"===typeof t)return c(t)?e.from((o="string"!==typeof(r=t)?r:c(r)?r.slice(2):r).length%2?"0"+o:o,"hex"):e.from(t);if("number"===typeof t||"bigint"===typeof t)return t?function(t){var o=u(t);return e.from(o,"hex")}(t):e.from([]);if(null===t||void 0===t)return e.from([]);if(t instanceof Uint8Array)return e.from(t);if(n.default.isBN(t))return e.from(t.toArray());throw new Error("invalid type")}var o,r;return t}t.encode=function t(o){if(Array.isArray(o)){for(var r=[],n=0;n2?"one of ".concat(t," ").concat(e.slice(0,o-1).join(", "),", or ")+e[o-1]:2===o?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,o){var r,n,a,s;if("string"===typeof t&&(n="not ",t.substr(!a||a<0?0:+a,n.length)===n)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,o){return(void 0===o||o>e.length)&&(o=e.length),e.substring(o-t.length,o)===t}(e," argument"))s="The ".concat(e," ").concat(r," ").concat(i(t,"type"));else{var c=function(e,t,o){return"number"!==typeof o&&(o=0),!(o+t.length>e.length)&&-1!==e.indexOf(t,o)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(c," ").concat(r," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof o)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,o){"use strict";(function(t){var r=Object.keys||function(e){var t=[];for(var o in e)t.push(o);return t};e.exports=u;var n=o(229),i=o(233);o(23)(u,n);for(var a=r(i.prototype),s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var o=8*this._len;if(o<=4294967295)this._block.writeUInt32BE(o,this._blockSize-4);else{var r=(4294967295&o)>>>0,n=(o-r)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=n},function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));var r=o(104);function n(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Object(r.a)(e,t):void 0}}},function(e,t,o){"use strict";o.d(t,"a",(function(){return f})),o.d(t,"b",(function(){return l})),o.d(t,"c",(function(){return m})),o.d(t,"d",(function(){return u}));var r=o(10);function n(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var i="function"===typeof Symbol&&Symbol.observable||"@@observable",a=function(){return Math.random().toString(36).substring(7).split("").join(".")},s={INIT:"@@redux/INIT"+a(),REPLACE:"@@redux/REPLACE"+a(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+a()}};function c(e){if("object"!==typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function u(e,t,o){var r;if("function"===typeof t&&"function"===typeof o||"function"===typeof o&&"function"===typeof arguments[3])throw new Error(n(0));if("function"===typeof t&&"undefined"===typeof o&&(o=t,t=void 0),"undefined"!==typeof o){if("function"!==typeof o)throw new Error(n(1));return o(u)(e,t)}if("function"!==typeof e)throw new Error(n(2));var a=e,l=t,m=[],f=m,d=!1;function h(){f===m&&(f=m.slice())}function p(){if(d)throw new Error(n(3));return l}function g(e){if("function"!==typeof e)throw new Error(n(4));if(d)throw new Error(n(5));var t=!0;return h(),f.push(e),function(){if(t){if(d)throw new Error(n(6));t=!1,h();var o=f.indexOf(e);f.splice(o,1),m=null}}}function b(e){if(!c(e))throw new Error(n(7));if("undefined"===typeof e.type)throw new Error(n(8));if(d)throw new Error(n(9));try{d=!0,l=a(l,e)}finally{d=!1}for(var t=m=f,o=0;o=this._delta8){var o=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-o,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-o,this.endian);for(var n=0;n>>24&255,r[n++]=e>>>16&255,r[n++]=e>>>8&255,r[n++]=255&e}else for(r[n++]=255&e,r[n++]=e>>>8&255,r[n++]=e>>>16&255,r[n++]=e>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,i=8;i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==o.return||o.return()}finally{if(c)throw a}}}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,o){(t=e.exports=o(209)).Stream=t,t.Readable=t,t.Writable=o(132),t.Duplex=o(74),t.Transform=o(212),t.PassThrough=o(433)},function(e,t,o){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"===typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"===typeof e},t.isString=function(e){return"string"===typeof e},t.isSymbol=function(e){return"symbol"===typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"===typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"===typeof e},t.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},t.isBuffer=o(20).Buffer.isBuffer},function(e,t){function o(t){return e.exports=o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,o(t)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,o){"use strict";var r=t;r.version=o(478).version,r.utils=o(56),r.rand=o(226),r.curve=o(227),r.curves=o(142),r.ec=o(485),r.eddsa=o(489)},function(e,t,o){"use strict";(function(t){var r=o(106);function n(e,t){if(e===t)return 0;for(var o=e.length,r=t.length,n=0,i=Math.min(o,r);n=0;u--)if(l[u]!==m[u])return!1;for(u=l.length-1;u>=0;u--)if(!v(e[s=l[u]],t[s],o,r))return!1;return!0}(e,t,o,r))}return o?e===t:e==t}function k(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(o){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function x(e,t,o,r){var n;if("function"!==typeof t)throw new TypeError('"block" argument must be a function');"string"===typeof o&&(r=o,o=null),n=function(e){var t;try{e()}catch(o){t=o}return t}(t),r=(o&&o.name?" ("+o.name+").":".")+(r?" "+r:"."),e&&!n&&b(n,o,"Missing expected exception"+r);var i="string"===typeof r,s=!e&&n&&!o;if((!e&&a.isError(n)&&i&&w(n,o)||s)&&b(n,o,"Got unwanted exception"+r),e&&n&&o&&!w(n,o)||!e&&n)throw n}f.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return p(g(e.actual),128)+" "+e.operator+" "+p(g(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||b;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var o=new Error;if(o.stack){var r=o.stack,n=h(t),i=r.indexOf("\n"+n);if(i>=0){var a=r.indexOf("\n",i+1);r=r.substring(a+1)}this.stack=r}}},a.inherits(f.AssertionError,Error),f.fail=b,f.ok=y,f.equal=function(e,t,o){e!=t&&b(e,t,o,"==",f.equal)},f.notEqual=function(e,t,o){e==t&&b(e,t,o,"!=",f.notEqual)},f.deepEqual=function(e,t,o){v(e,t,!1)||b(e,t,o,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,o){v(e,t,!0)||b(e,t,o,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,o){v(e,t,!1)&&b(e,t,o,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function e(t,o,r){v(t,o,!0)&&b(t,o,r,"notDeepStrictEqual",e)},f.strictEqual=function(e,t,o){e!==t&&b(e,t,o,"===",f.strictEqual)},f.notStrictEqual=function(e,t,o){e===t&&b(e,t,o,"!==",f.notStrictEqual)},f.throws=function(e,t,o){x(!0,e,t,o)},f.doesNotThrow=function(e,t,o){x(!1,e,t,o)},f.ifError=function(e){if(e)throw e},f.strict=r((function e(t,o){t||b(t,!0,o,"==",e)}),f,{equal:f.strictEqual,deepEqual:f.deepStrictEqual,notEqual:f.notStrictEqual,notDeepEqual:f.notDeepStrictEqual}),f.strict.strict=f.strict;var z=Object.keys||function(e){var t=[];for(var o in e)s.call(e,o)&&t.push(o);return t}}).call(this,o(29))},function(e,t){e.exports=function(){}},function(e,t){function o(e){return e.sort((function(e,t){return"latest"===e||"earliest"===t?1:"latest"===t||"earliest"===e?-1:r(e)-r(t)}))}function r(e){return void 0===e||null===e?e:Number.parseInt(e,16)}function n(e){if(void 0===e||null===e)return e;var t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function i(){return Math.floor(16*Math.random()).toString(16)}e.exports={minBlockRef:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"===typeof t){if(!r.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=e.from(r.padToEven(r.stripHexPrefix(t)),"hex")}else if("number"===typeof t)t=r.intToBuffer(t);else if(null===t||void 0===t)t=e.allocUnsafe(0);else if(n.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t},t.bufferToInt=function(e){return new n(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new n(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!==typeof e||r.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(o){if(e.isBuffer(o))return"0x"+o.toString("hex");if(o instanceof Array){for(var r=[],n=0;ne.length)&&(t=e.length);for(var o=0,r=new Array(t);o=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},o(388),t.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof e&&e.clearImmediate||this&&this.clearImmediate}).call(this,o(29))},function(e,t,o){var r=o(399),n=o(400),i=o(128),a=o(401);e.exports=function(e){return r(e)||n(e)||i(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,o){"use strict";(function(t){"undefined"===typeof t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,o,r,n){if("function"!==typeof e)throw new TypeError('"callback" argument must be a function');var i,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,o)}));case 3:return t.nextTick((function(){e.call(null,o,r)}));case 4:return t.nextTick((function(){e.call(null,o,r,n)}));default:for(i=new Array(s-1),a=0;a0&&n[n.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){s(e.precomputed);var o=e._getDoubles(),r=i(t,1,this._bitLength),n=(1<=a;l--)c=(c<<1)+r[l];u.push(c)}for(var m=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=n;d>0;d--){for(a=0;a=0;u--){for(var l=0;u>=0&&0===a[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var m=a[u];s(0!==m),c="affine"===e.type?m>0?c.mixedAdd(n[m-1>>1]):c.mixedAdd(n[-m-1>>1].neg()):m>0?c.add(n[m-1>>1]):c.add(n[-m-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,o,r,n){var s,c,u,l=this._wnafT1,m=this._wnafT2,f=this._wnafT3,d=0;for(s=0;s=1;s-=2){var p=s-1,g=s;if(1===l[p]&&1===l[g]){var b=[t[p],null,null,t[g]];0===t[p].y.cmp(t[g].y)?(b[1]=t[p].add(t[g]),b[2]=t[p].toJ().mixedAdd(t[g].neg())):0===t[p].y.cmp(t[g].y.redNeg())?(b[1]=t[p].toJ().mixedAdd(t[g]),b[2]=t[p].add(t[g].neg())):(b[1]=t[p].toJ().mixedAdd(t[g]),b[2]=t[p].toJ().mixedAdd(t[g].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=a(o[p],o[g]);for(d=Math.max(v[0].length,d),f[p]=new Array(d),f[g]=new Array(d),c=0;c=0;s--){for(var j=0;s>=0;){var M=!0;for(c=0;c=0&&j++,x=x.dblp(j),s<0)break;for(c=0;c0?u=m[c][A-1>>1]:A<0&&(u=m[c][-A-1>>1].neg()),x="affine"===u.type?x.mixedAdd(u):x.add(u))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var o=[this],r=this,n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=o>>5,this.extraBytes=(31&o)>>3;for(var r=0;r<50;++r)this.s[r]=0}function L(e,t,o){D.call(this,e,t,o)}D.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,o=typeof e;if("string"!==o){if("object"!==o)throw new Error(a);if(null===e)throw new Error(a);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!f||!ArrayBuffer.isView(e)))throw new Error(a);t=!0}for(var r,n,i=this.blocks,s=this.byteCount,c=e.length,u=this.blockCount,l=0,m=this.s;l>2]|=e[l]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(i[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=s){for(this.start=r-s,this.block=i[u],r=0;r>=8);o>0;)n.unshift(o),o=255&(e>>=8),++r;return t?n.push(r):n.unshift(r),this.update(n),n.length},D.prototype.encodeString=function(e){var t,o=typeof e;if("string"!==o){if("object"!==o)throw new Error(a);if(null===e)throw new Error(a);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!f||!ArrayBuffer.isView(e)))throw new Error(a);t=!0}var r=0,n=e.length;if(t)r=n;else for(var i=0;i=57344?r+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++i)),r+=4)}return r+=this.encode(8*r),this.update(e),r},D.prototype.bytepad=function(e,t){for(var o=this.encode(t),r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[o],t=1;t>4&15]+d[15&e]+d[e>>12&15]+d[e>>8&15]+d[e>>20&15]+d[e>>16&15]+d[e>>28&15]+d[e>>24&15];a%t===0&&(P(o),i=0)}return n&&(e=o[i],s+=d[e>>4&15]+d[15&e],n>1&&(s+=d[e>>12&15]+d[e>>8&15]),n>2&&(s+=d[e>>20&15]+d[e>>16&15])),s},D.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,o=this.s,r=this.outputBlocks,n=this.extraBytes,i=0,a=0,s=this.outputBits>>3;e=n?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%o===0&&P(r)}return i&&(e=s<<2,t=r[a],c[e]=255&t,i>1&&(c[e+1]=t>>8&255),i>2&&(c[e+2]=t>>16&255)),c},L.prototype=new D,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),D.prototype.finalize.call(this)};var P=function(e){var t,o,r,n,i,a,s,c,u,l,m,f,d,h,p,b,y,v,k,w,x,z,j,M,A,q,I,E,S,N,_,T,O,C,D,L,P,R,B,U,F,Q,Y,H,G,W,Z,V,K,J,X,$,ee,te,oe,re,ne,ie,ae,se,ce,ue,le;for(r=0;r<48;r+=2)n=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],m=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),o=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=o,e[10]^=t,e[11]^=o,e[20]^=t,e[21]^=o,e[30]^=t,e[31]^=o,e[40]^=t,e[41]^=o,t=n^(c<<1|u>>>31),o=i^(u<<1|c>>>31),e[2]^=t,e[3]^=o,e[12]^=t,e[13]^=o,e[22]^=t,e[23]^=o,e[32]^=t,e[33]^=o,e[42]^=t,e[43]^=o,t=a^(l<<1|m>>>31),o=s^(m<<1|l>>>31),e[4]^=t,e[5]^=o,e[14]^=t,e[15]^=o,e[24]^=t,e[25]^=o,e[34]^=t,e[35]^=o,e[44]^=t,e[45]^=o,t=c^(f<<1|d>>>31),o=u^(d<<1|f>>>31),e[6]^=t,e[7]^=o,e[16]^=t,e[17]^=o,e[26]^=t,e[27]^=o,e[36]^=t,e[37]^=o,e[46]^=t,e[47]^=o,t=l^(n<<1|i>>>31),o=m^(i<<1|n>>>31),e[8]^=t,e[9]^=o,e[18]^=t,e[19]^=o,e[28]^=t,e[29]^=o,e[38]^=t,e[39]^=o,e[48]^=t,e[49]^=o,h=e[0],p=e[1],W=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,E=e[20]<<3|e[21]>>>29,S=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,Q=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,K=e[23]<<10|e[22]>>>22,N=e[33]<<13|e[32]>>>19,_=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,oe=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,P=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,k=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,T=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,M=e[6]<<28|e[7]>>>4,A=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,R=e[26]<<25|e[27]>>>7,B=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,x=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,q=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,U=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,z=e[48]<<14|e[49]>>>18,j=e[49]<<14|e[48]>>>18,e[0]=h^~b&v,e[1]=p^~y&k,e[10]=M^~q&E,e[11]=A^~I&S,e[20]=C^~L&R,e[21]=D^~P&B,e[30]=H^~W&V,e[31]=G^~Z&K,e[40]=te^~re&ie,e[41]=oe^~ne&ae,e[2]=b^~v&w,e[3]=y^~k&x,e[12]=q^~E&N,e[13]=I^~S&_,e[22]=L^~R&U,e[23]=P^~B&F,e[32]=W^~V&J,e[33]=Z^~K&X,e[42]=re^~ie&se,e[43]=ne^~ae&ce,e[4]=v^~w&z,e[5]=k^~x&j,e[14]=E^~N&T,e[15]=S^~_&O,e[24]=R^~U&Q,e[25]=B^~F&Y,e[34]=V^~J&$,e[35]=K^~X&ee,e[44]=ie^~se&ue,e[45]=ae^~ce&le,e[6]=w^~z&h,e[7]=x^~j&p,e[16]=N^~T&M,e[17]=_^~O&A,e[26]=U^~Q&C,e[27]=F^~Y&D,e[36]=J^~$&H,e[37]=X^~ee&G,e[46]=se^~ue&te,e[47]=ce^~le&oe,e[8]=z^~h&b,e[9]=j^~p&y,e[18]=T^~M&q,e[19]=O^~A&I,e[28]=Q^~C&L,e[29]=Y^~D&P,e[38]=$^~H&W,e[39]=ee^~G&Z,e[48]=ue^~te&re,e[49]=le^~oe&ne,e[0]^=g[r],e[1]^=g[r+1]};if(l)e.exports=I;else{for(S=0;S=64;){var d=o,h=r,p=n,g=i,b=a,y=s,v=c,k=u,w=void 0,x=void 0,z=void 0,j=void 0,M=void 0;for(x=0;x<16;x++)z=m+4*x,l[x]=(255&e[z])<<24|(255&e[z+1])<<16|(255&e[z+2])<<8|255&e[z+3];for(x=16;x<64;x++)j=((w=l[x-2])>>>17|w<<15)^(w>>>19|w<<13)^w>>>10,M=((w=l[x-15])>>>7|w<<25)^(w>>>18|w<<14)^w>>>3,l[x]=(j+l[x-7]|0)+(M+l[x-16]|0)|0;for(x=0;x<64;x++)j=(((b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+(b&y^~b&v)|0)+(k+(t[x]+l[x]|0)|0)|0,M=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&h^d&p^h&p)|0,k=v,v=y,y=b,b=g+j|0,g=p,p=h,h=d,d=j+M|0;o=o+d|0,r=r+h|0,n=n+p|0,i=i+g|0,a=a+b|0,s=s+y|0,c=c+v|0,u=u+k|0,m+=64,f-=64}}m(e);var f,d=e.length%64,h=e.length/536870912|0,p=e.length<<3,g=d<56?56:120,b=e.slice(e.length-d,e.length);for(b.push(128),f=d+1;f>>24&255),b.push(h>>>16&255),b.push(h>>>8&255),b.push(h>>>0&255),b.push(p>>>24&255),b.push(p>>>16&255),b.push(p>>>8&255),b.push(p>>>0&255),m(b),[o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255]}function i(e,t,o){e=e.length<=64?e:n(e);var r,i=64+t.length+4,a=new Array(i),s=new Array(64),c=[];for(r=0;r<64;r++)a[r]=54;for(r=0;r=i-4;e--){if(a[e]++,a[e]<=255)return;a[e]=0}}for(;o>=32;)u(),c=c.concat(n(s.concat(n(a)))),o-=32;return o>0&&(u(),c=c.concat(n(s.concat(n(a))).slice(0,o))),c}function a(e,t,o,r,n){var i;for(l(e,16*(2*o-1),n,0,16),i=0;i<2*o;i++)u(e,16*i,n,16),c(n,r),l(n,0,e,t+16*i,16);for(i=0;i>>32-t}function c(e,t){l(e,0,t,0,16);for(var o=8;o>0;o-=2)t[4]^=s(t[0]+t[12],7),t[8]^=s(t[4]+t[0],9),t[12]^=s(t[8]+t[4],13),t[0]^=s(t[12]+t[8],18),t[9]^=s(t[5]+t[1],7),t[13]^=s(t[9]+t[5],9),t[1]^=s(t[13]+t[9],13),t[5]^=s(t[1]+t[13],18),t[14]^=s(t[10]+t[6],7),t[2]^=s(t[14]+t[10],9),t[6]^=s(t[2]+t[14],13),t[10]^=s(t[6]+t[2],18),t[3]^=s(t[15]+t[11],7),t[7]^=s(t[3]+t[15],9),t[11]^=s(t[7]+t[3],13),t[15]^=s(t[11]+t[7],18),t[1]^=s(t[0]+t[3],7),t[2]^=s(t[1]+t[0],9),t[3]^=s(t[2]+t[1],13),t[0]^=s(t[3]+t[2],18),t[6]^=s(t[5]+t[4],7),t[7]^=s(t[6]+t[5],9),t[4]^=s(t[7]+t[6],13),t[5]^=s(t[4]+t[7],18),t[11]^=s(t[10]+t[9],7),t[8]^=s(t[11]+t[10],9),t[9]^=s(t[8]+t[11],13),t[10]^=s(t[9]+t[8],18),t[12]^=s(t[15]+t[14],7),t[13]^=s(t[12]+t[15],9),t[14]^=s(t[13]+t[12],13),t[15]^=s(t[14]+t[13],18);for(var r=0;r<16;++r)e[r]+=t[r]}function u(e,t,o,r){for(var n=0;n=256)return!1}return!0}function f(e,t){if("number"!==typeof e||e%1)throw new Error("invalid "+t);return e}function d(e,o,n,s,c,d,h){if(n=f(n,"N"),s=f(s,"r"),c=f(c,"p"),d=f(d,"dkLen"),0===n||0!==(n&n-1))throw new Error("N must be power of 2");if(n>r/128/s)throw new Error("N too large");if(s>r/128/c)throw new Error("r too large");if(!m(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!m(o))throw new Error("salt must be an array or buffer");o=Array.prototype.slice.call(o);for(var p=i(e,o,128*c*s),g=new Uint32Array(32*c*s),b=0;b_&&(o=_);for(var r=0;r_&&(o=_);for(var f=0;f>0&255),p.push(g[O]>>8&255),p.push(g[O]>>16&255),p.push(g[O]>>24&255);var C=i(e,p,d);return h&&h(null,1,C),C}h&&T(t)};if(!h)for(;;){var C=O();if(void 0!=C)return C}O()}var h={scrypt:function(e,t,o,r,n,i,a){return new Promise((function(s,c){var u=0;a&&a(0),d(e,t,o,r,n,i,(function(e,t,o){if(e)c(e);else if(o)a&&1!==u&&a(1),s(new Uint8Array(o));else if(a&&t!==u)return u=t,a(t)}))}))},syncScrypt:function(e,t,o,r,n,i){return new Uint8Array(d(e,t,o,r,n,i))}};e.exports=h}()}).call(this,o(107).setImmediate)},,,function(e,t,o){"use strict";(function(t){var r=o(51),n=o(351),i=o(176),a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:function(){var e;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof t&&"[object process]"===Object.prototype.toString.call(t))&&(e=o(177)),e}(),transformRequest:[function(e,t){return n(t,"Accept"),n(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,o){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(n){if("SyntaxError"!==n.name)throw n}return(o||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,o=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,a=!o&&"json"===this.responseType;if(a||n&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(a){if("SyntaxError"===s.name)throw i(s,this,"E_JSON_PARSE");throw s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){c.headers[e]=r.merge(a)})),e.exports=c}).call(this,o(27))},function(e,t,o){var r=o(190);e.exports=function(e,t){if(e){if("string"===typeof e)return r(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){var o={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==o.call(e)}},function(e,t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&"undefined"!==typeof e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,o){if(t.isValid(e))return e;try{return function(e){if("string"!==typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(r){return o}}},function(e,t,o){var r=o(20),n=r.Buffer;function i(e,t){for(var o in e)t[o]=e[o]}function a(e,t,o){return n(e,t,o)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),i(n,a),a.from=function(e,t,o){if("number"===typeof e)throw new TypeError("Argument must not be a number");return n(e,t,o)},a.alloc=function(e,t,o){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"===typeof o?r.fill(t,o):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return n(e)},a.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,o){"use strict";(function(t,r,n){var i=o(109);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,o){var r=e.entry;e.entry=null;for(;r;){var n=r.callback;t.pendingcb--,n(o),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=y;var s,c=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;y.WritableState=b;var u=Object.create(o(96));u.inherits=o(23);var l={deprecate:o(133)},m=o(210),f=o(131).Buffer,d=("undefined"!==typeof n?n:"undefined"!==typeof window?window:"undefined"!==typeof self?self:{}).Uint8Array||function(){};var h,p=o(211);function g(){}function b(e,t){s=s||o(74),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,u=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r&&(u||0===u)?u:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var m=!1===e.decodeStrings;this.decodeStrings=!m,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var o=e._writableState,r=o.sync,n=o.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(o),t)!function(e,t,o,r,n){--t.pendingcb,o?(i.nextTick(n,r),i.nextTick(j,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(n(r),e._writableState.errorEmitted=!0,e.emit("error",r),j(e,t))}(e,o,r,t,n);else{var a=x(o);a||o.corked||o.bufferProcessing||!o.bufferedRequest||w(e,o),r?c(k,e,o,a,n):k(e,o,a,n)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(s=s||o(74),!h.call(y,this)&&!(this instanceof s))return new y(e);this._writableState=new b(e,this),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),m.call(this)}function v(e,t,o,r,n,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,o?e._writev(n,t.onwrite):e._write(n,i,t.onwrite),t.sync=!1}function k(e,t,o,r){o||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),j(e,t)}function w(e,t){t.bufferProcessing=!0;var o=t.bufferedRequest;if(e._writev&&o&&o.next){var r=t.bufferedRequestCount,n=new Array(r),i=t.corkedRequestsFree;i.entry=o;for(var s=0,c=!0;o;)n[s]=o,o.isBuf||(c=!1),o=o.next,s+=1;n.allBuffers=c,v(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;o;){var u=o.chunk,l=o.encoding,m=o.callback;if(v(e,t,!1,t.objectMode?1:u.length,u,l,m),o=o.next,t.bufferedRequestCount--,t.writing)break}null===o&&(t.lastBufferedRequest=null)}t.bufferedRequest=o,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function z(e,t){e._final((function(o){t.pendingcb--,o&&e.emit("error",o),t.prefinished=!0,e.emit("prefinish"),j(e,t)}))}function j(e,t){var o=x(t);return o&&(!function(e,t){t.prefinished||t.finalCalled||("function"===typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(z,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),o}u.inherits(y,m),b.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(b.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===y&&(e&&e._writableState instanceof b)}})):h=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,o){var r,n=this._writableState,a=!1,s=!n.objectMode&&(r=e,f.isBuffer(r)||r instanceof d);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"===typeof t&&(o=t,t=null),s?t="buffer":t||(t=n.defaultEncoding),"function"!==typeof o&&(o=g),n.ended?function(e,t){var o=new Error("write after end");e.emit("error",o),i.nextTick(t,o)}(this,o):(s||function(e,t,o,r){var n=!0,a=!1;return null===o?a=new TypeError("May not write null values to stream"):"string"===typeof o||void 0===o||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(r,a),n=!1),n}(this,n,e,o))&&(n.pendingcb++,a=function(e,t,o,r,n,i){if(!o){var a=function(e,t,o){e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=f.from(t,o));return t}(t,r,n);r!==a&&(o=!0,n="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,o){o(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,o){var r=this._writableState;"function"===typeof e?(o=e,e=null,t=null):"function"===typeof t&&(o=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,o){t.ending=!0,j(e,t),o&&(t.finished?i.nextTick(o):e.once("finish",o));t.ended=!0,e.writable=!1}(this,r,o)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=p.destroy,y.prototype._undestroy=p.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,o(27),o(107).setImmediate,o(29))},function(e,t,o){(function(t){function o(e){try{if(!t.localStorage)return!1}catch(r){return!1}var o=t.localStorage[e];return null!=o&&"true"===String(o).toLowerCase()}e.exports=function(e,t){if(o("noDeprecation"))return e;var r=!1;return function(){if(!r){if(o("throwDeprecation"))throw new Error(t);o("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,o(29))},function(e,t,o){"use strict";var r=o(436);function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var i=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(c),l=["%","/","?",";","#"].concat(u),m=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},p={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=o(437);function y(e,t,o){if(e&&"object"===typeof e&&e instanceof n)return e;var r=new n;return r.parse(e,t,o),r}n.prototype.parse=function(e,t,o){if("string"!==typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),a=-1!==n&&n127?_+="x":_+=N[T];if(!_.match(f)){var C=E.slice(0,A),D=E.slice(A+1),L=N.match(d);L&&(C.push(L[1]),D.unshift(L[2])),D.length&&(y="/"+D.join(".")+y),this.hostname=C.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=r.toASCII(this.hostname));var P=this.port?":"+this.port:"",R=this.hostname||"";this.host=R+P,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!h[w])for(A=0,S=u.length;A0)&&o.host.split("@"))&&(o.auth=I.shift(),o.hostname=I.shift(),o.host=o.hostname);return o.search=e.search,o.query=e.query,null===o.pathname&&null===o.search||(o.path=(o.pathname?o.pathname:"")+(o.search?o.search:"")),o.href=o.format(),o}if(!x.length)return o.pathname=null,o.search?o.path="/"+o.search:o.path=null,o.href=o.format(),o;for(var j=x.slice(-1)[0],M=(o.host||e.host||x.length>1)&&("."===j||".."===j)||""===j,A=0,q=x.length;q>=0;q--)"."===(j=x[q])?x.splice(q,1):".."===j?(x.splice(q,1),A++):A&&(x.splice(q,1),A--);if(!k&&!w)for(;A--;A)x.unshift("..");!k||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),M&&"/"!==x.join("/").substr(-1)&&x.push("");var I,E=""===x[0]||x[0]&&"/"===x[0].charAt(0);z&&(o.hostname=E?"":x.length?x.shift():"",o.host=o.hostname,(I=!!(o.host&&o.host.indexOf("@")>0)&&o.host.split("@"))&&(o.auth=I.shift(),o.hostname=I.shift(),o.host=o.hostname));return(k=k||o.host&&x.length)&&!E&&x.unshift(""),x.length>0?o.pathname=x.join("/"):(o.pathname=null,o.path=null),null===o.pathname&&null===o.search||(o.path=(o.pathname?o.pathname:"")+(o.search?o.search:"")),o.auth=e.auth||o.auth,o.slashes=o.slashes||e.slashes,o.href=o.format(),o},n.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.parse=y,t.resolve=function(e,t){return y(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?y(e,!1,!0).resolveObject(t):t},t.format=function(e){return"string"===typeof e&&(e=y(e)),e instanceof n?e.format():n.prototype.format.call(e)},t.Url=n},function(e,t,o){"use strict";var r,n=SyntaxError,i=Function,a=TypeError,s=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(t){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(S){c=null}var u=function(){throw new a},l=c?function(){try{return u}catch(e){try{return c(arguments,"callee").get}catch(t){return u}}}():u,m=o(440)(),f=o(442)(),d=Object.getPrototypeOf||(f?function(e){return e.__proto__}:null),h={},p="undefined"!==typeof Uint8Array&&d?d(Uint8Array):r,g={"%AggregateError%":"undefined"===typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":m&&d?d([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"===typeof Atomics?r:Atomics,"%BigInt%":"undefined"===typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"===typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"===typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"===typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"===typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"===typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"===typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":h,"%Int8Array%":"undefined"===typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"===typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"===typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m&&d?d(d([][Symbol.iterator]())):r,"%JSON%":"object"===typeof JSON?JSON:r,"%Map%":"undefined"===typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&m&&d?d((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?r:Promise,"%Proxy%":"undefined"===typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"===typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"===typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&m&&d?d((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m&&d?d(""[Symbol.iterator]()):r,"%Symbol%":m?Symbol:r,"%SyntaxError%":n,"%ThrowTypeError%":l,"%TypedArray%":p,"%TypeError%":a,"%Uint8Array%":"undefined"===typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"===typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"===typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"===typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"===typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"===typeof WeakSet?r:WeakSet};if(d)try{null.error}catch(S){var b=d(d(S));g["%Error.prototype%"]=b}var y=function e(t){var o;if("%AsyncFunction%"===t)o=s("async function () {}");else if("%GeneratorFunction%"===t)o=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)o=s("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(o=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=e("%AsyncGenerator%");n&&d&&(o=d(n.prototype))}return g[t]=o,o},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},k=o(136),w=o(444),x=k.call(Function.call,Array.prototype.concat),z=k.call(Function.apply,Array.prototype.splice),j=k.call(Function.call,String.prototype.replace),M=k.call(Function.call,String.prototype.slice),A=k.call(Function.call,RegExp.prototype.exec),q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,I=/\\(\\)?/g,E=function(e,t){var o,r=e;if(w(v,r)&&(r="%"+(o=v[r])[0]+"%"),w(g,r)){var i=g[r];if(i===h&&(i=y(r)),"undefined"===typeof i&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:r,value:i}}throw new n("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!==typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===A(/^%?[^%]*%?$/,e))throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var o=function(e){var t=M(e,0,1),o=M(e,-1);if("%"===t&&"%"!==o)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===o&&"%"!==t)throw new n("invalid intrinsic syntax, expected opening `%`");var r=[];return j(e,q,(function(e,t,o,n){r[r.length]=o?j(n,I,"$1"):t||e})),r}(e),r=o.length>0?o[0]:"",i=E("%"+r+"%",t),s=i.name,u=i.value,l=!1,m=i.alias;m&&(r=m[0],z(o,x([0,1],m)));for(var f=1,d=!0;f=o.length){var y=c(u,h);u=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:u[h]}else d=w(u,h),u=u[h];d&&!l&&(g[s]=u)}}return u}},function(e,t,o){"use strict";var r=o(443);e.exports=Function.prototype.bind||r},function(e,t,o){"use strict";var r=String.prototype.replace,n=/%20/g,i="RFC1738",a="RFC3986";e.exports={default:a,formatters:{RFC1738:function(e){return r.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:i,RFC3986:a}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.listeners={}}return e.prototype.addEventListener=function(e,t){e=e.toLowerCase(),this.listeners[e]=this.listeners[e]||[],this.listeners[e].push(t.handleEvent||t)},e.prototype.removeEventListener=function(e,t){if(e=e.toLowerCase(),this.listeners[e]){var o=this.listeners[e].indexOf(t.handleEvent||t);o<0||this.listeners[e].splice(o,1)}},e.prototype.dispatchEvent=function(e){var t=e.type.toLowerCase();if(e.target=this,this.listeners[t])for(var o=0,r=this.listeners[t];o0&&"0"===o.toString();)o=(e=e.slice(1))[0];return e},t.toBuffer=function(e){if(!h.isBuffer(e))if(Array.isArray(e))e=h.from(e);else if("string"===typeof e)e=t.isHexString(e)?h.from(t.padToEven(t.stripHexPrefix(e)),"hex"):h.from(e);else if("number"===typeof e)e=t.intToBuffer(e);else if(null===e||void 0===e)e=h.allocUnsafe(0);else if(f.isBN(e))e=e.toArrayLike(h);else{if(!e.toArray)throw new Error("invalid type");e=h.from(e.toArray())}return e},t.bufferToInt=function(e){return new f(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new f(e).fromTwos(256)},t.toUnsigned=function(e){return h.from(e.toTwos(256).toArray())},t.keccak=function(e,o){switch(e=t.toBuffer(e),o||(o=256),o){case 224:return i(e);case 256:return s(e);case 384:return a(e);case 512:return c(e);default:throw new Error("Invald algorithm: keccak"+o)}},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),d("sha256").update(e).digest()},t.ripemd160=function(e,o){e=t.toBuffer(e);var r=d("rmd160").update(e).digest();return!0===o?t.setLength(r,32):r},t.rlphash=function(e){return t.keccak(m.encode(e))},t.isValidPrivate=function(e){return u.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?u.publicKeyVerify(h.concat([h.from([4]),e])):!!t&&u.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,o){return e=t.toBuffer(e),o&&64!==e.length&&(e=u.publicKeyConvert(e,!1).slice(1)),l(64===e.length),t.keccak(e).slice(-20)};var p=t.privateToPublic=function(e){return e=t.toBuffer(e),u.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return 64!==(e=t.toBuffer(e)).length&&(e=u.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var o=u.sign(e,t),r={};return r.r=o.signature.slice(0,32),r.s=o.signature.slice(32,64),r.v=o.recovery+27,r},t.hashPersonalMessage=function(e){var o=t.toBuffer("\x19Ethereum Signed Message:\n"+e.length.toString());return t.keccak(h.concat([o,e]))},t.ecrecover=function(e,o,r,n){var i=h.concat([t.setLength(r,32),t.setLength(n,32)],64),a=o-27;if(0!==a&&1!==a)throw new Error("Invalid signature v value");var s=u.recover(e,i,a);return u.publicKeyConvert(s,!1).slice(1)},t.toRpcSig=function(e,o,r){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(h.concat([t.setLengthLeft(o,32),t.setLengthLeft(r,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(65!==(e=t.toBuffer(e)).length)throw new Error("Invalid signature length");var o=e[64];return o<27&&(o+=27),{v:o,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(p(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var o=t.keccak(e).toString("hex"),r="0x",n=0;n=8?r+=e[n].toUpperCase():r+=e[n];return r},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,o){return e=t.toBuffer(e),o=(o=new f(o)).isZero()?null:h.from(o.toArray()),t.rlphash([e,o]).slice(-20)},t.isPrecompiled=function(e){var o=t.unpad(e);return 1===o.length&&o[0]>=1&&o[0]<=8},t.addHexPrefix=function(e){return"string"!==typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,o,r){var n=new f("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),i=new f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===o.length&&((27===e||28===e)&&(t=new f(t),o=new f(o),!(t.isZero()||t.gt(i)||o.isZero()||o.gt(i))&&(!1!==r||1!==new f(o).cmp(n))))},t.baToJSON=function(e){if(h.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var o=[],r=0;r=n.length,"The field "+o.name+" must not have more "+o.length+" bytes")):o.allowZero&&0===n.length||!o.length||l(o.length===n.length,"The field "+o.name+" must have byte length of "+o.length),e.raw[r]=n}e._fields.push(o.name),Object.defineProperty(e,o.name,{enumerable:!0,configurable:!0,get:n,set:i}),o.default&&(e[o.name]=o.default),o.alias&&Object.defineProperty(e,o.alias,{enumerable:!1,configurable:!0,set:i,get:n})})),n)if("string"===typeof n&&(n=h.from(t.stripHexPrefix(n),"hex")),h.isBuffer(n)&&(n=m.decode(n)),Array.isArray(n)){if(n.length>e._fields.length)throw new Error("wrong number of fields in data");n.forEach((function(o,r){e[e._fields[r]]=t.toBuffer(o)}))}else{if("object"!==("undefined"===typeof n?"undefined":r(n)))throw new Error("invalid data");var i=Object.keys(n);o.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=n[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=n[t.alias])}))}}},function(e,t){function o(t,r){return e.exports=o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,o(t,r)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,o){"use strict";var r=o(82).codes.ERR_STREAM_PREMATURE_CLOSE;function n(){}e.exports=function e(t,o,i){if("function"===typeof o)return e(t,null,o);o||(o={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var o=arguments.length,r=new Array(o),n=0;n1?r-1:0),i=1;i0&&(a=n[0]),a instanceof Error)throw a;var c=new Error("Unhandled error.".concat(a?" (".concat(a.message,")"):""));throw c.context=a,c}var u=o[e];if(void 0===u)return!1;if("function"===typeof u)s(u,this,n);else for(var l=u.length,m=function(e){for(var t=e.length,o=new Array(t),r=0;r=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');return t.call(this,e,n,i)}return n(o)}(u);function m(e,t){if("[Circular]"!==t)return t}t.EthereumProviderError=l},function(e,t,o){"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."}}},function(e,t,o){var r=o(33).default,n=o(48).default,i=o(38).default,a=o(39).default,s=o(41).default,c=o(42).default,u=function(e){"use strict";s(o,e);var t=c(o);function o(){var e;return i(this,o),(e=t.call(this)).updates=[],e}return a(o,[{key:"initialize",value:function(){var e=n(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"update",value:function(){var e=n(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("BaseFilter - no update method specified");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"addResults",value:function(e){var t=this;this.updates=this.updates.concat(e),e.forEach((function(e){return t.emit("update",e)}))}},{key:"addInitialResults",value:function(e){}},{key:"getChangesAndClear",value:function(){var e=this.updates;return this.updates=[],e}}]),o}(o(150).default);e.exports=u},function(e,t,o){var r=o(33).default,n=o(48).default;function i(){return(i=n(r().mark((function e(t){var o,n,i,u,l,m,f;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.provider,n=t.fromBlock,i=t.toBlock,n||(n=i),u=a(n),l=a(i),m=Array(l-u+1).fill().map((function(e,t){return u+t})).map(s),e.next=8,Promise.all(m.map((function(e){return c(o,"eth_getBlockByNumber",[e,!1])})));case 8:return f=e.sent,e.abrupt("return",f);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function a(e){return void 0===e||null===e?e:Number.parseInt(e,16)}function s(e){return void 0===e||null===e?e:"0x"+e.toString(16)}function c(e,t,o){return new Promise((function(r,n){e.sendAsync({id:1,jsonrpc:"2.0",method:t,params:o},(function(e,t){if(e)return n(e);r(t.result)}))}))}e.exports=function(e){return i.apply(this,arguments)}},function(e,t,o){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.ecdhUnsafe=t.ecdh=t.recover=t.verify=t.sign=t.signatureImportLax=t.signatureImport=t.signatureExport=t.signatureNormalize=t.publicKeyCombine=t.publicKeyTweakMul=t.publicKeyTweakAdd=t.publicKeyVerify=t.publicKeyConvert=t.publicKeyCreate=t.privateKeyTweakMul=t.privateKeyTweakAdd=t.privateKeyModInverse=t.privateKeyNegate=t.privateKeyImport=t.privateKeyExport=t.privateKeyVerify=void 0;var r=o(113),n=o(596),i=o(597);t.privateKeyVerify=function(e){return 32===e.length&&r.privateKeyVerify(Uint8Array.from(e))},t.privateKeyExport=function(e,t){if(32!==e.length)throw new RangeError("private key length is invalid");var o=n.privateKeyExport(e,t);return i.privateKeyExport(e,o,t)},t.privateKeyImport=function(e){if(null!==(e=i.privateKeyImport(e))&&32===e.length&&t.privateKeyVerify(e))return e;throw new Error("couldn't import from DER format")},t.privateKeyNegate=function(t){return e.from(r.privateKeyNegate(Uint8Array.from(t)))},t.privateKeyModInverse=function(t){if(32!==t.length)throw new Error("private key length is invalid");return e.from(n.privateKeyModInverse(Uint8Array.from(t)))},t.privateKeyTweakAdd=function(t,o){return e.from(r.privateKeyTweakAdd(Uint8Array.from(t),o))},t.privateKeyTweakMul=function(t,o){return e.from(r.privateKeyTweakMul(Uint8Array.from(t),Uint8Array.from(o)))},t.publicKeyCreate=function(t,o){return e.from(r.publicKeyCreate(Uint8Array.from(t),o))},t.publicKeyConvert=function(t,o){return e.from(r.publicKeyConvert(Uint8Array.from(t),o))},t.publicKeyVerify=function(e){return(33===e.length||65===e.length)&&r.publicKeyVerify(Uint8Array.from(e))},t.publicKeyTweakAdd=function(t,o,n){return e.from(r.publicKeyTweakAdd(Uint8Array.from(t),Uint8Array.from(o),n))},t.publicKeyTweakMul=function(t,o,n){return e.from(r.publicKeyTweakMul(Uint8Array.from(t),Uint8Array.from(o),n))},t.publicKeyCombine=function(t,o){var n=[];return t.forEach((function(e){n.push(Uint8Array.from(e))})),e.from(r.publicKeyCombine(n,o))},t.signatureNormalize=function(t){return e.from(r.signatureNormalize(Uint8Array.from(t)))},t.signatureExport=function(t){return e.from(r.signatureExport(Uint8Array.from(t)))},t.signatureImport=function(t){return e.from(r.signatureImport(Uint8Array.from(t)))},t.signatureImportLax=function(e){if(0===e.length)throw new RangeError("signature length is invalid");var t=i.signatureImportLax(e);if(null===t)throw new Error("couldn't parse DER signature");return n.signatureImport(t)},t.sign=function(t,o,n){if(null===n)throw new TypeError("options should be an Object");var i=void 0;if(n){if(i={},null===n.data)throw new TypeError("options.data should be a Buffer");if(n.data){if(32!=n.data.length)throw new RangeError("options.data length is invalid");i.data=new Uint8Array(n.data)}if(null===n.noncefn)throw new TypeError("options.noncefn should be a Function");n.noncefn&&(i.noncefn=function(t,o,r,i,a){var s=null!=r?e.from(r):null,c=null!=i?e.from(i):null,u=e.from("");return n.noncefn&&(u=n.noncefn(e.from(t),e.from(o),s,c,a)),new Uint8Array(u)})}var a=r.ecdsaSign(Uint8Array.from(t),Uint8Array.from(o),i);return{signature:e.from(a.signature),recovery:a.recid}},t.verify=function(e,t,o){return r.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(e),o)},t.recover=function(t,o,n,i){return e.from(r.ecdsaRecover(Uint8Array.from(o),n,Uint8Array.from(t),i))},t.ecdh=function(t,o){return e.from(r.ecdh(Uint8Array.from(t),Uint8Array.from(o),{}))},t.ecdhUnsafe=function(t,o,r){if(33!==t.length&&65!==t.length)throw new RangeError("public key length is invalid");if(32!==o.length)throw new RangeError("private key length is invalid");return e.from(n.ecdhUnsafe(Uint8Array.from(t),Uint8Array.from(o),r))}}).call(this,o(20).Buffer)},function(e,t,o){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160=t.sha256=t.keccak256=t.keccak=void 0;var r=o(111),n=r.keccak224,i=r.keccak384,a=r.keccak256,s=r.keccak512,c=o(115),u=o(68),l=o(84),m=o(102);t.keccak=function(t,o){switch(void 0===o&&(o=256),t="string"!==typeof t||u.isHexString(t)?m.toBuffer(t):e.from(t,"utf8"),o||(o=256),o){case 224:return n(t);case 256:return a(t);case 384:return i(t);case 512:return s(t);default:throw new Error("Invald algorithm: keccak"+o)}},t.keccak256=function(e){return t.keccak(e)},t.sha256=function(e){return e=m.toBuffer(e),c("sha256").update(e).digest()},t.ripemd160=function(e,t){e=m.toBuffer(e);var o=c("rmd160").update(e).digest();return!0===t?m.setLength(o,32):o},t.rlphash=function(e){return t.keccak(l.encode(e))}}).call(this,o(20).Buffer)},function(e,t,o){"use strict";o.r(t),o.d(t,"detectEnv",(function(){return a})),o.d(t,"detectOS",(function(){return s})),o.d(t,"isAndroid",(function(){return c})),o.d(t,"isIOS",(function(){return u})),o.d(t,"isMobile",(function(){return l})),o.d(t,"isNode",(function(){return m})),o.d(t,"isBrowser",(function(){return f})),o.d(t,"getFromWindow",(function(){return d})),o.d(t,"getFromWindowOrThrow",(function(){return h})),o.d(t,"getDocumentOrThrow",(function(){return p})),o.d(t,"getDocument",(function(){return g})),o.d(t,"getNavigatorOrThrow",(function(){return b})),o.d(t,"getNavigator",(function(){return y})),o.d(t,"getLocationOrThrow",(function(){return v})),o.d(t,"getLocation",(function(){return k})),o.d(t,"getCryptoOrThrow",(function(){return w})),o.d(t,"getCrypto",(function(){return x})),o.d(t,"getLocalStorageOrThrow",(function(){return z})),o.d(t,"getLocalStorage",(function(){return j})),o.d(t,"getClientMeta",(function(){return M})),o.d(t,"safeJsonParse",(function(){return A})),o.d(t,"safeJsonStringify",(function(){return q})),o.d(t,"setLocal",(function(){return I})),o.d(t,"getLocal",(function(){return E})),o.d(t,"removeLocal",(function(){return S})),o.d(t,"mobileLinkChoiceKey",(function(){return N})),o.d(t,"formatIOSMobile",(function(){return _})),o.d(t,"saveMobileLinkInfo",(function(){return T})),o.d(t,"getMobileRegistryEntry",(function(){return O})),o.d(t,"getMobileLinkRegistry",(function(){return C})),o.d(t,"getWalletRegistryUrl",(function(){return L})),o.d(t,"getDappRegistryUrl",(function(){return P})),o.d(t,"formatMobileRegistryEntry",(function(){return R})),o.d(t,"formatMobileRegistry",(function(){return B}));var r=o(277),n=o(49),i=o(278);function a(e){return Object(i.a)(e)}function s(){var e=a();return e&&e.os?e.os:void 0}function c(){var e=s();return!!e&&e.toLowerCase().includes("android")}function u(){var e=s();return!!e&&(e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1)}function l(){return!!s()&&(c()||u())}function m(){var e=a();return!(!e||!e.name)&&"node"===e.name.toLowerCase()}function f(){return!m()&&!!y()}var d=n.getFromWindow,h=n.getFromWindowOrThrow,p=n.getDocumentOrThrow,g=n.getDocument,b=n.getNavigatorOrThrow,y=n.getNavigator,v=n.getLocationOrThrow,k=n.getLocation,w=n.getCryptoOrThrow,x=n.getCrypto,z=n.getLocalStorageOrThrow,j=n.getLocalStorage;function M(){return r.getWindowMetadata()}var A=function(e){if("string"!==typeof e)throw new Error("Cannot safe json parse value of type ".concat(typeof e));try{return JSON.parse(e)}catch(t){return e}},q=function(e){return"string"===typeof e?e:JSON.stringify(e)};function I(e,t){var o=q(t),r=j();r&&r.setItem(e,o)}function E(e){var t=null,o=j();return o&&(t=o.getItem(e)),t?A(t):t}function S(e){var t=j();t&&t.removeItem(e)}var N="WALLETCONNECT_DEEPLINK_CHOICE";function _(e,t){var o=encodeURIComponent(e);return t.universalLink?"".concat(t.universalLink,"/wc?uri=").concat(o):t.deepLink?"".concat(t.deepLink).concat(t.deepLink.endsWith(":")?"//":"/","wc?uri=").concat(o):""}function T(e){var t=e.href.split("?")[0];I(N,Object.assign(Object.assign({},e),{href:t}))}function O(e,t){return e.filter((function(e){return e.name.toLowerCase().includes(t.toLowerCase())}))[0]}function C(e,t){var o=e;return t&&(o=t.map((function(t){return O(e,t)})).filter(Boolean)),o}var D="https://registry.walletconnect.com";function L(){return D+"/api/v2/wallets"}function P(){return D+"/api/v2/dapps"}function R(e){var t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mobile";return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:null!==(t=e.image_url.sm)&&void 0!==t?t:"",universalLink:e[o].universal||"",deepLink:e[o].native||""}}function B(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mobile";return Object.values(e).filter((function(e){return!!e[t].universal||!!e[t].native})).map((function(e){return R(e,t)}))}},function(e,t){e.exports=n,n.strict=i,n.loose=a;var o=Object.prototype.toString,r={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function n(e){return i(e)||a(e)}function i(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function a(e){return r[o.call(e)]}},function(e,t,o){"use strict";e.exports=o(299)},function(e,t,o){var r=o(308);e.exports=d,e.exports.parse=i,e.exports.compile=function(e,t){return s(i(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=f;var n=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(e,t){for(var o,r=[],i=0,a=0,s="",l=t&&t.delimiter||"/";null!=(o=n.exec(e));){var m=o[0],f=o[1],d=o.index;if(s+=e.slice(a,d),a=d+m.length,f)s+=f[1];else{var h=e[a],p=o[2],g=o[3],b=o[4],y=o[5],v=o[6],k=o[7];s&&(r.push(s),s="");var w=null!=p&&null!=h&&h!==p,x="+"===v||"*"===v,z="?"===v||"*"===v,j=o[2]||l,M=b||y;r.push({name:g||i++,prefix:p||"",delimiter:j,optional:z,repeat:x,partial:w,asterisk:!!k,pattern:M?u(M):k?".*":"[^"+c(j)+"]+?"})}}return a>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function c(e){for(var t=1,o=0;o126)return"Invalid prefix ("+e+")";t=s(t)^r>>5}for(t=s(t),o=0;ot)return"Exceeds length limit";var o=e.toLowerCase(),r=e.toUpperCase();if(e!==o&&e!==r)return"Mixed-case string "+e;var i=(e=o).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var a=e.slice(0,i),u=e.slice(i+1);if(u.length<6)return"Data too short";var l=c(a);if("string"===typeof l)return l;for(var m=[],f=0;f=u.length||m.push(h)}return 1!==l?"Invalid checksum for "+e:{prefix:a,words:m}}function l(e,t,o,r){for(var n=0,i=0,a=(1<=o;)i-=o,s.push(n>>i&a);if(r)i>0&&s.push(n<=t)return"Excess padding";if(n<o)throw new TypeError("Exceeds length limit");var n=c(e=e.toLowerCase());if("string"===typeof n)throw new Error(n);for(var i=e+"1",a=0;a>5!==0)throw new Error("Non 5-bit word");n=s(n)^u,i+=r.charAt(u)}for(a=0;a<6;++a)n=s(n);for(n^=1,a=0;a<6;++a){i+=r.charAt(n>>5*(5-a)&31)}return i},toWordsUnsafe:function(e){var t=l(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=l(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=l(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=l(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},,,,,,function(e,t,o){(function(t){self,e.exports=function(){var e={1645:function(e,t,o){"use strict";var r=function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},n=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.chains=t._getInitializedChains=void 0;var i=n(o(7295)),a=n(o(1227)),s=n(o(439)),c=n(o(7098)),u=n(o(7687));function l(e){var t,o,n={1:"mainnet",3:"ropsten",4:"rinkeby",42:"kovan",5:"goerli"},l={mainnet:i.default,ropsten:a.default,rinkeby:s.default,kovan:c.default,goerli:u.default};if(e)try{for(var m=r(e),f=m.next();!f.done;f=m.next()){var d=f.value,h=d.name;n[d.chainId.toString()]=h,l[h]=d}}catch(e){t={error:e}}finally{try{f&&!f.done&&(o=m.return)&&o.call(m)}finally{if(t)throw t.error}}return l.names=n,l}t._getInitializedChains=l,t.chains=l()},425:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EIPs=void 0,t.EIPs={1559:o(7523),2315:o(3339),2537:o(6769),2565:o(7897),2718:o(2170),2929:o(8436),2930:o(6213),3198:o(5491),3529:o(7852),3541:o(1871),3554:o(7225),3675:o(8571)}},7002:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hardforks=void 0,t.hardforks=[["chainstart",o(114)],["homestead",o(2800)],["dao",o(7197)],["tangerineWhistle",o(2302)],["spuriousDragon",o(716)],["byzantium",o(6985)],["constantinople",o(5993)],["petersburg",o(4064)],["istanbul",o(3166)],["muirGlacier",o(2946)],["berlin",o(15)],["london",o(1250)],["shanghai",o(5553)],["merge",o(8648)]]},3863:function(e,t,o){"use strict";var r,n=o(9033).Buffer,i=o(8847)(o(3355)),a=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),s=function(){return s=Object.assign||function(e){for(var t,o=1,r=arguments.length;o=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.ConsensusAlgorithm=t.ConsensusType=t.Hardfork=t.Chain=t.CustomChain=void 0;var u,l,m,f,d,h=o(8291),p=o(4628),g=o(3062),b=o(1645),y=o(7002),v=o(425);!function(e){e.PolygonMainnet="polygon-mainnet",e.PolygonMumbai="polygon-mumbai",e.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",e.xDaiChain="x-dai-chain"}(u=t.CustomChain||(t.CustomChain={})),(d=t.Chain||(t.Chain={}))[d.Mainnet=1]="Mainnet",d[d.Ropsten=3]="Ropsten",d[d.Rinkeby=4]="Rinkeby",d[d.Kovan=42]="Kovan",d[d.Goerli=5]="Goerli",function(e){e.Chainstart="chainstart",e.Homestead="homestead",e.Dao="dao",e.TangerineWhistle="tangerineWhistle",e.SpuriousDragon="spuriousDragon",e.Byzantium="byzantium",e.Constantinople="constantinople",e.Petersburg="petersburg",e.Istanbul="istanbul",e.MuirGlacier="muirGlacier",e.Berlin="berlin",e.London="london",e.Shanghai="shanghai",e.Merge="merge"}(l=t.Hardfork||(t.Hardfork={})),(f=t.ConsensusType||(t.ConsensusType={})).ProofOfStake="pos",f.ProofOfWork="pow",f.ProofOfAuthority="poa",(m=t.ConsensusAlgorithm||(t.ConsensusAlgorithm={})).Ethash="ethash",m.Clique="clique",m.Casper="casper";var k=function(e){function t(t){var o,r,n,i,a=e.call(this)||this;a._supportedHardforks=[],a._eips=[],a._customChains=null!==(n=t.customChains)&&void 0!==n?n:[],a._chainParams=a.setChain(t.chain),a.DEFAULT_HARDFORK=null!==(i=a._chainParams.defaultHardfork)&&void 0!==i?i:l.Istanbul;try{for(var s=c(a._chainParams.hardforks),u=s.next();!u.done;u=s.next()){var m=u.value;m.forkHash||(m.forkHash=a._calcForkHash(m.name))}}catch(e){o={error:e}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return a._hardfork=a.DEFAULT_HARDFORK,t.supportedHardforks&&(a._supportedHardforks=t.supportedHardforks),t.hardfork&&a.setHardfork(t.hardfork),t.eips&&a.setEIPs(t.eips),a}return a(t,e),t.custom=function(e,o){var r;void 0===o&&(o={});var n=null!==(r=o.baseChain)&&void 0!==r?r:"mainnet",i=s({},t._getChainParams(n));if(i.name="custom-chain","string"!=typeof e)return new t(s({chain:s(s({},i),e)},o));if(e===u.PolygonMainnet)return t.custom({name:u.PolygonMainnet,chainId:137,networkId:137});if(e===u.PolygonMumbai)return t.custom({name:u.PolygonMumbai,chainId:80001,networkId:80001});if(e===u.ArbitrumRinkebyTestnet)return t.custom({name:u.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611});if(e===u.xDaiChain)return t.custom({name:u.xDaiChain,chainId:100,networkId:100});throw new Error("Custom chain "+e+" not supported")},t.forCustomChain=function(e,o,r,n){var i=t._getChainParams(e);return new t({chain:s(s({},i),o),hardfork:r,supportedHardforks:n})},t.isSupportedChainId=function(e){var t=(0,b._getInitializedChains)();return Boolean(t.names[e.toString()])},t._getChainParams=function(e,t){var o=(0,b._getInitializedChains)(t);if("number"==typeof e||g.BN.isBN(e)){if(e=e.toString(),o.names[e])return o[o.names[e]];throw new Error("Chain with ID "+e+" not supported")}if(o[e])return o[e];throw new Error("Chain with name "+e+" not supported")},t.prototype.setChain=function(e){var o,r;if("number"==typeof e||"string"==typeof e||g.BN.isBN(e)){var n;n=this._customChains&&this._customChains.length>0&&Array.isArray(this._customChains[0])?this._customChains.map((function(e){return e[0]})):this._customChains,this._chainParams=t._getChainParams(e,n)}else{if("object"!==(0,i.default)(e))throw new Error("Wrong input format");if(this._customChains.length>0)throw new Error("Chain must be a string, number, or BN when initialized with customChains passed in");try{for(var a=c(["networkId","genesis","hardforks","bootstrapNodes"]),s=a.next();!s.done;s=a.next()){var u=s.value;if(void 0===e[u])throw new Error("Missing required chain parameter: "+u)}}catch(e){o={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}this._chainParams=e}return this._chainParams},t.prototype.setHardfork=function(e){var t,o;if(!this._isSupportedHardfork(e))throw new Error("Hardfork "+e+" not set as supported in supportedHardforks");var r=!1;try{for(var n=c(y.hardforks),i=n.next();!i.done;i=n.next())i.value[0]===e&&(this._hardfork!==e&&(this._hardfork=e,this.emit("hardforkChanged",e)),r=!0)}catch(e){t={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(t)throw t.error}}if(!r)throw new Error("Hardfork with name "+e+" not supported")},t.prototype.getHardforkByBlockNumber=function(e,t){var o,r;e=(0,g.toType)(e,g.TypeOutput.BN),t=t?(0,g.toType)(t,g.TypeOutput.BN):void 0;var n,i,a,s=l.Chainstart;try{for(var u=c(this.hardforks()),m=u.next();!m.done;m=u.next()){var f=m.value;if(null!==f.block)e.gte(new g.BN(f.block))&&(s=f.name),t&&f.td&&(t.gten(f.td)?n=f.name:i=a),a=f.name;else if(t&&f.td&&t.gten(f.td))return f.name}}catch(e){o={error:e}}finally{try{m&&!m.done&&(r=u.return)&&r.call(u)}finally{if(o)throw o.error}}if(t){var d="block number: "+e+" (-> "+s+"), ";if(n&&!this.hardforkGteHardfork(s,n)){var h="HF determined by block number is lower than the minimum total difficulty HF";throw d+="total difficulty: "+t+" (-> "+n+")",new Error(h+": "+d)}if(i&&!this.hardforkGteHardfork(i,s))throw h="Maximum HF determined by total difficulty is lower than the block number HF",d+="total difficulty: "+t+" (-> "+i+")",new Error(h+": "+d)}return s},t.prototype.setHardforkByBlockNumber=function(e,t){var o=this.getHardforkByBlockNumber(e,t);return this.setHardfork(o),o},t.prototype._chooseHardfork=function(e,t){if(void 0===t&&(t=!0),e){if(t&&!this._isSupportedHardfork(e))throw new Error("Hardfork "+e+" not set as supported in supportedHardforks")}else e=this._hardfork;return e},t.prototype._getHardfork=function(e){var t,o,r=this.hardforks();try{for(var n=c(r),i=n.next();!i.done;i=n.next()){var a=i.value;if(a.name===e)return a}}catch(e){t={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(t)throw t.error}}throw new Error("Hardfork "+e+" not defined for chain "+this.chainName())},t.prototype._isSupportedHardfork=function(e){var t,o;if(!(this._supportedHardforks.length>0))return!0;try{for(var r=c(this._supportedHardforks),n=r.next();!n.done;n=r.next())if(e===n.value)return!0}catch(e){t={error:e}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(t)throw t.error}}return!1},t.prototype.setEIPs=function(e){var t,o,r=this;void 0===e&&(e=[]);var n=function(t){if(!(t in v.EIPs))throw new Error(t+" not supported");var o=i.gteHardfork(v.EIPs[t].minimumHardfork);if(!o)throw new Error(t+" cannot be activated on hardfork "+i.hardfork()+", minimumHardfork: "+o);v.EIPs[t].requiredEIPs&&v.EIPs[t].requiredEIPs.forEach((function(o){if(!e.includes(o)&&!r.isActivatedEIP(o))throw new Error(t+" requires EIP "+o+", but is not included in the EIP list")}))},i=this;try{for(var a=c(e),s=a.next();!s.done;s=a.next())n(s.value)}catch(e){t={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(t)throw t.error}}this._eips=e},t.prototype.param=function(e,t){var o,r,n=null;try{for(var i=c(this._eips),a=i.next();!a.done;a=i.next()){var s=a.value;if(null!==(n=this.paramByEIP(e,t,s)))return n}}catch(e){o={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return this.paramByHardfork(e,t,this._hardfork)},t.prototype.paramByHardfork=function(e,t,o){var r,n,i,a;o=this._chooseHardfork(o);var s=null;try{for(var u=c(y.hardforks),l=u.next();!l.done;l=u.next()){var m=l.value;if("eips"in m[1]){var f=m[1].eips;try{for(var d=(i=void 0,c(f)),h=d.next();!h.done;h=d.next()){var p=h.value,g=this.paramByEIP(e,t,p);s=null!==g?g:s}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}}else{if(!m[1][e])throw new Error("Topic "+e+" not defined");void 0!==m[1][e][t]&&(s=m[1][e][t].v)}if(m[0]===o)break}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return s},t.prototype.paramByEIP=function(e,t,o){if(!(o in v.EIPs))throw new Error(o+" not supported");var r=v.EIPs[o];if(!(e in r))throw new Error("Topic "+e+" not defined");return void 0===r[e][t]?null:r[e][t].v},t.prototype.paramByBlock=function(e,t,o){var r=this.activeHardforks(o),n=r[r.length-1].name;return this.paramByHardfork(e,t,n)},t.prototype.isActivatedEIP=function(e){var t,o;if(this.eips().includes(e))return!0;try{for(var r=c(y.hardforks),n=r.next();!n.done;n=r.next()){var i=n.value[1];if(this.gteHardfork(i.name)&&"eips"in i&&i.eips.includes(e))return!0}}catch(e){t={error:e}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(t)throw t.error}}return!1},t.prototype.hardforkIsActiveOnBlock=function(e,t,o){var r;void 0===o&&(o={}),t=(0,g.toType)(t,g.TypeOutput.BN);var n=null!==(r=o.onlySupported)&&void 0!==r&&r;e=this._chooseHardfork(e,n);var i=this.hardforkBlockBN(e);return!(!i||!t.gte(i))},t.prototype.activeOnBlock=function(e,t){return this.hardforkIsActiveOnBlock(null,e,t)},t.prototype.hardforkGteHardfork=function(e,t,o){var r,n;void 0===o&&(o={});var i,a=void 0!==o.onlyActive&&o.onlyActive;e=this._chooseHardfork(e,o.onlySupported),i=a?this.activeHardforks(null,o):this.hardforks();var s=-1,u=-1,l=0;try{for(var m=c(i),f=m.next();!f.done;f=m.next()){var d=f.value;d.name===e&&(s=l),d.name===t&&(u=l),l+=1}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}return s>=u&&-1!==u},t.prototype.gteHardfork=function(e,t){return this.hardforkGteHardfork(null,e,t)},t.prototype.hardforkIsActiveOnChain=function(e,t){var o,r,n;void 0===t&&(t={});var i=null!==(n=t.onlySupported)&&void 0!==n&&n;e=this._chooseHardfork(e,i);try{for(var a=c(this.hardforks()),s=a.next();!s.done;s=a.next()){var u=s.value;if(u.name===e&&null!==u.block)return!0}}catch(e){o={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return!1},t.prototype.activeHardforks=function(e,t){var o,r;void 0===t&&(t={});var n=[],i=this.hardforks();try{for(var a=c(i),s=a.next();!s.done;s=a.next()){var u=s.value;if(null!==u.block){if(null!=e&&e0)return o[o.length-1].name;throw new Error("No (supported) active hardfork found")},t.prototype.hardforkBlock=function(e){var t=this.hardforkBlockBN(e);return t?(0,g.toType)(t,g.TypeOutput.Number):null},t.prototype.hardforkBlockBN=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e).block;return null==t?null:new g.BN(t)},t.prototype.hardforkTD=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e).td;return null==t?null:new g.BN(t)},t.prototype.isHardforkBlock=function(e,t){e=(0,g.toType)(e,g.TypeOutput.BN),t=this._chooseHardfork(t,!1);var o=this.hardforkBlockBN(t);return!!o&&o.eq(e)},t.prototype.nextHardforkBlock=function(e){var t=this.nextHardforkBlockBN(e);return null===t?null:(0,g.toType)(t,g.TypeOutput.Number)},t.prototype.nextHardforkBlockBN=function(e){e=this._chooseHardfork(e,!1);var t=this.hardforkBlockBN(e);return null===t?null:this.hardforks().reduce((function(e,o){var r=new g.BN(o.block);return r.gt(t)&&null===e?r:e}),null)},t.prototype.isNextHardforkBlock=function(e,t){e=(0,g.toType)(e,g.TypeOutput.BN),t=this._chooseHardfork(t,!1);var o=this.nextHardforkBlockBN(t);return null!==o&&o.eq(e)},t.prototype._calcForkHash=function(e){var t,o,r=n.from(this.genesis().hash.substr(2),"hex"),i=n.alloc(0),a=0;try{for(var s=c(this.hardforks()),u=s.next();!u.done;u=s.next()){var l=u.value,m=l.block;if(0!==m&&null!==m&&m!==a){var f=n.from(m.toString(16).padStart(16,"0"),"hex");i=n.concat([i,f])}if(l.name===e)break;null!==m&&(a=m)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(t)throw t.error}}var d=n.concat([r,i]);return"0x"+(0,g.intToBuffer)((0,p.buf)(d)>>>0).toString("hex")},t.prototype.forkHash=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e);if(null===t.block)throw new Error("No fork hash calculation possible for non-applied or future hardfork");return void 0!==t.forkHash?t.forkHash:this._calcForkHash(e)},t.prototype.hardforkForForkHash=function(e){var t=this.hardforks().filter((function(t){return t.forkHash===e}));return t.length>=1?t[t.length-1]:null},t.prototype.genesis=function(){return this._chainParams.genesis},t.prototype.genesisState=function(){var e,t;switch(this.chainName()){case"mainnet":return o(Object(function(){var e=new Error("Cannot find module './genesisStates/mainnet.json'");throw e.code="MODULE_NOT_FOUND",e}()));case"ropsten":return o(Object(function(){var e=new Error("Cannot find module './genesisStates/ropsten.json'");throw e.code="MODULE_NOT_FOUND",e}()));case"rinkeby":return o(Object(function(){var e=new Error("Cannot find module './genesisStates/rinkeby.json'");throw e.code="MODULE_NOT_FOUND",e}()));case"kovan":return o(Object(function(){var e=new Error("Cannot find module './genesisStates/kovan.json'");throw e.code="MODULE_NOT_FOUND",e}()));case"goerli":return o(Object(function(){var e=new Error("Cannot find module './genesisStates/goerli.json'");throw e.code="MODULE_NOT_FOUND",e}()))}if(this._customChains&&this._customChains.length>0&&Array.isArray(this._customChains[0]))try{for(var r=c(this._customChains),n=r.next();!n.done;n=r.next()){var i=n.value;if(i[0].name===this.chainName())return i[1]}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return{}},t.prototype.hardforks=function(){return this._chainParams.hardforks},t.prototype.bootstrapNodes=function(){return this._chainParams.bootstrapNodes},t.prototype.dnsNetworks=function(){return this._chainParams.dnsNetworks},t.prototype.hardfork=function(){return this._hardfork},t.prototype.chainId=function(){return(0,g.toType)(this.chainIdBN(),g.TypeOutput.Number)},t.prototype.chainIdBN=function(){return new g.BN(this._chainParams.chainId)},t.prototype.chainName=function(){return this._chainParams.name},t.prototype.networkId=function(){return(0,g.toType)(this.networkIdBN(),g.TypeOutput.Number)},t.prototype.networkIdBN=function(){return new g.BN(this._chainParams.networkId)},t.prototype.eips=function(){return this._eips},t.prototype.consensusType=function(){var e,t,o,r=this.hardfork();try{for(var n=c(y.hardforks),i=n.next();!i.done;i=n.next()){var a=i.value;if("consensus"in a[1]&&(o=a[1].consensus.type),a[0]===r)break}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return o||this._chainParams.consensus.type},t.prototype.consensusAlgorithm=function(){var e,t,o,r=this.hardfork();try{for(var n=c(y.hardforks),i=n.next();!i.done;i=n.next()){var a=i.value;if("consensus"in a[1]&&(o=a[1].consensus.algorithm),a[0]===r)break}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return o||this._chainParams.consensus.algorithm},t.prototype.consensusConfig=function(){var e,t,o,r=this.hardfork();try{for(var n=c(y.hardforks),i=n.next();!i.done;i=n.next()){var a=i.value;if("consensus"in a[1]&&(o=a[1].consensus[a[1].consensus.algorithm]),a[0]===r)break}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}if(o)return o;var s=this.consensusAlgorithm();return this._chainParams.consensus[s]},t.prototype.copy=function(){return Object.assign(Object.create(Object.getPrototypeOf(this)),this)},t}(h.EventEmitter);t.default=k},4383:function(e,t,o){"use strict";var r=Object.create?function(e,t,o,r){void 0===r&&(r=o),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[o]}})}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]},n=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},i=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTransaction=void 0;var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t}(o(3863)),s=o(3062),c=o(7325),u=function(){function e(e){this.cache={hash:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=a.Chain.Mainnet,this.DEFAULT_HARDFORK=a.Hardfork.Istanbul;var t=e.nonce,o=e.gasLimit,r=e.to,n=e.value,i=e.data,c=e.v,u=e.r,l=e.s,m=e.type;this._type=new s.BN((0,s.toBuffer)(m)).toNumber();var f=(0,s.toBuffer)(""===r?"0x":r),d=(0,s.toBuffer)(""===c?"0x":c),h=(0,s.toBuffer)(""===u?"0x":u),p=(0,s.toBuffer)(""===l?"0x":l);this.nonce=new s.BN((0,s.toBuffer)(""===t?"0x":t)),this.gasLimit=new s.BN((0,s.toBuffer)(""===o?"0x":o)),this.to=f.length>0?new s.Address(f):void 0,this.value=new s.BN((0,s.toBuffer)(""===n?"0x":n)),this.data=(0,s.toBuffer)(""===i?"0x":i),this.v=d.length>0?new s.BN(d):void 0,this.r=h.length>0?new s.BN(h):void 0,this.s=p.length>0?new s.BN(p):void 0,this._validateCannotExceedMaxInteger({nonce:this.nonce,gasLimit:this.gasLimit,value:this.value,r:this.r,s:this.s})}return Object.defineProperty(e.prototype,"transactionType",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),e.prototype.supports=function(e){return this.activeCapabilities.includes(e)},e.prototype.validate=function(e){void 0===e&&(e=!1);var t=[];return this.getBaseFee().gt(this.gasLimit)&&t.push("gasLimit is too low. given "+this.gasLimit+", need at least "+this.getBaseFee()),this.isSigned()&&!this.verifySignature()&&t.push("Invalid Signature"),e?t:0===t.length},e.prototype.getBaseFee=function(){var e=this.getDataFee().addn(this.common.param("gasPrices","tx"));return this.common.gteHardfork("homestead")&&this.toCreationAddress()&&e.iaddn(this.common.param("gasPrices","txCreation")),e},e.prototype.getDataFee=function(){for(var e=this.common.param("gasPrices","txDataZero"),t=this.common.param("gasPrices","txDataNonZero"),o=0,r=0;r-1&&this.activeCapabilities.splice(l,1)}return u},e.prototype._getCommon=function(e,t){var o;if(t){var r=new s.BN((0,s.toBuffer)(t));if(e){if(!e.chainIdBN().eq(r))throw new Error("The chain ID does not match the chain ID of Common");return e.copy()}return a.default.isSupportedChainId(r)?new a.default({chain:r,hardfork:this.DEFAULT_HARDFORK}):a.default.forCustomChain(this.DEFAULT_CHAIN,{name:"custom-chain",networkId:r,chainId:r},this.DEFAULT_HARDFORK)}return null!==(o=null==e?void 0:e.copy())&&void 0!==o?o:new a.default({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})},e.prototype._validateCannotExceedMaxInteger=function(e,t){var o,r;void 0===t&&(t=53);try{for(var n=function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(Object.entries(e)),a=n.next();!a.done;a=n.next()){var c=i(a.value,2),u=c[0],l=c[1];if(53===t){if(null==l?void 0:l.gt(s.MAX_INTEGER))throw new Error(u+" cannot exceed MAX_INTEGER, given "+l)}else{if(256!==t)throw new Error("unimplemented bits value");if(null==l?void 0:l.gte(s.TWO_POW256))throw new Error(u+" must be less than 2^256, given "+l)}}}catch(e){o={error:e}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}},e}();t.BaseTransaction=u},660:function(e,t,o){"use strict";var r,n=o(9033).Buffer,i=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),a=function(){return a=Object.assign||function(e){for(var t,o=1,r=arguments.length;o0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a}(e,12),n=r[0],i=r[1],a=r[2],c=r[3],u=r[4],l=r[5],m=r[6],f=r[7],d=r[8],h=r[9],p=r[10],g=r[11];return new t({chainId:new s.BN(n),nonce:i,maxPriorityFeePerGas:a,maxFeePerGas:c,gasLimit:u,to:l,value:m,data:f,accessList:null!=d?d:[],v:void 0!==h?new s.BN(h):void 0,r:p,s:g},o)},t.prototype.getDataFee=function(){var t=e.prototype.getDataFee.call(this);return t.iaddn(l.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),t},t.prototype.getUpfrontCost=function(e){void 0===e&&(e=new s.BN(0));var t=s.BN.min(this.maxPriorityFeePerGas,this.maxFeePerGas.sub(e)).add(e);return this.gasLimit.mul(t).add(this.value)},t.prototype.raw=function(){return[(0,s.bnToUnpaddedBuffer)(this.chainId),(0,s.bnToUnpaddedBuffer)(this.nonce),(0,s.bnToUnpaddedBuffer)(this.maxPriorityFeePerGas),(0,s.bnToUnpaddedBuffer)(this.maxFeePerGas),(0,s.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:n.from([]),(0,s.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0,s.bnToUnpaddedBuffer)(this.v):n.from([]),void 0!==this.r?(0,s.bnToUnpaddedBuffer)(this.r):n.from([]),void 0!==this.s?(0,s.bnToUnpaddedBuffer)(this.s):n.from([])]},t.prototype.serialize=function(){var e=this.raw();return n.concat([m,s.rlp.encode(e)])},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this.raw().slice(0,9),o=n.concat([m,s.rlp.encode(t)]);return e?(0,s.keccak256)(o):o},t.prototype.hash=function(){if(!this.isSigned())throw new Error("Cannot call hash method if transaction is not signed");return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,s.keccak256)(this.serialize())),this.cache.hash):(0,s.keccak256)(this.serialize())},t.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},t.prototype.getSenderPublicKey=function(){var e;if(!this.isSigned())throw new Error("Cannot call this method if transaction is not signed");var t=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(u.N_DIV_2)))throw new Error("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");var o=this,r=o.v,n=o.r,i=o.s;try{return(0,s.ecrecover)(t,r.addn(27),(0,s.bnToUnpaddedBuffer)(n),(0,s.bnToUnpaddedBuffer)(i))}catch(e){throw new Error("Invalid Signature")}},t.prototype._processSignature=function(e,o,r){var n={common:this.common};return t.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new s.BN(e-27),r:new s.BN(o),s:new s.BN(r)},n)},t.prototype.toJSON=function(){var e=l.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,s.bnToHex)(this.chainId),nonce:(0,s.bnToHex)(this.nonce),maxPriorityFeePerGas:(0,s.bnToHex)(this.maxPriorityFeePerGas),maxFeePerGas:(0,s.bnToHex)(this.maxFeePerGas),gasLimit:(0,s.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,s.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:e,v:void 0!==this.v?(0,s.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,s.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,s.bnToHex)(this.s):void 0}},t}(c.BaseTransaction);t.default=f},7613:function(e,t,o){"use strict";var r,n=o(9033).Buffer,i=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),a=function(){return a=Object.assign||function(e){for(var t,o=1,r=arguments.length;o0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a}(e,11),n=r[0],i=r[1],a=r[2],c=r[3],u=r[4],l=r[5],m=r[6],f=r[7],d=r[8],h=r[9],p=r[10];return new t({chainId:new s.BN(n),nonce:i,gasPrice:a,gasLimit:c,to:u,value:l,data:m,accessList:null!=f?f:[],v:void 0!==d?new s.BN(d):void 0,r:h,s:p},o)},t.prototype.getDataFee=function(){var t=e.prototype.getDataFee.call(this);return t.iaddn(l.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),t},t.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},t.prototype.raw=function(){return[(0,s.bnToUnpaddedBuffer)(this.chainId),(0,s.bnToUnpaddedBuffer)(this.nonce),(0,s.bnToUnpaddedBuffer)(this.gasPrice),(0,s.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:n.from([]),(0,s.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0,s.bnToUnpaddedBuffer)(this.v):n.from([]),void 0!==this.r?(0,s.bnToUnpaddedBuffer)(this.r):n.from([]),void 0!==this.s?(0,s.bnToUnpaddedBuffer)(this.s):n.from([])]},t.prototype.serialize=function(){var e=this.raw();return n.concat([m,s.rlp.encode(e)])},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this.raw().slice(0,8),o=n.concat([m,s.rlp.encode(t)]);return e?(0,s.keccak256)(o):o},t.prototype.hash=function(){if(!this.isSigned())throw new Error("Cannot call hash method if transaction is not signed");return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,s.keccak256)(this.serialize())),this.cache.hash):(0,s.keccak256)(this.serialize())},t.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},t.prototype.getSenderPublicKey=function(){var e;if(!this.isSigned())throw new Error("Cannot call this method if transaction is not signed");var t=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(u.N_DIV_2)))throw new Error("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");var o=this,r=o.yParity,n=o.r,i=o.s;try{return(0,s.ecrecover)(t,r.addn(27),(0,s.bnToUnpaddedBuffer)(n),(0,s.bnToUnpaddedBuffer)(i))}catch(e){throw new Error("Invalid Signature")}},t.prototype._processSignature=function(e,o,r){var n={common:this.common};return t.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new s.BN(e-27),r:new s.BN(o),s:new s.BN(r)},n)},t.prototype.toJSON=function(){var e=l.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,s.bnToHex)(this.chainId),nonce:(0,s.bnToHex)(this.nonce),gasPrice:(0,s.bnToHex)(this.gasPrice),gasLimit:(0,s.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,s.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:e,v:void 0!==this.v?(0,s.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,s.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,s.bnToHex)(this.s):void 0}},t}(c.BaseTransaction);t.default=f},2339:function(e,t,o){"use strict";var r=Object.create?function(e,t,o,r){void 0===r&&(r=o),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[o]}})}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]},n=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FeeMarketEIP1559Transaction=t.TransactionFactory=t.AccessListEIP2930Transaction=t.Transaction=void 0;var i=o(3088);Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return n(i).default}});var a=o(7613);Object.defineProperty(t,"AccessListEIP2930Transaction",{enumerable:!0,get:function(){return n(a).default}});var s=o(9562);Object.defineProperty(t,"TransactionFactory",{enumerable:!0,get:function(){return n(s).default}});var c=o(660);Object.defineProperty(t,"FeeMarketEIP1559Transaction",{enumerable:!0,get:function(){return n(c).default}}),function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||r(t,e,o)}(o(7325),t)},3088:function(e,t,o){"use strict";var r,n=o(9033).Buffer,i=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),a=function(){return a=Object.assign||function(e){for(var t,o=1,r=arguments.length;o0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a}(e,9);return new t({nonce:r[0],gasPrice:r[1],gasLimit:r[2],to:r[3],value:r[4],data:r[5],v:r[6],r:r[7],s:r[8]},o)},t.prototype.raw=function(){return[(0,s.bnToUnpaddedBuffer)(this.nonce),(0,s.bnToUnpaddedBuffer)(this.gasPrice),(0,s.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:n.from([]),(0,s.bnToUnpaddedBuffer)(this.value),this.data,void 0!==this.v?(0,s.bnToUnpaddedBuffer)(this.v):n.from([]),void 0!==this.r?(0,s.bnToUnpaddedBuffer)(this.r):n.from([]),void 0!==this.s?(0,s.bnToUnpaddedBuffer)(this.s):n.from([])]},t.prototype.serialize=function(){return s.rlp.encode(this.raw())},t.prototype._getMessageToSign=function(){var e=[(0,s.bnToUnpaddedBuffer)(this.nonce),(0,s.bnToUnpaddedBuffer)(this.gasPrice),(0,s.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:n.from([]),(0,s.bnToUnpaddedBuffer)(this.value),this.data];return this.supports(c.Capability.EIP155ReplayProtection)&&(e.push((0,s.toBuffer)(this.common.chainIdBN())),e.push((0,s.unpadBuffer)((0,s.toBuffer)(0))),e.push((0,s.unpadBuffer)((0,s.toBuffer)(0)))),e},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this._getMessageToSign();return e?(0,s.rlphash)(t):t},t.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},t.prototype.hash=function(){return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,s.rlphash)(this.raw())),this.cache.hash):(0,s.rlphash)(this.raw())},t.prototype.getMessageToVerifySignature=function(){if(!this.isSigned())throw Error("This transaction is not signed");var e=this._getMessageToSign();return(0,s.rlphash)(e)},t.prototype.getSenderPublicKey=function(){var e,t=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(c.N_DIV_2)))throw new Error("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");var o=this,r=o.v,n=o.r,i=o.s;try{return(0,s.ecrecover)(t,r,(0,s.bnToUnpaddedBuffer)(n),(0,s.bnToUnpaddedBuffer)(i),this.supports(c.Capability.EIP155ReplayProtection)?this.common.chainIdBN():void 0)}catch(e){throw new Error("Invalid Signature")}},t.prototype._processSignature=function(e,o,r){var n=new s.BN(e);this.supports(c.Capability.EIP155ReplayProtection)&&n.iadd(this.common.chainIdBN().muln(2).addn(8));var i={common:this.common};return t.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:n,r:new s.BN(o),s:new s.BN(r)},i)},t.prototype.toJSON=function(){return{nonce:(0,s.bnToHex)(this.nonce),gasPrice:(0,s.bnToHex)(this.gasPrice),gasLimit:(0,s.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,s.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),v:void 0!==this.v?(0,s.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,s.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,s.bnToHex)(this.s):void 0}},t.prototype._validateTxV=function(e,t){var o;if(void 0!==e&&!e.eqn(0)&&(!t||t.gteHardfork("spuriousDragon"))&&!e.eqn(27)&&!e.eqn(28))if(t){var r=t.chainIdBN().muln(2);if(!e.eq(r.addn(35))&&!e.eq(r.addn(36)))throw new Error("Incompatible EIP155-based V "+e.toString()+" and chain id "+t.chainIdBN().toString()+". See the Common parameter of the Transaction constructor to set the chain id.")}else{var n;n=e.subn(35).isEven()?35:36,o=e.subn(n).divn(2)}return this._getCommon(t,o)},t.prototype._unsignedTxImplementsEIP155=function(){return this.common.gteHardfork("spuriousDragon")},t.prototype._signedTxImplementsEIP155=function(){if(!this.isSigned())throw Error("This transaction is not signed");var e=this.common.gteHardfork("spuriousDragon"),t=this.v,o=this.common.chainIdBN().muln(2);return(t.eq(o.addn(35))||t.eq(o.addn(36)))&&e},t}(o(4383).BaseTransaction);t.default=u},9562:function(e,t,o){"use strict";var r=o(9033).Buffer;Object.defineProperty(t,"__esModule",{value:!0});var n=o(3062),i=o(2339),a=function(){function e(){}return e.fromTxData=function(e,t){if(void 0===t&&(t={}),"type"in e&&void 0!==e.type){var o=new n.BN((0,n.toBuffer)(e.type)).toNumber();if(0===o)return i.Transaction.fromTxData(e,t);if(1===o)return i.AccessListEIP2930Transaction.fromTxData(e,t);if(2===o)return i.FeeMarketEIP1559Transaction.fromTxData(e,t);throw new Error("Tx instantiation with type "+o+" not supported")}return i.Transaction.fromTxData(e,t)},e.fromSerializedData=function(e,t){if(void 0===t&&(t={}),e[0]<=127){var o=void 0;switch(e[0]){case 1:o=2930;break;case 2:o=1559;break;default:throw new Error("TypedTransaction with ID "+e[0]+" unknown")}return 1559===o?i.FeeMarketEIP1559Transaction.fromSerializedTx(e,t):i.AccessListEIP2930Transaction.fromSerializedTx(e,t)}return i.Transaction.fromSerializedTx(e,t)},e.fromBlockBodyData=function(e,t){if(void 0===t&&(t={}),r.isBuffer(e))return this.fromSerializedData(e,t);if(Array.isArray(e))return i.Transaction.fromValuesArray(e,t);throw new Error("Cannot decode transaction: unknown type input")},e.getTransactionClass=function(e,t){if(void 0===e&&(e=0),0==e||e>=128&&e<=255)return i.Transaction;switch(e){case 1:return i.AccessListEIP2930Transaction;case 2:return i.FeeMarketEIP1559Transaction;default:throw new Error("TypedTransaction with ID "+e+" unknown")}},e}();t.default=a},7325:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.N_DIV_2=t.isAccessList=t.isAccessListBuffer=t.Capability=void 0;var r,n=o(3062);function i(e){if(0===e.length)return!0;var t=e[0];return!!Array.isArray(t)}(r=t.Capability||(t.Capability={}))[r.EIP155ReplayProtection=155]="EIP155ReplayProtection",r[r.EIP1559FeeMarket=1559]="EIP1559FeeMarket",r[r.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",r[r.EIP2930AccessLists=2930]="EIP2930AccessLists",t.isAccessListBuffer=i,t.isAccessList=function(e){return!i(e)},t.N_DIV_2=new n.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16)},3789:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccessLists=void 0;var r=o(3062),n=o(7325),i=function(){function e(){}return e.getAccessListData=function(e){var t,o;if(e&&(0,n.isAccessList)(e)){t=e;for(var i=[],a=0;a256||r%8!=0)&&w.throwArgumentError("invalid "+o[1]+" bit length","param",e),new b.NumberCoder(r/8,"int"===o[1],e.name)}if(o=e.type.match(x)){var n=parseInt(o[1]);return(0===n||n>32)&&w.throwArgumentError("invalid bytes length","param",e),new p.FixedBytesCoder(n,e.name)}return w.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new l.Reader(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new l.Writer(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,o=e.map((function(e){return t._getCoder(k.ParamType.from(e))}));return new v.TupleCoder(o,"_").defaultValue()}},{key:"encode",value:function(e,t){var o=this;e.length!==t.length&&w.throwError("types/values length mismatch",c.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var r=e.map((function(e){return o._getCoder(k.ParamType.from(e))})),n=new v.TupleCoder(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}},{key:"decode",value:function(e,t,o){var r=this,n=e.map((function(e){return r._getCoder(k.ParamType.from(e))}));return new v.TupleCoder(n,"_").decode(this._getReader((0,a.arrayify)(t),o))}}]),e}();t.AbiCoder=j;var M=new j;t.defaultAbiCoder=M},7316:function(e,t,o){"use strict";var r=o(8847);Object.defineProperty(t,"__esModule",{value:!0}),t.Writer=t.Reader=t.Coder=void 0,t.checkResultErrors=function(e){var t=[];return function e(o,r){if(Array.isArray(r))for(var n in r){var i=o.slice();i.push(n);try{e(i,r[n])}catch(e){t.push({path:i,error:e})}}}([],e),t};var n=r(o(9721)),i=r(o(8985)),a=o(908),s=o(4952),c=o(3694),u=o(4327),l=o(8067),m=new u.Logger(l.version),f=function(){function e(t,o,r,i){(0,n.default)(this,e),this.name=t,this.type=o,this.localName=r,this.dynamic=i}return(0,i.default)(e,[{key:"_throwError",value:function(e,t){m.throwArgumentError(e,this.localName,t)}}]),e}();t.Coder=f;var d=function(){function e(t){(0,n.default)(this,e),(0,c.defineReadOnly)(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}return(0,i.default)(e,[{key:"data",get:function(){return(0,a.hexConcat)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(e){return this._data.push(e),this._dataLength+=e.length,e.length}},{key:"appendWriter",value:function(e){return this._writeData((0,a.concat)(e._data))}},{key:"writeBytes",value:function(e){var t=(0,a.arrayify)(e),o=t.length%this.wordSize;return o&&(t=(0,a.concat)([t,this._padding.slice(o)])),this._writeData(t)}},{key:"_getValue",value:function(e){var t=(0,a.arrayify)(s.BigNumber.from(e));return t.length>this.wordSize&&m.throwError("value out-of-bounds",u.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,a.concat)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(o){e._data[t]=e._getValue(o)}}}]),e}();t.Writer=d;var h=function(){function e(t,o,r,i){(0,n.default)(this,e),(0,c.defineReadOnly)(this,"_data",(0,a.arrayify)(t)),(0,c.defineReadOnly)(this,"wordSize",o||32),(0,c.defineReadOnly)(this,"_coerceFunc",r),(0,c.defineReadOnly)(this,"allowLoose",i),this._offset=0}return(0,i.default)(e,[{key:"data",get:function(){return(0,a.hexlify)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,o){return this._coerceFunc?this._coerceFunc(t,o):e.coerce(t,o)}},{key:"_peekBytes",value:function(e,t,o){var r=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+r>this._data.length&&(this.allowLoose&&o&&this._offset+t<=this._data.length?r=t:m.throwError("data out-of-bounds",u.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+r})),this._data.slice(this._offset,this._offset+r)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var o=this._peekBytes(0,e,!!t);return this._offset+=o.length,o.slice(0,e)}},{key:"readValue",value:function(){return s.BigNumber.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var o=e.match("^u?int([0-9]+)$");return o&&parseInt(o[1])<=48&&(t=t.toNumber()),t}}]),e}();t.Reader=h},9146:function(e,t,o){"use strict";var r=o(8847);Object.defineProperty(t,"__esModule",{value:!0}),t.AddressCoder=void 0;var n=r(o(9721)),i=r(o(8985)),a=r(o(5163)),s=r(o(4650)),c=r(o(1949)),u=o(7921),l=o(908),m=function(e){(0,a.default)(m,e);var t,o,r=(t=m,o=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(e){return!1}}(),function(){var e,r=(0,c.default)(t);if(o){var n=(0,c.default)(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return(0,s.default)(this,e)});function m(e){return(0,n.default)(this,m),r.call(this,"address","address",e,!1)}return(0,i.default)(m,[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(e,t){try{t=(0,u.getAddress)(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}},{key:"decode",value:function(e){return(0,u.getAddress)((0,l.hexZeroPad)(e.readValue().toHexString(),20))}}]),m}(o(7316).Coder);t.AddressCoder=m},8090:function(e,t,o){"use strict";var r=o(8847);Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousCoder=void 0;var n=r(o(9721)),i=r(o(8985)),a=r(o(5163)),s=r(o(4650)),c=r(o(1949)),u=function(e){(0,a.default)(u,e);var t,o,r=(t=u,o=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(e){return!1}}(),function(){var e,r=(0,c.default)(t);if(o){var n=(0,c.default)(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return(0,s.default)(this,e)});function u(e){var t;return(0,n.default)(this,u),(t=r.call(this,e.name,e.type,void 0,e.dynamic)).coder=e,t}return(0,i.default)(u,[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(e,t){return this.coder.encode(e,t)}},{key:"decode",value:function(e){return this.coder.decode(e)}}]),u}(o(7316).Coder);t.AnonymousCoder=u},4341:function(e,t,o){"use strict";var r=o(8847);Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayCoder=void 0,t.pack=p,t.unpack=g;var n=r(o(9721)),i=r(o(8985)),a=r(o(5163)),s=r(o(4650)),c=r(o(1949)),u=r(o(3355)),l=o(4327),m=o(8067),f=o(7316),d=o(8090),h=new l.Logger(m.version);function p(e,t,o){var r=null;if(Array.isArray(o))r=o;else if(o&&"object"===(0,u.default)(o)){var n={};r=t.map((function(e){var t=e.localName;return t||h.throwError("cannot encode object for signature with missing names",l.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:o}),n[t]&&h.throwError("cannot encode object for signature with duplicate names",l.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:o}),n[t]=!0,o[t]}))}else h.throwArgumentError("invalid tuple value","tuple",o);t.length!==r.length&&h.throwArgumentError("types/value length mismatch","tuple",o);var i=new f.Writer(e.wordSize),a=new f.Writer(e.wordSize),s=[];return t.forEach((function(e,t){var o=r[t];if(e.dynamic){var n=a.length;e.encode(a,o);var c=i.writeUpdatableValue();s.push((function(e){c(e+n)}))}else e.encode(i,o)})),s.forEach((function(e){e(i.length)})),e.appendWriter(i)+e.appendWriter(a)}function g(e,t){var o=[],r=e.subReader(0);t.forEach((function(t){var n=null;if(t.dynamic){var i=e.readValue(),a=r.subReader(i.toNumber());try{n=t.decode(a)}catch(e){if(e.code===l.Logger.errors.BUFFER_OVERRUN)throw e;(n=e).baseType=t.name,n.name=t.localName,n.type=t.type}}else try{n=t.decode(e)}catch(e){if(e.code===l.Logger.errors.BUFFER_OVERRUN)throw e;(n=e).baseType=t.name,n.name=t.localName,n.type=t.type}null!=n&&o.push(n)}));var n=t.reduce((function(e,t){var o=t.localName;return o&&(e[o]||(e[o]=0),e[o]++),e}),{});t.forEach((function(e,t){var r=e.localName;if(r&&1===n[r]&&("length"===r&&(r="_length"),null==o[r])){var i=o[t];i instanceof Error?Object.defineProperty(o,r,{enumerable:!0,get:function(){throw i}}):o[r]=i}}));for(var i=function(e){var t=o[e];t instanceof Error&&Object.defineProperty(o,e,{enumerable:!0,get:function(){throw t}})},a=0;a=0?t:"")+"]",s=-1===t||e.dynamic;return(i=r.call(this,"array",a,o,s)).coder=e,i.length=t,i}return(0,i.default)(u,[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],o=0;oe._data.length&&h.throwError("insufficient data length",l.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var o=[],r=0;r=0||"tuple"===e)&&b[t])return!0;return(g[t]||"payable"===t)&&h.throwArgumentError("invalid modifier","name",t),!1}function v(e,t){for(var o in t)(0,l.defineReadOnly)(e,o,t[o])}var k=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"});t.FormatTypes=k;var w=new RegExp(/^(.*)\[([0-9]*)\]$/),x=function(){function e(t,o){(0,s.default)(this,e),t!==p&&h.throwError("use fromString",m.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),v(this,o);var r=this.type.match(w);v(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:e.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return(0,c.default)(e,[{key:"format",value:function(e){if(e||(e=k.sighash),k[e]||h.throwArgumentError("invalid format type","format",e),e===k.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var o="";return"array"===this.baseType?(o+=this.arrayChildren.format(e),o+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==k.sighash&&(o+=this.type),o+="("+this.components.map((function(t){return t.format(e)})).join(e===k.full?", ":",")+")"):o+=this.type,e!==k.sighash&&(!0===this.indexed&&(o+=" indexed"),e===k.full&&this.name&&(o+=" "+this.name)),o}}],[{key:"from",value:function(t,o){return"string"==typeof t?e.fromString(t,o):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(p,{name:t.name||null,type:T(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,o){return r=function(e,t){var o=e;function r(t){h.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function n(e){var o={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(o.indexed=!1),o}e=e.replace(/\s/g," ");for(var i={type:"",name:"",state:{allowType:!0}},a=i,s=0;s2&&h.throwArgumentError("invalid human-readable ABI signature","value",e),o[1].match(/^[0-9]+$/)||h.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=u.BigNumber.from(o[1]),o[0]):e}function q(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function I(e){var t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&h.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&h.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||h.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&h.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&h.throwArgumentError("unable to determine stateMutability","value",e),t}t.EventFragment=M;var E=function(e){(0,n.default)(o,e);var t=d(o);function o(){return(0,s.default)(this,o),t.apply(this,arguments)}return(0,c.default)(o,[{key:"format",value:function(e){if(e||(e=k.sighash),k[e]||h.throwArgumentError("invalid format type","format",e),e===k.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});e===k.sighash&&h.throwError("cannot format a constructor for sighash",m.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===k.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?o.fromString(e):o.fromObject(e)}},{key:"fromObject",value:function(e){if(o.isConstructorFragment(e))return e;"constructor"!==e.type&&h.throwArgumentError("invalid constructor object","value",e);var t=I(e);t.constant&&h.throwArgumentError("constructor cannot be constant","value",e);var r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(x.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?u.BigNumber.from(e.gas):null};return new o(p,r)}},{key:"fromString",value:function(e){var t={type:"constructor"},r=(e=A(e,t)).match(D);return r&&"constructor"===r[1].trim()||h.throwArgumentError("invalid constructor string","value",e),t.inputs=z(r[2].trim(),!1),q(r[3].trim(),t),o.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),o}(j);t.ConstructorFragment=E;var S=function(e){(0,n.default)(o,e);var t=d(o);function o(){return(0,s.default)(this,o),t.apply(this,arguments)}return(0,c.default)(o,[{key:"format",value:function(e){if(e||(e=k.sighash),k[e]||h.throwArgumentError("invalid format type","format",e),e===k.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==k.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===k.full?", ":",")+") ",e!==k.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?o.fromString(e):o.fromObject(e)}},{key:"fromObject",value:function(e){if(o.isFunctionFragment(e))return e;"function"!==e.type&&h.throwArgumentError("invalid function object","value",e);var t=I(e),r={type:e.type,name:C(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(x.fromObject):[],outputs:e.outputs?e.outputs.map(x.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?u.BigNumber.from(e.gas):null};return new o(p,r)}},{key:"fromString",value:function(e){var t={type:"function"},r=(e=A(e,t)).split(" returns ");r.length>2&&h.throwArgumentError("invalid function string","value",e);var n=r[0].match(D);if(n||h.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&C(t.name),t.inputs=z(n[2],!1),q(n[3].trim(),t),r.length>1){var i=r[1].match(D);""==i[1].trim()&&""==i[3].trim()||h.throwArgumentError("unexpected tokens","value",e),t.outputs=z(i[2],!1)}else t.outputs=[];return o.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),o}(E);function N(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||h.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}t.FunctionFragment=S;var _=function(e){(0,n.default)(o,e);var t=d(o);function o(){return(0,s.default)(this,o),t.apply(this,arguments)}return(0,c.default)(o,[{key:"format",value:function(e){if(e||(e=k.sighash),k[e]||h.throwArgumentError("invalid format type","format",e),e===k.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==k.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===k.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"==typeof e?o.fromString(e):o.fromObject(e)}},{key:"fromObject",value:function(e){if(o.isErrorFragment(e))return e;"error"!==e.type&&h.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:C(e.name),inputs:e.inputs?e.inputs.map(x.fromObject):[]};return N(new o(p,t))}},{key:"fromString",value:function(e){var t={type:"error"},r=e.match(D);return r||h.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&C(t.name),t.inputs=z(r[2],!1),N(o.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),o}(j);function T(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}t.ErrorFragment=_;var O=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function C(e){return e&&e.match(O)||h.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var D=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},2914:function(e,t,o){"use strict";Object.defineProperty(t,"RQ",{enumerable:!0,get:function(){return n.AbiCoder}}),Object.defineProperty(t,"_R",{enumerable:!0,get:function(){return r.ParamType}});var r=o(800),n=o(4937);o(9044)},9044:function(e,t,o){"use strict";var r=o(8847);Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionDescription=t.LogDescription=t.Interface=t.Indexed=t.ErrorDescription=void 0,Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return g.checkResultErrors}});var n=r(o(8985)),i=r(o(9721)),a=r(o(5163)),s=r(o(4650)),c=r(o(1949)),u=o(7921),l=o(4952),m=o(908),f=o(7515),d=o(4642),h=o(3694),p=o(4937),g=o(7316),b=o(800),y=o(4327),v=o(8067);function k(e){var t=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(e){return!1}}();return function(){var o,r=(0,c.default)(e);if(t){var n=(0,c.default)(this).constructor;o=Reflect.construct(r,arguments,n)}else o=r.apply(this,arguments);return(0,s.default)(this,o)}}var w=new y.Logger(v.version),x=function(e){(0,a.default)(o,e);var t=k(o);function o(){return(0,i.default)(this,o),t.apply(this,arguments)}return(0,n.default)(o)}(h.Description);t.LogDescription=x;var z=function(e){(0,a.default)(o,e);var t=k(o);function o(){return(0,i.default)(this,o),t.apply(this,arguments)}return(0,n.default)(o)}(h.Description);t.TransactionDescription=z;var j=function(e){(0,a.default)(o,e);var t=k(o);function o(){return(0,i.default)(this,o),t.apply(this,arguments)}return(0,n.default)(o)}(h.Description);t.ErrorDescription=j;var M=function(e){(0,a.default)(o,e);var t=k(o);function o(){return(0,i.default)(this,o),t.apply(this,arguments)}return(0,n.default)(o,null,[{key:"isIndexed",value:function(e){return!(!e||!e._isIndexed)}}]),o}(h.Description);t.Indexed=M;var A={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function q(e,t){var o=new Error("deferred error during ABI decoding triggered accessing ".concat(e));return o.error=t,o}var I=function(){function e(t){var o=this;(0,i.default)(this,e);var r=[];r="string"==typeof t?JSON.parse(t):t,(0,h.defineReadOnly)(this,"fragments",r.map((function(e){return b.Fragment.from(e)})).filter((function(e){return null!=e}))),(0,h.defineReadOnly)(this,"_abiCoder",(0,h.getStatic)(this instanceof e?this.constructor:void 0,"getAbiCoder")()),(0,h.defineReadOnly)(this,"functions",{}),(0,h.defineReadOnly)(this,"errors",{}),(0,h.defineReadOnly)(this,"events",{}),(0,h.defineReadOnly)(this,"structs",{}),this.fragments.forEach((function(e){var t=null;switch(e.type){case"constructor":return o.deploy?void w.warn("duplicate definition - constructor"):void(0,h.defineReadOnly)(o,"deploy",e);case"function":t=o.functions;break;case"event":t=o.events;break;case"error":t=o.errors;break;default:return}var r=e.format();t[r]?w.warn("duplicate definition - "+r):t[r]=e})),this.deploy||(0,h.defineReadOnly)(this,"deploy",b.ConstructorFragment.from({payable:!1,type:"constructor"})),(0,h.defineReadOnly)(this,"_isInterface",!0)}return(0,n.default)(e,[{key:"format",value:function(e){e||(e=b.FormatTypes.full),e===b.FormatTypes.sighash&&w.throwArgumentError("interface does not support formatting sighash","format",e);var t=this.fragments.map((function(t){return t.format(e)}));return e===b.FormatTypes.json?JSON.stringify(t.map((function(e){return JSON.parse(e)}))):t}},{key:"getFunction",value:function(e){if((0,m.isHexString)(e)){for(var t in this.functions)if(e===this.getSighash(t))return this.functions[t];w.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){var o=e.trim(),r=Object.keys(this.functions).filter((function(e){return e.split("(")[0]===o}));return 0===r.length?w.throwArgumentError("no matching function","name",o):r.length>1&&w.throwArgumentError("multiple matching functions","name",o),this.functions[r[0]]}var n=this.functions[b.FunctionFragment.fromString(e).format()];return n||w.throwArgumentError("no matching function","signature",e),n}},{key:"getEvent",value:function(e){if((0,m.isHexString)(e)){var t=e.toLowerCase();for(var o in this.events)if(t===this.getEventTopic(o))return this.events[o];w.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var r=e.trim(),n=Object.keys(this.events).filter((function(e){return e.split("(")[0]===r}));return 0===n.length?w.throwArgumentError("no matching event","name",r):n.length>1&&w.throwArgumentError("multiple matching events","name",r),this.events[n[0]]}var i=this.events[b.EventFragment.fromString(e).format()];return i||w.throwArgumentError("no matching event","signature",e),i}},{key:"getError",value:function(e){if((0,m.isHexString)(e)){var t=(0,h.getStatic)(this.constructor,"getSighash");for(var o in this.errors)if(e===t(this.errors[o]))return this.errors[o];w.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var r=e.trim(),n=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===r}));return 0===n.length?w.throwArgumentError("no matching error","name",r):n.length>1&&w.throwArgumentError("multiple matching errors","name",r),this.errors[n[0]]}var i=this.errors[b.FunctionFragment.fromString(e).format()];return i||w.throwArgumentError("no matching error","signature",e),i}},{key:"getSighash",value:function(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return(0,h.getStatic)(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"==typeof e&&(e=this.getEvent(e)),(0,h.getStatic)(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"==typeof e&&(e=this.getError(e));var o=(0,m.arrayify)(t);return(0,m.hexlify)(o.slice(0,4))!==this.getSighash(e)&&w.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",(0,m.hexlify)(o)),this._decodeParams(e.inputs,o.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"==typeof e&&(e=this.getError(e)),(0,m.hexlify)((0,m.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e));var o=(0,m.arrayify)(t);return(0,m.hexlify)(o.slice(0,4))!==this.getSighash(e)&&w.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",(0,m.hexlify)(o)),this._decodeParams(e.inputs,o.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,m.hexlify)((0,m.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e));var o=(0,m.arrayify)(t),r=null,n="",i=null,a=null,s=null;switch(o.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,o)}catch(l){}break;case 4:var c=(0,m.hexlify)(o.slice(0,4)),u=A[c];if(u)i=this._abiCoder.decode(u.inputs,o.slice(4)),a=u.name,s=u.signature,u.reason&&(r=i[0]),"Error"===a?n="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(i[0])):"Panic"===a&&(n="; VM Exception while processing transaction: reverted with panic code ".concat(i[0]));else try{var l=this.getError(c);i=this._abiCoder.decode(l.inputs,o.slice(4)),a=l.name,s=l.format()}catch(l){}}return w.throwError("call revert exception"+n,y.Logger.errors.CALL_EXCEPTION,{method:e.format(),data:(0,m.hexlify)(t),errorArgs:i,errorName:a,errorSignature:s,reason:r})}},{key:"encodeFunctionResult",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,m.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var o=this;"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&w.throwError("too many arguments for "+e.format(),y.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});var r=[];e.anonymous||r.push(this.getEventTopic(e));var n=function(e,t){return"string"===e.type?(0,f.id)(t):"bytes"===e.type?(0,d.keccak256)((0,m.hexlify)(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=l.BigNumber.from(t).toHexString()),"address"===e.type&&o._abiCoder.encode(["address"],[t]),(0,m.hexZeroPad)((0,m.hexlify)(t),32))};for(t.forEach((function(t,o){var i=e.inputs[o];i.indexed?null==t?r.push(null):"array"===i.baseType||"tuple"===i.baseType?w.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?r.push(t.map((function(e){return n(i,e)}))):r.push(n(i,t)):null!=t&&w.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}},{key:"encodeEventLog",value:function(e,t){var o=this;"string"==typeof e&&(e=this.getEvent(e));var r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&w.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,a){var s=t[a];if(e.indexed)if("string"===e.type)r.push((0,f.id)(s));else if("bytes"===e.type)r.push((0,d.keccak256)(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(o._abiCoder.encode([e.type],[s]))}else n.push(e),i.push(s)})),{data:this._abiCoder.encode(n,i),topics:r}}},{key:"decodeEventLog",value:function(e,t,o){if("string"==typeof e&&(e=this.getEvent(e)),null!=o&&!e.anonymous){var r=this.getEventTopic(e);(0,m.isHexString)(o[0],32)&&o[0].toLowerCase()===r||w.throwError("fragment/topic mismatch",y.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:r,value:o[0]}),o=o.slice(1)}var n=[],i=[],a=[];e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(b.ParamType.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(n.push(e),a.push(!1)):(i.push(e),a.push(!1))}));var s=null!=o?this._abiCoder.decode(n,(0,m.concat)(o)):null,c=this._abiCoder.decode(i,t,!0),u=[],l=0,f=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==s)u[t]=new M({_isIndexed:!0,hash:null});else if(a[t])u[t]=new M({_isIndexed:!0,hash:s[f++]});else try{u[t]=s[f++]}catch(e){u[t]=e}else try{u[t]=c[l++]}catch(e){u[t]=e}if(e.name&&null==u[e.name]){var o=u[t];o instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:function(){throw q("property ".concat(JSON.stringify(e.name)),o)}}):u[e.name]=o}}));for(var d=function(e){var t=u[e];t instanceof Error&&Object.defineProperty(u,e,{enumerable:!0,get:function(){throw q("index ".concat(e),t)}})},h=0;h>1]>>4>=8&&(t[s]=t[s].toUpperCase()),(15&a[s>>1])>=8&&(t[s+1]=t[s+1].toUpperCase());return"0x"+t.join("")}for(var m={},f=0;f<10;f++)m[String(f)]=String(f);for(var d=0;d<26;d++)m[String.fromCharCode(65+d)]=String(10+d);var h,p=Math.floor((h=9007199254740991,Math.log10?Math.log10(h):Math.log(h)/Math.LN10));function g(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return m[e]})).join("");t.length>=p;){var o=t.substring(0,p);t=parseInt(o,10)%97+t.substring(o.length)}for(var r=String(98-parseInt(t,10)%97);r.length<2;)r="0"+r;return r}function b(e){var t=null;if("string"!=typeof e&&u.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=l(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==g(e)&&u.throwArgumentError("bad icap checksum","address",e),t=(0,n._base36To16)(e.substring(4));t.length<40;)t="0"+t;t=l("0x"+t)}else u.throwArgumentError("invalid address","address",e);return t}},5798:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){e=atob(e);for(var t=[],o=0;o0&&(10===arguments[0]?h||(h=!0,m.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?m.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",c.Logger.errors.UNEXPECTED_ARGUMENT,{}):m.throwError("BigNumber.toString does not accept parameters",c.Logger.errors.UNEXPECTED_ARGUMENT,{})),y(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}],[{key:"from",value:function(t){if(t instanceof e)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(f,g(t)):t.match(/^-?[0-9]+$/)?new e(f,g(new l(t))):m.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&v("underflow","BigNumber.from",t),(t>=d||t<=-d)&&v("overflow","BigNumber.from",t),e.from(String(t));var o=t;if("bigint"==typeof o)return e.from(o.toString());if((0,s.isBytes)(o))return e.from((0,s.hexlify)(o));if(o)if(o.toHexString){var r=o.toHexString();if("string"==typeof r)return e.from(r)}else{var n=o._hex;if(null==n&&"BigNumber"===o.type&&(n=o.hex),"string"==typeof n&&((0,s.isHexString)(n)||"-"===n[0]&&(0,s.isHexString)(n.substring(1))))return e.from(n)}return m.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}]),e}();function g(e){if("string"!=typeof e)return g(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&m.throwArgumentError("invalid hex","value",e),"0x00"===(e=g(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function b(e){return p.from(g(e))}function y(e){var t=p.from(e).toHexString();return"-"===t[0]?new l("-"+t.substring(3),16):new l(t.substring(2),16)}function v(e,t,o){var r={fault:e,operation:t};return null!=o&&(r.value=o),m.throwError(e,c.Logger.errors.NUMERIC_FAULT,r)}t.BigNumber=p},8390:function(e,t,o){"use strict";var r=o(8847);Object.defineProperty(t,"__esModule",{value:!0}),t.FixedNumber=t.FixedFormat=void 0,t.formatFixed=y,t.parseFixed=v;var n=r(o(3355)),i=r(o(9721)),a=r(o(8985)),s=o(908),c=o(4327),u=o(3042),l=o(1872),m=new c.Logger(u.version),f={},d=l.BigNumber.from(0),h=l.BigNumber.from(-1);function p(e,t,o,r){var n={fault:t,operation:o};return void 0!==r&&(n.value=r),m.throwError(e,c.Logger.errors.NUMERIC_FAULT,n)}for(var g="0";g.length<256;)g+=g;function b(e){if("number"!=typeof e)try{e=l.BigNumber.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+g.substring(0,e):m.throwArgumentError("invalid decimal size","decimals",e)}function y(e,t){null==t&&(t=0);var o=b(t),r=(e=l.BigNumber.from(e)).lt(d);r&&(e=e.mul(h));for(var n=e.mod(o).toString();n.length2&&m.throwArgumentError("too many decimal points","value",e);var i=n[0],a=n[1];for(i||(i="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>o.length-1&&p("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length80&&m.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new e(f,o,r,i)}}]),e}();t.FixedFormat=k;var w=function(){function e(t,o,r,n){(0,i.default)(this,e),t!==f&&m.throwError("cannot use FixedNumber constructor; use FixedNumber.from",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=o,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}return(0,a.default)(e,[{key:"_checkFormat",value:function(e){this.format.name!==e.format.name&&m.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}},{key:"addUnsafe",value:function(t){this._checkFormat(t);var o=v(this._value,this.format.decimals),r=v(t._value,t.format.decimals);return e.fromValue(o.add(r),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(t){this._checkFormat(t);var o=v(this._value,this.format.decimals),r=v(t._value,t.format.decimals);return e.fromValue(o.sub(r),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(t){this._checkFormat(t);var o=v(this._value,this.format.decimals),r=v(t._value,t.format.decimals);return e.fromValue(o.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(t){this._checkFormat(t);var o=v(this._value,this.format.decimals),r=v(t._value,t.format.decimals);return e.fromValue(o.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}},{key:"floor",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var o=e.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(o=o.subUnsafe(x.toFormat(o.format))),o}},{key:"ceiling",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var o=e.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(o=o.addUnsafe(x.toFormat(o.format))),o}},{key:"round",value:function(t){null==t&&(t=0);var o=this.toString().split(".");if(1===o.length&&o.push("0"),(t<0||t>80||t%1)&&m.throwArgumentError("invalid decimal count","decimals",t),o[1].length<=t)return this;var r=e.from("1"+g.substring(0,t),this.format),n=z.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(e){if(null==e)return this._hex;e%8&&m.throwArgumentError("invalid byte width","width",e);var t=l.BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,s.hexZeroPad)(t,e/8)}},{key:"toUnsafeFloat",value:function(){return parseFloat(this.toString())}},{key:"toFormat",value:function(t){return e.fromString(this._value,t)}}],[{key:"fromValue",value:function(t,o,r){return null!=r||null==o||(0,l.isBigNumberish)(o)||(r=o,o=null),null==o&&(o=0),null==r&&(r="fixed"),e.fromString(y(t,o),k.from(r))}},{key:"fromString",value:function(t,o){null==o&&(o="fixed");var r=k.from(o),n=v(t,r.decimals);!r.signed&&n.lt(d)&&p("unsigned value cannot be negative","overflow","value",t);var i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=(0,s.hexZeroPad)(i,r.width/8));var a=y(n,r.decimals);return new e(f,i,a,r)}},{key:"fromBytes",value:function(t,o){null==o&&(o="fixed");var r=k.from(o);if((0,s.arrayify)(t).length>r.width/8)throw new Error("overflow");var n=l.BigNumber.from(t);r.signed&&(n=n.fromTwos(r.width));var i=n.toTwos((r.signed?0:1)+r.width).toHexString(),a=y(n,r.decimals);return new e(f,i,a,r)}},{key:"from",value:function(t,o){if("string"==typeof t)return e.fromString(t,o);if((0,s.isBytes)(t))return e.fromBytes(t,o);try{return e.fromValue(t,0,o)}catch(e){if(e.code!==c.Logger.errors.INVALID_ARGUMENT)throw e}return m.throwArgumentError("invalid FixedNumber value","value",t)}},{key:"isFixedNumber",value:function(e){return!(!e||!e._isFixedNumber)}}]),e}();t.FixedNumber=w;var x=w.from(1),z=w.from("0.5")},4952:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BigNumber",{enumerable:!0,get:function(){return r.BigNumber}}),Object.defineProperty(t,"FixedFormat",{enumerable:!0,get:function(){return n.FixedFormat}}),Object.defineProperty(t,"FixedNumber",{enumerable:!0,get:function(){return n.FixedNumber}}),Object.defineProperty(t,"_base16To36",{enumerable:!0,get:function(){return r._base16To36}}),Object.defineProperty(t,"_base36To16",{enumerable:!0,get:function(){return r._base36To16}}),Object.defineProperty(t,"formatFixed",{enumerable:!0,get:function(){return n.formatFixed}}),Object.defineProperty(t,"parseFixed",{enumerable:!0,get:function(){return n.parseFixed}});var r=o(1872),n=o(8390)},8729:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="bytes/5.7.0"},908:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayify=m,t.concat=f,t.hexConcat=function(e){var t="0x";return e.forEach((function(e){t+=g(e).substring(2)})),t},t.hexDataLength=function(e){if("string"!=typeof e)e=g(e);else if(!h(e)||e.length%2)return null;return(e.length-2)/2},t.hexDataSlice=function(e,t,o){return"string"!=typeof e?e=g(e):(!h(e)||e.length%2)&&i.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=o?"0x"+e.substring(t,2+2*o):"0x"+e.substring(t)},t.hexStripZeros=b,t.hexValue=function(e){var t=b(g(e,{hexPad:"left"}));return"0x"===t?"0x0":t},t.hexZeroPad=y,t.hexlify=g,t.isBytes=l,t.isBytesLike=c,t.isHexString=h,t.joinSignature=function(e){return g(f([(e=v(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))},t.splitSignature=v,t.stripZeros=function(e){var t=m(e);if(0===t.length)return t;for(var o=0;o=256)return!1}return!0}function m(e,t){if(t||(t={}),"number"==typeof e){i.checkSafeUint53(e,"invalid arrayify value");for(var o=[];e;)o.unshift(255&e),e=parseInt(String(e/256));return 0===o.length&&o.push(0),s(new Uint8Array(o))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),a(e)&&(e=e.toHexString()),h(e)){var r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":i.throwArgumentError("hex data is odd-length","value",e));for(var n=[],c=0;ct&&i.throwArgumentError("value out of range","value",arguments[0]);var o=new Uint8Array(t);return o.set(e,t-e.length),s(o)}function h(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}var p="0123456789abcdef";function g(e,t){if(t||(t={}),"number"==typeof e){i.checkSafeUint53(e,"invalid hexlify value");for(var o="";e;)o=p[15&e]+o,e=Math.floor(e/16);return o.length?(o.length%2&&(o="0"+o),"0x"+o):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),a(e))return e.toHexString();if(h(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":i.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(l(e)){for(var r="0x",n=0;n>4]+p[15&s]}return r}return i.throwArgumentError("invalid hexlify value","value",e)}function b(e){"string"!=typeof e&&(e=g(e)),h(e)||i.throwArgumentError("invalid hex string","value",e),e=e.substring(2);for(var t=0;t2*t+2&&i.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function v(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(c(e)){var o=m(e);64===o.length?(t.v=27+(o[32]>>7),o[32]&=127,t.r=g(o.slice(0,32)),t.s=g(o.slice(32,64))):65===o.length?(t.r=g(o.slice(0,32)),t.s=g(o.slice(32,64)),t.v=o[64]):i.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:i.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(o[32]|=128),t._vs=g(o.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){var r=d(m(t._vs),32);t._vs=g(r);var n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&i.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;var a=g(r);null==t.s?t.s=a:t.s!==a&&i.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?i.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{var s=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==s&&i.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&h(t.r)?t.r=y(t.r,32):i.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&h(t.s)?t.s=y(t.s,32):i.throwArgumentError("signature missing or invalid s","signature",e);var u=m(t.s);u[0]>=128&&i.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(u[0]|=128);var l=g(u);t._vs&&(h(t._vs)||i.throwArgumentError("signature invalid _vs","signature",e),t._vs=y(t._vs,32)),null==t._vs?t._vs=l:t._vs!==l&&i.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}},8721:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddressZero=void 0,t.AddressZero="0x0000000000000000000000000000000000000000"},2997:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Zero=t.WeiPerEther=t.Two=t.One=t.NegativeOne=t.MinInt256=t.MaxUint256=t.MaxInt256=void 0;var r=o(4952),n=r.BigNumber.from(-1);t.NegativeOne=n;var i=r.BigNumber.from(0);t.Zero=i;var a=r.BigNumber.from(1);t.One=a;var s=r.BigNumber.from(2);t.Two=s;var c=r.BigNumber.from("1000000000000000000");t.WeiPerEther=c;var u=r.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");t.MaxUint256=u;var l=r.BigNumber.from("-0x8000000000000000000000000000000000000000000000000000000000000000");t.MinInt256=l;var m=r.BigNumber.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");t.MaxInt256=m},396:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HashZero=void 0,t.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000"},5465:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AddressZero",{enumerable:!0,get:function(){return r.AddressZero}}),Object.defineProperty(t,"EtherSymbol",{enumerable:!0,get:function(){return a.EtherSymbol}}),Object.defineProperty(t,"HashZero",{enumerable:!0,get:function(){return i.HashZero}}),Object.defineProperty(t,"MaxInt256",{enumerable:!0,get:function(){return n.MaxInt256}}),Object.defineProperty(t,"MaxUint256",{enumerable:!0,get:function(){return n.MaxUint256}}),Object.defineProperty(t,"MinInt256",{enumerable:!0,get:function(){return n.MinInt256}}),Object.defineProperty(t,"NegativeOne",{enumerable:!0,get:function(){return n.NegativeOne}}),Object.defineProperty(t,"One",{enumerable:!0,get:function(){return n.One}}),Object.defineProperty(t,"Two",{enumerable:!0,get:function(){return n.Two}}),Object.defineProperty(t,"WeiPerEther",{enumerable:!0,get:function(){return n.WeiPerEther}}),Object.defineProperty(t,"Zero",{enumerable:!0,get:function(){return n.Zero}});var r=o(8721),n=o(2997),i=o(396),a=o(8347)},8347:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EtherSymbol=void 0,t.EtherSymbol="\u039e"},3989:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="hash/5.7.0"},3731:function(e,t){"use strict";function o(e,t){null==t&&(t=1);var o=[],r=o.forEach;return function e(t,n){r.call(t,(function(t){n>0&&Array.isArray(t)?e(t,n-1):o.push(t)}))}(e,t),o}function r(e){var t=0;function o(){return e[t++]<<8|e[t++]}for(var r=o(),n=1,i=[0,1],a=1;a>--u&1}for(var f=Math.pow(2,31),d=f>>>1,h=d>>1,p=f-1,g=0,b=0;b<31;b++)g=g<<1|m();for(var y=[],v=0,k=f;;){for(var w=Math.floor(((g-v+1)*n-1)/k),x=0,z=r;z-x>1;){var j=x+z>>>1;w>>1|m(),M=M<<1^d,A=(A^d)<<1|d|1;v=M,k=1+A-M}var q=r-4;return y.map((function(t){switch(t-q){case 3:return q+65792+(e[c++]<<16|e[c++]<<8|e[c++]);case 2:return q+256+(e[c++]<<8|e[c++]);case 1:return q+e[c++];default:return t-1}}))}function n(e){var t=0;return function(){return e[t++]}}function i(e){return 1&e?~e>>1:e>>1}function a(e,t){for(var o=Array(e),r=0,n=-1;r>=1),check:2==i}}()},t.read_mapped_map=function(e){for(var t=[];;){var r=e();if(0==r)break;t.push(m(r,e))}for(;;){var n=e()-1;if(n<0)break;t.push(f(n,e))}return function(e){for(var t={},o=0;oe.length)&&(t=e.length);for(var o=0,r=new Array(t);o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==o.return||o.return()}finally{if(s)throw i}}}}(e.split("."));try{for(o.s();!(t=o.n()).done;){var r=t.value,n=g(r);try{for(var i=n.lastIndexOf(p)-1;i>=0;i--)if(n[i]!==p)throw new Error("underscore only allowed at start");if(n.length>=4&&n.every((function(e){return e<128}))&&n[2]===h&&n[3]===h)throw new Error("invalid label extension")}catch(e){throw new Error('Invalid label "'.concat(r,'": ').concat(e.message))}}}catch(e){o.e(e)}finally{o.f()}return e}function v(e,t){var o,r,i,a=d,s=[],c=e.length;t&&(t.length=0);for(var u=function(){var u=e[--c];if(!(a=null===(o=a.branches.find((function(e){return e.set.has(u)})))||void 0===o?void 0:o.node))return"break";if(a.save)i=u;else if(a.check&&u===i)return"break";s.push(u),a.fe0f&&(s.push(65039),c>0&&65039==e[c-1]&&c--),a.valid&&(r=s.slice(),2==a.valid&&r.splice(1,1),t&&t.push.apply(t,(0,n.default)(e.slice(c).reverse())),e.length=c)};c&&"break"!==u(););return r}},7901:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.id=function(e){return(0,r.keccak256)((0,n.toUtf8Bytes)(e))};var r=o(4642),n=o(8627)},7515:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return a.TypedDataEncoder}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return n.dnsEncode}}),Object.defineProperty(t,"ensNormalize",{enumerable:!0,get:function(){return n.ensNormalize}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return i.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return r.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return n.isValidName}}),Object.defineProperty(t,"messagePrefix",{enumerable:!0,get:function(){return i.messagePrefix}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return n.namehash}});var r=o(7901),n=o(4898),i=o(4443),a=o(2171)},4443:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hashMessage=function(e){return"string"==typeof e&&(e=(0,i.toUtf8Bytes)(e)),(0,n.keccak256)((0,r.concat)([(0,i.toUtf8Bytes)(a),(0,i.toUtf8Bytes)(String(e.length)),e]))},t.messagePrefix=void 0;var r=o(908),n=o(4642),i=o(8627),a="\x19Ethereum Signed Message:\n";t.messagePrefix=a},4898:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dnsEncode=function(e){return(0,r.hexlify)((0,r.concat)(f(e).map((function(e){if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");var t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"},t.ensNormalize=function(e){return f(e).map((function(e){return(0,n.toUtf8String)(e)})).join(".")},t.isValidName=function(e){try{return 0!==f(e).length}catch(e){}return!1},t.namehash=function(e){"string"!=typeof e&&u.throwArgumentError("invalid ENS name; not a string","name",e);for(var t=l,o=f(e);o.length;)t=(0,i.keccak256)((0,r.concat)([t,(0,i.keccak256)(o.pop())]));return(0,r.hexlify)(t)};var r=o(908),n=o(8627),i=o(4642),a=o(4327),s=o(3989),c=o(7032),u=new a.Logger(s.version),l=new Uint8Array(32);function m(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function f(e){var t=(0,n.toUtf8Bytes)((0,c.ens_normalize)(e)),o=[];if(0===e.length)return o;for(var r=0,i=0;i=t.length)throw new Error("invalid ENS name; empty component");return o.push(m(t.slice(r))),o}l.fill(0)},2171:function(e,t,o){"use strict";var r=o(8847);Object.defineProperty(t,"__esModule",{value:!0}),t.TypedDataEncoder=void 0;var n=r(o(2247)),i=r(o(9721)),a=r(o(8985)),s=o(7921),c=o(4952),u=o(908),l=o(4642),m=o(3694),f=o(4327),d=o(3989),h=o(7901),p=new f.Logger(d.version),g=new Uint8Array(32);g.fill(0);var b=c.BigNumber.from(-1),y=c.BigNumber.from(0),v=c.BigNumber.from(1),k=c.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),w=(0,u.hexZeroPad)(v.toHexString(),32),x=(0,u.hexZeroPad)(y.toHexString(),32),z={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},j=["name","version","chainId","verifyingContract","salt"];function M(e){return function(t){return"string"!=typeof t&&p.throwArgumentError("invalid domain value for ".concat(JSON.stringify(e)),"domain.".concat(e),t),t}}var A={name:M("name"),version:M("version"),chainId:function(e){try{return c.BigNumber.from(e).toString()}catch(e){}return p.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return(0,s.getAddress)(e).toLowerCase()}catch(e){}return p.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{var t=(0,u.arrayify)(e);if(32!==t.length)throw new Error("bad length");return(0,u.hexlify)(t)}catch(e){}return p.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function q(e){var t=e.match(/^(u?)int(\d*)$/);if(t){var o=""===t[1],r=parseInt(t[2]||"256");(r%8!=0||r>256||t[2]&&t[2]!==String(r))&&p.throwArgumentError("invalid numeric width","type",e);var n=k.mask(o?r-1:r),i=o?n.add(v).mul(b):y;return function(t){var o=c.BigNumber.from(t);return(o.lt(i)||o.gt(n))&&p.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),(0,u.hexZeroPad)(o.toTwos(256).toHexString(),32)}}var a=e.match(/^bytes(\d+)$/);if(a){var m=parseInt(a[1]);return(0===m||m>32||a[1]!==String(m))&&p.throwArgumentError("invalid bytes width","type",e),function(t){return(0,u.arrayify)(t).length!==m&&p.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=(0,u.arrayify)(e),o=t.length%32;return o?(0,u.hexConcat)([t,g.slice(o)]):(0,u.hexlify)(t)}(t)}}switch(e){case"address":return function(e){return(0,u.hexZeroPad)((0,s.getAddress)(e),32)};case"bool":return function(e){return e?w:x};case"bytes":return function(e){return(0,l.keccak256)(e)};case"string":return function(e){return(0,h.id)(e)}}return null}function I(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var E=function(){function e(t){(0,i.default)(this,e),(0,m.defineReadOnly)(this,"types",Object.freeze((0,m.deepCopy)(t))),(0,m.defineReadOnly)(this,"_encoderCache",{}),(0,m.defineReadOnly)(this,"_types",{});var o={},r={},n={};Object.keys(t).forEach((function(e){o[e]={},r[e]=[],n[e]={}}));var a=function(e){var n={};t[e].forEach((function(i){n[i.name]&&p.throwArgumentError("duplicate variable name ".concat(JSON.stringify(i.name)," in ").concat(JSON.stringify(e)),"types",t),n[i.name]=!0;var a=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===e&&p.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),q(a)||(r[a]||p.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",t),r[a].push(e),o[e][a]=!0)}))};for(var s in t)a(s);var c=Object.keys(r).filter((function(e){return 0===r[e].length}));for(var u in 0===c.length?p.throwArgumentError("missing primary type","types",t):c.length>1&&p.throwArgumentError("ambiguous primary types or unused types: ".concat(c.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),(0,m.defineReadOnly)(this,"primaryType",c[0]),function e(i,a){a[i]&&p.throwArgumentError("circular type reference to ".concat(JSON.stringify(i)),"types",t),a[i]=!0,Object.keys(o[i]).forEach((function(t){r[t]&&(e(t,a),Object.keys(a).forEach((function(e){n[e][t]=!0})))})),delete a[i]}(this.primaryType,{}),n){var l=Object.keys(n[u]);l.sort(),this._types[u]=I(u,t[u])+l.map((function(e){return I(e,t[e])})).join("")}}return(0,a.default)(e,[{key:"getEncoder",value:function(e){var t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,o=q(e);if(o)return o;var r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){var n=r[1],i=this.getEncoder(n),a=parseInt(r[3]);return function(e){a>=0&&e.length!==a&&p.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var o=e.map(i);return t._types[n]&&(o=o.map(l.keccak256)),(0,l.keccak256)((0,u.hexConcat)(o))}}var s=this.types[e];if(s){var c=(0,h.id)(this._types[e]);return function(e){var o=s.map((function(o){var r=o.name,n=o.type,i=t.getEncoder(n)(e[r]);return t._types[n]?(0,l.keccak256)(i):i}));return o.unshift(c),(0,u.hexConcat)(o)}}return p.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||p.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return(0,l.keccak256)(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,o){var r=this;if(q(e))return o(e,t);var n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var i=n[1],a=parseInt(n[3]);return a>=0&&t.length!==a&&p.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return r._visit(i,e,o)}))}var s=this.types[e];return s?s.reduce((function(e,n){var i=n.name,a=n.type;return e[i]=r._visit(a,t[i],o),e}),{}):p.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}],[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,o,r){return e.from(o).hashStruct(t,r)}},{key:"hashDomain",value:function(t){var o=[];for(var r in t){var n=z[r];n||p.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(r)),"domain",t),o.push({name:r,type:n})}return o.sort((function(e,t){return j.indexOf(e.name)-j.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:o},t)}},{key:"encode",value:function(t,o,r){return(0,u.hexConcat)(["0x1901",e.hashDomain(t),e.from(o).hash(r)])}},{key:"hash",value:function(t,o,r){return(0,l.keccak256)(e.encode(t,o,r))}},{key:"resolveNames",value:function(t,o,r,i){return a=this,s=void 0,c=void 0,l=n.default.mark((function a(){var s,c,l;return n.default.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:t=(0,m.shallowCopy)(t),s={},t.verifyingContract&&!(0,u.isHexString)(t.verifyingContract,20)&&(s[t.verifyingContract]="0x"),(c=e.from(o)).visit(r,(function(e,t){return"address"!==e||(0,u.isHexString)(t,20)||(s[t]="0x"),t})),a.t0=n.default.keys(s);case 6:if((a.t1=a.t0()).done){a.next=13;break}return l=a.t1.value,a.next=10,i(l);case 10:s[l]=a.sent,a.next=6;break;case 13:return t.verifyingContract&&s[t.verifyingContract]&&(t.verifyingContract=s[t.verifyingContract]),r=c.visit(r,(function(e,t){return"address"===e&&s[t]?s[t]:t})),a.abrupt("return",{domain:t,value:r});case 16:case"end":return a.stop()}}),a)})),new(c||(c=Promise))((function(e,t){function o(e){try{n(l.next(e))}catch(e){t(e)}}function r(e){try{n(l.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof c?n:new c((function(e){e(n)}))).then(o,r)}n((l=l.apply(a,s||[])).next())}));var a,s,c,l}},{key:"getPayload",value:function(t,o,r){e.hashDomain(t);var n={},i=[];j.forEach((function(e){var o=t[e];null!=o&&(n[e]=A[e](o),i.push({name:e,type:z[e]}))}));var a=e.from(o),s=(0,m.shallowCopy)(o);return s.EIP712Domain?p.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",o):s.EIP712Domain=i,a.encode(r),{types:s,domain:n,primaryType:a.primaryType,message:a.visit(r,(function(e,t){if(e.match(/^bytes(\d*)/))return(0,u.hexlify)((0,u.arrayify)(t));if(e.match(/^u?int/))return c.BigNumber.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&p.throwArgumentError("invalid string","value",t),t}return p.throwArgumentError("unsupported type","type",e)}))}}}]),e}();t.TypedDataEncoder=E},4642:function(e,t,o){"use strict";var r=o(8847);Object.defineProperty(t,"__esModule",{value:!0}),t.keccak256=function(e){return"0x"+n.default.keccak_256((0,i.arrayify)(e))};var n=r(o(5975)),i=o(908)},5975:function(e,t,o){"use strict";e=o.nmd(e);var r,n=o(9142),i=o(8847)(o(3355));!function(){var a="input is invalid type",s="object"===("undefined"==typeof window?"undefined":(0,i.default)(window)),c=s?window:{};c.JS_SHA3_NO_WINDOW&&(s=!1);var u=!s&&"object"===("undefined"==typeof self?"undefined":(0,i.default)(self));!c.JS_SHA3_NO_NODE_JS&&"object"===(void 0===n?"undefined":(0,i.default)(n))&&n.versions&&n.versions.node?c=o.g:u&&(c=self);var l=!c.JS_SHA3_NO_COMMON_JS&&"object"===(0,i.default)(e)&&e.exports,m=o.amdO,f=!c.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),h=[4,1024,262144,67108864],p=[0,8,16,24],g=[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],y=[128,256],v=["hex","buffer","arrayBuffer","array","digest"],k={128:168,256:136};!c.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!f||!c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===(0,i.default)(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var w=function(e,t,o){return function(r){return new D(e,t,e).update(r)[o]()}},x=function(e,t,o){return function(r,n){return new D(e,t,n).update(r)[o]()}},z=function(e,t,o){return function(t,r,n,i){return I["cshake"+e].update(t,r,n,i)[o]()}},j=function(e,t,o){return function(t,r,n,i){return I["kmac"+e].update(t,r,n,i)[o]()}},M=function(e,t,o,r){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=o>>5,this.extraBytes=(31&o)>>3;for(var r=0;r<50;++r)this.s[r]=0}function L(e,t,o){D.call(this,e,t,o)}D.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,o=(0,i.default)(e);if("string"!==o){if("object"!==o)throw new Error(a);if(null===e)throw new Error(a);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||f&&ArrayBuffer.isView(e)))throw new Error(a);t=!0}for(var r,n,s=this.blocks,c=this.byteCount,u=e.length,l=this.blockCount,m=0,d=this.s;m>2]|=e[m]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=c){for(this.start=r-c,this.block=s[l],r=0;r>=8);o>0;)n.unshift(o),o=255&(e>>=8),++r;return t?n.push(r):n.unshift(r),this.update(n),n.length},D.prototype.encodeString=function(e){var t,o=(0,i.default)(e);if("string"!==o){if("object"!==o)throw new Error(a);if(null===e)throw new Error(a);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||f&&ArrayBuffer.isView(e)))throw new Error(a);t=!0}var r=0,n=e.length;if(t)r=n;else for(var s=0;s=57344?r+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++s)),r+=4)}return r+=this.encode(8*r),this.update(e),r},D.prototype.bytepad=function(e,t){for(var o=this.encode(t),r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[o],t=1;t>4&15]+d[15&e]+d[e>>12&15]+d[e>>8&15]+d[e>>20&15]+d[e>>16&15]+d[e>>28&15]+d[e>>24&15];a%t==0&&(P(o),i=0)}return n&&(e=o[i],s+=d[e>>4&15]+d[15&e],n>1&&(s+=d[e>>12&15]+d[e>>8&15]),n>2&&(s+=d[e>>20&15]+d[e>>16&15])),s},D.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,o=this.s,r=this.outputBlocks,n=this.extraBytes,i=0,a=0,s=this.outputBits>>3;e=n?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%o==0&&P(r)}return i&&(e=s<<2,t=r[a],c[e]=255&t,i>1&&(c[e+1]=t>>8&255),i>2&&(c[e+2]=t>>16&255)),c},L.prototype=new D,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),D.prototype.finalize.call(this)};var P=function(e){var t,o,r,n,i,a,s,c,u,l,m,f,d,h,p,b,y,v,k,w,x,z,j,M,A,q,I,E,S,N,_,T,O,C,D,L,P,R,B,U,F,Q,Y,H,G,W,Z,V,K,J,X,$,ee,te,oe,re,ne,ie,ae,se,ce,ue,le;for(r=0;r<48;r+=2)n=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],m=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),o=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=o,e[10]^=t,e[11]^=o,e[20]^=t,e[21]^=o,e[30]^=t,e[31]^=o,e[40]^=t,e[41]^=o,t=n^(c<<1|u>>>31),o=i^(u<<1|c>>>31),e[2]^=t,e[3]^=o,e[12]^=t,e[13]^=o,e[22]^=t,e[23]^=o,e[32]^=t,e[33]^=o,e[42]^=t,e[43]^=o,t=a^(l<<1|m>>>31),o=s^(m<<1|l>>>31),e[4]^=t,e[5]^=o,e[14]^=t,e[15]^=o,e[24]^=t,e[25]^=o,e[34]^=t,e[35]^=o,e[44]^=t,e[45]^=o,t=c^(f<<1|d>>>31),o=u^(d<<1|f>>>31),e[6]^=t,e[7]^=o,e[16]^=t,e[17]^=o,e[26]^=t,e[27]^=o,e[36]^=t,e[37]^=o,e[46]^=t,e[47]^=o,t=l^(n<<1|i>>>31),o=m^(i<<1|n>>>31),e[8]^=t,e[9]^=o,e[18]^=t,e[19]^=o,e[28]^=t,e[29]^=o,e[38]^=t,e[39]^=o,e[48]^=t,e[49]^=o,h=e[0],p=e[1],W=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,E=e[20]<<3|e[21]>>>29,S=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,Q=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,K=e[23]<<10|e[22]>>>22,N=e[33]<<13|e[32]>>>19,_=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,oe=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,P=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,k=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,T=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,M=e[6]<<28|e[7]>>>4,A=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,R=e[26]<<25|e[27]>>>7,B=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,x=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,q=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,U=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,z=e[48]<<14|e[49]>>>18,j=e[49]<<14|e[48]>>>18,e[0]=h^~b&v,e[1]=p^~y&k,e[10]=M^~q&E,e[11]=A^~I&S,e[20]=C^~L&R,e[21]=D^~P&B,e[30]=H^~W&V,e[31]=G^~Z&K,e[40]=te^~re&ie,e[41]=oe^~ne&ae,e[2]=b^~v&w,e[3]=y^~k&x,e[12]=q^~E&N,e[13]=I^~S&_,e[22]=L^~R&U,e[23]=P^~B&F,e[32]=W^~V&J,e[33]=Z^~K&X,e[42]=re^~ie&se,e[43]=ne^~ae&ce,e[4]=v^~w&z,e[5]=k^~x&j,e[14]=E^~N&T,e[15]=S^~_&O,e[24]=R^~U&Q,e[25]=B^~F&Y,e[34]=V^~J&$,e[35]=K^~X&ee,e[44]=ie^~se&ue,e[45]=ae^~ce&le,e[6]=w^~z&h,e[7]=x^~j&p,e[16]=N^~T&M,e[17]=_^~O&A,e[26]=U^~Q&C,e[27]=F^~Y&D,e[36]=J^~$&H,e[37]=X^~ee&G,e[46]=se^~ue&te,e[47]=ce^~le&oe,e[8]=z^~h&b,e[9]=j^~p&y,e[18]=T^~M&q,e[19]=O^~A&I,e[28]=Q^~C&L,e[29]=Y^~D&P,e[38]=$^~H&W,e[39]=ee^~G&Z,e[48]=ue^~te&re,e[49]=le^~oe&ne,e[0]^=g[r],e[1]^=g[r+1]};if(l)e.exports=I;else{for(S=0;Sm[o]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,o=new Array(t),r=0;r>4],o+=p[15&t[i]];n.push(e+"=Uint8Array(0x"+o+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push("code=".concat(o)),n.push("version=".concat(this.version));var a=t,s="";switch(o){case i.NUMERIC_FAULT:s="NUMERIC_FAULT";var c=t;switch(c){case"overflow":case"underflow":case"division-by-zero":s+="-"+c;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break;case i.CALL_EXCEPTION:case i.INSUFFICIENT_FUNDS:case i.MISSING_NEW:case i.NONCE_EXPIRED:case i.REPLACEMENT_UNDERPRICED:case i.TRANSACTION_REPLACED:case i.UNPREDICTABLE_GAS_LIMIT:s=o}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(t+=" ("+n.join(", ")+")");var u=new Error(t);return u.reason=a,u.code=o,Object.keys(r).forEach((function(e){u[e]=r[e]})),u}},{key:"throwError",value:function(e,t,o){throw this.makeError(e,t,o)}},{key:"throwArgumentError",value:function(t,o,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:o,value:r})}},{key:"assert",value:function(e,t,o,r){e||this.throwError(t,o,r)}},{key:"assertArgument",value:function(e,t,o,r){e||this.throwArgumentError(t,o,r)}},{key:"checkNormalize",value:function(t){null==t&&(t="platform missing String.prototype.normalize"),h&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:h})}},{key:"checkSafeUint53",value:function(t,o){"number"==typeof t&&(null==o&&(o="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(o,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(o,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,o,r){r=r?": "+r:"",to&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:o})}},{key:"checkNew",value:function(t,o){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:o.name})}},{key:"checkAbstract",value:function(t,o){t===o?this.throwError("cannot instantiate abstract class "+JSON.stringify(o.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:o.name})}}],[{key:"globalLogger",value:function(){return d||(d=new e(c.version)),d}},{key:"setCensorship",value:function(t,o){if(!t&&o&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),u){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}l=!!t,u=!!o}},{key:"setLogLevel",value:function(t){var o=m[t.toLowerCase()];null!=o?f=o:e.globalLogger().warn("invalid log level - "+t)}},{key:"from",value:function(t){return new e(t)}}]),e}();t.Logger=g,g.errors=i,g.levels=n},4071:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="properties/5.7.0"},3694:function(e,t,o){"use strict";var r=o(8847);Object.defineProperty(t,"__esModule",{value:!0}),t.Description=void 0,t.checkProperties=function(e,t){e&&"object"===(0,s.default)(e)||m.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((function(o){t[o]||m.throwArgumentError("invalid object key - "+o,"transaction:"+o,e)}))},t.deepCopy=g,t.defineReadOnly=f,t.getStatic=function(e,t){for(var o=0;o<32;o++){if(e[t])return e[t];if(!e.prototype||"object"!==(0,s.default)(e.prototype))break;e=Object.getPrototypeOf(e.prototype).constructor}return null},t.resolveProperties=function(e){return l(this,void 0,void 0,n.default.mark((function t(){var o,r;return n.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=Object.keys(e).map((function(t){var o=e[t];return Promise.resolve(o).then((function(e){return{key:t,value:e}}))})),t.next=3,Promise.all(o);case 3:return r=t.sent,t.abrupt("return",r.reduce((function(e,t){return e[t.key]=t.value,e}),{}));case 5:case"end":return t.stop()}}),t)})))},t.shallowCopy=function(e){var t={};for(var o in e)t[o]=e[o];return t};var n=r(o(2247)),i=r(o(8985)),a=r(o(9721)),s=r(o(3355)),c=o(4327),u=o(4071),l=function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},m=new c.Logger(u.version);function f(e,t,o){Object.defineProperty(e,t,{enumerable:!0,value:o,writable:!1})}var d={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function h(e){if(null==e||d[(0,s.default)(e)])return!0;if(Array.isArray(e)||"object"===(0,s.default)(e)){if(!Object.isFrozen(e))return!1;for(var t=Object.keys(e),o=0;o>=8;return t}function c(e,t,o){for(var r=0,n=0;nt+1+r&&a.throwError("child data too short",n.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:i}}function m(e,t){if(0===e.length&&a.throwError("data too short",n.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){var o=e[t]-247;t+1+o>e.length&&a.throwError("data short segment too short",n.Logger.errors.BUFFER_OVERRUN,{});var i=c(e,t+1,o);return t+1+o+i>e.length&&a.throwError("data long segment too short",n.Logger.errors.BUFFER_OVERRUN,{}),l(e,t,t+1+o,o+i)}if(e[t]>=192){var s=e[t]-192;return t+1+s>e.length&&a.throwError("data array too short",n.Logger.errors.BUFFER_OVERRUN,{}),l(e,t,t+1,s)}if(e[t]>=184){var u=e[t]-183;t+1+u>e.length&&a.throwError("data array too short",n.Logger.errors.BUFFER_OVERRUN,{});var m=c(e,t+1,u);return t+1+u+m>e.length&&a.throwError("data array too short",n.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+u+m,result:(0,r.hexlify)(e.slice(t+1+u,t+1+u+m))}}if(e[t]>=128){var f=e[t]-128;return t+1+f>e.length&&a.throwError("data too short",n.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+f,result:(0,r.hexlify)(e.slice(t+1,t+1+f))}}return{consumed:1,result:(0,r.hexlify)(e[t])}}},8100:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="signing-key/5.7.0"},6918:function(e,t,o){"use strict";var r=o(8847);Object.defineProperty(t,"__esModule",{value:!0}),t.EC=void 0;var n=r(o(3355)),i=r(o(1734)),a=r(o(7198));function s(e,t,o){return o={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&o.path)}},e(o,o.exports),o.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==o.g?o.g:"undefined"!=typeof self&&self;var c=u;function u(e,t){if(!e)throw new Error(t||"Assertion failed")}u.equal=function(e,t,o){if(e!=t)throw new Error(o||"Assertion failed: "+e+" != "+t)};var l=s((function(e,t){var o=t;function r(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",o=0;o>8,a=255&n;i?o.push(i,a):o.push(a)}return o},o.zero2=r,o.toHex=n,o.encode=function(e,t){return"hex"===t?n(e):e}})),m=s((function(e,t){var o=t;o.assert=c,o.toArray=l.toArray,o.zero2=l.zero2,o.toHex=l.toHex,o.encode=l.encode,o.getNAF=function(e,t,o){var r=new Array(Math.max(e.bitLength(),o)+1);r.fill(0);for(var n=1<(n>>1)-1?(n>>1)-c:c,i.isubn(s)):s=0,r[a]=s,i.iushrn(1)}return r},o.getJSF=function(e,t){var o=[[],[]];e=e.clone(),t=t.clone();for(var r,n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var a,s,c=e.andln(3)+n&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!=(r=e.andln(7)+n&7)&&5!==r||2!==u?c:-c,o[0].push(a),s=0==(1&u)?0:3!=(r=t.andln(7)+i&7)&&5!==r||2!==c?u:-u,o[1].push(s),2*n===a+1&&(n=1-n),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return o},o.cachedProperty=function(e,t,o){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=o.call(this)}},o.parseBytes=function(e){return"string"==typeof e?o.toArray(e,"hex"):e},o.intFromLE=function(e){return new i.default(e,"hex","le")}})),f=m.getNAF,d=m.getJSF,h=m.assert;function p(e,t){this.type=e,this.p=new i.default(t.p,16),this.red=t.prime?i.default.red(t.prime):i.default.mont(this.p),this.zero=new i.default(0).toRed(this.red),this.one=new i.default(1).toRed(this.red),this.two=new i.default(2).toRed(this.red),this.n=t.n&&new i.default(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var o=this.n&&this.p.div(this.n);!o||o.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var g=p;function b(e,t){this.curve=e,this.type=t,this.precomputed=null}p.prototype.point=function(){throw new Error("Not implemented")},p.prototype.validate=function(){throw new Error("Not implemented")},p.prototype._fixedNafMul=function(e,t){h(e.precomputed);var o=e._getDoubles(),r=f(t,1,this._bitLength),n=(1<=i;c--)a=(a<<1)+r[c];s.push(a)}for(var u=this.jpoint(null,null,null),l=this.jpoint(null,null,null),m=n;m>0;m--){for(i=0;i=0;s--){for(var c=0;s>=0&&0===i[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=i[s];h(0!==u),a="affine"===e.type?u>0?a.mixedAdd(n[u-1>>1]):a.mixedAdd(n[-u-1>>1].neg()):u>0?a.add(n[u-1>>1]):a.add(n[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},p.prototype._wnafMulAdd=function(e,t,o,r,n){var i,a,s,c=this._wnafT1,u=this._wnafT2,l=this._wnafT3,m=0;for(i=0;i=1;i-=2){var p=i-1,g=i;if(1===c[p]&&1===c[g]){var b=[t[p],null,null,t[g]];0===t[p].y.cmp(t[g].y)?(b[1]=t[p].add(t[g]),b[2]=t[p].toJ().mixedAdd(t[g].neg())):0===t[p].y.cmp(t[g].y.redNeg())?(b[1]=t[p].toJ().mixedAdd(t[g]),b[2]=t[p].add(t[g].neg())):(b[1]=t[p].toJ().mixedAdd(t[g]),b[2]=t[p].toJ().mixedAdd(t[g].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=d(o[p],o[g]);for(m=Math.max(v[0].length,m),l[p]=new Array(m),l[g]=new Array(m),a=0;a=0;i--){for(var j=0;i>=0;){var M=!0;for(a=0;a=0&&j++,x=x.dblp(j),i<0)break;for(a=0;a0?s=u[a][A-1>>1]:A<0&&(s=u[a][-A-1>>1].neg()),x="affine"===s.type?x.mixedAdd(s):x.add(s))}}for(i=0;i=Math.ceil((e.bitLength()+1)/t.step)},b.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var o=[this],r=this,n=0;n=0&&(a=t,s=o),r.negative&&(r=r.neg(),n=n.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:r,b:n},{a:a,b:s}]},k.prototype._endoSplit=function(e){var t=this.endo.basis,o=t[0],r=t[1],n=r.b.mul(e).divRound(this.n),i=o.b.neg().mul(e).divRound(this.n),a=n.mul(o.a),s=i.mul(r.a),c=n.mul(o.b),u=i.mul(r.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},k.prototype.pointFromX=function(e,t){(e=new i.default(e,16)).red||(e=e.toRed(this.red));var o=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=o.redSqrt();if(0!==r.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var n=r.fromRed().isOdd();return(t&&!n||!t&&n)&&(r=r.redNeg()),this.point(e,r)},k.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,o=e.y,r=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===o.redSqr().redISub(n).cmpn(0)},k.prototype._endoWnafMulAdd=function(e,t,o){for(var r=this._endoWnafT1,n=this._endoWnafT2,i=0;i":""},x.prototype.isInfinity=function(){return this.inf},x.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var o=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,r)},x.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,o=this.x.redSqr(),r=e.redInvm(),n=o.redAdd(o).redIAdd(o).redIAdd(t).redMul(r),i=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},x.prototype.getX=function(){return this.x.fromRed()},x.prototype.getY=function(){return this.y.fromRed()},x.prototype.mul=function(e){return e=new i.default(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},x.prototype.mulAdd=function(e,t,o){var r=[this,t],n=[e,o];return this.curve.endo?this.curve._endoWnafMulAdd(r,n):this.curve._wnafMulAdd(1,r,n,2)},x.prototype.jmulAdd=function(e,t,o){var r=[this,t],n=[e,o];return this.curve.endo?this.curve._endoWnafMulAdd(r,n,!0):this.curve._wnafMulAdd(1,r,n,2,!0)},x.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},x.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var o=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:o.naf&&{wnd:o.naf.wnd,points:o.naf.points.map(r)},doubles:o.doubles&&{step:o.doubles.step,points:o.doubles.points.map(r)}}}return t},x.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},y(z,g.BasePoint),k.prototype.jpoint=function(e,t,o){return new z(this,e,t,o)},z.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),o=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(o,r)},z.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},z.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),o=this.z.redSqr(),r=this.x.redMul(t),n=e.x.redMul(o),i=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(o.redMul(this.z)),s=r.redSub(n),c=i.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),m=r.redMul(u),f=c.redSqr().redIAdd(l).redISub(m).redISub(m),d=c.redMul(m.redISub(f)).redISub(i.redMul(l)),h=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(f,d,h)},z.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),o=this.x,r=e.x.redMul(t),n=this.y,i=e.y.redMul(t).redMul(this.z),a=o.redSub(r),s=n.redSub(i);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),l=o.redMul(c),m=s.redSqr().redIAdd(u).redISub(l).redISub(l),f=s.redMul(l.redISub(m)).redISub(n.redMul(u)),d=this.z.redMul(a);return this.curve.jpoint(m,f,d)},z.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var o=this;for(t=0;t=0)return!1;if(o.redIAdd(n),0===this.x.cmp(o))return!0}},z.prototype.inspect=function(){return this.isInfinity()?"":""},z.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var j=s((function(e,t){var o=t;o.base=g,o.short=w,o.mont=null,o.edwards=null})),M=s((function(e,t){var o,r=t,n=m.assert;function i(e){"short"===e.type?this.curve=new j.short(e):"edwards"===e.type?this.curve=new j.edwards(e):this.curve=new j.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var o=new i(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:o}),o}})}r.PresetCurve=i,s("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:a.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:a.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:a.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:a.default.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"]}),s("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:a.default.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.default.sha256,gRed:!1,g:["9"]}),s("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:a.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{o=null.crash()}catch(e){o=void 0}s("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:a.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})}));function A(e){if(!(this instanceof A))return new A(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=l.toArray(e.entropy,e.entropyEnc||"hex"),o=l.toArray(e.nonce,e.nonceEnc||"hex"),r=l.toArray(e.pers,e.persEnc||"hex");c(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,o,r)}var q=A;A.prototype._init=function(e,t,o){var r=e.concat(t).concat(o);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(o||[])),this._reseed=1},A.prototype.generate=function(e,t,o,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=o,o=t,t=null),o&&(o=l.toArray(o,r||"hex"),this._update(o));for(var n=[];n.length"};var N=m.assert;function _(e,t){if(e instanceof _)return e;this._importDER(e,t)||(N(e.r&&e.s,"Signature without r or s"),this.r=new i.default(e.r,16),this.s=new i.default(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var T=_;function O(){this.place=0}function C(e,t){var o=e[t.place++];if(!(128&o))return o;var r=15&o;if(0===r||r>4)return!1;for(var n=0,i=0,a=t.place;i>>=0;return!(n<=127)&&(t.place=a,n)}function D(e){for(var t=0,o=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|o);--o;)e.push(t>>>(o<<3)&255);e.push(t)}}_.prototype._importDER=function(e,t){e=m.toArray(e,t);var o=new O;if(48!==e[o.place++])return!1;var r=C(e,o);if(!1===r)return!1;if(r+o.place!==e.length)return!1;if(2!==e[o.place++])return!1;var n=C(e,o);if(!1===n)return!1;var a=e.slice(o.place,n+o.place);if(o.place+=n,2!==e[o.place++])return!1;var s=C(e,o);if(!1===s)return!1;if(e.length!==s+o.place)return!1;var c=e.slice(o.place,s+o.place);if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}return this.r=new i.default(a),this.s=new i.default(c),this.recoveryParam=null,!0},_.prototype.toDER=function(e){var t=this.r.toArray(),o=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&o[0]&&(o=[0].concat(o)),t=D(t),o=D(o);!(o[0]||128&o[1]);)o=o.slice(1);var r=[2];L(r,t.length),(r=r.concat(t)).push(2),L(r,o.length);var n=r.concat(o),i=[48];return L(i,n.length),i=i.concat(n),m.encode(i,e)};var P=function(){throw new Error("unsupported")},R=m.assert;function B(e){if(!(this instanceof B))return new B(e);"string"==typeof e&&(R(Object.prototype.hasOwnProperty.call(M,e),"Unknown curve "+e),e=M[e]),e instanceof M.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var U=B;B.prototype.keyPair=function(e){return new S(this,e)},B.prototype.keyFromPrivate=function(e,t){return S.fromPrivate(this,e,t)},B.prototype.keyFromPublic=function(e,t){return S.fromPublic(this,e,t)},B.prototype.genKeyPair=function(e){e||(e={});for(var t=new q({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||P(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),o=this.n.byteLength(),r=this.n.sub(new i.default(2));;){var n=new i.default(t.generate(o));if(!(n.cmp(r)>0))return n.iaddn(1),this.keyFromPrivate(n)}},B.prototype._truncateToN=function(e,t){var o=8*e.byteLength()-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},B.prototype.sign=function(e,t,o,r){"object"===(0,n.default)(o)&&(r=o,o=null),r||(r={}),t=this.keyFromPrivate(t,o),e=this._truncateToN(new i.default(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),c=e.toArray("be",a),u=new q({hash:this.hash,entropy:s,nonce:c,pers:r.pers,persEnc:r.persEnc||"utf8"}),l=this.n.sub(new i.default(1)),m=0;;m++){var f=r.k?r.k(m):new i.default(u.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(l)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var h=d.getX(),p=h.umod(this.n);if(0!==p.cmpn(0)){var g=f.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var b=(d.getY().isOdd()?1:0)|(0!==h.cmp(p)?2:0);return r.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),b^=1),new T({r:p,s:g,recoveryParam:b})}}}}}},B.prototype.verify=function(e,t,o,r){e=this._truncateToN(new i.default(e,16)),o=this.keyFromPublic(o,r);var n=(t=new T(t,"hex")).r,a=t.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,c=a.invm(this.n),u=c.mul(e).umod(this.n),l=c.mul(n).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,o.getPublic(),l)).isInfinity()&&s.eqXToP(n):!(s=this.g.mulAdd(u,o.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(n)},B.prototype.recoverPubKey=function(e,t,o,r){R((3&o)===o,"The recovery param is more than two bits"),t=new T(t,r);var n=this.n,a=new i.default(e),s=t.r,c=t.s,u=1&o,l=o>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var m=t.r.invm(n),f=n.sub(a).mul(m).umod(n),d=c.mul(m).umod(n);return this.g.mulAdd(f,s,d)},B.prototype.getKeyRecoveryParam=function(e,t,o,r){if(null!==(t=new T(t,r)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var i;try{i=this.recoverPubKey(e,t,n)}catch(e){continue}if(i.eq(o))return n}throw new Error("Unable to find valid recovery factor")};var F=s((function(e,t){var o=t;o.version="6.5.4",o.utils=m,o.rand=function(){throw new Error("unsupported")},o.curve=j,o.curves=M,o.ec=U,o.eddsa=null})),Q=F.ec;t.EC=Q},7612:function(e,t,o){"use strict";var r=o(8847);Object.defineProperty(t,"__esModule",{value:!0}),t.SigningKey=void 0,t.computePublicKey=p,t.recoverPublicKey=function(e,t){var o=(0,s.splitSignature)(t),r={r:(0,s.arrayify)(o.r),s:(0,s.arrayify)(o.s)};return"0x"+d().recoverPubKey((0,s.arrayify)(e),r,o.recoveryParam).encode("hex",!1)};var n=r(o(9721)),i=r(o(8985)),a=o(6918),s=o(908),c=o(3694),u=o(4327),l=o(8100),m=new u.Logger(l.version),f=null;function d(){return f||(f=new a.EC("secp256k1")),f}var h=function(){function e(t){(0,n.default)(this,e),(0,c.defineReadOnly)(this,"curve","secp256k1"),(0,c.defineReadOnly)(this,"privateKey",(0,s.hexlify)(t)),32!==(0,s.hexDataLength)(this.privateKey)&&m.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var o=d().keyFromPrivate((0,s.arrayify)(this.privateKey));(0,c.defineReadOnly)(this,"publicKey","0x"+o.getPublic(!1,"hex")),(0,c.defineReadOnly)(this,"compressedPublicKey","0x"+o.getPublic(!0,"hex")),(0,c.defineReadOnly)(this,"_isSigningKey",!0)}return(0,i.default)(e,[{key:"_addPoint",value:function(e){var t=d().keyFromPublic((0,s.arrayify)(this.publicKey)),o=d().keyFromPublic((0,s.arrayify)(e));return"0x"+t.pub.add(o.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(e){var t=d().keyFromPrivate((0,s.arrayify)(this.privateKey)),o=(0,s.arrayify)(e);32!==o.length&&m.throwArgumentError("bad digest length","digest",e);var r=t.sign(o,{canonical:!0});return(0,s.splitSignature)({recoveryParam:r.recoveryParam,r:(0,s.hexZeroPad)("0x"+r.r.toString(16),32),s:(0,s.hexZeroPad)("0x"+r.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(e){var t=d().keyFromPrivate((0,s.arrayify)(this.privateKey)),o=d().keyFromPublic((0,s.arrayify)(p(e)));return(0,s.hexZeroPad)("0x"+t.derive(o.getPublic()).toString(16),32)}}],[{key:"isSigningKey",value:function(e){return!(!e||!e._isSigningKey)}}]),e}();function p(e,t){var o=(0,s.arrayify)(e);if(32===o.length){var r=new h(o);return t?"0x"+d().keyFromPrivate(o).getPublic(!0,"hex"):r.publicKey}return 33===o.length?t?(0,s.hexlify)(o):"0x"+d().keyFromPublic(o).getPublic(!1,"hex"):65===o.length?t?"0x"+d().keyFromPublic(o).getPublic(!0,"hex"):(0,s.hexlify)(o):m.throwArgumentError("invalid public or private key","key","[REDACTED]")}t.SigningKey=h},6518:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="strings/5.7.0"},5856:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=function(e){var t=(0,i.toUtf8Bytes)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,n.hexlify)((0,n.concat)([t,r.HashZero]).slice(0,32))},t.parseBytes32String=function(e){var t=(0,n.arrayify)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var o=31;0===t[o-1];)o--;return(0,i.toUtf8String)(t.slice(0,o))};var r=o(5465),n=o(908),i=o(4997)},8645:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._nameprepTableA1=h,t._nameprepTableB2=p,t._nameprepTableC=g,t.nameprep=function(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();var t,o=(0,r.toUtf8CodePoints)(e);t=o.map((function(e){return c.indexOf(e)>=0||e>=65024&&e<=65039?[]:p(e)||[e]})),o=t.reduce((function(e,t){return t.forEach((function(t){e.push(t)})),e}),[]),(o=(0,r.toUtf8CodePoints)((0,r._toUtf8String)(o),r.UnicodeNormalizationForm.NFKC)).forEach((function(e){if(g(e))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),o.forEach((function(e){if(h(e))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var n=(0,r._toUtf8String)(o);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n};var r=o(4997);function n(e,t){t||(t=function(e){return[parseInt(e,16)]});var o=0,r={};return e.split(",").forEach((function(e){var n=e.split(":");o+=parseInt(n[0],16),r[o]=t(n[1])})),r}function i(e){var t=0;return e.split(",").map((function(e){var o=e.split("-");return 1===o.length?o[1]="0":""===o[1]&&(o[1]="1"),{l:t+parseInt(o[0],16),h:t=parseInt(o[1],16)}}))}function a(e,t){for(var o=0,r=0;r=(o+=n.l)&&e<=o+n.h&&(e-o)%(n.d||1)==0){if(n.e&&-1!==n.e.indexOf(e-o))continue;return n}}return null}var s=i("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),c="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(e){return parseInt(e,16)})),u=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],l=n("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),m=n("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),f=n("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");for(var t=[],o=0;o=32&&e<127)return String.fromCharCode(e)}return e<=65535?d(e):d(55296+((e-=65536)>>10&1023))+d(56320+(1023&e))})).join("")+'"'},t._toUtf8String=h,t.toUtf8Bytes=f,t.toUtf8CodePoints=function(e){return m(f(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.current))},t.toUtf8String=function(e,t){return h(m(e,t))};var r,n,i=o(908),a=o(4327),s=o(6518),c=new a.Logger(s.version);function u(e,t,o,r,i){if(e===n.BAD_PREFIX||e===n.UNEXPECTED_CONTINUE){for(var a=0,s=t+1;s>6==2;s++)a++;return a}return e===n.OVERRUN?o.length-t-1:0}t.UnicodeNormalizationForm=r,function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(r||(t.UnicodeNormalizationForm=r={})),t.Utf8ErrorReason=n,function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(n||(t.Utf8ErrorReason=n={}));var l=Object.freeze({error:function(e,t,o,r,n){return c.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",o)},ignore:u,replace:function(e,t,o,r,i){return e===n.OVERLONG?(r.push(i),0):(r.push(65533),u(e,t,o))}});function m(e,t){null==t&&(t=l.error),e=(0,i.arrayify)(e);for(var o=[],r=0;r>7!=0){var s=null,c=null;if(192==(224&a))s=1,c=127;else if(224==(240&a))s=2,c=2047;else{if(240!=(248&a)){r+=t(128==(192&a)?n.UNEXPECTED_CONTINUE:n.BAD_PREFIX,r-1,e,o);continue}s=3,c=65535}if(r-1+s>=e.length)r+=t(n.OVERRUN,r-1,e,o);else{for(var u=a&(1<<8-s-1)-1,m=0;m1114111?r+=t(n.OUT_OF_RANGE,r-1-s,e,o,u):u>=55296&&u<=57343?r+=t(n.UTF16_SURROGATE,r-1-s,e,o,u):u<=c?r+=t(n.OVERLONG,r-1-s,e,o,u):o.push(u))}}else o.push(a)}return o}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.current;t!=r.current&&(c.checkNormalize(),e=e.normalize(t));for(var o=[],n=0;n>6|192),o.push(63&a|128);else if(55296==(64512&a)){n++;var s=e.charCodeAt(n);if(n>=e.length||56320!=(64512&s))throw new Error("invalid utf-8 string");var u=65536+((1023&a)<<10)+(1023&s);o.push(u>>18|240),o.push(u>>12&63|128),o.push(u>>6&63|128),o.push(63&u|128)}else o.push(a>>12|224),o.push(a>>6&63|128),o.push(63&a|128)}return(0,i.arrayify)(o)}function d(e){var t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function h(e){return e.map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}t.Utf8ErrorFuncs=l},6783:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="transactions/5.7.0"},1936:function(e,t,o){"use strict";var r=o(3355);Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionTypes=void 0,t.accessListify=M,t.computeAddress=w,t.parse=function(e){var t=(0,a.arrayify)(e);if(t[0]>127)return function(e){var t=l.decode(e);9!==t.length&&6!==t.length&&g.throwArgumentError("invalid raw transaction","rawTransaction",e);var o={nonce:y(t[0]).toNumber(),gasPrice:y(t[1]),gasLimit:y(t[2]),to:b(t[3]),value:y(t[4]),data:t[5],chainId:0};if(6===t.length)return o;try{o.v=i.BigNumber.from(t[6]).toNumber()}catch(e){return o}if(o.r=(0,a.hexZeroPad)(t[7],32),o.s=(0,a.hexZeroPad)(t[8],32),i.BigNumber.from(o.r).isZero()&&i.BigNumber.from(o.s).isZero())o.chainId=o.v,o.v=0;else{o.chainId=Math.floor((o.v-35)/2),o.chainId<0&&(o.chainId=0);var r=o.v-27,n=t.slice(0,6);0!==o.chainId&&(n.push((0,a.hexlify)(o.chainId)),n.push("0x"),n.push("0x"),r-=2*o.chainId+8);var s=(0,c.keccak256)(l.encode(n));try{o.from=x(s,{r:(0,a.hexlify)(o.r),s:(0,a.hexlify)(o.s),recoveryParam:r})}catch(e){}o.hash=(0,c.keccak256)(e)}return o.type=null,o}(t);switch(t[0]){case 1:return function(e){var t=l.decode(e.slice(1));8!==t.length&&11!==t.length&&g.throwArgumentError("invalid component count for transaction type: 1","payload",(0,a.hexlify)(e));var o={type:1,chainId:y(t[0]).toNumber(),nonce:y(t[1]).toNumber(),gasPrice:y(t[2]),gasLimit:y(t[3]),to:b(t[4]),value:y(t[5]),data:t[6],accessList:M(t[7])};return 8===t.length||(o.hash=(0,c.keccak256)(e),E(o,t.slice(8),I)),o}(t);case 2:return function(e){var t=l.decode(e.slice(1));9!==t.length&&12!==t.length&&g.throwArgumentError("invalid component count for transaction type: 2","payload",(0,a.hexlify)(e));var o=y(t[2]),r=y(t[3]),n={type:2,chainId:y(t[0]).toNumber(),nonce:y(t[1]).toNumber(),maxPriorityFeePerGas:o,maxFeePerGas:r,gasPrice:null,gasLimit:y(t[4]),to:b(t[5]),value:y(t[6]),data:t[7],accessList:M(t[8])};return 9===t.length||(n.hash=(0,c.keccak256)(e),E(n,t.slice(9),q)),n}(t)}return g.throwError("unsupported transaction type: ".concat(t[0]),f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})},t.recoverAddress=x,t.serialize=function(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&g.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,u.checkProperties)(e,k);var o=[];v.forEach((function(t){var r=e[t.name]||[],n={};t.numeric&&(n.hexPad="left"),r=(0,a.arrayify)((0,a.hexlify)(r,n)),t.length&&r.length!==t.length&&r.length>0&&g.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,r),t.maxLength&&(r=(0,a.stripZeros)(r)).length>t.maxLength&&g.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,r),o.push((0,a.hexlify)(r))}));var r=0;if(null!=e.chainId?"number"!=typeof(r=e.chainId)&&g.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!(0,a.isBytesLike)(t)&&t.v>28&&(r=Math.floor((t.v-35)/2)),0!==r&&(o.push((0,a.hexlify)(r)),o.push("0x"),o.push("0x")),!t)return l.encode(o);var n=(0,a.splitSignature)(t),i=27+n.recoveryParam;return 0!==r?(o.pop(),o.pop(),o.pop(),i+=2*r+8,n.v>28&&n.v!==i&&g.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):n.v!==i&&g.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),o.push((0,a.hexlify)(i)),o.push((0,a.stripZeros)((0,a.arrayify)(n.r))),o.push((0,a.stripZeros)((0,a.arrayify)(n.s))),l.encode(o)}(e,t);switch(e.type){case 1:return I(e,t);case 2:return q(e,t)}return g.throwError("unsupported transaction type: ".concat(e.type),f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})};var n=o(7921),i=o(4952),a=o(908),s=o(5465),c=o(4642),u=o(3694),l=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var o=h(t);if(o&&o.has(e))return o.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,o&&o.set(e,n),n}(o(5265)),m=o(7612),f=o(4327),d=o(6783);function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(h=function(e){return e?o:t})(e)}var p,g=new f.Logger(d.version);function b(e){return"0x"===e?null:(0,n.getAddress)(e)}function y(e){return"0x"===e?s.Zero:i.BigNumber.from(e)}t.TransactionTypes=p,function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(p||(t.TransactionTypes=p={}));var v=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],k={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function w(e){var t=(0,m.computePublicKey)(e);return(0,n.getAddress)((0,a.hexDataSlice)((0,c.keccak256)((0,a.hexDataSlice)(t,1)),12))}function x(e,t){return w((0,m.recoverPublicKey)((0,a.arrayify)(e),t))}function z(e,t){var o=(0,a.stripZeros)(i.BigNumber.from(e).toHexString());return o.length>32&&g.throwArgumentError("invalid length for "+t,"transaction:"+t,e),o}function j(e,t){return{address:(0,n.getAddress)(e),storageKeys:(t||[]).map((function(t,o){return 32!==(0,a.hexDataLength)(t)&&g.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(o,"]"),t),t.toLowerCase()}))}}function M(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&g.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),j(e[0],e[1])):j(e.address,e.storageKeys)}));var t=Object.keys(e).map((function(t){var o=e[t].reduce((function(e,t){return e[t]=!0,e}),{});return j(t,Object.keys(o).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function A(e){return M(e).map((function(e){return[e.address,e.storageKeys]}))}function q(e,t){if(null!=e.gasPrice){var o=i.BigNumber.from(e.gasPrice),r=i.BigNumber.from(e.maxFeePerGas||0);o.eq(r)||g.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:o,maxFeePerGas:r})}var s=[z(e.chainId||0,"chainId"),z(e.nonce||0,"nonce"),z(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),z(e.maxFeePerGas||0,"maxFeePerGas"),z(e.gasLimit||0,"gasLimit"),null!=e.to?(0,n.getAddress)(e.to):"0x",z(e.value||0,"value"),e.data||"0x",A(e.accessList||[])];if(t){var c=(0,a.splitSignature)(t);s.push(z(c.recoveryParam,"recoveryParam")),s.push((0,a.stripZeros)(c.r)),s.push((0,a.stripZeros)(c.s))}return(0,a.hexConcat)(["0x02",l.encode(s)])}function I(e,t){var o=[z(e.chainId||0,"chainId"),z(e.nonce||0,"nonce"),z(e.gasPrice||0,"gasPrice"),z(e.gasLimit||0,"gasLimit"),null!=e.to?(0,n.getAddress)(e.to):"0x",z(e.value||0,"value"),e.data||"0x",A(e.accessList||[])];if(t){var r=(0,a.splitSignature)(t);o.push(z(r.recoveryParam,"recoveryParam")),o.push((0,a.stripZeros)(r.r)),o.push((0,a.stripZeros)(r.s))}return(0,a.hexConcat)(["0x01",l.encode(o)])}function E(e,t,o){try{var r=y(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){g.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,a.hexZeroPad)(t[1],32),e.s=(0,a.hexZeroPad)(t[2],32);try{var n=(0,c.keccak256)(o(e));e.from=x(n,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}},3368:function(e,t,o){"use strict";var r,n,i=o(8847)(o(3355));void 0===(n="function"==typeof(r=function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var o=0;o>6],n=0==(32&o);if(31==(31&o)){var i=o;for(o=0;128==(128&i);){if(i=e.readUInt8(t),e.isError(i))return i;o<<=7,o|=127&i}}else o&=31;return{cls:r,primitive:n,tag:o,tagStr:s.tag[o]}}function m(e,t,o){var r=e.readUInt8(o);if(e.isError(r))return r;if(!t&&128===r)return null;if(0==(128&r))return r;var n=127&r;if(n>4)return e.error("length octect is too long");r=0;for(var i=0;i=31?r.error("Multi-octet tag encoding unsupported"):(t||(n|=32),n|=a.tagClassByName[o||"universal"]<<6)}(e,t,o,this.reporter);if(r.length<128){var s=n.alloc(2);return s[0]=i,s[1]=r.length,this._createEncoderBuffer([s,r])}for(var c=1,u=r.length;u>=256;u>>=8)c++;var l=n.alloc(2+c);l[0]=i,l[1]=128|c;for(var m=1+c,f=r.length;f>0;m--,f>>=8)l[m]=255&f;return this._createEncoderBuffer([l,r])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var o=n.alloc(2*e.length),r=0;r=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}for(var a=0,s=0;s=128;c>>=7)a++}for(var u=n.alloc(a),l=u.length-1,m=e.length-1;m>=0;m--){var f=e[m];for(u[l--]=127&f;(f>>=7)>0;)u[l--]=128|127&f}return this._createEncoderBuffer(u)},c.prototype._encodeTime=function(e,t){var o,r=new Date(e);return"gentime"===t?o=[u(r.getUTCFullYear()),u(r.getUTCMonth()+1),u(r.getUTCDate()),u(r.getUTCHours()),u(r.getUTCMinutes()),u(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?o=[u(r.getUTCFullYear()%100),u(r.getUTCMonth()+1),u(r.getUTCDate()),u(r.getUTCHours()),u(r.getUTCMinutes()),u(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(o,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!n.isBuffer(e)){var o=e.toArray();!e.sign&&128&o[0]&&o.unshift(0),e=n.from(o)}if(n.isBuffer(e)){var r=e.length;0===e.length&&r++;var i=n.alloc(r);return e.copy(i),0===e.length&&(i[0]=0),this._createEncoderBuffer(i)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);for(var a=1,s=e;s>=256;s>>=8)a++;for(var c=new Array(a),u=c.length-1;u>=0;u--)c[u]=255&e,e>>=8;return 128&c[0]&&c.unshift(0),this._createEncoderBuffer(n.from(c))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,o){var r,n=this._baseState;if(null===n.default)return!1;var i=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,o).join()),i.length!==n.defaultBuffer.length)return!1;for(r=0;r=0;c--)if(l[c]!==m[c])return!1;for(c=l.length-1;c>=0;c--)if(!k(e[a=l[c]],t[a],o,r))return!1;return!0}(e,t,o,n))}return o?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function x(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function z(e,t,o,r){var n;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof o&&(r=o,o=null),n=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(o&&o.name?" ("+o.name+").":".")+(r?" "+r:"."),e&&!n&&y(n,o,"Missing expected exception"+r);var i="string"==typeof r,a=!e&&n&&!o;if((!e&&s.isError(n)&&i&&x(n,o)||a)&&y(n,o,"Got unwanted exception"+r),e&&n&&o&&!x(n,o)||!e&&n)throw n}d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return g(b(e.actual),128)+" "+e.operator+" "+g(b(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var o=new Error;if(o.stack){var r=o.stack,n=p(t),i=r.indexOf("\n"+n);if(i>=0){var a=r.indexOf("\n",i+1);r=r.substring(a+1)}this.stack=r}}},s.inherits(d.AssertionError,Error),d.fail=y,d.ok=v,d.equal=function(e,t,o){e!=t&&y(e,t,o,"==",d.equal)},d.notEqual=function(e,t,o){e==t&&y(e,t,o,"!=",d.notEqual)},d.deepEqual=function(e,t,o){k(e,t,!1)||y(e,t,o,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(e,t,o){k(e,t,!0)||y(e,t,o,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(e,t,o){k(e,t,!1)&&y(e,t,o,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function e(t,o,r){k(t,o,!0)&&y(t,o,r,"notDeepStrictEqual",e)},d.strictEqual=function(e,t,o){e!==t&&y(e,t,o,"===",d.strictEqual)},d.notStrictEqual=function(e,t,o){e===t&&y(e,t,o,"!==",d.notStrictEqual)},d.throws=function(e,t,o){z(!0,e,t,o)},d.doesNotThrow=function(e,t,o){z(!1,e,t,o)},d.ifError=function(e){if(e)throw e},d.strict=n((function e(t,o){t||y(t,!0,o,"==",e)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var j=Object.keys||function(e){var t=[];for(var o in e)c.call(e,o)&&t.push(o);return t}},4074:function(e){"use strict";"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var o=function(){};o.prototype=t.prototype,e.prototype=new o,e.prototype.constructor=e}},6732:function(e,t,o){"use strict";var r=o(8847)(o(3355));e.exports=function(e){return e&&"object"===(0,r.default)(e)&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},9954:function(e,t,o){"use strict";var r=o(9142),n=o(8847)(o(3355)),i=/%[sdj%]/g;t.format=function(e){if(!y(e)){for(var t=[],o=0;o=n)return e;switch(e){case"%s":return String(r[o++]);case"%d":return Number(r[o++]);case"%j":try{return JSON.stringify(r[o++])}catch(e){return"[Circular]"}default:return e}})),s=r[o];o=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),p(o)?r.showHidden=o:o&&t._extend(r,o),v(r.showHidden)&&(r.showHidden=!1),v(r.depth)&&(r.depth=2),v(r.colors)&&(r.colors=!1),v(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),m(r,e,r.depth)}function u(e,t){var o=c.styles[t];return o?"\x1b["+c.colors[o][0]+"m"+e+"\x1b["+c.colors[o][1]+"m":e}function l(e,t){return e}function m(e,o,r){if(e.customInspect&&o&&j(o.inspect)&&o.inspect!==t.inspect&&(!o.constructor||o.constructor.prototype!==o)){var n=o.inspect(r,e);return y(n)||(n=m(e,n,r)),n}var i=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var o="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(o,"string")}return b(t)?e.stylize(""+t,"number"):p(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}(e,o);if(i)return i;var a=Object.keys(o),s=function(e){var t={};return e.forEach((function(e,o){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(o)),z(o)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(o);if(0===a.length){if(j(o)){var c=o.name?": "+o.name:"";return e.stylize("[Function"+c+"]","special")}if(k(o))return e.stylize(RegExp.prototype.toString.call(o),"regexp");if(x(o))return e.stylize(Date.prototype.toString.call(o),"date");if(z(o))return f(o)}var u,l="",w=!1,M=["{","}"];return h(o)&&(w=!0,M=["[","]"]),j(o)&&(l=" [Function"+(o.name?": "+o.name:"")+"]"),k(o)&&(l=" "+RegExp.prototype.toString.call(o)),x(o)&&(l=" "+Date.prototype.toUTCString.call(o)),z(o)&&(l=" "+f(o)),0!==a.length||w&&0!=o.length?r<0?k(o)?e.stylize(RegExp.prototype.toString.call(o),"regexp"):e.stylize("[Object]","special"):(e.seen.push(o),u=w?function(e,t,o,r,n){for(var i=[],a=0,s=t.length;a60?o[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+o[1]:o[0]+t+" "+e.join(", ")+" "+o[1]}(u,l,M)):M[0]+l+M[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,o,r,n,i){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),I(r,n)||(a="["+n+"]"),s||(e.seen.indexOf(c.value)<0?(s=g(o)?m(e,c.value,null):m(e,c.value,o-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),v(a)){if(i&&n.match(/^\d+$/))return s;(a=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function g(e){return null===e}function b(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function k(e){return w(e)&&"[object RegExp]"===M(e)}function w(e){return"object"===(0,n.default)(e)&&null!==e}function x(e){return w(e)&&"[object Date]"===M(e)}function z(e){return w(e)&&("[object Error]"===M(e)||e instanceof Error)}function j(e){return"function"==typeof e}function M(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(v(a)&&(a=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!s[e])if(new RegExp("\\b"+e+"\\b","i").test(a)){var o=r.pid;s[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,o,r)}}else s[e]=function(){};return s[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=p,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=y,t.isSymbol=function(e){return"symbol"===(0,n.default)(e)},t.isUndefined=v,t.isRegExp=k,t.isObject=w,t.isDate=x,t.isError=z,t.isFunction=j,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===(0,n.default)(e)||void 0===e},t.isBuffer=o(6732);var q=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,o;console.log("%s - %s",(o=[A((e=new Date).getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":"),[e.getDate(),q[e.getMonth()],o].join(" ")),t.format.apply(t,arguments))},t.inherits=o(4074),t._extend=function(e,t){if(!t||!w(t))return e;for(var o=Object.keys(t),r=o.length;r--;)e[o[r]]=t[o[r]];return e}},7548:function(e,t,o){"use strict";var r=o(8850).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),o=0;o>>0,l=new Uint8Array(a);e[o];){var m=t[e.charCodeAt(o)];if(255===m)return;for(var f=0,d=a-1;(0!==m||f>>0,l[d]=m%256>>>0,m=m/256>>>0;if(0!==m)throw new Error("Non-zero carry");i=f,o++}for(var h=a-i;h!==a&&0===l[h];)h++;var p=r.allocUnsafe(n+(a-h));p.fill(0,0,n);for(var g=n;h!==a;)p[g++]=l[h++];return p}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=r.from(t)),!r.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var o=0,n=0,i=0,a=t.length;i!==a&&0===t[i];)i++,o++;for(var u=(a-i)*l+1>>>0,m=new Uint8Array(u);i!==a;){for(var f=t[i],d=0,h=u-1;(0!==f||d>>0,m[h]=f%s>>>0,f=f/s>>>0;if(0!==f)throw new Error("Non-zero carry");n=d,i++}for(var p=u-n;p!==u&&0===m[p];)p++;for(var g=c.repeat(o);p0?a-4:a;for(o=0;o>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===s&&(t=r[e.charCodeAt(o)]<<2|r[e.charCodeAt(o+1)]>>4,u[l++]=255&t),1===s&&(t=r[e.charCodeAt(o)]<<10|r[e.charCodeAt(o+1)]<<4|r[e.charCodeAt(o+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i=[],a=16383,s=0,c=r-n;sc?c:s+a));return 1===n?(t=e[r-1],i.push(o[t>>2]+o[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(o[t>>10]+o[t>>4&63]+o[t<<2&63]+"=")),i.join("")};for(var o=[],r=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.indexOf("=");return-1===o&&(o=t),[o,o===t?0:4-o%4]}function u(e,t,r){for(var n,i,a=[],s=t;s>18&63]+o[i>>12&63]+o[i>>6&63]+o[63&i]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},1734:function(e,t,o){"use strict";e=o.nmd(e);var r=o(8847)(o(3355));!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var o=function(){};o.prototype=t.prototype,e.prototype=new o,e.prototype.constructor=e}function a(e,t,o){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(o=t,t=10),this._init(e||0,t||10,o||"be"))}var s;"object"===(0,r.default)(e)?e.exports=a:(void 0).BN=a,a.BN=a,a.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:o(9033).Buffer}catch(e){}function c(e,t){var o=e.charCodeAt(t);return o>=48&&o<=57?o-48:o>=65&&o<=70?o-55:o>=97&&o<=102?o-87:void n(!1,"Invalid character in "+e)}function u(e,t,o){var r=c(e,o);return o-1>=t&&(r|=c(e,o-1)<<4),r}function l(e,t,o,r){for(var i=0,a=0,s=Math.min(e.length,o),c=t;c=49?u-49+10:u>=17?u-17+10:u,n(u>=0&&a0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,o){if("number"==typeof e)return this._initNumber(e,t,o);if("object"===(0,r.default)(e))return this._initArray(e,t,o);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;r-=3)a=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===o)for(r=0,i=0;r>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},a.prototype._parseHex=function(e,t,o){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=u(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=n>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=n>>>26):i+=8;this._strip()},a.prototype._parseBase=function(e,t,o){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-o,a=i%r,s=Math.min(i,i-a)+o,c=0,u=o;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){a.prototype.inspect=f}else a.prototype.inspect=f;function f(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function g(e,t,o){o.negative=t.negative^e.negative;var r=e.length+t.length|0;o.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],a=n*i,s=67108863&a,c=a/67108864|0;o.words[0]=s;for(var u=1;u>>26,m=67108863&c,f=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=f;d++){var h=u-d|0;l+=(a=(n=0|e.words[h])*(i=0|t.words[d])+m)/67108864|0,m=67108863&a}o.words[u]=0|m,c=0|l}return 0!==c?o.words[u]=0|c:o.length--,o._strip()}a.prototype.toString=function(e,t){var o;if(t=0|t||1,16===(e=e||10)||"hex"===e){o="";for(var r=0,i=0,a=0;a>>24-r&16777215,(r+=2)>=26&&(r-=26,a--),o=0!==i||a!==this.length-1?d[6-c.length]+c+o:c+o}for(0!==i&&(o=i.toString(16)+o);o.length%t!=0;)o="0"+o;return 0!==this.negative&&(o="-"+o),o}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],l=p[e];o="";var m=this.clone();for(m.negative=0;!m.isZero();){var f=m.modrn(l).toString(e);o=(m=m.idivn(l)).isZero()?f+o:d[u-f.length]+f+o}for(this.isZero()&&(o="0"+o);o.length%t!=0;)o="0"+o;return 0!==this.negative&&(o="-"+o),o}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16,2)},s&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,o){this._strip();var r=this.byteLength(),i=o||Math.max(1,r);n(r<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,r),a},a.prototype._toArrayLikeLE=function(e,t){for(var o=0,r=0,n=0,i=0;n>8&255),o>16&255),6===i?(o>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(o=0&&(e[o--]=a>>8&255),o>=0&&(e[o--]=a>>16&255),6===i?(o>=0&&(e[o--]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(o>=0)for(e[o--]=r;o>=0;)e[o--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,o=0;return t>=4096&&(o+=13,t>>>=13),t>=64&&(o+=7,t>>>=7),t>=8&&(o+=4,t>>>=4),t>=2&&(o+=2,t>>>=2),o+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,o=0;return 0==(8191&t)&&(o+=13,t>>>=13),0==(127&t)&&(o+=7,t>>>=7),0==(15&t)&&(o+=4,t>>>=4),0==(3&t)&&(o+=2,t>>>=2),0==(1&t)&&o++,o},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var o=0;oe.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,o;this.length>e.length?(t=this,o=e):(t=e,o=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),o=e%26;this._expand(t),o>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-o),this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var o=e/26|0,r=e%26;return this._expand(o+1),this.words[o]=t?this.words[o]|1<e.length?(o=this,r=e):(o=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=o.length,0!==n)this.words[this.length]=n,this.length++;else if(o!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var o,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(o=this,r=e):(o=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],h=8191&d,p=d>>>13,g=0|a[2],b=8191&g,y=g>>>13,v=0|a[3],k=8191&v,w=v>>>13,x=0|a[4],z=8191&x,j=x>>>13,M=0|a[5],A=8191&M,q=M>>>13,I=0|a[6],E=8191&I,S=I>>>13,N=0|a[7],_=8191&N,T=N>>>13,O=0|a[8],C=8191&O,D=O>>>13,L=0|a[9],P=8191&L,R=L>>>13,B=0|s[0],U=8191&B,F=B>>>13,Q=0|s[1],Y=8191&Q,H=Q>>>13,G=0|s[2],W=8191&G,Z=G>>>13,V=0|s[3],K=8191&V,J=V>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],oe=8191&te,re=te>>>13,ne=0|s[6],ie=8191&ne,ae=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,le=0|s[8],me=8191&le,fe=le>>>13,de=0|s[9],he=8191&de,pe=de>>>13;o.negative=e.negative^t.negative,o.length=19;var ge=(u+(r=Math.imul(m,U))|0)+((8191&(n=(n=Math.imul(m,F))+Math.imul(f,U)|0))<<13)|0;u=((i=Math.imul(f,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(h,U),n=(n=Math.imul(h,F))+Math.imul(p,U)|0,i=Math.imul(p,F);var be=(u+(r=r+Math.imul(m,Y)|0)|0)+((8191&(n=(n=n+Math.imul(m,H)|0)+Math.imul(f,Y)|0))<<13)|0;u=((i=i+Math.imul(f,H)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(b,U),n=(n=Math.imul(b,F))+Math.imul(y,U)|0,i=Math.imul(y,F),r=r+Math.imul(h,Y)|0,n=(n=n+Math.imul(h,H)|0)+Math.imul(p,Y)|0,i=i+Math.imul(p,H)|0;var ye=(u+(r=r+Math.imul(m,W)|0)|0)+((8191&(n=(n=n+Math.imul(m,Z)|0)+Math.imul(f,W)|0))<<13)|0;u=((i=i+Math.imul(f,Z)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(k,U),n=(n=Math.imul(k,F))+Math.imul(w,U)|0,i=Math.imul(w,F),r=r+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(y,Y)|0,i=i+Math.imul(y,H)|0,r=r+Math.imul(h,W)|0,n=(n=n+Math.imul(h,Z)|0)+Math.imul(p,W)|0,i=i+Math.imul(p,Z)|0;var ve=(u+(r=r+Math.imul(m,K)|0)|0)+((8191&(n=(n=n+Math.imul(m,J)|0)+Math.imul(f,K)|0))<<13)|0;u=((i=i+Math.imul(f,J)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(z,U),n=(n=Math.imul(z,F))+Math.imul(j,U)|0,i=Math.imul(j,F),r=r+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,H)|0)+Math.imul(w,Y)|0,i=i+Math.imul(w,H)|0,r=r+Math.imul(b,W)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,Z)|0,r=r+Math.imul(h,K)|0,n=(n=n+Math.imul(h,J)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,J)|0;var ke=(u+(r=r+Math.imul(m,$)|0)|0)+((8191&(n=(n=n+Math.imul(m,ee)|0)+Math.imul(f,$)|0))<<13)|0;u=((i=i+Math.imul(f,ee)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(A,U),n=(n=Math.imul(A,F))+Math.imul(q,U)|0,i=Math.imul(q,F),r=r+Math.imul(z,Y)|0,n=(n=n+Math.imul(z,H)|0)+Math.imul(j,Y)|0,i=i+Math.imul(j,H)|0,r=r+Math.imul(k,W)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(w,W)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(b,K)|0,n=(n=n+Math.imul(b,J)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,J)|0,r=r+Math.imul(h,$)|0,n=(n=n+Math.imul(h,ee)|0)+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0;var we=(u+(r=r+Math.imul(m,oe)|0)|0)+((8191&(n=(n=n+Math.imul(m,re)|0)+Math.imul(f,oe)|0))<<13)|0;u=((i=i+Math.imul(f,re)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,U),n=(n=Math.imul(E,F))+Math.imul(S,U)|0,i=Math.imul(S,F),r=r+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,H)|0)+Math.imul(q,Y)|0,i=i+Math.imul(q,H)|0,r=r+Math.imul(z,W)|0,n=(n=n+Math.imul(z,Z)|0)+Math.imul(j,W)|0,i=i+Math.imul(j,Z)|0,r=r+Math.imul(k,K)|0,n=(n=n+Math.imul(k,J)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,J)|0,r=r+Math.imul(b,$)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,ee)|0,r=r+Math.imul(h,oe)|0,n=(n=n+Math.imul(h,re)|0)+Math.imul(p,oe)|0,i=i+Math.imul(p,re)|0;var xe=(u+(r=r+Math.imul(m,ie)|0)|0)+((8191&(n=(n=n+Math.imul(m,ae)|0)+Math.imul(f,ie)|0))<<13)|0;u=((i=i+Math.imul(f,ae)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(_,U),n=(n=Math.imul(_,F))+Math.imul(T,U)|0,i=Math.imul(T,F),r=r+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(S,Y)|0,i=i+Math.imul(S,H)|0,r=r+Math.imul(A,W)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,W)|0,i=i+Math.imul(q,Z)|0,r=r+Math.imul(z,K)|0,n=(n=n+Math.imul(z,J)|0)+Math.imul(j,K)|0,i=i+Math.imul(j,J)|0,r=r+Math.imul(k,$)|0,n=(n=n+Math.imul(k,ee)|0)+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(b,oe)|0,n=(n=n+Math.imul(b,re)|0)+Math.imul(y,oe)|0,i=i+Math.imul(y,re)|0,r=r+Math.imul(h,ie)|0,n=(n=n+Math.imul(h,ae)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,ae)|0;var ze=(u+(r=r+Math.imul(m,ce)|0)|0)+((8191&(n=(n=n+Math.imul(m,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((i=i+Math.imul(f,ue)|0)+(n>>>13)|0)+(ze>>>26)|0,ze&=67108863,r=Math.imul(C,U),n=(n=Math.imul(C,F))+Math.imul(D,U)|0,i=Math.imul(D,F),r=r+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,H)|0)+Math.imul(T,Y)|0,i=i+Math.imul(T,H)|0,r=r+Math.imul(E,W)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,Z)|0,r=r+Math.imul(A,K)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,K)|0,i=i+Math.imul(q,J)|0,r=r+Math.imul(z,$)|0,n=(n=n+Math.imul(z,ee)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,ee)|0,r=r+Math.imul(k,oe)|0,n=(n=n+Math.imul(k,re)|0)+Math.imul(w,oe)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(b,ie)|0,n=(n=n+Math.imul(b,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0,r=r+Math.imul(h,ce)|0,n=(n=n+Math.imul(h,ue)|0)+Math.imul(p,ce)|0,i=i+Math.imul(p,ue)|0;var je=(u+(r=r+Math.imul(m,me)|0)|0)+((8191&(n=(n=n+Math.imul(m,fe)|0)+Math.imul(f,me)|0))<<13)|0;u=((i=i+Math.imul(f,fe)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(P,U),n=(n=Math.imul(P,F))+Math.imul(R,U)|0,i=Math.imul(R,F),r=r+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,H)|0)+Math.imul(D,Y)|0,i=i+Math.imul(D,H)|0,r=r+Math.imul(_,W)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(T,W)|0,i=i+Math.imul(T,Z)|0,r=r+Math.imul(E,K)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(S,K)|0,i=i+Math.imul(S,J)|0,r=r+Math.imul(A,$)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,$)|0,i=i+Math.imul(q,ee)|0,r=r+Math.imul(z,oe)|0,n=(n=n+Math.imul(z,re)|0)+Math.imul(j,oe)|0,i=i+Math.imul(j,re)|0,r=r+Math.imul(k,ie)|0,n=(n=n+Math.imul(k,ae)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,ae)|0,r=r+Math.imul(b,ce)|0,n=(n=n+Math.imul(b,ue)|0)+Math.imul(y,ce)|0,i=i+Math.imul(y,ue)|0,r=r+Math.imul(h,me)|0,n=(n=n+Math.imul(h,fe)|0)+Math.imul(p,me)|0,i=i+Math.imul(p,fe)|0;var Me=(u+(r=r+Math.imul(m,he)|0)|0)+((8191&(n=(n=n+Math.imul(m,pe)|0)+Math.imul(f,he)|0))<<13)|0;u=((i=i+Math.imul(f,pe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(P,Y),n=(n=Math.imul(P,H))+Math.imul(R,Y)|0,i=Math.imul(R,H),r=r+Math.imul(C,W)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(D,W)|0,i=i+Math.imul(D,Z)|0,r=r+Math.imul(_,K)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(T,K)|0,i=i+Math.imul(T,J)|0,r=r+Math.imul(E,$)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,r=r+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,re)|0)+Math.imul(q,oe)|0,i=i+Math.imul(q,re)|0,r=r+Math.imul(z,ie)|0,n=(n=n+Math.imul(z,ae)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,ae)|0,r=r+Math.imul(k,ce)|0,n=(n=n+Math.imul(k,ue)|0)+Math.imul(w,ce)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(b,me)|0,n=(n=n+Math.imul(b,fe)|0)+Math.imul(y,me)|0,i=i+Math.imul(y,fe)|0;var Ae=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(n=(n=n+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;u=((i=i+Math.imul(p,pe)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(P,W),n=(n=Math.imul(P,Z))+Math.imul(R,W)|0,i=Math.imul(R,Z),r=r+Math.imul(C,K)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,J)|0,r=r+Math.imul(_,$)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,r=r+Math.imul(E,oe)|0,n=(n=n+Math.imul(E,re)|0)+Math.imul(S,oe)|0,i=i+Math.imul(S,re)|0,r=r+Math.imul(A,ie)|0,n=(n=n+Math.imul(A,ae)|0)+Math.imul(q,ie)|0,i=i+Math.imul(q,ae)|0,r=r+Math.imul(z,ce)|0,n=(n=n+Math.imul(z,ue)|0)+Math.imul(j,ce)|0,i=i+Math.imul(j,ue)|0,r=r+Math.imul(k,me)|0,n=(n=n+Math.imul(k,fe)|0)+Math.imul(w,me)|0,i=i+Math.imul(w,fe)|0;var qe=(u+(r=r+Math.imul(b,he)|0)|0)+((8191&(n=(n=n+Math.imul(b,pe)|0)+Math.imul(y,he)|0))<<13)|0;u=((i=i+Math.imul(y,pe)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,r=Math.imul(P,K),n=(n=Math.imul(P,J))+Math.imul(R,K)|0,i=Math.imul(R,J),r=r+Math.imul(C,$)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(D,$)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,re)|0)+Math.imul(T,oe)|0,i=i+Math.imul(T,re)|0,r=r+Math.imul(E,ie)|0,n=(n=n+Math.imul(E,ae)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,r=r+Math.imul(A,ce)|0,n=(n=n+Math.imul(A,ue)|0)+Math.imul(q,ce)|0,i=i+Math.imul(q,ue)|0,r=r+Math.imul(z,me)|0,n=(n=n+Math.imul(z,fe)|0)+Math.imul(j,me)|0,i=i+Math.imul(j,fe)|0;var Ie=(u+(r=r+Math.imul(k,he)|0)|0)+((8191&(n=(n=n+Math.imul(k,pe)|0)+Math.imul(w,he)|0))<<13)|0;u=((i=i+Math.imul(w,pe)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(P,$),n=(n=Math.imul(P,ee))+Math.imul(R,$)|0,i=Math.imul(R,ee),r=r+Math.imul(C,oe)|0,n=(n=n+Math.imul(C,re)|0)+Math.imul(D,oe)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(_,ie)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,ae)|0,r=r+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,i=i+Math.imul(S,ue)|0,r=r+Math.imul(A,me)|0,n=(n=n+Math.imul(A,fe)|0)+Math.imul(q,me)|0,i=i+Math.imul(q,fe)|0;var Ee=(u+(r=r+Math.imul(z,he)|0)|0)+((8191&(n=(n=n+Math.imul(z,pe)|0)+Math.imul(j,he)|0))<<13)|0;u=((i=i+Math.imul(j,pe)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(P,oe),n=(n=Math.imul(P,re))+Math.imul(R,oe)|0,i=Math.imul(R,re),r=r+Math.imul(C,ie)|0,n=(n=n+Math.imul(C,ae)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,ae)|0,r=r+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(T,ce)|0,i=i+Math.imul(T,ue)|0,r=r+Math.imul(E,me)|0,n=(n=n+Math.imul(E,fe)|0)+Math.imul(S,me)|0,i=i+Math.imul(S,fe)|0;var Se=(u+(r=r+Math.imul(A,he)|0)|0)+((8191&(n=(n=n+Math.imul(A,pe)|0)+Math.imul(q,he)|0))<<13)|0;u=((i=i+Math.imul(q,pe)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(P,ie),n=(n=Math.imul(P,ae))+Math.imul(R,ie)|0,i=Math.imul(R,ae),r=r+Math.imul(C,ce)|0,n=(n=n+Math.imul(C,ue)|0)+Math.imul(D,ce)|0,i=i+Math.imul(D,ue)|0,r=r+Math.imul(_,me)|0,n=(n=n+Math.imul(_,fe)|0)+Math.imul(T,me)|0,i=i+Math.imul(T,fe)|0;var Ne=(u+(r=r+Math.imul(E,he)|0)|0)+((8191&(n=(n=n+Math.imul(E,pe)|0)+Math.imul(S,he)|0))<<13)|0;u=((i=i+Math.imul(S,pe)|0)+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(P,ce),n=(n=Math.imul(P,ue))+Math.imul(R,ce)|0,i=Math.imul(R,ue),r=r+Math.imul(C,me)|0,n=(n=n+Math.imul(C,fe)|0)+Math.imul(D,me)|0,i=i+Math.imul(D,fe)|0;var _e=(u+(r=r+Math.imul(_,he)|0)|0)+((8191&(n=(n=n+Math.imul(_,pe)|0)+Math.imul(T,he)|0))<<13)|0;u=((i=i+Math.imul(T,pe)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(P,me),n=(n=Math.imul(P,fe))+Math.imul(R,me)|0,i=Math.imul(R,fe);var Te=(u+(r=r+Math.imul(C,he)|0)|0)+((8191&(n=(n=n+Math.imul(C,pe)|0)+Math.imul(D,he)|0))<<13)|0;u=((i=i+Math.imul(D,pe)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863;var Oe=(u+(r=Math.imul(P,he))|0)+((8191&(n=(n=Math.imul(P,pe))+Math.imul(R,he)|0))<<13)|0;return u=((i=Math.imul(R,pe))+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,c[0]=ge,c[1]=be,c[2]=ye,c[3]=ve,c[4]=ke,c[5]=we,c[6]=xe,c[7]=ze,c[8]=je,c[9]=Me,c[10]=Ae,c[11]=qe,c[12]=Ie,c[13]=Ee,c[14]=Se,c[15]=Ne,c[16]=_e,c[17]=Te,c[18]=Oe,0!==u&&(c[19]=u,o.length++),o};function y(e,t,o){o.negative=t.negative^e.negative,o.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0)>>>26,a&=67108863}o.words[i]=s,r=a,a=n}return 0!==r?o.words[i]=r:o.length--,o._strip()}function v(e,t,o){return y(e,t,o)}function k(e,t){this.x=e,this.y=t}Math.imul||(b=g),a.prototype.mulTo=function(e,t){var o=this.length+e.length;return 10===this.length&&10===e.length?b(this,e,t):o<63?g(this,e,t):o<1024?y(this,e,t):v(this,e,t)},k.prototype.makeRBT=function(e){for(var t=new Array(e),o=a.prototype._countBits(e)-1,r=0;r>=1;return r},k.prototype.permute=function(e,t,o,r,n,i){for(var a=0;a>>=1)n++;return 1<>>=13,o[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,o+=i/67108864|0,o+=a>>>26,this.words[r]=67108863&a}return 0!==o&&(this.words[r]=o,this.length++),t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),o=0;o>>n&1}return t}(e);if(0===t.length)return new a(1);for(var o=this,r=0;r=0);var t,o=e%26,r=(e-o)/26,i=67108863>>>26-o<<26-o;if(0!==o){var a=0;for(t=0;t>>26-o}a&&(this.words[t]=a,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=r);u--){var m=0|this.words[u];this.words[u]=l<<26-i|m>>>i,l=m&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,o){return n(0===this.negative),this.iushrn(e,t,o)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,o=(e-t)/26,r=1<=0);var t=e%26,o=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=o)return this;if(0!==t&&o++,this.length=Math.min(o,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[r+o]=67108863&i}for(;r>26,this.words[r+o]=67108863&i;if(0===s)return this._strip();for(n(-1===s),s=0,r=0;r>26,this.words[r]=67108863&i;return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var o=(this.length,e.length),r=this.clone(),n=e,i=0|n.words[n.length-1];0!=(o=26-this._countBits(i))&&(n=n.ushln(o),r.iushln(o),i=0|n.words[n.length-1]);var s,c=r.length-n.length;if("mod"!==t){(s=new a(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;m--){var f=67108864*(0|r.words[n.length+m])+(0|r.words[n.length+m-1]);for(f=Math.min(f/i|0,67108863),r._ishlnsubmul(n,f,m);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(n,1,m),r.isZero()||(r.negative^=1);s&&(s.words[m]=f)}return s&&s._strip(),r._strip(),"div"!==t&&0!==o&&r.iushrn(o),{div:s||null,mod:r}},a.prototype.divmod=function(e,t,o){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(r=s.div.neg()),"div"!==t&&(i=s.mod.neg(),o&&0!==i.negative&&i.iadd(e)),{div:r,mod:i}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(r=s.div.neg()),{div:r,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(i=s.mod.neg(),o&&0!==i.negative&&i.isub(e)),{div:s.div,mod:i}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t);var r,i,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var o=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=o.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var o=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(o*r+(0|this.words[i]))%e;return t?-r:r},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var o=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*o;this.words[r]=i/e|0,o=i%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,o=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new a(1),i=new a(0),s=new a(0),c=new a(1),u=0;t.isEven()&&o.isEven();)t.iushrn(1),o.iushrn(1),++u;for(var l=o.clone(),m=t.clone();!t.isZero();){for(var f=0,d=1;0==(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(r.isOdd()||i.isOdd())&&(r.iadd(l),i.isub(m)),r.iushrn(1),i.iushrn(1);for(var h=0,p=1;0==(o.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(o.iushrn(h);h-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(m)),s.iushrn(1),c.iushrn(1);t.cmp(o)>=0?(t.isub(o),r.isub(s),i.isub(c)):(o.isub(t),s.isub(r),c.isub(i))}return{a:s,b:c,gcd:o.iushln(u)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,o=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,i=new a(1),s=new a(0),c=o.clone();t.cmpn(1)>0&&o.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)i.isOdd()&&i.iadd(c),i.iushrn(1);for(var m=0,f=1;0==(o.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(o.iushrn(m);m-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(o)>=0?(t.isub(o),i.isub(s)):(o.isub(t),s.isub(i))}return(r=0===t.cmpn(1)?i:s).cmpn(0)<0&&r.iadd(e),r},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),o=e.clone();t.negative=0,o.negative=0;for(var r=0;t.isEven()&&o.isEven();r++)t.iushrn(1),o.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;o.isEven();)o.iushrn(1);var n=t.cmp(o);if(n<0){var i=t;t=o,o=i}else if(0===n||0===o.cmpn(1))break;t.isub(o)}return o.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,o=(e-t)/26,r=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,o=e<0;if(0!==this.negative&&!o)return-1;if(0===this.negative&&o)return 1;if(this._strip(),this.length>1)t=1;else{o&&(e=-e),n(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;o--){var r=0|this.words[o],n=0|e.words[o];if(r!==n){rn&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new q(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function z(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function j(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function q(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){q.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}x.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,o=e;do{this.split(o,this.tmp),t=(o=(o=this.imulK(o)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?o.isub(this.p):void 0!==o.strip?o.strip():o._strip(),o},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(z,x),z.prototype.split=function(e,t){for(var o=4194303,r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},z.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,o=0;o>>=26,e.words[o]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new z;else if("p224"===e)t=new j;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},q.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},q.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},q.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(m(e,e.umod(this.m)._forceRed(this)),e)},q.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},q.prototype.add=function(e,t){this._verify2(e,t);var o=e.add(t);return o.cmp(this.m)>=0&&o.isub(this.m),o._forceRed(this)},q.prototype.iadd=function(e,t){this._verify2(e,t);var o=e.iadd(t);return o.cmp(this.m)>=0&&o.isub(this.m),o},q.prototype.sub=function(e,t){this._verify2(e,t);var o=e.sub(t);return o.cmpn(0)<0&&o.iadd(this.m),o._forceRed(this)},q.prototype.isub=function(e,t){this._verify2(e,t);var o=e.isub(t);return o.cmpn(0)<0&&o.iadd(this.m),o},q.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},q.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},q.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},q.prototype.isqr=function(e){return this.imul(e,e.clone())},q.prototype.sqr=function(e){return this.mul(e,e)},q.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var o=this.m.add(new a(1)).iushrn(2);return this.pow(e,o)}for(var r=this.m.subn(1),i=0;!r.isZero()&&0===r.andln(1);)i++,r.iushrn(1);n(!r.isZero());var s=new a(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new a(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var m=this.pow(l,r),f=this.pow(e,r.addn(1).iushrn(1)),d=this.pow(e,r),h=i;0!==d.cmp(s);){for(var p=d,g=0;0!==p.cmp(s);g++)p=p.redSqr();n(g=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var m=u>>l&1;n!==o[0]&&(n=this.sqr(n)),0!==m||0!==i?(i<<=1,i|=m,(4==++s||0===r&&0===l)&&(n=this.mul(n,o[i]),s=0,i=0)):s=0}c=26}return n},q.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},q.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new I(e)},i(I,q),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},I.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var o=e.imul(t),r=o.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=o.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},I.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var o=e.mul(t),r=o.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=o.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e)},2202:function(e,t,o){"use strict";var r,n=o(8847)(o(3355));function i(e){this.rand=e}if(e.exports=function(e){return r||(r=new i(null)),r.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),o=0;o>>24]^l[h>>>16&255]^m[p>>>8&255]^f[255&g]^t[b++],a=u[h>>>24]^l[p>>>16&255]^m[g>>>8&255]^f[255&d]^t[b++],s=u[p>>>24]^l[g>>>16&255]^m[d>>>8&255]^f[255&h]^t[b++],c=u[g>>>24]^l[d>>>16&255]^m[h>>>8&255]^f[255&p]^t[b++],d=i,h=a,p=s,g=c;return i=(r[d>>>24]<<24|r[h>>>16&255]<<16|r[p>>>8&255]<<8|r[255&g])^t[b++],a=(r[h>>>24]<<24|r[p>>>16&255]<<16|r[g>>>8&255]<<8|r[255&d])^t[b++],s=(r[p>>>24]<<24|r[g>>>16&255]<<16|r[d>>>8&255]<<8|r[255&h])^t[b++],c=(r[g>>>24]<<24|r[d>>>16&255]<<16|r[h>>>8&255]<<8|r[255&p])^t[b++],[i>>>=0,a>>>=0,s>>>=0,c>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var o=[],r=[],n=[[],[],[],[]],i=[[],[],[],[]],a=0,s=0,c=0;c<256;++c){var u=s^s<<1^s<<2^s<<3^s<<4;u=u>>>8^255&u^99,o[a]=u,r[u]=a;var l=e[a],m=e[l],f=e[m],d=257*e[u]^16843008*u;n[0][a]=d<<24|d>>>8,n[1][a]=d<<16|d>>>16,n[2][a]=d<<8|d>>>24,n[3][a]=d,d=16843009*f^65537*m^257*l^16843008*a,i[0][u]=d<<24|d>>>8,i[1][u]=d<<16|d>>>16,i[2][u]=d<<8|d>>>24,i[3][u]=d,0===a?a=s=1:(a=l^e[e[e[f^l]]],s^=e[e[s]])}return{SBOX:o,INV_SBOX:r,SUB_MIX:n,INV_SUB_MIX:i}}();function u(e){this._key=n(e),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var e=this._key,t=e.length,o=t+6,r=4*(o+1),n=[],i=0;i>>24,a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a],a^=s[i/t|0]<<24):t>6&&i%t==4&&(a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a]),n[i]=n[i-t]^a}for(var u=[],l=0;l>>24]]^c.INV_SUB_MIX[1][c.SBOX[f>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[f>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&f]]}this._nRounds=o,this._keySchedule=n,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(e){return a(e=n(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},u.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),o=r.allocUnsafe(16);return o.writeUInt32BE(t[0],0),o.writeUInt32BE(t[1],4),o.writeUInt32BE(t[2],8),o.writeUInt32BE(t[3],12),o},u.prototype.decryptBlock=function(e){var t=(e=n(e))[1];e[1]=e[3],e[3]=t;var o=a(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),i=r.allocUnsafe(16);return i.writeUInt32BE(o[0],0),i.writeUInt32BE(o[3],4),i.writeUInt32BE(o[2],8),i.writeUInt32BE(o[1],12),i},u.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},e.exports.AES=u},426:function(e,t,o){"use strict";var r=o(7494),n=o(8850).Buffer,i=o(3013),a=o(1736),s=o(6626),c=o(6316),u=o(7557);function l(e,t,o,a){i.call(this);var c=n.alloc(4,0);this._cipher=new r.AES(t);var l=this._cipher.encryptBlock(c);this._ghash=new s(l),o=function(e,t,o){if(12===t.length)return e._finID=n.concat([t,n.from([0,0,0,1])]),n.concat([t,n.from([0,0,0,2])]);var r=new s(o),i=t.length,a=i%16;r.update(t),a&&(a=16-a,r.update(n.alloc(a,0))),r.update(n.alloc(8,0));var c=8*i,l=n.alloc(8);l.writeUIntBE(c,0,8),r.update(l),e._finID=r.state;var m=n.from(e._finID);return u(m),m}(this,o,l),this._prev=n.from(o),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}a(l,i),l.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=n.alloc(t,0),this._ghash.update(t))}this._called=!0;var o=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(o),this._len+=e.length,o},l.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var o=0;e.length!==t.length&&o++;for(var r=Math.min(e.length,t.length),n=0;n16)throw new Error("unable to decrypt data");for(var o=-1;++o16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},m.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var o=i[e.toLowerCase()];if(!o)throw new TypeError("invalid suite type");var r=u(t,!1,o.key,o.iv);return f(e,r.key,r.iv)},t.createDecipheriv=f},5478:function(e,t,o){"use strict";var r=o(8408),n=o(426),i=o(8850).Buffer,a=o(1408),s=o(3013),c=o(7494),u=o(7085);function l(e,t,o){s.call(this),this._cache=new f,this._cipher=new c.AES(t),this._prev=i.from(o),this._mode=e,this._autopadding=!0}o(1736)(l,s),l.prototype._update=function(e){var t,o;this._cache.add(e);for(var r=[];t=this._cache.get();)o=this._mode.encrypt(this,t),r.push(o);return i.concat(r)};var m=i.alloc(16,16);function f(){this.cache=i.allocUnsafe(0)}function d(e,t,o){var s=r[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof o&&(o=i.from(o)),"GCM"!==s.mode&&o.length!==s.iv)throw new TypeError("invalid iv length "+o.length);return"stream"===s.type?new a(s.module,t,o):"auth"===s.type?new n(s.module,t,o):new l(s.module,t,o)}l.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(m))throw this._cipher.scrub(),new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=i.concat([this.cache,e])},f.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},f.prototype.flush=function(){for(var e=16-this.cache.length,t=i.allocUnsafe(e),o=-1;++o>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t0;t--)r[t]=r[t]>>>1|(1&r[t-1])<<31;r[0]=r[0]>>>1,o&&(r[0]=r[0]^225<<24)}this.state=i(n)},a.prototype.update=function(e){var t;for(this.cache=r.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(r.concat([this.cache,n],16)),this.ghash(i([0,e,0,t])),this.state},e.exports=a},7557:function(e){"use strict";e.exports=function(e){for(var t,o=e.length;o--;){if(255!==(t=e.readUInt8(o))){t++,e.writeUInt8(t,o);break}e.writeUInt8(0,o)}}},7427:function(e,t,o){"use strict";var r=o(6316);t.encrypt=function(e,t){var o=r(t,e._prev);return e._prev=e._cipher.encryptBlock(o),e._prev},t.decrypt=function(e,t){var o=e._prev;e._prev=t;var n=e._cipher.decryptBlock(t);return r(n,o)}},4030:function(e,t,o){"use strict";var r=o(8850).Buffer,n=o(6316);function i(e,t,o){var i=t.length,a=n(t,e._cache);return e._cache=e._cache.slice(i),e._prev=r.concat([e._prev,o?t:a]),a}t.encrypt=function(e,t,o){for(var n,a=r.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=r.allocUnsafe(0)),!(e._cache.length<=t.length)){a=r.concat([a,i(e,t,o)]);break}n=e._cache.length,a=r.concat([a,i(e,t.slice(0,n),o)]),t=t.slice(n)}return a}},3206:function(e,t,o){"use strict";var r=o(8850).Buffer;function n(e,t,o){for(var r,n,a=-1,s=0;++a<8;)r=t&1<<7-a?128:0,s+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^r))>>a%8,e._prev=i(e._prev,o?r:n);return s}function i(e,t){var o=e.length,n=-1,i=r.allocUnsafe(e.length);for(e=r.concat([e,r.from([t])]);++n>7;return i}t.encrypt=function(e,t,o){for(var i=t.length,a=r.allocUnsafe(i),s=-1;++s=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function s(e,t){var o=function(e){var t=a(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),i=t.modulus.byteLength(),s=new n(e).mul(o.blinder).umod(t.modulus),c=s.toRed(n.mont(t.prime1)),u=s.toRed(n.mont(t.prime2)),l=t.coefficient,m=t.prime1,f=t.prime2,d=c.redPow(t.exponent1).fromRed(),h=u.redPow(t.exponent2).fromRed(),p=d.isub(h).imul(l).umod(m).imul(f);return h.iadd(p).imul(o.unblinder).umod(t.modulus).toArrayLike(r,"be",i)}s.getr=a,e.exports=s},6561:function(e,t,o){"use strict";e.exports=o(5207)},9527:function(e,t,o){"use strict";var r=o(8850).Buffer,n=o(5866),i=o(6505),a=o(1736),s=o(1628),c=o(5410),u=o(5207);function l(e){i.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=n(t.hash),this._tag=t.id,this._signType=t.sign}function m(e){i.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hash=n(t.hash),this._tag=t.id,this._signType=t.sign}function f(e){return new l(e)}function d(e){return new m(e)}Object.keys(u).forEach((function(e){u[e].id=r.from(u[e].id,"hex"),u[e.toLowerCase()]=u[e]})),a(l,i.Writable),l.prototype._write=function(e,t,o){this._hash.update(e),o()},l.prototype.update=function(e,t){return"string"==typeof e&&(e=r.from(e,t)),this._hash.update(e),this},l.prototype.sign=function(e,t){this.end();var o=this._hash.digest(),r=s(o,e,this._hashType,this._signType,this._tag);return t?r.toString(t):r},a(m,i.Writable),m.prototype._write=function(e,t,o){this._hash.update(e),o()},m.prototype.update=function(e,t){return"string"==typeof e&&(e=r.from(e,t)),this._hash.update(e),this},m.prototype.verify=function(e,t,o){"string"==typeof t&&(t=r.from(t,o)),this.end();var n=this._hash.digest();return c(t,n,e,this._signType,this._tag)},e.exports={Sign:f,Verify:d,createSign:f,createVerify:d}},1628:function(e,t,o){"use strict";var r=o(8850).Buffer,n=o(4424),i=o(9782),a=o(6597).ec,s=o(1734),c=o(7552),u=o(1308);function l(e,t,o,i){if((e=r.from(e.toArray())).length0&&o.ishrn(r),o}function f(e,t,o){var i,a;do{for(i=r.alloc(0);8*i.length=t)throw new Error("invalid sig")}e.exports=function(e,t,o,u,l){var m=a(o);if("ec"===m.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(e,t,o){var r=s[o.data.algorithm.curve.join(".")];if(!r)throw new Error("unknown curve "+o.data.algorithm.curve.join("."));var n=new i(r),a=o.data.subjectPrivateKey.data;return n.verify(t,e,a)}(e,t,m)}if("dsa"===m.type){if("dsa"!==u)throw new Error("wrong public key type");return function(e,t,o){var r=o.data.p,i=o.data.q,s=o.data.g,u=o.data.pub_key,l=a.signature.decode(e,"der"),m=l.s,f=l.r;c(m,i),c(f,i);var d=n.mont(r),h=m.invm(i);return 0===s.toRed(d).redPow(new n(t).mul(h).mod(i)).fromRed().mul(u.toRed(d).redPow(f.mul(h).mod(i)).fromRed()).mod(r).mod(i).cmp(f)}(e,t,m)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");t=r.concat([l,t]);for(var f=m.modulus.byteLength(),d=[1],h=0;t.length+d.length+2=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var o=e.length;if(0===o)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*o;case"hex":return o>>>1;case"base64":return U(e).length;default:if(r)return B(e).length;t=(""+t).toLowerCase(),r=!0}}function p(e,t,o){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===o||o>this.length)&&(o=this.length),o<=0)return"";if((o>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,o);case"utf8":case"utf-8":return A(this,t,o);case"ascii":return I(this,t,o);case"latin1":case"binary":return E(this,t,o);case"base64":return M(this,t,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,o);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,o){var r=e[t];e[t]=e[o],e[o]=r}function b(e,t,o,r,n){if(0===e.length)return-1;if("string"==typeof o?(r=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),o=+o,isNaN(o)&&(o=n?0:e.length-1),o<0&&(o=e.length+o),o>=e.length){if(n)return-1;o=e.length-1}else if(o<0){if(!n)return-1;o=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:y(e,t,o,r,n);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,o):Uint8Array.prototype.lastIndexOf.call(e,t,o):y(e,[t],o,r,n);throw new TypeError("val must be string, number or Buffer")}function y(e,t,o,r,n){var i,a=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,o/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var l=-1;for(i=o;is&&(o=s-c),i=o;i>=0;i--){for(var m=!0,f=0;fn&&(r=n):r=n;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,n=o%256,i.push(n),i.push(r);return i}(t,e.length-o),e,o,r)}function M(e,t,o){return 0===t&&o===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,o))}function A(e,t,o){o=Math.min(e.length,o);for(var r=[],n=t;n239?4:u>223?3:u>191?2:1;if(n+m<=o)switch(m){case 1:u<128&&(l=u);break;case 2:128==(192&(i=e[n+1]))&&(c=(31&u)<<6|63&i)>127&&(l=c);break;case 3:i=e[n+1],a=e[n+2],128==(192&i)&&128==(192&a)&&(c=(15&u)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:i=e[n+1],a=e[n+2],s=e[n+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(l=c)}null===l?(l=65533,m=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),n+=m}return function(e){var t=e.length;if(t<=q)return String.fromCharCode.apply(String,e);for(var o="",r=0;r0&&(e=this.toString("hex",0,o).match(/.{2}/g).join(" "),this.length>o&&(e+=" ... ")),""},c.prototype.compare=function(e,t,o,r,n){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===o&&(o=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||o>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=o)return 0;if(r>=n)return-1;if(t>=o)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(r>>>=0),a=(o>>>=0)-(t>>>=0),s=Math.min(i,a),u=this.slice(r,n),l=e.slice(t,o),m=0;mn)&&(o=n),e.length>0&&(o<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return v(this,e,t,o);case"utf8":case"utf-8":return k(this,e,t,o);case"ascii":return w(this,e,t,o);case"latin1":case"binary":return x(this,e,t,o);case"base64":return z(this,e,t,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,o);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var q=4096;function I(e,t,o){var r="";o=Math.min(e.length,o);for(var n=t;nn)&&(o=n);for(var i="",a=t;ao)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,o,r,n,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function O(e,t,o,r){t<0&&(t=65535+t+1);for(var n=0,i=Math.min(e.length-o,2);n>>8*(r?n:1-n)}function C(e,t,o,r){t<0&&(t=4294967295+t+1);for(var n=0,i=Math.min(e.length-o,4);n>>8*(r?n:3-n)&255}function D(e,t,o,r,n,i){if(o+r>e.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function L(e,t,o,r,i){return i||D(e,0,o,4),n.write(e,t,o,r,23,4),o+4}function P(e,t,o,r,i){return i||D(e,0,o,8),n.write(e,t,o,r,52,8),o+8}c.prototype.slice=function(e,t){var o,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(n*=256);)r+=this[e+--t]*n;return r},c.prototype.readUInt8=function(e,t){return t||_(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||_(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||_(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||_(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||_(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,o){e|=0,t|=0,o||_(e,t,this.length);for(var r=this[e],n=1,i=0;++i=(n*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,o){e|=0,t|=0,o||_(e,t,this.length);for(var r=t,n=1,i=this[e+--r];r>0&&(n*=256);)i+=this[e+--r]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||_(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||_(e,2,this.length);var o=this[e]|this[e+1]<<8;return 32768&o?4294901760|o:o},c.prototype.readInt16BE=function(e,t){t||_(e,2,this.length);var o=this[e+1]|this[e]<<8;return 32768&o?4294901760|o:o},c.prototype.readInt32LE=function(e,t){return t||_(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||_(e,4,this.length),n.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||_(e,4,this.length),n.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||_(e,8,this.length),n.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||_(e,8,this.length),n.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,o,r){e=+e,t|=0,o|=0,r||T(this,e,t,o,Math.pow(2,8*o)-1,0);var n=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+n]=e/i&255;return t+o},c.prototype.writeUInt8=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,o,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*o-1);T(this,e,t,o,n-1,-n)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+o},c.prototype.writeIntBE=function(e,t,o,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*o-1);T(this,e,t,o,n-1,-n)}var i=o-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+o},c.prototype.writeInt8=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,o){return e=+e,t|=0,o||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,o){return L(this,e,t,!0,o)},c.prototype.writeFloatBE=function(e,t,o){return L(this,e,t,!1,o)},c.prototype.writeDoubleLE=function(e,t,o){return P(this,e,t,!0,o)},c.prototype.writeDoubleBE=function(e,t,o){return P(this,e,t,!1,o)},c.prototype.copy=function(e,t,o,r){if(o||(o=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--n)e[n+t]=this[n+o];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,o=void 0===o?this.length:o>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&o<57344){if(!n){if(o>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}n=o;continue}if(o<56320){(t-=3)>-1&&i.push(239,191,189),n=o;continue}o=65536+(n-55296<<10|o-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,o<128){if((t-=1)<0)break;i.push(o)}else if(o<2048){if((t-=2)<0)break;i.push(o>>6|192,63&o|128)}else if(o<65536){if((t-=3)<0)break;i.push(o>>12|224,o>>6&63|128,63&o|128)}else{if(!(o<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}}return i}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,o,r){for(var n=0;n=t.length||n>=e.length);++n)t[n+o]=e[n];return n}},3675:function(e){"use strict";e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},593:function(e,t,o){"use strict";var r=o(7701),n=o(4373),i=n(r("String.prototype.indexOf"));e.exports=function(e,t){var o=r(e,!!t);return"function"==typeof o&&i(e,".prototype.")>-1?n(o):o}},4373:function(e,t,o){"use strict";var r=o(3767),n=o(7701),i=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),s=n("%Reflect.apply%",!0)||r.call(a,i),c=n("%Object.getOwnPropertyDescriptor%",!0),u=n("%Object.defineProperty%",!0),l=n("%Math.max%");if(u)try{u({},"a",{value:1})}catch(e){u=null}e.exports=function(e){var t=s(r,a,arguments);return c&&u&&c(t,"length").configurable&&u(t,"length",{value:1+l(0,e.length-(arguments.length-1))}),t};var m=function(){return s(r,i,arguments)};u?u(e.exports,"apply",{value:m}):e.exports.apply=m},7759:function(e,t,o){"use strict";for(var r=o(8847)(o(4519)),n=o(3630),i={},a=0,s=Object.entries(n);a0&&void 0!==arguments[0]?arguments[0]:this.multibaseName;if(this.string&&e===this.multibaseName)return this.string;var t=null;if(0===this.version){if("base58btc"!==e)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");t=s.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");t=c.encode(e,this.buffer).toString()}return e===this.multibaseName&&Object.defineProperty(this,"string",{value:t}),t}},{key:e,value:function(){return"CID("+this.toString()+")"}},{key:"toString",value:function(e){return this.toBaseEncodedString(e)}},{key:"toJSON",value:function(){return{codec:this.codec,version:this.version,hash:this.multihash}}},{key:"equals",value:function(e){return this.codec===e.codec&&this.version===e.version&&this.multihash.equals(e.multihash)}}],[{key:"validateCID",value:function(e){var t=m.checkCIDComponents(e);if(t)throw new Error(t)}}]),t}(Symbol.for("nodejs.util.inspect.custom")),{className:"CID",symbolName:"@ipld/js-cid/CID"});f.codecs=l,e.exports=f},3013:function(e,t,o){"use strict";var r=o(8850).Buffer,n=o(7245).Transform,i=o(3462).s;function a(e){n.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}o(1736)(a,n),a.prototype.update=function(e,t,o){"string"==typeof e&&(e=r.from(e,t));var n=this._update(e);return this.hashMode?this:(o&&(n=this._toString(n,o)),n)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,o){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){r=e}finally{o(r)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||r.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,o){if(this._decoder||(this._decoder=new i(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return o&&(r+=this._decoder.end()),r},e.exports=a},3162:function(e,t,o){"use strict";var r=o(8847),n=r(o(4727)),i=r(o(775)),a=r(o(9721)),s=r(o(8985)),c=r(o(8975)),u=r(o(5163)),l=r(o(4650)),m=r(o(1949));e.exports=function(e,t){var o=t.className,r=t.symbolName,n=Symbol.for(r),f=(0,i.default)({},o,function(e,t){(0,u.default)(d,e);var r,i,f=(r=d,i=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(e){return!1}}(),function(){var e,t=(0,m.default)(r);if(i){var o=(0,m.default)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return(0,l.default)(this,e)});function d(){var e;(0,a.default)(this,d);for(var t=arguments.length,o=new Array(t),r=0;r>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1,t[o]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}(),o=function(e){var t=0,o=0,r=0,n="undefined"!=typeof Int32Array?new Int32Array(4096):new Array(4096);for(r=0;256!=r;++r)n[r]=e[r];for(r=0;256!=r;++r)for(o=e[r],t=256+r;t<4096;t+=256)o=n[t]=o>>>8^e[255&o];var i=[];for(r=1;16!=r;++r)i[r-1]="undefined"!=typeof Int32Array?n.subarray(256*r,256*r+256):n.slice(256*r,256*r+256);return i}(t),r=o[0],n=o[1],i=o[2],a=o[3],s=o[4],c=o[5],u=o[6],l=o[7],m=o[8],f=o[9],d=o[10],h=o[11],p=o[12],g=o[13],b=o[14];e.table=t,e.bstr=function(e,o){for(var r=-1^o,n=0,i=e.length;n>>8^t[255&(r^e.charCodeAt(n++))];return~r},e.buf=function(e,o){for(var y=-1^o,v=e.length-15,k=0;k>8&255]^p[e[k++]^y>>16&255]^h[e[k++]^y>>>24]^d[e[k++]]^f[e[k++]]^m[e[k++]]^l[e[k++]]^u[e[k++]]^c[e[k++]]^s[e[k++]]^a[e[k++]]^i[e[k++]]^n[e[k++]]^r[e[k++]]^t[e[k++]];for(v+=15;k>>8^t[255&(y^e[k++])];return~y},e.str=function(e,o){for(var r=-1^o,n=0,i=e.length,a=0,s=0;n>>8^t[255&(r^a)]:a<2048?r=(r=r>>>8^t[255&(r^(192|a>>6&31))])>>>8^t[255&(r^(128|63&a))]:a>=55296&&a<57344?(a=64+(1023&a),s=1023&e.charCodeAt(n++),r=(r=(r=(r=r>>>8^t[255&(r^(240|a>>8&7))])>>>8^t[255&(r^(128|a>>2&63))])>>>8^t[255&(r^(128|s>>6&15|(3&a)<<4))])>>>8^t[255&(r^(128|63&s))]):r=(r=(r=r>>>8^t[255&(r^(224|a>>12&15))])>>>8^t[255&(r^(128|a>>6&63))])>>>8^t[255&(r^(128|63&a))];return~r}},"undefined"==typeof DO_NOT_EXPORT_CRC?"object"===(0,i.default)(t)?n(t):(r=function(){var e={};return n(e),e}.call(t,o,t,e),void 0===r||(e.exports=r)):n({})},5102:function(e,t,o){"use strict";var r=o(9033).Buffer,n=o(6597),i=o(1734);e.exports=function(e){return new s(e)};var a={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function s(e){this.curveType=a[e],this.curveType||(this.curveType={name:e}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function c(e,t,o){Array.isArray(e)||(e=e.toArray());var n=new r(e);if(o&&n.lengtho?t=("rmd160"===e?new c:u(e)).update(t).digest():t.lengths?t=e(t):t.length-1};function i(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return o.iterable&&(t[Symbol.iterator]=function(){return t}),t}function c(e){this.map={},e instanceof c?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function u(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function l(e){return new Promise((function(t,o){e.onload=function(){t(e.result)},e.onerror=function(){o(e.error)}}))}function m(e){var t=new FileReader,o=l(t);return t.readAsArrayBuffer(e),o}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o.arrayBuffer&&o.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||n(e))?this._bodyArrayBuffer=f(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var e=u(this);if(e)return e;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?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var e,t,o,r=u(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,o=l(t=new FileReader),t.readAsText(e),o;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),o=new Array(t.length),r=0;r-1?r:o),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function g(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var o=e.split("="),r=o.shift().replace(/\+/g," "),n=o.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(n))}})),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}p.prototype.clone=function(){return new p(this,{body:this._bodyInit})},d.call(p.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var y=[301,302,303,307,308];b.redirect=function(e,t){if(-1===y.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var o=Error(e);this.stack=o.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function v(e,r){return new Promise((function(n,i){var a=new p(e,r);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e,t,o={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var o=e.split(":"),r=o.shift().trim();if(r){var n=o.join(":").trim();t.append(r,n)}})),t)};o.url="responseURL"in s?s.responseURL:o.headers.get("X-Request-URL");var r="response"in s?s.response:s.responseText;n(new b(r,o))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o.blob&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}v.polyfill=!0,e.fetch||(e.fetch=v,e.Headers=c,e.Request=p,e.Response=b),t.Headers=c,t.Request=p,t.Response=b,t.fetch=v,Object.defineProperty(t,"__esModule",{value:!0})}({})}("undefined"!=typeof self?self:void 0)},4293:function(e,t,o){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=o(5010),t.createHash=t.Hash=o(5866),t.createHmac=t.Hmac=o(4424);var r=o(6561),n=Object.keys(r),i=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);t.getHashes=function(){return i};var a=o(4192);t.pbkdf2=a.pbkdf2,t.pbkdf2Sync=a.pbkdf2Sync;var s=o(6805);t.Cipher=s.Cipher,t.createCipher=s.createCipher,t.Cipheriv=s.Cipheriv,t.createCipheriv=s.createCipheriv,t.Decipher=s.Decipher,t.createDecipher=s.createDecipher,t.Decipheriv=s.Decipheriv,t.createDecipheriv=s.createDecipheriv,t.getCiphers=s.getCiphers,t.listCiphers=s.listCiphers;var c=o(8333);t.DiffieHellmanGroup=c.DiffieHellmanGroup,t.createDiffieHellmanGroup=c.createDiffieHellmanGroup,t.getDiffieHellman=c.getDiffieHellman,t.createDiffieHellman=c.createDiffieHellman,t.DiffieHellman=c.DiffieHellman;var u=o(9527);t.createSign=u.createSign,t.Sign=u.Sign,t.createVerify=u.createVerify,t.Verify=u.Verify,t.createECDH=o(5102);var l=o(6991);t.publicEncrypt=l.publicEncrypt,t.privateEncrypt=l.privateEncrypt,t.publicDecrypt=l.publicDecrypt,t.privateDecrypt=l.privateDecrypt;var m=o(6509);t.randomFill=m.randomFill,t.randomFillSync=m.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},34:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n="%[a-f0-9]{2}",i=new RegExp("("+n+")|([^%]+?)","gi"),a=new RegExp("("+n+")+","gi");function s(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var o=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],s(o),s(r))}function c(e){try{return decodeURIComponent(e)}catch(r){for(var t=e.match(i)||[],o=1;o0;r--)t+=this._buffer(e,t),o+=this._flushBuffer(n,o);return t+=this._buffer(e,t),n},n.prototype.final=function(e){var t,o;return e&&(t=this.update(e)),o="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(o):o},n.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>1];o=i.r28shl(o,s),n=i.r28shl(n,s),i.pc2(o,n,e.keys,a)}},c.prototype._update=function(e,t,o,r){var n=this._desState,a=i.readUInt32BE(e,t),s=i.readUInt32BE(e,t+4);i.ip(a,s,n.tmp,0),a=n.tmp[0],s=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,s,n.tmp,0):this._decrypt(n,a,s,n.tmp,0),a=n.tmp[0],s=n.tmp[1],i.writeUInt32BE(o,a,r),i.writeUInt32BE(o,s,r+4)},c.prototype._pad=function(e,t){for(var o=e.length-t,r=t;r>>0,a=f}i.rip(s,a,r,n)},c.prototype._decrypt=function(e,t,o,r,n){for(var a=o,s=t,c=e.keys.length-2;c>=0;c-=2){var u=e.keys[c],l=e.keys[c+1];i.expand(a,e.tmp,0),u^=e.tmp[0],l^=e.tmp[1];var m=i.substitute(u,l),f=a;a=(s^i.permute(m))>>>0,s=f}i.rip(a,s,r,n)}},9413:function(e,t,o){"use strict";var r=o(4504),n=o(1736),i=o(9591),a=o(3049);function s(e,t){r.equal(t.length,24,"Invalid key length");var o=t.slice(0,8),n=t.slice(8,16),i=t.slice(16,24);this.ciphers="encrypt"===e?[a.create({type:"encrypt",key:o}),a.create({type:"decrypt",key:n}),a.create({type:"encrypt",key:i})]:[a.create({type:"decrypt",key:i}),a.create({type:"encrypt",key:n}),a.create({type:"decrypt",key:o})]}function c(e){i.call(this,e);var t=new s(this.type,this.options.key);this._edeState=t}n(c,i),e.exports=c,c.create=function(e){return new c(e)},c.prototype._update=function(e,t,o,r){var n=this._edeState;n.ciphers[0]._update(e,t,o,r),n.ciphers[1]._update(o,r,o,r),n.ciphers[2]._update(o,r,o,r)},c.prototype._pad=a.prototype._pad,c.prototype._unpad=a.prototype._unpad},319:function(e,t){"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,o){e[0+o]=t>>>24,e[1+o]=t>>>16&255,e[2+o]=t>>>8&255,e[3+o]=255&t},t.ip=function(e,t,o,r){for(var n=0,i=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)i<<=1,i|=t>>>s+a&1;for(s=1;s<=25;s+=8)i<<=1,i|=e>>>s+a&1}o[r+0]=n>>>0,o[r+1]=i>>>0},t.rip=function(e,t,o,r){for(var n=0,i=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)n<<=1,n|=t>>>s+a&1,n<<=1,n|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;o[r+0]=n>>>0,o[r+1]=i>>>0},t.pc1=function(e,t,o,r){for(var n=0,i=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;o[r+0]=n>>>0,o[r+1]=i>>>0},t.r28shl=function(e,t){return e<>>28-t};var o=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,r,n){for(var i=0,a=0,s=o.length>>>1,c=0;c>>o[c]&1;for(c=s;c>>o[c]&1;r[n+0]=i>>>0,r[n+1]=a>>>0},t.expand=function(e,t,o){var r=0,n=0;r=(1&e)<<5|e>>>27;for(var i=23;i>=15;i-=4)r<<=6,r|=e>>>i&63;for(i=11;i>=3;i-=4)n|=e>>>i&63,n<<=6;n|=(31&e)<<1|e>>>31,t[o+0]=r>>>0,t[o+1]=n>>>0};var r=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var o=0,n=0;n<4;n++)o<<=4,o|=r[64*n+(e>>>18-6*n&63)];for(n=0;n<4;n++)o<<=4,o|=r[256+64*n+(t>>>18-6*n&63)];return o>>>0};var n=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,o=0;o>>n[o]&1;return t>>>0},t.padSplit=function(e,t,o){for(var r=e.toString(2);r.lengthe;)o.ishrn(1);if(o.isEven()&&o.iadd(s),o.testn(1)||o.iadd(c),t.cmp(c)){if(!t.cmp(u))for(;o.mod(l).cmp(m);)o.iadd(d)}else for(;o.mod(i).cmp(f);)o.iadd(d);if(g(h=o.shrn(1))&&g(o)&&b(h)&&b(o)&&a.test(h)&&a.test(o))return o}}},6597:function(e,t,o){"use strict";var r=t;r.version=o(8597).i8,r.utils=o(7528),r.rand=o(2202),r.curve=o(6063),r.curves=o(506),r.ec=o(8320),r.eddsa=o(8027)},1249:function(e,t,o){"use strict";var r=o(1734),n=o(7528),i=n.getNAF,a=n.getJSF,s=n.assert;function c(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var o=this.n&&this.p.div(this.n);!o||o.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){s(e.precomputed);var o=e._getDoubles(),r=i(t,1,this._bitLength),n=(1<=a;l--)c=(c<<1)+r[l];u.push(c)}for(var m=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=n;d>0;d--){for(a=0;a=0;u--){for(var l=0;u>=0&&0===a[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var m=a[u];s(0!==m),c="affine"===e.type?m>0?c.mixedAdd(n[m-1>>1]):c.mixedAdd(n[-m-1>>1].neg()):m>0?c.add(n[m-1>>1]):c.add(n[-m-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,o,r,n){var s,c,u,l=this._wnafT1,m=this._wnafT2,f=this._wnafT3,d=0;for(s=0;s=1;s-=2){var p=s-1,g=s;if(1===l[p]&&1===l[g]){var b=[t[p],null,null,t[g]];0===t[p].y.cmp(t[g].y)?(b[1]=t[p].add(t[g]),b[2]=t[p].toJ().mixedAdd(t[g].neg())):0===t[p].y.cmp(t[g].y.redNeg())?(b[1]=t[p].toJ().mixedAdd(t[g]),b[2]=t[p].add(t[g].neg())):(b[1]=t[p].toJ().mixedAdd(t[g]),b[2]=t[p].toJ().mixedAdd(t[g].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=a(o[p],o[g]);for(d=Math.max(v[0].length,d),f[p]=new Array(d),f[g]=new Array(d),c=0;c=0;s--){for(var j=0;s>=0;){var M=!0;for(c=0;c=0&&j++,x=x.dblp(j),s<0)break;for(c=0;c0?u=m[c][A-1>>1]:A<0&&(u=m[c][-A-1>>1].neg()),x="affine"===u.type?x.mixedAdd(u):x.add(u))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var o=[this],r=this,n=0;n":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),o=this.z.redSqr();o=o.redIAdd(o);var r=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=r.redAdd(t),a=i.redSub(o),s=r.redSub(t),c=n.redMul(a),u=i.redMul(s),l=n.redMul(s),m=a.redMul(i);return this.curve.point(c,u,m,l)},u.prototype._projDbl=function(){var e,t,o,r,n,i,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(r=this.curve._mulA(s)).redAdd(c);this.zOne?(e=a.redSub(s).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(r.redSub(c)),o=u.redSqr().redSub(u).redSub(u)):(n=this.z.redSqr(),i=u.redSub(n).redISub(n),e=a.redSub(s).redISub(c).redMul(i),t=u.redMul(r.redSub(c)),o=u.redMul(i))}else r=s.redAdd(c),n=this.curve._mulC(this.z).redSqr(),i=r.redSub(n).redSub(n),e=this.curve._mulC(a.redISub(r)).redMul(i),t=this.curve._mulC(r).redMul(s.redISub(c)),o=r.redMul(i);return this.curve.point(e,t,o)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),o=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),i=o.redSub(t),a=n.redSub(r),s=n.redAdd(r),c=o.redAdd(t),u=i.redMul(a),l=s.redMul(c),m=i.redMul(c),f=a.redMul(s);return this.curve.point(u,l,f,m)},u.prototype._projAdd=function(e){var t,o,r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(i).redMul(a),c=n.redSub(s),u=n.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),m=r.redMul(c).redMul(l);return this.curve.twisted?(t=r.redMul(u).redMul(a.redSub(this.curve._mulA(i))),o=c.redMul(u)):(t=r.redMul(u).redMul(a.redSub(i)),o=this.curve._mulC(c).redMul(u)),this.curve.point(m,t,o)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,o){return this.curve._wnafMulAdd(1,[this,t],[e,o],2,!1)},u.prototype.jmulAdd=function(e,t,o){return this.curve._wnafMulAdd(1,[this,t],[e,o],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var o=e.clone(),r=this.curve.redN.redMul(this.z);;){if(o.iadd(this.curve.n),o.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},6063:function(e,t,o){"use strict";var r=t;r.base=o(1249),r.short=o(3148),r.mont=o(1105),r.edwards=o(1123)},1105:function(e,t,o){"use strict";var r=o(1734),n=o(1736),i=o(1249),a=o(7528);function s(e){i.call(this,"mont",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,o){i.BasePoint.call(this,e,"projective"),null===t&&null===o?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(t,16),this.z=new r(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(s,i),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,o=t.redSqr(),r=o.redMul(t).redAdd(o.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},n(c,i.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),o=e.redSub(t),r=e.redMul(t),n=o.redMul(t.redAdd(this.curve.a24.redMul(o)));return this.curve.point(r,n)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var o=this.x.redAdd(this.z),r=this.x.redSub(this.z),n=e.x.redAdd(e.z),i=e.x.redSub(e.z).redMul(o),a=n.redMul(r),s=t.z.redMul(i.redAdd(a).redSqr()),c=t.x.redMul(i.redISub(a).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),o=this,r=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var i=n.length-1;i>=0;i--)0===n[i]?(o=o.diffAdd(r,this),r=r.dbl()):(r=o.diffAdd(r,this),o=o.dbl());return r},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},3148:function(e,t,o){"use strict";var r=o(7528),n=o(1734),i=o(1736),a=o(1249),s=r.assert;function c(e){a.call(this,"short",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,o,r){a.BasePoint.call(this,e,"affine"),null===t&&null===o?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(t,16),this.y=new n(o,16),r&&(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 l(e,t,o,r){a.BasePoint.call(this,e,"jacobian"),null===t&&null===o&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(t,16),this.y=new n(o,16),this.z=new n(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}i(c,a),e.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,o;if(e.beta)t=new n(e.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);t=(t=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(e.lambda)o=new n(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?o=i[0]:(o=i[1],s(0===this.g.mul(o).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:o,basis:e.basis?e.basis.map((function(e){return{a:new n(e.a,16),b:new n(e.b,16)}})):this._getEndoBasis(o)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:n.mont(e),o=new n(2).toRed(t).redInvm(),r=o.redNeg(),i=new n(3).toRed(t).redNeg().redSqrt().redMul(o);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,o,r,i,a,s,c,u,l,m=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,d=this.n.clone(),h=new n(1),p=new n(0),g=new n(0),b=new n(1),y=0;0!==f.cmpn(0);){var v=d.div(f);u=d.sub(v.mul(f)),l=g.sub(v.mul(h));var k=b.sub(v.mul(p));if(!r&&u.cmp(m)<0)t=c.neg(),o=h,r=u.neg(),i=l;else if(r&&2==++y)break;c=u,d=f,f=u,g=h,h=l,b=p,p=k}a=u.neg(),s=l;var w=r.sqr().add(i.sqr());return a.sqr().add(s.sqr()).cmp(w)>=0&&(a=t,s=o),r.negative&&(r=r.neg(),i=i.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:r,b:i},{a:a,b:s}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,o=t[0],r=t[1],n=r.b.mul(e).divRound(this.n),i=o.b.neg().mul(e).divRound(this.n),a=n.mul(o.a),s=i.mul(r.a),c=n.mul(o.b),u=i.mul(r.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var o=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=o.redSqrt();if(0!==r.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,o=e.y,r=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===o.redSqr().redISub(n).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,o){for(var r=this._endoWnafT1,n=this._endoWnafT2,i=0;i":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var o=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,r)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,o=this.x.redSqr(),r=e.redInvm(),n=o.redAdd(o).redIAdd(o).redIAdd(t).redMul(r),i=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new n(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,o){var r=[this,t],n=[e,o];return this.curve.endo?this.curve._endoWnafMulAdd(r,n):this.curve._wnafMulAdd(1,r,n,2)},u.prototype.jmulAdd=function(e,t,o){var r=[this,t],n=[e,o];return this.curve.endo?this.curve._endoWnafMulAdd(r,n,!0):this.curve._wnafMulAdd(1,r,n,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var o=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:o.naf&&{wnd:o.naf.wnd,points:o.naf.points.map(r)},doubles:o.doubles&&{step:o.doubles.step,points:o.doubles.points.map(r)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},i(l,a.BasePoint),c.prototype.jpoint=function(e,t,o){return new l(this,e,t,o)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),o=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(o,r)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),o=this.z.redSqr(),r=this.x.redMul(t),n=e.x.redMul(o),i=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(o.redMul(this.z)),s=r.redSub(n),c=i.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),m=r.redMul(u),f=c.redSqr().redIAdd(l).redISub(m).redISub(m),d=c.redMul(m.redISub(f)).redISub(i.redMul(l)),h=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(f,d,h)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),o=this.x,r=e.x.redMul(t),n=this.y,i=e.y.redMul(t).redMul(this.z),a=o.redSub(r),s=n.redSub(i);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),l=o.redMul(c),m=s.redSqr().redIAdd(u).redISub(l).redISub(l),f=s.redMul(l.redISub(m)).redISub(n.redMul(u)),d=this.z.redMul(a);return this.curve.jpoint(m,f,d)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var o=this;for(t=0;t=0)return!1;if(o.redIAdd(n),0===this.x.cmp(o))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},506:function(e,t,o){"use strict";var r,n=t,i=o(7198),a=o(6063),s=o(7528).assert;function c(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var o=new c(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:o}),o}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:i.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:i.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=o(6401)}catch(e){r=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},8320:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=o(1734),i=o(9410),a=o(7528),s=o(506),c=o(2202),u=a.assert,l=o(7791),m=o(488);function f(e){if(!(this instanceof f))return new f(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=f,f.prototype.keyPair=function(e){return new l(this,e)},f.prototype.keyFromPrivate=function(e,t){return l.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return l.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||c(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),o=this.n.byteLength(),r=this.n.sub(new n(2));;){var a=new n(t.generate(o));if(!(a.cmp(r)>0))return a.iaddn(1),this.keyFromPrivate(a)}},f.prototype._truncateToN=function(e,t){var o=8*e.byteLength()-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(e,t,o,a){"object"===(0,r.default)(o)&&(a=o,o=null),a||(a={}),t=this.keyFromPrivate(t,o),e=this._truncateToN(new n(e,16));for(var s=this.n.byteLength(),c=t.getPrivate().toArray("be",s),u=e.toArray("be",s),l=new i({hash:this.hash,entropy:c,nonce:u,pers:a.pers,persEnc:a.persEnc||"utf8"}),f=this.n.sub(new n(1)),d=0;;d++){var h=a.k?a.k(d):new n(l.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(f)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var g=p.getX(),b=g.umod(this.n);if(0!==b.cmpn(0)){var y=h.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==g.cmp(b)?2:0);return a.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),v^=1),new m({r:b,s:y,recoveryParam:v})}}}}}},f.prototype.verify=function(e,t,o,r){e=this._truncateToN(new n(e,16)),o=this.keyFromPublic(o,r);var i=(t=new m(t,"hex")).r,a=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,c=a.invm(this.n),u=c.mul(e).umod(this.n),l=c.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,o.getPublic(),l)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(u,o.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},f.prototype.recoverPubKey=function(e,t,o,r){u((3&o)===o,"The recovery param is more than two bits"),t=new m(t,r);var i=this.n,a=new n(e),s=t.r,c=t.s,l=1&o,f=o>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");s=f?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var d=t.r.invm(i),h=i.sub(a).mul(d).umod(i),p=c.mul(d).umod(i);return this.g.mulAdd(h,s,p)},f.prototype.getKeyRecoveryParam=function(e,t,o,r){if(null!==(t=new m(t,r)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var i;try{i=this.recoverPubKey(e,t,n)}catch(e){continue}if(i.eq(o))return n}throw new Error("Unable to find valid recovery factor")}},7791:function(e,t,o){"use strict";var r=o(1734),n=o(7528).assert;function i(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=i,i.fromPublic=function(e,t,o){return t instanceof i?t:new i(e,{pub:t,pubEnc:o})},i.fromPrivate=function(e,t,o){return t instanceof i?t:new i(e,{priv:t,privEnc:o})},i.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},i.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},i.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(e,t){this.priv=new r(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},i.prototype.derive=function(e){return e.validate()||n(e.validate(),"public point not validated"),e.mul(this.priv).getX()},i.prototype.sign=function(e,t,o){return this.ec.sign(e,this,t,o)},i.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},i.prototype.inspect=function(){return""}},488:function(e,t,o){"use strict";var r=o(1734),n=o(7528),i=n.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new r(e.r,16),this.s=new r(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function c(e,t){var o=e[t.place++];if(!(128&o))return o;var r=15&o;if(0===r||r>4)return!1;for(var n=0,i=0,a=t.place;i>>=0;return!(n<=127)&&(t.place=a,n)}function u(e){for(var t=0,o=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|o);--o;)e.push(t>>>(o<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=n.toArray(e,t);var o=new s;if(48!==e[o.place++])return!1;var i=c(e,o);if(!1===i)return!1;if(i+o.place!==e.length)return!1;if(2!==e[o.place++])return!1;var a=c(e,o);if(!1===a)return!1;var u=e.slice(o.place,a+o.place);if(o.place+=a,2!==e[o.place++])return!1;var l=c(e,o);if(!1===l)return!1;if(e.length!==l+o.place)return!1;var m=e.slice(o.place,l+o.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===m[0]){if(!(128&m[1]))return!1;m=m.slice(1)}return this.r=new r(u),this.s=new r(m),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),o=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&o[0]&&(o=[0].concat(o)),t=u(t),o=u(o);!(o[0]||128&o[1]);)o=o.slice(1);var r=[2];l(r,t.length),(r=r.concat(t)).push(2),l(r,o.length);var i=r.concat(o),a=[48];return l(a,i.length),a=a.concat(i),n.encode(a,e)}},8027:function(e,t,o){"use strict";var r=o(7198),n=o(506),i=o(7528),a=i.assert,s=i.parseBytes,c=o(7303),u=o(6646);function l(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=n[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}e.exports=l,l.prototype.sign=function(e,t){e=s(e);var o=this.keyFromSecret(t),r=this.hashInt(o.messagePrefix(),e),n=this.g.mul(r),i=this.encodePoint(n),a=this.hashInt(i,o.pubBytes(),e).mul(o.priv()),c=r.add(a).umod(this.curve.n);return this.makeSignature({R:n,S:c,Rencoded:i})},l.prototype.verify=function(e,t,o){e=s(e),t=this.makeSignature(t);var r=this.keyFromPublic(o),n=this.hashInt(t.Rencoded(),r.pubBytes(),e),i=this.g.mul(t.S());return t.R().add(r.pub().mul(n)).eq(i)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t(n>>1)-1?(n>>1)-c:c,i.isubn(s)):s=0,r[a]=s,i.iushrn(1)}return r},r.getJSF=function(e,t){var o=[[],[]];e=e.clone(),t=t.clone();for(var r,n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var a,s,c=e.andln(3)+n&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!=(r=e.andln(7)+n&7)&&5!==r||2!==u?c:-c,o[0].push(a),s=0==(1&u)?0:3!=(r=t.andln(7)+i&7)&&5!==r||2!==c?u:-u,o[1].push(s),2*n===a+1&&(n=1-n),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return o},r.cachedProperty=function(e,t,o){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=o.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new n(e,"hex","le")}},6464:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=function(){if("object"===("undefined"==typeof self?"undefined":(0,r.default)(self))&&self)return self;if("object"===("undefined"==typeof window?"undefined":(0,r.default)(window))&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"===("undefined"==typeof globalThis?"undefined":(0,r.default)(globalThis))&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},4258:function(e,t,o){"use strict";var r,n,i,a=o(9142),s=o(8847)(o(3355));i=function(){function e(e){return"function"==typeof e}var t=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,n=void 0,i=void 0,c=function(e,t){p[r]=e,p[r+1]=t,2===(r+=2)&&(i?i(g):w())},u="undefined"!=typeof window?window:void 0,l=u||{},m=l.MutationObserver||l.WebKitMutationObserver,f="undefined"==typeof self&&void 0!==a&&"[object process]"==={}.toString.call(a),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(g,1)}}var p=new Array(1e3);function g(){for(var e=0;e=0;o--){var s=n(i[o]);t=n(new r(t+s,"hex"))}}return"0x"+t},t.normalize=a},3058:function(e,t,o){"use strict";var r=o(9033).Buffer,n=o(8847)(o(4519)),i=o(6851),a=o(9733),s=o(6597),c=(o(6740),new s.ec("secp256k1")),u=o(2922),l=u.keccak256,m=u.keccak256s,f=function(e){for(var t=m(e.slice(2)),o="0x",r=0;r<40;r++)o+=parseInt(t[r+2],16)>7?e[r+2].toUpperCase():e[r+2];return o},d=function(e){var t=new r(e.slice(2),"hex"),o="0x"+c.keyFromPrivate(t).getPublic(!1,"hex").slice(2),n=l(o);return{address:f("0x"+n.slice(-40)),privateKey:e}},h=function(e){var t=(0,n.default)(e,3),o=t[0],r=t[1],a=t[2];return i.flatten([r,a,o])},p=function(e){return[i.slice(64,i.length(e),e),i.slice(0,32,e),i.slice(32,64,e)]},g=function(e){return function(t,o){var n=c.keyFromPrivate(new r(o.slice(2),"hex")).sign(new r(t.slice(2),"hex"),{canonical:!0});return h([a.fromString(i.fromNumber(e+n.recoveryParam)),i.pad(32,i.fromNat("0x"+n.r.toString(16))),i.pad(32,i.fromNat("0x"+n.s.toString(16)))])}},b=g(27);e.exports={create:function(e){var t=l(i.concat(i.random(32),e||i.random(32))),o=i.concat(i.concat(i.random(32),t),i.random(32)),r=l(o);return d(r)},toChecksum:f,fromPrivate:d,sign:b,makeSigner:g,recover:function(e,t){var o=p(t),n={v:i.toNumber(o[0]),r:o[1].slice(2),s:o[2].slice(2)},a="0x"+c.recoverPubKey(new r(e.slice(2),"hex"),n,n.v<2?n.v:1-n.v%2).encode("hex",!1).slice(2),s=l(a);return f("0x"+s.slice(-40))},encodeSignature:h,decodeSignature:p}},1376:function(e){"use strict";var t=function(e,t){for(var o=[],r=0;r>6|192);else{if(n>55295&&n<56320){if(++r==e.length)return null;var i=e.charCodeAt(r);if(i<56320||i>57343)return null;o+=t((n=65536+((1023&n)<<10)+(1023&i))>>18|240),o+=t(n>>12&63|128)}else o+=t(n>>12|224);o+=t(n>>6&63|128)}o+=t(63&n|128)}}return o},toString:function(e){for(var t="",o=0,i=n(e);o127){if(a>191&&a<224){if(o>=i)return null;a=(31&a)<<6|63&r(e,o)}else if(a>223&&a<240){if(o+1>=i)return null;a=(15&a)<<12|(63&r(e,o))<<6|63&r(e,++o)}else{if(!(a>239&&a<248))return null;if(o+2>=i)return null;a=(7&a)<<18|(63&r(e,o))<<12|(63&r(e,++o))<<6|63&r(e,++o)}++o}if(a<=65535)t+=String.fromCharCode(a);else{if(!(a<=1114111))return null;a-=65536,t+=String.fromCharCode(a>>10|55296),t+=String.fromCharCode(1023&a|56320)}}return t},fromNumber:function(e){var t=e.toString(16);return t.length%2==0?"0x"+t:"0x0"+t},toNumber:function(e){return parseInt(e.slice(2),16)},fromNat:function(e){return"0x0"===e?"0x":e.length%2==0?e:"0x0"+e.slice(2)},toNat:function(e){return"0"===e[2]?"0x"+e.slice(3):e},fromArray:a,toArray:i,fromUint8Array:function(e){return a([].slice.call(e,0))},toUint8Array:function(e){return new Uint8Array(i(e))}}},2922:function(e){"use strict";var t="0123456789abcdef".split(""),o=[1,256,65536,16777216],r=[0,8,16,24],n=[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],i=function(e){var t,o,r,i,a,s,c,u,l,m,f,d,h,p,g,b,y,v,k,w,x,z,j,M,A,q,I,E,S,N,_,T,O,C,D,L,P,R,B,U,F,Q,Y,H,G,W,Z,V,K,J,X,$,ee,te,oe,re,ne,ie,ae,se,ce,ue,le;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],c=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],m=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|c>>>31),o=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(c<<1|s>>>31),e[0]^=t,e[1]^=o,e[10]^=t,e[11]^=o,e[20]^=t,e[21]^=o,e[30]^=t,e[31]^=o,e[40]^=t,e[41]^=o,t=i^(u<<1|l>>>31),o=a^(l<<1|u>>>31),e[2]^=t,e[3]^=o,e[12]^=t,e[13]^=o,e[22]^=t,e[23]^=o,e[32]^=t,e[33]^=o,e[42]^=t,e[43]^=o,t=s^(m<<1|f>>>31),o=c^(f<<1|m>>>31),e[4]^=t,e[5]^=o,e[14]^=t,e[15]^=o,e[24]^=t,e[25]^=o,e[34]^=t,e[35]^=o,e[44]^=t,e[45]^=o,t=u^(d<<1|h>>>31),o=l^(h<<1|d>>>31),e[6]^=t,e[7]^=o,e[16]^=t,e[17]^=o,e[26]^=t,e[27]^=o,e[36]^=t,e[37]^=o,e[46]^=t,e[47]^=o,t=m^(i<<1|a>>>31),o=f^(a<<1|i>>>31),e[8]^=t,e[9]^=o,e[18]^=t,e[19]^=o,e[28]^=t,e[29]^=o,e[38]^=t,e[39]^=o,e[48]^=t,e[49]^=o,p=e[0],g=e[1],W=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,E=e[20]<<3|e[21]>>>29,S=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,Q=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,K=e[23]<<10|e[22]>>>22,N=e[33]<<13|e[32]>>>19,_=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,oe=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,P=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,k=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,T=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,M=e[6]<<28|e[7]>>>4,A=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,R=e[26]<<25|e[27]>>>7,B=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,x=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,q=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,U=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,z=e[48]<<14|e[49]>>>18,j=e[49]<<14|e[48]>>>18,e[0]=p^~b&v,e[1]=g^~y&k,e[10]=M^~q&E,e[11]=A^~I&S,e[20]=C^~L&R,e[21]=D^~P&B,e[30]=H^~W&V,e[31]=G^~Z&K,e[40]=te^~re&ie,e[41]=oe^~ne&ae,e[2]=b^~v&w,e[3]=y^~k&x,e[12]=q^~E&N,e[13]=I^~S&_,e[22]=L^~R&U,e[23]=P^~B&F,e[32]=W^~V&J,e[33]=Z^~K&X,e[42]=re^~ie&se,e[43]=ne^~ae&ce,e[4]=v^~w&z,e[5]=k^~x&j,e[14]=E^~N&T,e[15]=S^~_&O,e[24]=R^~U&Q,e[25]=B^~F&Y,e[34]=V^~J&$,e[35]=K^~X&ee,e[44]=ie^~se&ue,e[45]=ae^~ce&le,e[6]=w^~z&p,e[7]=x^~j&g,e[16]=N^~T&M,e[17]=_^~O&A,e[26]=U^~Q&C,e[27]=F^~Y&D,e[36]=J^~$&H,e[37]=X^~ee&G,e[46]=se^~ue&te,e[47]=ce^~le&oe,e[8]=z^~p&b,e[9]=j^~g&y,e[18]=T^~M&q,e[19]=O^~A&I,e[28]=Q^~C&L,e[29]=Y^~D&P,e[38]=$^~H&W,e[39]=ee^~G&Z,e[48]=ue^~te&re,e[49]=le^~oe&ne,e[0]^=n[r],e[1]^=n[r+1]},a=function(e){return function(n){var a;if("0x"===n.slice(0,2)){a=[];for(var s=2,c=n.length;s>2]|=n[d]<>2]|=a<>2]|=(192|a>>6)<>2]|=(128|63&a)<=57344?(c[g>>2]|=(224|a>>12)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<>2]|=(240|a>>18)<>2]|=(128|a>>12&63)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<=u){for(e.start=g-u,e.block=c[l],g=0;g>2]|=o[3&g],e.lastByteIndex===u)for(c[0]=c[l],g=1;g>4&15]+t[15&h]+t[h>>12&15]+t[h>>8&15]+t[h>>20&15]+t[h>>16&15]+t[h>>28&15]+t[h>>24&15];b%l==0&&(i(f),g=0)}return"0x"+p}(function(e){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(t=[0,0,0,0,0,0,0,0,0,0],[].concat(t,t,t,t,t))};var t}(e),a)}};e.exports={keccak256:a(256),keccak512:a(512),keccak256s:a(256),keccak512s:a(512)}},9733:function(e,t,o){"use strict";var r=o(1734),n=o(6851),i=function(e){return new r(e.slice(2),16)},a=function(e){var t="0x"+("0x"===e.slice(0,2)?new r(e.slice(2),16):new r(e,10)).toString("hex");return"0x0"===t?"0x":t},s=function(e){return"string"==typeof e?/^0x/.test(e)?e:"0x"+e:"0x"+new r(e).toString("hex")},c=function(e){return i(e).toNumber()},u=function(e){return function(t,o){return"0x"+i(t)[e](i(o)).toString("hex")}},l=u("add"),m=u("mul"),f=u("div"),d=u("sub");e.exports={toString:function(e){return i(e).toString(10)},fromString:a,toNumber:c,fromNumber:s,toEther:function(e){return c(f(e,a("10000000000")))/1e8},fromEther:function(e){return m(s(Math.floor(1e8*e)),a("10000000000"))},toUint256:function(e){return n.pad(32,e)},add:l,mul:m,div:f,sub:d}},6740:function(e){"use strict";e.exports={encode:function(e){var t=function(e){return(t=e.toString(16)).length%2==0?t:"0"+t;var t},o=function(e,o){return e<56?t(o+e):t(o+t(e).length/2+55)+t(e)};return"0x"+function e(t){if("string"==typeof t){var r=t.slice(2);return(2!=r.length||r>="80"?o(r.length/2,128):"")+r}var n=t.map(e).join("");return o(n.length/2,192)+n}(e)},decode:function(e){var t=2,o=function(){if(t>=e.length)throw"";var o=e.slice(t,t+2);return o<"80"?(t+=2,"0x"+o):o<"c0"?n():i()},r=function(){var o=parseInt(e.slice(t,t+=2),16)%64;return o<56?o:parseInt(e.slice(t,t+=2*(o-55)),16)},n=function(){var o=r();return"0x"+e.slice(t,t+=2*o)},i=function(){for(var e=2*r()+t,n=[];t=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw new Error("invalid bloom")}function c(e){return!("string"!=typeof e||!/^(0x)?[0-9a-f]{64}$/i.test(e)||!/^(0x)?[0-9a-f]{64}$/.test(e)&&!/^(0x)?[0-9A-F]{64}$/.test(e))}function u(e){return!("string"!=typeof e||!e.match(/^(0x)?[0-9a-fA-F]{40}$/)&&!e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/))}t.isBloom=i,t.isInBloom=a,t.isUserEthereumAddressInBloom=function(e,t){if(!i(e))throw new Error("Invalid bloom given");if(!u(t))throw new Error('Invalid ethereum address given: "'.concat(t,'"'));return a(e,n.padLeft(t,64))},t.isContractAddressInBloom=function(e,t){if(!i(e))throw new Error("Invalid bloom given");if(!u(t))throw new Error('Invalid contract address given: "'.concat(t,'"'));return a(e,t)},t.isTopicInBloom=function(e,t){if(!i(e))throw new Error("Invalid bloom given");if(!c(t))throw new Error("Invalid topic");return a(e,t)},t.isTopic=c,t.isAddress=u},8179:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7286);function n(e){if(null==e)throw new Error("cannot convert null value to array");if("string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);if(!t)throw new Error("invalid hexidecimal string");if("0x"!==t[1])throw new Error("hex string must have 0x prefix");(e=e.substring(2)).length%2&&(e="0"+e);for(var o=[],r=0;r=256||parseInt(String(o))!=o)return!1}return!0}(e))return i(new Uint8Array(e));throw new Error("invalid arrayify value")}function i(e){var t=arguments;return void 0!==e.slice||(e.slice=function(){var o=Array.prototype.slice.call(t);return i(new Uint8Array(Array.prototype.slice.apply(e,o)))}),e}t.keccak256=function(e){return"0x"+r.keccak_256(n(e))},t.padLeft=function(e,t){var o=/^0x/i.test(e)||"number"==typeof e,r=t-(e=e.toString().replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(o?"0x":"")+new Array(r).join("0")+e},t.bytesToHex=function(e){for(var t=[],o=0;o>>4).toString(16)),t.push((15&e[o]).toString(16));return"0x".concat(t.join("").replace(/^0+/,""))},t.toByteArray=n},7286:function(e,t,o){"use strict";e=o.nmd(e);var r,n=o(9142),i=o(8847)(o(3355));!function(){var a="input is invalid type",s="object"===("undefined"==typeof window?"undefined":(0,i.default)(window)),c=s?window:{};c.JS_SHA3_NO_WINDOW&&(s=!1);var u=!s&&"object"===("undefined"==typeof self?"undefined":(0,i.default)(self));!c.JS_SHA3_NO_NODE_JS&&"object"===(void 0===n?"undefined":(0,i.default)(n))&&n.versions&&n.versions.node?c=o.g:u&&(c=self);var l=!c.JS_SHA3_NO_COMMON_JS&&"object"===(0,i.default)(e)&&e.exports,m=o.amdO,f=!c.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),h=[4,1024,262144,67108864],p=[0,8,16,24],g=[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],y=[128,256],v=["hex","buffer","arrayBuffer","array","digest"],k={128:168,256:136};!c.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!f||!c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===(0,i.default)(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var w=function(e,t,o){return function(r){return new D(e,t,e).update(r)[o]()}},x=function(e,t,o){return function(r,n){return new D(e,t,n).update(r)[o]()}},z=function(e,t,o){return function(t,r,n,i){return I["cshake"+e].update(t,r,n,i)[o]()}},j=function(e,t,o){return function(t,r,n,i){return I["kmac"+e].update(t,r,n,i)[o]()}},M=function(e,t,o,r){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=o>>5,this.extraBytes=(31&o)>>3;for(var r=0;r<50;++r)this.s[r]=0}function L(e,t,o){D.call(this,e,t,o)}D.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,o=(0,i.default)(e);if("string"!==o){if("object"!==o)throw new Error(a);if(null===e)throw new Error(a);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||f&&ArrayBuffer.isView(e)))throw new Error(a);t=!0}for(var r,n,s=this.blocks,c=this.byteCount,u=e.length,l=this.blockCount,m=0,d=this.s;m>2]|=e[m]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=c){for(this.start=r-c,this.block=s[l],r=0;r>=8);o>0;)n.unshift(o),o=255&(e>>=8),++r;return t?n.push(r):n.unshift(r),this.update(n),n.length},D.prototype.encodeString=function(e){var t,o=(0,i.default)(e);if("string"!==o){if("object"!==o)throw new Error(a);if(null===e)throw new Error(a);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||f&&ArrayBuffer.isView(e)))throw new Error(a);t=!0}var r=0,n=e.length;if(t)r=n;else for(var s=0;s=57344?r+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++s)),r+=4)}return r+=this.encode(8*r),this.update(e),r},D.prototype.bytepad=function(e,t){for(var o=this.encode(t),r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[o],t=1;t>4&15]+d[15&e]+d[e>>12&15]+d[e>>8&15]+d[e>>20&15]+d[e>>16&15]+d[e>>28&15]+d[e>>24&15];a%t==0&&(P(o),i=0)}return n&&(e=o[i],s+=d[e>>4&15]+d[15&e],n>1&&(s+=d[e>>12&15]+d[e>>8&15]),n>2&&(s+=d[e>>20&15]+d[e>>16&15])),s},D.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,o=this.s,r=this.outputBlocks,n=this.extraBytes,i=0,a=0,s=this.outputBits>>3;e=n?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%o==0&&P(r)}return i&&(e=s<<2,t=r[a],c[e]=255&t,i>1&&(c[e+1]=t>>8&255),i>2&&(c[e+2]=t>>16&255)),c},L.prototype=new D,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),D.prototype.finalize.call(this)};var P=function(e){var t,o,r,n,i,a,s,c,u,l,m,f,d,h,p,b,y,v,k,w,x,z,j,M,A,q,I,E,S,N,_,T,O,C,D,L,P,R,B,U,F,Q,Y,H,G,W,Z,V,K,J,X,$,ee,te,oe,re,ne,ie,ae,se,ce,ue,le;for(r=0;r<48;r+=2)n=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],m=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),o=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=o,e[10]^=t,e[11]^=o,e[20]^=t,e[21]^=o,e[30]^=t,e[31]^=o,e[40]^=t,e[41]^=o,t=n^(c<<1|u>>>31),o=i^(u<<1|c>>>31),e[2]^=t,e[3]^=o,e[12]^=t,e[13]^=o,e[22]^=t,e[23]^=o,e[32]^=t,e[33]^=o,e[42]^=t,e[43]^=o,t=a^(l<<1|m>>>31),o=s^(m<<1|l>>>31),e[4]^=t,e[5]^=o,e[14]^=t,e[15]^=o,e[24]^=t,e[25]^=o,e[34]^=t,e[35]^=o,e[44]^=t,e[45]^=o,t=c^(f<<1|d>>>31),o=u^(d<<1|f>>>31),e[6]^=t,e[7]^=o,e[16]^=t,e[17]^=o,e[26]^=t,e[27]^=o,e[36]^=t,e[37]^=o,e[46]^=t,e[47]^=o,t=l^(n<<1|i>>>31),o=m^(i<<1|n>>>31),e[8]^=t,e[9]^=o,e[18]^=t,e[19]^=o,e[28]^=t,e[29]^=o,e[38]^=t,e[39]^=o,e[48]^=t,e[49]^=o,h=e[0],p=e[1],W=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,E=e[20]<<3|e[21]>>>29,S=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,Q=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,K=e[23]<<10|e[22]>>>22,N=e[33]<<13|e[32]>>>19,_=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,oe=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,P=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,k=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,T=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,M=e[6]<<28|e[7]>>>4,A=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,R=e[26]<<25|e[27]>>>7,B=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,x=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,q=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,U=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,z=e[48]<<14|e[49]>>>18,j=e[49]<<14|e[48]>>>18,e[0]=h^~b&v,e[1]=p^~y&k,e[10]=M^~q&E,e[11]=A^~I&S,e[20]=C^~L&R,e[21]=D^~P&B,e[30]=H^~W&V,e[31]=G^~Z&K,e[40]=te^~re&ie,e[41]=oe^~ne&ae,e[2]=b^~v&w,e[3]=y^~k&x,e[12]=q^~E&N,e[13]=I^~S&_,e[22]=L^~R&U,e[23]=P^~B&F,e[32]=W^~V&J,e[33]=Z^~K&X,e[42]=re^~ie&se,e[43]=ne^~ae&ce,e[4]=v^~w&z,e[5]=k^~x&j,e[14]=E^~N&T,e[15]=S^~_&O,e[24]=R^~U&Q,e[25]=B^~F&Y,e[34]=V^~J&$,e[35]=K^~X&ee,e[44]=ie^~se&ue,e[45]=ae^~ce&le,e[6]=w^~z&h,e[7]=x^~j&p,e[16]=N^~T&M,e[17]=_^~O&A,e[26]=U^~Q&C,e[27]=F^~Y&D,e[36]=J^~$&H,e[37]=X^~ee&G,e[46]=se^~ue&te,e[47]=ce^~le&oe,e[8]=z^~h&b,e[9]=j^~p&y,e[18]=T^~M&q,e[19]=O^~A&I,e[28]=Q^~C&L,e[29]=Y^~D&P,e[38]=$^~H&W,e[39]=ee^~G&Z,e[48]=ue^~te&re,e[49]=le^~oe&ne,e[0]^=g[r],e[1]^=g[r+1]};if(l)e.exports=I;else{for(S=0;S0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a}(t,4),r=o[0],n=o[1],i=o[2],s=o[3];return new e(new a.BN(r),new a.BN(n),i,s)},e.prototype._validate=function(){if(this.nonce.lt(new a.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new a.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,d.bnToUnpaddedBuffer)(this.nonce),(0,d.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return a.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(u.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(u.KECCAK256_NULL)},e}();t.Account=h,t.isValidAddress=function(e){try{(0,f.assertIsString)(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)},t.toChecksumAddress=function(e,t){(0,f.assertIsHexString)(e);var o=(0,c.stripHexPrefix)(e).toLowerCase(),r="";t&&(r=(0,d.toType)(t,d.TypeOutput.BN).toString()+"0x");for(var n=(0,m.keccakFromString)(r+o).toString("hex"),i="0x",a=0;a=8?i+=o[a].toUpperCase():i+=o[a];return i},t.isValidChecksumAddress=function(e,o){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,o)===e},t.generateAddress=function(e,t){(0,f.assertIsBuffer)(e),(0,f.assertIsBuffer)(t);var o=new a.BN(t);return o.isZero()?(0,m.rlphash)([e,null]).slice(-20):(0,m.rlphash)([e,r.from(o.toArray())]).slice(-20)},t.generateAddress2=function(e,t,o){return(0,f.assertIsBuffer)(e),(0,f.assertIsBuffer)(t),(0,f.assertIsBuffer)(o),(0,i.default)(20===e.length),(0,i.default)(32===t.length),(0,m.keccak256)(r.concat([r.from("ff","hex"),e,t,(0,m.keccak256)(o)])).slice(-20)},t.isValidPrivate=function(e){return(0,s.privateKeyVerify)(e)},t.isValidPublic=function(e,t){return void 0===t&&(t=!1),(0,f.assertIsBuffer)(e),64===e.length?(0,s.publicKeyVerify)(r.concat([r.from([4]),e])):!!t&&(0,s.publicKeyVerify)(e)},t.pubToAddress=function(e,t){return void 0===t&&(t=!1),(0,f.assertIsBuffer)(e),t&&64!==e.length&&(e=r.from((0,s.publicKeyConvert)(e,!1).slice(1))),(0,i.default)(64===e.length),(0,m.keccak)(e).slice(-20)},t.publicToAddress=t.pubToAddress,t.privateToPublic=function(e){return(0,f.assertIsBuffer)(e),r.from((0,s.publicKeyCreate)(e,!1)).slice(1)},t.privateToAddress=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))},t.importPublic=function(e){return(0,f.assertIsBuffer)(e),64!==e.length&&(e=r.from((0,s.publicKeyConvert)(e,!1).slice(1))),e},t.zeroAddress=function(){var e=(0,l.zeros)(20);return(0,l.bufferToHex)(e)},t.isZeroAddress=function(e){try{(0,f.assertIsString)(e)}catch(e){return!1}return(0,t.zeroAddress)()===e}},1984:function(e,t,o){"use strict";var r=o(9033).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var n,i=(n=o(3894))&&n.__esModule?n:{default:n},a=o(9100),s=o(3464),c=o(1968),u=function(){function e(e){(0,i.default)(20===e.length,"Invalid address length"),this.buf=e}return e.zero=function(){return new e((0,s.zeros)(20))},e.fromString=function(t){return(0,i.default)((0,c.isValidAddress)(t),"Invalid address"),new e((0,s.toBuffer)(t))},e.fromPublicKey=function(t){return(0,i.default)(r.isBuffer(t),"Public key should be Buffer"),new e((0,c.pubToAddress)(t))},e.fromPrivateKey=function(t){return(0,i.default)(r.isBuffer(t),"Private key should be Buffer"),new e((0,c.privateToAddress)(t))},e.generate=function(t,o){return(0,i.default)(a.BN.isBN(o)),new e((0,c.generateAddress)(t.buf,o.toArrayLike(r)))},e.generate2=function(t,o,n){return(0,i.default)(r.isBuffer(o)),(0,i.default)(r.isBuffer(n)),new e((0,c.generateAddress2)(t.buf,o,n))},e.prototype.equals=function(e){return this.buf.equals(e.buf)},e.prototype.isZero=function(){return this.equals(e.zero())},e.prototype.isPrecompileOrSystemAddress=function(){var e=new a.BN(this.buf),t=new a.BN(0),o=new a.BN("ffff","hex");return e.gte(t)&&e.lte(o)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return r.from(this.buf)},e}();t.Address=u},3464:function(e,t,o){"use strict";var r=o(9033).Buffer,n=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=o(9100),a=o(3271),s=o(5725);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))},t.intToBuffer=function(e){var o=(0,t.intToHex)(e);return r.from((0,a.padToEven)(o.slice(2)),"hex")},t.zeros=function(e){return r.allocUnsafe(e).fill(0)};var c=function(e,o,r){var n=(0,t.zeros)(o);return r?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,s.assertIsBuffer)(e),u(e)},t.unpadArray=function(e){return(0,s.assertIsArray)(e),u(e)},t.unpadHexString=function(e){return(0,s.assertIsHexString)(e),e=(0,a.stripHexPrefix)(e),u(e)},t.toBuffer=function(e){if(null==e)return r.allocUnsafe(0);if(r.isBuffer(e))return r.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return r.from(e);if("string"==typeof e){if(!(0,a.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return r.from((0,a.padToEven)((0,a.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,t.intToBuffer)(e);if(i.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(r)}if(e.toArray)return r.from(e.toArray());if(e.toBuffer)return r.from(e.toBuffer());throw new Error("invalid type")},t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")},t.fromSigned=function(e){return new i.BN(e).fromTwos(256)},t.toUnsigned=function(e){return r.from(e.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||(0,a.isHexPrefixed)(e)?e:"0x"+e},t.toUtf8=function(e){if((e=(0,a.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return r.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")},t.baToJSON=function(e){if(r.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var o=[],n=0;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(Object.entries(e)),i=r.next();!i.done;i=r.next()){var a=n(i.value,2),s=a[0],c=a[1];if(void 0!==c&&c.length>0&&0===c[0])throw new Error("".concat(s," cannot have leading zeroes, received: ").concat(c.toString("hex")))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(t)throw t.error}}},t.arrToBufArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):r.from(t)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}},986:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0;var r=o(9033),n=o(9100);t.MAX_UINT64=new n.BN("ffffffffffffffff",16),t.MAX_INTEGER=new n.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new n.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=r.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=r.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=r.Buffer.from(t.KECCAK256_RLP_S,"hex")},9100:function(e,t,o){"use strict";var r=Object.create?function(e,t,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]},n=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var i,a=(i=o(1734))&&i.__esModule?i:{default:i};t.BN=a.default;var s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t}(o(6905));t.rlp=s},9808:function(e,t,o){"use strict";var r=o(9033).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var n=o(1243),i=o(5866),a=o(9100),s=o(3464),c=o(5725);t.keccak=function(e,t){switch(void 0===t&&(t=256),(0,c.assertIsBuffer)(e),t){case 224:return(0,n.keccak224)(e);case 256:return(0,n.keccak256)(e);case 384:return(0,n.keccak384)(e);case 512:return(0,n.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}},t.keccak256=function(e){return(0,t.keccak)(e)},t.keccakFromString=function(e,o){void 0===o&&(o=256),(0,c.assertIsString)(e);var n=r.from(e,"utf8");return(0,t.keccak)(n,o)},t.keccakFromHexString=function(e,o){return void 0===o&&(o=256),(0,c.assertIsHexString)(e),(0,t.keccak)((0,s.toBuffer)(e),o)},t.keccakFromArray=function(e,o){return void 0===o&&(o=256),(0,c.assertIsArray)(e),(0,t.keccak)((0,s.toBuffer)(e),o)};var u=function(e){return e=(0,s.toBuffer)(e),i("sha256").update(e).digest()};t.sha256=function(e){return(0,c.assertIsBuffer)(e),u(e)},t.sha256FromString=function(e){return(0,c.assertIsString)(e),u(e)},t.sha256FromArray=function(e){return(0,c.assertIsArray)(e),u(e)};var l=function(e,t){e=(0,s.toBuffer)(e);var o=i("rmd160").update(e).digest();return!0===t?(0,s.setLengthLeft)(o,32):o};t.ripemd160=function(e,t){return(0,c.assertIsBuffer)(e),l(e,t)},t.ripemd160FromString=function(e,t){return(0,c.assertIsString)(e),l(e,t)},t.ripemd160FromArray=function(e,t){return(0,c.assertIsArray)(e),l(e,t)},t.rlphash=function(e){return(0,t.keccak)(a.rlp.encode(e))}},5725:function(e,t,o){"use strict";var r=o(9033).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=o(3271);t.assertIsHexString=function(e){if(!(0,n.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}},t.assertIsBuffer=function(e){if(!r.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}},t.assertIsArray=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}},t.assertIsString=function(e){if("string"!=typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}}},3062:function(e,t,o){"use strict";var r=Object.create?function(e,t,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]},n=function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||r(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,n(o(986),t),n(o(1968),t),n(o(1984),t),n(o(9808),t),n(o(6081),t),n(o(3464),t),n(o(1677),t),n(o(9100),t),n(o(5513),t);var i=o(3271);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},3271:function(e,t,o){"use strict";var r=o(9033).Buffer,n=o(8847)(o(3355));function i(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat((0,n.default)(e)));return"0"===e[0]&&"x"===e[1]}function a(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat((0,n.default)(t)));return t.length%2&&(t="0".concat(t)),t}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=i,t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat((0,n.default)(e)));return i(e)?e.slice(2):e},t.padToEven=a,t.getBinarySize=function(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat((0,n.default)(e)));return r.byteLength(e,"utf8")},t.arrayContainsArray=function(e,t,o){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat((0,n.default)(e),"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat((0,n.default)(t),"'"));return t[o?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function(e){var t="",o=0,r=e.length;for("0x"===e.substring(0,2)&&(o=2);o=n.length,"The field ".concat(t.name," must not have more ").concat(t.length," bytes"))):t.allowZero&&0===n.length||!t.length||(0,a.default)(t.length===n.length,"The field ".concat(t.name," must have byte length of ").concat(t.length)),e.raw[o]=n}e._fields.push(t.name),Object.defineProperty(e,t.name,{enumerable:!0,configurable:!0,get:n,set:i}),t.default&&(e[t.name]=t.default),t.alias&&Object.defineProperty(e,t.alias,{enumerable:!1,configurable:!0,set:i,get:n})})),o)if("string"==typeof o&&(o=r.from((0,s.stripHexPrefix)(o),"hex")),r.isBuffer(o)&&(o=c.rlp.decode(o)),Array.isArray(o)){if(o.length>e._fields.length)throw new Error("wrong number of fields in data");o.forEach((function(t,o){e[e._fields[o]]=(0,u.toBuffer)(t)}))}else{if("object"!==(0,n.default)(o))throw new Error("invalid data");var i=Object.keys(o);t.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=o[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=o[t.alias])}))}}},6081:function(e,t,o){"use strict";var r=o(9033).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;var n=o(6992),i=o(9100),a=o(3464),s=o(9808),c=o(5725),u=o(5513);function l(e,t){var o=(0,u.toType)(e,u.TypeOutput.BN);if(o.eqn(0)||o.eqn(1))return(0,u.toType)(e,u.TypeOutput.BN);if(!t)return o.subn(27);var r=(0,u.toType)(t,u.TypeOutput.BN);return o.sub(r.muln(2).addn(35))}function m(e){var t=new i.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=function(e,t,o){var i=(0,n.ecdsaSign)(e,t),a=i.signature,s=i.recid,c=r.from(a.slice(0,32)),l=r.from(a.slice(32,64));if(!o||"number"==typeof o){if(o&&!Number.isSafeInteger(o))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:c,s:l,v:o?s+(2*o+35):s+27}}return{r:c,s:l,v:(0,u.toType)(o,u.TypeOutput.BN).muln(2).addn(35).addn(s).toArrayLike(r)}},t.ecrecover=function(e,t,o,i,s){var c=r.concat([(0,a.setLengthLeft)(o,32),(0,a.setLengthLeft)(i,32)],64),u=l(t,s);if(!m(u))throw new Error("Invalid signature v value");var f=(0,n.ecdsaRecover)(c,u.toNumber(),e);return r.from((0,n.publicKeyConvert)(f,!1).slice(1))},t.toRpcSig=function(e,t,o,n){if(!m(l(e,n)))throw new Error("Invalid signature v value");return(0,a.bufferToHex)(r.concat([(0,a.setLengthLeft)(t,32),(0,a.setLengthLeft)(o,32),(0,a.toBuffer)(e)]))},t.toCompactSig=function(e,t,o,n){if(!m(l(e,n)))throw new Error("Invalid signature v value");var i=(0,u.toType)(e,u.TypeOutput.Number),s=o;return(i>28&&i%2==1||1===i||28===i)&&((s=r.from(o))[0]|=128),(0,a.bufferToHex)(r.concat([(0,a.setLengthLeft)(t,32),(0,a.setLengthLeft)(s,32)]))},t.fromRpcSig=function(e){var t,o,r,n=(0,a.toBuffer)(e);if(n.length>=65)t=n.slice(0,32),o=n.slice(32,64),r=(0,a.bufferToInt)(n.slice(64));else{if(64!==n.length)throw new Error("Invalid signature length");t=n.slice(0,32),o=n.slice(32,64),r=(0,a.bufferToInt)(n.slice(32,33))>>7,o[0]&=127}return r<27&&(r+=27),{v:r,r:t,s:o}},t.isValidSignature=function(e,t,o,r,n){void 0===r&&(r=!0);var a=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==o.length)return!1;if(!m(l(e,n)))return!1;var c=new i.BN(t),u=new i.BN(o);return!(c.isZero()||c.gt(s)||u.isZero()||u.gt(s)||r&&1===u.cmp(a))},t.hashPersonalMessage=function(e){(0,c.assertIsBuffer)(e);var t=r.from("\x19Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,s.keccak)(r.concat([t,e]))}},5513:function(e,t,o){"use strict";var r=o(9033).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,i=o(9100),a=o(3271),s=o(3464);function c(e){return(0,s.unpadBuffer)(e.toArrayLike(r))}t.bnToHex=function(e){return"0x".concat(e.toString(16))},t.bnToUnpaddedBuffer=c,t.bnToRlp=function(e){return c(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(n=t.TypeOutput||(t.TypeOutput={})),t.toType=function(e,t){if(null===e)return null;if(void 0!==e){if("string"==typeof e&&!(0,a.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var o=(0,s.toBuffer)(e);if(t===n.Buffer)return o;if(t===n.BN)return new i.BN(o);if(t===n.Number){var r=new i.BN(o),c=new i.BN(Number.MAX_SAFE_INTEGER.toString());if(r.gt(c))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return r.toNumber()}return"0x".concat(o.toString("hex"))}}},7130:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=o(1734),i=o(7277),a=new n(0),s=new n(-1),c={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function u(e){var t=e?e.toLowerCase():"ether",o=c[t];if("string"!=typeof o)throw new Error("[ethjs-unit] the unit provided "+e+" doesn't exists, please use the one of the following units "+JSON.stringify(c,null,2));return new n(o,10)}function l(e){if("string"==typeof e){if(!e.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+e+"', should be a number matching (^-?[0-9.]+).");return e}if("number"==typeof e)return String(e);if("object"===(0,r.default)(e)&&e.toString&&(e.toTwos||e.dividedToIntegerBy))return e.toPrecision?String(e.toPrecision()):e.toString(10);throw new Error("while converting number to string, invalid number value '"+e+"' type "+(0,r.default)(e)+".")}e.exports={unitMap:c,numberToString:l,getValueOfUnit:u,fromWei:function(e,t,o){var r=i(e),n=r.lt(a),l=u(t),m=c[t].length-1||1,f=o||{};n&&(r=r.mul(s));for(var d=r.mod(l).toString(10);d.length2)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal points");var f=m[0],d=m[1];if(f||(f="0"),d||(d="0"),d.length>i)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal places");for(;d.length0&&c.length>a){c.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+c.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=c.length,"object"===("undefined"==typeof console?"undefined":(0,r.default)(console))&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else c=s[t]=o,++e._eventsCount;return e}function d(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t1&&(t=arguments[1]),t instanceof Error)throw t;var c=new Error('Unhandled "error" event. ('+t+")");throw c.context=t,c}if(!(o=a[e]))return!1;var u="function"==typeof o;switch(r=arguments.length){case 1:!function(e,t,o){if(t)e.call(o);else for(var r=e.length,n=b(e,r),i=0;i=0;a--)if(o[a]===t||o[a].listener===t){s=o[a].listener,i=a;break}if(i<0)return this;0===i?o.shift():function(e,t){for(var o=t,r=o+1,n=e.length;r=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},7085:function(e,t,o){"use strict";var r=o(8850).Buffer,n=o(807);e.exports=function(e,t,o,i){if(r.isBuffer(e)||(e=r.from(e,"binary")),t&&(r.isBuffer(t)||(t=r.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=o/8,s=r.alloc(a),c=r.alloc(i||0),u=r.alloc(0);a>0||i>0;){var l=new n;l.update(u),l.update(e),t&&l.update(t),u=l.digest();var m=0;if(a>0){var f=s.length-a;m=Math.min(a,u.length),u.copy(s,f,0,m),a-=m}if(m0){var d=c.length-i,h=Math.min(i,u.length-m);u.copy(c,d,m,m+h),i-=h}}return u.fill(0),{key:s,iv:c}}},8184:function(e,t,o){"use strict";var r=o(1493),n=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,o){if(!r(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=o),"[object Array]"===n.call(e)?function(e,t,o){for(var r=0,n=e.length;r1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===M(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var o=function(e){var t=j(e,0,1),o=j(e,-1);if("%"===t&&"%"!==o)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===o&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return z(e,A,(function(e,t,o,n){r[r.length]=o?z(n,q,"$1"):t||e})),r}(e),r=o.length>0?o[0]:"",n=I("%"+r+"%",t),a=n.name,c=n.value,l=!1,m=n.alias;m&&(r=m[0],x(o,w([0,1],m)));for(var f=1,d=!0;f=o.length){var y=u(c,h);c=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:c[h]}else d=k(c,h),c=c[h];d&&!l&&(g[a]=c)}}return c}},2948:function(e,t,o){"use strict";var r;r="undefined"!=typeof window?window:void 0!==o.g?o.g:"undefined"!=typeof self?self:{},e.exports=r},3820:function(e,t,o){"use strict";var r=o(7701)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(e){r=null}e.exports=r},8489:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n="undefined"!=typeof Symbol&&Symbol,i=o(7027);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"===(0,r.default)(n("foo"))&&"symbol"===(0,r.default)(Symbol("bar"))&&i()}},7027:function(e,t,o){"use strict";var r=o(8847)(o(3355));e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"===(0,r.default)(Symbol.iterator))return!0;var e={},t=Symbol("test"),o=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(o))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},1191:function(e,t,o){"use strict";var r=o(7027);e.exports=function(){return r()&&!!Symbol.toStringTag}},1888:function(e,t,o){"use strict";var r=o(3767);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},2353:function(e,t,o){"use strict";var r=o(8850).Buffer,n=o(6505).Transform;function i(e){n.call(this),this._block=r.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}o(1736)(i,n),i.prototype._transform=function(e,t,o){var r=null;try{this.update(e,t)}catch(e){r=e}o(r)},i.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},i.prototype.update=function(e,t){if(function(e,t){if(!r.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");r.isBuffer(e)||(e=r.from(e,t));for(var o=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var i=this._blockOffset;i0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},i.prototype._update=function(){throw new Error("_update is not implemented")},i.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var o=0;o<4;++o)this._length[o]=0;return t},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i},7198:function(e,t,o){"use strict";var r=t;r.utils=o(4268),r.common=o(4696),r.sha=o(9310),r.ripemd=o(9294),r.hmac=o(3201),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},4696:function(e,t,o){"use strict";var r=o(4268),n=o(4504);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=i,i.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var o=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-o,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-o,this.endian);for(var n=0;n>>24&255,r[n++]=e>>>16&255,r[n++]=e>>>8&255,r[n++]=255&e}else for(r[n++]=255&e,r[n++]=e>>>8&255,r[n++]=e>>>16&255,r[n++]=e>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,i=8;ithis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},4268:function(e,t,o){"use strict";var r=o(4504),n=o(1736);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=n,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var o=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,o[r++]=63&a|128):i(e,n)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++n)),o[r++]=a>>18|240,o[r++]=a>>12&63|128,o[r++]=a>>6&63|128,o[r++]=63&a|128):(o[r++]=a>>12|224,o[r++]=a>>6&63|128,o[r++]=63&a|128)}else for(n=0;n>>0}return a},t.split32=function(e,t){for(var o=new Array(4*e.length),r=0,n=0;r>>24,o[n+1]=i>>>16&255,o[n+2]=i>>>8&255,o[n+3]=255&i):(o[n+3]=i>>>24,o[n+2]=i>>>16&255,o[n+1]=i>>>8&255,o[n]=255&i)}return o},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,o){return e+t+o>>>0},t.sum32_4=function(e,t,o,r){return e+t+o+r>>>0},t.sum32_5=function(e,t,o,r,n){return e+t+o+r+n>>>0},t.sum64=function(e,t,o,r){var n=e[t],i=r+e[t+1]>>>0,a=(i>>0,e[t+1]=i},t.sum64_hi=function(e,t,o,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,o,r){return t+r>>>0},t.sum64_4_hi=function(e,t,o,r,n,i,a,s){var c=0,u=t;return c+=(u=u+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,o,r,n,i,a,s){return t+r+i+s>>>0},t.sum64_5_hi=function(e,t,o,r,n,i,a,s,c,u){var l=0,m=t;return l+=(m=m+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,o,r,n,i,a,s,c,u){return t+r+i+s+u>>>0},t.rotr64_hi=function(e,t,o){return(t<<32-o|e>>>o)>>>0},t.rotr64_lo=function(e,t,o){return(e<<32-o|t>>>o)>>>0},t.shr64_hi=function(e,t,o){return e>>>o},t.shr64_lo=function(e,t,o){return(e<<32-o|t>>>o)>>>0}},9410:function(e,t,o){"use strict";var r=o(7198),n=o(6580),i=o(4504);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=n.toArray(e.entropy,e.entropyEnc||"hex"),o=n.toArray(e.nonce,e.nonceEnc||"hex"),r=n.toArray(e.pers,e.persEnc||"hex");i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,o,r)}e.exports=a,a.prototype._init=function(e,t,o){var r=e.concat(t).concat(o);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(o||[])),this._reseed=1},a.prototype.generate=function(e,t,o,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=o,o=t,t=null),o&&(o=n.toArray(o,r||"hex"),this._update(o));for(var i=[];i.length\\$%@\u0621\u0624\u0629\"'^|~\u2985\u2986\u30fb\u30a5\u30e3\xa2\xa3\xac\xa6\xa5\u20a9\u2502\u2190\u2191\u2192\u2193\u25a0\u25cb\ud801\udc28\ud801\udc29\ud801\udc2a\ud801\udc2b\ud801\udc2c\ud801\udc2d\ud801\udc2e\ud801\udc2f\ud801\udc30\ud801\udc31\ud801\udc32\ud801\udc33\ud801\udc34\ud801\udc35\ud801\udc36\ud801\udc37\ud801\udc38\ud801\udc39\ud801\udc3a\ud801\udc3b\ud801\udc3c\ud801\udc3d\ud801\udc3e\ud801\udc3f\ud801\udc40\ud801\udc41\ud801\udc42\ud801\udc43\ud801\udc44\ud801\udc45\ud801\udc46\ud801\udc47\ud801\udc48\ud801\udc49\ud801\udc4a\ud801\udc4b\ud801\udc4c\ud801\udc4d\ud801\udc4e\ud801\udc4f\ud801\udcd8\ud801\udcd9\ud801\udcda\ud801\udcdb\ud801\udcdc\ud801\udcdd\ud801\udcde\ud801\udcdf\ud801\udce0\ud801\udce1\ud801\udce2\ud801\udce3\ud801\udce4\ud801\udce5\ud801\udce6\ud801\udce7\ud801\udce8\ud801\udce9\ud801\udcea\ud801\udceb\ud801\udcec\ud801\udced\ud801\udcee\ud801\udcef\ud801\udcf0\ud801\udcf1\ud801\udcf2\ud801\udcf3\ud801\udcf4\ud801\udcf5\ud801\udcf6\ud801\udcf7\ud801\udcf8\ud801\udcf9\ud801\udcfa\ud801\udcfb\ud803\udcc0\ud803\udcc1\ud803\udcc2\ud803\udcc3\ud803\udcc4\ud803\udcc5\ud803\udcc6\ud803\udcc7\ud803\udcc8\ud803\udcc9\ud803\udcca\ud803\udccb\ud803\udccc\ud803\udccd\ud803\udcce\ud803\udccf\ud803\udcd0\ud803\udcd1\ud803\udcd2\ud803\udcd3\ud803\udcd4\ud803\udcd5\ud803\udcd6\ud803\udcd7\ud803\udcd8\ud803\udcd9\ud803\udcda\ud803\udcdb\ud803\udcdc\ud803\udcdd\ud803\udcde\ud803\udcdf\ud803\udce0\ud803\udce1\ud803\udce2\ud803\udce3\ud803\udce4\ud803\udce5\ud803\udce6\ud803\udce7\ud803\udce8\ud803\udce9\ud803\udcea\ud803\udceb\ud803\udcec\ud803\udced\ud803\udcee\ud803\udcef\ud803\udcf0\ud803\udcf1\ud803\udcf2\ud806\udcc0\ud806\udcc1\ud806\udcc2\ud806\udcc3\ud806\udcc4\ud806\udcc5\ud806\udcc6\ud806\udcc7\ud806\udcc8\ud806\udcc9\ud806\udcca\ud806\udccb\ud806\udccc\ud806\udccd\ud806\udcce\ud806\udccf\ud806\udcd0\ud806\udcd1\ud806\udcd2\ud806\udcd3\ud806\udcd4\ud806\udcd5\ud806\udcd6\ud806\udcd7\ud806\udcd8\ud806\udcd9\ud806\udcda\ud806\udcdb\ud806\udcdc\ud806\udcdd\ud806\udcde\ud806\udcdf\u0131\u0237\u2207\u2202\ud83a\udd22\ud83a\udd23\ud83a\udd24\ud83a\udd25\ud83a\udd26\ud83a\udd27\ud83a\udd28\ud83a\udd29\ud83a\udd2a\ud83a\udd2b\ud83a\udd2c\ud83a\udd2d\ud83a\udd2e\ud83a\udd2f\ud83a\udd30\ud83a\udd31\ud83a\udd32\ud83a\udd33\ud83a\udd34\ud83a\udd35\ud83a\udd36\ud83a\udd37\ud83a\udd38\ud83a\udd39\ud83a\udd3a\ud83a\udd3b\ud83a\udd3c\ud83a\udd3d\ud83a\udd3e\ud83a\udd3f\ud83a\udd40\ud83a\udd41\ud83a\udd42\ud83a\udd43\u066e\u06a1\u066f\u5b57\u53cc\u591a\u89e3\u4ea4\u6620\u7121\u524d\u5f8c\u518d\u65b0\u521d\u7d42\u8ca9\u58f0\u5439\u6f14\u6295\u6355\u904a\u6307\u7981\u7a7a\u5408\u6e80\u7533\u5272\u55b6\u914d\u5f97\u53ef\u4e3d\u4e38\u4e41\ud840\udd22\u4f60\u4fbb\u5002\u507a\u5099\u50cf\u349e\ud841\ude3a\u5154\u5164\u5177\ud841\udd1c\u34b9\u5167\ud841\udd4b\u5197\u51a4\u4ecc\u51ac\ud864\udddf\u5203\u34df\u523b\u5246\u5277\u3515\u5305\u5306\u5349\u535a\u5373\u537d\u537f\ud842\ude2c\u7070\u53ca\u53df\ud842\udf63\u53eb\u53f1\u5406\u549e\u5438\u5448\u5468\u54a2\u54f6\u5510\u5553\u5563\u5584\u55ab\u55b3\u55c2\u5716\u5717\u5651\u5674\u58ee\u57ce\u57f4\u580d\u578b\u5832\u5831\u58ac\ud845\udce4\u58f2\u58f7\u5906\u5922\u5962\ud845\udea8\ud845\udeea\u59ec\u5a1b\u5a27\u59d8\u5a66\u36ee\u5b08\u5b3e\ud846\uddc8\u5bc3\u5bd8\u5bf3\ud846\udf18\u5bff\u5c06\u3781\u5c60\u5cc0\u5c8d\ud847\udde4\u5d43\ud847\udde6\u5d6e\u5d6b\u5d7c\u5de1\u5de2\u382f\u5dfd\u5e28\u5e3d\u5e69\u3862\ud848\udd83\u387c\u5eb0\u5eb3\u5eb6\ud868\udf92\ud848\udf31\u8201\u5f22\u38c7\ud84c\udeb8\ud858\uddda\u5f62\u5f6b\u38e3\u5f9a\u5fcd\u5fd7\u5ff9\u6081\u393a\u391c\ud849\uded4\u60c7\u6148\u614c\u617a\u61b2\u61a4\u61af\u61de\u621b\u625d\u62b1\u62d4\u6350\ud84a\udf0c\u633d\u62fc\u6368\u6383\u63e4\ud84a\udff1\u6422\u63c5\u63a9\u3a2e\u6469\u647e\u649d\u6477\u3a6c\u656c\ud84c\udc0a\u65e3\u66f8\u6649\u3b19\u3b08\u3ae4\u5192\u5195\u6700\u669c\u80ad\u43d9\u6721\u675e\u6753\ud84c\udfc3\u3b49\u67fa\u6785\u6852\ud84d\udc6d\u688e\u681f\u6914\u6942\u69a3\u69ea\u6aa8\ud84d\udea3\u6adb\u3c18\u6b21\ud84e\udca7\u6b54\u3c4e\u6b72\u6b9f\u6bbb\ud84e\ude8d\ud847\udd0b\ud84e\udefa\u6c4e\ud84f\udcbc\u6cbf\u6ccd\u6c67\u6d16\u6d3e\u6d69\u6d78\u6d85\ud84f\udd1e\u6d34\u6e2f\u6e6e\u3d33\u6ec7\ud84f\uded1\u6df9\u6f6e\ud84f\udf5e\ud84f\udf8e\u6fc6\u7039\u701b\u3d96\u704a\u707d\u7077\u70ad\ud841\udd25\u7145\ud850\ude63\u719c\u7228\u7250\ud851\ude08\u7280\u7295\ud851\udf35\ud852\udc14\u737a\u738b\u3eac\u73a5\u3eb8\u7447\u745c\u7485\u74ca\u3f1b\u7524\ud853\udc36\u753e\ud853\udc92\ud848\udd9f\u7610\ud853\udfa1\ud853\udfb8\ud854\udc44\u3ffc\u4008\ud854\udcf3\ud854\udcf2\ud854\udd19\ud854\udd33\u771e\u771f\u778b\u4046\u4096\ud855\udc1d\u784e\u40e3\ud855\ude26\ud855\ude9a\ud855\udec5\u79eb\u412f\u7a4a\u7a4f\ud856\udd7c\ud856\udea7\u4202\ud856\udfab\u7bc6\u7bc9\u4227\ud857\udc80\u7cd2\u42a0\u7ce8\u7ce3\u7d00\ud857\udf86\u7d63\u4301\u7dc7\u7e02\u7e45\u4334\ud858\ude28\ud858\ude47\u4359\ud858\uded9\u7f7a\ud858\udf3e\u7f95\u7ffa\ud859\udcda\ud859\udd23\u8060\ud859\udda8\u8070\ud84c\udf5f\u43d5\u80b2\u8103\u440b\u813e\u5ab5\ud859\udfa7\ud859\udfb5\ud84c\udf93\ud84c\udf9c\u8204\u8f9e\u446b\u8291\u828b\u829d\u52b3\u82b1\u82b3\u82bd\u82e6\ud85a\udf3c\u831d\u8363\u83ad\u8323\u83bd\u83e7\u8353\u83ca\u83cc\u83dc\ud85b\udc36\ud85b\udd6b\ud85b\udcd5\u452b\u84f1\u84f3\u8516\ud85c\udfca\u8564\ud85b\udf2c\u455d\u4561\ud85b\udfb1\ud85c\udcd2\u456b\u8650\u8667\u8669\u86a9\u8688\u870e\u86e2\u8728\u876b\u8786\u87e1\u8801\u45f9\u8860\ud85d\ude67\u88d7\u88de\u4635\u88fa\u34bb\ud85e\udcae\ud85e\udd66\u46be\u46c7\u8aa0\ud85f\udca8\u8cab\u8cc1\u8d1b\u8d77\ud85f\udf2f\ud842\udc04\u8dcb\u8dbc\u8df0\ud842\udcde\u8ed4\ud861\uddd2\ud861\udded\u9094\u90f1\u9111\ud861\udf2e\u911b\u9238\u92d7\u92d8\u927c\u93f9\u9415\ud862\udffa\u958b\u4995\u95b7\ud863\udd77\u49e6\u96c3\u5db2\u9723\ud864\udd45\ud864\ude1a\u4a6e\u4a76\u97e0\ud865\udc0a\u4ab2\ud865\udc96\u9829\ud865\uddb6\u98e2\u4b33\u9929\u99a7\u99c2\u99fe\u4bce\ud866\udf30\u9c40\u9cfd\u4cce\u4ced\u9d67\ud868\udcce\u4cf8\ud868\udd05\ud868\ude0e\ud868\ude91\u4d56\u9efe\u9f05\u9f0f\u9f16\ud869\ude00",mapChar:function(o){return o>=196608?o>=917760&&o<=917999?18874368:0:e[t[o>>4]][15&o]}};var e,t}.apply(t,[]))||(e.exports=r)},4489:function(e,t,o){"use strict";var r=o(8847)(o(3106));function n(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,t){if(e){if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){o&&(e=o);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==o.return||o.return()}finally{if(c)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,d=String.fromCharCode;function h(e){throw new RangeError(m[e])}function p(e,t){var o=e.split("@"),r="";o.length>1&&(r=o[0]+"@",e=o[1]);var n=function(e,t){for(var o=[],r=e.length;r--;)o[r]=t(e[r]);return o}((e=e.replace(l,".")).split("."),t).join(".");return r+n}function g(e){for(var t=[],o=0,r=e.length;o=55296&&n<=56319&&o>1,e+=f(e/t);e>455;r+=s)e=f(e/35);return f(r+36*e/(e+38))},v=function(e){var t,o=[],r=e.length,n=0,i=128,c=72,u=e.lastIndexOf("-");u<0&&(u=0);for(var l=0;l=128&&h("not-basic"),o.push(e.charCodeAt(l));for(var m=u>0?u+1:0;m=r&&h("invalid-input");var b=(t=e.charCodeAt(m++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:s;(b>=s||b>f((a-n)/p))&&h("overflow"),n+=b*p;var v=g<=c?1:g>=c+26?26:g-c;if(bf(a/k)&&h("overflow"),p*=k}var w=o.length+1;c=y(n-d,w,0==d),f(n/w)>a-i&&h("overflow"),i+=f(n/w),n%=w,o.splice(n++,0,i)}return String.fromCodePoint.apply(String,o)},k=function(e){var t,o=[],r=(e=g(e)).length,i=128,c=0,u=72,l=n(e);try{for(l.s();!(t=l.n()).done;){var m=t.value;m<128&&o.push(d(m))}}catch(e){l.e(e)}finally{l.f()}var p=o.length,v=p;for(p&&o.push("-");v=i&&zf((a-c)/j)&&h("overflow"),c+=(w-i)*j,i=w;var M,A=n(e);try{for(A.s();!(M=A.n()).done;){var q=M.value;if(qa&&h("overflow"),q==i){for(var I=c,E=s;;E+=s){var S=E<=u?1:E>=u+26?26:E-u;if(I>23,f=l>>21&3,d=l>>5&65535,h=31&l,p=t.mapStr.substr(d,h);if(0===f||r&&1&m)throw new Error("Illegal char "+u);1===f?i.push(p):2===f?i.push(n?p:u):3===f&&i.push(u)}return i.join("").normalize("NFC")}function r(t,r,i){void 0===i&&(i=!1);var a=o(t,i,r).split(".");return(a=a.map((function(t){return t.startsWith("xn--")?n(t=e.decode(t.substring(4)),i,!1):n(t,i,r),t}))).join(".")}function n(e,r,n){if("-"===e[2]&&"-"===e[3])throw new Error("Failed to validate "+e);if(e.startsWith("-")||e.endsWith("-"))throw new Error("Failed to validate "+e);if(e.includes("."))throw new Error("Failed to validate "+e);if(o(e,r,n)!==e)throw new Error("Failed to validate "+e);var i=e.codePointAt(0);if(t.mapChar(i)&2<<23)throw new Error("Label contains illegal character: "+i)}return{toUnicode:function(e,t){return void 0===t&&(t={}),r(e,!1,"useStd3ASCII"in t&&t.useStd3ASCII)},toAscii:function(t,o){void 0===o&&(o={});var n,i=!("transitional"in o)||o.transitional,a="useStd3ASCII"in o&&o.useStd3ASCII,s="verifyDnsLength"in o&&o.verifyDnsLength,c=r(t,i,a).split(".").map(e.toASCII),u=c.join(".");if(s){if(u.length<1||u.length>253)throw new Error("DNS name has wrong length: "+u);for(n=0;n63)throw new Error("DNS label has wrong length: "+l)}}return u}}}(e,t)}.apply(t,r))||(e.exports=n)},3226:function(e,t){"use strict";t.read=function(e,t,o,r,n){var i,a,s=8*n-r-1,c=(1<>1,l=-7,m=o?n-1:0,f=o?-1:1,d=e[t+m];for(m+=f,i=d&(1<<-l)-1,d>>=-l,l+=s;l>0;i=256*i+e[t+m],m+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+m],m+=f,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=u}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,o,r,n,i){var a,s,c,u=8*i-n-1,l=(1<>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+m>=1?f/c:f*Math.pow(2,1-m))*c>=2&&(a++,c/=2),a+m>=l?(s=0,a=l):a+m>=1?(s=(t*c-1)*Math.pow(2,n),a+=m):(s=t*Math.pow(2,m-1)*Math.pow(2,n),a=0));n>=8;e[o+d]=255&s,d+=h,s/=256,n-=8);for(a=a<0;e[o+d]=255&a,d+=h,a/=256,u-=8);e[o+d-h]|=128*p}},1736:function(e){"use strict";"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var o=function(){};o.prototype=t.prototype,e.prototype=new o,e.prototype.constructor=e}}},9446:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=o(1191)(),i=o(593)("Object.prototype.toString"),a=function(e){return!(n&&e&&"object"===(0,r.default)(e)&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!a(e)||null!==e&&"object"===(0,r.default)(e)&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},c=function(){return a(arguments)}();a.isLegacyArguments=s,e.exports=c?a:s},1493:function(e,t,o){"use strict";var r,n,i=o(8847)(o(3355)),a=Function.prototype.toString,s="object"===("undefined"==typeof Reflect?"undefined":(0,i.default)(Reflect))&&null!==Reflect&&Reflect.apply;if("function"==typeof s&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},s((function(){throw 42}),null,r)}catch(e){e!==n&&(s=null)}else s=null;var c=/^\s*class\b/,u=function(e){try{var t=a.call(e);return c.test(t)}catch(e){return!1}},l=function(e){try{return!u(e)&&(a.call(e),!0)}catch(e){return!1}},m=Object.prototype.toString,f="function"==typeof Symbol&&!!Symbol.toStringTag,d=!(0 in[,]),h=function(){return!1};if("object"===("undefined"==typeof document?"undefined":(0,i.default)(document))){var p=document.all;m.call(p)===m.call(document.all)&&(h=function(e){if((d||!e)&&(void 0===e||"object"===(0,i.default)(e)))try{var t=m.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=s?function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!==(0,i.default)(e))return!1;try{s(e,null,r)}catch(e){if(e!==n)return!1}return!u(e)&&l(e)}:function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!==(0,i.default)(e))return!1;if(f)return l(e);if(u(e))return!1;var t=m.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&l(e)}},4339:function(e){"use strict";e.exports=function(e){if(!e)return!1;var o=t.call(e);return"[object Function]"===o||"function"==typeof e&&"[object RegExp]"!==o||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString},4477:function(e,t,o){"use strict";var r,n=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=o(1191)(),c=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(a.test(i.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===n.call(e);if(!c)return!1;if(void 0===r){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();r=!!t&&c(t)}return c(e)===r}},8619:function(e,t,o){"use strict";var r=o(8847)(o(3355));e.exports=function(e){if("string"!=typeof e)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+(0,r.default)(e)+", while checking isHexPrefixed.");return"0x"===e.slice(0,2)}},8915:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=o(8184),i=o(3604),a=o(593),s=a("Object.prototype.toString"),c=o(1191)(),u=o(3820),l="undefined"==typeof globalThis?o.g:globalThis,m=i(),f=a("Array.prototype.indexOf",!0)||function(e,t){for(var o=0;o-1}return!!u&&function(e){var t=!1;return n(h,(function(o,r){if(!t)try{t=o.call(e)===r}catch(e){}})),t}(e)}},9484:function(e){"use strict";var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},4858:function(e,t,o){"use strict";e=o.nmd(e);var r=o(9142),n=o(8847)(o(3355));!function(){var t="object"===("undefined"==typeof window?"undefined":(0,n.default)(window))?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"===(void 0===r?"undefined":(0,n.default)(r))&&r.versions&&r.versions.node&&(t=o.g);for(var i=!t.JS_SHA3_NO_COMMON_JS&&"object"===(0,n.default)(e)&&e.exports,a="0123456789abcdef".split(""),s=[0,8,16,24],c=[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],u=[224,256,384,512],l=["hex","buffer","arrayBuffer","array"],m=function(e,t,o){return function(r){return new x(e,t,e).update(r)[o]()}},f=function(e,t,o){return function(r,n){return new x(e,t,n).update(r)[o]()}},d=function(e,t){var o=m(e,t,"hex");o.create=function(){return new x(e,t,e)},o.update=function(e){return o.create().update(e)};for(var r=0;r>5,this.byteCount=this.blockCount<<2,this.outputBlocks=o>>5,this.extraBytes=(31&o)>>3;for(var r=0;r<50;++r)this.s[r]=0}x.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var o,r,n=e.length,i=this.blocks,a=this.byteCount,c=this.blockCount,u=0,l=this.s;u>2]|=e[u]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(i[o>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=a){for(this.start=o-a,this.block=i[c],o=0;o>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[o],t=1;t>4&15]+a[15&e]+a[e>>12&15]+a[e>>8&15]+a[e>>20&15]+a[e>>16&15]+a[e>>28&15]+a[e>>24&15];s%t==0&&(z(o),i=0)}return n&&(e=o[i],n>0&&(c+=a[e>>4&15]+a[15&e]),n>1&&(c+=a[e>>12&15]+a[e>>8&15]),n>2&&(c+=a[e>>20&15]+a[e>>16&15])),c},x.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,o=this.s,r=this.outputBlocks,n=this.extraBytes,i=0,a=0,s=this.outputBits>>3;e=n?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%o==0&&z(r)}return i&&(e=s<<2,t=r[a],i>0&&(c[e]=255&t),i>1&&(c[e+1]=t>>8&255),i>2&&(c[e+2]=t>>16&255)),c};var z=function(e){var t,o,r,n,i,a,s,u,l,m,f,d,h,p,g,b,y,v,k,w,x,z,j,M,A,q,I,E,S,N,_,T,O,C,D,L,P,R,B,U,F,Q,Y,H,G,W,Z,V,K,J,X,$,ee,te,oe,re,ne,ie,ae,se,ce,ue,le;for(r=0;r<48;r+=2)n=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],m=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),o=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=o,e[10]^=t,e[11]^=o,e[20]^=t,e[21]^=o,e[30]^=t,e[31]^=o,e[40]^=t,e[41]^=o,t=n^(u<<1|l>>>31),o=i^(l<<1|u>>>31),e[2]^=t,e[3]^=o,e[12]^=t,e[13]^=o,e[22]^=t,e[23]^=o,e[32]^=t,e[33]^=o,e[42]^=t,e[43]^=o,t=a^(m<<1|f>>>31),o=s^(f<<1|m>>>31),e[4]^=t,e[5]^=o,e[14]^=t,e[15]^=o,e[24]^=t,e[25]^=o,e[34]^=t,e[35]^=o,e[44]^=t,e[45]^=o,t=u^(d<<1|h>>>31),o=l^(h<<1|d>>>31),e[6]^=t,e[7]^=o,e[16]^=t,e[17]^=o,e[26]^=t,e[27]^=o,e[36]^=t,e[37]^=o,e[46]^=t,e[47]^=o,t=m^(n<<1|i>>>31),o=f^(i<<1|n>>>31),e[8]^=t,e[9]^=o,e[18]^=t,e[19]^=o,e[28]^=t,e[29]^=o,e[38]^=t,e[39]^=o,e[48]^=t,e[49]^=o,p=e[0],g=e[1],W=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,E=e[20]<<3|e[21]>>>29,S=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,Q=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,K=e[23]<<10|e[22]>>>22,N=e[33]<<13|e[32]>>>19,_=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,oe=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,P=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,k=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,T=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,M=e[6]<<28|e[7]>>>4,A=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,R=e[26]<<25|e[27]>>>7,B=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,x=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,q=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,U=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,z=e[48]<<14|e[49]>>>18,j=e[49]<<14|e[48]>>>18,e[0]=p^~b&v,e[1]=g^~y&k,e[10]=M^~q&E,e[11]=A^~I&S,e[20]=C^~L&R,e[21]=D^~P&B,e[30]=H^~W&V,e[31]=G^~Z&K,e[40]=te^~re&ie,e[41]=oe^~ne&ae,e[2]=b^~v&w,e[3]=y^~k&x,e[12]=q^~E&N,e[13]=I^~S&_,e[22]=L^~R&U,e[23]=P^~B&F,e[32]=W^~V&J,e[33]=Z^~K&X,e[42]=re^~ie&se,e[43]=ne^~ae&ce,e[4]=v^~w&z,e[5]=k^~x&j,e[14]=E^~N&T,e[15]=S^~_&O,e[24]=R^~U&Q,e[25]=B^~F&Y,e[34]=V^~J&$,e[35]=K^~X&ee,e[44]=ie^~se&ue,e[45]=ae^~ce&le,e[6]=w^~z&p,e[7]=x^~j&g,e[16]=N^~T&M,e[17]=_^~O&A,e[26]=U^~Q&C,e[27]=F^~Y&D,e[36]=J^~$&H,e[37]=X^~ee&G,e[46]=se^~ue&te,e[47]=ce^~le&oe,e[8]=z^~p&b,e[9]=j^~g&y,e[18]=T^~M&q,e[19]=O^~A&I,e[28]=Q^~C&L,e[29]=Y^~D&P,e[38]=$^~H&W,e[39]=ee^~G&Z,e[48]=ue^~te&re,e[49]=le^~oe&ne,e[0]^=c[r],e[1]^=c[r+1]};if(i)e.exports=p;else for(b=0;b>>31),h=f^(a<<1|i>>>31),p=e[0]^d,g=e[1]^h,b=e[10]^d,y=e[11]^h,v=e[20]^d,k=e[21]^h,w=e[30]^d,x=e[31]^h,z=e[40]^d,j=e[41]^h;d=r^(s<<1|c>>>31),h=n^(c<<1|s>>>31);var M=e[2]^d,A=e[3]^h,q=e[12]^d,I=e[13]^h,E=e[22]^d,S=e[23]^h,N=e[32]^d,_=e[33]^h,T=e[42]^d,O=e[43]^h;d=i^(u<<1|l>>>31),h=a^(l<<1|u>>>31);var C=e[4]^d,D=e[5]^h,L=e[14]^d,P=e[15]^h,R=e[24]^d,B=e[25]^h,U=e[34]^d,F=e[35]^h,Q=e[44]^d,Y=e[45]^h;d=s^(m<<1|f>>>31),h=c^(f<<1|m>>>31);var H=e[6]^d,G=e[7]^h,W=e[16]^d,Z=e[17]^h,V=e[26]^d,K=e[27]^h,J=e[36]^d,X=e[37]^h,$=e[46]^d,ee=e[47]^h;d=u^(r<<1|n>>>31),h=l^(n<<1|r>>>31);var te=e[8]^d,oe=e[9]^h,re=e[18]^d,ne=e[19]^h,ie=e[28]^d,ae=e[29]^h,se=e[38]^d,ce=e[39]^h,ue=e[48]^d,le=e[49]^h,me=p,fe=g,de=y<<4|b>>>28,he=b<<4|y>>>28,pe=v<<3|k>>>29,ge=k<<3|v>>>29,be=x<<9|w>>>23,ye=w<<9|x>>>23,ve=z<<18|j>>>14,ke=j<<18|z>>>14,we=M<<1|A>>>31,xe=A<<1|M>>>31,ze=I<<12|q>>>20,je=q<<12|I>>>20,Me=E<<10|S>>>22,Ae=S<<10|E>>>22,qe=_<<13|N>>>19,Ie=N<<13|_>>>19,Ee=T<<2|O>>>30,Se=O<<2|T>>>30,Ne=D<<30|C>>>2,_e=C<<30|D>>>2,Te=L<<6|P>>>26,Oe=P<<6|L>>>26,Ce=B<<11|R>>>21,De=R<<11|B>>>21,Le=U<<15|F>>>17,Pe=F<<15|U>>>17,Re=Y<<29|Q>>>3,Be=Q<<29|Y>>>3,Ue=H<<28|G>>>4,Fe=G<<28|H>>>4,Qe=Z<<23|W>>>9,Ye=W<<23|Z>>>9,He=V<<25|K>>>7,Ge=K<<25|V>>>7,We=J<<21|X>>>11,Ze=X<<21|J>>>11,Ve=ee<<24|$>>>8,Ke=$<<24|ee>>>8,Je=te<<27|oe>>>5,Xe=oe<<27|te>>>5,$e=re<<20|ne>>>12,et=ne<<20|re>>>12,tt=ae<<7|ie>>>25,ot=ie<<7|ae>>>25,rt=se<<8|ce>>>24,nt=ce<<8|se>>>24,it=ue<<14|le>>>18,at=le<<14|ue>>>18;e[0]=me^~ze&Ce,e[1]=fe^~je&De,e[10]=Ue^~$e&pe,e[11]=Fe^~et&ge,e[20]=we^~Te&He,e[21]=xe^~Oe&Ge,e[30]=Je^~de&Me,e[31]=Xe^~he&Ae,e[40]=Ne^~Qe&tt,e[41]=_e^~Ye&ot,e[2]=ze^~Ce&We,e[3]=je^~De&Ze,e[12]=$e^~pe&qe,e[13]=et^~ge&Ie,e[22]=Te^~He&rt,e[23]=Oe^~Ge&nt,e[32]=de^~Me&Le,e[33]=he^~Ae&Pe,e[42]=Qe^~tt&be,e[43]=Ye^~ot&ye,e[4]=Ce^~We&it,e[5]=De^~Ze&at,e[14]=pe^~qe&Re,e[15]=ge^~Ie&Be,e[24]=He^~rt&ve,e[25]=Ge^~nt&ke,e[34]=Me^~Le&Ve,e[35]=Ae^~Pe&Ke,e[44]=tt^~be&Ee,e[45]=ot^~ye&Se,e[6]=We^~it&me,e[7]=Ze^~at&fe,e[16]=qe^~Re&Ue,e[17]=Ie^~Be&Fe,e[26]=rt^~ve&we,e[27]=nt^~ke&xe,e[36]=Le^~Ve&Je,e[37]=Pe^~Ke&Xe,e[46]=be^~Ee&Ne,e[47]=ye^~Se&_e,e[8]=it^~me&ze,e[9]=at^~fe&je,e[18]=Re^~Ue&$e,e[19]=Be^~Fe&et,e[28]=ve^~we&Te,e[29]=ke^~xe&Oe,e[38]=Ve^~Je&de,e[39]=Ke^~Xe&he,e[48]=Ee^~Ne&Qe,e[49]=Se^~_e&Ye,e[0]^=o[2*t],e[1]^=o[2*t+1]}}},801:function(e,t,o){"use strict";var r=o(9033).Buffer,n=o(5612);function i(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}i.prototype.initialize=function(e,t){for(var o=0;o<50;++o)this.state[o]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},i.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},i.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=i},807:function(e,t,o){"use strict";var r=o(1736),n=o(2353),i=o(8850).Buffer,a=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,o,r,n,i,a){return c(e+(t&o|~t&r)+n+i|0,a)+t|0}function l(e,t,o,r,n,i,a){return c(e+(t&r|o&~r)+n+i|0,a)+t|0}function m(e,t,o,r,n,i,a){return c(e+(t^o^r)+n+i|0,a)+t|0}function f(e,t,o,r,n,i,a){return c(e+(o^(t|~r))+n+i|0,a)+t|0}r(s,n),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var o=this._a,r=this._b,n=this._c,i=this._d;o=u(o,r,n,i,e[0],3614090360,7),i=u(i,o,r,n,e[1],3905402710,12),n=u(n,i,o,r,e[2],606105819,17),r=u(r,n,i,o,e[3],3250441966,22),o=u(o,r,n,i,e[4],4118548399,7),i=u(i,o,r,n,e[5],1200080426,12),n=u(n,i,o,r,e[6],2821735955,17),r=u(r,n,i,o,e[7],4249261313,22),o=u(o,r,n,i,e[8],1770035416,7),i=u(i,o,r,n,e[9],2336552879,12),n=u(n,i,o,r,e[10],4294925233,17),r=u(r,n,i,o,e[11],2304563134,22),o=u(o,r,n,i,e[12],1804603682,7),i=u(i,o,r,n,e[13],4254626195,12),n=u(n,i,o,r,e[14],2792965006,17),o=l(o,r=u(r,n,i,o,e[15],1236535329,22),n,i,e[1],4129170786,5),i=l(i,o,r,n,e[6],3225465664,9),n=l(n,i,o,r,e[11],643717713,14),r=l(r,n,i,o,e[0],3921069994,20),o=l(o,r,n,i,e[5],3593408605,5),i=l(i,o,r,n,e[10],38016083,9),n=l(n,i,o,r,e[15],3634488961,14),r=l(r,n,i,o,e[4],3889429448,20),o=l(o,r,n,i,e[9],568446438,5),i=l(i,o,r,n,e[14],3275163606,9),n=l(n,i,o,r,e[3],4107603335,14),r=l(r,n,i,o,e[8],1163531501,20),o=l(o,r,n,i,e[13],2850285829,5),i=l(i,o,r,n,e[2],4243563512,9),n=l(n,i,o,r,e[7],1735328473,14),o=m(o,r=l(r,n,i,o,e[12],2368359562,20),n,i,e[5],4294588738,4),i=m(i,o,r,n,e[8],2272392833,11),n=m(n,i,o,r,e[11],1839030562,16),r=m(r,n,i,o,e[14],4259657740,23),o=m(o,r,n,i,e[1],2763975236,4),i=m(i,o,r,n,e[4],1272893353,11),n=m(n,i,o,r,e[7],4139469664,16),r=m(r,n,i,o,e[10],3200236656,23),o=m(o,r,n,i,e[13],681279174,4),i=m(i,o,r,n,e[0],3936430074,11),n=m(n,i,o,r,e[3],3572445317,16),r=m(r,n,i,o,e[6],76029189,23),o=m(o,r,n,i,e[9],3654602809,4),i=m(i,o,r,n,e[12],3873151461,11),n=m(n,i,o,r,e[15],530742520,16),o=f(o,r=m(r,n,i,o,e[2],3299628645,23),n,i,e[0],4096336452,6),i=f(i,o,r,n,e[7],1126891415,10),n=f(n,i,o,r,e[14],2878612391,15),r=f(r,n,i,o,e[5],4237533241,21),o=f(o,r,n,i,e[12],1700485571,6),i=f(i,o,r,n,e[3],2399980690,10),n=f(n,i,o,r,e[10],4293915773,15),r=f(r,n,i,o,e[1],2240044497,21),o=f(o,r,n,i,e[8],1873313359,6),i=f(i,o,r,n,e[15],4264355552,10),n=f(n,i,o,r,e[6],2734768916,15),r=f(r,n,i,o,e[13],1309151649,21),o=f(o,r,n,i,e[4],4149444226,6),i=f(i,o,r,n,e[11],3174756917,10),n=f(n,i,o,r,e[2],718787259,15),r=f(r,n,i,o,e[9],3951481745,21),this._a=this._a+o|0,this._b=this._b+r|0,this._c=this._c+n|0,this._d=this._d+i|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=i.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},137:function(e,t,o){"use strict";var r=o(1734),n=o(2202);function i(e){this.rand=e||new n.Rand}e.exports=i,i.create=function(e){return new i(e)},i.prototype._randbelow=function(e){var t=e.bitLength(),o=Math.ceil(t/8);do{var n=new r(this.rand.generate(o))}while(n.cmp(e)>=0);return n},i.prototype._randrange=function(e,t){var o=t.sub(e);return e.add(this._randbelow(o))},i.prototype.test=function(e,t,o){var n=e.bitLength(),i=r.mont(e),a=new r(1).toRed(i);t||(t=Math.max(1,n/48|0));for(var s=e.subn(1),c=0;!s.testn(c);c++);for(var u=e.shrn(c),l=s.toRed(i);t>0;t--){var m=this._randrange(new r(2),s);o&&o(m);var f=m.toRed(i).redPow(u);if(0!==f.cmp(a)&&0!==f.cmp(l)){for(var d=1;d0;t--){var l=this._randrange(new r(2),a),m=e.gcd(l);if(0!==m.cmpn(1))return m;var f=l.toRed(n).redPow(c);if(0!==f.cmp(i)&&0!==f.cmp(u)){for(var d=1;d>8,a=255&n;i?o.push(i,a):o.push(a)}return o},o.zero2=r,o.toHex=n,o.encode=function(e,t){return"hex"===t?n(e):e}},6565:function(e,t,o){"use strict";var r=o(8847),n=r(o(9721)),i=r(o(8985)),a=function(){function e(t,o,r,i){(0,n.default)(this,e),this.name=t,this.code=o,this.alphabet=i,r&&i&&(this.engine=r(i))}return(0,i.default)(e,[{key:"encode",value:function(e){return this.engine.encode(e)}},{key:"decode",value:function(e){return this.engine.decode(e)}},{key:"isImplemented",value:function(){return this.engine}}]),e}();e.exports=a},2642:function(e,t,o){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==o.return||o.return()}finally{if(c)throw a}}}}(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;if(e.indexOf(a)<0)throw new Error("invalid base16 character")}}catch(e){i.e(e)}finally{i.f()}return n.from(t,"hex")}}}},6494:function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o=5;)s+=t[a>>>i-5&31],i-=5;if(i>0&&(s+=t[a<<5-i&31]),n)for(;s.length%8!=0;)s+="=";return s}("string"==typeof t?Uint8Array.from(t):t,e)},decode:function(o){var r,n=function(e,o){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,o){if(e){if("string"==typeof e)return t(e,o);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,o):void 0}}(e))||o&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(o);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(e.indexOf(i)<0)throw new Error("invalid base32 character")}}catch(e){n.e(e)}finally{n.f()}return function(e,t){for(var o=(e=e.replace(new RegExp("=","g"),"")).length,r=0,n=0,i=0,a=new Uint8Array(5*o/8|0),s=0;s=8&&(a[i++]=n>>>r-8&255,r-=8);return a.buffer}(o,e)}}}},6627:function(e,t,o){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o-1,o=e.indexOf("-")>-1&&e.indexOf("_")>-1;return{encode:function(e){var r="";r="string"==typeof e?n.from(e).toString("base64"):e.toString("base64"),o&&(r=r.replace(/\+/g,"-").replace(/\//g,"_"));var i=r.indexOf("=");return i>0&&!t&&(r=r.substring(0,i)),r},decode:function(t){var o,i=function(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,t){if(e){if("string"==typeof e)return r(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){o&&(e=o);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==o.return||o.return()}finally{if(c)throw a}}}}(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;if(e.indexOf(a)<0)throw new Error("invalid base64 character")}}catch(e){i.e(e)}finally{i.f()}return n.from(t,"base64")}}}},7905:function(e,t,o){"use strict";var r=o(6565),n=o(7548),i=o(2642),a=o(6494),s=o(6627),c=[["base1","1","","1"],["base2","0",n,"01"],["base8","7",n,"01234567"],["base10","9",n,"0123456789"],["base16","f",i,"0123456789abcdef"],["base32","b",a,"abcdefghijklmnopqrstuvwxyz234567"],["base32pad","c",a,"abcdefghijklmnopqrstuvwxyz234567="],["base32hex","v",a,"0123456789abcdefghijklmnopqrstuv"],["base32hexpad","t",a,"0123456789abcdefghijklmnopqrstuv="],["base32z","h",a,"ybndrfg8ejkmcpqxot1uwisza345h769"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base64","m",s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],u=c.reduce((function(e,t){return e[t[0]]=new r(t[0],t[1],t[2],t[3]),e}),{}),l=c.reduce((function(e,t){return e[t[1]]=u[t[0]],e}),{});e.exports={names:u,codes:l}},6086:function(e,t,o){"use strict";var r=o(9033).Buffer,n=o(7905);(t=e.exports=a).encode=function(e,t){var o=s(e);return a(o.name,r.from(o.encode(t)))},t.decode=function(e){r.isBuffer(e)&&(e=e.toString());var t=e.substring(0,1);"string"==typeof(e=e.substring(1,e.length))&&(e=r.from(e));var o=s(t);return r.from(o.decode(e.toString()))},t.isEncoded=function(e){if(r.isBuffer(e)&&(e=e.toString()),"[object String]"!==Object.prototype.toString.call(e))return!1;var t=e.substring(0,1);try{return s(t).name}catch(e){return!1}},t.names=Object.freeze(Object.keys(n.names)),t.codes=Object.freeze(Object.keys(n.codes));var i=new Error("Unsupported encoding");function a(e,t){if(!t)throw new Error("requires an encoded buffer");var o=s(e),n=r.from(o.code);return function(e,t){s(e).decode(t.toString())}(o.name,t),r.concat([n,t])}function s(e){var t;if(n.names[e])t=n.names[e];else{if(!n.codes[e])throw i;t=n.codes[e]}if(!t.isImplemented())throw new Error("Base "+e+" is not implemented yet");return t}},4093:function(e,t,o){"use strict";for(var r=o(8847)(o(4519)),n=o(4070),i={},a=0,s=Object.entries(n);ae.length)&&(t=e.length);for(var o=0,r=new Array(t);o=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==o.return||o.return()}finally{if(c)throw a}}}}(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;if(e.indexOf(a)<0)throw new Error("invalid base16 character")}}catch(e){i.e(e)}finally{i.f()}return n.from(t,"hex")}}}},976:function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o=5;)s+=t[a>>>i-5&31],i-=5;if(i>0&&(s+=t[a<<5-i&31]),n)for(;s.length%8!=0;)s+="=";return s}("string"==typeof t?Uint8Array.from(t):t,e)},decode:function(o){var r,n=function(e,o){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,o){if(e){if("string"==typeof e)return t(e,o);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,o):void 0}}(e))||o&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(o);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(e.indexOf(i)<0)throw new Error("invalid base32 character")}}catch(e){n.e(e)}finally{n.f()}return function(e,t){for(var o=(e=e.replace(new RegExp("=","g"),"")).length,r=0,n=0,i=0,a=new Uint8Array(5*o/8|0),s=0;s=8&&(a[i++]=n>>>r-8&255,r-=8);return a.buffer}(o,e)}}}},8504:function(e,t,o){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o-1,o=e.indexOf("-")>-1&&e.indexOf("_")>-1;return{encode:function(e){var r="";r="string"==typeof e?n.from(e).toString("base64"):e.toString("base64"),o&&(r=r.replace(/\+/g,"-").replace(/\//g,"_"));var i=r.indexOf("=");return i>0&&!t&&(r=r.substring(0,i)),r},decode:function(t){var o,i=function(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,t){if(e){if("string"==typeof e)return r(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){o&&(e=o);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==o.return||o.return()}finally{if(c)throw a}}}}(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;if(e.indexOf(a)<0)throw new Error("invalid base64 character")}}catch(e){i.e(e)}finally{i.f()}return n.from(t,"base64")}}}},2263:function(e,t,o){"use strict";var r=o(1786),n=o(7548),i=o(7739),a=o(976),s=o(8504),c=[["base1","1","","1"],["base2","0",n,"01"],["base8","7",n,"01234567"],["base10","9",n,"0123456789"],["base16","f",i,"0123456789abcdef"],["base32","b",a,"abcdefghijklmnopqrstuvwxyz234567"],["base32pad","c",a,"abcdefghijklmnopqrstuvwxyz234567="],["base32hex","v",a,"0123456789abcdefghijklmnopqrstuv"],["base32hexpad","t",a,"0123456789abcdefghijklmnopqrstuv="],["base32z","h",a,"ybndrfg8ejkmcpqxot1uwisza345h769"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base64","m",s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],u=c.reduce((function(e,t){return e[t[0]]=new r(t[0],t[1],t[2],t[3]),e}),{}),l=c.reduce((function(e,t){return e[t[1]]=u[t[0]],e}),{});e.exports={names:u,codes:l}},2592:function(e,t,o){"use strict";var r=o(9033).Buffer,n=o(2263);function i(e,t){if(!t)throw new Error("requires an encoded buffer");var o=a(e),n=r.from(o.code);return function(e,t){a(e).decode(t.toString())}(o.name,t),r.concat([n,t])}function a(e){var t;if(n.names[e])t=n.names[e];else{if(!n.codes[e])throw new Error("Unsupported encoding");t=n.codes[e]}if(!t.isImplemented())throw new Error("Base "+e+" is not implemented yet");return t}(t=e.exports=i).encode=function(e,t){var o=a(e);return i(o.name,r.from(o.encode(t)))},t.decode=function(e){r.isBuffer(e)&&(e=e.toString());var t=e.substring(0,1);"string"==typeof(e=e.substring(1,e.length))&&(e=r.from(e));var o=a(t);return r.from(o.decode(e.toString()))},t.isEncoded=function(e){if(r.isBuffer(e)&&(e=e.toString()),"[object String]"!==Object.prototype.toString.call(e))return!1;var t=e.substring(0,1);try{return a(t).name}catch(e){return!1}},t.names=Object.freeze(Object.keys(n.names)),t.codes=Object.freeze(Object.keys(n.codes))},1269:function(e,t){"use strict";t.names=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"dbl-sha2-256":86,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"murmur3-128":34,"murmur3-32":35,md4:212,md5:213,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"Skein256-8":45825,"Skein256-16":45826,"Skein256-24":45827,"Skein256-32":45828,"Skein256-40":45829,"Skein256-48":45830,"Skein256-56":45831,"Skein256-64":45832,"Skein256-72":45833,"Skein256-80":45834,"Skein256-88":45835,"Skein256-96":45836,"Skein256-104":45837,"Skein256-112":45838,"Skein256-120":45839,"Skein256-128":45840,"Skein256-136":45841,"Skein256-144":45842,"Skein256-152":45843,"Skein256-160":45844,"Skein256-168":45845,"Skein256-176":45846,"Skein256-184":45847,"Skein256-192":45848,"Skein256-200":45849,"Skein256-208":45850,"Skein256-216":45851,"Skein256-224":45852,"Skein256-232":45853,"Skein256-240":45854,"Skein256-248":45855,"Skein256-256":45856,"Skein512-8":45857,"Skein512-16":45858,"Skein512-24":45859,"Skein512-32":45860,"Skein512-40":45861,"Skein512-48":45862,"Skein512-56":45863,"Skein512-64":45864,"Skein512-72":45865,"Skein512-80":45866,"Skein512-88":45867,"Skein512-96":45868,"Skein512-104":45869,"Skein512-112":45870,"Skein512-120":45871,"Skein512-128":45872,"Skein512-136":45873,"Skein512-144":45874,"Skein512-152":45875,"Skein512-160":45876,"Skein512-168":45877,"Skein512-176":45878,"Skein512-184":45879,"Skein512-192":45880,"Skein512-200":45881,"Skein512-208":45882,"Skein512-216":45883,"Skein512-224":45884,"Skein512-232":45885,"Skein512-240":45886,"Skein512-248":45887,"Skein512-256":45888,"Skein512-264":45889,"Skein512-272":45890,"Skein512-280":45891,"Skein512-288":45892,"Skein512-296":45893,"Skein512-304":45894,"Skein512-312":45895,"Skein512-320":45896,"Skein512-328":45897,"Skein512-336":45898,"Skein512-344":45899,"Skein512-352":45900,"Skein512-360":45901,"Skein512-368":45902,"Skein512-376":45903,"Skein512-384":45904,"Skein512-392":45905,"Skein512-400":45906,"Skein512-408":45907,"Skein512-416":45908,"Skein512-424":45909,"Skein512-432":45910,"Skein512-440":45911,"Skein512-448":45912,"Skein512-456":45913,"Skein512-464":45914,"Skein512-472":45915,"Skein512-480":45916,"Skein512-488":45917,"Skein512-496":45918,"Skein512-504":45919,"Skein512-512":45920,"Skein1024-8":45921,"Skein1024-16":45922,"Skein1024-24":45923,"Skein1024-32":45924,"Skein1024-40":45925,"Skein1024-48":45926,"Skein1024-56":45927,"Skein1024-64":45928,"Skein1024-72":45929,"Skein1024-80":45930,"Skein1024-88":45931,"Skein1024-96":45932,"Skein1024-104":45933,"Skein1024-112":45934,"Skein1024-120":45935,"Skein1024-128":45936,"Skein1024-136":45937,"Skein1024-144":45938,"Skein1024-152":45939,"Skein1024-160":45940,"Skein1024-168":45941,"Skein1024-176":45942,"Skein1024-184":45943,"Skein1024-192":45944,"Skein1024-200":45945,"Skein1024-208":45946,"Skein1024-216":45947,"Skein1024-224":45948,"Skein1024-232":45949,"Skein1024-240":45950,"Skein1024-248":45951,"Skein1024-256":45952,"Skein1024-264":45953,"Skein1024-272":45954,"Skein1024-280":45955,"Skein1024-288":45956,"Skein1024-296":45957,"Skein1024-304":45958,"Skein1024-312":45959,"Skein1024-320":45960,"Skein1024-328":45961,"Skein1024-336":45962,"Skein1024-344":45963,"Skein1024-352":45964,"Skein1024-360":45965,"Skein1024-368":45966,"Skein1024-376":45967,"Skein1024-384":45968,"Skein1024-392":45969,"Skein1024-400":45970,"Skein1024-408":45971,"Skein1024-416":45972,"Skein1024-424":45973,"Skein1024-432":45974,"Skein1024-440":45975,"Skein1024-448":45976,"Skein1024-456":45977,"Skein1024-464":45978,"Skein1024-472":45979,"Skein1024-480":45980,"Skein1024-488":45981,"Skein1024-496":45982,"Skein1024-504":45983,"Skein1024-512":45984,"Skein1024-520":45985,"Skein1024-528":45986,"Skein1024-536":45987,"Skein1024-544":45988,"Skein1024-552":45989,"Skein1024-560":45990,"Skein1024-568":45991,"Skein1024-576":45992,"Skein1024-584":45993,"Skein1024-592":45994,"Skein1024-600":45995,"Skein1024-608":45996,"Skein1024-616":45997,"Skein1024-624":45998,"Skein1024-632":45999,"Skein1024-640":46e3,"Skein1024-648":46001,"Skein1024-656":46002,"Skein1024-664":46003,"Skein1024-672":46004,"Skein1024-680":46005,"Skein1024-688":46006,"Skein1024-696":46007,"Skein1024-704":46008,"Skein1024-712":46009,"Skein1024-720":46010,"Skein1024-728":46011,"Skein1024-736":46012,"Skein1024-744":46013,"Skein1024-752":46014,"Skein1024-760":46015,"Skein1024-768":46016,"Skein1024-776":46017,"Skein1024-784":46018,"Skein1024-792":46019,"Skein1024-800":46020,"Skein1024-808":46021,"Skein1024-816":46022,"Skein1024-824":46023,"Skein1024-832":46024,"Skein1024-840":46025,"Skein1024-848":46026,"Skein1024-856":46027,"Skein1024-864":46028,"Skein1024-872":46029,"Skein1024-880":46030,"Skein1024-888":46031,"Skein1024-896":46032,"Skein1024-904":46033,"Skein1024-912":46034,"Skein1024-920":46035,"Skein1024-928":46036,"Skein1024-936":46037,"Skein1024-944":46038,"Skein1024-952":46039,"Skein1024-960":46040,"Skein1024-968":46041,"Skein1024-976":46042,"Skein1024-984":46043,"Skein1024-992":46044,"Skein1024-1000":46045,"Skein1024-1008":46046,"Skein1024-1016":46047,"Skein1024-1024":46048}),t.codes=Object.freeze({0:"identity",17:"sha1",18:"sha2-256",19:"sha2-512",86:"dbl-sha2-256",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3-128",35:"murmur3-32",212:"md4",213:"md5",45569:"blake2b-8",45570:"blake2b-16",45571:"blake2b-24",45572:"blake2b-32",45573:"blake2b-40",45574:"blake2b-48",45575:"blake2b-56",45576:"blake2b-64",45577:"blake2b-72",45578:"blake2b-80",45579:"blake2b-88",45580:"blake2b-96",45581:"blake2b-104",45582:"blake2b-112",45583:"blake2b-120",45584:"blake2b-128",45585:"blake2b-136",45586:"blake2b-144",45587:"blake2b-152",45588:"blake2b-160",45589:"blake2b-168",45590:"blake2b-176",45591:"blake2b-184",45592:"blake2b-192",45593:"blake2b-200",45594:"blake2b-208",45595:"blake2b-216",45596:"blake2b-224",45597:"blake2b-232",45598:"blake2b-240",45599:"blake2b-248",45600:"blake2b-256",45601:"blake2b-264",45602:"blake2b-272",45603:"blake2b-280",45604:"blake2b-288",45605:"blake2b-296",45606:"blake2b-304",45607:"blake2b-312",45608:"blake2b-320",45609:"blake2b-328",45610:"blake2b-336",45611:"blake2b-344",45612:"blake2b-352",45613:"blake2b-360",45614:"blake2b-368",45615:"blake2b-376",45616:"blake2b-384",45617:"blake2b-392",45618:"blake2b-400",45619:"blake2b-408",45620:"blake2b-416",45621:"blake2b-424",45622:"blake2b-432",45623:"blake2b-440",45624:"blake2b-448",45625:"blake2b-456",45626:"blake2b-464",45627:"blake2b-472",45628:"blake2b-480",45629:"blake2b-488",45630:"blake2b-496",45631:"blake2b-504",45632:"blake2b-512",45633:"blake2s-8",45634:"blake2s-16",45635:"blake2s-24",45636:"blake2s-32",45637:"blake2s-40",45638:"blake2s-48",45639:"blake2s-56",45640:"blake2s-64",45641:"blake2s-72",45642:"blake2s-80",45643:"blake2s-88",45644:"blake2s-96",45645:"blake2s-104",45646:"blake2s-112",45647:"blake2s-120",45648:"blake2s-128",45649:"blake2s-136",45650:"blake2s-144",45651:"blake2s-152",45652:"blake2s-160",45653:"blake2s-168",45654:"blake2s-176",45655:"blake2s-184",45656:"blake2s-192",45657:"blake2s-200",45658:"blake2s-208",45659:"blake2s-216",45660:"blake2s-224",45661:"blake2s-232",45662:"blake2s-240",45663:"blake2s-248",45664:"blake2s-256",45825:"Skein256-8",45826:"Skein256-16",45827:"Skein256-24",45828:"Skein256-32",45829:"Skein256-40",45830:"Skein256-48",45831:"Skein256-56",45832:"Skein256-64",45833:"Skein256-72",45834:"Skein256-80",45835:"Skein256-88",45836:"Skein256-96",45837:"Skein256-104",45838:"Skein256-112",45839:"Skein256-120",45840:"Skein256-128",45841:"Skein256-136",45842:"Skein256-144",45843:"Skein256-152",45844:"Skein256-160",45845:"Skein256-168",45846:"Skein256-176",45847:"Skein256-184",45848:"Skein256-192",45849:"Skein256-200",45850:"Skein256-208",45851:"Skein256-216",45852:"Skein256-224",45853:"Skein256-232",45854:"Skein256-240",45855:"Skein256-248",45856:"Skein256-256",45857:"Skein512-8",45858:"Skein512-16",45859:"Skein512-24",45860:"Skein512-32",45861:"Skein512-40",45862:"Skein512-48",45863:"Skein512-56",45864:"Skein512-64",45865:"Skein512-72",45866:"Skein512-80",45867:"Skein512-88",45868:"Skein512-96",45869:"Skein512-104",45870:"Skein512-112",45871:"Skein512-120",45872:"Skein512-128",45873:"Skein512-136",45874:"Skein512-144",45875:"Skein512-152",45876:"Skein512-160",45877:"Skein512-168",45878:"Skein512-176",45879:"Skein512-184",45880:"Skein512-192",45881:"Skein512-200",45882:"Skein512-208",45883:"Skein512-216",45884:"Skein512-224",45885:"Skein512-232",45886:"Skein512-240",45887:"Skein512-248",45888:"Skein512-256",45889:"Skein512-264",45890:"Skein512-272",45891:"Skein512-280",45892:"Skein512-288",45893:"Skein512-296",45894:"Skein512-304",45895:"Skein512-312",45896:"Skein512-320",45897:"Skein512-328",45898:"Skein512-336",45899:"Skein512-344",45900:"Skein512-352",45901:"Skein512-360",45902:"Skein512-368",45903:"Skein512-376",45904:"Skein512-384",45905:"Skein512-392",45906:"Skein512-400",45907:"Skein512-408",45908:"Skein512-416",45909:"Skein512-424",45910:"Skein512-432",45911:"Skein512-440",45912:"Skein512-448",45913:"Skein512-456",45914:"Skein512-464",45915:"Skein512-472",45916:"Skein512-480",45917:"Skein512-488",45918:"Skein512-496",45919:"Skein512-504",45920:"Skein512-512",45921:"Skein1024-8",45922:"Skein1024-16",45923:"Skein1024-24",45924:"Skein1024-32",45925:"Skein1024-40",45926:"Skein1024-48",45927:"Skein1024-56",45928:"Skein1024-64",45929:"Skein1024-72",45930:"Skein1024-80",45931:"Skein1024-88",45932:"Skein1024-96",45933:"Skein1024-104",45934:"Skein1024-112",45935:"Skein1024-120",45936:"Skein1024-128",45937:"Skein1024-136",45938:"Skein1024-144",45939:"Skein1024-152",45940:"Skein1024-160",45941:"Skein1024-168",45942:"Skein1024-176",45943:"Skein1024-184",45944:"Skein1024-192",45945:"Skein1024-200",45946:"Skein1024-208",45947:"Skein1024-216",45948:"Skein1024-224",45949:"Skein1024-232",45950:"Skein1024-240",45951:"Skein1024-248",45952:"Skein1024-256",45953:"Skein1024-264",45954:"Skein1024-272",45955:"Skein1024-280",45956:"Skein1024-288",45957:"Skein1024-296",45958:"Skein1024-304",45959:"Skein1024-312",45960:"Skein1024-320",45961:"Skein1024-328",45962:"Skein1024-336",45963:"Skein1024-344",45964:"Skein1024-352",45965:"Skein1024-360",45966:"Skein1024-368",45967:"Skein1024-376",45968:"Skein1024-384",45969:"Skein1024-392",45970:"Skein1024-400",45971:"Skein1024-408",45972:"Skein1024-416",45973:"Skein1024-424",45974:"Skein1024-432",45975:"Skein1024-440",45976:"Skein1024-448",45977:"Skein1024-456",45978:"Skein1024-464",45979:"Skein1024-472",45980:"Skein1024-480",45981:"Skein1024-488",45982:"Skein1024-496",45983:"Skein1024-504",45984:"Skein1024-512",45985:"Skein1024-520",45986:"Skein1024-528",45987:"Skein1024-536",45988:"Skein1024-544",45989:"Skein1024-552",45990:"Skein1024-560",45991:"Skein1024-568",45992:"Skein1024-576",45993:"Skein1024-584",45994:"Skein1024-592",45995:"Skein1024-600",45996:"Skein1024-608",45997:"Skein1024-616",45998:"Skein1024-624",45999:"Skein1024-632",46e3:"Skein1024-640",46001:"Skein1024-648",46002:"Skein1024-656",46003:"Skein1024-664",46004:"Skein1024-672",46005:"Skein1024-680",46006:"Skein1024-688",46007:"Skein1024-696",46008:"Skein1024-704",46009:"Skein1024-712",46010:"Skein1024-720",46011:"Skein1024-728",46012:"Skein1024-736",46013:"Skein1024-744",46014:"Skein1024-752",46015:"Skein1024-760",46016:"Skein1024-768",46017:"Skein1024-776",46018:"Skein1024-784",46019:"Skein1024-792",46020:"Skein1024-800",46021:"Skein1024-808",46022:"Skein1024-816",46023:"Skein1024-824",46024:"Skein1024-832",46025:"Skein1024-840",46026:"Skein1024-848",46027:"Skein1024-856",46028:"Skein1024-864",46029:"Skein1024-872",46030:"Skein1024-880",46031:"Skein1024-888",46032:"Skein1024-896",46033:"Skein1024-904",46034:"Skein1024-912",46035:"Skein1024-920",46036:"Skein1024-928",46037:"Skein1024-936",46038:"Skein1024-944",46039:"Skein1024-952",46040:"Skein1024-960",46041:"Skein1024-968",46042:"Skein1024-976",46043:"Skein1024-984",46044:"Skein1024-992",46045:"Skein1024-1000",46046:"Skein1024-1008",46047:"Skein1024-1016",46048:"Skein1024-1024"}),t.defaultLengths=Object.freeze({17:20,18:32,19:64,86:32,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,45569:1,45570:2,45571:3,45572:4,45573:5,45574:6,45575:7,45576:8,45577:9,45578:10,45579:11,45580:12,45581:13,45582:14,45583:15,45584:16,45585:17,45586:18,45587:19,45588:20,45589:21,45590:22,45591:23,45592:24,45593:25,45594:26,45595:27,45596:28,45597:29,45598:30,45599:31,45600:32,45601:33,45602:34,45603:35,45604:36,45605:37,45606:38,45607:39,45608:40,45609:41,45610:42,45611:43,45612:44,45613:45,45614:46,45615:47,45616:48,45617:49,45618:50,45619:51,45620:52,45621:53,45622:54,45623:55,45624:56,45625:57,45626:58,45627:59,45628:60,45629:61,45630:62,45631:63,45632:64,45633:1,45634:2,45635:3,45636:4,45637:5,45638:6,45639:7,45640:8,45641:9,45642:10,45643:11,45644:12,45645:13,45646:14,45647:15,45648:16,45649:17,45650:18,45651:19,45652:20,45653:21,45654:22,45655:23,45656:24,45657:25,45658:26,45659:27,45660:28,45661:29,45662:30,45663:31,45664:32,45825:1,45826:2,45827:3,45828:4,45829:5,45830:6,45831:7,45832:8,45833:9,45834:10,45835:11,45836:12,45837:13,45838:14,45839:15,45840:16,45841:17,45842:18,45843:19,45844:20,45845:21,45846:22,45847:23,45848:24,45849:25,45850:26,45851:27,45852:28,45853:29,45854:30,45855:31,45856:32,45857:1,45858:2,45859:3,45860:4,45861:5,45862:6,45863:7,45864:8,45865:9,45866:10,45867:11,45868:12,45869:13,45870:14,45871:15,45872:16,45873:17,45874:18,45875:19,45876:20,45877:21,45878:22,45879:23,45880:24,45881:25,45882:26,45883:27,45884:28,45885:29,45886:30,45887:31,45888:32,45889:33,45890:34,45891:35,45892:36,45893:37,45894:38,45895:39,45896:40,45897:41,45898:42,45899:43,45900:44,45901:45,45902:46,45903:47,45904:48,45905:49,45906:50,45907:51,45908:52,45909:53,45910:54,45911:55,45912:56,45913:57,45914:58,45915:59,45916:60,45917:61,45918:62,45919:63,45920:64,45921:1,45922:2,45923:3,45924:4,45925:5,45926:6,45927:7,45928:8,45929:9,45930:10,45931:11,45932:12,45933:13,45934:14,45935:15,45936:16,45937:17,45938:18,45939:19,45940:20,45941:21,45942:22,45943:23,45944:24,45945:25,45946:26,45947:27,45948:28,45949:29,45950:30,45951:31,45952:32,45953:33,45954:34,45955:35,45956:36,45957:37,45958:38,45959:39,45960:40,45961:41,45962:42,45963:43,45964:44,45965:45,45966:46,45967:47,45968:48,45969:49,45970:50,45971:51,45972:52,45973:53,45974:54,45975:55,45976:56,45977:57,45978:58,45979:59,45980:60,45981:61,45982:62,45983:63,45984:64,45985:65,45986:66,45987:67,45988:68,45989:69,45990:70,45991:71,45992:72,45993:73,45994:74,45995:75,45996:76,45997:77,45998:78,45999:79,46e3:80,46001:81,46002:82,46003:83,46004:84,46005:85,46006:86,46007:87,46008:88,46009:89,46010:90,46011:91,46012:92,46013:93,46014:94,46015:95,46016:96,46017:97,46018:98,46019:99,46020:100,46021:101,46022:102,46023:103,46024:104,46025:105,46026:106,46027:107,46028:108,46029:109,46030:110,46031:111,46032:112,46033:113,46034:114,46035:115,46036:116,46037:117,46038:118,46039:119,46040:120,46041:121,46042:122,46043:123,46044:124,46045:125,46046:126,46047:127,46048:128})},7748:function(e,t,o){"use strict";var r=o(9033).Buffer,n=o(2592),i=o(6657),a=o(1269);function s(e){t.decode(e)}t.names=a.names,t.codes=a.codes,t.defaultLengths=a.defaultLengths,t.toHexString=function(e){if(!r.isBuffer(e))throw new Error("must be passed a buffer");return e.toString("hex")},t.fromHexString=function(e){return r.from(e,"hex")},t.toB58String=function(e){if(!r.isBuffer(e))throw new Error("must be passed a buffer");return n.encode("base58btc",e).toString().slice(1)},t.fromB58String=function(e){var t=e;return r.isBuffer(e)&&(t=e.toString()),n.decode("z"+t)},t.decode=function(e){if(!r.isBuffer(e))throw new Error("multihash must be a Buffer");if(e.length<2)throw new Error("multihash too short. must be > 2 bytes.");var o=i.decode(e);if(!t.isValidCode(o))throw new Error("multihash unknown function code: 0x".concat(o.toString(16)));e=e.slice(i.decode.bytes);var n=i.decode(e);if(n<0)throw new Error("multihash invalid length: ".concat(n));if((e=e.slice(i.decode.bytes)).length!==n)throw new Error("multihash length inconsistent: 0x".concat(e.toString("hex")));return{code:o,name:a.codes[o],length:n,digest:e}},t.encode=function(e,o,n){if(!e||void 0===o)throw new Error("multihash encode requires at least two args: digest, code");var a=t.coerceCode(o);if(!r.isBuffer(e))throw new Error("digest should be a Buffer");if(null==n&&(n=e.length),n&&e.length!==n)throw new Error("digest length should be equal to specified length.");return r.concat([r.from(i.encode(a)),r.from(i.encode(n)),e])},t.coerceCode=function(e){var o=e;if("string"==typeof e){if(void 0===a.names[e])throw new Error("Unrecognized hash function named: ".concat(e));o=a.names[e]}if("number"!=typeof o)throw new Error("Hash function code should be a number. Got: ".concat(o));if(void 0===a.codes[o]&&!t.isAppCode(o))throw new Error("Unrecognized function code: ".concat(o));return o},t.isAppCode=function(e){return e>0&&e<16},t.isValidCode=function(e){return!!t.isAppCode(e)||!!a.codes[e]},t.validate=s,t.prefix=function(e){return s(e),e.slice(0,2)}},7277:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=o(1734),i=o(6931);e.exports=function(e){if("string"==typeof e||"number"==typeof e){var t=new n(1),o=String(e).toLowerCase().trim(),a="0x"===o.substr(0,2)||"-0x"===o.substr(0,3),s=i(o);if("-"===s.substr(0,1)&&(s=i(s.slice(1)),t=new n(-1,10)),!(s=""===s?"0":s).match(/^-?[0-9]+$/)&&s.match(/^[0-9A-Fa-f]+$/)||s.match(/^[a-fA-F]+$/)||!0===a&&s.match(/^[0-9A-Fa-f]+$/))return new n(s,16).mul(t);if((s.match(/^-?[0-9]+$/)||""===s)&&!1===a)return new n(s,10).mul(t)}else if("object"===(0,r.default)(e)&&e.toString&&!e.pop&&!e.push&&e.toString(10).match(/^-?[0-9]+$/)&&(e.mul||e.dividedToIntegerBy))return new n(e.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(e)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")}},3103:function(e){"use strict";var t=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},o=0;o<10;o++)t["_"+String.fromCharCode(o)]=o;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,n){for(var i,a,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),c=1;c0&&(n=o),o=e[u++]);)switch(F++,"\n"===o?(Y++,Q=0):Q++,L){case d:if("{"===o)L=p;else if("["===o)L=b;else if(!G(o))return H("Non-whitespace before {[.");continue;case k:case p:if(G(o))continue;if(L===k)P.push(w);else{if("}"===o){s({}),c(),L=P.pop()||h;continue}P.push(g)}if('"'!==o)return H('Malformed object key should start with " ');L=v;continue;case w:case g:if(G(o))continue;if(":"===o)L===g?(P.push(g),void 0!==i&&(s({}),a(i),i=void 0),U++):void 0!==i&&(a(i),i=void 0),L=h;else if("}"===o)void 0!==i&&(s(i),c(),i=void 0),c(),U--,L=P.pop()||h;else{if(","!==o)return H("Bad object");L===g&&P.push(g),void 0!==i&&(s(i),c(),i=void 0),L=k}continue;case b:case h:if(G(o))continue;if(L===b){if(s([]),U++,L=h,"]"===o){c(),U--,L=P.pop()||h;continue}P.push(y)}if('"'===o)L=v;else if("{"===o)L=p;else if("["===o)L=b;else if("t"===o)L=x;else if("f"===o)L=M;else if("n"===o)L=E;else if("-"===o)O+=o;else if("0"===o)O+=o,L=20;else{if(-1==="123456789".indexOf(o))return H("Bad value");O+=o,L=20}continue;case y:if(","===o)P.push(y),void 0!==i&&(s(i),c(),i=void 0),L=h;else{if("]"!==o){if(G(o))continue;return H("Bad array")}void 0!==i&&(s(i),c(),i=void 0),c(),U--,L=P.pop()||h}continue;case v:void 0===i&&(i="");var f=u-1;e:for(;;){for(;B>0;)if(R+=o,o=e.charAt(u++),4===B?(i+=String.fromCharCode(parseInt(R,16)),B=0,f=u-1):B++,!o)break e;if('"'===o&&!C){L=P.pop()||h,i+=e.substring(f,u-1);break}if(!("\\"!==o||C||(C=!0,i+=e.substring(f,u-1),o=e.charAt(u++))))break;if(C){if(C=!1,"n"===o?i+="\n":"r"===o?i+="\r":"t"===o?i+="\t":"f"===o?i+="\f":"b"===o?i+="\b":"u"===o?(B=1,R=""):i+=o,o=e.charAt(u++),f=u-1,o)continue;break}m.lastIndex=u;var W=m.exec(e);if(!W){u=e.length+1,i+=e.substring(f,u-1);break}if(u=W.index+1,!(o=e.charAt(W.index))){i+=e.substring(f,u-1);break}}continue;case x:if(!o)continue;if("r"!==o)return H("Invalid true started with t"+o);L=z;continue;case z:if(!o)continue;if("u"!==o)return H("Invalid true started with tr"+o);L=j;continue;case j:if(!o)continue;if("e"!==o)return H("Invalid true started with tru"+o);s(!0),c(),L=P.pop()||h;continue;case M:if(!o)continue;if("a"!==o)return H("Invalid false started with f"+o);L=A;continue;case A:if(!o)continue;if("l"!==o)return H("Invalid false started with fa"+o);L=q;continue;case q:if(!o)continue;if("s"!==o)return H("Invalid false started with fal"+o);L=I;continue;case I:if(!o)continue;if("e"!==o)return H("Invalid false started with fals"+o);s(!1),c(),L=P.pop()||h;continue;case E:if(!o)continue;if("u"!==o)return H("Invalid null started with n"+o);L=S;continue;case S:if(!o)continue;if("l"!==o)return H("Invalid null started with nu"+o);L=N;continue;case N:if(!o)continue;if("l"!==o)return H("Invalid null started with nul"+o);s(null),c(),L=P.pop()||h;continue;case _:if("."!==o)return H("Leading zero not followed by .");O+=o,L=20;continue;case 20:if(-1!=="0123456789".indexOf(o))O+=o;else if("."===o){if(-1!==O.indexOf("."))return H("Invalid number has two dots");O+=o}else if("e"===o||"E"===o){if(-1!==O.indexOf("e")||-1!==O.indexOf("E"))return H("Invalid number has two exponential");O+=o}else if("+"===o||"-"===o){if("e"!==n&&"E"!==n)return H("Invalid symbol in number");O+=o}else O&&(s(parseFloat(O)),c(),O=""),u--,L=P.pop()||h;continue;default:return H("Unknown state: "+L)}F>=T&&(r=0,void 0!==i&&i.length>l&&(H("Max buffer length exceeded: textNode"),r=Math.max(r,i.length)),O.length>l&&(H("Max buffer length exceeded: numberNode"),r=Math.max(r,O.length)),T=l-r+F)}})),e(r.n).on((function(){if(L===d)return s({}),c(),void(D=!0);L===h&&0===U||H("Unexpected end"),void 0!==i&&(s(i),c(),i=void 0),D=!0}))}},function(e,t,o){o.d(t,"a",(function(){return c})),o.d(t,"b",(function(){return u}));var r=o(19),n=o(3),i=o(2),a=o(20),s=o(0);function c(){return new XMLHttpRequest}function u(e,t,o,c,u,l,m){var f=e(n.m).emit,d=e(n.b).emit,h=0,p=!0;function g(){if("2"===String(t.status)[0]){var e=t.responseText,o=(" "+e.substr(h)).substr(1);o&&f(o),h=Object(i.e)(e)}}function b(t){try{p&&e(n.c).emit(t.status,Object(a.a)(t.getAllResponseHeaders())),p=!1}catch(e){}}e(n.a).on((function(){t.onreadystatechange=null,t.abort()})),"onprogress"in t&&(t.onprogress=g),t.onreadystatechange=function(){switch(t.readyState){case 2:case 3:return b(t);case 4:b(t),"2"===String(t.status)[0]?(g(),e(n.n).emit()):d(Object(n.o)(t.status,t.responseText))}};try{for(var y in t.open(o,c,!0),l)t.setRequestHeader(y,l[y]);Object(r.a)(window.location,Object(r.b)(c))||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=m,t.send(u)}catch(e){window.setTimeout(Object(s.j)(d,Object(n.o)(void 0,void 0,e)),0)}}},function(e,t,o){function r(e,t){function o(t){return String(t.port||{"http:":80,"https:":443}[t.protocol||e.protocol])}return!!(t.protocol&&t.protocol!==e.protocol||t.host&&t.host!==e.host||t.host&&o(t)!==o(e))}function n(e){var t=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e)||[];return{protocol:t[1]||"",host:t[2]||"",port:t[3]||""}}o.d(t,"a",(function(){return r})),o.d(t,"b",(function(){return n}))},function(e,t,o){function r(e){var t={};return e&&e.split("\r\n").forEach((function(e){var o=e.indexOf(": ");t[e.substring(0,o)]=e.substring(o+2)})),t}o.d(t,"a",(function(){return r}))}]).default},"object"===(0,s.default)(t)&&"object"===(0,s.default)(e)?e.exports=a():(n=[],void 0===(i="function"==typeof(r=a)?r.apply(t,n):r)||(e.exports=i))},1823:function(e,t,o){"use strict";var r=o(8357);t.certificate=o(1320);var n=r.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));t.RSAPrivateKey=n;var i=r.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));t.RSAPublicKey=i;var a=r.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}));t.PublicKey=a;var s=r.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),c=r.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())}));t.PrivateKey=c;var u=r.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));t.EncryptedPrivateKey=u;var l=r.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));t.DSAPrivateKey=l,t.DSAparam=r.define("DSAparam",(function(){this.int()}));var m=r.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(f),this.key("publicKey").optional().explicit(1).bitstr())}));t.ECPrivateKey=m;var f=r.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));t.signature=r.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},1320:function(e,t,o){"use strict";var r=o(8357),n=r.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),i=r.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),a=r.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),s=r.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())})),c=r.define("RelativeDistinguishedName",(function(){this.setof(i)})),u=r.define("RDNSequence",(function(){this.seqof(c)})),l=r.define("Name",(function(){this.choice({rdnSequence:this.use(u)})})),m=r.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))})),f=r.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),d=r.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(l),this.key("validity").use(m),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())})),h=r.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())}));e.exports=h},4988:function(e,t,o){"use strict";var r=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,n=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=o(7085),s=o(8073),c=o(8850).Buffer;e.exports=function(e,t){var o,u=e.toString(),l=u.match(r);if(l){var m="aes"+l[1],f=c.from(l[2],"hex"),d=c.from(l[3].replace(/[\r\n]/g,""),"base64"),h=a(t,f.slice(0,8),parseInt(l[1],10)).key,p=[],g=s.createDecipheriv(m,h,f);p.push(g.update(d)),p.push(g.final()),o=c.concat(p)}else{var b=u.match(i);o=c.from(b[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(n)[1],data:o}}},7552:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=o(1823),i=o(2562),a=o(4988),s=o(8073),c=o(4192),u=o(8850).Buffer;function l(e){var t;"object"!==(0,r.default)(e)||u.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=u.from(e));var o,l,m=a(e,t),f=m.tag,d=m.data;switch(f){case"CERTIFICATE":l=n.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(l||(l=n.PublicKey.decode(d,"der")),o=l.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(l.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return l.subjectPrivateKey=l.subjectPublicKey,{type:"ec",data:l};case"1.2.840.10040.4.1":return l.algorithm.params.pub_key=n.DSAparam.decode(l.subjectPublicKey.data,"der"),{type:"dsa",data:l.algorithm.params};default:throw new Error("unknown key id "+o)}case"ENCRYPTED PRIVATE KEY":d=function(e,t){var o=e.algorithm.decrypt.kde.kdeparams.salt,r=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=i[e.algorithm.decrypt.cipher.algo.join(".")],a=e.algorithm.decrypt.cipher.iv,l=e.subjectPrivateKey,m=parseInt(n.split("-")[1],10)/8,f=c.pbkdf2Sync(t,o,r,m,"sha1"),d=s.createDecipheriv(n,f,a),h=[];return h.push(d.update(l)),h.push(d.final()),u.concat(h)}(d=n.EncryptedPrivateKey.decode(d,"der"),t);case"PRIVATE KEY":switch(o=(l=n.PrivateKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(l.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:l.algorithm.curve,privateKey:n.ECPrivateKey.decode(l.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return l.algorithm.params.priv_key=n.DSAparam.decode(l.subjectPrivateKey,"der"),{type:"dsa",params:l.algorithm.params};default:throw new Error("unknown key id "+o)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return{curve:(d=n.ECPrivateKey.decode(d,"der")).parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+f)}}e.exports=l,l.signature=n.signature},8209:function(e){"use strict";var t=function(e){return e.replace(/^\s+|\s+$/g,"")};e.exports=function(e){if(!e)return{};for(var o,r={},n=t(e).split("\n"),i=0;i=6?"utf-8":"binary":"utf-8",e.exports=r},3127:function(e){"use strict";var t=Math.pow(2,30)-1;e.exports=function(e,o){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof o)throw new TypeError("Key length not a number");if(o<0||o>t||o!=o)throw new TypeError("Bad key length")}},1658:function(e,t,o){"use strict";var r=o(5349),n=o(6707),i=o(1708),a=o(8850).Buffer,s=o(3127),c=o(7401),u=o(8398),l=a.alloc(128),m={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function f(e,t,o){var s=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new n).update(e).digest()}:"md5"===e?r:function(t){return i(e).update(t).digest()}}(e),c="sha512"===e||"sha384"===e?128:64;t.length>c?t=s(t):t.length1)for(var o=1;oh||new a(t).cmp(d.modulus)>=0)throw new Error("decryption error");f=o?u(new a(t),d):s(t,d);var p=l.alloc(h-f.length);if(f=l.concat([p,f],h),4===m)return function(e,t){var o=e.modulus.byteLength(),r=c("sha1").update(l.alloc(0)).digest(),a=r.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),u=t.slice(a+1),m=i(s,n(u,a)),f=i(u,n(m,o-a-1));if(function(e,t){e=l.from(e),t=l.from(t);var o=0,r=e.length;e.length!==t.length&&(o++,r=Math.min(e.length,t.length));for(var n=-1;++n=t.length){i++;break}var a=t.slice(2,n-1);if(("0002"!==r.toString("hex")&&!o||"0001"!==r.toString("hex")&&o)&&i++,a.length<8&&i++,i)throw new Error("decryption error");return t.slice(n)}(0,f,o);if(3===m)return f;throw new Error("unknown padding")}},2466:function(e,t,o){"use strict";var r=o(7552),n=o(5010),i=o(5866),a=o(6873),s=o(817),c=o(1734),u=o(2561),l=o(9782),m=o(8850).Buffer;e.exports=function(e,t,o){var f;f=e.padding?e.padding:o?1:4;var d,h=r(e);if(4===f)d=function(e,t){var o=e.modulus.byteLength(),r=t.length,u=i("sha1").update(m.alloc(0)).digest(),l=u.length,f=2*l;if(r>o-f-2)throw new Error("message too long");var d=m.alloc(o-r-f-2),h=o-l-1,p=n(l),g=s(m.concat([u,d,m.alloc(1,1),t],h),a(p,h)),b=s(p,a(g,l));return new c(m.concat([m.alloc(1),b,g],o))}(h,t);else if(1===f)d=function(e,t,o){var r,i=t.length,a=e.modulus.byteLength();if(i>a-11)throw new Error("message too long");return r=o?m.alloc(a-i-3,255):function(e){for(var t,o=m.allocUnsafe(e),r=0,i=n(2*e),a=0;r=0)throw new Error("data too long for modulus")}return o?l(d,h):u(d,h)}},2561:function(e,t,o){"use strict";var r=o(1734),n=o(8850).Buffer;e.exports=function(e,t){return n.from(e.toRed(r.mont(t.modulus)).redPow(new r(t.publicExponent)).fromRed().toArray())}},817:function(e){"use strict";e.exports=function(e,t){for(var o=e.length,r=-1;++r4294967295)throw new RangeError("requested too many random bytes");var o=i.allocUnsafe(e);if(e>0)if(e>n)for(var s=0;sl||e<0)throw new TypeError("offset must be a uint32");if(e>c||e>t)throw new RangeError("offset out of range")}function f(e,t,o){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>l||e<0)throw new TypeError("size must be a uint32");if(e+t>o||e>c)throw new RangeError("buffer too small")}function d(e,t,o,n){if(r.browser){var i=e.buffer,s=new Uint8Array(i,t,o);return u.getRandomValues(s),n?void r.nextTick((function(){n(null,e)})):e}if(!n)return a(o).copy(e,t),e;a(o,(function(o,r){if(o)return n(o);r.copy(e,t),n(null,e)}))}u&&u.getRandomValues||!r.browser?(t.randomFill=function(e,t,r,n){if(!(s.isBuffer(e)||e instanceof o.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)n=t,t=0,r=e.length;else if("function"==typeof r)n=r,r=e.length-t;else if("function"!=typeof n)throw new TypeError('"cb" argument must be a function');return m(t,e.length),f(r,t,e.length),d(e,t,r,n)},t.randomFillSync=function(e,t,r){if(void 0===t&&(t=0),!(s.isBuffer(e)||e instanceof o.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return m(t,e.length),void 0===r&&(r=e.length-t),f(r,t,e.length),d(e,t,r)}):(t.randomFill=n,t.randomFillSync=n)},9024:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n={};function i(e,t,o){o||(o=Error);var r=function(e){var o,r;function n(o,r,n){return e.call(this,function(e,o,r){return"string"==typeof t?t:t(e,o,r)}(o,r,n))||this}return r=e,(o=n).prototype=Object.create(r.prototype),o.prototype.constructor=o,o.__proto__=r,n}(o);r.prototype.name=o.name,r.prototype.code=e,n[e]=r}function a(e,t){if(Array.isArray(e)){var o=e.length;return e=e.map((function(e){return String(e)})),o>2?"one of ".concat(t," ").concat(e.slice(0,o-1).join(", "),", or ")+e[o-1]:2===o?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,o){var n,i,s,c,u;if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,o){return(void 0===o||o>e.length)&&(o=e.length),e.substring(o-t.length,o)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(a(t,"type"));else{var l=("number"!=typeof u&&(u=0),u+1>(c=e).length||-1===c.indexOf(".",u)?"argument":"property");s='The "'.concat(e,'" ').concat(l," ").concat(n," ").concat(a(t,"type"))}return s+". Received type ".concat((0,r.default)(o))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=n},6884:function(e,t,o){"use strict";var r=o(9142),n=Object.keys||function(e){var t=[];for(var o in e)t.push(o);return t};e.exports=l;var i=o(6297),a=o(1471);o(1736)(l,i);for(var s=n(a.prototype),c=0;c0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r)s.endEmitted?x(e,new w):q(e,s,t,!0);else if(s.ended)x(e,new v);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!o?(t=s.decoder.write(t),s.objectMode||0!==t.length?q(e,s,t,!1):_(e,s)):q(e,s,t,!1)}else r||(s.reading=!1,_(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(N,e))}function N(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function _(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(T,e,t))}function T(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function C(e){i("readable nexttick read 0"),e.read(0)}function D(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?o=t.buffer.shift():!e||e>=t.length?(o=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):o=t.buffer.consume(e,t.decoder),o);var o}function R(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(B,t,e))}function B(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var o=t._writableState;(!o||o.autoDestroy&&o.finished)&&t.destroy()}}function U(e,t){for(var o=0,r=e.length;o=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):S(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&R(this),null;var r,n=t.needReadable;return i("need readable",n),(0===t.length||t.length-e0?P(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),o!==e&&t.ended&&R(this)),null!==r&&this.emit("data",r),r},M.prototype._read=function(e){x(this,new k("_read()"))},M.prototype.pipe=function(e,t){var o=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,i("pipe count=%d opts=%j",r.pipesCount,t);var s=t&&!1===t.end||e===n.stdout||e===n.stderr?p:c;function c(){i("onend"),e.end()}r.endEmitted?n.nextTick(s):o.once("end",s),e.on("unpipe",(function t(n,a){i("onunpipe"),n===o&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,i("cleanup"),e.removeListener("close",d),e.removeListener("finish",h),e.removeListener("drain",u),e.removeListener("error",f),e.removeListener("unpipe",t),o.removeListener("end",c),o.removeListener("end",p),o.removeListener("data",m),l=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,L(e))}}(o);e.on("drain",u);var l=!1;function m(t){i("ondata");var n=e.write(t);i("dest.write",n),!1===n&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==U(r.pipes,e))&&!l&&(i("false write response, pause",r.awaitDrain),r.awaitDrain++),o.pause())}function f(t){i("onerror",t),p(),e.removeListener("error",f),0===a(e,"error")&&x(e,t)}function d(){e.removeListener("finish",h),p()}function h(){i("onfinish"),e.removeListener("close",d),p()}function p(){i("unpipe"),o.unpipe(e)}return o.on("data",m),function(e,t,o){if("function"==typeof e.prependListener)return e.prependListener(t,o);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(o):e._events[t]=[o,e._events[t]]:e.on(t,o)}(e,"error",f),e.once("close",d),e.once("finish",h),e.emit("pipe",o),r.flowing||(i("pipe resume"),o.resume()),e},M.prototype.unpipe=function(e){var t=this._readableState,o={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,o)),this;if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,i("on readable",r.length,r.reading),r.length?S(this):r.reading||n.nextTick(C,this))),o},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(e,t){var o=s.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(O,this),o},M.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(O,this),t},M.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(D,e,t))}(this,e)),e.paused=!1,this},M.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(e){var t=this,o=this._readableState,r=!1;for(var n in e.on("end",(function(){if(i("wrapped end"),o.decoder&&!o.ended){var e=o.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){i("wrapped data"),o.decoder&&(n=o.decoder.write(n)),o.objectMode&&null==n||(o.objectMode||n&&n.length)&&(t.push(n)||(r=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var a=0;a-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(e,t,o){o(new p("_write()"))},M.prototype._writev=null,M.prototype.end=function(e,t,o){var r=this._writableState;return"function"==typeof e?(o=e,e=null,t=null):"function"==typeof t&&(o=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,o){t.ending=!0,N(e,t),o&&(t.finished?n.nextTick(o):e.once("finish",o)),t.ended=!0,e.writable=!1}(this,r,o),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),M.prototype.destroy=m.destroy,M.prototype._undestroy=m.undestroy,M.prototype._destroy=function(e,t){t(e)}},2317:function(e,t,o){"use strict";var r,n=o(9142);function i(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var a=o(5831),s=Symbol("lastResolve"),c=Symbol("lastReject"),u=Symbol("error"),l=Symbol("ended"),m=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[s];if(null!==t){var o=e[d].read();null!==o&&(e[m]=null,e[s]=null,e[c]=null,t(h(o,!1)))}}function g(e){n.nextTick(p,e)}var b=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(r={get stream(){return this[d]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise((function(t,o){n.nextTick((function(){e[u]?o(e[u]):t(h(void 0,!0))}))}));var o,r=this[m];if(r)o=new Promise(function(e,t){return function(o,r){e.then((function(){t[l]?o(h(void 0,!0)):t[f](o,r)}),r)}}(r,this));else{var i=this[d].read();if(null!==i)return Promise.resolve(h(i,!1));o=new Promise(this[f])}return this[m]=o,o}},Symbol.asyncIterator,(function(){return this})),i(r,"return",(function(){var e=this;return new Promise((function(t,o){e[d].destroy(null,(function(e){e?o(e):t(h(void 0,!0))}))}))})),r),b);e.exports=function(e){var t,o=Object.create(y,(i(t={},d,{value:e,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,l,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var r=o[d].read();r?(o[m]=null,o[s]=null,o[c]=null,e(h(r,!1))):(o[s]=e,o[c]=t)},writable:!0}),t));return o[m]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=o[c];return null!==t&&(o[m]=null,o[s]=null,o[c]=null,t(e)),void(o[u]=e)}var r=o[s];null!==r&&(o[m]=null,o[s]=null,o[c]=null,r(h(void 0,!0))),o[l]=!0})),e.on("readable",g.bind(null,o)),o}},5392:function(e,t,o){"use strict";function r(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function n(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function i(e,t){for(var o=0;o0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,o=""+t.data;t=t.next;)o+=e+t.data;return o}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,o,r,n=a.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,o=n,r=s,a.prototype.copy.call(t,o,r),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(e,t){var o;return en.length?n.length:e;if(i===n.length?r+=n:r+=n.slice(0,e),0==(e-=i)){i===n.length?(++o,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(i));break}++o}return this.length-=o,r}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),o=this.head,r=1;for(o.data.copy(t),e-=o.data.length;o=o.next;){var n=o.data,i=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,i),0==(e-=i)){i===n.length?(++r,o.next?this.head=o.next:this.head=this.tail=null):(this.head=o,o.data=n.slice(i));break}++r}return this.length-=r,t}},{key:c,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){l||(l=e),e&&f.forEach(c),i||(f.forEach(c),m(l))}))}));return t.reduce(u)}},6756:function(e,t,o){"use strict";var r=o(9024).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,o,n){var i=function(e,t,o){return null!=e.highWaterMark?e.highWaterMark:t?e[o]:null}(t,n,o);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new r(n?o:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},7144:function(e,t,o){"use strict";e.exports=o(8291).EventEmitter},6505:function(e,t,o){"use strict";(t=e.exports=o(6297)).Stream=t,t.Readable=t,t.Writable=o(1471),t.Duplex=o(6884),t.Transform=o(9154),t.PassThrough=o(3582),t.finished=o(5831),t.pipeline=o(384)},6707:function(e,t,o){"use strict";var r=o(9033).Buffer,n=o(1736),i=o(2353),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],l=[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],m=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function d(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function h(e,t){return e<>>32-t}function p(e,t,o,r,n,i,a,s){return h(e+(t^o^r)+i+a|0,s)+n|0}function g(e,t,o,r,n,i,a,s){return h(e+(t&o|~t&r)+i+a|0,s)+n|0}function b(e,t,o,r,n,i,a,s){return h(e+((t|~o)^r)+i+a|0,s)+n|0}function y(e,t,o,r,n,i,a,s){return h(e+(t&r|o&~r)+i+a|0,s)+n|0}function v(e,t,o,r,n,i,a,s){return h(e+(t^(o|~r))+i+a|0,s)+n|0}n(d,i),d.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var o=0|this._a,r=0|this._b,n=0|this._c,i=0|this._d,d=0|this._e,k=0|this._a,w=0|this._b,x=0|this._c,z=0|this._d,j=0|this._e,M=0;M<80;M+=1){var A,q;M<16?(A=p(o,r,n,i,d,e[s[M]],m[0],u[M]),q=v(k,w,x,z,j,e[c[M]],f[0],l[M])):M<32?(A=g(o,r,n,i,d,e[s[M]],m[1],u[M]),q=y(k,w,x,z,j,e[c[M]],f[1],l[M])):M<48?(A=b(o,r,n,i,d,e[s[M]],m[2],u[M]),q=b(k,w,x,z,j,e[c[M]],f[2],l[M])):M<64?(A=y(o,r,n,i,d,e[s[M]],m[3],u[M]),q=g(k,w,x,z,j,e[c[M]],f[3],l[M])):(A=v(o,r,n,i,d,e[s[M]],m[4],u[M]),q=p(k,w,x,z,j,e[c[M]],f[4],l[M])),o=d,d=i,i=h(n,10),n=r,r=A,k=j,j=z,z=h(x,10),x=w,w=q}var I=this._b+n+z|0;this._b=this._c+i+j|0,this._c=this._d+d+k|0,this._d=this._e+o+w|0,this._e=this._a+r+x|0,this._a=I},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=r.alloc?r.alloc(20):new r(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=d},6905:function(e,t,o){"use strict";var r=o(9033).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.getLength=t.decode=t.encode=void 0;var n,i=(n=o(1734))&&n.__esModule?n:{default:n};function a(e,t){if("0"===e[0]&&"0"===e[1])throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function s(e,t){if(e<56)return r.from([e+t]);var o=l(e),n=l(t+55+o.length/2);return r.from(n+o,"hex")}function c(e){var t,o,n,i,s,u=[],l=e[0];if(l<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(l<=183){if(t=l-127,n=128===l?r.from([]):e.slice(1,t),2===t&&n[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:n,remainder:e.slice(t)}}if(l<=191){if(o=l-182,e.length-1e.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(i=e.slice(o,m)).length)throw new Error("invalid rlp, List has a invalid length");for(;i.length;)s=c(i),u.push(s.data),i=s.remainder;return{data:u,remainder:e.slice(m)}}function u(e){return"0x"===e.slice(0,2)}function l(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0"+t:t}function m(e){if(!r.isBuffer(e)){if("string"==typeof e)return u(e)?r.from((o="string"!=typeof(n=e)?n:u(n)?n.slice(2):n).length%2?"0"+o:o,"hex"):r.from(e);if("number"==typeof e||"bigint"==typeof e)return e?(t=l(e),r.from(t,"hex")):r.from([]);if(null==e)return r.from([]);if(e instanceof Uint8Array)return r.from(e);if(i.default.isBN(e))return r.from(e.toArray());throw new Error("invalid type")}var t,o,n;return e}t.encode=function e(t){if(Array.isArray(t)){for(var o=[],n=0;n=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=s(e);return t&&0!==t.length?"string"==typeof o?r.fill(t,o):r.fill(t):r.fill(0),r}),!c.kStringMaxLength)try{c.kStringMaxLength=n.binding("buffer").kStringMaxLength}catch(e){}c.constants||(c.constants={MAX_LENGTH:c.kMaxLength},c.kStringMaxLength&&(c.constants.MAX_STRING_LENGTH=c.kStringMaxLength)),e.exports=c},7799:function(e){"use strict";!function(o){var r=2147483647;function n(e){var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),o=1779033703,r=3144134277,n=1013904242,i=2773480762,a=1359893119,s=2600822924,c=528734635,u=1541459225,l=new Uint32Array(64);function m(e){for(var m=0,f=e.length;f>=64;){var d=o,h=r,p=n,g=i,b=a,y=s,v=c,k=u,w=void 0,x=void 0,z=void 0,j=void 0,M=void 0;for(x=0;x<16;x++)z=m+4*x,l[x]=(255&e[z])<<24|(255&e[z+1])<<16|(255&e[z+2])<<8|255&e[z+3];for(x=16;x<64;x++)j=((w=l[x-2])>>>17|w<<15)^(w>>>19|w<<13)^w>>>10,M=((w=l[x-15])>>>7|w<<25)^(w>>>18|w<<14)^w>>>3,l[x]=(j+l[x-7]|0)+(M+l[x-16]|0)|0;for(x=0;x<64;x++)j=(((b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+(b&y^~b&v)|0)+(k+(t[x]+l[x]|0)|0)|0,M=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&h^d&p^h&p)|0,k=v,v=y,y=b,b=g+j|0,g=p,p=h,h=d,d=j+M|0;o=o+d|0,r=r+h|0,n=n+p|0,i=i+g|0,a=a+b|0,s=s+y|0,c=c+v|0,u=u+k|0,m+=64,f-=64}}m(e);var f,d=e.length%64,h=e.length/536870912|0,p=e.length<<3,g=d<56?56:120,b=e.slice(e.length-d,e.length);for(b.push(128),f=d+1;f>>24&255),b.push(h>>>16&255),b.push(h>>>8&255),b.push(h>>>0&255),b.push(p>>>24&255),b.push(p>>>16&255),b.push(p>>>8&255),b.push(p>>>0&255),m(b),[o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255]}function i(e,t,o){e=e.length<=64?e:n(e);var r,i=64+t.length+4,a=new Array(i),s=new Array(64),c=[];for(r=0;r<64;r++)a[r]=54;for(r=0;r=i-4;e--){if(a[e]++,a[e]<=255)return;a[e]=0}}for(;o>=32;)u(),c=c.concat(n(s.concat(n(a)))),o-=32;return o>0&&(u(),c=c.concat(n(s.concat(n(a))).slice(0,o))),c}function a(e,t,o,r,n){var i;for(l(e,16*(2*o-1),n,0,16),i=0;i<2*o;i++)u(e,16*i,n,16),c(n,r),l(n,0,e,t+16*i,16);for(i=0;i>>32-t}function c(e,t){l(e,0,t,0,16);for(var o=8;o>0;o-=2)t[4]^=s(t[0]+t[12],7),t[8]^=s(t[4]+t[0],9),t[12]^=s(t[8]+t[4],13),t[0]^=s(t[12]+t[8],18),t[9]^=s(t[5]+t[1],7),t[13]^=s(t[9]+t[5],9),t[1]^=s(t[13]+t[9],13),t[5]^=s(t[1]+t[13],18),t[14]^=s(t[10]+t[6],7),t[2]^=s(t[14]+t[10],9),t[6]^=s(t[2]+t[14],13),t[10]^=s(t[6]+t[2],18),t[3]^=s(t[15]+t[11],7),t[7]^=s(t[3]+t[15],9),t[11]^=s(t[7]+t[3],13),t[15]^=s(t[11]+t[7],18),t[1]^=s(t[0]+t[3],7),t[2]^=s(t[1]+t[0],9),t[3]^=s(t[2]+t[1],13),t[0]^=s(t[3]+t[2],18),t[6]^=s(t[5]+t[4],7),t[7]^=s(t[6]+t[5],9),t[4]^=s(t[7]+t[6],13),t[5]^=s(t[4]+t[7],18),t[11]^=s(t[10]+t[9],7),t[8]^=s(t[11]+t[10],9),t[9]^=s(t[8]+t[11],13),t[10]^=s(t[9]+t[8],18),t[12]^=s(t[15]+t[14],7),t[13]^=s(t[12]+t[15],9),t[14]^=s(t[13]+t[12],13),t[15]^=s(t[14]+t[13],18);for(var r=0;r<16;++r)e[r]+=t[r]}function u(e,t,o,r){for(var n=0;n=256)return!1}return!0}function f(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function d(e,o,n,s,c,d,h){if(n=f(n,"N"),s=f(s,"r"),c=f(c,"p"),d=f(d,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/s)throw new Error("N too large");if(s>r/128/c)throw new Error("r too large");if(!m(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!m(o))throw new Error("salt must be an array or buffer");o=Array.prototype.slice.call(o);for(var p=i(e,o,128*c*s),g=new Uint32Array(32*c*s),b=0;b_&&(o=_);for(var r=0;r_&&(o=_);for(var f=0;f>0&255),p.push(g[O]>>8&255),p.push(g[O]>>16&255),p.push(g[O]>>24&255);var C=i(e,p,d);return h&&h(null,1,C),C}h&&T(t)};if(!h)for(;;){var C=O();if(null!=C)return C}O()}var h={scrypt:function(e,t,o,r,n,i,a){return new Promise((function(s,c){var u=0;a&&a(0),d(e,t,o,r,n,i,(function(e,t,o){if(e)c(e);else if(o)a&&1!==u&&a(1),s(new Uint8Array(o));else if(a&&t!==u)return u=t,a(t)}))}))},syncScrypt:function(e,t,o,r,n,i){return new Uint8Array(d(e,t,o,r,n,i))}};e.exports=h}()},7902:function(e,t,o){"use strict";e.exports=o(6922)(o(8123))},8123:function(e,t,o){"use strict";var r=new(0,o(6597).ec)("secp256k1"),n=r.curve,i=n.n.constructor;function a(e){var t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){var o=new i(t);if(o.cmp(n.p)>=0)return null;var a=(o=o.toRed(n.red)).redSqr().redIMul(o).redIAdd(n.b).redSqrt();return 3===e!==a.isOdd()&&(a=a.redNeg()),r.keyPair({pub:{x:o,y:a}})}(t,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,o){var a=new i(t),s=new i(o);if(a.cmp(n.p)>=0||s.cmp(n.p)>=0)return null;if(a=a.toRed(n.red),s=s.toRed(n.red),(6===e||7===e)&&s.isOdd()!==(7===e))return null;var c=a.redSqr().redIMul(a);return s.redSqr().redISub(c.redIAdd(n.b)).isZero()?r.keyPair({pub:{x:a,y:s}}):null}(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function s(e,t){for(var o=t.encode(null,33===e.length),r=0;r=0)return 1;if(o.iadd(new i(e)),o.cmp(n.n)>=0&&o.isub(n.n),o.isZero())return 1;var r=o.toArrayLike(Uint8Array,"be",32);return e.set(r),0},privateKeyTweakMul:function(e,t){var o=new i(t);if(o.cmp(n.n)>=0||o.isZero())return 1;o.imul(new i(e)),o.cmp(n.n)>=0&&(o=o.umod(n.n));var r=o.toArrayLike(Uint8Array,"be",32);return e.set(r),0},publicKeyVerify:function(e){return null===a(e)?1:0},publicKeyCreate:function(e,t){var o=new i(t);return o.cmp(n.n)>=0||o.isZero()?1:(s(e,r.keyFromPrivate(t).getPublic()),0)},publicKeyConvert:function(e,t){var o=a(t);return null===o?1:(s(e,o.getPublic()),0)},publicKeyNegate:function(e,t){var o=a(t);if(null===o)return 1;var r=o.getPublic();return r.y=r.y.redNeg(),s(e,r),0},publicKeyCombine:function(e,t){for(var o=new Array(t.length),r=0;r=0)return 2;var c=r.getPublic().add(n.g.mul(o));return c.isInfinity()?2:(s(e,c),0)},publicKeyTweakMul:function(e,t,o){var r=a(t);return null===r?1:(o=new i(o)).cmp(n.n)>=0||o.isZero()?2:(s(e,r.getPublic().mul(o)),0)},signatureNormalize:function(e){var t=new i(e.subarray(0,32)),o=new i(e.subarray(32,64));return t.cmp(n.n)>=0||o.cmp(n.n)>=0?1:(1===o.cmp(r.nh)&&e.set(n.n.sub(o).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport:function(e,t){var o=t.subarray(0,32),r=t.subarray(32,64);if(new i(o).cmp(n.n)>=0)return 1;if(new i(r).cmp(n.n)>=0)return 1;var a=e.output,s=a.subarray(4,37);s[0]=0,s.set(o,1);for(var c=33,u=0;c>1&&0===s[u]&&!(128&s[u+1]);--c,++u);if(128&(s=s.subarray(u))[0])return 1;if(c>1&&0===s[0]&&!(128&s[1]))return 1;var l=a.subarray(39,72);l[0]=0,l.set(r,1);for(var m=33,f=0;m>1&&0===l[f]&&!(128&l[f+1]);--m,++f);return 128&(l=l.subarray(f))[0]||m>1&&0===l[0]&&!(128&l[1])?1:(e.outputlen=6+c+m,a[0]=48,a[1]=e.outputlen-2,a[2]=2,a[3]=s.length,a.set(s,4),a[4+c]=2,a[5+c]=l.length,a.set(l,6+c),0)},signatureImport:function(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;var o=t[3];if(0===o)return 1;if(5+o>=t.length)return 1;if(2!==t[4+o])return 1;var r=t[5+o];if(0===r)return 1;if(6+o+r!==t.length)return 1;if(128&t[4])return 1;if(o>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[o+6])return 1;if(r>1&&0===t[o+6]&&!(128&t[o+7]))return 1;var a=t.subarray(4,4+o);if(33===a.length&&0===a[0]&&(a=a.subarray(1)),a.length>32)return 1;var s=t.subarray(6+o);if(33===s.length&&0===s[0]&&(s=s.slice(1)),s.length>32)throw new Error("S length is too long");var c=new i(a);c.cmp(n.n)>=0&&(c=new i(0));var u=new i(t.subarray(6+o));return u.cmp(n.n)>=0&&(u=new i(0)),e.set(c.toArrayLike(Uint8Array,"be",32),0),e.set(u.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign:function(e,t,o,a,s){if(s){var c=s;s=function(e){var r=c(t,o,null,a,e);if(!(r instanceof Uint8Array&&32===r.length))throw new Error("This is the way");return new i(r)}}var u,l=new i(o);if(l.cmp(n.n)>=0||l.isZero())return 1;try{u=r.sign(t,o,{canonical:!0,k:s,pers:a})}catch(e){return 1}return e.signature.set(u.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(u.s.toArrayLike(Uint8Array,"be",32),32),e.recid=u.recoveryParam,0},ecdsaVerify:function(e,t,o){var s={r:e.subarray(0,32),s:e.subarray(32,64)},c=new i(s.r),u=new i(s.s);if(c.cmp(n.n)>=0||u.cmp(n.n)>=0)return 1;if(1===u.cmp(r.nh)||c.isZero()||u.isZero())return 3;var l=a(o);if(null===l)return 2;var m=l.getPublic();return r.verify(t,s,m)?0:3},ecdsaRecover:function(e,t,o,a){var c,u={r:t.slice(0,32),s:t.slice(32,64)},l=new i(u.r),m=new i(u.s);if(l.cmp(n.n)>=0||m.cmp(n.n)>=0)return 1;if(l.isZero()||m.isZero())return 2;try{c=r.recoverPubKey(a,u,o)}catch(e){return 2}return s(e,c),0},ecdh:function(e,t,o,s,c,u,l){var m=a(t);if(null===m)return 1;var f=new i(o);if(f.cmp(n.n)>=0||f.isZero())return 2;var d=m.getPublic().mul(f);if(void 0===c)for(var h=d.encode(null,!0),p=r.hash().update(h).digest(),g=0;g<32;++g)e[g]=p[g];else{u||(u=new Uint8Array(32));for(var b=d.getX().toArray("be",32),y=0;y<32;++y)u[y]=b[y];l||(l=new Uint8Array(32));for(var v=d.getY().toArray("be",32),k=0;k<32;++k)l[k]=v[k];var w=c(u,l,s);if(!(w instanceof Uint8Array&&w.length===e.length))return 2;e.set(w)}return 0}}},6922:function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o0&&void 0!==arguments[0]?arguments[0]:function(e){return new Uint8Array(e)},t=arguments.length>1?arguments[1]:void 0;return"function"==typeof e&&(e=e(t)),u("output",e,t),e}function f(e){return Object.prototype.toString.call(e).slice(8,-1)}e.exports=function(e){return{contextRandomize:function(t){if(c(null===t||t instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==t&&u("seed",t,32),1===e.contextRandomize(t))throw new Error("Unknow error on context randomization")},privateKeyVerify:function(t){return u("private key",t,32),0===e.privateKeyVerify(t)},privateKeyNegate:function(t){switch(u("private key",t,32),e.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(o)}},privateKeyTweakAdd:function(t,o){switch(u("private key",t,32),u("tweak",o,32),e.privateKeyTweakAdd(t,o)){case 0:return t;case 1:throw new Error(r)}},privateKeyTweakMul:function(t,o){switch(u("private key",t,32),u("tweak",o,32),e.privateKeyTweakMul(t,o)){case 0:return t;case 1:throw new Error(n)}},publicKeyVerify:function(t){return u("public key",t,[33,65]),0===e.publicKeyVerify(t)},publicKeyCreate:function(t){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0;switch(u("private key",t,32),l(o),r=m(r,o?33:65),e.publicKeyCreate(r,t)){case 0:return r;case 1:throw new Error("Private Key is invalid");case 2:throw new Error(a)}},publicKeyConvert:function(t){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0;switch(u("public key",t,[33,65]),l(o),r=m(r,o?33:65),e.publicKeyConvert(r,t)){case 0:return r;case 1:throw new Error(i);case 2:throw new Error(a)}},publicKeyNegate:function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;switch(u("public key",t,[33,65]),l(r),n=m(n,r?33:65),e.publicKeyNegate(n,t)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error(o);case 3:throw new Error(a)}},publicKeyCombine:function(o){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;c(Array.isArray(o),"Expected public keys to be an Array"),c(o.length>0,"Expected public keys array will have more than zero items");var s,f=function(e,o){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,o){if(e){if("string"==typeof e)return t(e,o);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,o):void 0}}(e))||o&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(o);try{for(f.s();!(s=f.n()).done;)u("public key",s.value,[33,65])}catch(e){f.e(e)}finally{f.f()}switch(l(r),n=m(n,r?33:65),e.publicKeyCombine(n,o)){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(a)}},publicKeyTweakAdd:function(t,o){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3?arguments[3]:void 0;switch(u("public key",t,[33,65]),u("tweak",o,32),l(n),a=m(a,n?33:65),e.publicKeyTweakAdd(a,t,o)){case 0:return a;case 1:throw new Error(i);case 2:throw new Error(r)}},publicKeyTweakMul:function(t,o){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3?arguments[3]:void 0;switch(u("public key",t,[33,65]),u("tweak",o,32),l(r),a=m(a,r?33:65),e.publicKeyTweakMul(a,t,o)){case 0:return a;case 1:throw new Error(i);case 2:throw new Error(n)}},signatureNormalize:function(t){switch(u("signature",t,64),e.signatureNormalize(t)){case 0:return t;case 1:throw new Error(s)}},signatureExport:function(t,r){u("signature",t,64);var n={output:r=m(r,72),outputlen:72};switch(e.signatureExport(n,t)){case 0:return r.slice(0,n.outputlen);case 1:throw new Error(s);case 2:throw new Error(o)}},signatureImport:function(t,r){switch(u("signature",t),r=m(r,64),e.signatureImport(r,t)){case 0:return r;case 1:throw new Error(s);case 2:throw new Error(o)}},ecdsaSign:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;u("message",t,32),u("private key",r,32),c("Object"===f(n),"Expected options to be an Object"),void 0!==n.data&&u("options.data",n.data),void 0!==n.noncefn&&c("Function"===f(n.noncefn),"Expected options.noncefn to be a Function");var a={signature:i=m(i,64),recid:null};switch(e.ecdsaSign(a,t,r,n.data,n.noncefn)){case 0:return a;case 1:throw new Error("The nonce generation function failed, or the private key was invalid");case 2:throw new Error(o)}},ecdsaVerify:function(t,o,r){switch(u("signature",t,64),u("message",o,32),u("public key",r,[33,65]),e.ecdsaVerify(t,o,r)){case 0:return!0;case 3:return!1;case 1:throw new Error(s);case 2:throw new Error(i)}},ecdsaRecover:function(t,r,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4?arguments[4]:void 0;switch(u("signature",t,64),c("Number"===f(r)&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),u("message",n,32),l(i),a=m(a,i?33:65),e.ecdsaRecover(a,t,r,n)){case 0:return a;case 1:throw new Error(s);case 2:throw new Error("Public key could not be recover");case 3:throw new Error(o)}},ecdh:function(t,o){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;switch(u("public key",t,[33,65]),u("private key",o,32),c("Object"===f(r),"Expected options to be an Object"),void 0!==r.data&&u("options.data",r.data),void 0!==r.hashfn?(c("Function"===f(r.hashfn),"Expected options.hashfn to be a Function"),void 0!==r.xbuf&&u("options.xbuf",r.xbuf,32),void 0!==r.ybuf&&u("options.ybuf",r.ybuf,32),u("output",n)):n=m(n,32),e.ecdh(n,t,o,r.data,r.hashfn,r.xbuf,r.ybuf)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error("Scalar was invalid (zero or overflow)")}}}}},6003:function(e,t,o){"use strict";var r=o(8850).Buffer;function n(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}n.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=r.from(e,t));for(var o=this._block,n=this._blockSize,i=e.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var o=8*this._len;if(o<=4294967295)this._block.writeUInt32BE(o,this._blockSize-4);else{var r=(4294967295&o)>>>0,n=(o-r)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=n},1708:function(e,t,o){"use strict";var r=e.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};r.sha=o(8210),r.sha1=o(544),r.sha224=o(6288),r.sha256=o(4571),r.sha384=o(6959),r.sha512=o(4515)},8210:function(e,t,o){"use strict";var r=o(1736),n=o(6003),i=o(8850).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,n.call(this,64,56)}function u(e){return e<<30|e>>>2}function l(e,t,o,r){return 0===e?t&o|~t&r:2===e?t&o|t&r|o&r:t^o^r}r(c,n),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,o=this._w,r=0|this._a,n=0|this._b,i=0|this._c,s=0|this._d,c=0|this._e,m=0;m<16;++m)o[m]=e.readInt32BE(4*m);for(;m<80;++m)o[m]=o[m-3]^o[m-8]^o[m-14]^o[m-16];for(var f=0;f<80;++f){var d=~~(f/20),h=0|((t=r)<<5|t>>>27)+l(d,n,i,s)+c+o[f]+a[d];c=s,s=i,i=u(n),n=r,r=h}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},544:function(e,t,o){"use strict";var r=o(1736),n=o(6003),i=o(8850).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,n.call(this,64,56)}function u(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function m(e,t,o,r){return 0===e?t&o|~t&r:2===e?t&o|t&r|o&r:t^o^r}r(c,n),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,o=this._w,r=0|this._a,n=0|this._b,i=0|this._c,s=0|this._d,c=0|this._e,f=0;f<16;++f)o[f]=e.readInt32BE(4*f);for(;f<80;++f)o[f]=(t=o[f-3]^o[f-8]^o[f-14]^o[f-16])<<1|t>>>31;for(var d=0;d<80;++d){var h=~~(d/20),p=u(r)+m(h,n,i,s)+c+o[d]+a[h]|0;c=s,s=i,i=l(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},6288:function(e,t,o){"use strict";var r=o(1736),n=o(4571),i=o(6003),a=o(8850).Buffer,s=new Array(64);function c(){this.init(),this._w=s,i.call(this,64,56)}r(c,n),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=c},4571:function(e,t,o){"use strict";var r=o(1736),n=o(6003),i=o(8850).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function c(){this.init(),this._w=s,n.call(this,64,56)}function u(e,t,o){return o^e&(t^o)}function l(e,t,o){return e&t|o&(e|t)}function m(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}r(c,n),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,o=this._w,r=0|this._a,n=0|this._b,i=0|this._c,s=0|this._d,c=0|this._e,h=0|this._f,p=0|this._g,g=0|this._h,b=0;b<16;++b)o[b]=e.readInt32BE(4*b);for(;b<64;++b)o[b]=0|(((t=o[b-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+o[b-7]+d(o[b-15])+o[b-16];for(var y=0;y<64;++y){var v=g+f(c)+u(c,h,p)+a[y]+o[y]|0,k=m(r)+l(r,n,i)|0;g=p,p=h,h=c,c=s+v|0,s=i,i=n,n=r,r=v+k|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=h+this._f|0,this._g=p+this._g|0,this._h=g+this._h|0},c.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},6959:function(e,t,o){"use strict";var r=o(1736),n=o(4515),i=o(6003),a=o(8850).Buffer,s=new Array(160);function c(){this.init(),this._w=s,i.call(this,128,112)}r(c,n),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,o,r){e.writeInt32BE(t,r),e.writeInt32BE(o,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=c},4515:function(e,t,o){"use strict";var r=o(1736),n=o(6003),i=o(8850).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function c(){this.init(),this._w=s,n.call(this,128,112)}function u(e,t,o){return o^e&(t^o)}function l(e,t,o){return e&t|o&(e|t)}function m(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function f(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function p(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function b(e,t){return e>>>0>>0?1:0}r(c,n),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,o=0|this._ah,r=0|this._bh,n=0|this._ch,i=0|this._dh,s=0|this._eh,c=0|this._fh,y=0|this._gh,v=0|this._hh,k=0|this._al,w=0|this._bl,x=0|this._cl,z=0|this._dl,j=0|this._el,M=0|this._fl,A=0|this._gl,q=0|this._hl,I=0;I<32;I+=2)t[I]=e.readInt32BE(4*I),t[I+1]=e.readInt32BE(4*I+4);for(;I<160;I+=2){var E=t[I-30],S=t[I-30+1],N=d(E,S),_=h(S,E),T=p(E=t[I-4],S=t[I-4+1]),O=g(S,E),C=t[I-14],D=t[I-14+1],L=t[I-32],P=t[I-32+1],R=_+D|0,B=N+C+b(R,_)|0;B=(B=B+T+b(R=R+O|0,O)|0)+L+b(R=R+P|0,P)|0,t[I]=B,t[I+1]=R}for(var U=0;U<160;U+=2){B=t[U],R=t[U+1];var F=l(o,r,n),Q=l(k,w,x),Y=m(o,k),H=m(k,o),G=f(s,j),W=f(j,s),Z=a[U],V=a[U+1],K=u(s,c,y),J=u(j,M,A),X=q+W|0,$=v+G+b(X,q)|0;$=($=($=$+K+b(X=X+J|0,J)|0)+Z+b(X=X+V|0,V)|0)+B+b(X=X+R|0,R)|0;var ee=H+Q|0,te=Y+F+b(ee,H)|0;v=y,q=A,y=c,A=M,c=s,M=j,s=i+$+b(j=z+X|0,z)|0,i=n,z=x,n=r,x=w,r=o,w=k,o=$+te+b(k=X+ee|0,X)|0}this._al=this._al+k|0,this._bl=this._bl+w|0,this._cl=this._cl+x|0,this._dl=this._dl+z|0,this._el=this._el+j|0,this._fl=this._fl+M|0,this._gl=this._gl+A|0,this._hl=this._hl+q|0,this._ah=this._ah+o+b(this._al,k)|0,this._bh=this._bh+r+b(this._bl,w)|0,this._ch=this._ch+n+b(this._cl,x)|0,this._dh=this._dh+i+b(this._dl,z)|0,this._eh=this._eh+s+b(this._el,j)|0,this._fh=this._fh+c+b(this._fl,M)|0,this._gh=this._gh+y+b(this._gl,A)|0,this._hh=this._hh+v+b(this._hl,q)|0},c.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,o,r){e.writeInt32BE(t,r),e.writeInt32BE(o,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=c},7245:function(e,t,o){"use strict";e.exports=n;var r=o(8291).EventEmitter;function n(){r.call(this)}o(1736)(n,r),n.Readable=o(6297),n.Writable=o(1471),n.Duplex=o(6884),n.Transform=o(9154),n.PassThrough=o(3582),n.finished=o(5831),n.pipeline=o(384),n.Stream=n,n.prototype.pipe=function(e,t){var o=this;function n(t){e.writable&&!1===e.write(t)&&o.pause&&o.pause()}function i(){o.readable&&o.resume&&o.resume()}o.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(o.on("end",s),o.on("close",c));var a=!1;function s(){a||(a=!0,e.end())}function c(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(l(),0===r.listenerCount(this,"error"))throw e}function l(){o.removeListener("data",n),e.removeListener("drain",i),o.removeListener("end",s),o.removeListener("close",c),o.removeListener("error",u),e.removeListener("error",u),o.removeListener("end",l),o.removeListener("close",l),e.removeListener("close",l)}return o.on("error",u),e.on("error",u),o.on("end",l),o.on("close",l),e.on("close",l),e.emit("pipe",o),e}},9519:function(e,t,o){"use strict";var r=o(8844),n=o(3319),i=o(7705),a=o(3675),s=o(1143),c=t;c.request=function(e,t){e="string"==typeof e?s.parse(e):i(e);var n=-1===o.g.location.protocol.search(/^https?:$/)?"http:":"",a=e.protocol||n,c=e.hostname||e.host,u=e.port,l=e.path||"/";c&&-1!==c.indexOf(":")&&(c="["+c+"]"),e.url=(c?a+"//"+c:"")+(u?":"+u:"")+l,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var m=new r(e);return t&&m.on("response",t),m},c.get=function(e,t){var o=c.request(e,t);return o.end(),o},c.ClientRequest=r,c.IncomingMessage=n.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=a,c.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},3928:function(e,t,o){"use strict";var r;function n(){if(void 0!==r)return r;if(o.g.XMLHttpRequest){r=new o.g.XMLHttpRequest;try{r.open("GET",o.g.XDomainRequest?"/":"https://example.com")}catch(e){r=null}}else r=null;return r}function i(e){var t=n();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function a(e){return"function"==typeof e}t.fetch=a(o.g.fetch)&&a(o.g.ReadableStream),t.writableStream=a(o.g.WritableStream),t.abortController=a(o.g.AbortController),t.arraybuffer=t.fetch||i("arraybuffer"),t.msstream=!t.fetch&&i("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&i("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!n()&&a(n().overrideMimeType),r=null},8844:function(e,t,o){"use strict";var r=o(9033).Buffer,n=o(9142),i=o(3928),a=o(1736),s=o(3319),c=o(6505),u=s.IncomingMessage,l=s.readyStates,m=e.exports=function(e){var t,o=this;c.Writable.call(o),o._opts=e,o._body=[],o._headers={},e.auth&&o.setHeader("Authorization","Basic "+r.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){o.setHeader(t,e.headers[t])}));var n=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!i.abortController)n=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!i.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}o._mode=function(e,t){return i.fetch&&t?"fetch":i.mozchunkedarraybuffer?"moz-chunked-arraybuffer":i.msstream?"ms-stream":i.arraybuffer&&e?"arraybuffer":"text"}(t,n),o._fetchTimer=null,o._socketTimeout=null,o._socketTimer=null,o.on("finish",(function(){o._onFinish()}))};a(m,c.Writable),m.prototype.setHeader=function(e,t){var o=e.toLowerCase();-1===f.indexOf(o)&&(this._headers[o]={name:e,value:t})},m.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},m.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},m.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts;"timeout"in t&&0!==t.timeout&&e.setTimeout(t.timeout);var r=e._headers,a=null;"GET"!==t.method&&"HEAD"!==t.method&&(a=new Blob(e._body,{type:(r["content-type"]||{}).value||""}));var s=[];if(Object.keys(r).forEach((function(e){var t=r[e].name,o=r[e].value;Array.isArray(o)?o.forEach((function(e){s.push([t,e])})):s.push([t,o])})),"fetch"===e._mode){var c=null;if(i.abortController){var u=new AbortController;c=u.signal,e._fetchAbortController=u,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=o.g.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),t.requestTimeout))}o.g.fetch(e._opts.url,{method:e._opts.method,headers:s,body:a||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:c}).then((function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()}),(function(t){e._resetTimers(!0),e._destroyed||e.emit("error",t)}))}else{var m=e._xhr=new o.g.XMLHttpRequest;try{m.open(e._opts.method,e._opts.url,!0)}catch(t){return void n.nextTick((function(){e.emit("error",t)}))}"responseType"in m&&(m.responseType=e._mode),"withCredentials"in m&&(m.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in m&&m.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(m.timeout=t.requestTimeout,m.ontimeout=function(){e.emit("requestTimeout")}),s.forEach((function(e){m.setRequestHeader(e[0],e[1])})),e._response=null,m.onreadystatechange=function(){switch(m.readyState){case l.LOADING:case l.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(m.onprogress=function(){e._onXHRProgress()}),m.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{m.send(a)}catch(t){return void n.nextTick((function(){e.emit("error",t)}))}}}},m.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},m.prototype._connect=function(){var e=this;e._destroyed||(e._response=new u(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},m.prototype._write=function(e,t,o){this._body.push(e),o()},m.prototype._resetTimers=function(e){var t=this;o.g.clearTimeout(t._socketTimer),t._socketTimer=null,e?(o.g.clearTimeout(t._fetchTimer),t._fetchTimer=null):t._socketTimeout&&(t._socketTimer=o.g.setTimeout((function(){t.emit("timeout")}),t._socketTimeout))},m.prototype.abort=m.prototype.destroy=function(e){var t=this;t._destroyed=!0,t._resetTimers(!0),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort(),e&&t.emit("error",e)},m.prototype.end=function(e,t,o){"function"==typeof e&&(o=e,e=void 0),c.Writable.prototype.end.call(this,e,t,o)},m.prototype.setTimeout=function(e,t){var o=this;t&&o.once("timeout",t),o._socketTimeout=e,o._resetTimers(!1)},m.prototype.flushHeaders=function(){},m.prototype.setNoDelay=function(){},m.prototype.setSocketKeepAlive=function(){};var f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},3319:function(e,t,o){"use strict";var r=o(9142),n=o(9033).Buffer,i=o(3928),a=o(1736),s=o(6505),c=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=t.IncomingMessage=function(e,t,o,a){var c=this;if(s.Readable.call(c),c._mode=o,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",(function(){r.nextTick((function(){c.emit("close")}))})),"fetch"===o){if(c._fetchResponse=t,c.url=t.url,c.statusCode=t.status,c.statusMessage=t.statusText,t.headers.forEach((function(e,t){c.headers[t.toLowerCase()]=e,c.rawHeaders.push(t,e)})),i.writableStream){var u=new WritableStream({write:function(e){return a(!1),new Promise((function(t,o){c._destroyed?o():c.push(n.from(e))?t():c._resumeFetch=t}))},close:function(){a(!0),c._destroyed||c.push(null)},abort:function(e){a(!0),c._destroyed||c.emit("error",e)}});try{return void t.body.pipeTo(u).catch((function(e){a(!0),c._destroyed||c.emit("error",e)}))}catch(e){}}var l=t.body.getReader();!function e(){l.read().then((function(t){c._destroyed||(a(t.done),t.done?c.push(null):(c.push(n.from(t.value)),e()))})).catch((function(e){a(!0),c._destroyed||c.emit("error",e)}))}()}else if(c._xhr=e,c._pos=0,c.url=e.responseURL,c.statusCode=e.status,c.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var o=t[1].toLowerCase();"set-cookie"===o?(void 0===c.headers[o]&&(c.headers[o]=[]),c.headers[o].push(t[2])):void 0!==c.headers[o]?c.headers[o]+=", "+t[2]:c.headers[o]=t[2],c.rawHeaders.push(t[1],t[2])}})),c._charset="x-user-defined",!i.overrideMimeType){var m=c.rawHeaders["mime-type"];if(m){var f=m.match(/;\s*charset=([^;])(;|$)/);f&&(c._charset=f[1].toLowerCase())}c._charset||(c._charset="utf-8")}};a(u,s.Readable),u.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},u.prototype._onXHRProgress=function(e){var t=this,r=t._xhr,i=null;switch(t._mode){case"text":if((i=r.responseText).length>t._pos){var a=i.substr(t._pos);if("x-user-defined"===t._charset){for(var s=n.alloc(a.length),u=0;ut._pos&&(t.push(n.from(new Uint8Array(l.result.slice(t._pos)))),t._pos=l.result.byteLength)},l.onload=function(){e(!0),t.push(null)},l.readAsArrayBuffer(i)}t._xhr.readyState===c.DONE&&"ms-stream"!==t._mode&&(e(!0),t.push(null))}},10:function(e){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}},3462:function(e,t,o){"use strict";var r=o(8850).Buffer,n=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=m,t=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,o=function(e,t,o){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==o?o:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var o=e.toString("utf16le",t);if(o){var r=o.charCodeAt(o.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],o.slice(0,-1)}return o}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var o=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,o)}return t}function l(e,t){var o=(e.length-t)%3;return 0===o?e.toString("base64",t):(this.lastNeed=3-o,this.lastTotal=3,1===o?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-o))}function m(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.s=i,i.prototype.write=function(e){if(0===e.length)return"";var t,o;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";o=this.lastNeed,this.lastNeed=0}else o=0;return o=0?(n>0&&(e.lastNeed=n-1),n):--r=0?(n>0&&(e.lastNeed=n-2),n):--r=0?(n>0&&(2===n?n=0:e.lastNeed=n-3),n):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=o;var r=e.length-(o-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},6931:function(e,t,o){"use strict";var r=o(8619);e.exports=function(e){return"string"!=typeof e?e:r(e)?e.slice(2):e}},6427:function(e,t,o){"use strict";var r=function(){throw"This swarm.js function isn't available on the browser."},n={readFile:r},i={download:r,safeDownloadArchived:r,directoryTree:r},a={platform:r,arch:r},s={join:r,slice:r},c={spawn:r},u={lookup:r},l=o(1357),m=o(631),f=o(2733),d=o(2510),h=o(3094);e.exports=h({fs:n,files:i,os:a,path:s,child_process:c,defaultArchives:{},mimetype:u,request:l,downloadUrl:null,bytes:m,hash:f,pick:d})},2510:function(e){"use strict";var t=function(e){return function(){return new Promise((function(t,o){var r,n=function(o){var r={},n=o.target.files.length,i=0;[].map.call(o.target.files,(function(o){var a=new FileReader;a.onload=function(a){var s=new Uint8Array(a.target.result);if("directory"===e){var c=o.webkitRelativePath;r[c.slice(c.indexOf("/")+1)]={type:"text/plain",data:s},++i===n&&t(r)}else if("file"===e){var u=o.webkitRelativePath;t({type:mimetype.lookup(u),data:s})}else t(s)},a.readAsArrayBuffer(o)}))};"directory"===e?((r=document.createElement("input")).addEventListener("change",n),r.type="file",r.webkitdirectory=!0,r.mozdirectory=!0,r.msdirectory=!0,r.odirectory=!0,r.directory=!0):((r=document.createElement("input")).addEventListener("change",n),r.type="file");var i=document.createEvent("MouseEvents");i.initEvent("click",!0,!1),r.dispatchEvent(i)}))}};e.exports={data:t("data"),file:t("file"),directory:t("directory")}},2733:function(e,t,o){"use strict";var r=o(9574).keccak256,n=o(631),i=function(e,t){var o=n.reverse(n.pad(6,n.fromNumber(e))),i=n.flatten([o,"0x0000",t]);return r(i).slice(2)};e.exports=function e(t){"string"==typeof t&&"0x"!==t.slice(0,2)?t=n.fromString(t):"string"!=typeof t&&void 0!==t.length&&(t=n.fromUint8Array(t));var o=n.length(t);if(o<=4096)return i(o,t);for(var r=4096;128*r=400?r(new Error("Error ".concat(n.statusCode,"."))):o(new Uint8Array(t))}))}))}},g=function(e){return function(t){return function t(o){return function(r){return function(n){var i=function(e){return void 0===e.path?Promise.resolve():"application/bzz-manifest+json"===e.contentType?t(e.hash)(r+e.path)(n):Promise.resolve((o=r+e.path,function(e){return function(t){return t[o]=e,t}})(function(e){return{type:e.contentType,hash:e.hash}}(e))(n));var o};return p(e)(o).then((function(e){return JSON.parse(D(e)).entries})).then((function(e){return Promise.all(e.map(i))})).then((function(){return n}))}}}(t)("")({})}},b=function(e){return function(t){return g(e)(t).then((function(e){return d(Object.keys(e))(Object.keys(e).map((function(t){return e[t].hash})))}))}},y=function(e){return function(t){return g(e)(t).then((function(t){var o=Object.keys(t),r=o.map((function(e){return t[e].hash})),n=o.map((function(e){return t[e].type})),i=r.map(p(e));return Promise.all(i).then((function(e){return d(o)(function(e){return e.map((function(e,t){return{type:n[t],data:e}}))}(e))}))}))}},v=function(e){return function(t){return function(r){return o.download(h(e)(t))(r)}}},k=function(e){return function(t){return function(o){return b(e)(t).then((function(t){var r=[];for(var i in t)if(i.length>0){var a=n.join(o,i);r.push(v(e)(t[i])(a))}return Promise.all(r).then((function(){return o}))}))}}},w=function(e){return function(t){return new Promise((function(o,r){var n={body:"string"==typeof t?L(t):t,method:"POST"};c("".concat(e,"/bzz-raw:/"),n,(function(e,t){return e?r(e):o(t)}))}))}},x=function(e){return function(t){return function(o){return function(r){return function n(i){var a="/"===o[0]?o:"/"+o,s="".concat(e,"/bzz:/").concat(t).concat(a),u={method:"PUT",headers:{"Content-Type":r.type},body:r.data};return new Promise((function(e,t){c(s,u,(function(o,r){return o?t(o):-1!==r.indexOf("error")?t(r):e(r)}))})).catch((function(e){return i>0&&n(i-1)}))}(3)}}}},z=function(e){return function(t){return M(e)({"":t})}},j=function(e){return function(o){return t.readFile(o).then((function(t){return z(e)({type:a.lookup(o),data:t})}))}},M=function(e){return function(t){return w(e)("{}").then((function(o){return Object.keys(t).reduce((function(o,r){return o.then(function(o){return function(r){return x(e)(r)(o)(t[o])}}(r))}),Promise.resolve(o))}))}},A=function(e){return function(o){return t.readFile(o).then(w(e))}},q=function(e){return function(r){return function(n){return o.directoryTree(n).then((function(e){return Promise.all(e.map((function(e){return t.readFile(e)}))).then((function(t){var o=e.map((function(e){return e.slice(n.length)})),r=e.map((function(e){return a.lookup(e)||"text/plain"}));return d(o)(t.map((function(e,t){return{type:r[t],data:e}})))}))})).then((function(e){return(t=r?{"":e[r]}:{},function(e){var o={};for(var r in t)o[r]=t[r];for(var n in e)o[n]=e[n];return o})(e);var t})).then(M(e))}}},I=function(e){return function(t){if("data"===t.pick)return f.data().then(w(e));if("file"===t.pick)return f.file().then(z(e));if("directory"===t.pick)return f.directory().then(M(e));if(t.path)switch(t.kind){case"data":return A(e)(t.path);case"file":return j(e)(t.path);case"directory":return q(e)(t.defaultFile)(t.path)}else{if(t.length||"string"==typeof t)return w(e)(t);if(t instanceof Object)return M(e)(t)}return Promise.reject(new Error("Bad arguments"))}},E=function(e){return function(t){return function(o){return O(e)(t).then((function(r){return r?o?k(e)(t)(o):y(e)(t):o?v(e)(t)(o):p(e)(t)}))}}},S=function(e,t){var n=r.platform().replace("win32","windows")+"-"+("x64"===r.arch()?"amd64":"386"),i=(t||s)[n],a=u+i.archive+".tar.gz",c=i.archiveMD5,l=i.binaryMD5;return o.safeDownloadArchived(a)(c)(l)(e)},N=function(e){return new Promise((function(t,o){var r=i.spawn,n=function(e){return function(t){return-1!==(""+t).indexOf(e)}},a=e.account,s=e.password,c=e.dataDir,u=e.ensApi,l=e.privateKey,m=0,f=r(e.binPath,["--bzzaccount",a||l,"--datadir",c,"--ens-api",u]),d=function(e){0===m&&n("Passphrase")(e)?setTimeout((function(){m=1,f.stdin.write(s+"\n")}),500):n("Swarm http proxy started")(e)&&(m=2,clearTimeout(h),t(f))};f.stdout.on("data",d),f.stderr.on("data",d);var h=setTimeout((function(){return o(new Error("Couldn't start swarm process."))}),2e4)}))},_=function(e){return new Promise((function(t,o){e.stderr.removeAllListeners("data"),e.stdout.removeAllListeners("data"),e.stdin.removeAllListeners("error"),e.removeAllListeners("error"),e.removeAllListeners("exit"),e.kill("SIGINT");var r=setTimeout((function(){return e.kill("SIGKILL")}),8e3);e.once("close",(function(){clearTimeout(r),t()}))}))},T=function(e){return w(e)("test").then((function(e){return"c9a99c7d326dcc6316f32fe2625b311f6dc49a175e6877681ded93137d3569e7"===e})).catch((function(){return!1}))},O=function(e){return function(t){return p(e)(t).then((function(e){try{return!!JSON.parse(D(e)).entries}catch(e){return!1}}))}},C=function(e){return function(t,o,r,n,i){var a;return void 0!==t&&(a=e(t)),void 0!==o&&(a=e(o)),void 0!==r&&(a=e(r)),void 0!==n&&(a=e(n)),void 0!==i&&(a=e(i)),a}},D=function(e){return l.toString(l.fromUint8Array(e))},L=function(e){return l.toUint8Array(l.fromString(e))},P=function(e){return{download:function(t,o){return E(e)(t)(o)},downloadData:C(p(e)),downloadDataToDisk:C(v(e)),downloadDirectory:C(y(e)),downloadDirectoryToDisk:C(k(e)),downloadEntries:C(g(e)),downloadRoutes:C(b(e)),isAvailable:function(){return T(e)},upload:function(t){return I(e)(t)},uploadData:C(w(e)),uploadFile:C(z(e)),uploadFileFromDisk:C(z(e)),uploadDataFromDisk:C(A(e)),uploadDirectory:C(M(e)),uploadDirectoryFromDisk:C(q(e)),uploadToManifest:C(x(e)),pick:f,hash:m,fromString:L,toString:D}};return{at:P,local:function(e){return function(t){return T("http://localhost:8500").then((function(o){return o?t(P("http://localhost:8500")).then((function(){})):S(e.binPath,e.archives).onData((function(t){return(e.onProgress||function(){})(t.length)})).then((function(){return N(e)})).then((function(e){return t(P("http://localhost:8500")).then((function(){return e}))})).then(_)}))}},download:E,downloadBinary:S,downloadData:p,downloadDataToDisk:v,downloadDirectory:y,downloadDirectoryToDisk:k,downloadEntries:g,downloadRoutes:b,isAvailable:T,startProcess:N,stopProcess:_,upload:I,uploadData:w,uploadDataFromDisk:A,uploadFile:z,uploadFileFromDisk:j,uploadDirectory:M,uploadDirectoryFromDisk:q,uploadToManifest:x,pick:f,hash:m,fromString:L,toString:D}}},7380:function(e){"use strict";var t=function(e,t){for(var o=[],r=0;r>6|192);else{if(n>55295&&n<56320){if(++r==e.length)return null;var i=e.charCodeAt(r);if(i<56320||i>57343)return null;o+=t((n=65536+((1023&n)<<10)+(1023&i))>>18|240),o+=t(n>>12&63|128)}else o+=t(n>>12|224);o+=t(n>>6&63|128)}o+=t(63&n|128)}}return o},toString:function(e){for(var t="",o=0,i=n(e);o127){if(a>191&&a<224){if(o>=i)return null;a=(31&a)<<6|63&r(e,o)}else if(a>223&&a<240){if(o+1>=i)return null;a=(15&a)<<12|(63&r(e,o))<<6|63&r(e,++o)}else{if(!(a>239&&a<248))return null;if(o+2>=i)return null;a=(7&a)<<18|(63&r(e,o))<<12|(63&r(e,++o))<<6|63&r(e,++o)}++o}if(a<=65535)t+=String.fromCharCode(a);else{if(!(a<=1114111))return null;a-=65536,t+=String.fromCharCode(a>>10|55296),t+=String.fromCharCode(1023&a|56320)}}return t},fromNumber:function(e){var t=e.toString(16);return t.length%2==0?"0x"+t:"0x0"+t},toNumber:function(e){return parseInt(e.slice(2),16)},fromNat:function(e){return"0x0"===e?"0x":e.length%2==0?e:"0x0"+e.slice(2)},toNat:function(e){return"0"===e[2]?"0x"+e.slice(3):e},fromArray:a,toArray:i,fromUint8Array:function(e){return a([].slice.call(e,0))},toUint8Array:function(e){return new Uint8Array(i(e))}}},9574:function(e){"use strict";var t="0123456789abcdef".split(""),o=[1,256,65536,16777216],r=[0,8,16,24],n=[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],i=function(e){var t,o,r,i,a,s,c,u,l,m,f,d,h,p,g,b,y,v,k,w,x,z,j,M,A,q,I,E,S,N,_,T,O,C,D,L,P,R,B,U,F,Q,Y,H,G,W,Z,V,K,J,X,$,ee,te,oe,re,ne,ie,ae,se,ce,ue,le;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],c=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],m=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|c>>>31),o=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(c<<1|s>>>31),e[0]^=t,e[1]^=o,e[10]^=t,e[11]^=o,e[20]^=t,e[21]^=o,e[30]^=t,e[31]^=o,e[40]^=t,e[41]^=o,t=i^(u<<1|l>>>31),o=a^(l<<1|u>>>31),e[2]^=t,e[3]^=o,e[12]^=t,e[13]^=o,e[22]^=t,e[23]^=o,e[32]^=t,e[33]^=o,e[42]^=t,e[43]^=o,t=s^(m<<1|f>>>31),o=c^(f<<1|m>>>31),e[4]^=t,e[5]^=o,e[14]^=t,e[15]^=o,e[24]^=t,e[25]^=o,e[34]^=t,e[35]^=o,e[44]^=t,e[45]^=o,t=u^(d<<1|h>>>31),o=l^(h<<1|d>>>31),e[6]^=t,e[7]^=o,e[16]^=t,e[17]^=o,e[26]^=t,e[27]^=o,e[36]^=t,e[37]^=o,e[46]^=t,e[47]^=o,t=m^(i<<1|a>>>31),o=f^(a<<1|i>>>31),e[8]^=t,e[9]^=o,e[18]^=t,e[19]^=o,e[28]^=t,e[29]^=o,e[38]^=t,e[39]^=o,e[48]^=t,e[49]^=o,p=e[0],g=e[1],W=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,E=e[20]<<3|e[21]>>>29,S=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,Q=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,K=e[23]<<10|e[22]>>>22,N=e[33]<<13|e[32]>>>19,_=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,oe=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,P=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,k=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,T=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,M=e[6]<<28|e[7]>>>4,A=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,R=e[26]<<25|e[27]>>>7,B=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,x=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,q=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,U=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,z=e[48]<<14|e[49]>>>18,j=e[49]<<14|e[48]>>>18,e[0]=p^~b&v,e[1]=g^~y&k,e[10]=M^~q&E,e[11]=A^~I&S,e[20]=C^~L&R,e[21]=D^~P&B,e[30]=H^~W&V,e[31]=G^~Z&K,e[40]=te^~re&ie,e[41]=oe^~ne&ae,e[2]=b^~v&w,e[3]=y^~k&x,e[12]=q^~E&N,e[13]=I^~S&_,e[22]=L^~R&U,e[23]=P^~B&F,e[32]=W^~V&J,e[33]=Z^~K&X,e[42]=re^~ie&se,e[43]=ne^~ae&ce,e[4]=v^~w&z,e[5]=k^~x&j,e[14]=E^~N&T,e[15]=S^~_&O,e[24]=R^~U&Q,e[25]=B^~F&Y,e[34]=V^~J&$,e[35]=K^~X&ee,e[44]=ie^~se&ue,e[45]=ae^~ce&le,e[6]=w^~z&p,e[7]=x^~j&g,e[16]=N^~T&M,e[17]=_^~O&A,e[26]=U^~Q&C,e[27]=F^~Y&D,e[36]=J^~$&H,e[37]=X^~ee&G,e[46]=se^~ue&te,e[47]=ce^~le&oe,e[8]=z^~p&b,e[9]=j^~g&y,e[18]=T^~M&q,e[19]=O^~A&I,e[28]=Q^~C&L,e[29]=Y^~D&P,e[38]=$^~H&W,e[39]=ee^~G&Z,e[48]=ue^~te&re,e[49]=le^~oe&ne,e[0]^=n[r],e[1]^=n[r+1]},a=function(e){return function(n){var a;if("0x"===n.slice(0,2)){a=[];for(var s=2,c=n.length;s>2]|=n[d]<>2]|=a<>2]|=(192|a>>6)<>2]|=(128|63&a)<=57344?(c[g>>2]|=(224|a>>12)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<>2]|=(240|a>>18)<>2]|=(128|a>>12&63)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<=u){for(e.start=g-u,e.block=c[l],g=0;g>2]|=o[3&g],e.lastByteIndex===u)for(c[0]=c[l],g=1;g>4&15]+t[15&h]+t[h>>12&15]+t[h>>8&15]+t[h>>20&15]+t[h>>16&15]+t[h>>28&15]+t[h>>24&15];b%l==0&&(i(f),g=0)}return"0x"+p}(function(e){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(t=[0,0,0,0,0,0,0,0,0,0],[].concat(t,t,t,t,t))};var t}(e),a)}};e.exports={keccak256:a(256),keccak512:a(512),keccak256s:a(256),keccak512s:a(512)}},8419:function(e){"use strict";e.exports=function(e,t){if(t){t=(t=t.trim().replace(/^(\?|#|&)/,""))?"?"+t:t;var o=e.split(/[\?\#]/)[0];t&&/\:\/\/[^\/]*$/.test(o)&&(o+="/");var r=e.match(/(\#.*)$/);e=o+t,r&&(e+=r[0])}return e}},8677:function(e,t,o){"use strict";var r;e=o.nmd(e);var n=o(8847)(o(3355));!function(i){var a="object"==(0,n.default)(t)&&t&&!t.nodeType&&t,s="object"==(0,n.default)(e)&&e&&!e.nodeType&&e,c="object"==(void 0===o.g?"undefined":(0,n.default)(o.g))&&o.g;c.global!==c&&c.window!==c&&c.self!==c||(i=c);var u,l,m=2147483647,f=36,d=1,h=26,p=38,g=700,b=72,y=128,v="-",k=/^xn--/,w=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,z={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},j=f-d,M=Math.floor,A=String.fromCharCode;function q(e){throw RangeError(z[e])}function I(e,t){for(var o=e.length,r=[];o--;)r[o]=t(e[o]);return r}function E(e,t){var o=e.split("@"),r="";return o.length>1&&(r=o[0]+"@",e=o[1]),r+I((e=e.replace(x,".")).split("."),t).join(".")}function S(e){for(var t,o,r=[],n=0,i=e.length;n=55296&&t<=56319&&n65535&&(t+=A((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+A(e)})).join("")}function _(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function T(e,t,o){var r=0;for(e=o?M(e/g):e>>1,e+=M(e/t);e>j*h>>1;r+=f)e=M(e/j);return M(r+(j+1)*e/(e+p))}function O(e){var t,o,r,n,i,a,s,c,u,l,p,g=[],k=e.length,w=0,x=y,z=b;for((o=e.lastIndexOf(v))<0&&(o=0),r=0;r=128&&q("not-basic"),g.push(e.charCodeAt(r));for(n=o>0?o+1:0;n=k&&q("invalid-input"),((c=(p=e.charCodeAt(n++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:f)>=f||c>M((m-w)/a))&&q("overflow"),w+=c*a,!(c<(u=s<=z?d:s>=z+h?h:s-z));s+=f)a>M(m/(l=f-u))&&q("overflow"),a*=l;z=T(w-i,t=g.length+1,0==i),M(w/t)>m-x&&q("overflow"),x+=M(w/t),w%=t,g.splice(w++,0,x)}return N(g)}function C(e){var t,o,r,n,i,a,s,c,u,l,p,g,k,w,x,z=[];for(g=(e=S(e)).length,t=y,o=0,i=b,a=0;a=t&&pM((m-o)/(k=r+1))&&q("overflow"),o+=(s-t)*k,t=s,a=0;am&&q("overflow"),p==t){for(c=o,u=f;!(c<(l=u<=i?d:u>=i+h?h:u-i));u+=f)x=c-l,w=f-l,z.push(A(_(l+x%w,0))),c=M(x/w);z.push(A(_(c,0))),i=T(o,k,r==n),o=0,++r}++o,++t}return z.join("")}if(u={version:"1.3.2",ucs2:{decode:S,encode:N},decode:O,encode:C,toASCII:function(e){return E(e,(function(e){return w.test(e)?"xn--"+C(e):e}))},toUnicode:function(e){return E(e,(function(e){return k.test(e)?O(e.slice(4).toLowerCase()):e}))}},"object"==(0,n.default)(o.amdO)&&o.amdO)void 0===(r=function(){return u}.call(t,o,t,e))||(e.exports=r);else if(a&&s)if(e.exports==a)s.exports=u;else for(l in u)u.hasOwnProperty(l)&&(a[l]=u[l]);else i.punycode=u}(void 0)},8983:function(e){"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,o,r,n){o=o||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(o);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var c=e.length;s>0&&c>s&&(c=s);for(var u=0;u=0?(l=h.substr(0,p),m=h.substr(p+1)):(l=h,m=""),f=decodeURIComponent(l),d=decodeURIComponent(m),t(i,f)?Array.isArray(i[f])?i[f].push(d):i[f]=[i[f],d]:i[f]=d}return i}},4031:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=function(e){switch((0,r.default)(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,o,i){return t=t||"&",o=o||"=",null===e&&(e=void 0),"object"===(0,r.default)(e)?Object.keys(e).map((function(r){var i=encodeURIComponent(n(r))+o;return Array.isArray(e[r])?e[r].map((function(e){return i+encodeURIComponent(n(e))})).join(t):i+encodeURIComponent(n(e[r]))})).join(t):i?encodeURIComponent(n(i))+o+encodeURIComponent(n(e)):""}},845:function(e,t,o){"use strict";t.decode=t.parse=o(8983),t.encode=t.stringify=o(4031)},1143:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=o(8677),i=o(5751);function a(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=k,t.resolve=function(e,t){return k(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?k(e,!1,!0).resolveObject(t):t},t.format=function(e){return i.isString(e)&&(e=k(e)),e instanceof a?e.format():a.prototype.format.call(e)},t.Url=a;var s=/^([a-z0-9.+-]+:)/i,c=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),m=["'"].concat(l),f=["%","/","?",";","#"].concat(m),d=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=o(845);function k(e,t,o){if(e&&i.isObject(e)&&e instanceof a)return e;var r=new a;return r.parse(e,t,o),r}a.prototype.parse=function(e,t,o){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(0,r.default)(e));var a=e.indexOf("?"),c=-1!==a&&a127?O+="x":O+=T[C];if(!O.match(h)){var L=N.slice(0,I),P=N.slice(I+1),R=T.match(p);R&&(L.push(R[1]),P.unshift(R[2])),P.length&&(k="/"+P.join(".")+k),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),S||(this.hostname=n.toASCII(this.hostname));var B=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+B,this.href+=this.host,S&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==k[0]&&(k="/"+k))}if(!g[z])for(I=0,_=m.length;I<_;I++){var F=m[I];if(-1!==k.indexOf(F)){var Q=encodeURIComponent(F);Q===F&&(Q=escape(F)),k=k.split(F).join(Q)}}var Y=k.indexOf("#");-1!==Y&&(this.hash=k.substr(Y),k=k.slice(0,Y));var H=k.indexOf("?");if(-1!==H?(this.search=k.substr(H),this.query=k.substr(H+1),t&&(this.query=v.parse(this.query)),k=k.slice(0,H)):t&&(this.search="",this.query={}),k&&(this.pathname=k),y[z]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){B=this.pathname||"";var G=this.search||"";this.path=B+G}return this.href=this.format(),this},a.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",o=this.pathname||"",r=this.hash||"",n=!1,a="";this.host?n=e+this.host:this.hostname&&(n=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=v.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==n?(n="//"+(n||""),o&&"/"!==o.charAt(0)&&(o="/"+o)):n||(n=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),t+n+(o=o.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+r},a.prototype.resolve=function(e){return this.resolveObject(k(e,!1,!0)).format()},a.prototype.resolveObject=function(e){if(i.isString(e)){var t=new a;t.parse(e,!1,!0),e=t}for(var o=new a,r=Object.keys(this),n=0;n0)&&o.host.split("@"))&&(o.auth=E.shift(),o.host=o.hostname=E.shift())),o.search=e.search,o.query=e.query,i.isNull(o.pathname)&&i.isNull(o.search)||(o.path=(o.pathname?o.pathname:"")+(o.search?o.search:"")),o.href=o.format(),o;if(!z.length)return o.pathname=null,o.search?o.path="/"+o.search:o.path=null,o.href=o.format(),o;for(var M=z.slice(-1)[0],A=(o.host||e.host||z.length>1)&&("."===M||".."===M)||""===M,q=0,I=z.length;I>=0;I--)"."===(M=z[I])?z.splice(I,1):".."===M?(z.splice(I,1),q++):q&&(z.splice(I,1),q--);if(!w&&!x)for(;q--;q)z.unshift("..");!w||""===z[0]||z[0]&&"/"===z[0].charAt(0)||z.unshift(""),A&&"/"!==z.join("/").substr(-1)&&z.push("");var E,S=""===z[0]||z[0]&&"/"===z[0].charAt(0);return j&&(o.hostname=o.host=S?"":z.length?z.shift():"",(E=!!(o.host&&o.host.indexOf("@")>0)&&o.host.split("@"))&&(o.auth=E.shift(),o.host=o.hostname=E.shift())),(w=w||o.host&&z.length)&&!S&&z.unshift(""),z.length?o.pathname=z.join("/"):(o.pathname=null,o.path=null),i.isNull(o.pathname)&&i.isNull(o.search)||(o.path=(o.pathname?o.pathname:"")+(o.search?o.search:"")),o.auth=e.auth||o.auth,o.slashes=o.slashes||e.slashes,o.href=o.format(),o},a.prototype.parseHost=function(){var e=this.host,t=c.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},5751:function(e,t,o){"use strict";var r=o(8847)(o(3355));e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"===(0,r.default)(e)&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},8632:function(e,t){"use strict";!function(e){var t,o,r,n=String.fromCharCode;function i(e){for(var t,o,r=[],n=0,i=e.length;n=55296&&t<=56319&&n=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function s(e,t){return n(e>>t&63|128)}function c(e){if(0==(4294967168&e))return n(e);var t="";return 0==(4294965248&e)?t=n(e>>6&31|192):0==(4294901760&e)?(a(e),t=n(e>>12&15|224),t+=s(e,6)):0==(4292870144&e)&&(t=n(e>>18&7|240),t+=s(e,12),t+=s(e,6)),t+n(63&e|128)}function u(){if(r>=o)throw Error("Invalid byte index");var e=255&t[r];if(r++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,n;if(r>o)throw Error("Invalid byte index");if(r==o)return!1;if(e=255&t[r],r++,0==(128&e))return e;if(192==(224&e)){if((n=(31&e)<<6|u())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&e)){if((n=(15&e)<<12|u()<<6|u())>=2048)return a(n),n;throw Error("Invalid continuation byte")}if(240==(248&e)&&(n=(7&e)<<18|u()<<12|u()<<6|u())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=i(e),o=t.length,r=-1,n="";++r65535&&(i+=n((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=n(t);return i}(s)}}(t)},6219:function(e,t,o){"use strict";function r(e){try{if(!o.g.localStorage)return!1}catch(e){return!1}var t=o.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var o=!1;return function(){if(!o){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),o=!0}return e.apply(this,arguments)}}},6248:function(e,t,o){"use strict";var r=o(8847)(o(3355));e.exports=function(e){return e&&"object"===(0,r.default)(e)&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},7092:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=o(9446),i=o(4477),a=o(2337),s=o(8915);function c(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,l="undefined"!=typeof Symbol,m=c(Object.prototype.toString),f=c(Number.prototype.valueOf),d=c(String.prototype.valueOf),h=c(Boolean.prototype.valueOf);if(u)var p=c(BigInt.prototype.valueOf);if(l)var g=c(Symbol.prototype.valueOf);function b(e,t){if("object"!==(0,r.default)(e))return!1;try{return t(e),!0}catch(e){return!1}}function y(e){return"[object Map]"===m(e)}function v(e){return"[object Set]"===m(e)}function k(e){return"[object WeakMap]"===m(e)}function w(e){return"[object WeakSet]"===m(e)}function x(e){return"[object ArrayBuffer]"===m(e)}function z(e){return"undefined"!=typeof ArrayBuffer&&(x.working?x(e):e instanceof ArrayBuffer)}function j(e){return"[object DataView]"===m(e)}function M(e){return"undefined"!=typeof DataView&&(j.working?j(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=s,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"===(0,r.default)(e)&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||M(e)},t.isUint8Array=function(e){return"Uint8Array"===a(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===a(e)},t.isUint16Array=function(e){return"Uint16Array"===a(e)},t.isUint32Array=function(e){return"Uint32Array"===a(e)},t.isInt8Array=function(e){return"Int8Array"===a(e)},t.isInt16Array=function(e){return"Int16Array"===a(e)},t.isInt32Array=function(e){return"Int32Array"===a(e)},t.isFloat32Array=function(e){return"Float32Array"===a(e)},t.isFloat64Array=function(e){return"Float64Array"===a(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===a(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===a(e)},y.working="undefined"!=typeof Map&&y(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(y.working?y(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},k.working="undefined"!=typeof WeakMap&&k(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(k.working?k(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),t.isArrayBuffer=z,j.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&j(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=M;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function q(e){return"[object SharedArrayBuffer]"===m(e)}function I(e){return void 0!==A&&(void 0===q.working&&(q.working=q(new A)),q.working?q(e):e instanceof A)}function E(e){return b(e,f)}function S(e){return b(e,d)}function N(e){return b(e,h)}function _(e){return u&&b(e,p)}function T(e){return l&&b(e,g)}t.isSharedArrayBuffer=I,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===m(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===m(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===m(e)},t.isGeneratorObject=function(e){return"[object Generator]"===m(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===m(e)},t.isNumberObject=E,t.isStringObject=S,t.isBooleanObject=N,t.isBigIntObject=_,t.isSymbolObject=T,t.isBoxedPrimitive=function(e){return E(e)||S(e)||N(e)||_(e)||T(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(z(e)||I(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},5058:function(e,t,o){"use strict";var r=o(9142),n=o(8847)(o(3355)),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),o={},r=0;r=n)return e;switch(e){case"%s":return String(r[o++]);case"%d":return Number(r[o++]);case"%j":try{return JSON.stringify(r[o++])}catch(e){return"[Circular]"}default:return e}})),s=r[o];o=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),b(o)?r.showHidden=o:o&&t._extend(r,o),w(r.showHidden)&&(r.showHidden=!1),w(r.depth)&&(r.depth=2),w(r.colors)&&(r.colors=!1),w(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=m),d(r,e,r.depth)}function m(e,t){var o=l.styles[t];return o?"\x1b["+l.colors[o][0]+"m"+e+"\x1b["+l.colors[o][1]+"m":e}function f(e,t){return e}function d(e,o,r){if(e.customInspect&&o&&A(o.inspect)&&o.inspect!==t.inspect&&(!o.constructor||o.constructor.prototype!==o)){var n=o.inspect(r,e);return k(n)||(n=d(e,n,r)),n}var i=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(k(t)){var o="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(o,"string")}return v(t)?e.stylize(""+t,"number"):b(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}(e,o);if(i)return i;var a=Object.keys(o),s=function(e){var t={};return e.forEach((function(e,o){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(o)),M(o)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(o);if(0===a.length){if(A(o)){var c=o.name?": "+o.name:"";return e.stylize("[Function"+c+"]","special")}if(x(o))return e.stylize(RegExp.prototype.toString.call(o),"regexp");if(j(o))return e.stylize(Date.prototype.toString.call(o),"date");if(M(o))return h(o)}var u,l="",m=!1,f=["{","}"];return g(o)&&(m=!0,f=["[","]"]),A(o)&&(l=" [Function"+(o.name?": "+o.name:"")+"]"),x(o)&&(l=" "+RegExp.prototype.toString.call(o)),j(o)&&(l=" "+Date.prototype.toUTCString.call(o)),M(o)&&(l=" "+h(o)),0!==a.length||m&&0!=o.length?r<0?x(o)?e.stylize(RegExp.prototype.toString.call(o),"regexp"):e.stylize("[Object]","special"):(e.seen.push(o),u=m?function(e,t,o,r,n){for(var i=[],a=0,s=t.length;a60?o[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+o[1]:o[0]+t+" "+e.join(", ")+" "+o[1]}(u,l,f)):f[0]+l+f[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,o,r,n,i){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),S(r,n)||(a="["+n+"]"),s||(e.seen.indexOf(c.value)<0?(s=y(o)?d(e,c.value,null):d(e,c.value,o-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),w(a)){if(i&&n.match(/^\d+$/))return s;(a=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function g(e){return Array.isArray(e)}function b(e){return"boolean"==typeof e}function y(e){return null===e}function v(e){return"number"==typeof e}function k(e){return"string"==typeof e}function w(e){return void 0===e}function x(e){return z(e)&&"[object RegExp]"===q(e)}function z(e){return"object"===(0,n.default)(e)&&null!==e}function j(e){return z(e)&&"[object Date]"===q(e)}function M(e){return z(e)&&("[object Error]"===q(e)||e instanceof Error)}function A(e){return"function"==typeof e}function q(e){return Object.prototype.toString.call(e)}function I(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(c.test(e)){var o=r.pid;s[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,o,r)}}else s[e]=function(){};return s[e]},t.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=o(7092),t.isArray=g,t.isBoolean=b,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=k,t.isSymbol=function(e){return"symbol"===(0,n.default)(e)},t.isUndefined=w,t.isRegExp=x,t.types.isRegExp=x,t.isObject=z,t.isDate=j,t.types.isDate=j,t.isError=M,t.types.isNativeError=M,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===(0,n.default)(e)||void 0===e},t.isBuffer=o(6248);var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,o;console.log("%s - %s",(o=[I((e=new Date).getHours()),I(e.getMinutes()),I(e.getSeconds())].join(":"),[e.getDate(),E[e.getMonth()],o].join(" ")),t.format.apply(t,arguments))},t.inherits=o(1736),t._extend=function(e,t){if(!t||!z(t))return e;for(var o=Object.keys(t),r=o.length;r--;)e[o[r]]=t[o[r]];return e};var N="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function _(e,t){if(!e){var o=new Error("Promise was rejected with a falsy value");o.reason=e,e=o}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(N&&e[N]){var t;if("function"!=typeof(t=e[N]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,N,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,o,r=new Promise((function(e,r){t=e,o=r})),n=[],i=0;i>>9<<4)+1}function r(e,t){var o=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(o>>16)<<16|65535&o}function n(e,t,o,n,i,a){return r((s=r(r(t,e),r(n,a)))<<(c=i)|s>>>32-c,o);var s,c}function i(e,t,o,r,i,a,s){return n(t&o|~t&r,e,t,i,a,s)}function a(e,t,o,r,i,a,s){return n(t&r|o&~r,e,t,i,a,s)}function s(e,t,o,r,i,a,s){return n(t^o^r,e,t,i,a,s)}function c(e,t,o,r,i,a,s){return n(o^(t|~r),e,t,i,a,s)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n>5]>>>n%32&255,a=parseInt(r.charAt(i>>>4&15)+r.charAt(15&i),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<>5]|=(255&e[n/8])<>>24,o[1]=t>>>16&255,o[2]=t>>>8&255,o[3]=255&t,o[4]=(t=parseInt(e.slice(9,13),16))>>>8,o[5]=255&t,o[6]=(t=parseInt(e.slice(14,18),16))>>>8,o[7]=255&t,o[8]=(t=parseInt(e.slice(19,23),16))>>>8,o[9]=255&t,o[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,o[11]=t/4294967296&255,o[12]=t>>>24&255,o[13]=t>>>16&255,o[14]=t>>>8&255,o[15]=255&t,o}},7300:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[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},4402:function(e,t){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!o&&!(o="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(r)};var r=new Uint8Array(16)},2702:function(e,t){"use strict";function o(e,t,o,r){switch(e){case 0:return t&o^~t&r;case 1:case 3:return t^o^r;case 2:return t&o^t&r^o&r}}function r(e,t){return e<>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var i=unescape(encodeURIComponent(e));e=[];for(var a=0;a>>0;w=k,k=v,v=r(y,30)>>>0,y=b,b=j}n[0]=n[0]+b>>>0,n[1]=n[1]+y>>>0,n[2]=n[2]+v>>>0,n[3]=n[3]+k>>>0,n[4]=n[4]+w>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}},2982:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=s;for(var r,n=(r=o(6163))&&r.__esModule?r:{default:r},i=[],a=0;a<256;++a)i.push((a+256).toString(16).slice(1));function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+"-"+i[e[t+4]]+i[e[t+5]]+"-"+i[e[t+6]]+i[e[t+7]]+"-"+i[e[t+8]]+i[e[t+9]]+"-"+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]).toLowerCase()}t.default=function(e){var t=s(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0);if(!(0,n.default)(t))throw TypeError("Stringified UUID is invalid");return t}},5999:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,n,i,a=(r=o(4402))&&r.__esModule?r:{default:r},s=o(2982),c=0,u=0;t.default=function(e,t,o){var r=t&&o||0,l=t||new Array(16),m=(e=e||{}).node||n,f=void 0!==e.clockseq?e.clockseq:i;if(null==m||null==f){var d=e.random||(e.rng||a.default)();null==m&&(m=n=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==f&&(f=i=16383&(d[6]<<8|d[7]))}var h=void 0!==e.msecs?e.msecs:Date.now(),p=void 0!==e.nsecs?e.nsecs:u+1,g=h-c+(p-u)/1e4;if(g<0&&void 0===e.clockseq&&(f=f+1&16383),(g<0||h>c)&&void 0===e.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=h,u=p,i=f;var b=(1e4*(268435455&(h+=122192928e5))+p)%4294967296;l[r++]=b>>>24&255,l[r++]=b>>>16&255,l[r++]=b>>>8&255,l[r++]=255&b;var y=h/4294967296*1e4&268435455;l[r++]=y>>>8&255,l[r++]=255&y,l[r++]=y>>>24&15|16,l[r++]=y>>>16&255,l[r++]=f>>>8|128,l[r++]=255&f;for(var v=0;v<6;++v)l[r+v]=m[v];return t||(0,s.unsafeStringify)(l)}},8231:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(o(6125)),n=i(o(6792));function i(e){return e&&e.__esModule?e:{default:e}}var a=(0,r.default)("v3",48,n.default);t.default=a},6125:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,o){function r(e,r,a,s){var c;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],o=0;o=u)throw e.bytes=0,new RangeError("Could not decode varint");i=r[c++],a+=s<28?(i&o)<=t);return e.bytes=c-n,a};var t=128,o=127},2699:function(e){"use strict";e.exports=function e(n,i,a){i=i||[];for(var s=a=a||0;n>=r;)i[a++]=255&n|t,n/=128;for(;n&o;)i[a++]=255&n|t,n>>>=7;return i[a]=0|n,e.bytes=a-s+1,i};var t=128,o=-128,r=Math.pow(2,31)},6657:function(e,t,o){"use strict";e.exports={encode:o(2699),decode:o(8325),encodingLength:o(7490)}},7490:function(e){"use strict";var t=Math.pow(2,7),o=Math.pow(2,14),r=Math.pow(2,21),n=Math.pow(2,28),i=Math.pow(2,35),a=Math.pow(2,42),s=Math.pow(2,49),c=Math.pow(2,56),u=Math.pow(2,63);e.exports=function(e){return e0&&(m=setTimeout((function(){if(!u){u=!0,l.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",n(e)}}),e.timeout)),l.setRequestHeader)for(s in p)p.hasOwnProperty(s)&&l.setRequestHeader(s,p[s]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(l.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(l),l.send(h||null),l}e.exports=c,e.exports.default=c,c.XMLHttpRequest=r.XMLHttpRequest||function(){},c.XDomainRequest="withCredentials"in new c.XMLHttpRequest?c.XMLHttpRequest:r.XDomainRequest,function(e,t){for(var o=0;o1?(e[o[0]]=e[o[0]]||{},e[o[0]][o[1]]=t):e[o[0]]=t},b.prototype.getCall=function(e){return"function"==typeof this.call?this.call(e):this.call},b.prototype.extractCallback=function(e){if("function"==typeof e[e.length-1])return e.pop()},b.prototype.validateArgs=function(e){if(e.length!==this.params)throw m.InvalidNumberOfParams(e.length,this.params,this.name)},b.prototype.formatInput=function(e){var t=this;return this.inputFormatter?this.inputFormatter.map((function(o,r){return o?o.call(t,e[r]):e[r]})):e},b.prototype.formatOutput=function(e){var t=this;return Array.isArray(e)?e.map((function(e){return t.outputFormatter&&e?t.outputFormatter(e,null==this?void 0:this.hexFormat):e})):this.outputFormatter&&e?this.outputFormatter(e,null==this?void 0:this.hexFormat):e},b.prototype.toPayload=function(e){var t=this.getCall(e),o=this.extractCallback(e),r=this.formatInput(e);this.validateArgs(r);var n={method:t,params:r,callback:o};return this.transformPayload&&(n=this.transformPayload(n)),n},b.prototype._confirmTransaction=function(e,t,o){var r=this,i=!1,a=!0,u=0,l=0,y=null,v=null,k=null,w=o.params[0]&&"object"===(0,c.default)(o.params[0])&&o.params[0].gas?o.params[0].gas:null,x=!!o.params[0]&&"object"===(0,c.default)(o.params[0])&&o.params[0].data&&o.params[0].from&&!o.params[0].to,z=x&&o.params[0].data.length>2,j=[new b({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[f.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:f.outputBlockFormatter}),new b({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:f.outputTransactionReceiptFormatter}),new b({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[f.inputAddressFormatter,f.inputDefaultBlockNumberFormatter]}),new b({name:"getTransactionByHash",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:f.outputTransactionFormatter}),new p({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:f.outputBlockFormatter}}})],M={};j.forEach((function(e){e.attachToObject(M),e.requestManager=r.requestManager}));var A=function(c,p,b,j,A){if(!b)return A||(A={unsubscribe:function(){clearInterval(y),clearTimeout(v)}}),(c?h.resolve(c):M.getTransactionReceipt(t)).catch((function(t){A.unsubscribe(),i=!0,d._fireError({message:"Failed to check for transaction receipt:",data:t},e.eventEmitter,e.reject)})).then(function(){var t=(0,s.default)(n.default.mark((function t(o){var i,s,u;return n.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o&&o.blockHash){t.next=2;break}throw new Error("Receipt missing or blockHash null");case 2:if(r.extraFormatters&&r.extraFormatters.receiptFormatter&&(o=r.extraFormatters.receiptFormatter(o)),!(e.eventEmitter.listeners("confirmation").length>0)){t.next=28;break}if(void 0!==c&&0===l){t.next=25;break}return t.next=7,M.getBlockByNumber("latest");case 7:if(s=t.sent,u=s?s.hash:null,!p){t.next=24;break}if(!k){t.next=17;break}return t.next=13,M.getBlockByNumber(k.number+1);case 13:(i=t.sent)&&(k=i,e.eventEmitter.emit("confirmation",l,o,u)),t.next=22;break;case 17:return t.next=19,M.getBlockByNumber(o.blockNumber);case 19:i=t.sent,k=i,e.eventEmitter.emit("confirmation",l,o,u);case 22:t.next=25;break;case 24:e.eventEmitter.emit("confirmation",l,o,u);case 25:(p&&i||!p)&&l++,a=!1,l===r.transactionConfirmationBlocks+1&&(A.unsubscribe(),e.eventEmitter.removeAllListeners());case 28:return t.abrupt("return",o);case 29:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).then(function(){var t=(0,s.default)(n.default.mark((function t(o){var s;return n.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!x||i){t.next=19;break}if(o.contractAddress){t.next=5;break}return a&&(A.unsubscribe(),i=!0),d._fireError(m.NoContractAddressFoundError(o),e.eventEmitter,e.reject,null,o),t.abrupt("return");case 5:return t.prev=5,t.next=8,M.getCode(o.contractAddress);case 8:s=t.sent,t.next=13;break;case 11:t.prev=11,t.t0=t.catch(5);case 13:if(s){t.next=15;break}return t.abrupt("return");case 15:!0===o.status&&z||s.length>2?(e.eventEmitter.emit("receipt",o),r.extraFormatters&&r.extraFormatters.contractDeployFormatter?e.resolve(r.extraFormatters.contractDeployFormatter(o)):e.resolve(o),a&&e.eventEmitter.removeAllListeners()):d._fireError(m.ContractCodeNotStoredError(o),e.eventEmitter,e.reject,null,o),a&&A.unsubscribe(),i=!0;case 19:return t.abrupt("return",o);case 20:case"end":return t.stop()}}),t,null,[[5,11]])})));return function(e){return t.apply(this,arguments)}}()).then(function(){var t=(0,s.default)(n.default.mark((function t(s){var c,u,l,h;return n.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(x||i){t.next=35;break}if(s.outOfGas||w&&w===s.gasUsed||!0!==s.status&&"0x1"!==s.status&&void 0!==s.status){t.next=7;break}e.eventEmitter.emit("receipt",s),e.resolve(s),a&&e.eventEmitter.removeAllListeners(),t.next=33;break;case 7:if(JSON.stringify(s,null,2),!1!==s.status&&"0x0"!==s.status){t.next=32;break}if(t.prev=9,c=null,!r.handleRevert||"eth_sendTransaction"!==r.call&&"eth_sendRawTransaction"!==r.call){t.next=24;break}return u=o.params[0],"eth_sendRawTransaction"===r.call&&(l=o.params[0],h=g.parse(l),u=f.inputTransactionFormatter({data:h.data,to:h.to,from:h.from,gas:h.gasLimit.toHexString(),gasPrice:h.gasPrice?h.gasPrice.toHexString():void 0,value:h.value.toHexString()})),t.next=16,r.getRevertReason(u,s.blockNumber);case 16:if(!(c=t.sent)){t.next=21;break}d._fireError(m.TransactionRevertInstructionError(c.reason,c.signature,s),e.eventEmitter,e.reject,null,s),t.next=22;break;case 21:throw!1;case 22:t.next=25;break;case 24:throw!1;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(9),d._fireError(m.TransactionRevertedWithoutReasonError(s),e.eventEmitter,e.reject,null,s);case 30:t.next=33;break;case 32:d._fireError(m.TransactionOutOfGasError(s),e.eventEmitter,e.reject,null,s);case 33:a&&A.unsubscribe(),i=!0;case 35:case"end":return t.stop()}}),t,null,[[9,27]])})));return function(e){return t.apply(this,arguments)}}()).catch((function(){u++,p?u-1>=r.transactionPollingTimeout&&(A.unsubscribe(),i=!0,d._fireError(m.TransactionError("Transaction was not mined within "+r.transactionPollingTimeout+" seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject)):u-1>=r.transactionBlockTimeout&&(A.unsubscribe(),i=!0,d._fireError(m.TransactionError("Transaction was not mined within "+r.transactionBlockTimeout+" blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject))}));A.unsubscribe(),i=!0,d._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:b},e.eventEmitter,e.reject)},q=function(e){var t=!1,o=function(){y=setInterval(A.bind(null,e,!0),r.transactionPollingInterval)};if(!this.requestManager.provider.on)return o();M.subscribe("newBlockHeaders",(function(r,n,i){if(t=!0,r||!n)return o();A(e,!1,r,0,i)})),v=setTimeout((function(){t||o()}),1e3*this.blockHeaderTimeout)}.bind(this);M.getTransactionReceipt(t).then((function(t){t&&t.blockHash?(e.eventEmitter.listeners("confirmation").length>0&&q(t),A(t,!1)):i||q()})).catch((function(){i||q()}))};var y=function(e,t){return"number"==typeof e?t.wallet[e]:e&&"object"===(0,c.default)(e)&&e.address&&e.privateKey?e:t.wallet[e.toLowerCase()]};b.prototype.buildCall=function(){var e=this,t="eth_sendTransaction"===e.call||"eth_sendRawTransaction"===e.call,o="eth_call"===e.call,r=function(){var r=Array.prototype.slice.call(arguments),n=h(!t),a=e.toPayload(r);e.hexFormat=!1,"eth_getTransactionReceipt"!==e.call&&"eth_getTransactionByHash"!==e.call&&"getBlock"!==e.name||(e.hexFormat=a.params.length0&&this.subscriptions.forEach((function(o,r){e&&"syncing"===o.name||t.removeSubscription(r)})),this.provider.reset&&this.provider.reset(),!0}catch(e){throw new Error("Error while clearing subscriptions: ".concat(e))}},u.prototype._isCleanCloseEvent=function(e){return"object"===(0,r.default)(e)&&([1e3].includes(e.code)||!0===e.wasClean)},u.prototype._isIpcCloseError=function(e){return"boolean"==typeof e&&e},u.prototype._jsonrpcResultCallback=function(e,t){return function(o,r){return r&&r.id&&t.id!==r.id?e(new Error("Wrong response id ".concat(r.id," (expected: ").concat(t.id,") in ").concat(JSON.stringify(t)))):o?e(o):r&&r.error?e(i.ErrorResponse(r)):a.isValidResponse(r)?void e(null,r.result):e(i.InvalidResponse(r))}},e.exports={Manager:u,BatchManager:s}},8155:function(e){"use strict";var t={messageId:Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),toPayload:function(e,o){if(!e)throw new Error('JSONRPC method should be specified for params: "'+JSON.stringify(o)+'"!');return t.messageId===Number.MAX_SAFE_INTEGER?t.messageId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER):t.messageId++,{jsonrpc:"2.0",id:t.messageId,method:e,params:o||[]}},isValidResponse:function(e){return Array.isArray(e)?e.every(t):t(e);function t(e){return!(!e||e.error||"2.0"!==e.jsonrpc||"number"!=typeof e.id&&"string"!=typeof e.id||void 0===e.result)}},toBatchPayload:function(e){return e.map((function(e){return t.toPayload(e.method,e.params)}))}};e.exports=t},4178:function(e,t,o){"use strict";var r=o(2929),n=function(e){this.name=e.name,this.type=e.type,this.subscriptions=e.subscriptions||{},this.requestManager=null};n.prototype.setRequestManager=function(e){this.requestManager=e},n.prototype.attachToObject=function(e){var t=this.buildCall(),o=this.name.split(".");o.length>1?(e[o[0]]=e[o[0]]||{},e[o[0]][o[1]]=t):e[o[0]]=t},n.prototype.buildCall=function(){var e=this;return function(){e.subscriptions[arguments[0]]||console.warn("Subscription "+JSON.stringify(arguments[0])+" doesn't exist. Subscribing anyway.");var t=new r({subscription:e.subscriptions[arguments[0]]||{},requestManager:e.requestManager,type:e.type});return t.subscribe.apply(t,arguments)}},e.exports={subscriptions:n,subscription:r}},2929:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=o(1314).errors,i=o(8008),a=o(1314).formatters;function s(e){return e}function c(e){i.call(this),this.id=null,this.callback=s,this.arguments=null,this.lastBlock=null,this.options={subscription:e.subscription,type:e.type,requestManager:e.requestManager}}c.prototype=Object.create(i.prototype),c.prototype.constructor=c,c.prototype._extractCallback=function(e){if("function"==typeof e[e.length-1])return e.pop()},c.prototype._validateArgs=function(e){var t=this.options.subscription;if(t||(t={}),t.params||(t.params=0),e.length!==t.params)throw n.InvalidNumberOfParams(e.length,t.params,t.subscriptionName)},c.prototype._formatInput=function(e){var t=this.options.subscription;return t&&t.inputFormatter?t.inputFormatter.map((function(t,o){return t?t(e[o]):e[o]})):e},c.prototype._formatOutput=function(e){var t=this.options.subscription;return t&&t.outputFormatter&&e?t.outputFormatter(e):e},c.prototype._toPayload=function(e){var t=[];if(this.callback=this._extractCallback(e)||s,this.subscriptionMethod||(this.subscriptionMethod=e.shift(),this.options.subscription.subscriptionName&&(this.subscriptionMethod=this.options.subscription.subscriptionName)),this.arguments||(this.arguments=this._formatInput(e),this._validateArgs(this.arguments),e=[]),t.push(this.subscriptionMethod),t=t.concat(this.arguments),e.length)throw new Error("Only a callback is allowed as parameter on an already instantiated subscription.");return{method:this.options.type+"_subscribe",params:t}},c.prototype.unsubscribe=function(e){this.options.requestManager.removeSubscription(this.id,e),this.id=null,this.lastBlock=null,this.removeAllListeners()},c.prototype.subscribe=function(){var e=this,t=Array.prototype.slice.call(arguments),o=this._toPayload(t);if(!o)return this;if(!this.options.requestManager.provider)return setTimeout((function(){var t=new Error("No provider set.");e.callback(t,null,e),e.emit("error",t)}),0),this;if(!this.options.requestManager.provider.on)return setTimeout((function(){var t=new Error("The current provider doesn't support subscriptions: "+e.options.requestManager.provider.constructor.name);e.callback(t,null,e),e.emit("error",t)}),0),this;if(this.lastBlock&&this.options.params&&"object"===(0,r.default)(this.options.params)&&(o.params[1]=this.options.params,o.params[1].fromBlock=a.inputBlockNumberFormatter(this.lastBlock+1)),this.id&&this.unsubscribe(),this.options.params=o.params[1],"logs"===o.params[0]&&o.params[1]&&"object"===(0,r.default)(o.params[1])&&o.params[1].hasOwnProperty("fromBlock")&&isFinite(o.params[1].fromBlock)){var n=Object.assign({},o.params[1]);this.options.requestManager.send({method:"eth_getLogs",params:[n]},(function(t,o){t?setTimeout((function(){e.callback(t,null,e),e.emit("error",t)}),0):o.forEach((function(t){var o=e._formatOutput(t);e.callback(null,o,e),e.emit("data",o)}))}))}return"object"===(0,r.default)(o.params[1])&&delete o.params[1].fromBlock,this.options.requestManager.send(o,(function(t,n){!t&&n?(e.id=n,e.method=o.params[0],e.options.requestManager.addSubscription(e,(function(t,o){t?(e.callback(t,!1,e),e.emit("error",t)):(Array.isArray(o)||(o=[o]),o.forEach((function(t){var o=e._formatOutput(t);if(e.lastBlock=o&&"object"===(0,r.default)(o)?o.blockNumber:null,"function"==typeof e.options.subscription.subscriptionHandler)return e.options.subscription.subscriptionHandler.call(e,o);e.emit("data",o),e.callback(null,o,e)})))})),e.emit("connected",n)):setTimeout((function(){e.callback(t,!1,e),e.emit("error",t)}),0)})),this},c.prototype.resubscribe=function(){this.options.requestManager.removeSubscription(this.id),this.id=null,this.subscribe(this.callback)},e.exports=c},9907:function(e,t,o){"use strict";var r=o(1314).formatters,n=o(3349),i=o(8161);e.exports=function(e){var t=function(t){var o;return t.property?(e[t.property]||(e[t.property]={}),o=e[t.property]):o=e,t.methods&&t.methods.forEach((function(t){t instanceof n||(t=new n(t)),t.attachToObject(o),t.setRequestManager(e._requestManager)})),e};return t.formatters=r,t.utils=i,t.Method=n,t}},606:function(e,t,o){"use strict";var r=o(2033),n=o(9907);e.exports={packageInit:function(e,t){if(t=Array.prototype.slice.call(t),!e)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(e,"currentProvider",{get:function(){return e._provider},set:function(t){return e.setProvider(t)},enumerable:!0,configurable:!0}),t[0]&&t[0]._requestManager?e._requestManager=t[0]._requestManager:e._requestManager=new r.Manager(t[0],t[1]),e.givenProvider=r.Manager.givenProvider,e.providers=r.Manager.providers,e._provider=e._requestManager.provider,e.setProvider||(e.setProvider=function(t,o){return e._requestManager.setProvider(t,o),e._provider=e._requestManager.provider,!0}),e.setRequestManager=function(t){e._requestManager=t,e._provider=t.provider},e.BatchRequest=r.BatchManager.bind(null,e._requestManager),e.extend=n(e)},addProviders:function(e){e.givenProvider=r.Manager.givenProvider,e.providers=r.Manager.providers}}},9901:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=o(9033).Buffer,i=o(8161),a=o(2914).RQ,s=o(2914)._R,c=new a((function(e,t){return!e.match(/^u?int/)||Array.isArray(t)||t&&"object"===(0,r.default)(t)&&"BN"===t.constructor.name?t:t.toString()}));function u(){}var l=function(){};l.prototype.encodeFunctionSignature=function(e){return("function"==typeof e||"object"===(0,r.default)(e)&&e)&&(e=i._jsonInterfaceMethodToString(e)),i.sha3(e).slice(0,10)},l.prototype.encodeEventSignature=function(e){return("function"==typeof e||"object"===(0,r.default)(e)&&e)&&(e=i._jsonInterfaceMethodToString(e)),i.sha3(e)},l.prototype.encodeParameter=function(e,t){return this.encodeParameters([e],[t])},l.prototype.encodeParameters=function(e,t){var o=this;return e=o.mapTypes(e),t=t.map((function(t,n){var i=e[n];return"object"===(0,r.default)(i)&&i.type&&(i=i.type),t=o.formatParam(i,t),"string"==typeof i&&i.includes("tuple")&&function e(t,r){if("array"===t.name){if(!t.type.match(/\[(\d+)\]/))return r.map((function(o){return e(c._getCoder(s.from(t.type.replace("[]",""))),o)}));var n=parseInt(t.type.match(/\[(\d+)\]/)[1]);if(r.length!==n)throw new Error("Array length does not matches with the given input");return r.map((function(o){return e(c._getCoder(s.from(t.type.replace(/\[\d+\]/,""))),o)}))}t.coders.forEach((function(t,n){"tuple"===t.name?e(t,r[n]):r[n]=o.formatParam(t.name,r[n])}))}(c._getCoder(s.from(i)),t),t})),c.encode(e,t)},l.prototype.mapTypes=function(e){var t=this,o=[];return e.forEach((function(e){if("object"===(0,r.default)(e)&&"function"===e.type&&(e=Object.assign({},e,{type:"bytes24"})),t.isSimplifiedStructFormat(e)){var n=Object.keys(e)[0];o.push(Object.assign(t.mapStructNameAndType(n),{components:t.mapStructToCoderFormat(e[n])}))}else o.push(e)})),o},l.prototype.isSimplifiedStructFormat=function(e){return"object"===(0,r.default)(e)&&void 0===e.components&&void 0===e.name},l.prototype.mapStructNameAndType=function(e){var t="tuple";return e.indexOf("[]")>-1&&(t="tuple[]",e=e.slice(0,-2)),{type:t,name:e}},l.prototype.mapStructToCoderFormat=function(e){var t=this,o=[];return Object.keys(e).forEach((function(n){"object"!==(0,r.default)(e[n])?o.push({name:n,type:e[n]}):o.push(Object.assign(t.mapStructNameAndType(n),{components:t.mapStructToCoderFormat(e[n])}))})),o},l.prototype.formatParam=function(e,t){var o=this,r=new RegExp(/^bytes([0-9]*)$/),a=new RegExp(/^bytes([0-9]*)\[\]$/),s=new RegExp(/^(u?int)([0-9]*)$/),c=new RegExp(/^(u?int)([0-9]*)\[\]$/);if(i.isBN(t)||i.isBigNumber(t))return t.toString(10);if(e.match(a)||e.match(c))return t.map((function(t){return o.formatParam(e.replace("[]",""),t)}));var u=e.match(s);if(u){var l=parseInt(u[2]||"256");l/80&&(!t||"0x"===t||"0X"===t))throw new Error("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");var n=c.decode(this.mapTypes(e),"0x"+t.replace(/0x/i,""),o),i=new u;return i.__length__=0,e.forEach((function(e,t){var o=n[i.__length__],a="object"===(0,r.default)(e)&&e.type&&"string"===e.type;o="0x"!==o||a||"string"==typeof e&&"string"===e?o:null,i[t]=o,("function"==typeof e||e&&"object"===(0,r.default)(e))&&e.name&&(i[e.name]=o),i.__length__++})),i},l.prototype.decodeLog=function(e,t,o){var r=this;o=Array.isArray(o)?o:[o],t=t||"";var n=[],i=[],a=0;e.forEach((function(e,t){e.indexed?(i[t]=["bool","int","uint","address","fixed","ufixed"].find((function(t){return-1!==e.type.indexOf(t)}))?r.decodeParameter(e.type,o[a]):o[a],a++):n[t]=e}));var s=t,c=s?this.decodeParametersWith(n,s,!0):[],l=new u;return l.__length__=0,e.forEach((function(e,t){l[t]="string"===e.type?"":null,void 0!==c[t]&&(l[t]=c[t]),void 0!==i[t]&&(l[t]=i[t]),e.name&&(l[e.name]=l[t]),l.__length__++})),l};var m=new l;e.exports=m},9819:function(e,t,o){"use strict";var r=o(9033).Buffer,n=o(8847),i=n(o(3106)),a=n(o(3355)),s=n(o(775)),c=n(o(4519));function u(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function l(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,r=new Array(t);o0){var l,f="Signer Error: ",d=function(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,t){if(e){if("string"==typeof e)return m(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?m(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){o&&(e=o);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==o.return||o.return()}finally{if(s)throw i}}}}(u);try{for(d.s();!(l=d.n()).done;){var h=l.value;f+="".concat(f," ").concat(h,".")}}catch(e){d.e(e)}finally{d.f()}throw new Error(f)}var p="0x"+c.serialize().toString("hex"),g=y.keccak256(p),b={messageHash:"0x"+r.from(c.getMessageToSign(!0)).toString("hex"),v:"0x"+c.v.toString("hex"),r:"0x"+c.r.toString("hex"),s:"0x"+c.s.toString("hex"),rawTransaction:p,transactionHash:g};return o(null,b),b}catch(e){return o(e),Promise.reject(e)}}return e.type=function(e){var t,o=void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas;if(void 0!==e.type?t=y.toHex(e.type):void 0===e.type&&o&&(t="0x2"),void 0!==e.gasPrice&&("0x2"===t||o))throw Error("eip-1559 transactions don't support gasPrice");if(("0x1"===t||"0x0"===t)&&o)throw Error("pre-eip-1559 transaction don't support maxFeePerGas/maxPriorityFeePerGas");return o||e.common&&e.common.hardfork&&e.common.hardfork.toLowerCase()===x.London||e.hardfork&&e.hardfork.toLowerCase()===x.London?t="0x2":(e.accessList||e.common&&e.common.hardfork&&e.common.hardfork.toLowerCase()===x.Berlin||e.hardfork&&e.hardfork.toLowerCase()===x.Berlin)&&(t="0x1"),t}(e),void 0!==e.nonce&&void 0!==e.chainId&&(void 0!==e.gasPrice||void 0!==e.maxFeePerGas&&void 0!==e.maxPriorityFeePerGas)&&s?Promise.resolve(u(e)):Promise.all([j(e.common)||j(e.common.customChain.chainId)?j(e.chainId)?n._ethereumCall.getChainId():e.chainId:void 0,j(e.nonce)?n._ethereumCall.getTransactionCount(n.privateKeyToAccount(t).address):e.nonce,j(s)?n._ethereumCall.getNetworkId():1,q(n,e)]).then((function(t){var o=(0,c.default)(t,4),r=o[0],n=o[1],i=o[2],a=o[3];if(j(r)&&j(e.common)&&j(e.common.customChain.chainId)||j(n)||j(i)||j(a))throw new Error('One of the values "chainId", "networkId", "gasPrice", or "nonce" couldn\'t be fetched: '+JSON.stringify(t));return u(l(l(l({},e),j(e.common)||j(e.common.customChain.chainId)?{chainId:r}:{}),{},{nonce:n,networkId:i},a))}))},A.prototype.recoverTransaction=function(e){var t=r.from(e.slice(2),"hex"),o=k.fromSerializedData(t);return y.toChecksumAddress(o.getSenderAddress().toString("hex"))},A.prototype.hashMessage=function(e){var t=y.isHexStrict(e)?e:y.utf8ToHex(e),o=y.hexToBytes(t),n=r.from(o),i="\x19Ethereum Signed Message:\n"+o.length,a=r.from(i),s=r.concat([a,n]);return z.bufferToHex(z.keccak256(s))},A.prototype.sign=function(e,t){if(t.startsWith("0x")||(t="0x"+t),66!==t.length)throw new Error("Private key must be 32 bytes long");var o=this.hashMessage(e),r=h.sign(o,t),n=h.decodeSignature(r);return{message:e,messageHash:o,v:n[0],r:n[1],s:n[2],signature:r}},A.prototype.recover=function(e,t,o){var r=[].slice.apply(arguments);return e&&"object"===(0,a.default)(e)?this.recover(e.messageHash,h.encodeSignature([e.v,e.r,e.s]),!0):(o||(e=this.hashMessage(e)),r.length>=4?(o="boolean"==typeof(o=r.slice(-1)[0])&&!!o,this.recover(e,h.encodeSignature(r.slice(1,4)),o)):h.recover(e,t))},A.prototype.decrypt=function(e,t,o){if("string"!=typeof t)throw new Error("No password given.");var n,s,c=e&&"object"===(0,a.default)(e)?e:JSON.parse(o?e.toLowerCase():e);if(3!==c.version)throw new Error("Not a valid V3 wallet");if("scrypt"===c.crypto.kdf)s=c.crypto.kdfparams,n=g.syncScrypt(r.from(t),r.from(s.salt,"hex"),s.n,s.r,s.p,s.dklen);else{if("pbkdf2"!==c.crypto.kdf)throw new Error("Unsupported key derivation scheme");if("hmac-sha256"!==(s=c.crypto.kdfparams).prf)throw new Error("Unsupported parameters to PBKDF2");n=p.pbkdf2Sync(r.from(t),r.from(s.salt,"hex"),s.c,s.dklen,"sha256")}var u=r.from(c.crypto.ciphertext,"hex");if(y.sha3(r.from([].concat((0,i.default)(n.slice(16,32)),(0,i.default)(u)))).replace("0x","")!==c.crypto.mac)throw new Error("Key derivation failed - possibly wrong password");var l=p.createDecipheriv(c.crypto.cipher,n.slice(0,16),r.from(c.crypto.cipherparams.iv,"hex")),m="0x"+r.from([].concat((0,i.default)(l.update(u)),(0,i.default)(l.final()))).toString("hex");return this.privateKeyToAccount(m,!0)},A.prototype.encrypt=function(e,t,o){var n,a=this.privateKeyToAccount(e,!0),s=(o=o||{}).salt||p.randomBytes(32),c=o.iv||p.randomBytes(16),u=o.kdf||"scrypt",l={dklen:o.dklen||32,salt:s.toString("hex")};if("pbkdf2"===u)l.c=o.c||262144,l.prf="hmac-sha256",n=p.pbkdf2Sync(r.from(t),r.from(l.salt,"hex"),l.c,l.dklen,"sha256");else{if("scrypt"!==u)throw new Error("Unsupported kdf");l.n=o.n||8192,l.r=o.r||8,l.p=o.p||1,n=g.syncScrypt(r.from(t),r.from(l.salt,"hex"),l.n,l.r,l.p,l.dklen)}var m=p.createCipheriv(o.cipher||"aes-128-ctr",n.slice(0,16),c);if(!m)throw new Error("Unsupported cipher");var f=r.from([].concat((0,i.default)(m.update(r.from(a.privateKey.replace("0x",""),"hex"))),(0,i.default)(m.final()))),d=y.sha3(r.from([].concat((0,i.default)(n.slice(16,32)),(0,i.default)(f)))).replace("0x","");return{version:3,id:b.v4({random:o.uuid||p.randomBytes(16)}),address:a.address.toLowerCase().replace("0x",""),crypto:{ciphertext:f.toString("hex"),cipherparams:{iv:c.toString("hex")},cipher:o.cipher||"aes-128-ctr",kdf:u,kdfparams:l,mac:d.toString("hex")}}},I.prototype._findSafeIndex=function(e){return e=e||0,this.hasOwnProperty(e)?this._findSafeIndex(e+1):e},I.prototype._currentIndexes=function(){return Object.keys(this).map((function(e){return parseInt(e)})).filter((function(e){return e<9e20}))},I.prototype.create=function(e,t){for(var o=0;oe.length)&&(t=e.length);for(var o=0,r=new Array(t);o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==o.return||o.return()}finally{if(c)throw i}}}}(e.inputs);try{var u=function(){var e=a.value;if(!e.indexed)return"continue";var t=o[e.name];if(!t)return i.push(null),"continue";Array.isArray(t)?i.push(t.map((function(t){return b.encodeParameter(e.type,t)}))):i.push(b.encodeParameter(e.type,t))};for(c.s();!(a=c.n()).done;)u()}catch(e){c.e(e)}finally{c.f()}}return i.length&&(r.topics=i),this.options.address&&(r.address=this.options.address.toLowerCase()),r},y.prototype._decodeEventABI=function(e){var t=this;e.data=e.data||"",e.topics=e.topics||[];var o=h.outputLogFormatter(e);if("ALLEVENTS"===t.name&&(t=t.jsonInterface.find((function(t){return t.signature===e.topics[0]}))||{anonymous:!0}),t.inputs=t.inputs||[],!t.anonymous){var r=0;t.inputs.forEach((function(e){return e.indexed?r++:null})),r>0&&e.topics.length!==r+1&&(t={anonymous:!0,inputs:[]})}var n=t.anonymous?e.topics:e.topics.slice(1);return o.returnValues=b.decodeLog(t.inputs,e.data,n),delete o.returnValues.__length__,o.event=t.name,o.signature=t.anonymous||!e.topics[0]?null:e.topics[0],o.raw={data:o.data,topics:o.topics},delete o.data,delete o.topics,o},y.prototype._encodeMethodABI=function(){var e=this._method.signature,t=this.arguments||[],o=!1,r=this._parent.options.jsonInterface.filter((function(t){return"constructor"===e&&t.type===e||(t.signature===e||t.signature===e.replace("0x","")||t.name===e)&&"function"===t.type})).map((function(e){var r=Array.isArray(e.inputs)?e.inputs.length:0;if(r!==t.length)throw new Error("The number of arguments is not matching the methods required number. You need to pass "+r+" arguments.");return"function"===e.type&&(o=e.signature),Array.isArray(e.inputs)?e.inputs:[]})).map((function(e){return b.encodeParameters(e,t).replace("0x","")}))[0]||"";if("constructor"===e){if(!this._deployData)throw new Error("The contract has no contract data option set. This is necessary to append the constructor parameters.");return this._deployData.startsWith("0x")||(this._deployData="0x"+this._deployData),this._deployData+r}var n=o?o+r:r;if(!n)throw new Error("Couldn't find a matching contract method named \""+this._method.name+'".');return n},y.prototype._decodeMethodReturn=function(e,t){if(!t)return null;t=t.length>=2?t.slice(2):t;var o=b.decodeParameters(e,t);return 1===o.__length__?o[0]:(delete o.__length__,o)},y.prototype.deploy=function(e,t){if((e=e||{}).arguments=e.arguments||[],!(e=this._getOrSetDefaultOptions(e)).data){if("function"==typeof t)return t(p.ContractMissingDeployDataError());throw p.ContractMissingDeployDataError()}var o=this.options.jsonInterface.find((function(e){return"constructor"===e.type}))||{};return o.signature="constructor",this._createTxObject.apply({method:o,parent:this,deployData:e.data,_ethAccounts:this.constructor._ethAccounts},e.arguments)},y.prototype._generateEventOptions=function(){var e=Array.prototype.slice.call(arguments),t=this._getCallback(e),o="object"===(!!e[e.length-1]&&(0,a.default)(e[e.length-1]))?e.pop():{},r="string"==typeof e[0]?e[0]:"allevents",n="allevents"===r.toLowerCase()?{name:"ALLEVENTS",jsonInterface:this.options.jsonInterface}:this.options.jsonInterface.find((function(e){return"event"===e.type&&(e.name===r||e.signature==="0x"+r.replace("0x",""))}));if(!n)throw p.ContractEventDoesNotExistError(r);if(!f.isAddress(this.options.address))throw p.ContractNoAddressDefinedError();return{params:this._encodeEventABI(n,o),event:n,filter:o.filter||{},callback:t}},y.prototype.clone=function(){return new this.constructor(this.options.jsonInterface,this.options.address,this.options)},y.prototype.once=function(e,t,o){var r=Array.prototype.slice.call(arguments);if(!(o=this._getCallback(r)))throw p.ContractOnceRequiresCallbackError();t&&delete t.fromBlock,this._on(e,t,(function(e,t,r){r.unsubscribe(),"function"==typeof o&&o(e,t,r)}))},y.prototype._on=function(){var e=this._generateEventOptions.apply(this,arguments);e.params&&e.params.toBlock&&(delete e.params.toBlock,console.warn("Invalid option: toBlock. Use getPastEvents for specific range.")),this._checkListener("newListener",e.event.name),this._checkListener("removeListener",e.event.name);var t=new d({subscription:{params:1,inputFormatter:[h.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(e.event),subscriptionHandler:function(e){e.removed?this.emit("changed",e):this.emit("data",e),"function"==typeof this.callback&&this.callback(null,e,this)}},type:"eth",requestManager:this._requestManager});return t.subscribe("logs",e.params,e.callback||function(){}),t};var v=function(e,t){if(e.event&&"ALLEVENTS"===e.event.name&&Array.isArray(t)){var o=e.filter||{},r=Object.keys(o);return r.length>0?t.filter((function(e){return"string"==typeof e||r.every((function(t){return Array.isArray(o[t])?o[t].some((function(o){return String(e.returnValues[t]).toUpperCase()===String(o).toUpperCase()})):String(e.returnValues[t]).toUpperCase()===String(o[t]).toUpperCase()}))})):t}return t};y.prototype.getPastEvents=function(){var e=this._generateEventOptions.apply(this,arguments),t=new m({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[h.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(e.event)});t.setRequestManager(this._requestManager);var o=t.buildCall();return t=null,o(e.params,(function(t,o){"function"==typeof e.callback&&e.callback(t,v(e,o))})).then(v.bind(this,e))},y.prototype._createTxObject=function(){var e=Array.prototype.slice.call(arguments),t={};if("function"===this.method.type&&(t.call=this.parent._executeMethod.bind(t,"call"),t.call.request=this.parent._executeMethod.bind(t,"call",!0)),t.send=this.parent._executeMethod.bind(t,"send"),t.send.request=this.parent._executeMethod.bind(t,"send",!0),t.encodeABI=this.parent._encodeMethodABI.bind(t),t.estimateGas=this.parent._executeMethod.bind(t,"estimate"),t.createAccessList=this.parent._executeMethod.bind(t,"createAccessList"),e&&this.method.inputs&&e.length!==this.method.inputs.length){if(this.nextMethod)return this.nextMethod.apply(null,e);throw p.InvalidNumberOfParams(e.length,this.method.inputs.length,this.method.name)}return t.arguments=e||[],t._method=this.method,t._parent=this.parent,t._ethAccounts=this.parent.constructor._ethAccounts||this._ethAccounts,this.deployData&&(t._deployData=this.deployData),t},y.prototype._processExecuteArguments=function(e,t){var o={};if(o.type=e.shift(),o.callback=this._parent._getCallback(e),"call"!==o.type||!0===e[e.length-1]||"string"!=typeof e[e.length-1]&&!isFinite(e[e.length-1])||(o.defaultBlock=e.pop()),o.options="object"===(!!e[e.length-1]&&(0,a.default)(e[e.length-1]))?e.pop():{},o.generateRequest=!0===e[e.length-1]&&e.pop(),o.options=this._parent._getOrSetDefaultOptions(o.options),o.options.data=this.encodeABI(),!this._deployData&&!f.isAddress(this._parent.options.address))throw p.ContractNoAddressDefinedError();return this._deployData||(o.options.to=this._parent.options.address),o.options.data?o:f._fireError(new Error("Couldn't find a matching contract method, or the number of parameters is wrong."),t.eventEmitter,t.reject,o.callback)},y.prototype._executeMethod=function(){var e=this,t=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),o),o=g("send"!==t.type),r=e.constructor._ethAccounts||e._ethAccounts;if(t.generateRequest){var n={params:[h.inputCallFormatter.call(this._parent,t.options)],callback:t.callback};return"call"===t.type?(n.params.push(h.inputDefaultBlockNumberFormatter.call(this._parent,t.defaultBlock)),n.method="eth_call",n.format=this._parent._decodeMethodReturn.bind(null,this._method.outputs)):n.method="eth_sendTransaction",n}switch(t.type){case"createAccessList":return f.isAddress(t.options.from)?new m({name:"createAccessList",call:"eth_createAccessList",params:2,inputFormatter:[h.inputTransactionFormatter,h.inputDefaultBlockNumberFormatter],requestManager:e._parent._requestManager,accounts:r,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock}).createFunction()(t.options,t.callback):f._fireError(p.ContractNoFromAddressDefinedError(),o.eventEmitter,o.reject,t.callback);case"estimate":return new m({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[h.inputCallFormatter],outputFormatter:f.hexToNumber,requestManager:e._parent._requestManager,accounts:r,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock}).createFunction()(t.options,t.callback);case"call":return new m({name:"call",call:"eth_call",params:2,inputFormatter:[h.inputCallFormatter,h.inputDefaultBlockNumberFormatter],outputFormatter:function(t){return e._parent._decodeMethodReturn(e._method.outputs,t)},requestManager:e._parent._requestManager,accounts:r,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock,handleRevert:e._parent.handleRevert,abiCoder:b}).createFunction()(t.options,t.defaultBlock,t.callback);case"send":if(!f.isAddress(t.options.from))return f._fireError(p.ContractNoFromAddressDefinedError(),o.eventEmitter,o.reject,t.callback);if("boolean"==typeof this._method.payable&&!this._method.payable&&t.options.value&&t.options.value>0)return f._fireError(new Error("Can not send value to non-payable contract method or constructor"),o.eventEmitter,o.reject,t.callback);var i={receiptFormatter:function(t){if(Array.isArray(t.logs)){var o=t.logs.map((function(t){return e._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:e._parent.options.jsonInterface},t)}));t.events={};var r=0;o.forEach((function(e){e.event?t.events[e.event]?Array.isArray(t.events[e.event])?t.events[e.event].push(e):t.events[e.event]=[t.events[e.event],e]:t.events[e.event]=e:(t.events[r]=e,r++)})),delete t.logs}return t},contractDeployFormatter:function(t){var o=e._parent.clone();return o.options.address=t.contractAddress,o}};return new m({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[h.inputTransactionFormatter],requestManager:e._parent._requestManager,accounts:e.constructor._ethAccounts||e._ethAccounts,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock,transactionBlockTimeout:e._parent.transactionBlockTimeout,transactionConfirmationBlocks:e._parent.transactionConfirmationBlocks,transactionPollingTimeout:e._parent.transactionPollingTimeout,transactionPollingInterval:e._parent.transactionPollingInterval,defaultCommon:e._parent.defaultCommon,defaultChain:e._parent.defaultChain,defaultHardfork:e._parent.defaultHardfork,handleRevert:e._parent.handleRevert,extraFormatters:i,abiCoder:b}).createFunction()(t.options,t.callback);default:throw new Error('Method "'+t.type+'" not implemented.')}},e.exports=y},6764:function(e,t,o){"use strict";var r=o(8847),n=r(o(2247)),i=r(o(5698)),a=o(5160),s=o(1314).formatters,c=o(8161),u=o(1841),l=o(2867),m=o(2689);function f(e){this.eth=e;var t=null;this._detectedAddress=null,this._lastSyncCheck=null,Object.defineProperty(this,"registry",{get:function(){return new u(this)},enumerable:!0}),Object.defineProperty(this,"resolverMethodHandler",{get:function(){return new l(this.registry)},enumerable:!0}),Object.defineProperty(this,"registryAddress",{get:function(){return t},set:function(e){t=null!==e?s.inputAddressFormatter(e):e},enumerable:!0})}f.prototype.supportsInterface=function(e,t,o){return this.getResolver(e).then((function(e){return c.isHexStrict(t)||(t=c.sha3(t).slice(0,10)),e.methods.supportsInterface(t).call(o)})).catch((function(e){if("function"!=typeof o)throw e;o(e,null)}))},f.prototype.resolver=function(e,t){return this.registry.resolver(e,t)},f.prototype.getResolver=function(e,t){return this.registry.getResolver(e,t)},f.prototype.setResolver=function(e,t,o,r){return this.registry.setResolver(e,t,o,r)},f.prototype.setRecord=function(e,t,o,r,n,i){return this.registry.setRecord(e,t,o,r,n,i)},f.prototype.setSubnodeRecord=function(e,t,o,r,n,i,a){return this.registry.setSubnodeRecord(e,t,o,r,n,i,a)},f.prototype.setApprovalForAll=function(e,t,o,r){return this.registry.setApprovalForAll(e,t,o,r)},f.prototype.isApprovedForAll=function(e,t,o){return this.registry.isApprovedForAll(e,t,o)},f.prototype.recordExists=function(e,t){return this.registry.recordExists(e,t)},f.prototype.setSubnodeOwner=function(e,t,o,r,n){return this.registry.setSubnodeOwner(e,t,o,r,n)},f.prototype.getTTL=function(e,t){return this.registry.getTTL(e,t)},f.prototype.setTTL=function(e,t,o,r){return this.registry.setTTL(e,t,o,r)},f.prototype.getOwner=function(e,t){return this.registry.getOwner(e,t)},f.prototype.setOwner=function(e,t,o,r){return this.registry.setOwner(e,t,o,r)},f.prototype.getAddress=function(e,t){return this.resolverMethodHandler.method(e,"addr",[]).call(t)},f.prototype.setAddress=function(e,t,o,r){return this.resolverMethodHandler.method(e,"setAddr",[t]).send(o,r)},f.prototype.getPubkey=function(e,t){return this.resolverMethodHandler.method(e,"pubkey",[],null,t).call(t)},f.prototype.setPubkey=function(e,t,o,r,n){return this.resolverMethodHandler.method(e,"setPubkey",[t,o]).send(r,n)},f.prototype.getContent=function(e,t){return this.resolverMethodHandler.method(e,"content",[]).call(t)},f.prototype.setContent=function(e,t,o,r){return this.resolverMethodHandler.method(e,"setContent",[t]).send(o,r)},f.prototype.getContenthash=function(e,t){return this.resolverMethodHandler.method(e,"contenthash",[],m.decode).call(t)},f.prototype.setContenthash=function(e,t,o,r){var n;try{n=m.encode(t)}catch(e){var i=new Error("Could not encode "+t+". See docs for supported hash protocols.");if("function"==typeof r)return void r(i,null);throw i}return this.resolverMethodHandler.method(e,"setContenthash",[n]).send(o,r)},f.prototype.getMultihash=function(e,t){return this.resolverMethodHandler.method(e,"multihash",[]).call(t)},f.prototype.setMultihash=function(e,t,o,r){return this.resolverMethodHandler.method(e,"multihash",[t]).send(o,r)},f.prototype.checkNetwork=(0,i.default)(n.default.mark((function e(){var t,o,r,i,s;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=new Date/1e3,this._lastSyncCheck&&!(t-this._lastSyncCheck>3600)){e.next=9;break}return e.next=4,this.eth.getBlock("latest");case 4:if(o=e.sent,!((r=t-o.timestamp)>3600)){e.next=8;break}throw new Error("Network not synced; last block was "+r+" seconds ago");case 8:this._lastSyncCheck=t;case 9:if(!this.registryAddress){e.next=11;break}return e.abrupt("return",this.registryAddress);case 11:if(this._detectedAddress){e.next=20;break}return e.next=14,this.eth.net.getNetworkType();case 14:if(i=e.sent,void 0!==(s=a.addresses[i])){e.next=18;break}throw new Error("ENS is not supported on network "+i);case 18:return this._detectedAddress=s,e.abrupt("return",this._detectedAddress);case 20:return e.abrupt("return",this._detectedAddress);case 21:case"end":return e.stop()}}),e,this)}))),e.exports=f},5160:function(e){"use strict";e.exports={addresses:{main:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",ropsten:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",rinkeby:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",goerli:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},interfaceIds:{addr:"0x3b3b57de",setAddr:"0x3b3b57de",pubkey:"0xc8690233",setPubkey:"0xc8690233",contenthash:"0xbc1c58d1",setContenthash:"0xbc1c58d1",content:"0xd8389dc5",setContent:"0xd8389dc5"}}},1841:function(e,t,o){"use strict";var r=o(8164),n=o(1006),i=o(282),a=o(1314).formatters,s=o(8161),c=o(3205),u=o(8384);function l(e){var t=this;this.ens=e,this.contract=e.checkNetwork().then((function(e){var o=new r(c,e);return o.setProvider(t.ens.eth.currentProvider),o}))}l.prototype.owner=function(e,t){return console.warn('Deprecated: Please use the "getOwner" method instead of "owner".'),this.getOwner(e,t)},l.prototype.getOwner=function(e,t){var o=new i(!0);return this.contract.then((function(t){return t.methods.owner(n.hash(e)).call()})).then((function(e){"function"!=typeof t?o.resolve(e):t(e,e)})).catch((function(e){"function"!=typeof t?o.reject(e):t(e,null)})),o.eventEmitter},l.prototype.setOwner=function(e,t,o,r){var s=new i(!0);return this.contract.then((function(r){return r.methods.setOwner(n.hash(e),a.inputAddressFormatter(t)).send(o)})).then((function(e){"function"!=typeof r?s.resolve(e):r(e,e)})).catch((function(e){"function"!=typeof r?s.reject(e):r(e,null)})),s.eventEmitter},l.prototype.getTTL=function(e,t){var o=new i(!0);return this.contract.then((function(t){return t.methods.ttl(n.hash(e)).call()})).then((function(e){"function"!=typeof t?o.resolve(e):t(e,e)})).catch((function(e){"function"!=typeof t?o.reject(e):t(e,null)})),o.eventEmitter},l.prototype.setTTL=function(e,t,o,r){var a=new i(!0);return this.contract.then((function(r){return r.methods.setTTL(n.hash(e),t).send(o)})).then((function(e){"function"!=typeof r?a.resolve(e):r(e,e)})).catch((function(e){"function"!=typeof r?a.reject(e):r(e,null)})),a.eventEmitter},l.prototype.setSubnodeOwner=function(e,t,o,r,c){var u=new i(!0);return s.isHexStrict(t)||(t=s.sha3(t)),this.contract.then((function(i){return i.methods.setSubnodeOwner(n.hash(e),t,a.inputAddressFormatter(o)).send(r)})).then((function(e){"function"!=typeof c?u.resolve(e):c(e,e)})).catch((function(e){"function"!=typeof c?u.reject(e):c(e,null)})),u.eventEmitter},l.prototype.setRecord=function(e,t,o,r,s,c){var u=new i(!0);return this.contract.then((function(i){return i.methods.setRecord(n.hash(e),a.inputAddressFormatter(t),a.inputAddressFormatter(o),r).send(s)})).then((function(e){"function"!=typeof c?u.resolve(e):c(e,e)})).catch((function(e){"function"!=typeof c?u.reject(e):c(e,null)})),u.eventEmitter},l.prototype.setSubnodeRecord=function(e,t,o,r,c,u,l){var m=new i(!0);return s.isHexStrict(t)||(t=s.sha3(t)),this.contract.then((function(i){return i.methods.setSubnodeRecord(n.hash(e),t,a.inputAddressFormatter(o),a.inputAddressFormatter(r),c).send(u)})).then((function(e){"function"!=typeof l?m.resolve(e):l(e,e)})).catch((function(e){"function"!=typeof l?m.reject(e):l(e,null)})),m.eventEmitter},l.prototype.setApprovalForAll=function(e,t,o,r){var n=new i(!0);return this.contract.then((function(r){return r.methods.setApprovalForAll(a.inputAddressFormatter(e),t).send(o)})).then((function(e){"function"!=typeof r?n.resolve(e):r(e,e)})).catch((function(e){"function"!=typeof r?n.reject(e):r(e,null)})),n.eventEmitter},l.prototype.isApprovedForAll=function(e,t,o){var r=new i(!0);return this.contract.then((function(o){return o.methods.isApprovedForAll(a.inputAddressFormatter(e),a.inputAddressFormatter(t)).call()})).then((function(e){"function"!=typeof o?r.resolve(e):o(e,e)})).catch((function(e){"function"!=typeof o?r.reject(e):o(e,null)})),r.eventEmitter},l.prototype.recordExists=function(e,t){var o=new i(!0);return this.contract.then((function(t){return t.methods.recordExists(n.hash(e)).call()})).then((function(e){"function"!=typeof t?o.resolve(e):t(e,e)})).catch((function(e){"function"!=typeof t?o.reject(e):t(e,null)})),o.eventEmitter},l.prototype.resolver=function(e,t){return console.warn('Deprecated: Please use the "getResolver" method instead of "resolver".'),this.getResolver(e,t)},l.prototype.getResolver=function(e,t){var o=this;return this.contract.then((function(t){return t.methods.resolver(n.hash(e)).call()})).then((function(e){var n=new r(u,e);if(n.setProvider(o.ens.eth.currentProvider),"function"!=typeof t)return n;t(n,n)})).catch((function(e){if("function"!=typeof t)throw e;t(e,null)}))},l.prototype.setResolver=function(e,t,o,r){var s=new i(!0);return this.contract.then((function(r){return r.methods.setResolver(n.hash(e),a.inputAddressFormatter(t)).send(o)})).then((function(e){"function"!=typeof r?s.resolve(e):r(e,e)})).catch((function(e){"function"!=typeof r?s.reject(e):r(e,null)})),s.eventEmitter},e.exports=l},715:function(e,t,o){"use strict";var r=o(6764);e.exports=r},2867:function(e,t,o){"use strict";var r=o(8847),n=r(o(2247)),i=r(o(5698)),a=o(282),s=o(1006),c=o(1314).errors,u=o(5160).interfaceIds;function l(e){this.registry=e}l.prototype.method=function(e,t,o,r,n){return{call:this.call.bind({ensName:e,methodName:t,methodArguments:o,callback:n,parent:this,outputFormatter:r}),send:this.send.bind({ensName:e,methodName:t,methodArguments:o,callback:n,parent:this})}},l.prototype.call=function(e){var t=this,o=new a,r=this.parent.prepareArguments(this.ensName,this.methodArguments),s=this.outputFormatter||null;return this.parent.registry.getResolver(this.ensName).then(function(){var a=(0,i.default)(n.default.mark((function i(a){return n.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.parent.checkInterfaceSupport(a,t.methodName);case 2:t.parent.handleCall(o,a.methods[t.methodName],r,s,e);case 3:case"end":return n.stop()}}),i)})));return function(e){return a.apply(this,arguments)}}()).catch((function(t){"function"!=typeof e?o.reject(t):e(t,null)})),o.eventEmitter},l.prototype.send=function(e,t){var o=this,r=new a,s=this.parent.prepareArguments(this.ensName,this.methodArguments);return this.parent.registry.getResolver(this.ensName).then(function(){var a=(0,i.default)(n.default.mark((function i(a){return n.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,o.parent.checkInterfaceSupport(a,o.methodName);case 2:o.parent.handleSend(r,a.methods[o.methodName],s,e,t);case 3:case"end":return n.stop()}}),i)})));return function(e){return a.apply(this,arguments)}}()).catch((function(e){"function"!=typeof t?r.reject(e):t(e,null)})),r.eventEmitter},l.prototype.handleCall=function(e,t,o,r,n){return t.apply(this,o).call().then((function(t){r&&(t=r(t)),"function"!=typeof n?e.resolve(t):n(t,t)})).catch((function(t){"function"!=typeof n?e.reject(t):n(t,null)})),e},l.prototype.handleSend=function(e,t,o,r,n){return t.apply(this,o).send(r).on("sending",(function(){e.eventEmitter.emit("sending")})).on("sent",(function(){e.eventEmitter.emit("sent")})).on("transactionHash",(function(t){e.eventEmitter.emit("transactionHash",t)})).on("confirmation",(function(t,o){e.eventEmitter.emit("confirmation",t,o)})).on("receipt",(function(t){e.eventEmitter.emit("receipt",t),e.resolve(t),"function"==typeof n&&n(t,t)})).on("error",(function(t){e.eventEmitter.emit("error",t),"function"!=typeof n?e.reject(t):n(t,null)})),e},l.prototype.prepareArguments=function(e,t){var o=s.hash(e);return t.length>0?(t.unshift(o),t):[o]},l.prototype.checkInterfaceSupport=function(){var e=(0,i.default)(n.default.mark((function e(t,o){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u[o]){e.next=2;break}return e.abrupt("return");case 2:return r=!1,e.prev=3,e.next=6,t.methods.supportsInterface(u[o]).call();case 6:r=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),console.warn('Could not verify interface of resolver contract at "'+t.options.address+'". ');case 12:if(r){e.next=14;break}throw c.ResolverMethodMissingError(t.options.address,o);case 14:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t,o){return e.apply(this,arguments)}}(),e.exports=l},2689:function(e,t,o){"use strict";var r=o(4308);e.exports={decode:function(e){var t=null,o=null,n=null;if(e&&e.error)return{protocolType:null,decoded:e.error};if(e)try{t=r.decode(e);var i=r.getCodec(e);"ipfs-ns"===i?o="ipfs":"swarm-ns"===i?o="bzz":"onion"===i?o="onion":"onion3"===i?o="onion3":t=e}catch(e){n=e.message}return{protocolType:o,decoded:t,error:n}},encode:function(e){var t,o,n=!1;if(e){var i=e.match(/^(ipfs|bzz|onion|onion3):\/\/(.*)/)||e.match(/\/(ipfs)\/(.*)/);i&&(o=i[1],t=i[2]);try{if("ipfs"===o)t.length>=4&&(n="0x"+r.fromIpfs(t));else if("bzz"===o)t.length>=4&&(n="0x"+r.fromSwarm(t));else if("onion"===o)16===t.length&&(n="0x"+r.encode("onion",t));else{if("onion3"!==o)throw new Error("Could not encode content hash: unsupported content type");56===t.length&&(n="0x"+r.encode("onion3",t))}}catch(e){throw e}}return n}}},3205:function(e){"use strict";e.exports=[{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"resolver",outputs:[{name:"",type:"address"}],payable:!1,type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"owner",outputs:[{name:"",type:"address"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"label",type:"bytes32"},{name:"owner",type:"address"}],name:"setSubnodeOwner",outputs:[],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"ttl",type:"uint64"}],name:"setTTL",outputs:[],payable:!1,type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"ttl",outputs:[{name:"",type:"uint64"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"resolver",type:"address"}],name:"setResolver",outputs:[],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"owner",type:"address"}],name:"setOwner",outputs:[],payable:!1,type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"owner",type:"address"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!0,name:"label",type:"bytes32"},{indexed:!1,name:"owner",type:"address"}],name:"NewOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"resolver",type:"address"}],name:"NewResolver",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"ttl",type:"uint64"}],name:"NewTTL",type:"event"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setRecord",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{constant:!0,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"recordExists",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"label",type:"bytes32"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setSubnodeRecord",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},8384:function(e){"use strict";e.exports=[{constant:!0,inputs:[{name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{name:"",type:"bool"}],payable:!1,type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"},{name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{name:"contentType",type:"uint256"},{name:"data",type:"bytes"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"hash",type:"bytes"}],name:"setMultihash",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"multihash",outputs:[{name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"x",type:"bytes32"},{name:"y",type:"bytes32"}],name:"setPubkey",outputs:[],payable:!1,type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"content",outputs:[{name:"ret",type:"bytes32"}],payable:!1,type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"addr",outputs:[{name:"ret",type:"address"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"contentType",type:"uint256"},{name:"data",type:"bytes"}],name:"setABI",outputs:[],payable:!1,type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"name",outputs:[{name:"ret",type:"string"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"name",type:"string"}],name:"setName",outputs:[],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"hash",type:"bytes32"}],name:"setContent",outputs:[],payable:!1,type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"pubkey",outputs:[{name:"x",type:"bytes32"},{name:"y",type:"bytes32"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"addr",type:"address"}],name:"setAddr",outputs:[],payable:!1,type:"function"},{inputs:[{name:"ensAddr",type:"address"}],payable:!1,type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"hash",type:"bytes32"}],name:"ContentChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!0,name:"contentType",type:"uint256"}],name:"ABIChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"x",type:"bytes32"},{indexed:!1,name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"contenthash",outputs:[{name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"hash",type:"bytes"}],name:"setContenthash",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},6:function(e,t,o){"use strict";var r=o(8847),n=r(o(9721)),i=r(o(8985)),a=o(8161),s=o(1734),c=function(e){var t="A".charCodeAt(0),o="Z".charCodeAt(0);return(e=(e=e.toUpperCase()).slice(4)+e.slice(0,4)).split("").map((function(e){var r=e.charCodeAt(0);return r>=t&&r<=o?r-t+10:e})).join("")},u=function(e){for(var t,o=e;o.length>2;)t=o.slice(0,9),o=parseInt(t,10)%97+o.slice(t.length);return parseInt(o,10)%97},l=function(){function e(t){(0,n.default)(this,e),this._iban=t}return(0,i.default)(e,[{key:"isValid",value:function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===u(c(this._iban))}},{key:"isDirect",value:function(){return 34===this._iban.length||35===this._iban.length}},{key:"isIndirect",value:function(){return 20===this._iban.length}},{key:"checksum",value:function(){return this._iban.slice(2,4)}},{key:"institution",value:function(){return this.isIndirect()?this._iban.slice(7,11):""}},{key:"client",value:function(){return this.isIndirect()?this._iban.slice(11):""}},{key:"toAddress",value:function(){if(this.isDirect()){var e=this._iban.slice(4),t=new s(e,36);return a.toChecksumAddress(t.toString(16,20))}return""}},{key:"toString",value:function(){return this._iban}}],[{key:"toAddress",value:function(t){if(!(t=new e(t)).isDirect())throw new Error("IBAN is indirect and can't be converted");return t.toAddress()}},{key:"toIban",value:function(t){return e.fromAddress(t).toString()}},{key:"fromAddress",value:function(t){if(!a.isAddress(t))throw new Error("Provided address is not a valid address: "+t);t=t.replace("0x","").replace("0X","");var o=function(e,t){for(var o=e;o.length<30;)o="0"+o;return o}(new s(t,16).toString(36));return e.fromBban(o.toUpperCase())}},{key:"fromBban",value:function(t){return new e("XE"+("0"+(98-u(c("XE00"+t)))).slice(-2)+t)}},{key:"createIndirect",value:function(t){return e.fromBban("ETH"+t.institution+t.identifier)}},{key:"isValid",value:function(t){return new e(t).isValid()}}]),e}();e.exports=l},6306:function(e,t,o){"use strict";var r=o(606),n=o(3349),i=o(8161),a=o(473),s=o(1314).formatters,c=function(){var e=this;r.packageInit(this,arguments),this.net=new a(this);var t=null,o="latest";Object.defineProperty(this,"defaultAccount",{get:function(){return t},set:function(e){return e&&(t=i.toChecksumAddress(s.inputAddressFormatter(e))),c.forEach((function(e){e.defaultAccount=t})),e},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return o},set:function(e){return o=e,c.forEach((function(e){e.defaultBlock=o})),e},enumerable:!0});var c=[new n({name:"getAccounts",call:"personal_listAccounts",params:0,outputFormatter:i.toChecksumAddress}),new n({name:"newAccount",call:"personal_newAccount",params:1,inputFormatter:[null],outputFormatter:i.toChecksumAddress}),new n({name:"unlockAccount",call:"personal_unlockAccount",params:3,inputFormatter:[s.inputAddressFormatter,null,null]}),new n({name:"lockAccount",call:"personal_lockAccount",params:1,inputFormatter:[s.inputAddressFormatter]}),new n({name:"importRawKey",call:"personal_importRawKey",params:2}),new n({name:"sendTransaction",call:"personal_sendTransaction",params:2,inputFormatter:[s.inputTransactionFormatter,null]}),new n({name:"signTransaction",call:"personal_signTransaction",params:2,inputFormatter:[s.inputTransactionFormatter,null]}),new n({name:"sign",call:"personal_sign",params:3,inputFormatter:[s.inputSignFormatter,s.inputAddressFormatter,null]}),new n({name:"ecRecover",call:"personal_ecRecover",params:2,inputFormatter:[s.inputSignFormatter,null]})];c.forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager),t.defaultBlock=e.defaultBlock,t.defaultAccount=e.defaultAccount}))};r.addProviders(c),e.exports=c},8130:function(e){"use strict";e.exports=function(e){var t,o=this;return this.net.getId().then((function(e){return t=e,o.getBlock(0)})).then((function(o){var r="private";return"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3"===o.hash&&1===t&&(r="main"),"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"===o.hash&&3===t&&(r="ropsten"),"0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177"===o.hash&&4===t&&(r="rinkeby"),"0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a"===o.hash&&5===t&&(r="goerli"),"0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9"===o.hash&&42===t&&(r="kovan"),"function"==typeof e&&e(null,r),r})).catch((function(t){if("function"!=typeof e)throw t;e(t)}))}},6748:function(e,t,o){"use strict";var r=o(606),n=o(1314),i=o(4178).subscriptions,a=o(3349),s=o(8161),c=o(473),u=o(715),l=o(6306),m=o(8164),f=o(6),d=o(9819),h=o(9901),p=o(8130),g=n.formatters,b=function(e){return"string"==typeof e[0]&&0===e[0].indexOf("0x")?"eth_getBlockByHash":"eth_getBlockByNumber"},y=function(e){return"string"==typeof e[0]&&0===e[0].indexOf("0x")?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},v=function(e){return"string"==typeof e[0]&&0===e[0].indexOf("0x")?"eth_getUncleByBlockHashAndIndex":"eth_getUncleByBlockNumberAndIndex"},k=function(e){return"string"==typeof e[0]&&0===e[0].indexOf("0x")?"eth_getBlockTransactionCountByHash":"eth_getBlockTransactionCountByNumber"},w=function(e){return"string"==typeof e[0]&&0===e[0].indexOf("0x")?"eth_getUncleCountByBlockHash":"eth_getUncleCountByBlockNumber"},x=function(){var e=this;r.packageInit(this,arguments);var t=this.setRequestManager;this.setRequestManager=function(o){return t(o),e.net.setRequestManager(o),e.personal.setRequestManager(o),e.accounts.setRequestManager(o),e.Contract._requestManager=e._requestManager,e.Contract.currentProvider=e._provider,!0};var o=this.setProvider;this.setProvider=function(){o.apply(e,arguments),e.setRequestManager(e._requestManager),e.ens._detectedAddress=null,e.ens._lastSyncCheck=null};var n,x,z,j=!1,M=null,A="latest",q=50,I=24,E=750,S=1e3,N=10,_=100;Object.defineProperty(this,"handleRevert",{get:function(){return j},set:function(t){j=t,e.Contract.handleRevert=j,C.forEach((function(e){e.handleRevert=j}))},enumerable:!0}),Object.defineProperty(this,"defaultCommon",{get:function(){return z},set:function(t){z=t,e.Contract.defaultCommon=z,C.forEach((function(e){e.defaultCommon=z}))},enumerable:!0}),Object.defineProperty(this,"defaultHardfork",{get:function(){return x},set:function(t){x=t,e.Contract.defaultHardfork=x,C.forEach((function(e){e.defaultHardfork=x}))},enumerable:!0}),Object.defineProperty(this,"defaultChain",{get:function(){return n},set:function(t){n=t,e.Contract.defaultChain=n,C.forEach((function(e){e.defaultChain=n}))},enumerable:!0}),Object.defineProperty(this,"transactionPollingTimeout",{get:function(){return E},set:function(t){E=t,e.Contract.transactionPollingTimeout=E,C.forEach((function(e){e.transactionPollingTimeout=E}))},enumerable:!0}),Object.defineProperty(this,"transactionPollingInterval",{get:function(){return S},set:function(t){S=t,e.Contract.transactionPollingInterval=S,C.forEach((function(e){e.transactionPollingInterval=S}))},enumerable:!0}),Object.defineProperty(this,"transactionConfirmationBlocks",{get:function(){return I},set:function(t){I=t,e.Contract.transactionConfirmationBlocks=I,C.forEach((function(e){e.transactionConfirmationBlocks=I}))},enumerable:!0}),Object.defineProperty(this,"transactionBlockTimeout",{get:function(){return q},set:function(t){q=t,e.Contract.transactionBlockTimeout=q,C.forEach((function(e){e.transactionBlockTimeout=q}))},enumerable:!0}),Object.defineProperty(this,"blockHeaderTimeout",{get:function(){return N},set:function(t){N=t,e.Contract.blockHeaderTimeout=N,C.forEach((function(e){e.blockHeaderTimeout=N}))},enumerable:!0}),Object.defineProperty(this,"defaultAccount",{get:function(){return M},set:function(t){return t&&(M=s.toChecksumAddress(g.inputAddressFormatter(t))),e.Contract.defaultAccount=M,e.personal.defaultAccount=M,C.forEach((function(e){e.defaultAccount=M})),t},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return A},set:function(t){return A=t,e.Contract.defaultBlock=A,e.personal.defaultBlock=A,C.forEach((function(e){e.defaultBlock=A})),t},enumerable:!0}),Object.defineProperty(this,"maxListenersWarningThreshold",{get:function(){return _},set:function(t){e.currentProvider&&e.currentProvider.setMaxListeners&&(_=t,e.currentProvider.setMaxListeners(t))},enumerable:!0}),this.clearSubscriptions=e._requestManager.clearSubscriptions.bind(e._requestManager),this.removeSubscriptionById=e._requestManager.removeSubscription.bind(e._requestManager),this.net=new c(this),this.net.getNetworkType=p.bind(this),this.accounts=new d(this),this.personal=new l(this),this.personal.defaultAccount=this.defaultAccount,this.maxListenersWarningThreshold=_;var T=this,O=function(){m.apply(this,arguments);var e=this,t=T.setProvider;T.setProvider=function(){t.apply(T,arguments),r.packageInit(e,[T])}};O.setProvider=function(){m.setProvider.apply(this,arguments)},(O.prototype=Object.create(m.prototype)).constructor=O,this.Contract=O,this.Contract.defaultAccount=this.defaultAccount,this.Contract.defaultBlock=this.defaultBlock,this.Contract.transactionBlockTimeout=this.transactionBlockTimeout,this.Contract.transactionConfirmationBlocks=this.transactionConfirmationBlocks,this.Contract.transactionPollingTimeout=this.transactionPollingTimeout,this.Contract.transactionPollingInterval=this.transactionPollingInterval,this.Contract.blockHeaderTimeout=this.blockHeaderTimeout,this.Contract.handleRevert=this.handleRevert,this.Contract._requestManager=this._requestManager,this.Contract._ethAccounts=this.accounts,this.Contract.currentProvider=this._requestManager.provider,this.Iban=f,this.abi=h,this.ens=new u(this);var C=[new a({name:"getNodeInfo",call:"web3_clientVersion"}),new a({name:"getProtocolVersion",call:"eth_protocolVersion",params:0}),new a({name:"getCoinbase",call:"eth_coinbase",params:0}),new a({name:"isMining",call:"eth_mining",params:0}),new a({name:"getHashrate",call:"eth_hashrate",params:0,outputFormatter:s.hexToNumber}),new a({name:"isSyncing",call:"eth_syncing",params:0,outputFormatter:g.outputSyncingFormatter}),new a({name:"getGasPrice",call:"eth_gasPrice",params:0,outputFormatter:g.outputBigNumberFormatter}),new a({name:"getFeeHistory",call:"eth_feeHistory",params:3,inputFormatter:[s.numberToHex,g.inputBlockNumberFormatter,null]}),new a({name:"getAccounts",call:"eth_accounts",params:0,outputFormatter:s.toChecksumAddress}),new a({name:"getBlockNumber",call:"eth_blockNumber",params:0,outputFormatter:s.hexToNumber}),new a({name:"getBalance",call:"eth_getBalance",params:2,inputFormatter:[g.inputAddressFormatter,g.inputDefaultBlockNumberFormatter],outputFormatter:g.outputBigNumberFormatter}),new a({name:"getStorageAt",call:"eth_getStorageAt",params:3,inputFormatter:[g.inputAddressFormatter,s.numberToHex,g.inputDefaultBlockNumberFormatter]}),new a({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[g.inputAddressFormatter,g.inputDefaultBlockNumberFormatter]}),new a({name:"getBlock",call:b,params:2,inputFormatter:[g.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:g.outputBlockFormatter}),new a({name:"getUncle",call:v,params:2,inputFormatter:[g.inputBlockNumberFormatter,s.numberToHex],outputFormatter:g.outputBlockFormatter}),new a({name:"getBlockTransactionCount",call:k,params:1,inputFormatter:[g.inputBlockNumberFormatter],outputFormatter:s.hexToNumber}),new a({name:"getBlockUncleCount",call:w,params:1,inputFormatter:[g.inputBlockNumberFormatter],outputFormatter:s.hexToNumber}),new a({name:"getTransaction",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:g.outputTransactionFormatter}),new a({name:"getTransactionFromBlock",call:y,params:2,inputFormatter:[g.inputBlockNumberFormatter,s.numberToHex],outputFormatter:g.outputTransactionFormatter}),new a({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:g.outputTransactionReceiptFormatter}),new a({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[g.inputAddressFormatter,g.inputDefaultBlockNumberFormatter],outputFormatter:s.hexToNumber}),new a({name:"sendSignedTransaction",call:"eth_sendRawTransaction",params:1,inputFormatter:[null],abiCoder:h}),new a({name:"signTransaction",call:"eth_signTransaction",params:1,inputFormatter:[g.inputTransactionFormatter]}),new a({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[g.inputTransactionFormatter],abiCoder:h}),new a({name:"sign",call:"eth_sign",params:2,inputFormatter:[g.inputSignFormatter,g.inputAddressFormatter],transformPayload:function(e){return e.params.reverse(),e}}),new a({name:"call",call:"eth_call",params:2,inputFormatter:[g.inputCallFormatter,g.inputDefaultBlockNumberFormatter],abiCoder:h}),new a({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[g.inputCallFormatter],outputFormatter:s.hexToNumber}),new a({name:"submitWork",call:"eth_submitWork",params:3}),new a({name:"getWork",call:"eth_getWork",params:0}),new a({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[g.inputLogFormatter],outputFormatter:g.outputLogFormatter}),new a({name:"getChainId",call:"eth_chainId",params:0,outputFormatter:s.hexToNumber}),new a({name:"requestAccounts",call:"eth_requestAccounts",params:0,outputFormatter:s.toChecksumAddress}),new a({name:"getProof",call:"eth_getProof",params:3,inputFormatter:[g.inputAddressFormatter,g.inputStorageKeysFormatter,g.inputDefaultBlockNumberFormatter],outputFormatter:g.outputProofFormatter}),new a({name:"getPendingTransactions",call:"eth_pendingTransactions",params:0,outputFormatter:g.outputTransactionFormatter}),new a({name:"createAccessList",call:"eth_createAccessList",params:2,inputFormatter:[g.inputTransactionFormatter,g.inputDefaultBlockNumberFormatter]}),new i({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:g.outputBlockFormatter},pendingTransactions:{subscriptionName:"newPendingTransactions",params:0},logs:{params:1,inputFormatter:[g.inputLogFormatter],outputFormatter:g.outputLogFormatter,subscriptionHandler:function(e){e.removed?this.emit("changed",e):this.emit("data",e),"function"==typeof this.callback&&this.callback(null,e,this)}},syncing:{params:0,outputFormatter:g.outputSyncingFormatter,subscriptionHandler:function(e){var t=this;!0!==this._isSyncing?(this._isSyncing=!0,this.emit("changed",t._isSyncing),"function"==typeof this.callback&&this.callback(null,t._isSyncing,this),setTimeout((function(){t.emit("data",e),"function"==typeof t.callback&&t.callback(null,e,t)}),0)):(this.emit("data",e),"function"==typeof t.callback&&this.callback(null,e,this),clearTimeout(this._isSyncingTimeout),this._isSyncingTimeout=setTimeout((function(){e.currentBlock>e.highestBlock-200&&(t._isSyncing=!1,t.emit("changed",t._isSyncing),"function"==typeof t.callback&&t.callback(null,t._isSyncing,t))}),500))}}}})];C.forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager,e.accounts),t.defaultBlock=e.defaultBlock,t.defaultAccount=e.defaultAccount,t.transactionBlockTimeout=e.transactionBlockTimeout,t.transactionConfirmationBlocks=e.transactionConfirmationBlocks,t.transactionPollingTimeout=e.transactionPollingTimeout,t.transactionPollingInterval=e.transactionPollingInterval,t.handleRevert=e.handleRevert}))};r.addProviders(x),e.exports=x},473:function(e,t,o){"use strict";var r=o(606),n=o(3349),i=o(8161),a=function(){var e=this;r.packageInit(this,arguments),[new n({name:"getId",call:"net_version",params:0,outputFormatter:parseInt}),new n({name:"isListening",call:"net_listening",params:0}),new n({name:"getPeerCount",call:"net_peerCount",params:0,outputFormatter:i.hexToNumber})].forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)}))};r.addProviders(a),e.exports=a},4565:function(e,t,o){"use strict";var r=o(1314).errors,n=o(9519),i=o(912);o(2439),o(4258).polyfill(),void 0===o.g||o.g.AbortController||o(3368);var a=function(e,t){t=t||{},this.withCredentials=t.withCredentials,this.timeout=t.timeout||0,this.headers=t.headers,this.agent=t.agent,this.connected=!1;var o=!1!==t.keepAlive;this.host=e||"http://localhost:8545",this.agent||("https"===this.host.substring(0,5)?this.httpsAgent=new i.Agent({keepAlive:o}):this.httpAgent=new n.Agent({keepAlive:o}))};a.prototype.send=function(e,t){var o,n={method:"POST",body:JSON.stringify(e)},i={};if("undefined"!=typeof AbortController?o=new AbortController:"undefined"!=typeof window&&void 0!==window.AbortController&&(o=new window.AbortController),void 0!==o&&(n.signal=o.signal),"undefined"==typeof XMLHttpRequest){var a={httpsAgent:this.httpsAgent,httpAgent:this.httpAgent};this.agent&&(a.httpsAgent=this.agent.https,a.httpAgent=this.agent.http),"https"===this.host.substring(0,5)?n.agent=a.httpsAgent:n.agent=a.httpAgent}this.headers&&this.headers.forEach((function(e){i[e.name]=e.value})),i["Content-Type"]||(i["Content-Type"]="application/json"),this.withCredentials?n.credentials="include":n.credentials="omit",n.headers=i,this.timeout>0&&void 0!==o&&(this.timeoutId=setTimeout((function(){o.abort()}),this.timeout)),fetch(this.host,n).then(function(e){void 0!==this.timeoutId&&clearTimeout(this.timeoutId),e.json().then((function(e){t(null,e)})).catch((function(o){t(r.InvalidResponse(e))}))}.bind(this)).catch(function(e){void 0!==this.timeoutId&&clearTimeout(this.timeoutId),"AbortError"===e.name&&t(r.ConnectionTimeout(this.timeout)),t(r.InvalidConnection(this.host,e))}.bind(this))},a.prototype.disconnect=function(){},a.prototype.supportsSubscriptions=function(){return!1},e.exports=a},2683:function(e,t,o){"use strict";var r=o(1314).errors,n=o(3150),i=function(e,t){var o=this;this.responseCallbacks={},this.notificationCallbacks=[],this.path=e,this.connected=!1,this.connection=t.connect({path:this.path}),this.addDefaultEvents();var r=function(e){var t=null;Array.isArray(e)?e.forEach((function(e){o.responseCallbacks[e.id]&&(t=e.id)})):t=e.id,t||-1===e.method.indexOf("_subscription")?o.responseCallbacks[t]&&(o.responseCallbacks[t](null,e),delete o.responseCallbacks[t]):o.notificationCallbacks.forEach((function(t){"function"==typeof t&&t(e)}))};"Socket"===t.constructor.name?n(this.connection).done(r):this.connection.on("data",(function(e){o._parseResponse(e.toString()).forEach(r)}))};i.prototype.addDefaultEvents=function(){var e=this;this.connection.on("connect",(function(){e.connected=!0})),this.connection.on("close",(function(){e.connected=!1})),this.connection.on("error",(function(){e._timeout()})),this.connection.on("end",(function(){e._timeout()})),this.connection.on("timeout",(function(){e._timeout()}))},i.prototype._parseResponse=function(e){var t=this,o=[];return e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach((function(e){t.lastChunk&&(e=t.lastChunk+e);var n=null;try{n=JSON.parse(e)}catch(o){return t.lastChunk=e,clearTimeout(t.lastChunkTimeout),void(t.lastChunkTimeout=setTimeout((function(){throw t._timeout(),r.InvalidResponse(e)}),15e3))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,n&&o.push(n)})),o},i.prototype._addResponseCallback=function(e,t){var o=e.id||e[0].id,r=e.method||e[0].method;this.responseCallbacks[o]=t,this.responseCallbacks[o].method=r},i.prototype._timeout=function(){for(var e in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(e)&&(this.responseCallbacks[e](r.InvalidConnection("on IPC")),delete this.responseCallbacks[e])},i.prototype.reconnect=function(){this.connection.connect({path:this.path})},i.prototype.send=function(e,t){this.connection.writable||this.connection.connect({path:this.path}),this.connection.write(JSON.stringify(e)),this._addResponseCallback(e,t)},i.prototype.on=function(e,t){if("function"!=typeof t)throw new Error("The second parameter callback must be a function.");"data"===e?this.notificationCallbacks.push(t):this.connection.on(e,t)},i.prototype.once=function(e,t){if("function"!=typeof t)throw new Error("The second parameter callback must be a function.");this.connection.once(e,t)},i.prototype.removeListener=function(e,t){var o=this;"data"===e?this.notificationCallbacks.forEach((function(e,r){e===t&&o.notificationCallbacks.splice(r,1)})):this.connection.removeListener(e,t)},i.prototype.removeAllListeners=function(e){"data"===e?this.notificationCallbacks=[]:this.connection.removeAllListeners(e)},i.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.connection.removeAllListeners("error"),this.connection.removeAllListeners("end"),this.connection.removeAllListeners("timeout"),this.addDefaultEvents()},i.prototype.supportsSubscriptions=function(){return!0},e.exports=i},360:function(e,t,o){"use strict";var r=o(9142),n=o(9033).Buffer,i=o(8847)(o(3355)),a="[object process]"===Object.prototype.toString.call(void 0!==r?r:0),s="undefined"!=typeof navigator&&"ReactNative"===navigator.product,c=null,u=null;if(a||s){c=function(e){return n.from(e).toString("base64")};var l=o(1143);if(l.URL){var m=l.URL;u=function(e){return new m(e)}}else u=o(1143).parse}else c=btoa.bind("object"===("undefined"==typeof globalThis?"undefined":(0,i.default)(globalThis))?globalThis:self),u=function(e){return new URL(e)};e.exports={parseURL:u,btoa:c}},7651:function(e,t,o){"use strict";var r=o(8008),n=o(360),i=o(1314).errors,a=o(1158).w3cwebsocket,s=function(e,t){r.call(this),t=t||{},this.url=e,this._customTimeout=t.timeout||15e3,this.headers=t.headers||{},this.protocol=t.protocol||void 0,this.reconnectOptions=Object.assign({auto:!1,delay:5e3,maxAttempts:!1,onTimeout:!1},t.reconnect),this.clientConfig=t.clientConfig||void 0,this.requestOptions=t.requestOptions||void 0,this.DATA="data",this.CLOSE="close",this.ERROR="error",this.CONNECT="connect",this.RECONNECT="reconnect",this.connection=null,this.requestQueue=new Map,this.responseQueue=new Map,this.reconnectAttempts=0,this.reconnecting=!1,this.connectFailedDescription=null;var o=n.parseURL(e);o.username&&o.password&&(this.headers.authorization="Basic "+n.btoa(o.username+":"+o.password)),o.auth&&(this.headers.authorization="Basic "+n.btoa(o.auth)),Object.defineProperty(this,"connected",{get:function(){return this.connection&&this.connection.readyState===this.connection.OPEN},enumerable:!0}),this.connect()};(s.prototype=Object.create(r.prototype)).constructor=s,s.prototype.connect=function(){this.connection=new a(this.url,this.protocol,void 0,this.headers,this.requestOptions,this.clientConfig),this._addSocketListeners()},s.prototype._onMessage=function(e){var t=this;this._parseResponse("string"==typeof e.data?e.data:"").forEach((function(e){if(e.method&&-1!==e.method.indexOf("_subscription"))t.emit(t.DATA,e);else{var o=e.id;Array.isArray(e)&&(o=e[0].id),t.responseQueue.has(o)&&(void 0!==t.responseQueue.get(o).callback&&t.responseQueue.get(o).callback(!1,e),t.responseQueue.delete(o))}}))},s.prototype._onConnect=function(){if(this.emit(this.CONNECT),this.reconnectAttempts=0,this.reconnecting=!1,this.requestQueue.size>0){var e=this;this.requestQueue.forEach((function(t,o){e.send(t.payload,t.callback),e.requestQueue.delete(o)}))}},s.prototype._onConnectFailed=function(e){this.connectFailedDescription=e.toString().split("\n")[0];var t=this;this.connectFailedDescription&&(e.description=this.connectFailedDescription,this.connectFailedDescription=null),e.code=1006,e.reason="connection failed",!this.reconnectOptions.auto||[1e3,1001].includes(e.code)&&!1!==e.wasClean?(this.emit(this.ERROR,e),this.requestQueue.size>0&&this.requestQueue.forEach((function(o,r){o.callback(i.ConnectionNotOpenError(e)),t.requestQueue.delete(r)})),this.responseQueue.size>0&&this.responseQueue.forEach((function(o,r){o.callback(i.InvalidConnection("on WS",e)),t.responseQueue.delete(r)})),this.connection._connection&&this.connection._connection.removeAllListeners(),this.connection._client.removeAllListeners(),this.connection._readyState=3,this.emit(this.CLOSE,e)):this.reconnect()},s.prototype._onClose=function(e){var t=this;!this.reconnectOptions.auto||[1e3,1001].includes(e.code)&&!1!==e.wasClean?(this.emit(this.CLOSE,e),this.requestQueue.size>0&&this.requestQueue.forEach((function(o,r){o.callback(i.ConnectionNotOpenError(e)),t.requestQueue.delete(r)})),this.responseQueue.size>0&&this.responseQueue.forEach((function(o,r){o.callback(i.InvalidConnection("on WS",e)),t.responseQueue.delete(r)})),this._removeSocketListeners(),this.removeAllListeners()):this.reconnect()},s.prototype._addSocketListeners=function(){this.connection.addEventListener("message",this._onMessage.bind(this)),this.connection.addEventListener("open",this._onConnect.bind(this)),this.connection.addEventListener("close",this._onClose.bind(this)),this.connection._client&&(this.connection._client.removeAllListeners("connectFailed"),this.connection._client.on("connectFailed",this._onConnectFailed.bind(this)))},s.prototype._removeSocketListeners=function(){this.connection.removeEventListener("message",this._onMessage),this.connection.removeEventListener("open",this._onConnect),this.connection.removeEventListener("close",this._onClose),this.connection._connection&&this.connection._client.removeListener("connectFailed",this._onConnectFailed)},s.prototype._parseResponse=function(e){var t=this,o=[];return e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach((function(e){t.lastChunk&&(e=t.lastChunk+e);var r=null;try{r=JSON.parse(e)}catch(o){return t.lastChunk=e,clearTimeout(t.lastChunkTimeout),void(t.lastChunkTimeout=setTimeout((function(){t.reconnectOptions.auto&&t.reconnectOptions.onTimeout?t.reconnect():(t.emit(t.ERROR,i.ConnectionTimeout(t._customTimeout)),t.requestQueue.size>0&&t.requestQueue.forEach((function(e,o){e.callback(i.ConnectionTimeout(t._customTimeout)),t.requestQueue.delete(o)})))}),t._customTimeout))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,r&&o.push(r)})),o},s.prototype.send=function(e,t){var o=e.id,r={payload:e,callback:t};if(Array.isArray(e)&&(o=e[0].id),this.connection.readyState===this.connection.CONNECTING||this.reconnecting)this.requestQueue.set(o,r);else{if(this.connection.readyState!==this.connection.OPEN)return this.requestQueue.delete(o),this.emit(this.ERROR,i.ConnectionNotOpenError()),void r.callback(i.ConnectionNotOpenError());this.responseQueue.set(o,r),this.requestQueue.delete(o);try{this.connection.send(JSON.stringify(r.payload))}catch(e){r.callback(e),this.responseQueue.delete(o)}}},s.prototype.reset=function(){this.responseQueue.clear(),this.requestQueue.clear(),this.removeAllListeners(),this._removeSocketListeners(),this._addSocketListeners()},s.prototype.disconnect=function(e,t){this._removeSocketListeners(),this.connection.close(e||1e3,t)},s.prototype.supportsSubscriptions=function(){return!0},s.prototype.reconnect=function(){var e=this;this.reconnecting=!0,this.responseQueue.size>0&&this.responseQueue.forEach((function(t,o){try{e.responseQueue.delete(o),t.callback(i.PendingRequestsOnReconnectingError())}catch(e){console.error("Error encountered in reconnect: ",e)}})),!this.reconnectOptions.maxAttempts||this.reconnectAttempts0&&this.requestQueue.forEach((function(t,o){t.callback(i.MaxAttemptsReachedOnReconnectingError()),e.requestQueue.delete(o)})))},e.exports=s},2565:function(e,t,o){"use strict";var r=o(606),n=o(4178).subscriptions,i=o(3349),a=o(473),s=function(){var e=this;r.packageInit(this,arguments);var t=this.setRequestManager;this.setRequestManager=function(o){return t(o),e.net.setRequestManager(o),!0};var o=this.setProvider;this.setProvider=function(){o.apply(e,arguments),e.setRequestManager(e._requestManager)},this.net=new a(this),[new n({name:"subscribe",type:"shh",subscriptions:{messages:{params:1}}}),new i({name:"getVersion",call:"shh_version",params:0}),new i({name:"getInfo",call:"shh_info",params:0}),new i({name:"setMaxMessageSize",call:"shh_setMaxMessageSize",params:1}),new i({name:"setMinPoW",call:"shh_setMinPoW",params:1}),new i({name:"markTrustedPeer",call:"shh_markTrustedPeer",params:1}),new i({name:"newKeyPair",call:"shh_newKeyPair",params:0}),new i({name:"addPrivateKey",call:"shh_addPrivateKey",params:1}),new i({name:"deleteKeyPair",call:"shh_deleteKeyPair",params:1}),new i({name:"hasKeyPair",call:"shh_hasKeyPair",params:1}),new i({name:"getPublicKey",call:"shh_getPublicKey",params:1}),new i({name:"getPrivateKey",call:"shh_getPrivateKey",params:1}),new i({name:"newSymKey",call:"shh_newSymKey",params:0}),new i({name:"addSymKey",call:"shh_addSymKey",params:1}),new i({name:"generateSymKeyFromPassword",call:"shh_generateSymKeyFromPassword",params:1}),new i({name:"hasSymKey",call:"shh_hasSymKey",params:1}),new i({name:"getSymKey",call:"shh_getSymKey",params:1}),new i({name:"deleteSymKey",call:"shh_deleteSymKey",params:1}),new i({name:"newMessageFilter",call:"shh_newMessageFilter",params:1}),new i({name:"getFilterMessages",call:"shh_getFilterMessages",params:1}),new i({name:"deleteMessageFilter",call:"shh_deleteMessageFilter",params:1}),new i({name:"post",call:"shh_post",params:1,inputFormatter:[null]}),new i({name:"unsubscribe",call:"shh_unsubscribe",params:1})].forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)}))};s.prototype.clearSubscriptions=function(){this._requestManager.clearSubscriptions()},r.addProviders(s),e.exports=s},8161:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=o(7130),i=o(323),a=o(747),s=o(5010),c=o(1734),u=function e(t,o){var n=[];return o.forEach((function(o){if("object"===(0,r.default)(o.components)){if("tuple"!==o.type.substring(0,5))throw new Error("components found but type is not tuple; report on GitHub");var i="",a=o.type.indexOf("[");a>=0&&(i=o.type.substring(a));var s=e(t,o.components);Array.isArray(s)&&t?n.push("tuple("+s.join(",")+")"+i):t?n.push("("+s+")"):n.push("("+s.join(",")+")"+i)}else n.push(o.type)})),n},l=function(e){if(!i.isHexStrict(e))throw new Error("The parameter must be a valid HEX string.");var t="",o=0,r=e.length;for("0x"===e.substring(0,2)&&(o=2);o7?o+=e[r].toUpperCase():o+=e[r];return o},toHex:i.toHex,toBN:i.toBN,bytesToHex:i.bytesToHex,hexToBytes:i.hexToBytes,hexToNumberString:i.hexToNumberString,hexToNumber:i.hexToNumber,toDecimal:i.hexToNumber,numberToHex:i.numberToHex,fromDecimal:i.numberToHex,hexToUtf8:i.hexToUtf8,hexToString:i.hexToUtf8,toUtf8:i.hexToUtf8,stripHexPrefix:i.stripHexPrefix,utf8ToHex:i.utf8ToHex,stringToHex:i.utf8ToHex,fromUtf8:i.utf8ToHex,hexToAscii:l,toAscii:l,asciiToHex:m,fromAscii:m,unitMap:n.unitMap,toWei:function(e,t){if(t=f(t),!i.isBN(e)&&"string"!=typeof e)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return i.isBN(e)?n.toWei(e,t):n.toWei(e,t).toString(10)},fromWei:function(e,t){if(t=f(t),!i.isBN(e)&&"string"!=typeof e)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return i.isBN(e)?n.fromWei(e,t):n.fromWei(e,t).toString(10)},padLeft:i.leftPad,leftPad:i.leftPad,padRight:i.rightPad,rightPad:i.rightPad,toTwosComplement:i.toTwosComplement,isBloom:i.isBloom,isUserEthereumAddressInBloom:i.isUserEthereumAddressInBloom,isContractAddressInBloom:i.isContractAddressInBloom,isTopic:i.isTopic,isTopicInBloom:i.isTopicInBloom,isInBloom:i.isInBloom,compareBlockNumbers:function(e,t){if(e===t)return 0;if("genesis"!==e&&"earliest"!==e&&0!==e||"genesis"!==t&&"earliest"!==t&&0!==t){if("genesis"===e||"earliest"===e||0===e)return-1;if("genesis"===t||"earliest"===t||0===t)return 1;if("latest"===e||"finalized"===e)return"pending"===t?-1:1;if("latest"===t||"finalized"===t)return"pending"===e?1:-1;if("pending"===e)return 1;if("pending"===t)return-1;if("safe"===e||"safe"===t)return;var o=new c(e),r=new c(t);return o.lt(r)?-1:o.eq(r)?0:1}return 0},toNumber:i.toNumber}},747:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=o(1734),i=o(323),a=function(e){var t=(0,r.default)(e);if("string"===t)return i.isHexStrict(e)?new n(e.replace(/0x/i,""),16):new n(e,10);if("number"===t)return new n(e);if(i.isBigNumber(e))return new n(e.toString(10));if(i.isBN(e))return e;throw new Error(e+" is not a number")},s=function(e,t,o){var r,s;if("bytes"===(e=function(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e}(e))){if(t.replace(/^0x/i,"").length%2!=0)throw new Error("Invalid bytes characters "+t.length);return t}if("string"===e)return i.utf8ToHex(t);if("bool"===e)return t?"01":"00";if(e.startsWith("address")){if(r=o?64:40,!i.isAddress(t))throw new Error(t+" is not a valid address, or the checksum is invalid.");return i.leftPad(t.toLowerCase(),r)}if(r=function(e){var t=/^\D+(\d+).*$/.exec(e);return t?parseInt(t[1],10):null}(e),e.startsWith("bytes")){if(!r)throw new Error("bytes[] not yet supported in solidity");if(o&&(r=32),r<1||r>32||r256)throw new Error("Invalid uint"+r+" size");if((s=a(t)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+s.bitLength());if(s.lt(new n(0)))throw new Error("Supplied uint "+s.toString()+" is negative");return r?i.leftPad(s.toString("hex"),r/8*2):s}if(e.startsWith("int")){if(r%8||r<8||r>256)throw new Error("Invalid int"+r+" size");if((s=a(t)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+s.bitLength());return s.lt(new n(0))?s.toTwos(r).toString("hex"):r?i.leftPad(s.toString("hex"),r/8*2):s}throw new Error("Unsupported or invalid type: "+e)},c=function(e){if(Array.isArray(e))throw new Error("Autodetection of array types is not supported.");var t,o,a="";if(e&&"object"===(0,r.default)(e)&&(e.hasOwnProperty("v")||e.hasOwnProperty("t")||e.hasOwnProperty("value")||e.hasOwnProperty("type"))?(t=e.hasOwnProperty("t")?e.t:e.type,a=e.hasOwnProperty("v")?e.v:e.value):(t=i.toHex(e,!0),a=i.toHex(e),t.startsWith("int")||t.startsWith("uint")||(t="bytes")),!t.startsWith("int")&&!t.startsWith("uint")||"string"!=typeof a||/^(-)?0x/i.test(a)||(a=new n(a)),Array.isArray(a)){if(o=function(e){var t=/^\D+\d*\[(\d+)\]$/.exec(e);return t?parseInt(t[1],10):null}(t),o&&a.length!==o)throw new Error(t+" is not matching the given array "+JSON.stringify(a));o=a.length}return Array.isArray(a)?a.map((function(e){return s(t,e,o).toString("hex").replace("0x","")})).join(""):s(t,a,o).toString("hex").replace("0x","")};e.exports={soliditySha3:function(){var e=Array.prototype.slice.call(arguments).map(c);return i.sha3("0x"+e.join(""))},soliditySha3Raw:function(){return i.sha3Raw("0x"+Array.prototype.slice.call(arguments).map(c).join(""))},encodePacked:function(){return"0x"+Array.prototype.slice.call(arguments).map(c).join("").toLowerCase()}}},323:function(e,t,o){"use strict";var r=o(9033).Buffer,n=o(8847),i=n(o(4519)),a=n(o(3355)),s=o(1734),c=o(7277),u=o(8632),l=o(3062),m=o(9313),f=function(e){return s.isBN(e)},d=function(e){return e&&e.constructor&&"BigNumber"===e.constructor.name},h=function(e){try{return c.apply(null,arguments)}catch(t){throw new Error(t+' Given value: "'+e+'"')}},p=function(e){return!!/^(0x)?[0-9a-f]{40}$/i.test(e)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(e)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(e))||g(e))},g=function(e){e=e.replace(/^0x/i,"");for(var t=j(e.toLowerCase()).replace(/^0x/i,""),o=0;o<40;o++)if(parseInt(t[o],16)>7&&e[o].toUpperCase()!==e[o]||parseInt(t[o],16)<=7&&e[o].toLowerCase()!==e[o])return!1;return!0},b=function(e){var t="";e=(e=(e=(e=(e=u.encode(e)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var o=0;o1&&void 0!==arguments[1]&&arguments[1];if(!e)return e;if("string"==typeof e&&!w(e))throw new Error('Given value "'+e+'" is not a valid hex string.');var o=h(e);return t&&(o>Number.MAX_SAFE_INTEGER||o>>4).toString(16)),t.push((15&e[o]).toString(16));return"0x"+t.join("")},isHex:x,isHexStrict:w,stripHexPrefix:function(e){return 0!==e&&x(e)?e.replace(/^(-)?0x/i,"$1"):e},leftPad:function(e,t,o){var r=/^0x/i.test(e)||"number"==typeof e,n=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(r?"0x":"")+new Array(n).join(o||"0")+e},rightPad:function(e,t,o){var r=/^0x/i.test(e)||"number"==typeof e,n=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(r?"0x":"")+e+new Array(n).join(o||"0")},toTwosComplement:function(e){return"0x"+h(e).toTwos(256).toString(16,64)},sha3:j,sha3Raw:function(e){return null===(e=j(e))?z:e},toNumber:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"number"==typeof e?e:y(k(e),t)}}},7001:function(e,t,o){"use strict";var r=o(8920).i8,n=o(606),i=o(6748),a=o(473),s=o(6306),c=o(2565),u=o(2463),l=o(8161),m=function(){var e=this;n.packageInit(this,arguments),this.version=r,this.utils=l,this.eth=new i(this),this.shh=new c(this),this.bzz=new u(this);var t=this.setProvider;this.setProvider=function(o,r){return t.apply(e,arguments),e.eth.setRequestManager(e._requestManager),e.shh.setRequestManager(e._requestManager),e.bzz.setProvider(o),!0}};m.version=r,m.utils=l,m.modules={Eth:i,Net:a,Personal:s,Shh:c,Bzz:u},n.addProviders(m),e.exports=m},9214:function(){},2361:function(){},4616:function(){},8768:function(e){"use strict";e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o=0;--r){var n=this.tryEntries[r],a=n.completion;if("root"===n.tryLoc)return o("end");if(n.tryLoc<=this.prev){var s=i.call(n,"catchLoc"),c=i.call(n,"finallyLoc");if(s&&c){if(this.prev=0;--o){var r=this.tryEntries[o];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===e)return this.complete(o.completion,o.afterLoc),q(o),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===e){var r=o.completion;if("throw"===r.type){var n=r.arg;q(o)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,o){return this.delegate={iterator:E(e),resultName:t,nextLoc:o},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},8746:function(e){"use strict";function t(o,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(o,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4519:function(e,t,o){"use strict";var r=o(2338),n=o(1436),i=o(6906),a=o(2966);e.exports=function(e,t){return r(e)||n(e,t)||i(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},7460:function(e,t,o){"use strict";var r=o(1949);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},3106:function(e,t,o){"use strict";var r=o(7907),n=o(1642),i=o(6906),a=o(2344);e.exports=function(e){return r(e)||n(e)||i(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},9662:function(e,t,o){"use strict";var r=o(3355).default;e.exports=function(e,t){if("object"!==r(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!==r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},2310:function(e,t,o){"use strict";var r=o(3355).default,n=o(9662);e.exports=function(e){var t=n(e,"string");return"symbol"===r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},3355:function(e){"use strict";function t(o){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},6906:function(e,t,o){"use strict";var r=o(8768);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},2247:function(e,t,o){"use strict";var r=o(8847)(o(3355)),n=o(2028)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"===("undefined"==typeof globalThis?"undefined":(0,r.default)(globalThis))?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},3604:function(e,t,o){"use strict";var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n="undefined"==typeof globalThis?o.g:globalThis;e.exports=function(){for(var e=[],t=0;t-1?o.split(e.arrayFormatSeparator).map((function(t){return m(t,e)})):null===o?o:m(o,e);r[t]=n};default:return function(e,t,o){void 0!==o[e]?o[e]=[].concat(o[e],t):o[e]=t}}}(t),i=Object.create(null);if("string"!==typeof e)return i;if(!(e=e.trim().replace(/^[?#&]/,"")))return i;var a,s=n(e.split("&"));try{for(s.s();!(a=s.n()).done;){var l=a.value,d=c(t.decode?l.replace(/\+/g," "):l,"="),h=r(d,2),g=h[0],b=h[1];b=void 0===b?null:["comma","separator"].includes(t.arrayFormat)?b:m(b,t),o(m(g,t),b,i)}}catch(M){s.e(M)}finally{s.f()}for(var y=0,v=Object.keys(i);y0})).join("&")},t.parseUrl=function(e,t){t=Object.assign({decode:!0},t);var o=c(e,"#"),n=r(o,2),i=n[0],a=n[1];return Object.assign({url:i.split("?")[0]||"",query:g(h(e),t)},t&&t.parseFragmentIdentifier&&a?{fragmentIdentifier:m(a,t)}:{})},t.stringifyUrl=function(e,o){o=Object.assign({encode:!0,strict:!0},o);var r=d(e.url).split("?")[0]||"",n=t.extract(e.url),i=t.parse(n,{sort:!1}),a=Object.assign(i,e.query),s=t.stringify(a,o);s&&(s="?".concat(s));var c=function(e){var t="",o=e.indexOf("#");return-1!==o&&(t=e.slice(o)),t}(e.url);return e.fragmentIdentifier&&(c="#".concat(l(e.fragmentIdentifier,o))),"".concat(r).concat(s).concat(c)}},function(e,t,o){"use strict";function r(e){var t=Object.create(null);return function(o){return void 0===t[o]&&(t[o]=e(o)),t[o]}}o.d(t,"a",(function(){return i}));var n=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,i=r((function(e){return n.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}))},,,function(e,t){(function(t){e.exports=t}).call(this,{})},,function(e,t,o){"use strict";e.exports=function(e,t){return function(){for(var o=new Array(arguments.length),r=0;r>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},function(e,t,o){"use strict";var r=o(62),n=o(93),i=o(182),a=o(71),s=r.sum32,c=r.sum32_4,u=r.sum32_5,l=i.ch32,m=i.maj32,f=i.s0_256,d=i.s1_256,h=i.g0_256,p=i.g1_256,g=n.BlockHash,b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}r.inherits(y,g),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var o=this.W,r=0;r<16;r++)o[r]=e[t+r];for(;r0&&void 0!==arguments[0]?arguments[0]:3;return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}},function(e,t,o){"use strict"},function(e,t,o){"use strict"},function(e,t,o){"use strict"},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o=1&&e<=40}},function(e,t){var o="[0-9]+",r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",n="(?:(?![A-Z0-9 $%*+\\-./:]|"+(r=r.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";t.KANJI=new RegExp(r,"g"),t.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=new RegExp(n,"g"),t.NUMERIC=new RegExp(o,"g"),t.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var i=new RegExp("^"+r+"$"),a=new RegExp("^"+o+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return i.test(e)},t.testNumeric=function(e){return a.test(e)},t.testAlphanumeric=function(e){return s.test(e)}},function(e,t){function o(e){if("number"===typeof e&&(e=e.toString()),"string"!==typeof e)throw new Error("Color should be defined as hex string");var t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");var o=parseInt(t.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:255&o,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});var t="undefined"===typeof e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,n=e.scale||4;return{width:r,scale:r?4:n,margin:t,color:{dark:o(e.color.dark||"#000000ff"),light:o(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,o){var r=t.getScale(e,o);return Math.floor((e+2*o.margin)*r)},t.qrToImageData=function(e,o,r){for(var n=o.modules.size,i=o.modules.data,a=t.getScale(n,r),s=Math.floor((n+2*r.margin)*a),c=r.margin*a,u=[r.color.light,r.color.dark],l=0;l=c&&m>=c&&le._pos){var i=o.substr(e._pos);if("x-user-defined"===e._charset){for(var a=new n(i.length),s=0;se._pos&&(e.push(new n(new Uint8Array(u.result.slice(e._pos)))),e._pos=u.result.byteLength)},u.onload=function(){e.push(null)},u.readAsArrayBuffer(o)}e._xhr.readyState===c.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,o(27),o(29),o(20).Buffer)},function(e,t,o){"use strict";(function(t,r){var n=o(109);e.exports=v;var i,a=o(428);v.ReadableState=y;o(60).EventEmitter;var s=function(e,t){return e.listeners(t).length},c=o(210),u=o(131).Buffer,l=("undefined"!==typeof t?t:"undefined"!==typeof window?window:"undefined"!==typeof self?self:{}).Uint8Array||function(){};var m=Object.create(o(96));m.inherits=o(23);var f=o(429),d=void 0;d=f&&f.debuglog?f.debuglog("stream"):function(){};var h,p=o(430),g=o(211);m.inherits(v,c);var b=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var r=t instanceof(i=i||o(74));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=o(75).StringDecoder),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function v(e){if(i=i||o(74),!(this instanceof v))return new v(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function k(e,t,o,r,n){var i,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var o=t.decoder.end();o&&o.length&&(t.buffer.push(o),t.length+=t.objectMode?1:o.length)}t.ended=!0,j(e)}(e,a)):(n||(i=function(e,t){var o;r=t,u.isBuffer(r)||r instanceof l||"string"===typeof t||void 0===t||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk"));var r;return o}(a,t)),i?e.emit("error",i):a.objectMode||t&&t.length>0?("string"===typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!o?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):A(e,a)):w(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=x?e=x:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function j(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(M,e):M(e))}function M(e){d("emit readable"),e.emit("readable"),S(e)}function A(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(q,e,t))}function q(e,t){for(var o=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(o=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):o=function(e,t,o){var r;ei.length?i.length:e;if(a===i.length?n+=i:n+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,o.next?t.head=o.next:t.head=t.tail=null):(t.head=o,o.data=i.slice(a));break}++r}return t.length-=r,n}(e,t):function(e,t){var o=u.allocUnsafe(e),r=t.head,n=1;r.data.copy(o),e-=r.data.length;for(;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(o,o.length-e,0,a),0===(e-=a)){a===i.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++n}return t.length-=n,o}(e,t);return r}(e,t.buffer,t.decoder),o);var o}function _(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function O(e,t){for(var o=0,r=e.length;o=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?_(this):j(this),null;if(0===(e=z(e,t))&&t.ended)return 0===t.length&&_(this),null;var r,n=t.needReadable;return d("need readable",n),(0===t.length||t.length-e0?N(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),o!==e&&t.ended&&_(this)),null!==r&&this.emit("data",r),r},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var o=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,d("pipe count=%d opts=%j",i.pipesCount,t);var c=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?l:v;function u(t,r){d("onunpipe"),t===o&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,d("cleanup"),e.removeListener("close",b),e.removeListener("finish",y),e.removeListener("drain",m),e.removeListener("error",g),e.removeListener("unpipe",u),o.removeListener("end",l),o.removeListener("end",v),o.removeListener("data",p),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||m())}function l(){d("onend"),e.end()}i.endEmitted?n.nextTick(c):o.once("end",c),e.on("unpipe",u);var m=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,S(e))}}(o);e.on("drain",m);var f=!1;var h=!1;function p(t){d("ondata"),h=!1,!1!==e.write(t)||h||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==O(i.pipes,e))&&!f&&(d("false write response, pause",i.awaitDrain),i.awaitDrain++,h=!0),o.pause())}function g(t){d("onerror",t),v(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function b(){e.removeListener("finish",y),v()}function y(){d("onfinish"),e.removeListener("close",b),v()}function v(){d("unpipe"),o.unpipe(e)}return o.on("data",p),function(e,t,o){if("function"===typeof e.prependListener)return e.prependListener(t,o);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(o):e._events[t]=[o,e._events[t]]:e.on(t,o)}(e,"error",g),e.once("close",b),e.once("finish",y),e.emit("pipe",o),i.flowing||(d("pipe resume"),o.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,o={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,o)),this;if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i1;){var t=e.pop(),o=t.obj[t.prop];if(i(o)){for(var r=[],n=0;n=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||i===r.RFC1738&&(40===l||41===l)?c+=s.charAt(u):l<128?c+=a[l]:l<2048?c+=a[192|l>>6]+a[128|63&l]:l<55296||l>=57344?c+=a[224|l>>12]+a[128|l>>6&63]+a[128|63&l]:(u+=1,l=65536+((1023&l)<<10|1023&s.charCodeAt(u)),c+=a[240|l>>18]+a[128|l>>12&63]+a[128|l>>6&63]+a[128|63&l])}return c},isBuffer:function(e){return!(!e||"object"!==typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var o=[],r=0;r0)if("string"===typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),r)a.endEmitted?x(e,new w):q(e,a,t,!0);else if(a.ended)x(e,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!o?(t=a.decoder.write(t),a.objectMode||0!==t.length?q(e,a,t,!1):_(e,a)):q(e,a,t,!1)}else r||(a.reading=!1,_(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(N,e))}function N(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function _(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(T,e,t))}function T(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function C(e){u("readable nexttick read 0"),e.read(0)}function D(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?o=t.buffer.shift():!e||e>=t.length?(o=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):o=t.buffer.consume(e,t.decoder),o);var o}function R(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(B,t,e))}function B(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var o=t._writableState;(!o||o.autoDestroy&&o.finished)&&t.destroy()}}function U(e,t){for(var o=0,r=e.length;o=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):S(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&R(this),null;var r,n=t.needReadable;return u("need readable",n),(0===t.length||t.length-e0?P(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),o!==e&&t.ended&&R(this)),null!==r&&this.emit("data",r),r},M.prototype._read=function(e){x(this,new k("_read()"))},M.prototype.pipe=function(e,t){var o=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:g;function s(t,r){u("onunpipe"),t===o&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,u("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",l),e.removeListener("error",d),e.removeListener("unpipe",s),o.removeListener("end",c),o.removeListener("end",g),o.removeListener("data",f),m=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){u("onend"),e.end()}n.endEmitted?r.nextTick(a):o.once("end",a),e.on("unpipe",s);var l=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,L(e))}}(o);e.on("drain",l);var m=!1;function f(t){u("ondata");var r=e.write(t);u("dest.write",r),!1===r&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==U(n.pipes,e))&&!m&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),o.pause())}function d(t){u("onerror",t),g(),e.removeListener("error",d),0===i(e,"error")&&x(e,t)}function h(){e.removeListener("finish",p),g()}function p(){u("onfinish"),e.removeListener("close",h),g()}function g(){u("unpipe"),o.unpipe(e)}return o.on("data",f),function(e,t,o){if("function"===typeof e.prependListener)return e.prependListener(t,o);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(o):e._events[t]=[o,e._events[t]]:e.on(t,o)}(e,"error",d),e.once("close",h),e.once("finish",p),e.emit("pipe",o),n.flowing||(u("pipe resume"),o.resume()),e},M.prototype.unpipe=function(e){var t=this._readableState,o={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,o)),this;if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?S(this):n.reading||r.nextTick(C,this))),o},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(e,t){var o=a.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(O,this),o},M.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(O,this),t},M.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(D,e,t))}(this,e)),e.paused=!1,this},M.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(e){var t=this,o=this._readableState,r=!1;for(var n in e.on("end",(function(){if(u("wrapped end"),o.decoder&&!o.ended){var e=o.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(u("wrapped data"),o.decoder&&(n=o.decoder.write(n)),!o.objectMode||null!==n&&void 0!==n)&&((o.objectMode||n&&n.length)&&(t.push(n)||(r=!0,e.pause())))})),e)void 0===this[n]&&"function"===typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var i=0;i-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(e,t,o){o(new p("_write()"))},M.prototype._writev=null,M.prototype.end=function(e,t,o){var n=this._writableState;return"function"===typeof e?(o=e,e=null,t=null):"function"===typeof t&&(o=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,o){t.ending=!0,N(e,t),o&&(t.finished?r.nextTick(o):e.once("finish",o));t.ended=!0,e.writable=!1}(this,n,o),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),M.prototype.destroy=m.destroy,M.prototype._undestroy=m.undestroy,M.prototype._destroy=function(e,t){t(e)}}).call(this,o(29),o(27))},function(e,t,o){"use strict";e.exports=l;var r=o(82).codes,n=r.ERR_METHOD_NOT_IMPLEMENTED,i=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,c=o(83);function u(e,t){var o=this._transformState;o.transforming=!1;var r=o.writecb;if(null===r)return this.emit("error",new i);o.writechunk=null,o.writecb=null,null!=t&&this.push(t),r(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length>8,a=255&n;i?o.push(i,a):o.push(a)}return o},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},function(e,t,o){var r;function n(e){this.rand=e}if(e.exports=function(e){return r||(r=new n(null)),r.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),o=0;o=this._blockSize;){for(var i=this._blockOffset;i0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},i.prototype._update=function(){throw new Error("_update is not implemented")},i.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var o=0;o<4;++o)this._length[o]=0;return t},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i},function(e,t,o){"use strict";(function(t,r){var n;e.exports=M,M.ReadableState=j;o(60).EventEmitter;var i=function(e,t){return e.listeners(t).length},a=o(230),s=o(20).Buffer,c=("undefined"!==typeof t?t:"undefined"!==typeof window?window:"undefined"!==typeof self?self:{}).Uint8Array||function(){};var u,l=o(500);u=l&&l.debuglog?l.debuglog("stream"):function(){};var m,f,d,h=o(501),p=o(231),g=o(232).getHighWaterMark,b=o(85).codes,y=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,k=b.ERR_METHOD_NOT_IMPLEMENTED,w=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;o(23)(M,a);var x=p.errorOrDestroy,z=["error","close","destroy","pause","resume"];function j(e,t,r){n=n||o(86),e=e||{},"boolean"!==typeof r&&(r=t instanceof n),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",r),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(m||(m=o(75).StringDecoder),this.decoder=new m(e.encoding),this.encoding=e.encoding)}function M(e){if(n=n||o(86),!(this instanceof M))return new M(e);var t=this instanceof n;this._readableState=new j(e,this,t),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function A(e,t,o,r,n){u("readableAddChunk",t);var i,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var o=t.decoder.end();o&&o.length&&(t.buffer.push(o),t.length+=t.objectMode?1:o.length)}t.ended=!0,t.sync?S(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,N(e)))}(e,a);else if(n||(i=function(e,t){var o;r=t,s.isBuffer(r)||r instanceof c||"string"===typeof t||void 0===t||e.objectMode||(o=new y("chunk",["string","Buffer","Uint8Array"],t));var r;return o}(a,t)),i)x(e,i);else if(a.objectMode||t&&t.length>0)if("string"===typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),r)a.endEmitted?x(e,new w):q(e,a,t,!0);else if(a.ended)x(e,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!o?(t=a.decoder.write(t),a.objectMode||0!==t.length?q(e,a,t,!1):_(e,a)):q(e,a,t,!1)}else r||(a.reading=!1,_(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(N,e))}function N(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function _(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(T,e,t))}function T(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function C(e){u("readable nexttick read 0"),e.read(0)}function D(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?o=t.buffer.shift():!e||e>=t.length?(o=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):o=t.buffer.consume(e,t.decoder),o);var o}function R(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(B,t,e))}function B(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var o=t._writableState;(!o||o.autoDestroy&&o.finished)&&t.destroy()}}function U(e,t){for(var o=0,r=e.length;o=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):S(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&R(this),null;var r,n=t.needReadable;return u("need readable",n),(0===t.length||t.length-e0?P(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),o!==e&&t.ended&&R(this)),null!==r&&this.emit("data",r),r},M.prototype._read=function(e){x(this,new k("_read()"))},M.prototype.pipe=function(e,t){var o=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:g;function s(t,r){u("onunpipe"),t===o&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,u("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",l),e.removeListener("error",d),e.removeListener("unpipe",s),o.removeListener("end",c),o.removeListener("end",g),o.removeListener("data",f),m=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){u("onend"),e.end()}n.endEmitted?r.nextTick(a):o.once("end",a),e.on("unpipe",s);var l=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,L(e))}}(o);e.on("drain",l);var m=!1;function f(t){u("ondata");var r=e.write(t);u("dest.write",r),!1===r&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==U(n.pipes,e))&&!m&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),o.pause())}function d(t){u("onerror",t),g(),e.removeListener("error",d),0===i(e,"error")&&x(e,t)}function h(){e.removeListener("finish",p),g()}function p(){u("onfinish"),e.removeListener("close",h),g()}function g(){u("unpipe"),o.unpipe(e)}return o.on("data",f),function(e,t,o){if("function"===typeof e.prependListener)return e.prependListener(t,o);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(o):e._events[t]=[o,e._events[t]]:e.on(t,o)}(e,"error",d),e.once("close",h),e.once("finish",p),e.emit("pipe",o),n.flowing||(u("pipe resume"),o.resume()),e},M.prototype.unpipe=function(e){var t=this._readableState,o={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,o)),this;if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?S(this):n.reading||r.nextTick(C,this))),o},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(e,t){var o=a.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(O,this),o},M.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(O,this),t},M.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(D,e,t))}(this,e)),e.paused=!1,this},M.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(e){var t=this,o=this._readableState,r=!1;for(var n in e.on("end",(function(){if(u("wrapped end"),o.decoder&&!o.ended){var e=o.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(u("wrapped data"),o.decoder&&(n=o.decoder.write(n)),!o.objectMode||null!==n&&void 0!==n)&&((o.objectMode||n&&n.length)&&(t.push(n)||(r=!0,e.pause())))})),e)void 0===this[n]&&"function"===typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var i=0;i-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(e,t,o){o(new p("_write()"))},M.prototype._writev=null,M.prototype.end=function(e,t,o){var n=this._writableState;return"function"===typeof e?(o=e,e=null,t=null):"function"===typeof t&&(o=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,o){t.ending=!0,N(e,t),o&&(t.finished?r.nextTick(o):e.once("finish",o));t.ended=!0,e.writable=!1}(this,n,o),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),M.prototype.destroy=m.destroy,M.prototype._undestroy=m.undestroy,M.prototype._destroy=function(e,t){t(e)}}).call(this,o(29),o(27))},function(e,t,o){"use strict";e.exports=l;var r=o(85).codes,n=r.ERR_METHOD_NOT_IMPLEMENTED,i=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,c=o(86);function u(e,t){var o=this._transformState;o.transforming=!1;var r=o.writecb;if(null===r)return this.emit("error",new i);o.writechunk=null,o.writecb=null,null!=t&&this.push(t),r(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}r(c,n),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,o=this._w,r=0|this._a,n=0|this._b,i=0|this._c,s=0|this._d,c=0|this._e,h=0|this._f,p=0|this._g,g=0|this._h,b=0;b<16;++b)o[b]=e.readInt32BE(4*b);for(;b<64;++b)o[b]=0|(((t=o[b-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+o[b-7]+d(o[b-15])+o[b-16];for(var y=0;y<64;++y){var v=g+f(c)+u(c,h,p)+a[y]+o[y]|0,k=m(r)+l(r,n,i)|0;g=p,p=h,h=c,c=s+v|0,s=i,i=n,n=r,r=v+k|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=h+this._f|0,this._g=p+this._g|0,this._h=g+this._h|0},c.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},function(e,t,o){var r=o(23),n=o(87),i=o(47).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function c(){this.init(),this._w=s,n.call(this,128,112)}function u(e,t,o){return o^e&(t^o)}function l(e,t,o){return e&t|o&(e|t)}function m(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function f(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function p(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function b(e,t){return e>>>0>>0?1:0}r(c,n),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,o=0|this._ah,r=0|this._bh,n=0|this._ch,i=0|this._dh,s=0|this._eh,c=0|this._fh,y=0|this._gh,v=0|this._hh,k=0|this._al,w=0|this._bl,x=0|this._cl,z=0|this._dl,j=0|this._el,M=0|this._fl,A=0|this._gl,q=0|this._hl,I=0;I<32;I+=2)t[I]=e.readInt32BE(4*I),t[I+1]=e.readInt32BE(4*I+4);for(;I<160;I+=2){var E=t[I-30],S=t[I-30+1],N=d(E,S),_=h(S,E),T=p(E=t[I-4],S=t[I-4+1]),O=g(S,E),C=t[I-14],D=t[I-14+1],L=t[I-32],P=t[I-32+1],R=_+D|0,B=N+C+b(R,_)|0;B=(B=B+T+b(R=R+O|0,O)|0)+L+b(R=R+P|0,P)|0,t[I]=B,t[I+1]=R}for(var U=0;U<160;U+=2){B=t[U],R=t[U+1];var F=l(o,r,n),Q=l(k,w,x),Y=m(o,k),H=m(k,o),G=f(s,j),W=f(j,s),Z=a[U],V=a[U+1],K=u(s,c,y),J=u(j,M,A),X=q+W|0,$=v+G+b(X,q)|0;$=($=($=$+K+b(X=X+J|0,J)|0)+Z+b(X=X+V|0,V)|0)+B+b(X=X+R|0,R)|0;var ee=H+Q|0,te=Y+F+b(ee,H)|0;v=y,q=A,y=c,A=M,c=s,M=j,s=i+$+b(j=z+X|0,z)|0,i=n,z=x,n=r,x=w,r=o,w=k,o=$+te+b(k=X+ee|0,X)|0}this._al=this._al+k|0,this._bl=this._bl+w|0,this._cl=this._cl+x|0,this._dl=this._dl+z|0,this._el=this._el+j|0,this._fl=this._fl+M|0,this._gl=this._gl+A|0,this._hl=this._hl+q|0,this._ah=this._ah+o+b(this._al,k)|0,this._bh=this._bh+r+b(this._bl,w)|0,this._ch=this._ch+n+b(this._cl,x)|0,this._dh=this._dh+i+b(this._dl,z)|0,this._eh=this._eh+s+b(this._el,j)|0,this._fh=this._fh+c+b(this._fl,M)|0,this._gh=this._gh+y+b(this._gl,A)|0,this._hh=this._hh+v+b(this._hl,q)|0},c.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,o,r){e.writeInt32BE(t,r),e.writeInt32BE(o,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=c},function(e,t){e.exports=function(e){if("string"!==typeof e)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof e+", while checking isHexPrefixed.");return"0x"===e.slice(0,2)}},function(e,t,o){"use strict";var r=function(e,t){return function(){for(var o=this,r=t.promiseModule,n=new Array(arguments.length),i=0;i-1&&e%1==0&&e<=9007199254740991}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,o,c){if(c=(0,n.default)(c||r.default),e<=0||!t)return c(null);var u=(0,i.default)(t),l=!1,m=0,f=!1;function d(e,t){if(m-=1,e)l=!0,c(e);else{if(t===s.default||l&&m<=0)return l=!0,c(null);f||h()}}function h(){for(f=!0;m=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function a(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}function s(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":return"fork";case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"eth_blockNumber":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":return"never"}}e.exports={cacheIdentifierForPayload:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n(e))return null;var o=t.includeBlockRef?e.params:i(e);return e.method+":"+r(o)},canCache:n,blockTagForPayload:function(e){var t=a(e);if(t>=e.params.length)return null;return e.params[t]},paramsWithoutBlockTag:i,blockTagParamIndex:a,cacheTypeForPayload:s}},function(e,t,o){"use strict";var r="undefined"!==typeof JSON?JSON:o(557),n=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},i=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},o=[];for(var r in e)t.call(e,r)&&o.push(r);return o};e.exports=function(e,t){t||(t={}),"function"===typeof t&&(t={cmp:t});var o=t.space||"";"number"===typeof o&&(o=Array(o+1).join(" "));var a,s="boolean"===typeof t.cycles&&t.cycles,c=t.replacer||function(e,t){return t},u=t.cmp&&(a=t.cmp,function(e){return function(t,o){var r={key:t,value:e[t]},n={key:o,value:e[o]};return a(r,n)}}),l=[];return function e(t,a,m,f){var d=o?"\n"+new Array(f+1).join(o):"",h=o?": ":":";if(m&&m.toJSON&&"function"===typeof m.toJSON&&(m=m.toJSON()),void 0!==(m=c.call(t,a,m))){if("object"!==typeof m||null===m)return r.stringify(m);if(n(m)){for(var p=[],g=0;g0?t.on("sync",k):o>0&&0===r&&t.removeListener("sync",k)}}},function(e,t,o){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[o]}})}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),n=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||r(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),n(o(567),t),n(o(568),t),n(o(569),t),n(o(255),t),n(o(256),t),n(o(576),t)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueId=void 0;var r=4294967295,n=Math.floor(Math.random()*r);t.getUniqueId=function(){return n=(n+1)%r}},function(e,t,o){"use strict";var r=o(94).default,n=o(33).default,i=o(80).default,a=o(48).default,s=o(38).default,c=o(39).default,u=o(41).default,l=o(42).default,m=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcEngine=void 0;var f=m(o(150)),d=o(570),h=function(e){u(o,e);var t=l(o);function o(){var e;return s(this,o),(e=t.call(this))._middleware=[],e}return c(o,[{key:"push",value:function(e){this._middleware.push(e)}},{key:"handle",value:function(e,t){if(t&&"function"!==typeof t)throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}},{key:"asMiddleware",value:function(){var e=this;return function(){var t=a(n().mark((function t(r,s,c,u){var l,m,f,d,h;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o._runAllMiddleware(r,s,e._middleware);case 3:if(l=t.sent,m=i(l,3),f=m[0],d=m[1],h=m[2],!d){t.next=12;break}return t.next=11,o._runReturnHandlers(h);case 11:return t.abrupt("return",u(f));case 12:return t.abrupt("return",c(function(){var e=a(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o._runReturnHandlers(h);case 3:e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(0),e.abrupt("return",t(e.t0));case 8:return e.abrupt("return",t());case 9:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t){return e.apply(this,arguments)}}()));case 15:return t.prev=15,t.t0=t.catch(0),t.abrupt("return",u(t.t0));case 18:case"end":return t.stop()}}),t,null,[[0,15]])})));return function(e,o,r,n){return t.apply(this,arguments)}}()}},{key:"_handleBatch",value:function(){var e=a(n().mark((function e(t,o){var r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.all(t.map(this._promiseHandle.bind(this)));case 3:if(r=e.sent,!o){e.next=6;break}return e.abrupt("return",o(null,r));case 6:return e.abrupt("return",r);case 9:if(e.prev=9,e.t0=e.catch(0),!o){e.next=13;break}return e.abrupt("return",o(e.t0));case 13:throw e.t0;case 14:case"end":return e.stop()}}),e,this,[[0,9]])})));return function(t,o){return e.apply(this,arguments)}}()},{key:"_promiseHandle",value:function(e){var t=this;return new Promise((function(o){t._handle(e,(function(e,t){o(t)}))}))}},{key:"_handle",value:function(){var e=a(n().mark((function e(t,o){var r,i,a,s,c;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&!Array.isArray(t)&&"object"===typeof t){e.next=3;break}return r=new d.EthereumRpcError(d.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: ".concat(typeof t),{request:t}),e.abrupt("return",o(r,{id:void 0,jsonrpc:"2.0",error:r}));case 3:if("string"===typeof t.method){e.next=6;break}return i=new d.EthereumRpcError(d.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: ".concat(typeof t.method),{request:t}),e.abrupt("return",o(i,{id:t.id,jsonrpc:"2.0",error:i}));case 6:return a=Object.assign({},t),s={id:a.id,jsonrpc:a.jsonrpc},c=null,e.prev=9,e.next=12,this._processRequest(a,s);case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(9),c=e.t0;case 17:return c&&(delete s.result,s.error||(s.error=d.serializeError(c))),e.abrupt("return",o(c,s));case 19:case"end":return e.stop()}}),e,this,[[9,14]])})));return function(t,o){return e.apply(this,arguments)}}()},{key:"_processRequest",value:function(){var e=a(n().mark((function e(t,r){var a,s,c,u,l;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o._runAllMiddleware(t,r,this._middleware);case 2:return a=e.sent,s=i(a,3),c=s[0],u=s[1],l=s[2],o._checkForCompletion(t,r,u),e.next=10,o._runReturnHandlers(l);case 10:if(!c){e.next=12;break}throw c;case 12:case"end":return e.stop()}}),e,this)})));return function(t,o){return e.apply(this,arguments)}}()}],[{key:"_runAllMiddleware",value:function(){var e=a(n().mark((function e(t,a,s){var c,u,l,m,f,d,h,p;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=[],u=null,l=!1,m=r(s),e.prev=4,m.s();case 6:if((f=m.n()).done){e.next=18;break}return d=f.value,e.next=10,o._runMiddleware(t,a,d,c);case 10:if(h=e.sent,p=i(h,2),u=p[0],!(l=p[1])){e.next=16;break}return e.abrupt("break",18);case 16:e.next=6;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(4),m.e(e.t0);case 23:return e.prev=23,m.f(),e.finish(23);case 26:return e.abrupt("return",[u,l,c.reverse()]);case 27:case"end":return e.stop()}}),e,null,[[4,20,23,26]])})));return function(t,o,r){return e.apply(this,arguments)}}()},{key:"_runMiddleware",value:function(e,t,o,r){return new Promise((function(n){var i=function(e){var o=e||t.error;o&&(t.error=d.serializeError(o)),n([o,!0])};try{o(e,t,(function(o){t.error?i(t.error):(o&&("function"!==typeof o&&i(new d.EthereumRpcError(d.errorCodes.rpc.internal,'JsonRpcEngine: "next" return handlers must be functions. '+'Received "'.concat(typeof o,'" for request:\n').concat(p(e)),{request:e})),r.push(o)),n([null,!1]))}),i)}catch(a){i(a)}}))}},{key:"_runReturnHandlers",value:function(){var e=a(n().mark((function e(t){var o,i,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=r(t),e.prev=1,a=n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.value,e.next=3,new Promise((function(e,o){t((function(t){return t?o(t):e()}))}));case 3:case"end":return e.stop()}}),e)})),o.s();case 4:if((i=o.n()).done){e.next=8;break}return e.delegateYield(a(),"t0",6);case 6:e.next=4;break;case 8:e.next=13;break;case 10:e.prev=10,e.t1=e.catch(1),o.e(e.t1);case 13:return e.prev=13,o.f(),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_checkForCompletion",value:function(e,t,o){if(!("result"in t)&&!("error"in t))throw new d.EthereumRpcError(d.errorCodes.rpc.internal,"JsonRpcEngine: Response has no error or result for request:\n".concat(p(e)),{request:e});if(!o)throw new d.EthereumRpcError(d.errorCodes.rpc.internal,"JsonRpcEngine: Nothing ended request:\n".concat(p(e)),{request:e})}}]),o}(f.default);function p(e){return JSON.stringify(e,null,2)}t.JsonRpcEngine=h},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var r=o(152),n=o(151),i=r.errorCodes.rpc.internal,a="Unspecified error message. This is a bug, please report it.",s={code:i,message:c(i)};function c(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;if(Number.isInteger(e)){var n=e.toString();if(f(r.errorValues,n))return r.errorValues[n].message;if(l(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return o}function u(e){if(!Number.isInteger(e))return!1;var t=e.toString();return!!r.errorValues[t]||!!l(e)}function l(e){return e>=-32099&&e<=-32e3}function m(e){return e&&"object"===typeof e&&!Array.isArray(e)?Object.assign({},e):e}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=c,t.isValidCode=u,t.serializeError=function(e){var t,o,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.fallbackError,a=void 0===i?s:i,l=r.shouldIncludeStack,d=void 0!==l&&l;if(!a||!Number.isInteger(a.code)||"string"!==typeof a.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof n.EthereumRpcError)return e.serialize();var h={};if(e&&"object"===typeof e&&!Array.isArray(e)&&f(e,"code")&&u(e.code)){var p=e;h.code=p.code,p.message&&"string"===typeof p.message?(h.message=p.message,f(p,"data")&&(h.data=p.data)):(h.message=c(h.code),h.data={originalError:m(e)})}else{h.code=a.code;var g=null===(t=e)||void 0===t?void 0:t.message;h.message=g&&"string"===typeof g?g:a.message,h.data={originalError:m(e)}}var b=null===(o=e)||void 0===o?void 0:o.stack;return d&&e&&b&&"string"===typeof b&&(h.stack=b),h}},function(e,t,o){e.exports=o(577)},function(e,t,o){var r=o(214);e.exports=function(e,t,o){return(t=r(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOutput=void 0;var r=["regex","typo","disposable","mx","smtp"];t.createOutput=function(e,t){var o={valid:!0,validators:{}};e&&(o.reason=e,o.valid=!1);for(var n=!0,i=0;id)&&(R=(F=F.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(g,"$1"+e.trim());case 58:return e.trim()+t.replace(g,"$1"+e.trim());default:if(0<1*o&&0c.charCodeAt(8))break;case 115:a=a.replace(c,"-webkit-"+c)+";"+a;break;case 207:case 102:a=a.replace(c,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],0>8,a=255&n;i?o.push(i,a):o.push(a)}return o},o.zero2=r,o.toHex=n,o.encode=function(e,t){return"hex"===t?n(e):e}})),m=s((function(e,t){var o=t;o.assert=c,o.toArray=l.toArray,o.zero2=l.zero2,o.toHex=l.toHex,o.encode=l.encode,o.getNAF=function(e,t,o){var r=new Array(Math.max(e.bitLength(),o)+1);r.fill(0);for(var n=1<(n>>1)-1?(n>>1)-c:c,i.isubn(s)):s=0,r[a]=s,i.iushrn(1)}return r},o.getJSF=function(e,t){var o=[[],[]];e=e.clone(),t=t.clone();for(var r,n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var a,s,c=e.andln(3)+n&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),a=0===(1&c)?0:3!==(r=e.andln(7)+n&7)&&5!==r||2!==u?c:-c,o[0].push(a),s=0===(1&u)?0:3!==(r=t.andln(7)+i&7)&&5!==r||2!==c?u:-u,o[1].push(s),2*n===a+1&&(n=1-n),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return o},o.cachedProperty=function(e,t,o){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=o.call(this)}},o.parseBytes=function(e){return"string"===typeof e?o.toArray(e,"hex"):e},o.intFromLE=function(e){return new n.a(e,"hex","le")}})),f=m.getNAF,d=m.getJSF,h=m.assert;function p(e,t){this.type=e,this.p=new n.a(t.p,16),this.red=t.prime?n.a.red(t.prime):n.a.mont(this.p),this.zero=new n.a(0).toRed(this.red),this.one=new n.a(1).toRed(this.red),this.two=new n.a(2).toRed(this.red),this.n=t.n&&new n.a(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var o=this.n&&this.p.div(this.n);!o||o.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var g=p;function b(e,t){this.curve=e,this.type=t,this.precomputed=null}p.prototype.point=function(){throw new Error("Not implemented")},p.prototype.validate=function(){throw new Error("Not implemented")},p.prototype._fixedNafMul=function(e,t){h(e.precomputed);var o=e._getDoubles(),r=f(t,1,this._bitLength),n=(1<=i;c--)a=(a<<1)+r[c];s.push(a)}for(var u=this.jpoint(null,null,null),l=this.jpoint(null,null,null),m=n;m>0;m--){for(i=0;i=0;s--){for(var c=0;s>=0&&0===i[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=i[s];h(0!==u),a="affine"===e.type?u>0?a.mixedAdd(n[u-1>>1]):a.mixedAdd(n[-u-1>>1].neg()):u>0?a.add(n[u-1>>1]):a.add(n[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},p.prototype._wnafMulAdd=function(e,t,o,r,n){var i,a,s,c=this._wnafT1,u=this._wnafT2,l=this._wnafT3,m=0;for(i=0;i=1;i-=2){var p=i-1,g=i;if(1===c[p]&&1===c[g]){var b=[t[p],null,null,t[g]];0===t[p].y.cmp(t[g].y)?(b[1]=t[p].add(t[g]),b[2]=t[p].toJ().mixedAdd(t[g].neg())):0===t[p].y.cmp(t[g].y.redNeg())?(b[1]=t[p].toJ().mixedAdd(t[g]),b[2]=t[p].add(t[g].neg())):(b[1]=t[p].toJ().mixedAdd(t[g]),b[2]=t[p].toJ().mixedAdd(t[g].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=d(o[p],o[g]);for(m=Math.max(v[0].length,m),l[p]=new Array(m),l[g]=new Array(m),a=0;a=0;i--){for(var j=0;i>=0;){var M=!0;for(a=0;a=0&&j++,x=x.dblp(j),i<0)break;for(a=0;a0?s=u[a][A-1>>1]:A<0&&(s=u[a][-A-1>>1].neg()),x="affine"===s.type?x.mixedAdd(s):x.add(s))}}for(i=0;i=Math.ceil((e.bitLength()+1)/t.step)},b.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var o=[this],r=this,n=0;n=0&&(a=t,s=o),r.negative&&(r=r.neg(),i=i.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:r,b:i},{a:a,b:s}]},k.prototype._endoSplit=function(e){var t=this.endo.basis,o=t[0],r=t[1],n=r.b.mul(e).divRound(this.n),i=o.b.neg().mul(e).divRound(this.n),a=n.mul(o.a),s=i.mul(r.a),c=n.mul(o.b),u=i.mul(r.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},k.prototype.pointFromX=function(e,t){(e=new n.a(e,16)).red||(e=e.toRed(this.red));var o=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=o.redSqrt();if(0!==r.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},k.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,o=e.y,r=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===o.redSqr().redISub(n).cmpn(0)},k.prototype._endoWnafMulAdd=function(e,t,o){for(var r=this._endoWnafT1,n=this._endoWnafT2,i=0;i":""},x.prototype.isInfinity=function(){return this.inf},x.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var o=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,r)},x.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,o=this.x.redSqr(),r=e.redInvm(),n=o.redAdd(o).redIAdd(o).redIAdd(t).redMul(r),i=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},x.prototype.getX=function(){return this.x.fromRed()},x.prototype.getY=function(){return this.y.fromRed()},x.prototype.mul=function(e){return e=new n.a(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},x.prototype.mulAdd=function(e,t,o){var r=[this,t],n=[e,o];return this.curve.endo?this.curve._endoWnafMulAdd(r,n):this.curve._wnafMulAdd(1,r,n,2)},x.prototype.jmulAdd=function(e,t,o){var r=[this,t],n=[e,o];return this.curve.endo?this.curve._endoWnafMulAdd(r,n,!0):this.curve._wnafMulAdd(1,r,n,2,!0)},x.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},x.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var o=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:o.naf&&{wnd:o.naf.wnd,points:o.naf.points.map(r)},doubles:o.doubles&&{step:o.doubles.step,points:o.doubles.points.map(r)}}}return t},x.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},y(z,g.BasePoint),k.prototype.jpoint=function(e,t,o){return new z(this,e,t,o)},z.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),o=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(o,r)},z.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},z.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),o=this.z.redSqr(),r=this.x.redMul(t),n=e.x.redMul(o),i=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(o.redMul(this.z)),s=r.redSub(n),c=i.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),m=r.redMul(u),f=c.redSqr().redIAdd(l).redISub(m).redISub(m),d=c.redMul(m.redISub(f)).redISub(i.redMul(l)),h=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(f,d,h)},z.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),o=this.x,r=e.x.redMul(t),n=this.y,i=e.y.redMul(t).redMul(this.z),a=o.redSub(r),s=n.redSub(i);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),l=o.redMul(c),m=s.redSqr().redIAdd(u).redISub(l).redISub(l),f=s.redMul(l.redISub(m)).redISub(n.redMul(u)),d=this.z.redMul(a);return this.curve.jpoint(m,f,d)},z.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var o=this;for(t=0;t=0)return!1;if(o.redIAdd(n),0===this.x.cmp(o))return!0}},z.prototype.inspect=function(){return this.isInfinity()?"":""},z.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var j=s((function(e,t){var o=t;o.base=g,o.short=w,o.mont=null,o.edwards=null})),M=s((function(e,t){var o,r=t,n=m.assert;function i(e){"short"===e.type?this.curve=new j.short(e):"edwards"===e.type?this.curve=new j.edwards(e):this.curve=new j.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var o=new i(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:o}),o}})}r.PresetCurve=i,s("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:a.a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:a.a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:a.a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:a.a.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"]}),s("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:a.a.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.a.sha256,gRed:!1,g:["9"]}),s("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:a.a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{o=null.crash()}catch(c){o=void 0}s("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:a.a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})}));function A(e){if(!(this instanceof A))return new A(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=l.toArray(e.entropy,e.entropyEnc||"hex"),o=l.toArray(e.nonce,e.nonceEnc||"hex"),r=l.toArray(e.pers,e.persEnc||"hex");c(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,o,r)}var q=A;A.prototype._init=function(e,t,o){var r=e.concat(t).concat(o);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(o||[])),this._reseed=1},A.prototype.generate=function(e,t,o,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(r=o,o=t,t=null),o&&(o=l.toArray(o,r||"hex"),this._update(o));for(var n=[];n.length"};var N=m.assert;function _(e,t){if(e instanceof _)return e;this._importDER(e,t)||(N(e.r&&e.s,"Signature without r or s"),this.r=new n.a(e.r,16),this.s=new n.a(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var T=_;function O(){this.place=0}function C(e,t){var o=e[t.place++];if(!(128&o))return o;var r=15&o;if(0===r||r>4)return!1;for(var n=0,i=0,a=t.place;i>>=0;return!(n<=127)&&(t.place=a,n)}function D(e){for(var t=0,o=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|o);--o;)e.push(t>>>(o<<3)&255);e.push(t)}}_.prototype._importDER=function(e,t){e=m.toArray(e,t);var o=new O;if(48!==e[o.place++])return!1;var r=C(e,o);if(!1===r)return!1;if(r+o.place!==e.length)return!1;if(2!==e[o.place++])return!1;var i=C(e,o);if(!1===i)return!1;var a=e.slice(o.place,i+o.place);if(o.place+=i,2!==e[o.place++])return!1;var s=C(e,o);if(!1===s)return!1;if(e.length!==s+o.place)return!1;var c=e.slice(o.place,s+o.place);if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}return this.r=new n.a(a),this.s=new n.a(c),this.recoveryParam=null,!0},_.prototype.toDER=function(e){var t=this.r.toArray(),o=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&o[0]&&(o=[0].concat(o)),t=D(t),o=D(o);!o[0]&&!(128&o[1]);)o=o.slice(1);var r=[2];L(r,t.length),(r=r.concat(t)).push(2),L(r,o.length);var n=r.concat(o),i=[48];return L(i,n.length),i=i.concat(n),m.encode(i,e)};var P=function(){throw new Error("unsupported")},R=m.assert;function B(e){if(!(this instanceof B))return new B(e);"string"===typeof e&&(R(Object.prototype.hasOwnProperty.call(M,e),"Unknown curve "+e),e=M[e]),e instanceof M.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var U=B;B.prototype.keyPair=function(e){return new S(this,e)},B.prototype.keyFromPrivate=function(e,t){return S.fromPrivate(this,e,t)},B.prototype.keyFromPublic=function(e,t){return S.fromPublic(this,e,t)},B.prototype.genKeyPair=function(e){e||(e={});for(var t=new q({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||P(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),o=this.n.byteLength(),r=this.n.sub(new n.a(2));;){var i=new n.a(t.generate(o));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},B.prototype._truncateToN=function(e,t){var o=8*e.byteLength()-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},B.prototype.sign=function(e,t,o,r){"object"===typeof o&&(r=o,o=null),r||(r={}),t=this.keyFromPrivate(t,o),e=this._truncateToN(new n.a(e,16));for(var i=this.n.byteLength(),a=t.getPrivate().toArray("be",i),s=e.toArray("be",i),c=new q({hash:this.hash,entropy:a,nonce:s,pers:r.pers,persEnc:r.persEnc||"utf8"}),u=this.n.sub(new n.a(1)),l=0;;l++){var m=r.k?r.k(l):new n.a(c.generate(this.n.byteLength()));if(!((m=this._truncateToN(m,!0)).cmpn(1)<=0||m.cmp(u)>=0)){var f=this.g.mul(m);if(!f.isInfinity()){var d=f.getX(),h=d.umod(this.n);if(0!==h.cmpn(0)){var p=m.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(f.getY().isOdd()?1:0)|(0!==d.cmp(h)?2:0);return r.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new T({r:h,s:p,recoveryParam:g})}}}}}},B.prototype.verify=function(e,t,o,r){e=this._truncateToN(new n.a(e,16)),o=this.keyFromPublic(o,r);var i=(t=new T(t,"hex")).r,a=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,c=a.invm(this.n),u=c.mul(e).umod(this.n),l=c.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,o.getPublic(),l)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(u,o.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},B.prototype.recoverPubKey=function(e,t,o,r){R((3&o)===o,"The recovery param is more than two bits"),t=new T(t,r);var i=this.n,a=new n.a(e),s=t.r,c=t.s,u=1&o,l=o>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var m=t.r.invm(i),f=i.sub(a).mul(m).umod(i),d=c.mul(m).umod(i);return this.g.mulAdd(f,s,d)},B.prototype.getKeyRecoveryParam=function(e,t,o,r){if(null!==(t=new T(t,r)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var i;try{i=this.recoverPubKey(e,t,n)}catch(e){continue}if(i.eq(o))return n}throw new Error("Unable to find valid recovery factor")};var F=s((function(e,t){var o=t;o.version="6.5.4",o.utils=m,o.rand=function(){throw new Error("unsupported")},o.curve=j,o.curves=M,o.ec=U,o.eddsa=null})).ec}).call(this,o(29))},function(e,t,o){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var o=function(){};o.prototype=t.prototype,e.prototype=new o,e.prototype.constructor=e}function i(e,t,o){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(o=t,t=10),this._init(e||0,t||10,o||"be"))}var a;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:o(387).Buffer}catch(I){}function s(e,t){var o=e.charCodeAt(t);return o>=48&&o<=57?o-48:o>=65&&o<=70?o-55:o>=97&&o<=102?o-87:void r(!1,"Invalid character in "+e)}function c(e,t,o){var r=s(e,o);return o-1>=t&&(r|=s(e,o-1)<<4),r}function u(e,t,o,n){for(var i=0,a=0,s=Math.min(e.length,o),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,o){if("number"===typeof e)return this._initNumber(e,t,o);if("object"===typeof e)return this._initArray(e,t,o);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===o)for(n=0,i=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,o){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=c(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=n>>>26):i+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=n>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,o){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-o,a=i%r,s=Math.min(i,i-a)+o,c=0,l=o;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=m}catch(I){i.prototype.inspect=m}else i.prototype.inspect=m;function m(){return(this.red?""}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(e,t){var o;if(t=0|t||1,16===(e=e||10)||"hex"===e){o="";for(var n=0,i=0,a=0;a>>24-n&16777215,(n+=2)>=26&&(n-=26,a--),o=0!==i||a!==this.length-1?f[6-c.length]+c+o:c+o}for(0!==i&&(o=i.toString(16)+o);o.length%t!==0;)o="0"+o;return 0!==this.negative&&(o="-"+o),o}if(e===(0|e)&&e>=2&&e<=36){var u=d[e],l=h[e];o="";var m=this.clone();for(m.negative=0;!m.isZero();){var p=m.modrn(l).toString(e);o=(m=m.idivn(l)).isZero()?p+o:f[u-p.length]+p+o}for(this.isZero()&&(o="0"+o);o.length%t!==0;)o="0"+o;return 0!==this.negative&&(o="-"+o),o}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function p(e,t,o){o.negative=t.negative^e.negative;var r=e.length+t.length|0;o.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],a=n*i,s=67108863&a,c=a/67108864|0;o.words[0]=s;for(var u=1;u>>26,m=67108863&c,f=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=f;d++){var h=u-d|0;l+=(a=(n=0|e.words[h])*(i=0|t.words[d])+m)/67108864|0,m=67108863&a}o.words[u]=0|m,c=0|l}return 0!==c?o.words[u]=0|c:o.length--,o._strip()}i.prototype.toArrayLike=function(e,t,o){this._strip();var n=this.byteLength(),i=o||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,n),a},i.prototype._toArrayLikeLE=function(e,t){for(var o=0,r=0,n=0,i=0;n>8&255),o>16&255),6===i?(o>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(o=0&&(e[o--]=a>>8&255),o>=0&&(e[o--]=a>>16&255),6===i?(o>=0&&(e[o--]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(o>=0)for(e[o--]=r;o>=0;)e[o--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,o=0;return t>=4096&&(o+=13,t>>>=13),t>=64&&(o+=7,t>>>=7),t>=8&&(o+=4,t>>>=4),t>=2&&(o+=2,t>>>=2),o+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,o=0;return 0===(8191&t)&&(o+=13,t>>>=13),0===(127&t)&&(o+=7,t>>>=7),0===(15&t)&&(o+=4,t>>>=4),0===(3&t)&&(o+=2,t>>>=2),0===(1&t)&&o++,o},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var o=0;oe.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,o;this.length>e.length?(t=this,o=e):(t=e,o=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),o=e%26;this._expand(t),o>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-o),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var o=e/26|0,n=e%26;return this._expand(o+1),this.words[o]=t?this.words[o]|1<e.length?(o=this,r=e):(o=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=o.length,0!==n)this.words[this.length]=n,this.length++;else if(o!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var o,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(o=this,r=e):(o=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,d=0|a[1],h=8191&d,p=d>>>13,g=0|a[2],b=8191&g,y=g>>>13,v=0|a[3],k=8191&v,w=v>>>13,x=0|a[4],z=8191&x,j=x>>>13,M=0|a[5],A=8191&M,q=M>>>13,I=0|a[6],E=8191&I,S=I>>>13,N=0|a[7],_=8191&N,T=N>>>13,O=0|a[8],C=8191&O,D=O>>>13,L=0|a[9],P=8191&L,R=L>>>13,B=0|s[0],U=8191&B,F=B>>>13,Q=0|s[1],Y=8191&Q,H=Q>>>13,G=0|s[2],W=8191&G,Z=G>>>13,V=0|s[3],K=8191&V,J=V>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],oe=8191&te,re=te>>>13,ne=0|s[6],ie=8191&ne,ae=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,le=0|s[8],me=8191&le,fe=le>>>13,de=0|s[9],he=8191&de,pe=de>>>13;o.negative=e.negative^t.negative,o.length=19;var ge=(u+(r=Math.imul(m,U))|0)+((8191&(n=(n=Math.imul(m,F))+Math.imul(f,U)|0))<<13)|0;u=((i=Math.imul(f,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(h,U),n=(n=Math.imul(h,F))+Math.imul(p,U)|0,i=Math.imul(p,F);var be=(u+(r=r+Math.imul(m,Y)|0)|0)+((8191&(n=(n=n+Math.imul(m,H)|0)+Math.imul(f,Y)|0))<<13)|0;u=((i=i+Math.imul(f,H)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(b,U),n=(n=Math.imul(b,F))+Math.imul(y,U)|0,i=Math.imul(y,F),r=r+Math.imul(h,Y)|0,n=(n=n+Math.imul(h,H)|0)+Math.imul(p,Y)|0,i=i+Math.imul(p,H)|0;var ye=(u+(r=r+Math.imul(m,W)|0)|0)+((8191&(n=(n=n+Math.imul(m,Z)|0)+Math.imul(f,W)|0))<<13)|0;u=((i=i+Math.imul(f,Z)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(k,U),n=(n=Math.imul(k,F))+Math.imul(w,U)|0,i=Math.imul(w,F),r=r+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(y,Y)|0,i=i+Math.imul(y,H)|0,r=r+Math.imul(h,W)|0,n=(n=n+Math.imul(h,Z)|0)+Math.imul(p,W)|0,i=i+Math.imul(p,Z)|0;var ve=(u+(r=r+Math.imul(m,K)|0)|0)+((8191&(n=(n=n+Math.imul(m,J)|0)+Math.imul(f,K)|0))<<13)|0;u=((i=i+Math.imul(f,J)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(z,U),n=(n=Math.imul(z,F))+Math.imul(j,U)|0,i=Math.imul(j,F),r=r+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,H)|0)+Math.imul(w,Y)|0,i=i+Math.imul(w,H)|0,r=r+Math.imul(b,W)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,Z)|0,r=r+Math.imul(h,K)|0,n=(n=n+Math.imul(h,J)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,J)|0;var ke=(u+(r=r+Math.imul(m,$)|0)|0)+((8191&(n=(n=n+Math.imul(m,ee)|0)+Math.imul(f,$)|0))<<13)|0;u=((i=i+Math.imul(f,ee)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(A,U),n=(n=Math.imul(A,F))+Math.imul(q,U)|0,i=Math.imul(q,F),r=r+Math.imul(z,Y)|0,n=(n=n+Math.imul(z,H)|0)+Math.imul(j,Y)|0,i=i+Math.imul(j,H)|0,r=r+Math.imul(k,W)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(w,W)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(b,K)|0,n=(n=n+Math.imul(b,J)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,J)|0,r=r+Math.imul(h,$)|0,n=(n=n+Math.imul(h,ee)|0)+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0;var we=(u+(r=r+Math.imul(m,oe)|0)|0)+((8191&(n=(n=n+Math.imul(m,re)|0)+Math.imul(f,oe)|0))<<13)|0;u=((i=i+Math.imul(f,re)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,U),n=(n=Math.imul(E,F))+Math.imul(S,U)|0,i=Math.imul(S,F),r=r+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,H)|0)+Math.imul(q,Y)|0,i=i+Math.imul(q,H)|0,r=r+Math.imul(z,W)|0,n=(n=n+Math.imul(z,Z)|0)+Math.imul(j,W)|0,i=i+Math.imul(j,Z)|0,r=r+Math.imul(k,K)|0,n=(n=n+Math.imul(k,J)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,J)|0,r=r+Math.imul(b,$)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,ee)|0,r=r+Math.imul(h,oe)|0,n=(n=n+Math.imul(h,re)|0)+Math.imul(p,oe)|0,i=i+Math.imul(p,re)|0;var xe=(u+(r=r+Math.imul(m,ie)|0)|0)+((8191&(n=(n=n+Math.imul(m,ae)|0)+Math.imul(f,ie)|0))<<13)|0;u=((i=i+Math.imul(f,ae)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(_,U),n=(n=Math.imul(_,F))+Math.imul(T,U)|0,i=Math.imul(T,F),r=r+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(S,Y)|0,i=i+Math.imul(S,H)|0,r=r+Math.imul(A,W)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,W)|0,i=i+Math.imul(q,Z)|0,r=r+Math.imul(z,K)|0,n=(n=n+Math.imul(z,J)|0)+Math.imul(j,K)|0,i=i+Math.imul(j,J)|0,r=r+Math.imul(k,$)|0,n=(n=n+Math.imul(k,ee)|0)+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(b,oe)|0,n=(n=n+Math.imul(b,re)|0)+Math.imul(y,oe)|0,i=i+Math.imul(y,re)|0,r=r+Math.imul(h,ie)|0,n=(n=n+Math.imul(h,ae)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,ae)|0;var ze=(u+(r=r+Math.imul(m,ce)|0)|0)+((8191&(n=(n=n+Math.imul(m,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((i=i+Math.imul(f,ue)|0)+(n>>>13)|0)+(ze>>>26)|0,ze&=67108863,r=Math.imul(C,U),n=(n=Math.imul(C,F))+Math.imul(D,U)|0,i=Math.imul(D,F),r=r+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,H)|0)+Math.imul(T,Y)|0,i=i+Math.imul(T,H)|0,r=r+Math.imul(E,W)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,Z)|0,r=r+Math.imul(A,K)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,K)|0,i=i+Math.imul(q,J)|0,r=r+Math.imul(z,$)|0,n=(n=n+Math.imul(z,ee)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,ee)|0,r=r+Math.imul(k,oe)|0,n=(n=n+Math.imul(k,re)|0)+Math.imul(w,oe)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(b,ie)|0,n=(n=n+Math.imul(b,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0,r=r+Math.imul(h,ce)|0,n=(n=n+Math.imul(h,ue)|0)+Math.imul(p,ce)|0,i=i+Math.imul(p,ue)|0;var je=(u+(r=r+Math.imul(m,me)|0)|0)+((8191&(n=(n=n+Math.imul(m,fe)|0)+Math.imul(f,me)|0))<<13)|0;u=((i=i+Math.imul(f,fe)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(P,U),n=(n=Math.imul(P,F))+Math.imul(R,U)|0,i=Math.imul(R,F),r=r+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,H)|0)+Math.imul(D,Y)|0,i=i+Math.imul(D,H)|0,r=r+Math.imul(_,W)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(T,W)|0,i=i+Math.imul(T,Z)|0,r=r+Math.imul(E,K)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(S,K)|0,i=i+Math.imul(S,J)|0,r=r+Math.imul(A,$)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,$)|0,i=i+Math.imul(q,ee)|0,r=r+Math.imul(z,oe)|0,n=(n=n+Math.imul(z,re)|0)+Math.imul(j,oe)|0,i=i+Math.imul(j,re)|0,r=r+Math.imul(k,ie)|0,n=(n=n+Math.imul(k,ae)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,ae)|0,r=r+Math.imul(b,ce)|0,n=(n=n+Math.imul(b,ue)|0)+Math.imul(y,ce)|0,i=i+Math.imul(y,ue)|0,r=r+Math.imul(h,me)|0,n=(n=n+Math.imul(h,fe)|0)+Math.imul(p,me)|0,i=i+Math.imul(p,fe)|0;var Me=(u+(r=r+Math.imul(m,he)|0)|0)+((8191&(n=(n=n+Math.imul(m,pe)|0)+Math.imul(f,he)|0))<<13)|0;u=((i=i+Math.imul(f,pe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(P,Y),n=(n=Math.imul(P,H))+Math.imul(R,Y)|0,i=Math.imul(R,H),r=r+Math.imul(C,W)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(D,W)|0,i=i+Math.imul(D,Z)|0,r=r+Math.imul(_,K)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(T,K)|0,i=i+Math.imul(T,J)|0,r=r+Math.imul(E,$)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,r=r+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,re)|0)+Math.imul(q,oe)|0,i=i+Math.imul(q,re)|0,r=r+Math.imul(z,ie)|0,n=(n=n+Math.imul(z,ae)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,ae)|0,r=r+Math.imul(k,ce)|0,n=(n=n+Math.imul(k,ue)|0)+Math.imul(w,ce)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(b,me)|0,n=(n=n+Math.imul(b,fe)|0)+Math.imul(y,me)|0,i=i+Math.imul(y,fe)|0;var Ae=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(n=(n=n+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;u=((i=i+Math.imul(p,pe)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(P,W),n=(n=Math.imul(P,Z))+Math.imul(R,W)|0,i=Math.imul(R,Z),r=r+Math.imul(C,K)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,J)|0,r=r+Math.imul(_,$)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,r=r+Math.imul(E,oe)|0,n=(n=n+Math.imul(E,re)|0)+Math.imul(S,oe)|0,i=i+Math.imul(S,re)|0,r=r+Math.imul(A,ie)|0,n=(n=n+Math.imul(A,ae)|0)+Math.imul(q,ie)|0,i=i+Math.imul(q,ae)|0,r=r+Math.imul(z,ce)|0,n=(n=n+Math.imul(z,ue)|0)+Math.imul(j,ce)|0,i=i+Math.imul(j,ue)|0,r=r+Math.imul(k,me)|0,n=(n=n+Math.imul(k,fe)|0)+Math.imul(w,me)|0,i=i+Math.imul(w,fe)|0;var qe=(u+(r=r+Math.imul(b,he)|0)|0)+((8191&(n=(n=n+Math.imul(b,pe)|0)+Math.imul(y,he)|0))<<13)|0;u=((i=i+Math.imul(y,pe)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,r=Math.imul(P,K),n=(n=Math.imul(P,J))+Math.imul(R,K)|0,i=Math.imul(R,J),r=r+Math.imul(C,$)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(D,$)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,re)|0)+Math.imul(T,oe)|0,i=i+Math.imul(T,re)|0,r=r+Math.imul(E,ie)|0,n=(n=n+Math.imul(E,ae)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,r=r+Math.imul(A,ce)|0,n=(n=n+Math.imul(A,ue)|0)+Math.imul(q,ce)|0,i=i+Math.imul(q,ue)|0,r=r+Math.imul(z,me)|0,n=(n=n+Math.imul(z,fe)|0)+Math.imul(j,me)|0,i=i+Math.imul(j,fe)|0;var Ie=(u+(r=r+Math.imul(k,he)|0)|0)+((8191&(n=(n=n+Math.imul(k,pe)|0)+Math.imul(w,he)|0))<<13)|0;u=((i=i+Math.imul(w,pe)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(P,$),n=(n=Math.imul(P,ee))+Math.imul(R,$)|0,i=Math.imul(R,ee),r=r+Math.imul(C,oe)|0,n=(n=n+Math.imul(C,re)|0)+Math.imul(D,oe)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(_,ie)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,ae)|0,r=r+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,i=i+Math.imul(S,ue)|0,r=r+Math.imul(A,me)|0,n=(n=n+Math.imul(A,fe)|0)+Math.imul(q,me)|0,i=i+Math.imul(q,fe)|0;var Ee=(u+(r=r+Math.imul(z,he)|0)|0)+((8191&(n=(n=n+Math.imul(z,pe)|0)+Math.imul(j,he)|0))<<13)|0;u=((i=i+Math.imul(j,pe)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(P,oe),n=(n=Math.imul(P,re))+Math.imul(R,oe)|0,i=Math.imul(R,re),r=r+Math.imul(C,ie)|0,n=(n=n+Math.imul(C,ae)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,ae)|0,r=r+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(T,ce)|0,i=i+Math.imul(T,ue)|0,r=r+Math.imul(E,me)|0,n=(n=n+Math.imul(E,fe)|0)+Math.imul(S,me)|0,i=i+Math.imul(S,fe)|0;var Se=(u+(r=r+Math.imul(A,he)|0)|0)+((8191&(n=(n=n+Math.imul(A,pe)|0)+Math.imul(q,he)|0))<<13)|0;u=((i=i+Math.imul(q,pe)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(P,ie),n=(n=Math.imul(P,ae))+Math.imul(R,ie)|0,i=Math.imul(R,ae),r=r+Math.imul(C,ce)|0,n=(n=n+Math.imul(C,ue)|0)+Math.imul(D,ce)|0,i=i+Math.imul(D,ue)|0,r=r+Math.imul(_,me)|0,n=(n=n+Math.imul(_,fe)|0)+Math.imul(T,me)|0,i=i+Math.imul(T,fe)|0;var Ne=(u+(r=r+Math.imul(E,he)|0)|0)+((8191&(n=(n=n+Math.imul(E,pe)|0)+Math.imul(S,he)|0))<<13)|0;u=((i=i+Math.imul(S,pe)|0)+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(P,ce),n=(n=Math.imul(P,ue))+Math.imul(R,ce)|0,i=Math.imul(R,ue),r=r+Math.imul(C,me)|0,n=(n=n+Math.imul(C,fe)|0)+Math.imul(D,me)|0,i=i+Math.imul(D,fe)|0;var _e=(u+(r=r+Math.imul(_,he)|0)|0)+((8191&(n=(n=n+Math.imul(_,pe)|0)+Math.imul(T,he)|0))<<13)|0;u=((i=i+Math.imul(T,pe)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(P,me),n=(n=Math.imul(P,fe))+Math.imul(R,me)|0,i=Math.imul(R,fe);var Te=(u+(r=r+Math.imul(C,he)|0)|0)+((8191&(n=(n=n+Math.imul(C,pe)|0)+Math.imul(D,he)|0))<<13)|0;u=((i=i+Math.imul(D,pe)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863;var Oe=(u+(r=Math.imul(P,he))|0)+((8191&(n=(n=Math.imul(P,pe))+Math.imul(R,he)|0))<<13)|0;return u=((i=Math.imul(R,pe))+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,c[0]=ge,c[1]=be,c[2]=ye,c[3]=ve,c[4]=ke,c[5]=we,c[6]=xe,c[7]=ze,c[8]=je,c[9]=Me,c[10]=Ae,c[11]=qe,c[12]=Ie,c[13]=Ee,c[14]=Se,c[15]=Ne,c[16]=_e,c[17]=Te,c[18]=Oe,0!==u&&(c[19]=u,o.length++),o};function b(e,t,o){o.negative=t.negative^e.negative,o.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0)>>>26,a&=67108863}o.words[i]=s,r=a,a=n}return 0!==r?o.words[i]=r:o.length--,o._strip()}function y(e,t,o){return b(e,t,o)}function v(e,t){this.x=e,this.y=t}Math.imul||(g=p),i.prototype.mulTo=function(e,t){var o=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):o<63?p(this,e,t):o<1024?b(this,e,t):y(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),o=i.prototype._countBits(e)-1,r=0;r>=1;return r},v.prototype.permute=function(e,t,o,r,n,i){for(var a=0;a>>=1)n++;return 1<>>=13,o[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,o+=i/67108864|0,o+=a>>>26,this.words[n]=67108863&a}return 0!==o&&(this.words[n]=o,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),o=0;o>>n&1}return t}(e);if(0===t.length)return new i(1);for(var o=this,r=0;r=0);var t,o=e%26,n=(e-o)/26,i=67108863>>>26-o<<26-o;if(0!==o){var a=0;for(t=0;t>>26-o}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=n);u--){var m=0|this.words[u];this.words[u]=l<<26-i|m>>>i,l=m&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,o){return r(0===this.negative),this.iushrn(e,t,o)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,o=(e-t)/26,n=1<=0);var t=e%26,o=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=o)return this;if(0!==t&&o++,this.length=Math.min(o,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[n+o]=67108863&i}for(;n>26,this.words[n+o]=67108863&i;if(0===s)return this._strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var o=(this.length,e.length),r=this.clone(),n=e,a=0|n.words[n.length-1];0!==(o=26-this._countBits(a))&&(n=n.ushln(o),r.iushln(o),a=0|n.words[n.length-1]);var s,c=r.length-n.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;m--){var f=67108864*(0|r.words[n.length+m])+(0|r.words[n.length+m-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(n,f,m);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(n,1,m),r.isZero()||(r.negative^=1);s&&(s.words[m]=f)}return s&&s._strip(),r._strip(),"div"!==t&&0!==o&&r.iushrn(o),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,o){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(a=s.mod.neg(),o&&0!==a.negative&&a.iadd(e)),{div:n,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),o&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var o=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=o.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var o=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(o*n+(0|this.words[i]))%e;return t?-n:n},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var o=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*o;this.words[n]=i/e|0,o=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,o=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&o.isEven();)t.iushrn(1),o.iushrn(1),++u;for(var l=o.clone(),m=t.clone();!t.isZero();){for(var f=0,d=1;0===(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(l),a.isub(m)),n.iushrn(1),a.iushrn(1);for(var h=0,p=1;0===(o.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(o.iushrn(h);h-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(m)),s.iushrn(1),c.iushrn(1);t.cmp(o)>=0?(t.isub(o),n.isub(s),a.isub(c)):(o.isub(t),s.isub(n),c.isub(a))}return{a:s,b:c,gcd:o.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,o=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,a=new i(1),s=new i(0),c=o.clone();t.cmpn(1)>0&&o.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var m=0,f=1;0===(o.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(o.iushrn(m);m-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(o)>=0?(t.isub(o),a.isub(s)):(o.isub(t),s.isub(a))}return(n=0===t.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),o=e.clone();t.negative=0,o.negative=0;for(var r=0;t.isEven()&&o.isEven();r++)t.iushrn(1),o.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;o.isEven();)o.iushrn(1);var n=t.cmp(o);if(n<0){var i=t;t=o,o=i}else if(0===n||0===o.cmpn(1))break;t.isub(o)}return o.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,o=(e-t)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,o=e<0;if(0!==this.negative&&!o)return-1;if(0===this.negative&&o)return 1;if(this._strip(),this.length>1)t=1;else{o&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;o--){var r=0|this.words[o],n=0|e.words[o];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var k={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function z(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function j(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function q(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,o=e;do{this.split(o,this.tmp),t=(o=(o=this.imulK(o)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?o.isub(this.p):void 0!==o.strip?o.strip():o._strip(),o},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(x,w),x.prototype.split=function(e,t){for(var o=4194303,r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,o=0;o>>=26,e.words[o]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(k[e])return k[e];var t;if("k256"===e)t=new x;else if("p224"===e)t=new z;else if("p192"===e)t=new j;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return k[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var o=e.add(t);return o.cmp(this.m)>=0&&o.isub(this.m),o._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var o=e.iadd(t);return o.cmp(this.m)>=0&&o.isub(this.m),o},A.prototype.sub=function(e,t){this._verify2(e,t);var o=e.sub(t);return o.cmpn(0)<0&&o.iadd(this.m),o._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var o=e.isub(t);return o.cmpn(0)<0&&o.iadd(this.m),o},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var o=this.m.add(new i(1)).iushrn(2);return this.pow(e,o)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);r(!n.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var m=this.pow(l,n),f=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),h=a;0!==d.cmp(s);){for(var p=d,g=0;0!==p.cmp(s);g++)p=p.redSqr();r(g=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var m=u>>l&1;n!==o[0]&&(n=this.sqr(n)),0!==m||0!==a?(a<<=1,a|=m,(4===++s||0===r&&0===l)&&(n=this.mul(n,o[a]),s=0,a=0)):s=0}c=26}return n},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new q(e)},n(q,A),q.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},q.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},q.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var o=e.imul(t),r=o.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=o.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},q.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var o=e.mul(t),r=o.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=o.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},q.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,o(67)(e))},function(e,t,o){"use strict";o.d(t,"a",(function(){return r}));var r="random/5.7.0"},,,,function(e,t,o){e.exports=function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=25)}([function(e,t,o){"use strict";o.r(t),o.d(t,"__extends",(function(){return n})),o.d(t,"__assign",(function(){return i})),o.d(t,"__rest",(function(){return a})),o.d(t,"__decorate",(function(){return s})),o.d(t,"__param",(function(){return c})),o.d(t,"__metadata",(function(){return u})),o.d(t,"__awaiter",(function(){return l})),o.d(t,"__generator",(function(){return m})),o.d(t,"__createBinding",(function(){return f})),o.d(t,"__exportStar",(function(){return d})),o.d(t,"__values",(function(){return h})),o.d(t,"__read",(function(){return p})),o.d(t,"__spread",(function(){return g})),o.d(t,"__spreadArrays",(function(){return b})),o.d(t,"__spreadArray",(function(){return y})),o.d(t,"__await",(function(){return v})),o.d(t,"__asyncGenerator",(function(){return k})),o.d(t,"__asyncDelegator",(function(){return w})),o.d(t,"__asyncValues",(function(){return x})),o.d(t,"__makeTemplateObject",(function(){return z})),o.d(t,"__importStar",(function(){return M})),o.d(t,"__importDefault",(function(){return A})),o.d(t,"__classPrivateFieldGet",(function(){return q})),o.d(t,"__classPrivateFieldSet",(function(){return I}));var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)};function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var i=function(){return(i=Object.assign||function(e){for(var t,o=1,r=arguments.length;o=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a}function c(e,t){return function(o,r){t(o,r,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function m(e,t){var o,r,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,r&&(n=2&i[0]?r.return:i[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,i[1])).done)return n;switch(r=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a}function g(){for(var e=[],t=0;t1||s(e,t)}))})}function s(e,t){try{(o=n[e](t)).value instanceof v?Promise.resolve(o.value.v).then(c,u):l(i[0][2],o)}catch(e){l(i[0][3],e)}var o}function c(e){s("next",e)}function u(e){s("throw",e)}function l(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function w(e){var t,o;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,n){t[r]=e[r]?function(t){return(o=!o)?{value:v(e[r](t)),done:"return"===r}:n?n(t):t}:n}}function x(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,o=e[Symbol.asyncIterator];return o?o.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(o){t[o]=e[o]&&function(t){return new Promise((function(r,n){!function(e,t,o,r){Promise.resolve(r).then((function(t){e({value:t,done:o})}),t)}(r,n,(t=e[o](t)).done,t.value)}))}}}function z(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var j=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function M(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&f(t,e,o);return j(t,e),t}function A(e){return e&&e.__esModule?e:{default:e}}function q(e,t,o,r){if("a"===o&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===o?r:"a"===o?r.call(e):r?r.value:t.get(e)}function I(e,t,o,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,o):n?n.value=o:t.set(e,o),o}},function(e,t,o){"use strict";e.exports=o(27)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(0);r.__exportStar(o(34),t),r.__exportStar(o(35),t),r.__exportStar(o(36),t),r.__exportStar(o(37),t)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(0);r.__exportStar(o(32),t),r.__exportStar(o(110),t),r.__exportStar(o(10),t)},function(e,t,o){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.themesList=void 0;var n=o(0),i=n.__importDefault(o(38)),a=n.__importDefault(o(39));t.themesList=((r={default:i.default})[i.default.name]=i.default,r[a.default.name]=a.default,r)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.providers=t.injected=t.connectors=void 0;var r=o(0),n=r.__importStar(o(40));t.connectors=n;var i=r.__importStar(o(12));t.injected=i;var a=r.__importStar(o(94));t.providers=a},function(e,t,o){"use strict";e.exports=o(115)},function(e,t,o){"use strict";var r=o(116),n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?a:s[e.$$typeof]||n}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,l=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,o,r){if("string"!=typeof o){if(h){var n=d(o);n&&n!==h&&e(t,n,r)}var a=l(o);m&&(a=a.concat(m(o)));for(var s=c(t),p=c(o),g=0;g1&&(e[0]===a.injected.METAMASK.check||e[0]===a.injected.CIPHER.check)?e[1]:e[0]:a.providers.FALLBACK.check}t.checkInjectedProviders=s,t.verifyInjectedProvider=c,t.getInjectedProvider=u,t.getInjectedProviderName=function(){var e=u();return e?e.name:null},t.getProviderInfo=function(e){return e?l(Object.values(a.providers).filter((function(t){return e[t.check]})).map((function(e){return e.check}))):a.providers.FALLBACK},t.getProviderInfoFromChecksArray=l,t.getProviderInfoByName=function(e){return f("name",e)},t.getProviderInfoById=function(e){return f("id",e)},t.getProviderInfoByCheck=function(e){return f("check",e)},t.isMobile=function(){return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(navigator.userAgent.substr(0,4))&&!function(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}())},t.getProviderDescription=function(e){if(e.description)return e.description;var t="";switch(e.type){case"injected":t="Connect to your "+e.name+" Wallet";break;case"web":t="Connect with your "+e.name+" account";break;case"qrcode":t="Scan with "+e.name+" to connect";break;case"hardware":t="Connect to your "+e.name+" Hardware Wallet"}return t},t.filterMatches=m,t.filterProviders=f,t.filterProviderChecks=d,t.getChainId=function(e){var t=m(Object.values(n.CHAIN_DATA_LIST),(function(t){return t.network===e}),void 0);if(!t)throw new Error("No chainId found match "+e);return t.chainId},t.getThemeColors=function(e){return"string"==typeof e?i.themesList[e].colors:e},t.findMatchingRequiredOptions=function e(t,o){return t.filter((function(t){if("string"==typeof t)return t in o;var r=e(t,o);return r&&r.length}))},t.isLocalStorageAvailable=function(){try{return localStorage.setItem("test","test"),localStorage.removeItem("test"),!0}catch(e){return!1}}},function(e,t){var o,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(o===setTimeout)return setTimeout(e,0);if((o===i||!o)&&setTimeout)return o=setTimeout,setTimeout(e,0);try{return o(e,0)}catch(t){try{return o.call(null,e,0)}catch(t){return o.call(this,e,0)}}}!function(){try{o="function"==typeof setTimeout?setTimeout:i}catch(e){o=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,u=[],l=!1,m=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):m=-1,u.length&&d())}function d(){if(!l){var e=s(f);l=!0;for(var t=u.length;t;){for(c=u,u=[];++m1)for(var o=1;o1?t-1:0),r=1;r0?" Args: "+o.join(", "):""))}var q=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,o=0;o=this.groupSizes.length){for(var o=this.groupSizes,r=o.length,n=r;e>=n;)(n<<=1)<0&&A(16,""+e);this.groupSizes=new Uint32Array(n),this.groupSizes.set(o),this.length=n;for(var i=r;i=this.length||0===this.groupSizes[e])return t;for(var o=this.groupSizes[e],r=this.indexOfGroup(e),n=r+o,i=r;i=S&&(S=t+1),I.set(e,t),E.set(t,e)},O="style["+w+'][data-styled-version="5.3.3"]',C=new RegExp("^"+w+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),D=function(e,t,o){for(var r,n=o.split(","),i=0,a=n.length;i=0;o--){var r=t[o];if(r&&1===r.nodeType&&r.hasAttribute(w))return r}}(o),i=void 0!==n?n.nextSibling:null;r.setAttribute(w,"active"),r.setAttribute("data-styled-version","5.3.3");var a=P();return a&&r.setAttribute("nonce",a),o.insertBefore(r,i),r},B=function(){function e(e){var t=this.element=R(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,o=0,r=t.length;o=0){var o=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(o,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(u+=e+",")})),r+=""+s+c+'{content:"'+u+'"}/*!sc*/\n'}}}return r}(this)},e}(),G=/(a)(d)/gi,W=function(e){return String.fromCharCode(e+(e>25?39:97))};function Z(e){var t,o="";for(t=Math.abs(e);t>52;t=t/52|0)o=W(t%52)+o;return(W(t%52)+o).replace(G,"$1-$2")}var V=function(e,t){for(var o=t.length;o;)e=33*e^t.charCodeAt(--o);return e},K=function(e){return V(5381,e)};function J(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var s=o(i,"."+a,void 0,r);t.insertRules(r,a,s)}n.push(a),this.staticRulesId=a}else{for(var c=this.rules.length,u=V(this.baseHash,o.hash),l="",m=0;m>>0);if(!t.hasNameForId(r,p)){var g=o(l,"."+p,void 0,r);t.insertRules(r,p,g)}n.push(p)}}return n.join(" ")},e}(),ee=/^\s*\/\/.*$/gm,te=[":","[",".","#"];function oe(e){var t,o,r,n,i=void 0===e?b:e,a=i.options,s=void 0===a?b:a,u=i.plugins,l=void 0===u?g:u,m=new c.a(s),f=[],d=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(o,r,n,i,a,s,c,u,l,m){switch(o){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(n[0]+r),"";default:return r+(0===m?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),h=function(e,r,i){return 0===r&&-1!==te.indexOf(i[o.length])||i.match(n)?e:"."+t};function p(e,i,a,s){void 0===s&&(s="&");var c=e.replace(ee,""),u=i&&a?a+" "+i+" { "+c+" }":c;return t=s,o=i,r=new RegExp("\\"+o+"\\b","g"),n=new RegExp("(\\"+o+"\\b){2,}"),m(a||!i?"":i,u)}return m.use([].concat(l,[function(e,t,n){2===e&&n.length&&n[0].lastIndexOf(o)>0&&(n[0]=n[0].replace(r,h))},d,function(e){if(-2===e){var t=f;return f=[],t}}])),p.hash=l.length?l.reduce((function(e,t){return t.name||A(15),V(e,t.name)}),5381).toString():"",p}var re=i.a.createContext(),ne=re.Consumer,ie=i.a.createContext(),ae=(ie.Consumer,new H),se=oe();function ce(){return Object(n.useContext)(re)||ae}function ue(){return Object(n.useContext)(ie)||se}function le(e){var t=Object(n.useState)(e.stylisPlugins),o=t[0],r=t[1],a=ce(),c=Object(n.useMemo)((function(){var t=a;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),u=Object(n.useMemo)((function(){return oe({options:{prefix:!e.disableVendorPrefixes},plugins:o})}),[e.disableVendorPrefixes,o]);return Object(n.useEffect)((function(){s()(o,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),i.a.createElement(re.Provider,{value:c},i.a.createElement(ie.Provider,{value:u},e.children))}var me=function(){function e(e,t){var o=this;this.inject=function(e,t){void 0===t&&(t=se);var r=o.name+t.hash;e.hasNameForId(o.id,r)||e.insertRules(o.id,r,t(o.rules,r,"@keyframes"))},this.toString=function(){return A(12,String(o.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=se),this.name+e.hash},e}(),fe=/([A-Z])/,de=/([A-Z])/g,he=/^ms-/,pe=function(e){return"-"+e.toLowerCase()};function ge(e){return fe.test(e)?e.replace(de,pe).replace(he,"-ms-"):e}var be=function(e){return null==e||!1===e||""===e};function ye(e,t,o,r){if(Array.isArray(e)){for(var n,i=[],a=0,s=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,ze=/(^-|-$)/g;function je(e){return e.replace(xe,"-").replace(ze,"")}var Me=function(e){return Z(K(e)>>>0)};function Ae(e){return"string"==typeof e&&!0}var qe=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Ie=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Ee(e,t,o){var r=e[o];qe(t)&&qe(r)?Se(r,t):e[o]=t}function Se(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r=0||(n[o]=e[o]);return n}(t,["componentId"]),i=r&&r+"-"+(Ae(e)?e:je(v(e)));return Ce(e,d({},n,{attrs:x,componentId:i}),o)},Object.defineProperty(j,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Se({},e.defaultProps,t):t}}),j.toString=function(){return"."+j.styledComponentId},a&&f()(j,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),j}var De=function(e){return function e(t,o,n){if(void 0===n&&(n=b),!Object(r.isValidElementType)(o))return A(1,String(o));var i=function(){return t(o,n,ke.apply(void 0,arguments))};return i.withConfig=function(r){return e(t,o,d({},n,{},r))},i.attrs=function(r){return e(t,o,d({},n,{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},i}(Ce,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){De[e]=De(e)}));var Le=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=J(e),H.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,o,r){var n=r(ye(this.rules,t,o,r).join(""),""),i=this.componentId+e;o.insertRules(i,i,n)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,o,r){e>2&&H.registerId(this.componentId+e),this.removeStyles(e,o),this.createStyles(e,t,o,r)},e}();function Pe(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r"+t+""},this.getStyleTags=function(){return e.sealed?A(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return A(2);var o=((t={})[w]="",t["data-styled-version"]="5.3.3",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=P();return r&&(o.nonce=r),[i.a.createElement("style",d({},o,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new H({isServer:!0}),this.sealed=!1}var t=e.prototype;return t.collectStyles=function(e){return this.sealed?A(2):i.a.createElement(le,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return A(3)},e}(),Ue=function(e){var t=i.a.forwardRef((function(t,o){var r=Object(n.useContext)(Ne),a=e.defaultProps,s=we(t,r,a);return i.a.createElement(e,d({},t,{theme:s,ref:o}))}));return f()(t,e),t.displayName="WithTheme("+v(e)+")",t},Fe=function(){return Object(n.useContext)(Ne)},Qe={StyleSheet:H,masterSheet:ae};t.default=De}.call(this,o(11))},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;var r,n,i,a,s,c=o(0),u=c.__importStar(o(1)),l=c.__importDefault(o(18)),m=o(2),f=l.default.div(r||(r=c.__makeTemplateObject(["\n width: 45px;\n height: 45px;\n display: flex;\n border-radius: 50%;\n overflow: visible;\n box-shadow: none;\n justify-content: center;\n align-items: center;\n & img {\n width: 100%;\n height: 100%;\n }\n\n @media screen and (max-width: 768px) {\n width: 8.5vw;\n height: 8.5vw;\n }\n"],["\n width: 45px;\n height: 45px;\n display: flex;\n border-radius: 50%;\n overflow: visible;\n box-shadow: none;\n justify-content: center;\n align-items: center;\n & img {\n width: 100%;\n height: 100%;\n }\n\n @media screen and (max-width: 768px) {\n width: 8.5vw;\n height: 8.5vw;\n }\n"]))),d=l.default.div(n||(n=c.__makeTemplateObject(["\n width: 100%;\n font-size: 24px;\n font-weight: 700;\n margin-top: 0.5em;\n color: ",";\n @media screen and (max-width: 768px) {\n font-size: 5vw;\n }\n"],["\n width: 100%;\n font-size: 24px;\n font-weight: 700;\n margin-top: 0.5em;\n color: ",";\n @media screen and (max-width: 768px) {\n font-size: 5vw;\n }\n"])),(function(e){return e.themeColors.main})),h=l.default.div(i||(i=c.__makeTemplateObject(["\n width: 100%;\n font-size: 18px;\n margin: 0.333em 0;\n color: ",";\n @media screen and (max-width: 768px) {\n font-size: 4vw;\n }\n"],["\n width: 100%;\n font-size: 18px;\n margin: 0.333em 0;\n color: ",";\n @media screen and (max-width: 768px) {\n font-size: 4vw;\n }\n"])),(function(e){return e.themeColors.secondary})),p=l.default.div(a||(a=c.__makeTemplateObject(["\n transition: background-color 0.2s ease-in-out;\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n background-color: ",";\n border-radius: 12px;\n padding: 24px 16px;\n @media screen and (max-width: 768px) {\n padding: 1vw;\n }\n"],["\n transition: background-color 0.2s ease-in-out;\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n background-color: ",";\n border-radius: 12px;\n padding: 24px 16px;\n @media screen and (max-width: 768px) {\n padding: 1vw;\n }\n"])),(function(e){return e.themeColors.background})),g=l.default.div(s||(s=c.__makeTemplateObject(["\n width: 100%;\n padding: 8px;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n cursor: pointer;\n border-radius: 0;\n border: ",";\n @media (hover: hover) {\n &:hover "," {\n background-color: ",";\n }\n }\n"],["\n width: 100%;\n padding: 8px;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n cursor: pointer;\n border-radius: 0;\n border: ",";\n @media (hover: hover) {\n &:hover "," {\n background-color: ",";\n }\n }\n"])),(function(e){return"1px solid "+e.themeColors.border}),p,(function(e){return e.themeColors.hover}));t.Provider=function(e){var t=e.name,o=e.logo,r=e.description,n=e.themeColors,i=e.onClick,a=c.__rest(e,["name","logo","description","themeColors","onClick"]);return u.createElement(g,c.__assign({themeColors:n,className:m.PROVIDER_WRAPPER_CLASSNAME,onClick:i},a),u.createElement(p,{themeColors:n,className:m.PROVIDER_CONTAINER_CLASSNAME},u.createElement(f,{className:m.PROVIDER_ICON_CLASSNAME},u.createElement("img",{src:o,alt:t})),u.createElement(d,{themeColors:n,className:m.PROVIDER_NAME_CLASSNAME},t),u.createElement(h,{themeColors:n,className:m.PROVIDER_DESCRIPTION_CLASSNAME},r)))}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(0);r.__exportStar(o(21),t),r.__exportStar(o(118),t)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventController=void 0;var r=function(){function e(){this._eventCallbacks=[]}return e.prototype.on=function(e){this._eventCallbacks.push(e)},e.prototype.off=function(e){e?e.callback?this._eventCallbacks=this._eventCallbacks.filter((function(t){return t.event!==e.event||t.callback!==e.callback})):this._eventCallbacks=this._eventCallbacks.filter((function(t){return t.event!==e.event})):this._eventCallbacks=[]},e.prototype.trigger=function(e,t){var o=this._eventCallbacks.filter((function(t){return t.event===e}));o&&o.length&&o.forEach((function(e){e.callback(t)}))},e}();t.EventController=r},function(e,t){e.exports=function(e,t,o,r){var n=o?o.call(r,e,t):void 0;if(void 0!==n)return!!n;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),c=0;cr&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(p,"$1"+e.trim());case 58:return e.trim()+t.replace(p,"$1"+e.trim());default:if(0<1*o&&0c.charCodeAt(8))break;case 115:a=a.replace(c,"-webkit-"+c)+";"+a;break;case 207:case 102:a=a.replace(c,"-webkit-"+(102s.charCodeAt(0)&&(s=s.trim()),s=[s],0<_){var c=a(-1,o,s,s,q,A,0,0,0,0);void 0!==c&&"string"==typeof c&&(o=c)}var m=function e(o,s,c,m,f){for(var d,h,p,v,w,x=0,z=0,j=0,M=0,N=0,T=0,C=p=d=0,D=0,L=0,P=0,R=0,B=c.length,U=B-1,F="",Q="",Y="",H="";Dd)&&(R=(F=F.replace(" ",":")).length),0<_&&void 0!==(w=a(1,F,s,o,q,A,Q.length,m,f,m))&&0===(R=(F=w.trim()).length)&&(F="\0\0"),d=F.charCodeAt(0),h=F.charCodeAt(1),d){case 0:break;case 64:if(105===h||99===h){H+=F+c.charAt(D);break}default:58!==F.charCodeAt(R-1)&&(Q+=r(F,d,h,F.charCodeAt(2)))}P=L=C=d=0,F="",h=c.charCodeAt(++D)}}switch(h){case 13:case 10:47===z?z=0:0===1+d&&107!==m&&0S.length&&S.push(e)}function T(e,t,o){return null==e?0:function e(t,o,r,n){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var c=!1;if(null===t)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case i:case a:c=!0}}if(c)return r(n,t,""===o?"."+O(t,0):o),1;if(c=0,o=""===o?".":o+":",Array.isArray(t))for(var u=0;u