diff --git a/eth-pm-wallet/asset-manifest.json b/eth-pm-wallet/asset-manifest.json new file mode 100644 index 0000000000..5adf2aa027 --- /dev/null +++ b/eth-pm-wallet/asset-manifest.json @@ -0,0 +1,24 @@ +{ + "files": { + "main.css": "/js-waku/eth-pm-wallet/static/css/main.3545b699.chunk.css", + "main.js": "/js-waku/eth-pm-wallet/static/js/main.7159cbe7.chunk.js", + "main.js.map": "/js-waku/eth-pm-wallet/static/js/main.7159cbe7.chunk.js.map", + "runtime-main.js": "/js-waku/eth-pm-wallet/static/js/runtime-main.1bceea87.js", + "runtime-main.js.map": "/js-waku/eth-pm-wallet/static/js/runtime-main.1bceea87.js.map", + "static/css/2.18735603.chunk.css": "/js-waku/eth-pm-wallet/static/css/2.18735603.chunk.css", + "static/js/2.ad16d0c5.chunk.js": "/js-waku/eth-pm-wallet/static/js/2.ad16d0c5.chunk.js", + "static/js/2.ad16d0c5.chunk.js.map": "/js-waku/eth-pm-wallet/static/js/2.ad16d0c5.chunk.js.map", + "index.html": "/js-waku/eth-pm-wallet/index.html", + "static/css/2.18735603.chunk.css.map": "/js-waku/eth-pm-wallet/static/css/2.18735603.chunk.css.map", + "static/css/main.3545b699.chunk.css.map": "/js-waku/eth-pm-wallet/static/css/main.3545b699.chunk.css.map", + "static/js/2.ad16d0c5.chunk.js.LICENSE.txt": "/js-waku/eth-pm-wallet/static/js/2.ad16d0c5.chunk.js.LICENSE.txt", + "static/media/index.css": "/js-waku/eth-pm-wallet/static/media/roboto-vietnamese-400-normal.52cebac0.woff2" + }, + "entrypoints": [ + "static/js/runtime-main.1bceea87.js", + "static/css/2.18735603.chunk.css", + "static/js/2.ad16d0c5.chunk.js", + "static/css/main.3545b699.chunk.css", + "static/js/main.7159cbe7.chunk.js" + ] +} \ No newline at end of file diff --git a/eth-pm-wallet/favicon.ico b/eth-pm-wallet/favicon.ico new file mode 100644 index 0000000000..a11777cc47 Binary files /dev/null and b/eth-pm-wallet/favicon.ico differ diff --git a/eth-pm-wallet/index.html b/eth-pm-wallet/index.html new file mode 100644 index 0000000000..dec67089eb --- /dev/null +++ b/eth-pm-wallet/index.html @@ -0,0 +1 @@ +React App
\ No newline at end of file diff --git a/eth-pm-wallet/logo192.png b/eth-pm-wallet/logo192.png new file mode 100644 index 0000000000..fc44b0a379 Binary files /dev/null and b/eth-pm-wallet/logo192.png differ diff --git a/eth-pm-wallet/logo512.png b/eth-pm-wallet/logo512.png new file mode 100644 index 0000000000..a4e47a6545 Binary files /dev/null and b/eth-pm-wallet/logo512.png differ diff --git a/eth-pm-wallet/manifest.json b/eth-pm-wallet/manifest.json new file mode 100644 index 0000000000..080d6c77ac --- /dev/null +++ b/eth-pm-wallet/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/eth-pm-wallet/robots.txt b/eth-pm-wallet/robots.txt new file mode 100644 index 0000000000..e9e57dc4d4 --- /dev/null +++ b/eth-pm-wallet/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/eth-pm-wallet/static/css/2.18735603.chunk.css b/eth-pm-wallet/static/css/2.18735603.chunk.css new file mode 100644 index 0000000000..36c8510c2f --- /dev/null +++ b/eth-pm-wallet/static/css/2.18735603.chunk.css @@ -0,0 +1,2 @@ +@font-face{font-family:"Roboto";font-style:normal;font-display:swap;font-weight:400;src:url(/js-waku/eth-pm-wallet/static/media/roboto-cyrillic-ext-400-normal.dd55ea0a.woff2) format("woff2"),url(/js-waku/eth-pm-wallet/static/media/roboto-all-400-normal.b5a0a0df.woff) format("woff");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:"Roboto";font-style:normal;font-display:swap;font-weight:400;src:url(/js-waku/eth-pm-wallet/static/media/roboto-cyrillic-400-normal.3605d18d.woff2) format("woff2"),url(/js-waku/eth-pm-wallet/static/media/roboto-all-400-normal.b5a0a0df.woff) format("woff");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:"Roboto";font-style:normal;font-display:swap;font-weight:400;src:url(/js-waku/eth-pm-wallet/static/media/roboto-greek-ext-400-normal.bc7ace6e.woff2) format("woff2"),url(/js-waku/eth-pm-wallet/static/media/roboto-all-400-normal.b5a0a0df.woff) format("woff");unicode-range:U+1f??}@font-face{font-family:"Roboto";font-style:normal;font-display:swap;font-weight:400;src:url(/js-waku/eth-pm-wallet/static/media/roboto-greek-400-normal.352cc77a.woff2) format("woff2"),url(/js-waku/eth-pm-wallet/static/media/roboto-all-400-normal.b5a0a0df.woff) format("woff");unicode-range:U+0370-03ff}@font-face{font-family:"Roboto";font-style:normal;font-display:swap;font-weight:400;src:url(/js-waku/eth-pm-wallet/static/media/roboto-vietnamese-400-normal.52cebac0.woff2) format("woff2"),url(/js-waku/eth-pm-wallet/static/media/roboto-all-400-normal.b5a0a0df.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-family:"Roboto";font-style:normal;font-display:swap;font-weight:400;src:url(/js-waku/eth-pm-wallet/static/media/roboto-latin-ext-400-normal.dcc07bcf.woff2) format("woff2"),url(/js-waku/eth-pm-wallet/static/media/roboto-all-400-normal.b5a0a0df.woff) format("woff");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:"Roboto";font-style:normal;font-display:swap;font-weight:400;src:url(/js-waku/eth-pm-wallet/static/media/roboto-latin-400-normal.176f8f5b.woff2) format("woff2"),url(/js-waku/eth-pm-wallet/static/media/roboto-all-400-normal.b5a0a0df.woff) format("woff");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd} +/*# sourceMappingURL=2.18735603.chunk.css.map */ \ No newline at end of file diff --git a/eth-pm-wallet/static/css/2.18735603.chunk.css.map b/eth-pm-wallet/static/css/2.18735603.chunk.css.map new file mode 100644 index 0000000000..3c7898afbf --- /dev/null +++ b/eth-pm-wallet/static/css/2.18735603.chunk.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://node_modules/fontsource-roboto/index.css"],"names":[],"mappings":"AACA,WACE,oBAAqB,CACrB,iBAAkB,CAClB,iBAAkB,CAClB,eAAgB,CAChB,sMAAkI,CAClI,gFACF,CAEA,WACE,oBAAqB,CACrB,iBAAkB,CAClB,iBAAkB,CAClB,eAAgB,CAChB,kMAA8H,CAC9H,wDACF,CAEA,WACE,oBAAqB,CACrB,iBAAkB,CAClB,iBAAkB,CAClB,eAAgB,CAChB,mMAA+H,CAC/H,oBACF,CAEA,WACE,oBAAqB,CACrB,iBAAkB,CAClB,iBAAkB,CAClB,eAAgB,CAChB,+LAA2H,CAC3H,yBACF,CAEA,WACE,oBAAqB,CACrB,iBAAkB,CAClB,iBAAkB,CAClB,eAAgB,CAChB,oMAAgI,CAChI,wGACF,CAEA,WACE,oBAAqB,CACrB,iBAAkB,CAClB,iBAAkB,CAClB,eAAgB,CAChB,mMAA+H,CAC/H,qGACF,CAEA,WACE,oBAAqB,CACrB,iBAAkB,CAClB,iBAAkB,CAClB,eAAgB,CAChB,+LAA2H,CAC3H,mJACF","file":"2.18735603.chunk.css","sourcesContent":["/* roboto-cyrillic-ext-400-normal*/\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-display: swap;\n font-weight: 400;\n src: url('./files/roboto-cyrillic-ext-400-normal.woff2') format('woff2'), url('./files/roboto-all-400-normal.woff') format('woff');\n unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* roboto-cyrillic-400-normal*/\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-display: swap;\n font-weight: 400;\n src: url('./files/roboto-cyrillic-400-normal.woff2') format('woff2'), url('./files/roboto-all-400-normal.woff') format('woff');\n unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* roboto-greek-ext-400-normal*/\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-display: swap;\n font-weight: 400;\n src: url('./files/roboto-greek-ext-400-normal.woff2') format('woff2'), url('./files/roboto-all-400-normal.woff') format('woff');\n unicode-range: U+1F00-1FFF;\n}\n/* roboto-greek-400-normal*/\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-display: swap;\n font-weight: 400;\n src: url('./files/roboto-greek-400-normal.woff2') format('woff2'), url('./files/roboto-all-400-normal.woff') format('woff');\n unicode-range: U+0370-03FF;\n}\n/* roboto-vietnamese-400-normal*/\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-display: swap;\n font-weight: 400;\n src: url('./files/roboto-vietnamese-400-normal.woff2') format('woff2'), url('./files/roboto-all-400-normal.woff') format('woff');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;\n}\n/* roboto-latin-ext-400-normal*/\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-display: swap;\n font-weight: 400;\n src: url('./files/roboto-latin-ext-400-normal.woff2') format('woff2'), url('./files/roboto-all-400-normal.woff') format('woff');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* roboto-latin-400-normal*/\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-display: swap;\n font-weight: 400;\n src: url('./files/roboto-latin-400-normal.woff2') format('woff2'), url('./files/roboto-all-400-normal.woff') format('woff');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n"]} \ No newline at end of file diff --git a/eth-pm-wallet/static/css/main.3545b699.chunk.css b/eth-pm-wallet/static/css/main.3545b699.chunk.css new file mode 100644 index 0000000000..a1c3f4b923 --- /dev/null +++ b/eth-pm-wallet/static/css/main.3545b699.chunk.css @@ -0,0 +1,2 @@ +body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.App{text-align:center}.App-logo{height:40vmin;pointer-events:none}@media (prefers-reduced-motion:no-preference){.App-logo{-webkit-animation:App-logo-spin 20s linear infinite;animation:App-logo-spin 20s linear infinite}}.App-header{background-color:#ddd;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:calc(10px + 2vmin);color:#000}.App-link{color:#61dafb}@-webkit-keyframes App-logo-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes App-logo-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}} +/*# sourceMappingURL=main.3545b699.chunk.css.map */ \ No newline at end of file diff --git a/eth-pm-wallet/static/css/main.3545b699.chunk.css.map b/eth-pm-wallet/static/css/main.3545b699.chunk.css.map new file mode 100644 index 0000000000..a45198c7d7 --- /dev/null +++ b/eth-pm-wallet/static/css/main.3545b699.chunk.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://src/index.css","webpack://src/App.css"],"names":[],"mappings":"AAAA,KACE,QAAS,CACT,mJAEY,CACZ,kCAAmC,CACnC,iCACF,CAEA,KACE,yEAEF,CCZA,KACE,iBACF,CAEA,UACE,aAAc,CACd,mBACF,CAEA,8CACE,UACE,mDAA4C,CAA5C,2CACF,CACF,CAEA,YACE,qBAAyB,CACzB,gBAAiB,CACjB,YAAa,CACb,qBAAsB,CACtB,kBAAmB,CACnB,sBAAuB,CACvB,4BAA6B,CAC7B,UACF,CAEA,UACE,aACF,CAEA,iCACE,GACE,8BAAuB,CAAvB,sBACF,CACA,GACE,+BAAyB,CAAzB,uBACF,CACF,CAPA,yBACE,GACE,8BAAuB,CAAvB,sBACF,CACA,GACE,+BAAyB,CAAzB,uBACF,CACF","file":"main.3545b699.chunk.css","sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n",".App {\n text-align: center;\n}\n\n.App-logo {\n height: 40vmin;\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .App-logo {\n animation: App-logo-spin infinite 20s linear;\n }\n}\n\n.App-header {\n background-color: #dddddd;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-size: calc(10px + 2vmin);\n color: black;\n}\n\n.App-link {\n color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n"]} \ No newline at end of file diff --git a/eth-pm-wallet/static/js/2.ad16d0c5.chunk.js b/eth-pm-wallet/static/js/2.ad16d0c5.chunk.js new file mode 100644 index 0000000000..484e9ae947 --- /dev/null +++ b/eth-pm-wallet/static/js/2.ad16d0c5.chunk.js @@ -0,0 +1,3 @@ +/*! For license information please see 2.ad16d0c5.chunk.js.LICENSE.txt */ +(this["webpackJsonpeth-pm-wallet-encryption"]=this["webpackJsonpeth-pm-wallet-encryption"]||[]).push([[2],[function(e,t,r){e.exports=r(535)},function(e,t,r){"use strict";e.exports=r(528)},function(e,t,r){"use strict";r.d(t,"k",(function(){return a})),r.d(t,"j",(function(){return s})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return c})),r.d(t,"o",(function(){return f})),r.d(t,"p",(function(){return l})),r.d(t,"l",(function(){return h})),r.d(t,"i",(function(){return p})),r.d(t,"d",(function(){return v})),r.d(t,"e",(function(){return y})),r.d(t,"c",(function(){return b})),r.d(t,"g",(function(){return g})),r.d(t,"f",(function(){return m})),r.d(t,"h",(function(){return w})),r.d(t,"n",(function(){return k})),r.d(t,"m",(function(){return S}));var n=new(r(3).b)("bytes/5.3.0");function i(e){return!!e.toHexString}function o(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return h(e)&&!(e.length%2)||s(e)}function s(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"===typeof e)return!1;if(null==e.length)return!1;for(var t=0;t=256||r%1)return!1}return!0}function u(e,t){if(t||(t={}),"number"===typeof e){n.checkSafeUint53(e,"invalid arrayify value");for(var r=[];e;)r.unshift(255&e),e=parseInt(String(e/256));return 0===r.length&&r.push(0),o(new Uint8Array(r))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),h(e)){var a=e.substring(2);a.length%2&&("left"===t.hexPad?a="0x0"+a.substring(2):"right"===t.hexPad?a+="0":n.throwArgumentError("hex data is odd-length","value",e));for(var u=[],c=0;ct&&n.throwArgumentError("value out of range","value",arguments[0]);var r=new Uint8Array(t);return r.set(e,t-e.length),o(r)}function h(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}var d="0123456789abcdef";function p(e,t){if(t||(t={}),"number"===typeof e){n.checkSafeUint53(e,"invalid hexlify value");for(var r="";e;)r=d[15&e]+r,e=Math.floor(e/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if("bigint"===typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e))return e.toHexString();if(h(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(s(e)){for(var o="0x",a=0;a>4]+d[15&u]}return o}return n.throwArgumentError("invalid hexlify value","value",e)}function v(e){if("string"!==typeof e)e=p(e);else if(!h(e)||e.length%2)return null;return(e.length-2)/2}function y(e,t,r){return"string"!==typeof e?e=p(e):(!h(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function b(e){var t="0x";return e.forEach((function(e){t+=p(e).substring(2)})),t}function g(e){var t=m(p(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function m(e){"string"!==typeof e&&(e=p(e)),h(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);for(var t=0;t2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function k(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0};if(a(e)){var r=u(e);65!==r.length&&n.throwArgumentError("invalid signature string; must be 65 bytes","signature",e),t.r=p(r.slice(0,32)),t.s=p(r.slice(32,64)),t.v=r[64],t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=p(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){var i=l(u(t._vs),32);t._vs=p(i);var o=i[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=o:t.recoveryParam!==o&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),i[0]&=127;var s=p(i);null==t.s?t.s=s:t.s!==s&&n.throwArgumentError("signature v mismatch _vs","signature",e)}null==t.recoveryParam?null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2:null==t.v?t.v=27+t.recoveryParam:t.recoveryParam!==1-t.v%2&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e),null!=t.r&&h(t.r)?t.r=w(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&h(t.s)?t.s=w(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);var c=u(t.s);c[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(c[0]|=128);var f=p(c);t._vs&&(h(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=w(t._vs,32)),null==t._vs?t._vs=f:t._vs!==f&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t}function S(e){return p(c([(e=k(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return d}));var n=r(5),i=r(7),o=!1,a=!1,s={debug:1,default:2,info:2,warning:3,error:4,off:5},u=s.default,c=null;var f,l,h=function(){try{var e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(f||(f={})),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"}(l||(l={}));var d=function(){function e(t){Object(n.a)(this,e),Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}return Object(i.a)(e,[{key:"_log",value:function(e,t){var r=e.toLowerCase();null==s[r]&&this.throwArgumentError("invalid log level name","logLevel",e),u>s[r]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n=9007199254740991)&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,r,n){n=n?": "+n:"",tr&&this.throwError("too many arguments"+n,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}},{key:"checkNew",value:function(t,r){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}},{key:"checkAbstract",value:function(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}}],[{key:"globalLogger",value:function(){return c||(c=new e("logger/5.3.0")),c}},{key:"setCensorship",value:function(t,r){if(!t&&r&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}a=!!t,o=!!r}},{key:"setLogLevel",value:function(t){var r=s[t.toLowerCase()];null!=r?u=r:e.globalLogger().warn("invalid log level - "+t)}},{key:"from",value:function(t){return new e(t)}}]),e}();d.errors=l,d.levels=f},function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}},function(e,t,r){"use strict";(function(e){var n=r(550),i=r(551),o=r(335);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.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 r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(n)return K(e).length;t=(""+t).toLowerCase(),n=!0}}function v(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return M(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"===typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var l=!0,h=0;hi&&(n=i):n=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128===(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],a=e[i+2],128===(192&o)&&128===(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(n,i),f=e.slice(t,r),l=0;li)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return k(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function M(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function B(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function D(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return o||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function j(e,t,r,n,o){return o||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||R(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):B(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):B(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):B(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):B(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return j(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return j(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function V(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(36))},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(576).Buffer}catch(A){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=u(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],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];function d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],d=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?v+r:f[c-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n("undefined"!==typeof a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,v=d>>>13,y=0|a[2],b=8191&y,g=y>>>13,m=0|a[3],w=8191&m,k=m>>>13,S=0|a[4],E=8191&S,_=S>>>13,A=0|a[5],x=8191&A,T=A>>>13,M=0|a[6],C=8191&M,O=M>>>13,I=0|a[7],P=8191&I,R=I>>>13,B=0|a[8],D=8191&B,N=B>>>13,L=0|a[9],j=8191&L,U=L>>>13,F=0|s[0],K=8191&F,z=F>>>13,V=0|s[1],H=8191&V,J=V>>>13,q=0|s[2],G=8191&q,X=q>>>13,W=0|s[3],Z=8191&W,Y=W>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],le=8191&fe,he=fe>>>13,de=0|s[9],pe=8191&de,ve=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(c+(n=Math.imul(l,K))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,K)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,z))+Math.imul(v,K)|0,o=Math.imul(v,z);var be=(c+(n=n+Math.imul(l,H)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(h,H)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,K),i=(i=Math.imul(b,z))+Math.imul(g,K)|0,o=Math.imul(g,z),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,J)|0;var ge=(c+(n=n+Math.imul(l,G)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,K),i=(i=Math.imul(w,z))+Math.imul(k,K)|0,o=Math.imul(k,z),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,J)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,X)|0;var me=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(E,K),i=(i=Math.imul(E,z))+Math.imul(_,K)|0,o=Math.imul(_,z),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0;var we=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,K),i=(i=Math.imul(x,z))+Math.imul(T,K)|0,o=Math.imul(T,z),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,Y)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var ke=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(C,K),i=(i=Math.imul(C,z))+Math.imul(O,K)|0,o=Math.imul(O,z),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,J)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var Se=(c+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(P,K),i=(i=Math.imul(P,z))+Math.imul(R,K)|0,o=Math.imul(R,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var Ee=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,z))+Math.imul(N,K)|0,o=Math.imul(N,z),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var _e=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,he)|0)+Math.imul(h,le)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(j,K),i=(i=Math.imul(j,z))+Math.imul(U,K)|0,o=Math.imul(U,z),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(v,le)|0,o=o+Math.imul(v,he)|0;var Ae=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ve)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,ve)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(j,H),i=(i=Math.imul(j,J))+Math.imul(U,H)|0,o=Math.imul(U,J),n=n+Math.imul(D,G)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,Y)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(b,le)|0,i=(i=i+Math.imul(b,he)|0)+Math.imul(g,le)|0,o=o+Math.imul(g,he)|0;var xe=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(j,G),i=(i=Math.imul(j,X))+Math.imul(U,G)|0,o=Math.imul(U,X),n=n+Math.imul(D,Z)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,he)|0;var Te=(c+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ve)|0)+Math.imul(g,pe)|0))<<13)|0;c=((o=o+Math.imul(g,ve)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(j,Z),i=(i=Math.imul(j,Y))+Math.imul(U,Z)|0,o=Math.imul(U,Y),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,n=n+Math.imul(E,le)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,he)|0;var Me=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(j,$),i=(i=Math.imul(j,ee))+Math.imul(U,$)|0,o=Math.imul(U,ee),n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(x,le)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(T,le)|0,o=o+Math.imul(T,he)|0;var Ce=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ve)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(j,re),i=(i=Math.imul(j,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,n=n+Math.imul(C,le)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(O,le)|0,o=o+Math.imul(O,he)|0;var Oe=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ve)|0)+Math.imul(T,pe)|0))<<13)|0;c=((o=o+Math.imul(T,ve)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(j,oe),i=(i=Math.imul(j,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,n=n+Math.imul(P,le)|0,i=(i=i+Math.imul(P,he)|0)+Math.imul(R,le)|0,o=o+Math.imul(R,he)|0;var Ie=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ve)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ve)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(j,ue),i=(i=Math.imul(j,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,he)|0)+Math.imul(N,le)|0,o=o+Math.imul(N,he)|0;var Pe=(c+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ve)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(j,le),i=(i=Math.imul(j,he))+Math.imul(U,le)|0,o=Math.imul(U,he);var Re=(c+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ve)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Be=(c+(n=Math.imul(j,pe))|0)+((8191&(i=(i=Math.imul(j,ve))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ve))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=ye,u[1]=be,u[2]=ge,u[3]=me,u[4]=we,u[5]=ke,u[6]=Se,u[7]=Ee,u[8]=_e,u[9]=Ae,u[10]=xe,u[11]=Te,u[12]=Me,u[13]=Ce,u[14]=Oe,u[15]=Ie,u[16]=Pe,u[17]=Re,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function v(e,t,r){return(new y).mulp(e,t,r)}function y(e,t){this.x=e,this.y=t}Math.imul||(p=d),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):v(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},y.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=t.clone();!t.isZero();){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,v=1;0===(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0===(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function _(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(m,g),m.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},m.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new w;else if("p192"===e)t=new k;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return b[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var v=d,y=0;0!==v.cmp(s);y++)v=v.redSqr();n(y=0;n--){for(var c=t.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new _(e)},i(_,E),_.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},_.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},_.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},_.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(156)(e))},function(e,t,r){"use strict";function n(e,t){for(var r in t)Object.defineProperty(e,r,{value:t[r],enumerable:!0,configurable:!0});return e}e.exports=function(e,t,r){if(!e||"string"===typeof e)throw new TypeError("Please pass an Error to err-code");r||(r={}),"object"===typeof t&&(r=t,t=""),t&&(r.code=t);try{return n(e,r)}catch(o){r.message=e.message,r.stack=e.stack;var i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(e)),n(new i,r)}}},function(e,t,r){"use strict";function n(e){var t,r,i="";if("string"===typeof e||"number"===typeof e)i+=e;else if("object"===typeof e)if(Array.isArray(e))for(t=0;t1&&void 0!==arguments[1]?arguments[1]:{};return function(r){var o=t.defaultTheme,s=t.withTheme,h=void 0!==s&&s,d=t.name,p=Object(i.a)(t,["defaultTheme","withTheme","name"]);var v=d,y=Object(c.a)(e,Object(n.a)({defaultTheme:o,Component:r,name:d||r.displayName,classNamePrefix:v},p)),b=a.a.forwardRef((function(e,t){e.classes;var s,u=e.innerRef,c=Object(i.a)(e,["classes","innerRef"]),p=y(Object(n.a)({},r.defaultProps,e)),v=c;return("string"===typeof d||h)&&(s=Object(l.a)()||o,d&&(v=Object(f.a)({theme:s,name:d,props:c})),h&&!v.theme&&(v.theme=s)),a.a.createElement(r,Object(n.a)({ref:u||t,classes:p},v))}));return u()(b,r),b}},d=r(145);t.a=function(e,t){return h(e,Object(n.a)({defaultTheme:d.a},t))}},function(e,t,r){"use strict";e.exports=r(1062)},function(e,t,r){var n=r(188);e.exports=function(e,t){var r;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=n(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}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,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}},function(e,t,r){(function(n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(r){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(r){}!e&&"undefined"!==typeof n&&"env"in n&&(e=Object({NODE_ENV:"production",PUBLIC_URL:"/js-waku/eth-pm-wallet",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}).DEBUG);return e},t.useColors=function(){if("undefined"!==typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=function(){var e=!1;return function(){e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||function(){},e.exports=r(658)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,r(39))},function(e,t){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},function(e,t,r){e.exports=r(1063)()},function(e,t,r){"use strict";function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(i,o){var a=e.apply(t,r);function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}r.d(t,"a",(function(){return i}))},function(e,t,r){var n=r(241);e.exports=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&&n(e,t)}},function(e,t,r){var n=r(84),i=r(341),o=r(342);e.exports=function(e){var t=i();return function(){var r,i=n(e);if(t){var a=n(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return o(this,r)}}},function(e,t,r){var n=r(13),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"===typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!==typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"===typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){var n=r(86);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}e.exports=function(e){for(var t=1;t=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?v+=r:(!i.number.test(s.type)||l&&!s.sign?h="":(h=l?"+":"-",r=r.toString().replace(i.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",f=s.width-(h+r).length,u=s.width&&f>0?c.repeat(f):"",v+=s.align?h+r+u:"0"===c?h+u+r:u+h+r)}return v}var u=Object.create(null);function c(e){if(u[e])return u[e];for(var t,r=e,n=[],o=0;r;){if(null!==(t=i.text.exec(r)))n.push(t[0]);else if(null!==(t=i.modulo.exec(r)))n.push("%");else{if(null===(t=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var a=[],s=t[2],c=[];if(null===(c=i.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(c[1]);""!==(s=s.substring(c[0].length));)if(null!==(c=i.key_access.exec(s)))a.push(c[1]);else{if(null===(c=i.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(c[1])}t[2]=a}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return u[e]=n}t.sprintf=o,t.vsprintf=a,"undefined"!==typeof window&&(window.sprintf=o,window.vsprintf=a,void 0===(n=function(){return{sprintf:o,vsprintf:a}}.call(t,r,t,e))||(e.exports=n))}()},,function(e,t,r){(function(t,n,i,o){var a=r(18),s=r(746),u=e.exports=a.util=a.util||{};function c(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function f(e){if(this.data="",this.read=0,"string"===typeof e)this.data=e;else if(u.isArrayBuffer(e)||u.isArrayBufferView(e))if("undefined"!==typeof o&&e instanceof o)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(n){for(var r=0;r15?(i=Date.now(),s(e)):(r.push(e),1===r.length&&a.setAttribute("a",o=!o))}}u.nextTick=u.setImmediate}(),u.isNodejs="undefined"!==typeof t&&t.versions&&t.versions.node,u.globalScope=u.isNodejs?i:"undefined"===typeof self?window:self,u.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},u.isArrayBuffer=function(e){return"undefined"!==typeof ArrayBuffer&&e instanceof ArrayBuffer},u.isArrayBufferView=function(e){return e&&u.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},u.ByteBuffer=f,u.ByteStringBuffer=f;u.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},u.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},u.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},u.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},u.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},u.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},u.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(u.encodeUtf8(e))},u.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},u.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},u.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},u.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},u.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},u.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},u.ByteStringBuffer.prototype.putInt=function(e,t){c(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},u.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},u.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},u.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},u.ByteStringBuffer.prototype.bytes=function(e){return"undefined"===typeof e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},u.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},u.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},u.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},u.ByteStringBuffer.prototype.copy=function(){var e=u.createBuffer(this.data);return e.read=this.read,e},u.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},u.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},u.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},u.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},u.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},u.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},u.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},u.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},u.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},u.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},u.DataBuffer.prototype.putInt=function(e,t){c(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},u.DataBuffer.prototype.putSignedInt=function(e,t){return c(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},u.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},u.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},u.DataBuffer.prototype.bytes=function(e){return"undefined"===typeof e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},u.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},u.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},u.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},u.DataBuffer.prototype.copy=function(){return new u.DataBuffer(this)},u.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},u.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},u.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},u.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},u.xorBytes=function(e,t,r){for(var n="",i="",o="",a=0,s=0;r>0;--r,++a)i=e.charCodeAt(a)^t.charCodeAt(a),s>=10&&(n+=o,o="",s=0),o+=String.fromCharCode(i),++s;return n+=o},u.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],d="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";u.encode64=function(e,t){for(var r,n,i,o="",a="",s=0;s>2),o+=l.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=l.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":l.charAt(63&i)),t&&o.length>t&&(a+=o.substr(0,t)+"\r\n",o=o.substr(t));return a+=o},u.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,o="",a=0;a>4),64!==n&&(o+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(o+=String.fromCharCode((3&n)<<6|i)));return o},u.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},u.decodeUtf8=function(e){return decodeURIComponent(escape(e))},u.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:s.encode,decode:s.decode}},u.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},u.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o>2),o+=l.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=l.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":l.charAt(63&i)),t&&o.length>t&&(a+=o.substr(0,t)+"\r\n",o=o.substr(t));return a+=o},u.binary.base64.decode=function(e,t,r){var n,i,o,a,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,c=r=r||0;u>4,64!==o&&(s[c++]=(15&i)<<4|o>>2,64!==a&&(s[c++]=(3&o)<<6|a));return t?c-r:s.subarray(0,c)},u.binary.base58.encode=function(e,t){return u.binary.baseN.encode(e,d,t)},u.binary.base58.decode=function(e,t){return u.binary.baseN.decode(e,d,t)},u.text={utf8:{},utf16:{}},u.text.utf8.encode=function(e,t,r){e=u.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o0?(i=r[n].substring(0,a),o=r[n].substring(a+1)):(i=r[n],o=null),i in t||(t[i]=[]),i in Object.prototype||null===o||t[i].push(unescape(o))}return t};return"undefined"===typeof e?(null===k&&(k="undefined"!==typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=k):t=r(e),t},u.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:u.getQueryVariables(r)}},u.makeRequest=function(e){var t=u.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return"undefined"===typeof e?t.path:t.path[e]},getQuery:function(e,r){var n;return"undefined"===typeof e?n=t.query:(n=t.query[e])&&"undefined"!==typeof r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},u.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},u.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},u.format=function(e){for(var t,r,n=/%./g,i=0,o=[],a=0;t=n.exec(e);){(r=e.substring(a,n.lastIndex-2)).length>0&&o.push(r),a=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i");break;case"%":o.push("%");break;default:o.push("<%"+s+"?>")}}return o.push(e.substring(a)),o.join("")},u.formatNumber=function(e,t,r,n){var i=e,o=isNaN(t=Math.abs(t))?2:t,a=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",f=c.length>3?c.length%3:0;return u+(f?c.substr(0,f)+s:"")+c.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+s)+(o?a+Math.abs(i-c).toFixed(o).slice(2):"")},u.formatSize=function(e){return e=e>=1073741824?u.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?u.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?u.formatNumber(e/1024,0)+" KiB":u.formatNumber(e,0)+" bytes"},u.bytesFromIP=function(e){return-1!==e.indexOf(".")?u.bytesFromIPv4(e):-1!==e.indexOf(":")?u.bytesFromIPv6(e):null},u.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=u.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:s,end:s})}t.push(o)}if(r.length>0){var c=r[n];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),0===c.start&&t.unshift(""),7===c.end&&t.push(""))}return t.join(":")},u.estimateCores=function(e,t){if("function"===typeof e&&(t=e,e={}),e=e||{},"cores"in u&&!e.update)return t(null,u.cores);if("undefined"!==typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return u.cores=navigator.hardwareConcurrency,t(null,u.cores);if("undefined"===typeof Worker)return u.cores=1,t(null,u.cores);if("undefined"===typeof Blob)return u.cores=2,t(null,u.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()s.st&&i.sti.st&&s.st1)for(var r=1;r0&&"/"!==t.charAt(0))throw new Error('multiaddr "'.concat(t,'" must start with a "/"'));this.bytes=s.fromString(t)}else{if(!e.isMultiaddr(t))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=s.fromBytes(t.bytes)}}return a(e,[{key:"toString",value:function(){return s.bytesToString(this.bytes)}},{key:"toJSON",value:function(){return this.toString()}},{key:"toOptions",value:function(){var e={},t=this.toString().split("/");return e.family="ip4"===t[1]?4:6,e.host=t[2],e.transport=t[3],e.port=parseInt(t[4]),e}},{key:"protos",value:function(){return this.protoCodes().map((function(e){return Object.assign({},u(e))}))}},{key:"protoCodes",value:function(){for(var e=[],t=this.bytes,r=0;r=0;n--)if(r[n][0]===t)return new e(s.tuplesToBytes(r.slice(0,n)));return this}},{key:"getPeerId",value:function(){try{var e=this.stringTuples().filter((function(e){return e[0]===u.names.ipfs.code})).pop();if(e&&e[1]){var t=e[1];return"Q"===t[0]||"1"===t[0]?p(l.decode("z".concat(t)),"base58btc"):p(f.parse(t).multihash.bytes,"base58btc")}return null}catch(r){return null}}},{key:"getPath",value:function(){var e=null;try{(e=this.stringTuples().filter((function(e){return!!u(e[0]).path}))[0][1])||(e=null)}catch(t){e=null}return e}},{key:"equals",value:function(e){return v(this.bytes,e.bytes)}},{key:"resolve",value:function(){var t=i(n.mark((function t(){var r,i,o;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.protos().find((function(e){return e.resolvable}))){t.next=3;break}return t.abrupt("return",[this]);case 3:if(i=y.get(r.name)){t.next=6;break}throw h(new Error("no available resolver for ".concat(r.name)),"ERR_NO_AVAILABLE_RESOLVER");case 6:return t.next=8,i(this);case 8:return o=t.sent,t.abrupt("return",o.map((function(t){return new e(t)})));case 10:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"nodeAddress",value:function(){var e=this.protoCodes(),t=this.protoNames(),r=this.toString().split("/").slice(1);if(r.length<4)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6}/{address}/{tcp, udp}/{port}".');if(4!==e[0]&&41!==e[0]&&54!==e[0]&&55!==e[0])throw new Error("no protocol with name: \"'".concat(t[0],'\'". Must have a valid family name: "{ip4, ip6, dns4, dns6}".'));if("tcp"!==r[2]&&"udp"!==r[2])throw new Error("no protocol with name: \"'".concat(t[1],'\'". Must have a valid transport protocol: "{tcp, udp}".'));return{family:41===e[0]||55===e[0]?6:4,address:r[1],port:parseInt(r[3])}}},{key:"isThinWaistAddress",value:function(e){var t=(e||this).protos();return 2===t.length&&((4===t[0].code||41===t[0].code)&&(6===t[1].code||273===t[1].code))}},{key:d,value:function(){return""}},{key:"inspect",value:function(){return""}}],[{key:"fromNodeAddress",value:function(t,r){if(!t)throw new Error("requires node address object");if(!r)throw new Error("requires transport protocol");var n;switch(t.family){case 4:n="ip4";break;case 6:n="ip6";break;default:throw Error("Invalid addr family. Got '".concat(t.family,"' instead of 4 or 6"))}return new e("/"+[n,t.address,r,t.port].join("/"))}},{key:"isName",value:function(t){return!!e.isMultiaddr(t)&&t.protos().some((function(e){return e.resolvable}))}},{key:"isMultiaddr",value:function(t){return t instanceof e||Boolean(t&&t[b])}}]),e}();g.protocols=u,g.resolvers=y,e.exports={Multiaddr:g,multiaddr:function(e){return new g(e)},protocols:u,resolvers:y}},function(e,t,r){"use strict";var n=r(0),i=r(6),o=r(8),a=r(9),s=r(29),u=r(90).CID,c=r(67),f=r(162),l=r(58),h=r(63),d=r(58).base58btc,p=r(67).base32,v=r(161).base16,y=r(88),b=r(268),g=r(170),m=r(797).PeerIdProto,w=r(798).equals,k=r(799).fromString,S=r(800).toString,E=r(89).identity,_=s(s(s(s({},c),f),l),h),A=Object.keys(_).reduce((function(e,t){return e.or(_[t])}),p.decoder),x=g(function(){function e(t,r,n){if(o(this,e),!(t instanceof Uint8Array))throw new Error("invalid id provided");if(r&&n&&!w(r.public.bytes,n.bytes))throw new Error("inconsistent arguments");this._id=t,this._idB58String=d.encode(this.id).substring(1),this._privKey=r,this._pubKey=n}return a(e,[{key:"id",get:function(){return this._id},set:function(e){throw new Error("Id is immutable")}},{key:"privKey",get:function(){return this._privKey},set:function(e){this._privKey=e}},{key:"pubKey",get:function(){if(this._pubKey)return this._pubKey;if(this._privKey)return this._privKey.public;try{var e=y.decode(this.id);e.code===E.code&&(this._pubKey=b.unmarshalPublicKey(e.digest))}catch(t){}return this._pubKey},set:function(e){this._pubKey=e}},{key:"marshalPubKey",value:function(){if(this.pubKey)return b.marshalPublicKey(this.pubKey)}},{key:"marshalPrivKey",value:function(){if(this.privKey)return b.marshalPrivateKey(this.privKey)}},{key:"marshal",value:function(e){return m.encode({id:this.toBytes(),pubKey:this.marshalPubKey(),privKey:e?null:this.marshalPrivKey()}).finish()}},{key:"toPrint",value:function(){var e=this.toB58String();e.startsWith("Qm")&&(e=e.slice(2));var t=6;return e.length"}},{key:"toJSON",value:function(){return{id:this.toB58String(),privKey:O(this.marshalPrivKey()),pubKey:O(this.marshalPubKey())}}},{key:"toHexString",value:function(){return v.encode(this.id).substring(1)}},{key:"toBytes",value:function(){return this.id}},{key:"toB58String",value:function(){return this._idB58String}},{key:"toString",value:function(){if(!this._idCIDString){var e=u.createV1(114,y.decode(this.id));Object.defineProperty(this,"_idCIDString",{value:e.toString(),enumerable:!1})}return this._idCIDString}},{key:"equals",value:function(e){if(e instanceof Uint8Array)return w(this.id,e);if(e.id)return w(this.id,e.id);throw new Error("not valid Id")}},{key:"isEqual",value:function(e){return this.equals(e)}},{key:"isValid",value:function(){return Boolean(this.privKey&&this.privKey.public&&this.privKey.public.bytes&&this.pubKey.bytes instanceof Uint8Array&&w(this.privKey.public.bytes,this.pubKey.bytes))}},{key:"hasInlinePublicKey",value:function(){try{if(y.decode(this.id).code===E.code)return!0}catch(e){}return!1}}]),e}(),{className:"PeerId",symbolName:"@libp2p/js-peer-id/PeerId"});t=e.exports=x;var T=function(e){return e.bytes.length<=42?y.create(E.code,e.bytes).bytes:e.hash()},M=function(){var e=i(n.mark((function e(t,r){var i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T(r);case 2:return i=e.sent,e.abrupt("return",new x(i,t,r));case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}();t.create=function(){var e=i(n.mark((function e(t){var r;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=t||{}).bits=t.bits||2048,t.keyType=t.keyType||"RSA",e.next=5,b.generateKeyPair(t.keyType,t.bits);case 5:return r=e.sent,e.abrupt("return",M(r,r.public));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.createFromHexString=function(e){return new x(v.decode("f"+e))},t.createFromBytes=function(e){try{var r=u.decode(e);if(!C(r))throw new Error("Supplied PeerID CID is invalid");return t.createFromCID(r)}catch(n){if(y.decode(e).code!==E.code)throw new Error("Supplied PeerID CID is invalid");return new x(e)}},t.createFromB58String=function(e){return t.createFromBytes(d.decode("z"+e))};var C=function(e){return 114===e.code||112===e.code};function O(e){if(e)return S(e,"base64pad")}t.createFromCID=function(e){if(!(e=u.asCID(e))||!C(e))throw new Error("Supplied PeerID CID is invalid");return new x(e.multihash.bytes)},t.createFromPubKey=function(){var e=i(n.mark((function e(t){var r,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"===typeof(r=t)&&(r=k(t,"base64pad")),r instanceof Uint8Array){e.next=4;break}throw new Error("Supplied key is neither a base64 string nor a Uint8Array");case 4:return e.next=6,b.unmarshalPublicKey(r);case 6:return i=e.sent,e.abrupt("return",M(void 0,i));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.createFromPrivKey=function(){var e=i(n.mark((function e(t){var r;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"===typeof t&&(t=k(t,"base64pad")),t instanceof Uint8Array){e.next=3;break}throw new Error("Supplied key is neither a base64 string nor a Uint8Array");case 3:return e.next=5,b.unmarshalPrivateKey(t);case 5:return r=e.sent,e.abrupt("return",M(r,r.public));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.createFromJSON=function(){var e=i(n.mark((function e(t){var r,i,o,a,s,u,c;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=d.decode("z"+t.id),i=t.privKey&&k(t.privKey,"base64pad"),o=t.pubKey&&k(t.pubKey,"base64pad"),e.t0=o,!e.t0){e.next=8;break}return e.next=7,b.unmarshalPublicKey(o);case 7:e.t0=e.sent;case 8:if(a=e.t0,i){e.next=11;break}return e.abrupt("return",new x(r,void 0,a));case 11:return e.next=13,b.unmarshalPrivateKey(i);case 13:return s=e.sent,e.next=16,T(s.public);case 16:if(u=e.sent,!a){e.next=21;break}return e.next=20,T(a);case 20:c=e.sent;case 21:if(!a||w(u,c)){e.next=23;break}throw new Error("Public and private key do not match");case 23:if(!r||w(u,r)){e.next=25;break}throw new Error("Id and private key do not match");case 25:return e.abrupt("return",new x(r,s,a));case 26:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.createFromProtobuf=function(){var e=i(n.mark((function e(t){var r,i,o,a,s,u;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"===typeof t&&(t=k(t,"base16")),r=m.decode(t),i=r.id,o=r.privKey,a=r.pubKey,!o){e.next=8;break}return e.next=5,b.unmarshalPrivateKey(o);case 5:e.t0=e.sent,e.next=9;break;case 8:e.t0=!1;case 9:if(o=e.t0,!a){e.next=16;break}return e.next=13,b.unmarshalPublicKey(a);case 13:e.t1=e.sent,e.next=17;break;case 16:e.t1=!1;case 17:if(a=e.t1,!o){e.next=22;break}return e.next=21,T(o.public);case 21:u=e.sent;case 22:if(!a){e.next=26;break}return e.next=25,T(a);case 25:s=e.sent;case 26:if(!o){e.next=31;break}if(!a){e.next=30;break}if(w(u,s)){e.next=30;break}throw new Error("Public and private key do not match");case 30:return e.abrupt("return",new x(u,o,o.public));case 31:if(!a){e.next=33;break}return e.abrupt("return",new x(s,void 0,a));case 33:if(!i){e.next=35;break}return e.abrupt("return",new x(i));case 35:throw new Error("Protobuf did not contain any usable key material");case 36:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.parse=function(e){return"1"!==e.charAt(0)&&"Q"!==e.charAt(0)||(e="z".concat(e)),t.createFromBytes(A.decode(e))},t.isPeerId=function(e){return Boolean("object"===typeof e&&e._id&&e._idB58String)}},function(e,t,r){var n=r(823);e.exports=function(e){return function(){return new n(e.apply(this,arguments))}}},function(e,t,r){var n=r(437);e.exports=function(e){return new n(e)}},,function(e,t,r){(function(){var t;function r(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function n(){return new r(null)}var i="undefined"!==typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function(e,t,r,n,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var u=32767&this[e],c=this[e++]>>15,f=s*u+c*a;i=((u=a*u+((32767&f)<<15)+r[n]+(1073741823&i))>>>30)+(f>>>15)+s*c+(i>>>30),r[n++]=1073741823&u}return i},t=30):i&&"Netscape"!=navigator.appName?(r.prototype.am=function(e,t,r,n,i,o){for(;--o>=0;){var a=t*this[e++]+r[n]+i;i=Math.floor(a/67108864),r[n++]=67108863&a}return i},t=26):(r.prototype.am=function(e,t,r,n,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var u=16383&this[e],c=this[e++]>>14,f=s*u+c*a;i=((u=a*u+((16383&f)<<14)+r[n]+i)>>28)+(f>>14)+s*c,r[n++]=268435455&u}return i},t=28),r.prototype.DB=t,r.prototype.DM=(1<>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function h(e){this.m=e}function d(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function m(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function w(){}function k(e){return e}function S(e){this.r2=n(),this.q3=n(),r.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}h.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},h.prototype.revert=function(e){return e},h.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},h.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},h.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},d.prototype.convert=function(e){var t=n();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(r.ZERO)>0&&this.m.subTo(t,t),t},d.prototype.revert=function(e){var t=n();return e.copyTo(t),this.reduce(t),t},d.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},d.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},d.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},r.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},r.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},r.prototype.fromString=function(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(256==t)n=8;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)return void this.fromRadix(e,t);n=2}this.t=0,this.s=0;for(var i=e.length,o=!1,a=0;--i>=0;){var s=8==n?255&e[i]:c(e,i);s<0?"-"==e.charAt(i)&&(o=!0):(o=!1,0==a?this[this.t++]=s:a+n>this.DB?(this[this.t-1]|=(s&(1<>this.DB-a):this[this.t-1]|=s<=this.DB&&(a-=this.DB))}8==n&&0!=(128&e[0])&&(this.s=-1,a>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==e;)--this.t},r.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},r.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t[r+a+1]=this[r]>>i|s,s=(this[r]&o)<=0;--r)t[r]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},r.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,o=(1<>n;for(var a=r+1;a>n;n>0&&(t[this.t-r-1]|=(this.s&o)<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},r.prototype.multiplyTo=function(e,t){var n=this.abs(),i=e.abs(),o=n.t;for(t.t=o+i.t;--o>=0;)t[o]=0;for(o=0;o=0;)e[r]=0;for(r=0;r=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},r.prototype.divRemTo=function(e,t,i){var o=e.abs();if(!(o.t<=0)){var a=this.abs();if(a.t0?(o.lShiftTo(f,s),a.lShiftTo(f,i)):(o.copyTo(s),a.copyTo(i));var h=s.t,d=s[h-1];if(0!=d){var p=d*(1<1?s[h-2]>>this.F2:0),v=this.FV/p,y=(1<=0&&(i[i.t++]=1,i.subTo(w,i)),r.ONE.dlShiftTo(h,w),w.subTo(s,s);s.t=0;){var k=i[--g]==d?this.DM:Math.floor(i[g]*v+(i[g-1]+b)*y);if((i[g]+=s.am(0,k,i,m,0,h))0&&i.rShiftTo(f,i),u<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(e,t){if(e>4294967295||e<1)return r.ONE;var i=n(),o=n(),a=t.convert(this),s=l(e)-1;for(a.copyTo(i);--s>=0;)if(t.sqrTo(i,o),(e&1<0)t.mulTo(o,a,i);else{var u=i;i=o,o=u}return t.revert(i)},r.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<0)for(s>s)>0&&(i=!0,o=u(r));a>=0;)s>(s+=this.DB-t)):(r=this[a]>>(s-=t)&n,s<=0&&(s+=this.DB,--a)),r>0&&(i=!0),i&&(o+=u(r));return i?o:"0"},r.prototype.negate=function(){var e=n();return r.ZERO.subTo(this,e),e},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+l(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(e){var t=n();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(r.ZERO)>0&&e.subTo(t,t),t},r.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new h(t):new d(t),this.exp(e,r)},r.ZERO=f(0),r.ONE=f(1),w.prototype.convert=k,w.prototype.revert=k,w.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},w.prototype.sqrTo=function(e,t){e.squareTo(t)},S.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=n();return e.copyTo(t),this.reduce(t),t},S.prototype.revert=function(e){return e},S.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},S.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},S.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var E,_,A,x=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],T=(1<<26)/x[x.length-1];function M(){var e;e=(new Date).getTime(),_[A++]^=255&e,_[A++]^=e>>8&255,_[A++]^=e>>16&255,_[A++]^=e>>24&255,A>=D&&(A-=D)}if(r.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},r.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),i=f(r),o=n(),a=n(),s="";for(this.divRemTo(i,o,a);o.signum()>0;)s=(r+a.intValue()).toString(e).substr(1)+s,o.divRemTo(i,o,a);return a.intValue().toString(e)+s},r.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var n=this.chunkSize(t),i=Math.pow(t,n),o=!1,a=0,s=0,u=0;u=n&&(this.dMultiply(i),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(s,0)),o&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(e,t,n){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(r.ONE.shiftLeft(e-1),v,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(r.ONE.shiftLeft(e-1),this);else{var i=new Array,o=7&e;i.length=1+(e>>3),t.nextBytes(i),o>0?i[0]&=(1<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},r.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},r.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i=0;)r[n]=0;for(n=Math.max(t-this.t,0);n0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},r.prototype.millerRabin=function(e){var t=this.subtract(r.ONE),i=t.getLowestSetBit();if(i<=0)return!1;var o=t.shiftRight(i);(e=e+1>>1)>x.length&&(e=x.length);for(var a=n(),s=0;s>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<=0;)n<8?(r=(this[e]&(1<>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},r.prototype.equals=function(e){return 0==this.compareTo(e)},r.prototype.min=function(e){return this.compareTo(e)<0?this:e},r.prototype.max=function(e){return this.compareTo(e)>0?this:e},r.prototype.and=function(e){var t=n();return this.bitwiseTo(e,p,t),t},r.prototype.or=function(e){var t=n();return this.bitwiseTo(e,v,t),t},r.prototype.xor=function(e){var t=n();return this.bitwiseTo(e,y,t),t},r.prototype.andNot=function(e){var t=n();return this.bitwiseTo(e,b,t),t},r.prototype.not=function(){for(var e=n(),t=0;t=this.t?0!=this.s:0!=(this[t]&1<1){var v=n();for(i.sqrTo(s[1],v);u<=p;)s[u]=n(),i.mulTo(v,s[u-2],s[u]),u+=2}var y,b,g=e.t-1,m=!0,w=n();for(o=l(e[g])-1;g>=0;){for(o>=c?y=e[g]>>o-c&p:(y=(e[g]&(1<0&&(y|=e[g-1]>>this.DB+o-c)),u=r;0==(1&y);)y>>=1,--u;if((o-=u)<0&&(o+=this.DB,--g),m)s[y].copyTo(a),m=!1;else{for(;u>1;)i.sqrTo(a,w),i.sqrTo(w,a),u-=2;u>0?i.sqrTo(a,w):(b=a,a=w,w=b),i.mulTo(w,s[y],a)}for(;g>=0&&0==(e[g]&1<=0?(n.subTo(i,n),t&&o.subTo(s,o),a.subTo(u,a)):(i.subTo(n,i),t&&s.subTo(o,s),u.subTo(a,u))}return 0!=i.compareTo(r.ONE)?r.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},r.prototype.pow=function(e){return this.exp(e,new w)},r.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return t;for(i0&&(t.rShiftTo(o,t),r.rShiftTo(o,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},r.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=x[x.length-1]){for(t=0;t>>8,_[A++]=255&C;A=0,M()}function P(){if(null==E){for(M(),(E=new B).init(_),A=0;A<_.length;++A)_[A]=0;A=0}return E.next()}function R(){}function B(){this.i=0,this.j=0,this.S=new Array}R.prototype.nextBytes=function(e){var t;for(t=0;t0)t[i]=e(t[i]||{},r,n);else{var o=t[i];o&&(n=[].concat(o).concat(n)),t[i]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(o,"decorateRoot",{get:function(){return a.decorated||(a.decorated=new(r(334)))}})},function(e,t,r){"use strict";var n,i="object"===typeof Reflect?Reflect:null,o=i&&"function"===typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"===typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"===typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}b(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"===typeof e.on&&b(e,"error",t,r)}(e,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var i,o,a,s;if(c(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"===typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=f(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"===typeof u)o(u,this,t);else{var c=u.length,f=y(u,c);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},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):v.call(e,t)},s.prototype.listenerCount=v,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(87),i=n.baseX({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),o=n.baseX({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});t.base58btc=i,t.base58flickr=o},function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return f})),r.d(t,"d",(function(){return l}));var n=r(519);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),r)}function o(e){if(e.type)return e;if("#"===e.charAt(0))return o(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),r=e.match(t);return r&&1===r[0].length&&(r=r.map((function(e){return e+e}))),r?"rgb".concat(4===r.length?"a":"","(").concat(r.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),r=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(r))throw new Error(Object(n.a)(3,e));var i=e.substring(t+1,e.length-1).split(",");return{type:r,values:i=i.map((function(e){return parseFloat(e)}))}}function a(e){var t=e.type,r=e.values;return-1!==t.indexOf("rgb")?r=r.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(r[1]="".concat(r[1],"%"),r[2]="".concat(r[2],"%")),"".concat(t,"(").concat(r.join(", "),")")}function s(e,t){var r=u(e),n=u(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function u(e){var t="hsl"===(e=o(e)).type?o(function(e){var t=(e=o(e)).values,r=t[0],n=t[1]/100,i=t[2]/100,s=n*Math.min(i,1-i),u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+r/30)%12;return i-s*Math.max(Math.min(t-3,9-t,1),-1)},c="rgb",f=[Math.round(255*u(0)),Math.round(255*u(8)),Math.round(255*u(4))];return"hsla"===e.type&&(c+="a",f.push(t[3])),a({type:c,values:f})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e,t){return e=o(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,a(e)}function f(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var r=0;r<3;r+=1)e.values[r]*=1-t;return a(e)}function l(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;return a(e)}},function(e,t){var r=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n1&&i(t[t.length-1])&&(t[t.length-1]=t[t.length-1].sink),t.length>2)for(var c=1;ct){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,o,a){if(n.util.isArray(o)){for(var s=[],u=0;ut){if(n.strict){var p=new Error("Too few bytes to read ASN.1 value.");throw p.available=e.length(),p.remaining=t,p.requested=d,p}d=t}var v=32===(32&u);if(v)if(l=[],void 0===d)for(;;){if(o(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}s=e.length(),l.push(a(e,t,r+1,n)),t-=s-e.length()}else for(;d>0;)s=e.length(),l.push(a(e,d,r+1,n)),t-=s-e.length(),d-=s-e.length();if(void 0===l&&c===i.Class.UNIVERSAL&&f===i.Type.BITSTRING&&(h=e.bytes(d)),void 0===l&&n.decodeBitStrings&&c===i.Class.UNIVERSAL&&f===i.Type.BITSTRING&&d>1){var y=e.read,b=t,g=0;if(f===i.Type.BITSTRING&&(o(e,t,1),g=e.getByte(),t--),0===g)try{s=e.length();var m=a(e,t,r+1,{verbose:n.verbose,strict:!0,decodeBitStrings:!0}),w=s-e.length();t-=w,f==i.Type.BITSTRING&&w++;var k=m.tagClass;w!==d||k!==i.Class.UNIVERSAL&&k!==i.Class.CONTEXT_SPECIFIC||(l=[m])}catch(E){}void 0===l&&(e.read=y,t=b)}if(void 0===l){if(void 0===d){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");d=t}if(f===i.Type.BMPSTRING)for(l="";d>0;d-=2)o(e,t,2),l+=String.fromCharCode(e.getInt16()),t-=2;else l=e.getBytes(d)}var S=void 0===h?null:{bitStringContents:h};return i.create(c,f,v,l,S)}i.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"===typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"===typeof e&&(e=n.util.createBuffer(e)),a(e,e.length(),0,t)},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,o=n.util.createBuffer(),a=!1;if("bitStringContents"in e&&(a=!0,e.original&&(a=i.equals(e,e.original))),a)o.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:o.putByte(0);for(var s=0;s1&&(0===e.value.charCodeAt(0)&&0===(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128===(128&e.value.charCodeAt(1)))?o.putBytes(e.value.substr(1)):o.putBytes(e.value);if(t.putByte(r),o.length()<=127)t.putByte(127&o.length());else{var u=o.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);t.putByte(128|c.length);for(s=c.length-1;s>=0;--s)t.putByte(c.charCodeAt(s))}return t.putBuffer(o),t},i.oidToDer=function(e){var t,r,i,o,a=e.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var u=2;u>>=7,t||(o|=128),r.push(o),t=!1}while(i>0);for(var c=r.length-1;c>=0;--c)s.putByte(r[c])}return s},i.derToOid=function(e){var t;"string"===typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),o=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var u=e.charAt(10),c=10;"+"!==u&&"-"!==u&&(s=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(o,a,s,0),c&&("+"===(u=e.charAt(c))||"-"===u)){var f=60*parseInt(e.substr(c+1,2),10)+parseInt(e.substr(c+4,2),10);f*=6e4,"+"===u?t.setTime(+t-f):t.setTime(+t+f)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),a=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),u=0,c=0,f=!1;"Z"===e.charAt(e.length-1)&&(f=!0);var l=e.length-5,h=e.charAt(l);"+"!==h&&"-"!==h||(c=60*parseInt(e.substr(l+1,2),10)+parseInt(e.substr(l+4,2),10),c*=6e4,"+"===h&&(c*=-1),f=!0);return"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),f?(t.setUTCFullYear(r,n,i),t.setUTCHours(o,a,s,u),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(o,a,s,u)),t},i.dateToUtcTime=function(e){if("string"===typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"===typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,o){var a=!1;if(e.tagClass!==t.tagClass&&"undefined"!==typeof t.tagClass||e.type!==t.type&&"undefined"!==typeof t.type)o&&(e.tagClass!==t.tagClass&&o.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&o.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||"undefined"===typeof t.constructed){if(a=!0,t.value&&n.util.isArray(t.value))for(var s=0,u=0;a&&u0&&(o+="\n");for(var a="",u=0;u1?o+="0x"+n.util.bytesToHex(e.value.slice(1)):o+="(none)",e.value.length>0){var h=e.value.charCodeAt(0);1==h?o+=" (1 unused bit shown)":h>1&&(o+=" ("+h+" unused bits shown)")}}else e.type===i.Type.OCTETSTRING?(s.test(e.value)||(o+="("+e.value+") "),o+="0x"+n.util.bytesToHex(e.value)):e.type===i.Type.UTF8?o+=n.util.decodeUtf8(e.value):e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?o+=e.value:s.test(e.value)?o+="0x"+n.util.bytesToHex(e.value):0===e.value.length?o+="[null]":o+=e.value}return o}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(87),i=n.rfc4648({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),o=n.rfc4648({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),a=n.rfc4648({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),s=n.rfc4648({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});t.base64=i,t.base64pad=o,t.base64url=a,t.base64urlpad=s},function(e,t,r){"use strict";var n=r(367),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function a(e){return"undefined"===typeof e}function s(e){return null!==e&&"object"===typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===i.call(e)}function f(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0===(1&u)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0===(1&c)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"===typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(87),i=n.rfc4648({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),o=n.rfc4648({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),a=n.rfc4648({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),s=n.rfc4648({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),u=n.rfc4648({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),c=n.rfc4648({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),f=n.rfc4648({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),l=n.rfc4648({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),h=n.rfc4648({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});t.base32=i,t.base32hex=u,t.base32hexpad=f,t.base32hexpadupper=l,t.base32hexupper=c,t.base32pad=a,t.base32padupper=s,t.base32upper=o,t.base32z=h},function(e,t,r){"use strict";var n=t,i=r(92),o=r(108),a=r(411);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0===(1&u)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0===(1&c)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"===typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t,r){"use strict";function n(e){var t=e.props,r=e.states,n=e.muiFormControl;return r.reduce((function(e,r){return e[r]=t[r],n&&"undefined"===typeof t[r]&&(e[r]=n[r]),e}),{})}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),i="undefined"!==typeof window?n.useLayoutEffect:n.useEffect;function o(e){var t=n.useRef(e);return i((function(){t.current=e})),n.useCallback((function(){return t.current.apply(void 0,arguments)}),[])}},,function(e,t,r){"use strict";!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function a(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var s={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},u=function(){var e="0123456789abcdef";return{toBytes:function(e){for(var t=[],r=0;r>4]+e[15&i])}return r.join("")}}}(),c={16:10,24:12,32:14},f=[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],l=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],d=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],v=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],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],g=[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],m=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],k=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],S=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],E=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],_=[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 A(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,u=i;u>16&255]<<24^l[a>>8&255]<<16^l[255&a]<<8^l[a>>24&255]^f[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^l[a>>16&255]<<16^l[a>>24&255]<<24;for(t=i/2+1;t>2,d=u%4,this._Ke[h][d]=o[t],this._Kd[e-h][d]=o[t++],u++}for(var h=1;h>24&255]^S[a>>16&255]^E[a>>8&255]^_[255&a]},x.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=A(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a>24&255]^p[n[(i+1)%4]>>16&255]^v[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[a][i];n=r.slice()}var s,u=o(16);for(i=0;i<4;i++)s=this._Ke[t][i],u[4*i]=255&(l[n[i]>>24&255]^s>>24),u[4*i+1]=255&(l[n[(i+1)%4]>>16&255]^s>>16),u[4*i+2]=255&(l[n[(i+2)%4]>>8&255]^s>>8),u[4*i+3]=255&(l[255&n[(i+3)%4]]^s);return u},x.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=A(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a>24&255]^g[n[(i+3)%4]>>16&255]^m[n[(i+2)%4]>>8&255]^w[255&n[(i+1)%4]]^this._Kd[a][i];n=r.slice()}var s,u=o(16);for(i=0;i<4;i++)s=this._Kd[t][i],u[4*i]=255&(h[n[i]>>24&255]^s>>24),u[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^s>>16),u[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),u[4*i+3]=255&(h[255&n[(i+1)%4]]^s);return u};var T=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new x(t)};T.prototype.encrypt=function(e){if((e=i(e)).length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},I.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},I.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var P=function e(t,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",r instanceof I||(r=new I(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new x(t)};P.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}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,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}},function(e,t,r){"use strict";var n=r(66),i=r(23);function o(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"===typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),i=0;i>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t;return u+=(c=c+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var f=0,l=t;return f+=(l=l+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(625),t),i(r(626),t),i(r(627),t),i(r(628),t)},function(e,t,r){"use strict";var n=r(108),i=r(201);function o(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"===typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),i=0;i>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t;return u+=(c=c+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var f=0,l=t;return f+=(l=l+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){var n=r(18);if(r(62),r(114),r(168),r(766),r(768),r(113),r(34),"undefined"===typeof i)var i=n.jsbn.BigInteger;var o=n.util.isNodejs?r(271):null,a=n.asn1,s=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,c=[6,4,2,4,2,4,6,2],f={name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},l={name:"RSAPrivateKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},h={name:"RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},d=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},p=function(e){var t;if(!(e.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=u.oids[e.algorithm];var n=a.oidToDer(t).getBytes(),i=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]),o=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);o.value.push(a.create(a.Class.UNIVERSAL,a.Type.OID,!1,n)),o.value.push(a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,""));var s=a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(o),i.value.push(s),a.toDer(i).getBytes()},v=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var o;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{o=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(o.compareTo(t.n)>=0||!o.gcd(t.n).equals(i.ONE));for(var a=(e=e.multiply(o.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);a.compareTo(s)<0;)a=a.add(t.p);var u=a.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return u=u.multiply(o.modInverse(t.n)).mod(t.n)};function y(e,t,r){var i=n.util.createBuffer(),o=Math.ceil(t.n.bitLength()/8);if(e.length>o-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=o-11,a}i.putByte(0),i.putByte(r);var s,u=o-3-e.length;if(0===r||1===r){s=0===r?0:255;for(var c=0;c0;){var f=0,l=n.random.getBytes(u);for(c=0;c1;){if(255!==a.getByte()){--a.read;break}++c}else if(2===u)for(c=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++c}if(0!==a.getByte()||c!==o-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function g(e,t,r){"function"===typeof t&&(r=t,t={});var o={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function a(){s(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?c(t,e.q):void s(e.qBits,c))}))}function s(e,t){n.prime.generateProbablePrime(e,o,t)}function c(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var o=e.p;e.p=e.q,e.q=o}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void a();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void s(e.qBits,c);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void a();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void s(e.qBits,c);var f=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,f,e.p,e.q,f.mod(e.p1),f.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(o.prng=t.prng),a()}function m(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0===(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128===(128&r.charCodeAt(1)))?r.substr(1):r}function w(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function k(e){return n.util.isNodejs&&"function"===typeof o[e]}function S(e){return"undefined"!==typeof s.globalScope&&"object"===typeof s.globalScope.crypto&&"object"===typeof s.globalScope.crypto.subtle&&"function"===typeof s.globalScope.crypto.subtle[e]}function E(e){return"undefined"!==typeof s.globalScope&&"object"===typeof s.globalScope.msCrypto&&"object"===typeof s.globalScope.msCrypto.subtle&&"function"===typeof s.globalScope.msCrypto.subtle[e]}function _(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i0;)f.putByte(0),--l;return f.putBytes(n.util.hexToBytes(c)),f.getBytes()},u.rsa.decrypt=function(e,t,r,o){var a=Math.ceil(t.n.bitLength()/8);if(e.length!==a){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=a,s}var u=new i(n.util.createBuffer(e).toHex(),16);if(u.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=v(u,t,r).toString(16),f=n.util.createBuffer(),l=a-Math.ceil(c.length/2);l>0;)f.putByte(0),--l;return f.putBytes(n.util.hexToBytes(c)),!1!==o?b(f.getBytes(),t,r):f.getBytes()},u.rsa.createKeyPairGenerationState=function(e,t,r){"string"===typeof e&&(e=parseInt(e,10)),e=e||2048;var o,a=(r=r||{}).prng||n.random,s={nextBytes:function(e){for(var t=a.getBytesSync(e.length),r=0;r>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(o.eInt),o},u.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,o=0,a=function(e,t){return e|t},s=+new Date,f=0;null===e.keys&&(t<=0||fl?e.pqState=0:e.num.isProbablePrime(w(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(c[o++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var d=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,d,e.p,e.q,d.mod(e.p1),d.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)}}f+=(n=+new Date)-s,s=n}return null!==e.keys},u.rsa.generateKeyPair=function(e,t,r,i){if(1===arguments.length?"object"===typeof e?(r=e,e=void 0):"function"===typeof e&&(i=e,e=void 0):2===arguments.length?"number"===typeof e?"function"===typeof t?(i=t,t=void 0):"number"!==typeof t&&(r=t,t=void 0):(r=e,i=t,e=void 0,t=void 0):3===arguments.length&&("number"===typeof t?"function"===typeof r&&(i=r,r=void 0):(i=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(i){if(k("generateKeyPair"))return o.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return i(e);i(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(t)})}));if(S("generateKey")&&S("exportKey"))return s.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:_(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return s.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){i(e)})).then((function(e){if(e){var t=u.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(e)));i(null,{privateKey:t,publicKey:u.setRsaPublicKey(t.n,t.e)})}}));if(E("generateKey")&&E("exportKey")){var c=s.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:_(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(e){var t=e.target.result,r=s.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=u.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(t)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){i(e)}},void(c.onerror=function(e){i(e)})}}else if(k("generateKeyPairSync")){var f=o.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(f.privateKey),publicKey:u.publicKeyFromPem(f.publicKey)}}var l=u.rsa.createKeyPairGenerationState(e,t,r);if(!i)return u.rsa.stepKeyPairGenerationState(l,0),l.keys;g(l,r,i)},u.setRsaPublicKey=u.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"===typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return y(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"===typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var o=t.encode(e,r,!0);return u.rsa.encrypt(o,r,!0)},verify:function(e,t,n){"string"===typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=b(t,r,!0),e===a.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=b(t,r,!0))}});var i=u.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(e,t,r,i,o,a,s,c){var f={n:e,e:t,d:r,p:i,q:o,dP:a,dQ:s,qInv:c,decrypt:function(e,t,r){"string"===typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=u.rsa.decrypt(e,f,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:b};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,f,!1)},sign:function(e,t){var r=!1;"string"===typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:p},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,f.n.bitLength());return u.rsa.encrypt(n,f,r)}};return f},u.wrapRsaPrivateKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(u.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(e).getBytes())])},u.privateKeyFromAsn1=function(e){var t,r,o,s,c,h,d,p,v={},y=[];if(a.validate(e,f,v,y)&&(e=a.fromDer(n.util.createBuffer(v.privateKey))),v={},y=[],!a.validate(e,l,v,y)){var b=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw b.errors=y,b}return t=n.util.createBuffer(v.privateKeyModulus).toHex(),r=n.util.createBuffer(v.privateKeyPublicExponent).toHex(),o=n.util.createBuffer(v.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(v.privateKeyPrime1).toHex(),c=n.util.createBuffer(v.privateKeyPrime2).toHex(),h=n.util.createBuffer(v.privateKeyExponent1).toHex(),d=n.util.createBuffer(v.privateKeyExponent2).toHex(),p=n.util.createBuffer(v.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(t,16),new i(r,16),new i(o,16),new i(s,16),new i(c,16),new i(h,16),new i(d,16),new i(p,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,m(e.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,m(e.e)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,m(e.d)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,m(e.p)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,m(e.q)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,m(e.dP)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,m(e.dQ)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,m(e.qInv))])},u.publicKeyFromAsn1=function(e){var t={},r=[];if(a.validate(e,d,t,r)){var o,s=a.derToOid(t.publicKeyOid);if(s!==u.oids.rsaEncryption)throw(o=new Error("Cannot read public key. Unknown OID.")).oid=s,o;e=t.rsaPublicKey}if(r=[],!a.validate(e,h,t,r))throw(o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,o;var c=n.util.createBuffer(t.publicKeyModulus).toHex(),f=n.util.createBuffer(t.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(c,16),new i(f,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(u.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(e)])])},u.publicKeyToRSAPublicKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,m(e.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,m(e.e))])}},function(e,t,r){"use strict";var n=r(13).Buffer,i=Symbol.for("BufferList");function o(e){if(!(this instanceof o))return new o(e);o._init.call(this,e)}o._init=function(e){Object.defineProperty(this,i,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},o.prototype._new=function(e){return new o(e)},o.prototype._offset=function(e){if(0===e)return[0,0];for(var t=0,r=0;rthis.length||e<0)){var t=this._offset(e);return this._bufs[t[0]][t[1]]}},o.prototype.slice=function(e,t){return"number"===typeof e&&e<0&&(e+=this.length),"number"===typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},o.prototype.copy=function(e,t,r,i){if(("number"!==typeof r||r<0)&&(r=0),("number"!==typeof i||i>this.length)&&(i=this.length),r>=this.length)return e||n.alloc(0);if(i<=0)return e||n.alloc(0);var o=!!e,a=this._offset(r),s=i-r,u=s,c=o&&t||0,f=a[1];if(0===r&&i===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:n.concat(this._bufs,this.length);for(var l=0;ld)){this._bufs[h].copy(e,c,f,f+u),c+=d;break}this._bufs[h].copy(e,c,f),c+=d,u-=d,f&&(f=0)}return e.length>c?e.slice(0,c):e},o.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!==typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();var r=this._offset(e),n=this._offset(t),i=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!==r[1]&&(i[0]=i[0].slice(r[1])),this._new(i)},o.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)},o.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},o.prototype.duplicate=function(){for(var e=this._new(),t=0;tthis.length?this.length:t;for(var i=this._offset(t),o=i[0],a=i[1];o=e.length){var u=s.indexOf(e,a);if(-1!==u)return this._reverseOffset([o,u]);a=s.length-e.length+1}else{var c=this._reverseOffset([o,a]);if(this._match(c,e))return c;a++}}a=0}return-1},o.prototype._match=function(e,t){if(this.length-e0&&void 0!==arguments[0]?arguments[0]:0;return this.slice(r,r+e[t])[t](0)}}(t)}(),o.prototype._isBufferList=function(e){return e instanceof o||o.isBufferList(e)},o.isBufferList=function(e){return null!=e&&e[i]},e.exports=o},function(e,t,r){"use strict";function n(e,t){"function"===typeof e?e(t):e&&(e.current=t)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),i=r(126);function o(){return n.useContext(i.a)}},function(e,t,r){"use strict";(function(e){var n=t;function i(e,t,r){for(var n=Object.keys(t),i=0;i0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(t){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"===typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"===typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!==typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"utf8",r=n[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.encoder.encode(e).substring(1)}},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t,r){"use strict";var n=r(86),i=r(29),o=r(8),a=r(9);Object.defineProperty(t,"__esModule",{value:!0});var s=r(630),u=r(99),c=function(){function e(t,r,n){o(this,e),this.name=t,this.prefix=r,this.baseEncode=n}return a(e,[{key:"encode",value:function(e){if(e instanceof Uint8Array)return"".concat(this.prefix).concat(this.baseEncode(e));throw Error("Unknown type, must be binary type")}}]),e}(),f=function(){function e(t,r,n){o(this,e),this.name=t,this.prefix=r,this.baseDecode=n}return a(e,[{key:"decode",value:function(e){if("string"!==typeof e)throw Error("Can only multibase decode strings");switch(e[0]){case this.prefix:return this.baseDecode(e.slice(1));default:throw Error("Unable to decode multibase string ".concat(JSON.stringify(e),", ").concat(this.name," decoder only supports inputs prefixed with ").concat(this.prefix))}}},{key:"or",value:function(e){var t=i(n({},this.prefix,this),e.decoders||n({},e.prefix,e));return new l(t)}}]),e}(),l=function(){function e(t){o(this,e),this.decoders=t}return a(e,[{key:"or",value:function(t){var r=t.decoders||n({},t.prefix,t);return new e(i(i({},this.decoders),r))}},{key:"decode",value:function(e){var t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError("Unable to decode multibase string ".concat(JSON.stringify(e),", only inputs prefixed with ").concat(Object.keys(this.decoders)," are supported"))}}]),e}(),h=function(){function e(t,r,n,i){o(this,e),this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new c(t,r,n),this.decoder=new f(t,r,i)}return a(e,[{key:"encode",value:function(e){return this.encoder.encode(e)}},{key:"decode",value:function(e){return this.decoder.decode(e)}}]),e}(),d=function(e){var t=e.name,r=e.prefix,n=e.encode,i=e.decode;return new h(t,r,n,i)};t.Codec=h,t.baseX=function(e){var t=e.prefix,r=e.name,n=e.alphabet,i=s(n,r),o=i.encode,a=i.decode;return d({prefix:t,name:r,encode:o,decode:function(e){return u.coerce(a(e))}})},t.from=d,t.rfc4648=function(e){var t=e.name,r=e.prefix,n=e.bitsPerChar,i=e.alphabet;return d({prefix:r,name:t,encode:function(e){return function(e,t,r){for(var n="="===t[t.length-1],i=(1<r;)o+=t[i&s>>(a-=r)];if(a&&(o+=t[i&s<=8&&(u-=8,s[f++]=255&c>>u)}if(u>=r||255&c<<8-u)throw new SyntaxError("Unexpected end of data");return s}(e,i,n,t)}})}},function(e,t,r){"use strict";var n=r(8),i=r(40);Object.defineProperty(t,"__esModule",{value:!0});var o=r(99),a=r(193),s=function e(t,r,i,o){n(this,e),this.code=t,this.size=r,this.digest=i,this.bytes=o};t.Digest=s,t.create=function(e,t){var r=t.byteLength,n=a.encodingLength(e),i=n+a.encodingLength(r),o=new Uint8Array(i+r);return a.encodeTo(e,o,0),a.encodeTo(r,o,n),o.set(t,i),new s(e,r,t,o)},t.decode=function(e){var t=o.coerce(e),r=a.decode(t),n=i(r,2),u=n[0],c=n[1],f=a.decode(t.subarray(c)),l=i(f,2),h=l[0],d=l[1],p=t.subarray(c+d);if(p.byteLength!==h)throw new Error("Incorrect length");return new s(u,h,p,t)},t.equals=function(e,t){return e===t||e.code===t.code&&e.size===t.size&&o.equals(e.bytes,t.bytes)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(192),i=r(99),o=n.from({name:"identity",code:0,encode:function(e){return i.coerce(e)}});t.identity=o},function(e,t,r){"use strict";var n=r(40),i=r(8),o=r(9);Object.defineProperty(t,"__esModule",{value:!0});var a=r(193),s=r(88),u=r(58),c=r(67),f=r(99),l=function(){function e(t,r,n,o){i(this,e),this.code=r,this.version=t,this.multihash=n,this.bytes=o,this.byteOffset=o.byteOffset,this.byteLength=o.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:w,byteLength:w,code:m,version:m,multihash:m,bytes:m,_baseCache:w,asCID:w})}return o(e,[{key:"toV0",value:function(){switch(this.version){case 0:return this;default:var t=this.code,r=this.multihash;if(t!==v)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==y)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return e.createV0(r)}}},{key:"toV1",value:function(){switch(this.version){case 0:var t=this.multihash,r=t.code,n=t.digest,i=s.create(r,n);return e.createV1(this.code,i);case 1:return this;default:throw Error("Can not convert CID version ".concat(this.version," to version 0. This is a bug please report"))}}},{key:"equals",value:function(e){return e&&this.code===e.code&&this.version===e.version&&s.equals(this.multihash,e.multihash)}},{key:"toString",value:function(e){var t=this.bytes,r=this.version,n=this._baseCache;switch(r){case 0:return d(t,n,e||u.base58btc.encoder);default:return p(t,n,e||c.base32.encoder)}}},{key:"toJSON",value:function(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}},{key:Symbol.toStringTag,get:function(){return"CID"}},{key:Symbol.for("nodejs.util.inspect.custom"),value:function(){return"CID("+this.toString()+")"}},{key:"toBaseEncodedString",get:function(){throw new Error("Deprecated, use .toString()")}},{key:"codec",get:function(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}},{key:"buffer",get:function(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}},{key:"multibaseName",get:function(){throw new Error('"multibaseName" property is deprecated')}},{key:"prefix",get:function(){throw new Error('"prefix" property is deprecated')}}],[{key:"isCID",value:function(e){return k(/^0\.0/,S),!(!e||!e[g]&&e.asCID!==e)}},{key:"asCID",value:function(t){if(t instanceof e)return t;if(null!=t&&t.asCID===t){var r=t.version,n=t.code,i=t.multihash;return new e(r,n,i,t.bytes||b(r,n,i.bytes))}if(null!=t&&!0===t[g]){var o=t.version,a=t.multihash,u=t.code,c=s.decode(a);return e.create(o,u,c)}return null}},{key:"create",value:function(t,r,n){if("number"!==typeof r)throw new Error("String codecs are no longer supported");switch(t){case 0:if(r!==v)throw new Error("Version 0 CID must use dag-pb (code: ".concat(v,") block encoding"));return new e(t,r,n,n.bytes);case 1:return new e(t,r,n,b(t,r,n.bytes));default:throw new Error("Invalid version")}}},{key:"createV0",value:function(t){return e.create(0,v,t)}},{key:"createV1",value:function(t,r){return e.create(1,t,r)}},{key:"decode",value:function(t){var r=e.decodeFirst(t),i=n(r,2),o=i[0];if(i[1].length)throw new Error("Incorrect length");return o}},{key:"decodeFirst",value:function(t){var r=e.inspectBytes(t),n=r.size-r.multihashSize,i=f.coerce(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");var o=i.subarray(r.multihashSize-r.digestSize),a=new s.Digest(r.multihashCode,r.digestSize,o,i);return[0===r.version?e.createV0(a):e.createV1(r.codec,a),t.subarray(r.size)]}},{key:"inspectBytes",value:function(e){var t=0,r=function(){var r=a.decode(e.subarray(t)),i=n(r,2),o=i[0],s=i[1];return t+=s,o},i=r(),o=v;if(18===i?(i=0,t=0):1===i&&(o=r()),0!==i&&1!==i)throw new RangeError("Invalid CID version ".concat(i));var s=t,u=r(),c=r(),f=t+c;return{version:i,codec:o,multihashCode:u,digestSize:c,multihashSize:f-s,size:f}}},{key:"parse",value:function(t,r){var i=h(t,r),o=n(i,2),a=o[0],s=o[1],u=e.decode(s);return u._baseCache.set(a,t),u}}]),e}(),h=function(e,t){switch(e[0]){case"Q":var r=t||u.base58btc;return[u.base58btc.prefix,r.decode("".concat(u.base58btc.prefix).concat(e))];case u.base58btc.prefix:var n=t||u.base58btc;return[u.base58btc.prefix,n.decode(e)];case c.base32.prefix:var i=t||c.base32;return[c.base32.prefix,i.decode(e)];default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},d=function(e,t,r){var n=r.prefix;if(n!==u.base58btc.prefix)throw Error("Cannot string encode V0 in ".concat(r.name," encoding"));var i=t.get(n);if(null==i){var o=r.encode(e).slice(1);return t.set(n,o),o}return i},p=function(e,t,r){var n=r.prefix,i=t.get(n);if(null==i){var o=r.encode(e);return t.set(n,o),o}return i},v=112,y=18,b=function(e,t,r){var n=a.encodingLength(e),i=n+a.encodingLength(t),o=new Uint8Array(i+r.byteLength);return a.encodeTo(e,o,0),a.encodeTo(t,o,n),o.set(r,i),o},g=Symbol.for("@ipld/js-cid/CID"),m={writable:!1,configurable:!1,enumerable:!0},w={writable:!1,enumerable:!1,configurable:!1},k=function(e,t){if(!e.test("0.0.0-dev"))throw new Error(t);console.warn(t)},S="CID.isCID(v) is deprecated and will be removed in the next major release.\nFollowing code pattern:\n\nif (CID.isCID(value)) {\n doSomethingWithCID(value)\n}\n\nIs replaced with:\n\nconst cid = CID.asCID(value)\nif (cid) {\n // Make sure to use cid instead of value\n doSomethingWithCID(cid)\n}\n";t.CID=l},function(e,t,r){e.exports={encode:r(664),decode:r(665),encodingLength:r(666)}},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(714).Buffer}catch(A){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=u(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],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];function d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],d=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?v+r:f[c-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n("undefined"!==typeof a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,v=d>>>13,y=0|a[2],b=8191&y,g=y>>>13,m=0|a[3],w=8191&m,k=m>>>13,S=0|a[4],E=8191&S,_=S>>>13,A=0|a[5],x=8191&A,T=A>>>13,M=0|a[6],C=8191&M,O=M>>>13,I=0|a[7],P=8191&I,R=I>>>13,B=0|a[8],D=8191&B,N=B>>>13,L=0|a[9],j=8191&L,U=L>>>13,F=0|s[0],K=8191&F,z=F>>>13,V=0|s[1],H=8191&V,J=V>>>13,q=0|s[2],G=8191&q,X=q>>>13,W=0|s[3],Z=8191&W,Y=W>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],le=8191&fe,he=fe>>>13,de=0|s[9],pe=8191&de,ve=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(c+(n=Math.imul(l,K))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,K)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,z))+Math.imul(v,K)|0,o=Math.imul(v,z);var be=(c+(n=n+Math.imul(l,H)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(h,H)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,K),i=(i=Math.imul(b,z))+Math.imul(g,K)|0,o=Math.imul(g,z),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,J)|0;var ge=(c+(n=n+Math.imul(l,G)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,K),i=(i=Math.imul(w,z))+Math.imul(k,K)|0,o=Math.imul(k,z),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,J)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,X)|0;var me=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(E,K),i=(i=Math.imul(E,z))+Math.imul(_,K)|0,o=Math.imul(_,z),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0;var we=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,K),i=(i=Math.imul(x,z))+Math.imul(T,K)|0,o=Math.imul(T,z),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,Y)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var ke=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(C,K),i=(i=Math.imul(C,z))+Math.imul(O,K)|0,o=Math.imul(O,z),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,J)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var Se=(c+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(P,K),i=(i=Math.imul(P,z))+Math.imul(R,K)|0,o=Math.imul(R,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var Ee=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,z))+Math.imul(N,K)|0,o=Math.imul(N,z),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var _e=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,he)|0)+Math.imul(h,le)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(j,K),i=(i=Math.imul(j,z))+Math.imul(U,K)|0,o=Math.imul(U,z),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(v,le)|0,o=o+Math.imul(v,he)|0;var Ae=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ve)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,ve)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(j,H),i=(i=Math.imul(j,J))+Math.imul(U,H)|0,o=Math.imul(U,J),n=n+Math.imul(D,G)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,Y)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(b,le)|0,i=(i=i+Math.imul(b,he)|0)+Math.imul(g,le)|0,o=o+Math.imul(g,he)|0;var xe=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(j,G),i=(i=Math.imul(j,X))+Math.imul(U,G)|0,o=Math.imul(U,X),n=n+Math.imul(D,Z)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,he)|0;var Te=(c+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ve)|0)+Math.imul(g,pe)|0))<<13)|0;c=((o=o+Math.imul(g,ve)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(j,Z),i=(i=Math.imul(j,Y))+Math.imul(U,Z)|0,o=Math.imul(U,Y),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,n=n+Math.imul(E,le)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,he)|0;var Me=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(j,$),i=(i=Math.imul(j,ee))+Math.imul(U,$)|0,o=Math.imul(U,ee),n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(x,le)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(T,le)|0,o=o+Math.imul(T,he)|0;var Ce=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ve)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(j,re),i=(i=Math.imul(j,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,n=n+Math.imul(C,le)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(O,le)|0,o=o+Math.imul(O,he)|0;var Oe=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ve)|0)+Math.imul(T,pe)|0))<<13)|0;c=((o=o+Math.imul(T,ve)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(j,oe),i=(i=Math.imul(j,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,n=n+Math.imul(P,le)|0,i=(i=i+Math.imul(P,he)|0)+Math.imul(R,le)|0,o=o+Math.imul(R,he)|0;var Ie=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ve)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ve)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(j,ue),i=(i=Math.imul(j,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,he)|0)+Math.imul(N,le)|0,o=o+Math.imul(N,he)|0;var Pe=(c+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ve)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(j,le),i=(i=Math.imul(j,he))+Math.imul(U,le)|0,o=Math.imul(U,he);var Re=(c+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ve)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Be=(c+(n=Math.imul(j,pe))|0)+((8191&(i=(i=Math.imul(j,ve))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ve))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=ye,u[1]=be,u[2]=ge,u[3]=me,u[4]=we,u[5]=ke,u[6]=Se,u[7]=Ee,u[8]=_e,u[9]=Ae,u[10]=xe,u[11]=Te,u[12]=Me,u[13]=Ce,u[14]=Oe,u[15]=Ie,u[16]=Pe,u[17]=Re,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function v(e,t,r){return(new y).mulp(e,t,r)}function y(e,t){this.x=e,this.y=t}Math.imul||(p=d),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):v(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},y.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=t.clone();!t.isZero();){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,v=1;0===(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0===(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function _(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(m,g),m.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},m.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new w;else if("p192"===e)t=new k;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return b[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var v=d,y=0;0!==v.cmp(s);y++)v=v.redSqr();n(y=0;n--){for(var c=t.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new _(e)},i(_,E),_.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},_.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},_.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},_.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(156)(e))},function(e,t,r){var n=r(84),i=r(241),o=r(736),a=r(419);function s(t){var r="function"===typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!o(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return a(e,arguments,n(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},s(t)}e.exports=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"utf8",r=n[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.decoder.decode("".concat(r.prefix).concat(e))}},function(e,t,r){var n=r(28).Buffer,i=r(242).Transform,o=r(155).StringDecoder;function a(e){i.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}r(23)(a,i),a.prototype.update=function(e,t,r){"string"===typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},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,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(i){n=i}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},function(e,t,r){"use strict";var n=r(29);Object.defineProperty(t,"__esModule",{value:!0});var i=r(629),o=r(631),a=r(632),s=r(633),u=r(161),c=r(67),f=r(162),l=r(58),h=r(63),d=r(49),p=r(89),v=r(635),y=r(636);r(637);var b=r(90),g=r(192),m=r(88),w=r(193),k=r(99),S=n(n(n(n(n(n(n(n(n({},i),o),a),s),u),c),f),l),h),E=n(n({},d),p),_={raw:v,json:y};t.CID=b.CID,t.hasher=g,t.digest=m,t.varint=w,t.bytes=k,t.bases=S,t.codecs=_,t.hashes=E},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=new Uint8Array(0);t.coerce=function(e){if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},t.empty=n,t.equals=function(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(var r=0;r=0||(i[r]=e[r]);return i}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(1);function i(e,t){return n.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(183);var i=r(506),o=r(228);function a(e){return function(e){if(Array.isArray(e))return Object(n.a)(e)}(e)||Object(i.a)(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,r){"use strict";var n=r(1),i=n.createContext({});t.a=i},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(182);var i=r(142);function o(e){return function(e){if(Array.isArray(e))return Object(n.a)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Object(i.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,r){"use strict";var n=r(189),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=Object.create(r(154));o.inherits=r(23);var a=r(343),s=r(245);o.inherits(l,a);for(var u=i(s.prototype),c=0;co)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0)if(e>i)for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:"utf8",r=n[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.encoder.encode(e).substring(1)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(425);t.fromString=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8",r=n[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.decoder.decode("".concat(r.prefix).concat(e))}},function(e,t,r){"use strict";(function(e){var n=t;function i(e,t,r){for(var n=Object.keys(t),i=0;i0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(t){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"===typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"===typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!==typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r>14;--o>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,f=s*u+c*a;i=((u=a*u+((16383&f)<<14)+r.data[n]+i)>>28)+(f>>14)+s*c,r.data[n++]=268435455&u}return i}i.jsbn.BigInteger=o,"undefined"===typeof navigator?(o.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=function(e,t,r,n,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,f=s*u+c*a;i=((u=a*u+((32767&f)<<15)+r.data[n]+(1073741823&i))>>>30)+(f>>>15)+s*c+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(o.prototype.am=function(e,t,r,n,i,o){for(;--o>=0;){var a=t*this.data[e++]+r.data[n]+i;i=Math.floor(a/67108864),r.data[n++]=67108863&a}return i},n=26):(o.prototype.am=s,n=28),o.prototype.DB=n,o.prototype.DM=(1<>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function v(e){this.m=e}function y(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function S(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function E(){}function _(e){return e}function A(e){this.r2=a(),this.q3=a(),o.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.convert=function(e){var t=a();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(o.ZERO)>0&&this.m.subTo(t,t),t},y.prototype.revert=function(e){var t=a();return e.copyTo(t),this.reduce(t),t},y.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},o.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},o.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},o.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,a=0;--n>=0;){var s=8==r?255&e[n]:h(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==a?this.data[this.t++]=s:a+r>this.DB?(this.data[this.t-1]|=(s&(1<>this.DB-a):this.data[this.t-1]|=s<=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==e;)--this.t},o.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},o.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t.data[r+a+1]=this.data[r]>>i|s,s=(this.data[r]&o)<=0;--r)t.data[r]=0;t.data[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},o.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,o=(1<>n;for(var a=r+1;a>n;n>0&&(t.data[this.t-r-1]|=(this.s&o)<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},o.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i=0;)e.data[r]=0;for(r=0;r=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},o.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(f,s),i.lShiftTo(f,r)):(n.copyTo(s),i.copyTo(r));var l=s.t,h=s.data[l-1];if(0!=h){var d=h*(1<1?s.data[l-2]>>this.F2:0),v=this.FV/d,y=(1<=0&&(r.data[r.t++]=1,r.subTo(w,r)),o.ONE.dlShiftTo(l,w),w.subTo(s,s);s.t=0;){var k=r.data[--g]==h?this.DM:Math.floor(r.data[g]*v+(r.data[g-1]+b)*y);if((r.data[g]+=s.am(0,k,r,m,0,l))0&&r.rShiftTo(f,r),u<0&&o.ZERO.subTo(r,r)}}},o.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},o.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},o.prototype.exp=function(e,t){if(e>4294967295||e<1)return o.ONE;var r=a(),n=a(),i=t.convert(this),s=p(e)-1;for(i.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<0)t.mulTo(n,i,r);else{var u=r;r=n,n=u}return t.revert(r)},o.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<0)for(s>s)>0&&(i=!0,o=l(r));a>=0;)s>(s+=this.DB-t)):(r=this.data[a]>>(s-=t)&n,s<=0&&(s+=this.DB,--a)),r>0&&(i=!0),i&&(o+=l(r));return i?o:"0"},o.prototype.negate=function(){var e=a();return o.ZERO.subTo(this,e),e},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},o.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+p(this.data[this.t-1]^this.s&this.DM)},o.prototype.mod=function(e){var t=a();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(o.ZERO)>0&&e.subTo(t,t),t},o.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new v(t):new y(t),this.exp(e,r)},o.ZERO=d(0),o.ONE=d(1),E.prototype.convert=_,E.prototype.revert=_,E.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},E.prototype.sqrTo=function(e,t){e.squareTo(t)},A.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=a();return e.copyTo(t),this.reduce(t),t},A.prototype.revert=function(e){return e},A.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},A.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},A.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],T=(1<<26)/x[x.length-1];o.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},o.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=d(r),i=a(),o=a(),s="";for(this.divRemTo(n,i,o);i.signum()>0;)s=(r+o.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,o);return o.intValue().toString(e)+s},o.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,a=0,s=0,u=0;u=r&&(this.dMultiply(n),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(s,0)),i&&o.ZERO.subTo(this,this)},o.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(o.ONE.shiftLeft(e-1),g,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(o.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},o.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},o.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},o.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},o.prototype.millerRabin=function(e){var t=this.subtract(o.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),a={nextBytes:function(e){for(var t=0;t=0);var u=n.modPow(i,this);if(0!=u.compareTo(o.ONE)&&0!=u.compareTo(t)){for(var c=1;c++>24},o.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},o.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},o.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<=0;)n<8?(r=(this.data[e]&(1<>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},o.prototype.equals=function(e){return 0==this.compareTo(e)},o.prototype.min=function(e){return this.compareTo(e)<0?this:e},o.prototype.max=function(e){return this.compareTo(e)>0?this:e},o.prototype.and=function(e){var t=a();return this.bitwiseTo(e,b,t),t},o.prototype.or=function(e){var t=a();return this.bitwiseTo(e,g,t),t},o.prototype.xor=function(e){var t=a();return this.bitwiseTo(e,m,t),t},o.prototype.andNot=function(e){var t=a();return this.bitwiseTo(e,w,t),t},o.prototype.not=function(){for(var e=a(),t=0;t=this.t?0!=this.s:0!=(this.data[t]&1<1){var l=a();for(n.sqrTo(s[1],l);u<=f;)s[u]=a(),n.mulTo(l,s[u-2],s[u]),u+=2}var h,b,g=e.t-1,m=!0,w=a();for(i=p(e.data[g])-1;g>=0;){for(i>=c?h=e.data[g]>>i-c&f:(h=(e.data[g]&(1<0&&(h|=e.data[g-1]>>this.DB+i-c)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--g),m)s[h].copyTo(o),m=!1;else{for(;u>1;)n.sqrTo(o,w),n.sqrTo(w,o),u-=2;u>0?n.sqrTo(o,w):(b=o,o=w,w=b),n.mulTo(w,s[h],o)}for(;g>=0&&0==(e.data[g]&1<=0?(r.subTo(n,r),t&&i.subTo(s,i),a.subTo(u,a)):(n.subTo(r,n),t&&s.subTo(i,s),u.subTo(a,u))}return 0!=n.compareTo(o.ONE)?o.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},o.prototype.pow=function(e){return this.exp(e,new E)},o.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return t;for(i0&&(t.rShiftTo(o,t),r.rShiftTo(o,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},o.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=x[x.length-1]){for(t=0;t1&&void 0!==arguments[1]?arguments[1]:"utf8",r=n[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.decoder.decode("".concat(r.prefix).concat(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(445);t.toString=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8",r=n[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.encoder.encode(e).substring(1)}},function(e,t,r){var n=r(0),i=r(21),o=r(45),a=r(44),s=r(442),u=r(894),c=function(e,t,r){return f(e,Array.isArray(t)?t:[{signal:t,options:r}])},f=function(e,t){function r(){return(r=a(n.mark((function r(){var a,s,c,f,l,h,d,p,v,y,b,g,m,w,k,S,E,_,A;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:s=function(){a&&a()},c=i(t);try{for(c.s();!(f=c.n()).done;)f.value.signal.addEventListener("abort",s)}catch(n){c.e(n)}finally{c.f()}case 3:0,l=void 0,r.prev=5,h=i(t),r.prev=7,h.s();case 9:if((d=h.n()).done){r.next=16;break}if(p=d.value,v=p.signal,y=p.options,!v.aborted){r.next=14;break}throw b=y.abortMessage,g=y.abortCode,new u(b,g);case 14:r.next=9;break;case 16:r.next=21;break;case 18:r.prev=18,r.t0=r.catch(7),h.e(r.t0);case 21:return r.prev=21,h.f(),r.finish(21);case 24:return m=new Promise((function(e,r){a=function(){var e=t.find((function(e){return e.signal.aborted})).options,n=e.abortMessage,i=e.abortCode;r(new u(n,i))}})),r.next=27,o(Promise.race([m,e.next()]));case 27:l=r.sent,a=null,r.next=46;break;case 31:r.prev=31,r.t1=r.catch(5),w=i(t);try{for(w.s();!(k=w.n()).done;)k.value.signal.removeEventListener("abort",s)}catch(n){w.e(n)}finally{w.f()}if(S=t.find((function(e){return e.signal.aborted})),!(E="aborted"===r.t1.type&&S)||!S.options.onAbort){r.next=40;break}return r.next=40,o(S.options.onAbort(e));case 40:if("function"!==typeof e.return){r.next=43;break}return r.next=43,o(e.return());case 43:if(!E||!S.options.returnOnAbort){r.next=45;break}return r.abrupt("return");case 45:throw r.t1;case 46:if(!l.done){r.next=48;break}return r.abrupt("break",52);case 48:return r.next=50,l.value;case 50:r.next=3;break;case 52:_=i(t);try{for(_.s();!(A=_.n()).done;)A.value.signal.removeEventListener("abort",s)}catch(n){_.e(n)}finally{_.f()}case 54:case"end":return r.stop()}}),r,null,[[5,31],[7,18,21,24]])})))).apply(this,arguments)}return e=s(e),t=t.map((function(e){return{signal:e.signal,options:e.options||{}}})),function(){return r.apply(this,arguments)}()},l=function(e,t,r){return h(e,Array.isArray(t)?t:[{signal:t,options:r}])},h=function(e,t){return function(r){return e(f(r,t))}},d=function(e,t){return{sink:h(e.sink,t),source:f(e.source,t)}};e.exports=c,e.exports.AbortError=u,e.exports.source=c,e.exports.sink=l,e.exports.transform=l,e.exports.duplex=function(e,t,r){return d(e,Array.isArray(t)?t:[{signal:t,options:r}])}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(481);t.fromString=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8",r=n[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.decoder.decode("".concat(r.prefix).concat(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(481);t.toString=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8",r=n[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.encoder.encode(e).substring(1)}},function(e,t,r){"use strict";function n(e){return(n="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)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(){for(var e=arguments.length,t=new Array(e),r=0;r1&&void 0!==arguments[1]&&arguments[1];return e&&(n(e.value)&&""!==e.value||t&&n(e.defaultValue)&&""!==e.defaultValue)}function o(e){return e.startAdornment}r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return o}))},function(e,t,r){"use strict";r.d(t,"b",(function(){return o}));var n=r(1),i=n.createContext();function o(){return n.useContext(i)}t.a=i},,function(e,t,r){"use strict";e.exports=o,o.className="ReflectionObject";var n,i=r(56);function o(e,t){if(!i.isString(e))throw TypeError("name must be a string");if(t&&!i.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(o.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),o.prototype.toJSON=function(){throw Error()},o.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},o.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},o.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},o.prototype.getOption=function(e){if(this.options)return this.options[e]},o.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},o.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var o=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(o){var a=o[e];i.setProperty(a,r,t)}else(o={})[e]=i.setProperty({},r,t),n.push(o)}else{var s={};s[e]=t,n.push(s)}return this},o.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}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,r){var n,i,a,s;if("string"===typeof t&&(i="not ",t.substr(!a||a<0?0:+a,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var u=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(o(t,"type"))}return s+=". Received type ".concat(typeof r)}),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.codes=n},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var i=r(357),o=r(361);r(23)(c,i);for(var a=n(o.prototype),s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,r){"use strict";(function(t){var n=r(365),i=r(612);function o(e){var t=e;if("string"!==typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function a(e){return"0x"+e.toString(16)}e.exports={arrayContainsArray:function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(r)?"some":"every"]((function(t){return e.indexOf(t)>=0}))},intToBuffer:function(e){var r=a(e);return new t(o(r.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:n,stripHexPrefix:i,padToEven:o,intToHex:a,fromAscii:function(e){for(var t="",r=0;r>>0,a>>>0];for(var s=d.fullMessageLength.length-1;s>=0;--s)d.fullMessageLength[s]+=a[1],a[1]=a[0]+(d.fullMessageLength[s]/4294967296>>>0),d.fullMessageLength[s]=d.fullMessageLength[s]>>>0,a[0]=a[1]/4294967296>>>0;return i.putBytes(e),f(r,o,i),(i.read>2048||0===i.length())&&i.compact(),d},d.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var s,u=d.fullMessageLength[d.fullMessageLength.length-1]+d.messageLengthSize&d.blockLength-1;t.putBytes(a.substr(0,d.blockLength-u));for(var c=8*d.fullMessageLength[0],l=0;l>>0,t.putInt32(c>>>0),c=s>>>0;t.putInt32(c);var h=new Array(r.length);for(l=0;l=128;){for(O=0;O<16;++O)t[O][0]=r.getInt32()>>>0,t[O][1]=r.getInt32()>>>0;for(;O<80;++O)n=(((I=(R=t[O-2])[0])>>>19|(P=R[1])<<13)^(P>>>29|I<<3)^I>>>6)>>>0,i=((I<<13|P>>>19)^(P<<3|I>>>29)^(I<<26|P>>>6))>>>0,o=(((I=(D=t[O-15])[0])>>>1|(P=D[1])<<31)^(I>>>8|P<<24)^I>>>7)>>>0,a=((I<<31|P>>>1)^(I<<24|P>>>8)^(I<<25|P>>>7))>>>0,B=t[O-7],N=t[O-16],P=i+B[1]+a+N[1],t[O][0]=n+B[0]+o+N[0]+(P/4294967296>>>0)>>>0,t[O][1]=P>>>0;for(p=e[0][0],v=e[0][1],y=e[1][0],b=e[1][1],g=e[2][0],m=e[2][1],w=e[3][0],k=e[3][1],S=e[4][0],E=e[4][1],_=e[5][0],A=e[5][1],x=e[6][0],T=e[6][1],M=e[7][0],C=e[7][1],O=0;O<80;++O)f=((S>>>14|E<<18)^(S>>>18|E<<14)^(E>>>9|S<<23))>>>0,l=(x^S&(_^x))>>>0,s=((p>>>28|v<<4)^(v>>>2|p<<30)^(v>>>7|p<<25))>>>0,c=((p<<4|v>>>28)^(v<<30|p>>>2)^(v<<25|p>>>7))>>>0,h=(p&y|g&(p^y))>>>0,d=(v&b|m&(v^b))>>>0,P=C+(((S<<18|E>>>14)^(S<<14|E>>>18)^(E<<23|S>>>9))>>>0)+((T^E&(A^T))>>>0)+u[O][1]+t[O][1],n=M+f+l+u[O][0]+t[O][0]+(P/4294967296>>>0)>>>0,i=P>>>0,o=s+h+((P=c+d)/4294967296>>>0)>>>0,a=P>>>0,M=x,C=T,x=_,T=A,_=S,A=E,S=w+n+((P=k+i)/4294967296>>>0)>>>0,E=P>>>0,w=g,k=m,g=y,m=b,y=p,b=v,p=n+o+((P=i+a)/4294967296>>>0)>>>0,v=P>>>0;P=e[0][1]+v,e[0][0]=e[0][0]+p+(P/4294967296>>>0)>>>0,e[0][1]=P>>>0,P=e[1][1]+b,e[1][0]=e[1][0]+y+(P/4294967296>>>0)>>>0,e[1][1]=P>>>0,P=e[2][1]+m,e[2][0]=e[2][0]+g+(P/4294967296>>>0)>>>0,e[2][1]=P>>>0,P=e[3][1]+k,e[3][0]=e[3][0]+w+(P/4294967296>>>0)>>>0,e[3][1]=P>>>0,P=e[4][1]+E,e[4][0]=e[4][0]+S+(P/4294967296>>>0)>>>0,e[4][1]=P>>>0,P=e[5][1]+A,e[5][0]=e[5][0]+_+(P/4294967296>>>0)>>>0,e[5][1]=P>>>0,P=e[6][1]+T,e[6][0]=e[6][0]+x+(P/4294967296>>>0)>>>0,e[6][1]=P>>>0,P=e[7][1]+C,e[7][0]=e[7][0]+M+(P/4294967296>>>0)>>>0,e[7][1]=P>>>0,L-=128}}},function(e,t){e.exports=function(e,t){var r={},n=!1;function i(r,i){return n=!0,i=new Promise((function(t){t(e[r](i))})),{done:!1,value:t(i)}}return"function"===typeof Symbol&&Symbol.iterator&&(r[Symbol.iterator]=function(){return this}),r.next=function(e){return n?(n=!1,e):i("next",e)},"function"===typeof e.throw&&(r.throw=function(e){if(n)throw n=!1,e;return i("throw",e)}),"function"===typeof e.return&&(r.return=function(e){return n?(n=!1,e):i("return",e)}),r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.equals=function(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:166;function n(){for(var n=arguments.length,i=new Array(n),o=0;ot)return!0;return!1},l.isReservedName=function(e,t){if(e)for(var r=0;r0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof l))throw Error("path conflicts with non-namespace objects")}else r.add(r=new l(n))}return t&&r.addJSON(t),r},l.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t-1)return n}else if(n instanceof l&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var i=0;i>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){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!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(e.lastNeed=i-1),i;if(--n=0)return i>0&&(e.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.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){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";var n=r(75),i=r(66);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o=0;c--)if(f[c]!==l[c])return!1;for(c=f.length-1;c>=0;c--)if(!m(e[s=f[c]],t[s],r,n))return!1;return!0}(e,t,r,n))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function k(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(r){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function S(e,t,r,n){var i;if("function"!==typeof t)throw new TypeError('"block" argument must be a function');"string"===typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(r){t=r}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&b(i,r,"Missing expected exception"+n);var o="string"===typeof n,s=!e&&i&&!r;if((!e&&a.isError(i)&&o&&k(i,r)||s)&&b(i,r,"Got unwanted exception"+n),e&&i&&r&&!k(i,r)||!e&&i)throw i}h.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 v(y(e.actual),128)+" "+e.operator+" "+v(y(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||b;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=p(t),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},a.inherits(h.AssertionError,Error),h.fail=b,h.ok=g,h.equal=function(e,t,r){e!=t&&b(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&b(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){m(e,t,!1)||b(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){m(e,t,!0)||b(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){m(e,t,!1)&&b(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,n){m(t,r,!0)&&b(t,r,n,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&b(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&b(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){S(!0,e,t,r)},h.doesNotThrow=function(e,t,r){S(!1,e,t,r)},h.ifError=function(e){if(e)throw e},h.strict=n((function e(t,r){t||b(t,!0,r,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var E=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(36))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.baToJSON=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.stripZeros=t.unpad=t.setLengthRight=t.setLength=t.setLengthLeft=t.zeros=void 0;var n=r(134),i=r(14);t.zeros=function(t){return e.allocUnsafe(t).fill(0)},t.setLengthLeft=function(e,r,n){void 0===n&&(n=!1);var i=t.zeros(r);return e=t.toBuffer(e),n?e.length0&&"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(!n.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(n.padToEven(n.stripHexPrefix(t)),"hex")}else if("number"===typeof t)t=n.intToBuffer(t);else if(null===t||void 0===t)t=e.allocUnsafe(0);else if(i.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 i(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new i(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!==typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],i=0;i=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o>>=2;for(i=0;i>8^255&l^99,o[v]=l,a[l]=v,d=(h=e[l])<<24^l<<16^l<<8^l^h,p=((r=e[v])^(n=e[r])^(i=e[n]))<<24^(v^i)<<16^(v^n^i)<<8^v^r^i;for(var b=0;b<4;++b)u[b][v]=d,c[b][l]=p,d=d<<24|d>>>8,p=p<<24|p>>>8;0===v?v=y=1:(v=r^e[e[e[r^i]]],y^=e[e[y]])}}function h(e,t){for(var r,n=e.slice(0),i=1,a=n.length,u=4*(a+6+1),f=a;f>>16&255]<<24^o[r>>>8&255]<<16^o[255&r]<<8^o[r>>>24]^s[i]<<24,i++):a>6&&f%a===4&&(r=o[r>>>24]<<24^o[r>>>16&255]<<16^o[r>>>8&255]<<8^o[255&r]),n[f]=n[f-a]^r;if(t){for(var l,h=c[0],d=c[1],p=c[2],v=c[3],y=n.slice(0),b=(f=0,(u=n.length)-4);f>>24]]^d[o[l>>>16&255]]^p[o[l>>>8&255]]^v[o[255&l]];n=y}return n}function d(e,t,r,n){var i,s,f,l,h,d,p,v,y,b,g,m,w=e.length/4-1;n?(i=c[0],s=c[1],f=c[2],l=c[3],h=a):(i=u[0],s=u[1],f=u[2],l=u[3],h=o),d=t[0]^e[0],p=t[n?3:1]^e[1],v=t[2]^e[2],y=t[n?1:3]^e[3];for(var k=3,S=1;S>>24]^s[p>>>16&255]^f[v>>>8&255]^l[255&y]^e[++k],g=i[p>>>24]^s[v>>>16&255]^f[y>>>8&255]^l[255&d]^e[++k],m=i[v>>>24]^s[y>>>16&255]^f[d>>>8&255]^l[255&p]^e[++k],y=i[y>>>24]^s[d>>>16&255]^f[p>>>8&255]^l[255&v]^e[++k],d=b,p=g,v=m;r[0]=h[d>>>24]<<24^h[p>>>16&255]<<16^h[v>>>8&255]<<8^h[255&y]^e[++k],r[n?3:1]=h[p>>>24]<<24^h[v>>>16&255]<<16^h[y>>>8&255]<<8^h[255&d]^e[++k],r[2]=h[v>>>24]<<24^h[y>>>16&255]<<16^h[d>>>8&255]<<8^h[255&p]^e[++k],r[n?1:3]=h[y>>>24]<<24^h[d>>>16&255]<<16^h[p>>>8&255]<<8^h[255&v]^e[++k]}function p(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=e,i.call(t,r)},t}},function(e,t,r){var n=r(18);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function o(e,t){i[e]=t,i[t]=e}function a(e,t){i[e]=t}o("1.2.840.113549.1.1.1","rsaEncryption"),o("1.2.840.113549.1.1.4","md5WithRSAEncryption"),o("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),o("1.2.840.113549.1.1.7","RSAES-OAEP"),o("1.2.840.113549.1.1.8","mgf1"),o("1.2.840.113549.1.1.9","pSpecified"),o("1.2.840.113549.1.1.10","RSASSA-PSS"),o("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),o("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),o("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),o("1.3.101.112","EdDSA25519"),o("1.2.840.10040.4.3","dsa-with-sha1"),o("1.3.14.3.2.7","desCBC"),o("1.3.14.3.2.26","sha1"),o("2.16.840.1.101.3.4.2.1","sha256"),o("2.16.840.1.101.3.4.2.2","sha384"),o("2.16.840.1.101.3.4.2.3","sha512"),o("1.2.840.113549.2.5","md5"),o("1.2.840.113549.1.7.1","data"),o("1.2.840.113549.1.7.2","signedData"),o("1.2.840.113549.1.7.3","envelopedData"),o("1.2.840.113549.1.7.4","signedAndEnvelopedData"),o("1.2.840.113549.1.7.5","digestedData"),o("1.2.840.113549.1.7.6","encryptedData"),o("1.2.840.113549.1.9.1","emailAddress"),o("1.2.840.113549.1.9.2","unstructuredName"),o("1.2.840.113549.1.9.3","contentType"),o("1.2.840.113549.1.9.4","messageDigest"),o("1.2.840.113549.1.9.5","signingTime"),o("1.2.840.113549.1.9.6","counterSignature"),o("1.2.840.113549.1.9.7","challengePassword"),o("1.2.840.113549.1.9.8","unstructuredAddress"),o("1.2.840.113549.1.9.14","extensionRequest"),o("1.2.840.113549.1.9.20","friendlyName"),o("1.2.840.113549.1.9.21","localKeyId"),o("1.2.840.113549.1.9.22.1","x509Certificate"),o("1.2.840.113549.1.12.10.1.1","keyBag"),o("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),o("1.2.840.113549.1.12.10.1.3","certBag"),o("1.2.840.113549.1.12.10.1.4","crlBag"),o("1.2.840.113549.1.12.10.1.5","secretBag"),o("1.2.840.113549.1.12.10.1.6","safeContentsBag"),o("1.2.840.113549.1.5.13","pkcs5PBES2"),o("1.2.840.113549.1.5.12","pkcs5PBKDF2"),o("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),o("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),o("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),o("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),o("1.2.840.113549.2.7","hmacWithSHA1"),o("1.2.840.113549.2.8","hmacWithSHA224"),o("1.2.840.113549.2.9","hmacWithSHA256"),o("1.2.840.113549.2.10","hmacWithSHA384"),o("1.2.840.113549.2.11","hmacWithSHA512"),o("1.2.840.113549.3.7","des-EDE3-CBC"),o("2.16.840.1.101.3.4.1.2","aes128-CBC"),o("2.16.840.1.101.3.4.1.22","aes192-CBC"),o("2.16.840.1.101.3.4.1.42","aes256-CBC"),o("2.5.4.3","commonName"),o("2.5.4.5","serialName"),o("2.5.4.6","countryName"),o("2.5.4.7","localityName"),o("2.5.4.8","stateOrProvinceName"),o("2.5.4.9","streetAddress"),o("2.5.4.10","organizationName"),o("2.5.4.11","organizationalUnitName"),o("2.5.4.13","description"),o("2.5.4.15","businessCategory"),o("2.5.4.17","postalCode"),o("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),o("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),o("2.16.840.1.113730.1.1","nsCertType"),o("2.16.840.1.113730.1.13","nsComment"),a("2.5.29.1","authorityKeyIdentifier"),a("2.5.29.2","keyAttributes"),a("2.5.29.3","certificatePolicies"),a("2.5.29.4","keyUsageRestriction"),a("2.5.29.5","policyMapping"),a("2.5.29.6","subtreesConstraint"),a("2.5.29.7","subjectAltName"),a("2.5.29.8","issuerAltName"),a("2.5.29.9","subjectDirectoryAttributes"),a("2.5.29.10","basicConstraints"),a("2.5.29.11","nameConstraints"),a("2.5.29.12","policyConstraints"),a("2.5.29.13","basicConstraints"),o("2.5.29.14","subjectKeyIdentifier"),o("2.5.29.15","keyUsage"),a("2.5.29.16","privateKeyUsagePeriod"),o("2.5.29.17","subjectAltName"),o("2.5.29.18","issuerAltName"),o("2.5.29.19","basicConstraints"),a("2.5.29.20","cRLNumber"),a("2.5.29.21","cRLReason"),a("2.5.29.22","expirationDate"),a("2.5.29.23","instructionCode"),a("2.5.29.24","invalidityDate"),a("2.5.29.25","cRLDistributionPoints"),a("2.5.29.26","issuingDistributionPoint"),a("2.5.29.27","deltaCRLIndicator"),a("2.5.29.28","issuingDistributionPoint"),a("2.5.29.29","certificateIssuer"),a("2.5.29.30","nameConstraints"),o("2.5.29.31","cRLDistributionPoints"),o("2.5.29.32","certificatePolicies"),a("2.5.29.33","policyMappings"),a("2.5.29.34","policyConstraints"),o("2.5.29.35","authorityKeyIdentifier"),a("2.5.29.36","policyConstraints"),o("2.5.29.37","extKeyUsage"),a("2.5.29.46","freshestCRL"),a("2.5.29.54","inhibitAnyPolicy"),o("1.3.6.1.4.1.11129.2.4.2","timestampList"),o("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),o("1.3.6.1.5.5.7.3.1","serverAuth"),o("1.3.6.1.5.5.7.3.2","clientAuth"),o("1.3.6.1.5.5.7.3.3","codeSigning"),o("1.3.6.1.5.5.7.3.4","emailProtection"),o("1.3.6.1.5.5.7.3.8","timeStamping")},function(e,t,r){var n=r(18);if(r(167),r(62),r(270),r(112),r(168),r(428),r(272),r(113),r(765),r(78),r(34),"undefined"===typeof i)var i=n.jsbn.BigInteger;var o=n.asn1,a=n.pki=n.pki||{};e.exports=a.pbe=n.pbe=n.pbe||{};var s=a.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},c={name:"PBES2Algorithms",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},f={name:"pkcs-12PbeParams",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"iterations"}]};function l(e,t){return e.start().update(t).digest().getBytes()}function h(e){var t;if(e){if(!(t=a.oids[o.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return d(t)}function d(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}a.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,u,c,f=n.random.getBytesSync(r.saltSize),l=r.count,h=o.integerToDer(l);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var p,v,y;switch(r.algorithm){case"aes128":i=16,p=16,v=s["aes128-CBC"],y=n.aes.createEncryptionCipher;break;case"aes192":i=24,p=16,v=s["aes192-CBC"],y=n.aes.createEncryptionCipher;break;case"aes256":i=32,p=16,v=s["aes256-CBC"],y=n.aes.createEncryptionCipher;break;case"des":i=8,p=8,v=s.desCBC,y=n.des.createEncryptionCipher;break;default:throw(S=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,S}var b="hmacWith"+r.prfAlgorithm.toUpperCase(),g=d(b),m=n.pkcs5.pbkdf2(t,f,l,i,g),w=n.random.getBytesSync(p);(E=y(m)).start(w),E.update(o.toDer(e)),E.finish(),c=E.output.getBytes();var k=function(e,t,r,i){var s=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,t.getBytes())]);"hmacWithSHA1"!==i&&s.value.push(o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.oids[i]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]));return s}(f,h,i,b);u=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s.pkcs5PBES2).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s.pkcs5PBKDF2).getBytes()),k]),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(v).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,w)])])])}else{var S;if("3des"!==r.algorithm)throw(S=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,S;i=24;var E,_=new n.util.ByteBuffer(f);m=a.pbe.generatePkcs12Key(t,_,1,l,i),w=a.pbe.generatePkcs12Key(t,_,2,l,i);(E=n.des.createEncryptionCipher(m)).start(w),E.update(o.toDer(e)),E.finish(),c=E.output.getBytes(),u=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,f),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,h.getBytes())])])}return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[u,o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,c)])},a.decryptPrivateKeyInfo=function(e,t){var r=null,i={},s=[];if(!o.validate(e,u,i,s)){var c=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw c.errors=s,c}var f=o.derToOid(i.encryptionOid),l=a.pbe.getCipher(f,i.encryptionParams,t),h=n.util.createBuffer(i.encryptedData);return l.update(h),l.finish()&&(r=o.fromDer(l.output)),r},a.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:o.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},a.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return o.fromDer(t.body)},a.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));return i=a.encryptPrivateKeyInfo(i,t,r),a.encryptedPrivateKeyToPem(i)}var s,u,c,f;switch(r.algorithm){case"aes128":s="AES-128-CBC",c=16,u=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",c=24,u=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",c=32,u=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",c=24,u=n.random.getBytesSync(8),f=n.des.createEncryptionCipher;break;case"des":s="DES-CBC",c=8,u=n.random.getBytesSync(8),f=n.des.createEncryptionCipher;break;default:var l=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw l.algorithm=r.algorithm,l}var h=f(n.pbe.opensslDeriveBytes(t,u.substr(0,8),c));h.start(u),h.update(o.toDer(a.privateKeyToAsn1(e))),h.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:s,parameters:n.util.bytesToHex(u).toUpperCase()},body:h.output.getBytes()};return n.pem.encode(d)},a.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(c=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=c,c;if(i.procType&&"ENCRYPTED"===i.procType.type){var s,u;switch(i.dekInfo.algorithm){case"DES-CBC":s=8,u=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,u=n.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,u=n.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,u=n.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,u=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,u=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":s=8,u=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":s=16,u=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var c;throw(c=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,c}var f=n.util.hexToBytes(i.dekInfo.parameters),l=u(n.pbe.opensslDeriveBytes(t,f.substr(0,8),s));if(l.start(f),l.update(n.util.createBuffer(i.body)),!l.finish())return r;r=l.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?a.decryptPrivateKeyInfo(o.fromDer(r),t):o.fromDer(r))&&(r=a.privateKeyFromAsn1(r)),r},a.pbe.generatePkcs12Key=function(e,t,r,i,o,a){var s,u;if("undefined"===typeof a||null===a){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');a=n.md.sha1.create()}var c=a.digestLength,f=a.blockLength,l=new n.util.ByteBuffer,h=new n.util.ByteBuffer;if(null!==e&&void 0!==e){for(u=0;u=0;u--)C>>=8,C+=A.at(u)+M.at(u),M.setAt(u,255&C);T.putBuffer(M)}w=T,l.putBuffer(E)}return l.truncate(l.length()-o),l},a.pbe.getCipher=function(e,t,r){switch(e){case a.oids.pkcs5PBES2:return a.pbe.getCipherForPBES2(e,t,r);case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case a.oids["pbewithSHAAnd40BitRC2-CBC"]:return a.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},a.pbe.getCipherForPBES2=function(e,t,r){var i,s={},u=[];if(!o.validate(t,c,s,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((e=o.derToOid(s.kdfOid))!==a.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=o.derToOid(s.encOid))!==a.oids["aes128-CBC"]&&e!==a.oids["aes192-CBC"]&&e!==a.oids["aes256-CBC"]&&e!==a.oids["des-EDE3-CBC"]&&e!==a.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var f,l,d=s.kdfSalt,p=n.util.createBuffer(s.kdfIterationCount);switch(p=p.getInt(p.length()<<3),a.oids[e]){case"aes128-CBC":f=16,l=n.aes.createDecryptionCipher;break;case"aes192-CBC":f=24,l=n.aes.createDecryptionCipher;break;case"aes256-CBC":f=32,l=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":f=24,l=n.des.createDecryptionCipher;break;case"desCBC":f=8,l=n.des.createDecryptionCipher}var v=h(s.prfOid),y=n.pkcs5.pbkdf2(r,d,p,f,v),b=s.encIv,g=l(y);return g.start(b),g},a.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},s=[];if(!o.validate(t,f,i,s))throw(v=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,v;var u,c,l,d=n.util.createBuffer(i.salt),p=n.util.createBuffer(i.iterations);switch(p=p.getInt(p.length()<<3),e){case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,c=8,l=n.des.startDecrypting;break;case a.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,c=8,l=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var v;throw(v=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,v}var y=h(i.prfOid),b=a.pbe.generatePkcs12Key(r,d,1,p,u,y);return y.start(),l(b,a.pbe.generatePkcs12Key(r,d,2,p,c,y))},a.pbe.opensslDeriveBytes=function(e,t,r,i){if("undefined"===typeof i||null===i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var o=[l(i,e+t)],a=16,s=1;a1&&void 0!==arguments[1]?arguments[1]:"utf8",r=n[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.decoder.decode("".concat(r.prefix).concat(e))}},function(e,t,r){"use strict";var n=r(41),i=n.Reader,o=n.Writer,a=n.util,s=n.roots["libp2p-circuit"]||(n.roots["libp2p-circuit"]={});s.CircuitRelay=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.type=e.int32();break;case 2:n.srcPeer=s.CircuitRelay.Peer.decode(e,e.uint32());break;case 3:n.dstPeer=s.CircuitRelay.Peer.decode(e,e.uint32());break;case 4:n.code=e.int32();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof s.CircuitRelay)return e;var t=new s.CircuitRelay;switch(e.type){case"HOP":case 1:t.type=1;break;case"STOP":case 2:t.type=2;break;case"STATUS":case 3:t.type=3;break;case"CAN_HOP":case 4:t.type=4}if(null!=e.srcPeer){if("object"!==typeof e.srcPeer)throw TypeError(".CircuitRelay.srcPeer: object expected");t.srcPeer=s.CircuitRelay.Peer.fromObject(e.srcPeer)}if(null!=e.dstPeer){if("object"!==typeof e.dstPeer)throw TypeError(".CircuitRelay.dstPeer: object expected");t.dstPeer=s.CircuitRelay.Peer.fromObject(e.dstPeer)}switch(e.code){case"SUCCESS":case 100:t.code=100;break;case"HOP_SRC_ADDR_TOO_LONG":case 220:t.code=220;break;case"HOP_DST_ADDR_TOO_LONG":case 221:t.code=221;break;case"HOP_SRC_MULTIADDR_INVALID":case 250:t.code=250;break;case"HOP_DST_MULTIADDR_INVALID":case 251:t.code=251;break;case"HOP_NO_CONN_TO_DST":case 260:t.code=260;break;case"HOP_CANT_DIAL_DST":case 261:t.code=261;break;case"HOP_CANT_OPEN_DST_STREAM":case 262:t.code=262;break;case"HOP_CANT_SPEAK_RELAY":case 270:t.code=270;break;case"HOP_CANT_RELAY_TO_SELF":case 280:t.code=280;break;case"STOP_SRC_ADDR_TOO_LONG":case 320:t.code=320;break;case"STOP_DST_ADDR_TOO_LONG":case 321:t.code=321;break;case"STOP_SRC_MULTIADDR_INVALID":case 350:t.code=350;break;case"STOP_DST_MULTIADDR_INVALID":case 351:t.code=351;break;case"STOP_RELAY_REFUSED":case 390:t.code=390;break;case"MALFORMED_MESSAGE":case 400:t.code=400}return t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.type=t.enums===String?"HOP":1,r.srcPeer=null,r.dstPeer=null,r.code=t.enums===String?"SUCCESS":100),null!=e.type&&e.hasOwnProperty("type")&&(r.type=t.enums===String?s.CircuitRelay.Type[e.type]:e.type),null!=e.srcPeer&&e.hasOwnProperty("srcPeer")&&(r.srcPeer=s.CircuitRelay.Peer.toObject(e.srcPeer,t)),null!=e.dstPeer&&e.hasOwnProperty("dstPeer")&&(r.dstPeer=s.CircuitRelay.Peer.toObject(e.dstPeer,t)),null!=e.code&&e.hasOwnProperty("code")&&(r.code=t.enums===String?s.CircuitRelay.Status[e.code]:e.code),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.Status=function(){var e={},t=Object.create(e);return t[e[100]="SUCCESS"]=100,t[e[220]="HOP_SRC_ADDR_TOO_LONG"]=220,t[e[221]="HOP_DST_ADDR_TOO_LONG"]=221,t[e[250]="HOP_SRC_MULTIADDR_INVALID"]=250,t[e[251]="HOP_DST_MULTIADDR_INVALID"]=251,t[e[260]="HOP_NO_CONN_TO_DST"]=260,t[e[261]="HOP_CANT_DIAL_DST"]=261,t[e[262]="HOP_CANT_OPEN_DST_STREAM"]=262,t[e[270]="HOP_CANT_SPEAK_RELAY"]=270,t[e[280]="HOP_CANT_RELAY_TO_SELF"]=280,t[e[320]="STOP_SRC_ADDR_TOO_LONG"]=320,t[e[321]="STOP_DST_ADDR_TOO_LONG"]=321,t[e[350]="STOP_SRC_MULTIADDR_INVALID"]=350,t[e[351]="STOP_DST_MULTIADDR_INVALID"]=351,t[e[390]="STOP_RELAY_REFUSED"]=390,t[e[400]="MALFORMED_MESSAGE"]=400,t}(),e.Type=function(){var e={},t=Object.create(e);return t[e[1]="HOP"]=1,t[e[2]="STOP"]=2,t[e[3]="STATUS"]=3,t[e[4]="CAN_HOP"]=4,t}(),e.Peer=function(){function e(e){if(this.addrs=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.id=e.bytes();break;case 2:n.addrs&&n.addrs.length||(n.addrs=[]),n.addrs.push(e.bytes());break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("id"))throw a.ProtocolError("missing required 'id'",{instance:n});return n},e.fromObject=function(e){if(e instanceof s.CircuitRelay.Peer)return e;var t=new s.CircuitRelay.Peer;if(null!=e.id&&("string"===typeof e.id?a.base64.decode(e.id,t.id=a.newBuffer(a.base64.length(e.id)),0):e.id.length&&(t.id=e.id)),e.addrs){if(!Array.isArray(e.addrs))throw TypeError(".CircuitRelay.Peer.addrs: array expected");t.addrs=[];for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r-1&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<=a;f--)u=(u<<1)+n[f];c.push(u)}for(var l=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(a=0;a=0;c--){for(var f=0;c>=0&&0===a[c];c--)f++;if(c>=0&&f++,u=u.dblp(f),c<0)break;var l=a[c];s(0!==l),u="affine"===e.type?l>0?u.mixedAdd(i[l-1>>1]):u.mixedAdd(i[-l-1>>1].neg()):l>0?u.add(i[l-1>>1]):u.add(i[-l-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var s,u,c,f=this._wnafT1,l=this._wnafT2,h=this._wnafT3,d=0;for(s=0;s=1;s-=2){var v=s-1,y=s;if(1===f[v]&&1===f[y]){var b=[t[v],null,null,t[y]];0===t[v].y.cmp(t[y].y)?(b[1]=t[v].add(t[y]),b[2]=t[v].toJ().mixedAdd(t[y].neg())):0===t[v].y.cmp(t[y].y.redNeg())?(b[1]=t[v].toJ().mixedAdd(t[y]),b[2]=t[v].add(t[y].neg())):(b[1]=t[v].toJ().mixedAdd(t[y]),b[2]=t[v].toJ().mixedAdd(t[y].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],m=a(r[v],r[y]);for(d=Math.max(m[0].length,d),h[v]=new Array(d),h[y]=new Array(d),u=0;u=0;s--){for(var _=0;s>=0;){var A=!0;for(u=0;u=0&&_++,S=S.dblp(_),s<0)break;for(u=0;u0?c=l[u][x-1>>1]:x<0&&(c=l[u][-x-1>>1].neg()),S="affine"===c.type?S.mixedAdd(c):S.add(c))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;it.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(s=t.slice(n,l)).length)throw new Error("invalid rlp, List has a invalid length");for(;s.length;)u=a(s),c.push(u.data),s=u.remainder;return{data:c,remainder:t.slice(l)}}function s(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 c(t){if(!e.isBuffer(t)){if("string"===typeof t)return s(t)?e.from((r="string"!==typeof(i=t)?i:s(i)?i.slice(2):i).length%2?"0"+r:r,"hex"):e.from(t);if("number"===typeof t||"bigint"===typeof t)return t?function(t){var r=u(t);return e.from(r,"hex")}(t):e.from([]);if(null===t||void 0===t)return e.from([]);if(t instanceof Uint8Array)return e.from(t);if(n.isBN(t))return e.from(t.toArray());throw new Error("invalid type")}var r,i;return t}t.encode=function t(r){if(Array.isArray(r)){for(var n=[],i=0;i2&&void 0!==arguments[2]?arguments[2]:0;return n.encode(e,t,r),t},t.encodingLength=function(e){return n.encodingLength(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(379);t.toString=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8",r=n[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.encoder.encode(e).substring(1)}},function(e,t,r){"use strict";function n(e){if("number"===typeof e){if(n.codes[e])return n.codes[e];throw new Error("no protocol with code: "+e)}if("string"===typeof e){if(n.names[e])return n.names[e];throw new Error("no protocol with name: "+e)}throw new Error("invalid protocol id type: "+e)}var i=-1;function o(e,t,r,n,i){return{code:e,size:t,name:r,resolvable:Boolean(n),path:Boolean(i)}}n.lengthPrefixedVarSize=i,n.V=i,n.table=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,i,"ip6zone"],[53,i,"dns","resolvable"],[54,i,"dns4","resolvable"],[55,i,"dns6","resolvable"],[56,i,"dnsaddr","resolvable"],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,i,"unix",!1,"path"],[421,i,"ipfs"],[421,i,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,i,"garlic64"],[460,0,"quic"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,i,"memory"]],n.names={},n.codes={},n.table.map((function(e){var t=o.apply(null,e);return n.codes[t.code]=t,n.names[t.name]=t,null})),n.object=o,e.exports=n},function(e,t,r){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r(106),t.createHash=t.Hash=r(107),t.createHmac=t.Hmac=r(383);var n=r(671),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return o};var a=r(386);t.pbkdf2=a.pbkdf2,t.pbkdf2Sync=a.pbkdf2Sync;var s=r(673);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 u=r(688);t.DiffieHellmanGroup=u.DiffieHellmanGroup,t.createDiffieHellmanGroup=u.createDiffieHellmanGroup,t.getDiffieHellman=u.getDiffieHellman,t.createDiffieHellman=u.createDiffieHellman,t.DiffieHellman=u.DiffieHellman;var c=r(691);t.createSign=c.createSign,t.Sign=c.Sign,t.createVerify=c.createVerify,t.Verify=c.Verify,t.createECDH=r(706);var f=r(707);t.publicEncrypt=f.publicEncrypt,t.privateEncrypt=f.privateEncrypt,t.publicDecrypt=f.publicDecrypt,t.privateDecrypt=f.privateDecrypt;var l=r(710);t.randomFill=l.randomFill,t.randomFillSync=l.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}},function(e,t,r){var n=r(28).Buffer;function i(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i>>24]^f[p>>>16&255]^l[v>>>8&255]^h[255&y]^t[b++],a=c[p>>>24]^f[v>>>16&255]^l[y>>>8&255]^h[255&d]^t[b++],s=c[v>>>24]^f[y>>>16&255]^l[d>>>8&255]^h[255&p]^t[b++],u=c[y>>>24]^f[d>>>16&255]^l[p>>>8&255]^h[255&v]^t[b++],d=o,p=a,v=s,y=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[v>>>8&255]<<8|n[255&y])^t[b++],a=(n[p>>>24]<<24|n[v>>>16&255]<<16|n[y>>>8&255]<<8|n[255&d])^t[b++],s=(n[v>>>24]<<24|n[y>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^t[b++],u=(n[y>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&v])^t[b++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99,r[a]=c,n[c]=a;var f=e[a],l=e[f],h=e[l],d=257*e[c]^16843008*c;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*h^65537*l^257*f^16843008*a,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===a?a=s=1:(a=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function c(e){this._key=i(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],o=0;o>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/t|0]<<24):t>6&&o%t===4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),i[o]=i[o-t]^a}for(var c=[],f=0;f>>24]]^u.INV_SUB_MIX[1][u.SBOX[h>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[h>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&h]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(e){return a(e=i(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},c.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=c},function(e,t,r){var n=r(28).Buffer,i=r(249);e.exports=function(e,t,r,o){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=n.alloc(a),u=n.alloc(o||0),c=n.alloc(0);a>0||o>0;){var f=new i;f.update(c),f.update(e),t&&f.update(t),c=f.digest();var l=0;if(a>0){var h=s.length-a;l=Math.min(a,c.length),c.copy(s,h,0,l),a-=l}if(l0){var d=u.length-o,p=Math.min(o,c.length-l);c.copy(u,d,l,l+p),o-=p}}return c.fill(0),{key:s,iv:u}}},function(e,t,r){var n=r(696),i=r(703),o=r(704),a=r(258),s=r(386),u=r(28).Buffer;function c(e){var t;"object"!==typeof e||u.isBuffer(e)||(t=e.passphrase,e=e.key),"string"===typeof e&&(e=u.from(e));var r,c,f=o(e,t),l=f.tag,h=f.data;switch(l){case"CERTIFICATE":c=n.certificate.decode(h,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(c||(c=n.PublicKey.decode(h,"der")),r=c.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(c.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return c.subjectPrivateKey=c.subjectPublicKey,{type:"ec",data:c};case"1.2.840.10040.4.1":return c.algorithm.params.pub_key=n.DSAparam.decode(c.subjectPublicKey.data,"der"),{type:"dsa",data:c.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":h=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[e.algorithm.decrypt.cipher.algo.join(".")],c=e.algorithm.decrypt.cipher.iv,f=e.subjectPrivateKey,l=parseInt(o.split("-")[1],10)/8,h=s.pbkdf2Sync(t,r,n,l,"sha1"),d=a.createDecipheriv(o,h,c),p=[];return p.push(d.update(f)),p.push(d.final()),u.concat(p)}(h=n.EncryptedPrivateKey.decode(h,"der"),t);case"PRIVATE KEY":switch(r=(c=n.PrivateKey.decode(h,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(c.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:c.algorithm.curve,privateKey:n.ECPrivateKey.decode(c.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return c.algorithm.params.priv_key=n.DSAparam.decode(c.subjectPrivateKey,"der"),{type:"dsa",params:c.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(h,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(h,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(h,"der")};case"EC PRIVATE KEY":return{curve:(h=n.ECPrivateKey.decode(h,"der")).parameters.value,privateKey:h.privateKey};default:throw new Error("unknown key type "+l)}}e.exports=c,c.signature=n.signature},function(e,t,r){"use strict";var n=r(92),i=r(68),o=i.getNAF,a=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<=a;f--)u=(u<<1)+n[f];c.push(u)}for(var l=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(a=0;a=0;c--){for(var f=0;c>=0&&0===a[c];c--)f++;if(c>=0&&f++,u=u.dblp(f),c<0)break;var l=a[c];s(0!==l),u="affine"===e.type?l>0?u.mixedAdd(i[l-1>>1]):u.mixedAdd(i[-l-1>>1].neg()):l>0?u.add(i[l-1>>1]):u.add(i[-l-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var s,u,c,f=this._wnafT1,l=this._wnafT2,h=this._wnafT3,d=0;for(s=0;s=1;s-=2){var v=s-1,y=s;if(1===f[v]&&1===f[y]){var b=[t[v],null,null,t[y]];0===t[v].y.cmp(t[y].y)?(b[1]=t[v].add(t[y]),b[2]=t[v].toJ().mixedAdd(t[y].neg())):0===t[v].y.cmp(t[y].y.redNeg())?(b[1]=t[v].toJ().mixedAdd(t[y]),b[2]=t[v].add(t[y].neg())):(b[1]=t[v].toJ().mixedAdd(t[y]),b[2]=t[v].toJ().mixedAdd(t[y].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],m=a(r[v],r[y]);for(d=Math.max(m[0].length,d),h[v]=new Array(d),h[y]=new Array(d),u=0;u=0;s--){for(var _=0;s>=0;){var A=!0;for(u=0;u=0&&_++,S=S.dblp(_),s<0)break;for(u=0;u0?c=l[u][x-1>>1]:x<0&&(c=l[u][-x-1>>1].neg()),S="affine"===c.type?S.mixedAdd(c):S.add(c))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i0&&void 0!==arguments[0]?arguments[0]:self,t=e.crypto||e.msCrypto;if(!t||!t.subtle)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p-crypto/blob/master/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return t}},function(e,t,r){"use strict";var n=r(21);Object.defineProperty(t,"__esModule",{value:!0}),t.concat=function(e,t){t||(t=e.reduce((function(e,t){return e+t.length}),0));var r,i=new Uint8Array(t),o=0,a=n(e);try{for(a.s();!(r=a.n()).done;){var s=r.value;i.set(s,o),o+=s.length}}catch(u){a.e(u)}finally{a.f()}return i}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.equals=function(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(var r=0;r0)if(e>n)for(;re?(crypto.getRandomValues(t.subarray(r,r+(e-r))),r+=e-r):(crypto.getRandomValues(t.subarray(r,r+n)),r+=n);else crypto.getRandomValues(t);return t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(820);function i(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}function o(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}function a(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function s(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function u(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function c(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function f(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function l(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}function h(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),f(e/4294967296>>>0,t,r),f(e>>>0,t,r+4),t}function d(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),l(e>>>0,t,r),l(e/4294967296>>>0,t,r+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=i,t.writeInt16BE=i,t.writeUint16LE=o,t.writeInt16LE=o,t.readInt32BE=a,t.readUint32BE=s,t.readInt32LE=u,t.readUint32LE=c,t.writeUint32BE=f,t.writeInt32BE=f,t.writeUint32LE=l,t.writeInt32LE=l,t.readInt64BE=function(e,t){void 0===t&&(t=0);var r=a(e,t),n=a(e,t+4);return 4294967296*r+n-4294967296*(n>>31)},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*s(e,t)+s(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var r=u(e,t);return 4294967296*u(e,t+4)+r-4294967296*(r>>31)},t.readUint64LE=function(e,t){void 0===t&&(t=0);var r=c(e,t);return 4294967296*c(e,t+4)+r},t.writeUint64BE=h,t.writeInt64BE=h,t.writeUint64LE=d,t.writeInt64LE=d,t.readUintBE=function(e,t,r){if(void 0===r&&(r=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=e/8+r-1;o>=r;o--)n+=t[o]*i,i*=256;return n},t.readUintLE=function(e,t,r){if(void 0===r&&(r=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o=i;a--)r[a]=t/o&255,o*=256;return r},t.writeUintLE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var o=1,a=i;a0&&void 0!==arguments[0]?arguments[0]:globalThis,t=e.crypto;if(!t||!t.subtle)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p-crypto/blob/master/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode2=t.decode1=t.decode0=t.encode2=t.encode1=t.encode0=t.uint16BEDecode=t.uint16BEEncode=void 0;var n=r(13);t.uint16BEEncode=function(e,t,r){return(t=t||n.Buffer.allocUnsafe(2)).writeUInt16BE(e,r),t},t.uint16BEEncode.bytes=2;t.uint16BEDecode=function(e){if(e.length<2)throw RangeError("Could not decode int16BE");return e.readUInt16BE(0)},t.uint16BEDecode.bytes=2,t.encode0=function(e){return n.Buffer.concat([e.ne,e.ciphertext])},t.encode1=function(e){return n.Buffer.concat([e.ne,e.ns,e.ciphertext])},t.encode2=function(e){return n.Buffer.concat([e.ns,e.ciphertext])},t.decode0=function(e){if(e.length<32)throw new Error("Cannot decode stage 0 MessageBuffer: length less than 32 bytes.");return{ne:e.slice(0,32),ciphertext:e.slice(32,e.length),ns:n.Buffer.alloc(0)}},t.decode1=function(e){if(e.length<80)throw new Error("Cannot decode stage 1 MessageBuffer: length less than 80 bytes.");return{ne:e.slice(0,32),ns:e.slice(32,80),ciphertext:e.slice(80,e.length)}},t.decode2=function(e){if(e.length<48)throw new Error("Cannot decode stage 2 MessageBuffer: length less than 48 bytes.");return{ne:n.Buffer.alloc(0),ns:e.slice(0,48),ciphertext:e.slice(48,e.length)}}},function(e,t,r){"use strict";var n=r(21),i=r(868),o=Object.prototype.hasOwnProperty,a=Object.propertyIsEnumerable,s=function(e,t,r){return Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})},u=this,c={concatArrays:!1,ignoreUndefined:!1},f=function(e){var t=[];for(var r in e)o.call(e,r)&&t.push(r);if(Object.getOwnPropertySymbols){var i,s=Object.getOwnPropertySymbols(e),u=n(s);try{for(u.s();!(i=u.n()).done;){var c=i.value;a.call(e,c)&&t.push(c)}}catch(f){u.e(f)}finally{u.f()}}return t};function l(e){return Array.isArray(e)?function(e){var t=e.slice(0,0);return f(e).forEach((function(r){s(t,r,l(e[r]))})),t}(e):i(e)?function(e){var t=null===Object.getPrototypeOf(e)?Object.create(null):{};return f(e).forEach((function(r){s(t,r,l(e[r]))})),t}(e):e}var h=function(e,t,r,n){return r.forEach((function(r){"undefined"===typeof t[r]&&n.ignoreUndefined||(r in e&&e[r]!==Object.getPrototypeOf(e)?s(e,r,d(e[r],t[r],n)):s(e,r,l(t[r])))})),e};function d(e,t,r){return r.concatArrays&&Array.isArray(e)&&Array.isArray(t)?function(e,t,r){var n=e.slice(0,0),i=0;return[e,t].forEach((function(t){for(var a=[],u=0;u2&&void 0!==arguments[2]?arguments[2]:{},n=r.emit,i=void 0===n||n,o=e.toB58String();this.data.set(o,t),i&&this._emit(e,t)}},{key:"_emit",value:function(e,t){this._ps.emit(this.eventName,i({peerId:e},this.eventProperty,this.eventTransformer(t)))}},{key:"get",value:function(e){if(!u.isPeerId(e))throw s(new Error("peerId must be an instance of peer-id"),c);var t=this.data.get(e.toB58String());return t?n(t):void 0}},{key:"delete",value:function(e){if(!u.isPeerId(e))throw s(new Error("peerId must be an instance of peer-id"),c);return!!this.data.delete(e.toB58String())&&(this._emit(e,[]),!0)}}]),e}();e.exports=l},function(e,t,r){"use strict";var n=r(21);Object.defineProperty(t,"__esModule",{value:!0}),t.concat=function(e,t){t||(t=e.reduce((function(e,t){return e+t.length}),0));var r,i=new Uint8Array(t),o=0,a=n(e);try{for(a.s();!(r=a.n()).done;){var s=r.value;i.set(s,o),o+=s.length}}catch(u){a.e(u)}finally{a.f()}return i}},function(e,t,r){"use strict";t.get=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:globalThis,t=e.crypto;if(!t||!t.subtle)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p-crypto/blob/master/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return t}},,,function(e,t,r){"use strict";var n=r(0),i=r(6),o=r(8),a=r(9),s=r(29),u=r(90).CID,c=r(67),f=r(162),l=r(58),h=r(63),d=r(58).base58btc,p=r(67).base32,v=r(161).base16,y=r(88),b=r(1029),g=r(170),m=r(1045).PeerIdProto,w=r(181).equals,k=r(96).fromString,S=r(85).toString,E=r(89).identity,_=s(s(s(s({},c),f),l),h),A=Object.keys(_).reduce((function(e,t){return e.or(_[t])}),p.decoder),x=g(function(){function e(t,r,n){if(o(this,e),!(t instanceof Uint8Array))throw new Error("invalid id provided");if(r&&n&&!w(r.public.bytes,n.bytes))throw new Error("inconsistent arguments");this._id=t,this._idB58String=d.encode(this.id).substring(1),this._privKey=r,this._pubKey=n}return a(e,[{key:"id",get:function(){return this._id},set:function(e){throw new Error("Id is immutable")}},{key:"privKey",get:function(){return this._privKey},set:function(e){this._privKey=e}},{key:"pubKey",get:function(){if(this._pubKey)return this._pubKey;if(this._privKey)return this._privKey.public;try{var e=y.decode(this.id);e.code===E.code&&(this._pubKey=b.unmarshalPublicKey(e.digest))}catch(t){}return this._pubKey},set:function(e){this._pubKey=e}},{key:"marshalPubKey",value:function(){if(this.pubKey)return b.marshalPublicKey(this.pubKey)}},{key:"marshalPrivKey",value:function(){if(this.privKey)return b.marshalPrivateKey(this.privKey)}},{key:"marshal",value:function(e){return m.encode({id:this.toBytes(),pubKey:this.marshalPubKey(),privKey:e?null:this.marshalPrivKey()}).finish()}},{key:"toPrint",value:function(){var e=this.toB58String();e.startsWith("Qm")&&(e=e.slice(2));var t=6;return e.length"}},{key:"toJSON",value:function(){return{id:this.toB58String(),privKey:O(this.marshalPrivKey()),pubKey:O(this.marshalPubKey())}}},{key:"toHexString",value:function(){return v.encode(this.id).substring(1)}},{key:"toBytes",value:function(){return this.id}},{key:"toB58String",value:function(){return this._idB58String}},{key:"toString",value:function(){if(!this._idCIDString){var e=u.createV1(114,y.decode(this.id));Object.defineProperty(this,"_idCIDString",{value:e.toString(),enumerable:!1})}return this._idCIDString}},{key:"equals",value:function(e){if(e instanceof Uint8Array)return w(this.id,e);if(e.id)return w(this.id,e.id);throw new Error("not valid Id")}},{key:"isEqual",value:function(e){return this.equals(e)}},{key:"isValid",value:function(){return Boolean(this.privKey&&this.privKey.public&&this.privKey.public.bytes&&this.pubKey.bytes instanceof Uint8Array&&w(this.privKey.public.bytes,this.pubKey.bytes))}},{key:"hasInlinePublicKey",value:function(){try{if(y.decode(this.id).code===E.code)return!0}catch(e){}return!1}}]),e}(),{className:"PeerId",symbolName:"@libp2p/js-peer-id/PeerId"});t=e.exports=x;var T=function(e){return e.bytes.length<=42?y.create(E.code,e.bytes).bytes:e.hash()},M=function(){var e=i(n.mark((function e(t,r){var i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T(r);case 2:return i=e.sent,e.abrupt("return",new x(i,t,r));case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}();t.create=function(){var e=i(n.mark((function e(t){var r;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=t||{}).bits=t.bits||2048,t.keyType=t.keyType||"RSA",e.next=5,b.generateKeyPair(t.keyType,t.bits);case 5:return r=e.sent,e.abrupt("return",M(r,r.public));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.createFromHexString=function(e){return new x(v.decode("f"+e))},t.createFromBytes=function(e){try{var r=u.decode(e);if(!C(r))throw new Error("Supplied PeerID CID is invalid");return t.createFromCID(r)}catch(n){if(y.decode(e).code!==E.code)throw new Error("Supplied PeerID CID is invalid");return new x(e)}},t.createFromB58String=function(e){return t.createFromBytes(d.decode("z"+e))};var C=function(e){return 114===e.code||112===e.code};function O(e){if(e)return S(e,"base64pad")}t.createFromCID=function(e){if(!(e=u.asCID(e))||!C(e))throw new Error("Supplied PeerID CID is invalid");return new x(e.multihash.bytes)},t.createFromPubKey=function(){var e=i(n.mark((function e(t){var r,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"===typeof(r=t)&&(r=k(t,"base64pad")),r instanceof Uint8Array){e.next=4;break}throw new Error("Supplied key is neither a base64 string nor a Uint8Array");case 4:return e.next=6,b.unmarshalPublicKey(r);case 6:return i=e.sent,e.abrupt("return",M(void 0,i));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.createFromPrivKey=function(){var e=i(n.mark((function e(t){var r;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"===typeof t&&(t=k(t,"base64pad")),t instanceof Uint8Array){e.next=3;break}throw new Error("Supplied key is neither a base64 string nor a Uint8Array");case 3:return e.next=5,b.unmarshalPrivateKey(t);case 5:return r=e.sent,e.abrupt("return",M(r,r.public));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.createFromJSON=function(){var e=i(n.mark((function e(t){var r,i,o,a,s,u,c;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=d.decode("z"+t.id),i=t.privKey&&k(t.privKey,"base64pad"),o=t.pubKey&&k(t.pubKey,"base64pad"),e.t0=o,!e.t0){e.next=8;break}return e.next=7,b.unmarshalPublicKey(o);case 7:e.t0=e.sent;case 8:if(a=e.t0,i){e.next=11;break}return e.abrupt("return",new x(r,void 0,a));case 11:return e.next=13,b.unmarshalPrivateKey(i);case 13:return s=e.sent,e.next=16,T(s.public);case 16:if(u=e.sent,!a){e.next=21;break}return e.next=20,T(a);case 20:c=e.sent;case 21:if(!a||w(u,c)){e.next=23;break}throw new Error("Public and private key do not match");case 23:if(!r||w(u,r)){e.next=25;break}throw new Error("Id and private key do not match");case 25:return e.abrupt("return",new x(r,s,a));case 26:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.createFromProtobuf=function(){var e=i(n.mark((function e(t){var r,i,o,a,s,u;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"===typeof t&&(t=k(t,"base16")),r=m.decode(t),i=r.id,o=r.privKey,a=r.pubKey,!o){e.next=8;break}return e.next=5,b.unmarshalPrivateKey(o);case 5:e.t0=e.sent,e.next=9;break;case 8:e.t0=!1;case 9:if(o=e.t0,!a){e.next=16;break}return e.next=13,b.unmarshalPublicKey(a);case 13:e.t1=e.sent,e.next=17;break;case 16:e.t1=!1;case 17:if(a=e.t1,!o){e.next=22;break}return e.next=21,T(o.public);case 21:u=e.sent;case 22:if(!a){e.next=26;break}return e.next=25,T(a);case 25:s=e.sent;case 26:if(!o){e.next=31;break}if(!a){e.next=30;break}if(w(u,s)){e.next=30;break}throw new Error("Public and private key do not match");case 30:return e.abrupt("return",new x(u,o,o.public));case 31:if(!a){e.next=33;break}return e.abrupt("return",new x(s,void 0,a));case 33:if(!i){e.next=35;break}return e.abrupt("return",new x(i));case 35:throw new Error("Protobuf did not contain any usable key material");case 36:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.parse=function(e){return"1"!==e.charAt(0)&&"Q"!==e.charAt(0)||(e="z".concat(e)),t.createFromBytes(A.decode(e))},t.isPeerId=function(e){return Boolean("object"===typeof e&&e._id&&e._idB58String)}},function(e,t,r){"use strict";t.get=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:globalThis,t=e.crypto;if(!t||!t.subtle)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p-crypto/blob/master/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return t}},,function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(1),i=r(38),o=!0,a=!1,s=null,u={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function f(){o=!1}function l(){"hidden"===this.visibilityState&&a&&(o=!0)}function h(e){var t=e.target;try{return t.matches(":focus-visible")}catch(r){}return o||function(e){var t=e.type,r=e.tagName;return!("INPUT"!==r||!u[t]||e.readOnly)||"TEXTAREA"===r&&!e.readOnly||!!e.isContentEditable}(t)}function d(){a=!0,window.clearTimeout(s),s=window.setTimeout((function(){a=!1}),100)}function p(){return{isFocusVisible:h,onBlurVisible:d,ref:n.useCallback((function(e){var t,r=i.findDOMNode(e);null!=r&&((t=r.ownerDocument).addEventListener("keydown",c,!0),t.addEventListener("mousedown",f,!0),t.addEventListener("pointerdown",f,!0),t.addEventListener("touchstart",f,!0),t.addEventListener("visibilitychange",l,!0))}),[])}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(1);function i(e){var t=e.controlled,r=e.default,i=(e.name,e.state,n.useRef(void 0!==t).current),o=n.useState(r),a=o[0],s=o[1];return[i?t:a,n.useCallback((function(e){i||s(e)}),[])]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return h}));var n=r(4),i=r(1),o=r.n(i),a=r(12),s=(r(24),r(16)),u=r(19),c=r(31),f=i.forwardRef((function(e,t){var r=e.children,o=e.classes,u=e.className,f=e.color,l=void 0===f?"inherit":f,h=e.component,d=void 0===h?"svg":h,p=e.fontSize,v=void 0===p?"default":p,y=e.htmlColor,b=e.titleAccess,g=e.viewBox,m=void 0===g?"0 0 24 24":g,w=Object(a.a)(e,["children","classes","className","color","component","fontSize","htmlColor","titleAccess","viewBox"]);return i.createElement(d,Object(n.a)({className:Object(s.a)(o.root,u,"inherit"!==l&&o["color".concat(Object(c.a)(l))],"default"!==v&&o["fontSize".concat(Object(c.a)(v))]),focusable:"false",viewBox:m,color:y,"aria-hidden":!b||void 0,role:b?"img":void 0,ref:t},w),r,b?i.createElement("title",null,b):null)}));f.muiName="SvgIcon";var l=Object(u.a)((function(e){return{root:{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,fontSize:e.typography.pxToRem(24),transition:e.transitions.create("fill",{duration:e.transitions.duration.shorter})},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorAction:{color:e.palette.action.active},colorError:{color:e.palette.error.main},colorDisabled:{color:e.palette.action.disabled},fontSizeInherit:{fontSize:"inherit"},fontSizeSmall:{fontSize:e.typography.pxToRem(20)},fontSizeLarge:{fontSize:e.typography.pxToRem(35)}}}),{name:"MuiSvgIcon"})(f);function h(e,t){var r=function(t,r){return o.a.createElement(l,Object(n.a)({ref:r},t),e)};return r.muiName=l.muiName,o.a.memo(o.a.forwardRef(r))}},,function(e,t,r){"use strict";(function(e){var n=r(21),i=r(40),o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&o(t,e,r);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.recoverTypedSignature_v4=t.recoverTypedSignature=t.signTypedData_v4=t.signTypedData=t.recoverTypedMessage=t.signTypedMessage=t.getEncryptionPublicKey=t.decryptSafely=t.decrypt=t.encryptSafely=t.encrypt=t.recoverTypedSignatureLegacy=t.signTypedDataLegacy=t.typedSignatureHash=t.extractPublicKey=t.recoverPersonalSignature=t.personalSign=t.normalize=t.concatSig=t.TypedDataUtils=t.TYPED_MESSAGE_SCHEMA=void 0;var u=s(r(553)),c=s(r(613)),f=s(r(622)),l=s(r(624)),h={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]};t.TYPED_MESSAGE_SCHEMA=h;var d={encodeData:function(t,r,o){var a=this,s=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],f=["bytes32"],l=[this.hashType(t,o)];if(s){var h,d=function t(r,n,f){if(void 0!==o[n])return["bytes32",null==f?"0x0000000000000000000000000000000000000000000000000000000000000000":u.keccak(a.encodeData(n,f,o,s))];if(void 0===f)throw new Error("missing value for field ".concat(r," of type ").concat(n));if("bytes"===n)return["bytes32",u.keccak(f)];if("string"===n)return"string"===typeof f&&(f=e.from(f,"utf8")),["bytes32",u.keccak(f)];if(n.lastIndexOf("]")===n.length-1){var l=n.slice(0,n.lastIndexOf("[")),h=f.map((function(e){return t(r,l,e)}));return["bytes32",u.keccak(c.rawEncode(h.map((function(e){return i(e,1)[0]})),h.map((function(e){return i(e,2)[1]}))))]}return[n,f]},p=n(o[t]);try{for(p.s();!(h=p.n()).done;){var v=h.value,y=d(v.name,v.type,r[v.name]),b=i(y,2),g=b[0],m=b[1];f.push(g),l.push(m)}}catch(_){p.e(_)}finally{p.f()}}else{var w,k=n(o[t]);try{for(k.s();!(w=k.n()).done;){var S=w.value,E=r[S.name];if(void 0!==E)if("bytes"===S.type)f.push("bytes32"),E=u.keccak(E),l.push(E);else if("string"===S.type)f.push("bytes32"),"string"===typeof E&&(E=e.from(E,"utf8")),E=u.keccak(E),l.push(E);else if(void 0!==o[S.type])f.push("bytes32"),E=u.keccak(this.encodeData(S.type,E,o,s)),l.push(E);else{if(S.type.lastIndexOf("]")===S.type.length-1)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");f.push(S.type),l.push(E)}}}catch(_){k.e(_)}finally{k.f()}}return c.rawEncode(f,l)},encodeType:function(e,t){var r="",i=this.findTypeDependencies(e,t).filter((function(t){return t!==e}));i=[e].concat(i.sort());var o,a=n(i);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(!t[s])throw new Error("No type definition specified: ".concat(s));r+="".concat(s,"(").concat(t[s].map((function(e){var t=e.name,r=e.type;return"".concat(r," ").concat(t)})).join(","),")")}}catch(u){a.e(u)}finally{a.f()}return r},findTypeDependencies:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=e.match(/^[0-9A-Z_a-z]*/),a=i(o,1);if(e=a[0],r.includes(e)||void 0===t[e])return r;r.push(e);var s,u=n(t[e]);try{for(u.s();!(s=u.n()).done;){var c,f=s.value,l=n(this.findTypeDependencies(f.type,t,r));try{for(l.s();!(c=l.n()).done;){var h=c.value;!r.includes(h)&&r.push(h)}}catch(d){l.e(d)}finally{l.f()}}}catch(d){u.e(d)}finally{u.f()}return r},hashStruct:function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return u.keccak(this.encodeData(e,t,r,n))},hashType:function(e,t){return u.keccak(this.encodeType(e,t))},sanitizeData:function(e){var t={};for(var r in h.properties)e[r]&&(t[r]=e[r]);return"types"in t&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},sign:function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.sanitizeData(t),i=[e.from("1901","hex")];return i.push(this.hashStruct("EIP712Domain",n.domain,n.types,r)),"EIP712Domain"!==n.primaryType&&i.push(this.hashStruct(n.primaryType,n.message,n.types,r)),u.keccak(e.concat(i))}};function p(e,t,r){var n=u.fromSigned(t),i=u.fromSigned(r),o=u.bufferToInt(e),a=x(u.toUnsigned(n).toString("hex"),64),s=x(u.toUnsigned(i).toString("hex"),64),c=u.stripHexPrefix(u.intToHex(o));return u.addHexPrefix(a.concat(s,c)).toString("hex")}function v(e,t){var r=E(t.data),n=u.ecsign(r,e);return u.bufferToHex(p(n.v,n.r,n.s))}function y(e){var t=_(E(e.data),e.sig),r=u.publicToAddress(t);return u.bufferToHex(r)}function b(e,t,r){switch(r){case"x25519-xsalsa20-poly1305":if("string"!==typeof t.data)throw new Error('Cannot detect secret message, message params should be of the form {data: "secret message"} ');var n,i=f.box.keyPair();try{n=l.decodeBase64(e)}catch(u){throw new Error("Bad public key")}var o=l.decodeUTF8(t.data),a=f.randomBytes(f.box.nonceLength),s=f.box(o,a,n,i.secretKey);return{version:"x25519-xsalsa20-poly1305",nonce:l.encodeBase64(a),ephemPublicKey:l.encodeBase64(i.publicKey),ciphertext:l.encodeBase64(s)};default:throw new Error("Encryption type/version not supported")}}function g(e,t){switch(e.version){case"x25519-xsalsa20-poly1305":var r,n=T(t),i=f.box.keyPair.fromSecretKey(n).secretKey,o=l.decodeBase64(e.nonce),a=l.decodeBase64(e.ciphertext),s=l.decodeBase64(e.ephemPublicKey),u=f.box.open(a,o,s,i);try{r=l.encodeUTF8(u)}catch(c){throw new Error("Decryption failed.")}if(r)return r;throw new Error("Decryption failed.");default:throw new Error("Encryption type/version not supported.")}}function m(e,t){var r=d.sign(t.data,!1),n=u.ecsign(r,e);return u.bufferToHex(p(n.v,n.r,n.s))}function w(e,t){var r=d.sign(t.data),n=u.ecsign(r,e);return u.bufferToHex(p(n.v,n.r,n.s))}function k(e){var t=_(d.sign(e.data,!1),e.sig),r=u.publicToAddress(t);return u.bufferToHex(r)}function S(e){var t=_(d.sign(e.data),e.sig),r=u.publicToAddress(t);return u.bufferToHex(r)}function E(e){var t=new Error("Expect argument to be non-empty array");if("object"!==typeof e||!("length"in e)||!e.length)throw t;var r=e.map((function(e){return"bytes"===e.type?u.toBuffer(e.value):e.value})),n=e.map((function(e){return e.type})),i=e.map((function(e){if(!e.name)throw t;return"".concat(e.type," ").concat(e.name)}));return c.soliditySHA3(["bytes32","bytes32"],[c.soliditySHA3(new Array(e.length).fill("string"),i),c.soliditySHA3(n,r)])}function _(e,t){var r=u.toBuffer(t),n=u.fromRpcSig(r);return u.ecrecover(e,n.v,n.r,n.s)}function A(e){var t=u.toBuffer(e.data);return _(u.hashPersonalMessage(t),e.sig)}function x(e,t){for(var r="".concat(e);r.length0&&(u=i-s-16),a.padding="0".repeat(u),b(t,{data:JSON.stringify(a)},n)},t.decrypt=g,t.decryptSafely=function(e,t){return JSON.parse(g(e,t)).data},t.getEncryptionPublicKey=function(e){var t=T(e),r=f.box.keyPair.fromSecretKey(t).publicKey;return l.encodeBase64(r)},t.signTypedMessage=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"V4";switch(r){case"V1":return v(e,t);case"V3":return m(e,t);case"V4":default:return w(e,t)}},t.recoverTypedMessage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"V4";switch(t){case"V1":return y(e);case"V3":return k(e);case"V4":default:return S(e)}},t.signTypedData=m,t.signTypedData_v4=w,t.recoverTypedSignature=k,t.recoverTypedSignature_v4=S}).call(this,r(13).Buffer)},function(e,t,r){"use strict";function n(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(183);function i(e,t){if(e){if("string"===typeof e)return Object(n.a)(e,t);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)?Object(n.a)(e,t):void 0}}},function(e,t,r){"use strict";var n=r(1),i=r.n(n).a.createContext(null);t.a=i},function(e,t,r){"use strict";var n="function"===typeof Symbol&&Symbol.for;t.a=n?Symbol.for("mui.nested"):"__THEME_NESTED__"},function(e,t,r){"use strict";t.a={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},function(e,t,r){"use strict";e.exports=r(536)},function(e,t,r){"use strict";t.a={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"}},function(e,t,r){"use strict";(function(t){!function(r){var n=2147483647;function i(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]),r=1779033703,n=3144134277,i=1013904242,o=2773480762,a=1359893119,s=2600822924,u=528734635,c=1541459225,f=new Uint32Array(64);function l(e){for(var l=0,h=e.length;h>=64;){var d=r,p=n,v=i,y=o,b=a,g=s,m=u,w=c,k=void 0,S=void 0,E=void 0,_=void 0,A=void 0;for(S=0;S<16;S++)E=l+4*S,f[S]=(255&e[E])<<24|(255&e[E+1])<<16|(255&e[E+2])<<8|255&e[E+3];for(S=16;S<64;S++)_=((k=f[S-2])>>>17|k<<15)^(k>>>19|k<<13)^k>>>10,A=((k=f[S-15])>>>7|k<<25)^(k>>>18|k<<14)^k>>>3,f[S]=(_+f[S-7]|0)+(A+f[S-16]|0)|0;for(S=0;S<64;S++)_=(((b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+(b&g^~b&m)|0)+(w+(t[S]+f[S]|0)|0)|0,A=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&p^d&v^p&v)|0,w=m,m=g,g=b,b=y+_|0,y=v,v=p,p=d,d=_+A|0;r=r+d|0,n=n+p|0,i=i+v|0,o=o+y|0,a=a+b|0,s=s+g|0,u=u+m|0,c=c+w|0,l+=64,h-=64}}l(e);var h,d=e.length%64,p=e.length/536870912|0,v=e.length<<3,y=d<56?56:120,b=e.slice(e.length-d,e.length);for(b.push(128),h=d+1;h>>24&255),b.push(p>>>16&255),b.push(p>>>8&255),b.push(p>>>0&255),b.push(v>>>24&255),b.push(v>>>16&255),b.push(v>>>8&255),b.push(v>>>0&255),l(b),[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,o>>>24&255,o>>>16&255,o>>>8&255,o>>>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,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function o(e,t,r){e=e.length<=64?e:i(e);var n,o=64+t.length+4,a=new Array(o),s=new Array(64),u=[];for(n=0;n<64;n++)a[n]=54;for(n=0;n=o-4;e--){if(a[e]++,a[e]<=255)return;a[e]=0}}for(;r>=32;)c(),u=u.concat(i(s.concat(i(a)))),r-=32;return r>0&&(c(),u=u.concat(i(s.concat(i(a))).slice(0,r))),u}function a(e,t,r,n,i){var o;for(f(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)c(e,16*o,i,16),u(i,n),f(i,0,e,t+16*o,16);for(o=0;o>>32-t}function u(e,t){f(e,0,t,0,16);for(var r=8;r>0;r-=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 n=0;n<16;++n)e[n]+=t[n]}function c(e,t,r,n){for(var i=0;i=256)return!1}return!0}function h(e,t){if("number"!==typeof e||e%1)throw new Error("invalid "+t);return e}function d(e,r,i,s,u,d,p){if(i=h(i,"N"),s=h(s,"r"),u=h(u,"p"),d=h(d,"dkLen"),0===i||0!==(i&i-1))throw new Error("N must be power of 2");if(i>n/128/s)throw new Error("N too large");if(s>n/128/u)throw new Error("r too large");if(!l(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!l(r))throw new Error("salt must be an array or buffer");r=Array.prototype.slice.call(r);for(var v=o(e,r,128*u*s),y=new Uint32Array(32*u*s),b=0;bP&&(r=P);for(var n=0;nP&&(r=P);for(var h=0;h>0&255),v.push(y[B]>>8&255),v.push(y[B]>>16&255),v.push(y[B]>>24&255);var D=o(e,v,d);return p&&p(null,1,D),D}p&&R(t)};if(!p)for(;;){var D=B();if(void 0!=D)return D}B()}var p={scrypt:function(e,t,r,n,i,o,a){return new Promise((function(s,u){var c=0;a&&a(0),d(e,t,r,n,i,o,(function(e,t,r){if(e)u(e);else if(r)a&&1!==c&&a(1),s(new Uint8Array(r));else if(a&&t!==c)return c=t,a(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(d(e,t,r,n,i,o))}};e.exports=p}()}).call(this,r(246).setImmediate)},function(e,t,r){"use strict";var n=r(4),i=r(12),o=r(1),a=(r(24),r(16)),s=r(19),u=r(31),c={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},f=o.forwardRef((function(e,t){var r=e.align,s=void 0===r?"inherit":r,f=e.classes,l=e.className,h=e.color,d=void 0===h?"initial":h,p=e.component,v=e.display,y=void 0===v?"initial":v,b=e.gutterBottom,g=void 0!==b&&b,m=e.noWrap,w=void 0!==m&&m,k=e.paragraph,S=void 0!==k&&k,E=e.variant,_=void 0===E?"body1":E,A=e.variantMapping,x=void 0===A?c:A,T=Object(i.a)(e,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),M=p||(S?"p":x[_]||c[_])||"span";return o.createElement(M,Object(n.a)({className:Object(a.a)(f.root,l,"inherit"!==_&&f[_],"initial"!==d&&f["color".concat(Object(u.a)(d))],w&&f.noWrap,g&&f.gutterBottom,S&&f.paragraph,"inherit"!==s&&f["align".concat(Object(u.a)(s))],"initial"!==y&&f["display".concat(Object(u.a)(y))]),ref:t},T))}));t.a=Object(s.a)((function(e){return{root:{margin:0},body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}}),{name:"MuiTypography"})(f)},,function(e,t,r){"use strict";e.exports=l;var n,i=r(82),o=i.LongBits,a=i.base64,s=i.utf8;function u(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function c(){}function f(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var h=function(){return i.Buffer?function(){return(l.create=function(){return new n})()}:function(){return new l}};function d(e,t,r){t[r]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function v(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function y(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}l.create=h(),l.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(l.alloc=i.pool(l.alloc,i.Array.prototype.subarray)),l.prototype._push=function(e,t,r){return this.tail=this.tail.next=new u(e,t,r),this.len+=t,this},p.prototype=Object.create(u.prototype),p.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(v,10,o.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=o.from(e);return this._push(v,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(v,t.length(),t)},l.prototype.bool=function(e){return this._push(d,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=o.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var b=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n>>0;if(!t)return this._push(d,1,0);if(i.isString(e)){var r=l.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(b,t,e)},l.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(d,1,0)},l.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new u(c,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},l._configure=function(e){n=e,l.create=h(),n._configure()}},function(e,t,r){"use strict";e.exports=u;var n,i=r(82),o=i.LongBits,a=i.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var c="undefined"!==typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},f=function(){return i.Buffer?function(e){return(u.create=function(e){return i.Buffer.isBuffer(e)?new n(e):c(e)})(e)}:c};function l(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw s(this,8);return new o(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=f(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return e}}(),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},u.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},u.prototype.skip=function(e){if("number"===typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!==(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){n=e,u.create=f(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(u.prototype,{int64:function(){return l.call(this)[t](!1)},uint64:function(){return l.call(this)[t](!0)},sint64:function(){return l.call(this).zzDecode()[t](!1)},fixed64:function(){return d.call(this)[t](!0)},sfixed64:function(){return d.call(this)[t](!1)}})}},function(e,t,r){"use strict";e.exports=i;var n=r(82);function i(e){if(e)for(var t=Object.keys(e),r=0;r>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function L(e,t,r){N.call(this,e,t,r)}N.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(a);if(null===e)throw new Error(a);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!h||!ArrayBuffer.isView(e)))throw new Error(a);t=!0}for(var n,i,o=this.blocks,s=this.byteCount,u=e.length,c=this.blockCount,f=0,l=this.s;f>2]|=e[f]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=s){for(this.start=n-s,this.block=o[c],n=0;n>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},N.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(a);if(null===e)throw new Error(a);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!h||!ArrayBuffer.isView(e)))throw new Error(a);t=!0}var n=0,i=e.length;if(t)n=i;else for(var o=0;o=57344?n+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(e),n},N.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+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&&(j(r),o=0)}return i&&(e=r[o],s+=d[e>>4&15]+d[15&e],i>1&&(s+=d[e>>12&15]+d[e>>8&15]),i>2&&(s+=d[e>>20&15]+d[e>>16&15])),s},N.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r===0&&j(n)}return o&&(e=s<<2,t=n[a],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},L.prototype=new N,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var j=function(e){var t,r,n,i,o,a,s,u,c,f,l,h,d,p,v,b,g,m,w,k,S,E,_,A,x,T,M,C,O,I,P,R,B,D,N,L,j,U,F,K,z,V,H,J,q,G,X,W,Z,Y,Q,$,ee,te,re,ne,ie,oe,ae,se,ue,ce,fe;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(f<<1|l>>>31),r=s^(l<<1|f>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(h<<1|d>>>31),r=c^(d<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=f^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],v=e[1],G=e[11]<<4|e[10]>>>28,X=e[10]<<4|e[11]>>>28,C=e[20]<<3|e[21]>>>29,O=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,V=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,D=e[2]<<1|e[3]>>>31,N=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,W=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,I=e[33]<<13|e[32]>>>19,P=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,m=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,B=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,k=e[36]<<21|e[37]>>>11,S=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,J=e[8]<<27|e[9]>>>5,q=e[9]<<27|e[8]>>>5,T=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,K=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,_=e[49]<<14|e[48]>>>18,e[0]=p^~b&m,e[1]=v^~g&w,e[10]=A^~T&C,e[11]=x^~M&O,e[20]=D^~L&U,e[21]=N^~j&F,e[30]=J^~G&W,e[31]=q^~X&Z,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=b^~m&k,e[3]=g^~w&S,e[12]=T^~C&I,e[13]=M^~O&P,e[22]=L^~U&K,e[23]=j^~F&z,e[32]=G^~W&Y,e[33]=X^~Z&Q,e[42]=ne^~oe&se,e[43]=ie^~ae&ue,e[4]=m^~k&E,e[5]=w^~S&_,e[14]=C^~I&R,e[15]=O^~P&B,e[24]=U^~K&V,e[25]=F^~z&H,e[34]=W^~Y&$,e[35]=Z^~Q&ee,e[44]=oe^~se&ce,e[45]=ae^~ue&fe,e[6]=k^~E&p,e[7]=S^~_&v,e[16]=I^~R&A,e[17]=P^~B&x,e[26]=K^~V&D,e[27]=z^~H&N,e[36]=Y^~$&J,e[37]=Q^~ee&q,e[46]=se^~ce&te,e[47]=ue^~fe&re,e[8]=E^~p&b,e[9]=_^~v&g,e[18]=R^~A&T,e[19]=B^~x&M,e[28]=V^~D&L,e[29]=H^~N&j,e[38]=$^~J&G,e[39]=ee^~q&X,e[48]=ce^~te&ne,e[49]=fe^~re&ie,e[0]^=y[n],e[1]^=y[n+1]};if(f)e.exports=M;else{for(O=0;O-1?n:o.nextTick;g.WritableState=b;var c=Object.create(r(154));c.inherits=r(23);var f={deprecate:r(346)},l=r(344),h=r(244).Buffer,d=i.Uint8Array||function(){};var p,v=r(345);function y(){}function b(e,t){s=s||r(105),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(_,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),_(e,t))}(e,r,n,t,i);else{var a=S(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||k(e,r),n?u(w,e,r,a,i):w(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function g(e){if(s=s||r(105),!p.call(g,this)&&!(this instanceof s))return new g(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)),l.call(this)}function m(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),_(e,t)}function k(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,m(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(m(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),_(e,t)}))}function _(e,t){var r=S(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"===typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(g,l),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:f.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===g&&(e&&e._writableState instanceof b)}})):p=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,h.isBuffer(n)||n instanceof d);return s&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"===typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!==typeof r&&(r=y),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"===typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=h.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var n=this._writableState;"function"===typeof e?(r=e,e=null,t=null):"function"===typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,_(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=v.destroy,g.prototype._undestroy=v.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(39),r(246).setImmediate,r(36))},function(e,t,r){(function(e){var n="undefined"!==typeof e&&e||"undefined"!==typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(562),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,r(36))},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.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),r=0;r>>32-t}function c(e,t,r,n,i,o,a){return u(e+(t&r|~t&n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return u(e+(t&n|r&~n)+i+o|0,a)+t|0}function l(e,t,r,n,i,o,a){return u(e+(t^r^n)+i+o|0,a)+t|0}function h(e,t,r,n,i,o,a){return u(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,e[0],3614090360,7),o=c(o,r,n,i,e[1],3905402710,12),i=c(i,o,r,n,e[2],606105819,17),n=c(n,i,o,r,e[3],3250441966,22),r=c(r,n,i,o,e[4],4118548399,7),o=c(o,r,n,i,e[5],1200080426,12),i=c(i,o,r,n,e[6],2821735955,17),n=c(n,i,o,r,e[7],4249261313,22),r=c(r,n,i,o,e[8],1770035416,7),o=c(o,r,n,i,e[9],2336552879,12),i=c(i,o,r,n,e[10],4294925233,17),n=c(n,i,o,r,e[11],2304563134,22),r=c(r,n,i,o,e[12],1804603682,7),o=c(o,r,n,i,e[13],4254626195,12),i=c(i,o,r,n,e[14],2792965006,17),r=f(r,n=c(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=f(o,r,n,i,e[6],3225465664,9),i=f(i,o,r,n,e[11],643717713,14),n=f(n,i,o,r,e[0],3921069994,20),r=f(r,n,i,o,e[5],3593408605,5),o=f(o,r,n,i,e[10],38016083,9),i=f(i,o,r,n,e[15],3634488961,14),n=f(n,i,o,r,e[4],3889429448,20),r=f(r,n,i,o,e[9],568446438,5),o=f(o,r,n,i,e[14],3275163606,9),i=f(i,o,r,n,e[3],4107603335,14),n=f(n,i,o,r,e[8],1163531501,20),r=f(r,n,i,o,e[13],2850285829,5),o=f(o,r,n,i,e[2],4243563512,9),i=f(i,o,r,n,e[7],1735328473,14),r=l(r,n=f(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=l(o,r,n,i,e[8],2272392833,11),i=l(i,o,r,n,e[11],1839030562,16),n=l(n,i,o,r,e[14],4259657740,23),r=l(r,n,i,o,e[1],2763975236,4),o=l(o,r,n,i,e[4],1272893353,11),i=l(i,o,r,n,e[7],4139469664,16),n=l(n,i,o,r,e[10],3200236656,23),r=l(r,n,i,o,e[13],681279174,4),o=l(o,r,n,i,e[0],3936430074,11),i=l(i,o,r,n,e[3],3572445317,16),n=l(n,i,o,r,e[6],76029189,23),r=l(r,n,i,o,e[9],3654602809,4),o=l(o,r,n,i,e[12],3873151461,11),i=l(i,o,r,n,e[15],530742520,16),r=h(r,n=l(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=h(o,r,n,i,e[7],1126891415,10),i=h(i,o,r,n,e[14],2878612391,15),n=h(n,i,o,r,e[5],4237533241,21),r=h(r,n,i,o,e[12],1700485571,6),o=h(o,r,n,i,e[3],2399980690,10),i=h(i,o,r,n,e[10],4293915773,15),n=h(n,i,o,r,e[1],2240044497,21),r=h(r,n,i,o,e[8],1873313359,6),o=h(o,r,n,i,e[15],4264355552,10),i=h(i,o,r,n,e[6],2734768916,15),n=h(n,i,o,r,e[13],1309151649,21),r=h(r,n,i,o,e[4],4149444226,6),o=h(o,r,n,i,e[11],3174756917,10),i=h(i,o,r,n,e[2],718787259,15),n=h(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|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=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,r){"use strict";var n=r(131).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"===typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i>>32-t}function v(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function b(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function m(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(d,o),d.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,k=0|this._b,S=0|this._c,E=0|this._d,_=0|this._e,A=0;A<80;A+=1){var x,T;A<16?(x=v(r,n,i,o,d,e[s[A]],l[0],c[A]),T=m(w,k,S,E,_,e[u[A]],h[0],f[A])):A<32?(x=y(r,n,i,o,d,e[s[A]],l[1],c[A]),T=g(w,k,S,E,_,e[u[A]],h[1],f[A])):A<48?(x=b(r,n,i,o,d,e[s[A]],l[2],c[A]),T=b(w,k,S,E,_,e[u[A]],h[2],f[A])):A<64?(x=g(r,n,i,o,d,e[s[A]],l[3],c[A]),T=y(w,k,S,E,_,e[u[A]],h[3],f[A])):(x=m(r,n,i,o,d,e[s[A]],l[4],c[A]),T=v(w,k,S,E,_,e[u[A]],h[4],f[A])),r=d,d=o,o=p(i,10),i=n,n=x,w=_,_=E,E=p(S,10),S=k,k=T}var M=this._b+i+E|0;this._b=this._c+o+_|0,this._c=this._d+d+w|0,this._d=this._e+r+k|0,this._e=this._a+n+S|0,this._a=M},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=n.alloc?n.alloc(20):new n(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},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(608),t.sha1=r(609),t.sha224=r(610),t.sha256=r(363),t.sha384=r(611),t.sha512=r(364)},function(e,t,r){"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 n=r(348),i=r(616),o=r(617);t.privateKeyVerify=function(e){return 32===e.length&&n.privateKeyVerify(Uint8Array.from(e))},t.privateKeyExport=function(e,t){if(32!==e.length)throw new RangeError("private key length is invalid");var r=i.privateKeyExport(e,t);return o.privateKeyExport(e,r,t)},t.privateKeyImport=function(e){if(null!==(e=o.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(n.privateKeyNegate(Uint8Array.from(t)))},t.privateKeyModInverse=function(t){if(32!==t.length)throw new Error("private key length is invalid");return e.from(i.privateKeyModInverse(Uint8Array.from(t)))},t.privateKeyTweakAdd=function(t,r){return e.from(n.privateKeyTweakAdd(Uint8Array.from(t),r))},t.privateKeyTweakMul=function(t,r){return e.from(n.privateKeyTweakMul(Uint8Array.from(t),Uint8Array.from(r)))},t.publicKeyCreate=function(t,r){return e.from(n.publicKeyCreate(Uint8Array.from(t),r))},t.publicKeyConvert=function(t,r){return e.from(n.publicKeyConvert(Uint8Array.from(t),r))},t.publicKeyVerify=function(e){return(33===e.length||65===e.length)&&n.publicKeyVerify(Uint8Array.from(e))},t.publicKeyTweakAdd=function(t,r,i){return e.from(n.publicKeyTweakAdd(Uint8Array.from(t),Uint8Array.from(r),i))},t.publicKeyTweakMul=function(t,r,i){return e.from(n.publicKeyTweakMul(Uint8Array.from(t),Uint8Array.from(r),i))},t.publicKeyCombine=function(t,r){var i=[];return t.forEach((function(e){i.push(Uint8Array.from(e))})),e.from(n.publicKeyCombine(i,r))},t.signatureNormalize=function(t){return e.from(n.signatureNormalize(Uint8Array.from(t)))},t.signatureExport=function(t){return e.from(n.signatureExport(Uint8Array.from(t)))},t.signatureImport=function(t){return e.from(n.signatureImport(Uint8Array.from(t)))},t.signatureImportLax=function(e){if(0===e.length)throw new RangeError("signature length is invalid");var t=o.signatureImportLax(e);if(null===t)throw new Error("couldn't parse DER signature");return i.signatureImport(t)},t.sign=function(t,r,i){if(null===i)throw new TypeError("options should be an Object");var o=void 0;if(i){if(o={},null===i.data)throw new TypeError("options.data should be a Buffer");if(i.data){if(32!=i.data.length)throw new RangeError("options.data length is invalid");o.data=new Uint8Array(i.data)}if(null===i.noncefn)throw new TypeError("options.noncefn should be a Function");i.noncefn&&(o.noncefn=function(t,r,n,o,a){var s=null!=n?e.from(n):null,u=null!=o?e.from(o):null,c=e.from("");return i.noncefn&&(c=i.noncefn(e.from(t),e.from(r),s,u,a)),new Uint8Array(c)})}var a=n.ecdsaSign(Uint8Array.from(t),Uint8Array.from(r),o);return{signature:e.from(a.signature),recovery:a.recid}},t.verify=function(e,t,r){return n.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(e),r)},t.recover=function(t,r,i,o){return e.from(n.ecdsaRecover(Uint8Array.from(r),i,Uint8Array.from(t),o))},t.ecdh=function(t,r){return e.from(n.ecdh(Uint8Array.from(t),Uint8Array.from(r),{}))},t.ecdhUnsafe=function(t,r,n){if(33!==t.length&&65!==t.length)throw new RangeError("public key length is invalid");if(32!==r.length)throw new RangeError("private key length is invalid");return e.from(i.ecdhUnsafe(Uint8Array.from(t),Uint8Array.from(r),n))}}).call(this,r(13).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160=t.sha256=t.keccak256=t.keccak=void 0;var n=r(340),i=n.keccak224,o=n.keccak384,a=n.keccak256,s=n.keccak512,u=r(107),c=r(134),f=r(191),l=r(159);t.keccak=function(t,r){switch(void 0===r&&(r=256),t="string"!==typeof t||c.isHexString(t)?l.toBuffer(t):e.from(t,"utf8"),r||(r=256),r){case 224:return i(t);case 256:return a(t);case 384:return o(t);case 512:return s(t);default:throw new Error("Invald algorithm: keccak"+r)}},t.keccak256=function(e){return t.keccak(e)},t.sha256=function(e){return e=l.toBuffer(e),u("sha256").update(e).digest()},t.ripemd160=function(e,t){e=l.toBuffer(e);var r=u("rmd160").update(e).digest();return!0===t?l.setLength(r,32):r},t.rlphash=function(e){return t.keccak(f.encode(e))}}).call(this,r(13).Buffer)},function(e,t,r){"use strict";(function(t){var n=r(64),i=r(645),o=r(369),a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u={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=r(370)),e}(),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),JSON.stringify(e)):e}],transformResponse:[function(e){var t=this.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,a=!r&&"json"===this.responseType;if(a||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(a){if("SyntaxError"===s.name)throw o(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, */*"}}};n.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){u.headers[e]=n.merge(a)})),e.exports=u}).call(this,r(39))},,function(e,t,r){"use strict";var n=r(66);function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function a(e,r){var i=function(e){var t=o(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(r),a=r.modulus.byteLength(),s=new n(e).mul(i.blinder).umod(r.modulus),u=s.toRed(n.mont(r.prime1)),c=s.toRed(n.mont(r.prime2)),f=r.coefficient,l=r.prime1,h=r.prime2,d=u.redPow(r.exponent1).fromRed(),p=c.redPow(r.exponent2).fromRed(),v=d.isub(p).imul(f).umod(l).imul(h);return p.iadd(v).imul(i.unblinder).umod(r.modulus).toArrayLike(t,"be",a)}a.getr=o,e.exports=a}).call(this,r(13).Buffer)},function(e,t,r){"use strict";(function(t){var n,i=r(13),o=i.Buffer,a={};for(n in i)i.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(a[n]=i[n]);var s=a.Buffer={};for(n in o)o.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(s[n]=o[n]);if(a.Buffer.prototype=o.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(e,t,r){if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&"undefined"===typeof e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return o(e,t,r)}),s.alloc||(s.alloc=function(e,t,r){if("number"!==typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=o(e);return t&&0!==t.length?"string"===typeof r?n.fill(t,r):n.fill(t):n.fill(0),n}),!a.kStringMaxLength)try{a.kStringMaxLength=t.binding("buffer").kStringMaxLength}catch(u){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),e.exports=a}).call(this,r(39))},function(e,t,r){"use strict";var n=r(263).Reporter,i=r(164).EncoderBuffer,o=r(164).DecoderBuffer,a=r(66),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function c(e,t,r){var n={};this._baseState=n,n.name=r,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}e.exports=c;var f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){var e=this._baseState,t={};f.forEach((function(r){t[r]=e[r]}));var r=new this.constructor(t.parent);return r._baseState=t,r},c.prototype._wrap=function(){var e=this._baseState;u.forEach((function(t){this[t]=function(){var r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}}),this)},c.prototype._init=function(e){var t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),a.equal(t.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(e){var t=this._baseState,r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==r.length&&(a(null===t.children),t.children=r,r.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!==typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach((function(r){r==(0|r)&&(r|=0);var n=e[r];t[n]=r})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){c.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),s.forEach((function(e){c.prototype[e]=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(r),this}})),c.prototype.use=function(e){a(e);var t=this._baseState;return a(null===t.use),t.use=e,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(e){var t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},c.prototype.explicit=function(e){var t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},c.prototype.implicit=function(e){var t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},c.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},c.prototype.key=function(e){var t=this._baseState;return a(null===t.key),t.key=e,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(e){var t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},c.prototype.contains=function(e){var t=this._baseState;return a(null===t.use),t.contains=e,this},c.prototype._decode=function(e,t){var r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));var n,i=r.default,a=!0,s=null;if(null!==r.key&&(s=e.enterKey(r.key)),r.optional){var u=null;if(null!==r.explicit?u=r.explicit:null!==r.implicit?u=r.implicit:null!==r.tag&&(u=r.tag),null!==u||r.any){if(a=this._peekTag(e,u,r.any),e.isError(a))return a}else{var c=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),a=!0}catch(v){a=!1}e.restore(c)}}if(r.obj&&a&&(n=e.enterObject()),a){if(null!==r.explicit){var f=this._decodeTag(e,r.explicit);if(e.isError(f))return f;e=f}var l=e.offset;if(null===r.use&&null===r.choice){var h;r.any&&(h=e.save());var d=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(d))return d;r.any?i=e.raw(h):e=d}if(t&&t.track&&null!==r.tag&&t.track(e.path(),l,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(e,t)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var p=new o(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(p,t)}}return r.obj&&a&&(i=e.leaveObject(n)),null===r.key||null===i&&!0!==a?null!==s&&e.exitKey(s):e.leaveKey(s,r.key,i),i},c.prototype._decodeGeneric=function(e,t,r){var n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},c.prototype._getUse=function(e,t){var r=this._baseState;return r.useDecoder=this._use(e,t),a(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},c.prototype._decodeChoice=function(e,t){var r=this._baseState,n=null,i=!1;return Object.keys(r.choice).some((function(o){var a=e.save(),s=r.choice[o];try{var u=s._decode(e,t);if(e.isError(u))return!1;n={type:o,value:u},i=!0}catch(c){return e.restore(a),!1}return!0}),this),i?n:e.error("Choice not matched")},c.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},c.prototype._encode=function(e,t,r){var n=this._baseState;if(null===n.default||n.default!==e){var i=this._encodeValue(e,t,r);if(void 0!==i&&!this._skipDefault(i,t,r))return i}},c.prototype._encodeValue=function(e,t,r){var i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new n);var o=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}var a=null,s=!1;if(i.any)o=this._createEncoderBuffer(e);else if(i.choice)o=this._encodeChoice(e,t);else if(i.contains)a=this._getUse(i.contains,r)._encode(e,t),s=!0;else if(i.children)a=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");var n=t.enterKey(r._baseState.key);if("object"!==typeof e)return t.error("Child expected, but input is not object");var i=r._encode(e[r._baseState.key],t,e);return t.leaveKey(n),i}),this).filter((function(e){return e})),a=this._createEncoderBuffer(a);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(r){var n=this._baseState;return this._getUse(n.args[0],e)._encode(r,t)}),u))}else null!==i.use?o=this._getUse(i.use,r)._encode(e,t):(a=this._encodePrimitive(i.tag,e),s=!0);if(!i.any&&null===i.choice){var c=null!==i.implicit?i.implicit:i.tag,f=null===i.implicit?"universal":"context";null===c?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(c,s,f,a))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},c.prototype._encodeChoice=function(e,t){var r=this._baseState,n=r.choice[e.type];return n||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},c.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},c.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},c.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},function(e,t,r){"use strict";var n=r(23);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}t.Reporter=i,i.prototype.isError=function(e){return e instanceof o},i.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){var n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){var t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){var t,r=this._reporterState,n=e instanceof o;if(t=n?e:new o(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},function(e,t,r){"use strict";function n(e){var t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);var n=e[r];t[n]=r})),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=n(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=n(t.tag)},function(e,t,r){"use strict";var n,i=t,o=r(266),a=r(413),s=r(68).assert;function u(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(725)}catch(f){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){var n=t;n.utils=r(77),n.common=r(166),n.sha=r(719),n.ripemd=r(723),n.hmac=r(724),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){"use strict";var n=r(422),i=r(744),o=r(268);t.aes=i,t.hmac=n,t.keys=o,t.randomBytes=r(273),t.pbkdf2=r(783)},function(e,t,r){"use strict";var n=r(0),i=r(6),o=r(269);r(62),r(169);var a=r(18),s=r(15),u=r(110).fromString,c=r(769),f={rsa:r(770),ed25519:r(775),secp256k1:r(777)(o,r(273))},l="secp256k1 support requires libp2p-crypto-secp256k1 package",h="ERR_MISSING_PACKAGE";function d(e){var t=f[e.toLowerCase()];if(!t){var r=Object.keys(f).join(" / ");throw s(new Error("invalid or unsupported key type ".concat(e,". Must be ").concat(r)),"ERR_UNSUPPORTED_KEY_TYPE")}return t}var p=function(){var e=i(n.mark((function e(t,r){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",d(t).generateKeyPair(r));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),v=function(){var e=i(n.mark((function e(t,r,i){var o;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=d(t),"ed25519"===t.toLowerCase()){e.next=3;break}throw s(new Error("Seed key derivation is unimplemented for RSA or secp256k1"),"ERR_UNSUPPORTED_KEY_DERIVATION_TYPE");case 3:return e.abrupt("return",o.generateKeyPairFromSeed(r,i));case 4:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),y=function(){var e=i(n.mark((function e(t){var r,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=o.PrivateKey.decode(t),i=r.Data,e.t0=r.Type,e.next=e.t0===o.KeyType.RSA?5:e.t0===o.KeyType.Ed25519?6:e.t0===o.KeyType.Secp256k1?7:12;break;case 5:return e.abrupt("return",f.rsa.unmarshalRsaPrivateKey(i));case 6:return e.abrupt("return",f.ed25519.unmarshalEd25519PrivateKey(i));case 7:if(!f.secp256k1){e.next=11;break}return e.abrupt("return",f.secp256k1.unmarshalSecp256k1PrivateKey(i));case 11:throw s(new Error(l),h);case 12:d(r.Type);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),b=function(){var e=i(n.mark((function e(t,r){var i,o,l;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.import(t,r);case 3:return i=e.sent,e.abrupt("return",y(i));case 7:e.prev=7,e.t0=e.catch(0);case 9:if(null!==(o=a.pki.decryptRsaPrivateKey(t,r))){e.next=12;break}throw s(new Error("Cannot read the key, most likely the password is wrong or not a RSA key"),"ERR_CANNOT_DECRYPT_PEM");case 12:return l=a.asn1.toDer(a.pki.privateKeyToAsn1(o)),l=u(l.getBytes(),"ascii"),e.abrupt("return",f.rsa.unmarshalRsaPrivateKey(l));case 15:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,r){return e.apply(this,arguments)}}();e.exports={supportedKeys:f,keysPBM:o,keyStretcher:r(779),generateEphemeralKeyPair:r(780),generateKeyPair:p,generateKeyPairFromSeed:v,unmarshalPublicKey:function(e){var t=o.PublicKey.decode(e),r=t.Data;switch(t.Type){case o.KeyType.RSA:return f.rsa.unmarshalRsaPublicKey(r);case o.KeyType.Ed25519:return f.ed25519.unmarshalEd25519PublicKey(r);case o.KeyType.Secp256k1:if(f.secp256k1)return f.secp256k1.unmarshalSecp256k1PublicKey(r);throw s(new Error(l),h);default:d(t.Type)}},marshalPublicKey:function(e,t){return d(t=(t||"rsa").toLowerCase()),e.bytes},unmarshalPrivateKey:y,marshalPrivateKey:function(e,t){return d(t=(t||"rsa").toLowerCase()),e.bytes},import:b}},function(e,t,r){"use strict";var n=r(41),i=n.Reader,o=n.Writer,a=n.util,s=n.roots["libp2p-crypto-keys"]||(n.roots["libp2p-crypto-keys"]={});s.KeyType=function(){var e={},t=Object.create(e);return t[e[0]="RSA"]=0,t[e[1]="Ed25519"]=1,t[e[2]="Secp256k1"]=2,t}(),s.PublicKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw a.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw a.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof s.PublicKey)return e;var t=new s.PublicKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?a.base64.decode(e.Data,t.Data=a.newBuffer(a.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=a.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?s.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?a.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),s.PrivateKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw a.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw a.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof s.PrivateKey)return e;var t=new s.PrivateKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?a.base64.decode(e.Data,t.Data=a.newBuffer(a.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=a.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?s.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?a.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=s},function(e,t,r){var n=r(18);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.des.Algorithm(e,t)}))}r(423),r(424),r(34),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return d(r._keys,e,t,!1)},decrypt:function(e,t){return d(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],l=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],v=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=e.length()>8?3:1,b=[],g=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],m=0,w=0;w>>4^S))<<4,k^=t=65535&((S^=t)>>>-16^k),k^=(t=858993459&(k>>>2^(S^=t<<-16)))<<2,k^=t=65535&((S^=t)>>>-16^k),k^=(t=1431655765&(k>>>1^(S^=t<<-16)))<<1,k^=t=16711935&((S^=t)>>>8^k),t=(k^=(t=1431655765&(k>>>1^(S^=t<<8)))<<1)<<8|(S^=t)>>>20&240,k=S<<24|S<<8&16711680|S>>>8&65280|S>>>24&240,S=t;for(var E=0;E>>26,S=S<<2|S>>>26):(k=k<<1|k>>>27,S=S<<1|S>>>27),S&=-15;var _=r[(k&=-15)>>>28]|n[k>>>24&15]|i[k>>>20&15]|o[k>>>16&15]|a[k>>>12&15]|s[k>>>8&15]|u[k>>>4&15],A=c[S>>>28]|f[S>>>24&15]|l[S>>>20&15]|h[S>>>16&15]|d[S>>>12&15]|p[S>>>8&15]|v[S>>>4&15];t=65535&(A>>>16^_),b[m++]=_^t,b[m++]=A^t<<16}}return b}(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var o=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],a=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],f=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],l=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],h=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function d(e,t,r,n){var i,d,p=32===e.length?3:9;i=3===p?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var v=t[0],y=t[1];v^=(d=252645135&(v>>>4^y))<<4,v^=(d=65535&(v>>>16^(y^=d)))<<16,v^=d=858993459&((y^=d)>>>2^v),v^=d=16711935&((y^=d<<2)>>>8^v),v=(v^=(d=1431655765&(v>>>1^(y^=d<<8)))<<1)<<1|v>>>31,y=(y^=d)<<1|y>>>31;for(var b=0;b>>4|y<<28)^e[w+1];d=v,v=y,y=d^(a[k>>>24&63]|u[k>>>16&63]|f[k>>>8&63]|h[63&k]|o[S>>>24&63]|s[S>>>16&63]|c[S>>>8&63]|l[63&S])}d=v,v=y,y=d}y=y>>>1|y<<31,y^=d=1431655765&((v=v>>>1|v<<31)>>>1^y),y^=(d=16711935&(y>>>8^(v^=d<<1)))<<8,y^=(d=858993459&(y>>>2^(v^=d)))<<2,y^=d=65535&((v^=d)>>>16^y),y^=d=252645135&((v^=d<<16)>>>4^y),v^=d<<4,r[0]=v,r[1]=y}function p(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=e,i.call(t,r)},t}},,function(e,t,r){var n=r(18);r(34);var i=e.exports=n.pem=n.pem||{};function o(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i65&&-1!==a){var s=t[a];","===s?(++a,t=t.substr(0,a)+"\r\n "+t.substr(a)):t=t.substr(0,a)+"\r\n"+s+t.substr(a+1),o=i-a-1,a=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(a=i);return t}function a(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=o(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=o(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=o(r)),e.headers)for(var a=0;at)throw new Error("byte array longer than desired length");r=a([new Uint8Array(t-r.length),r])}return o(r,"base64url")},t.base64urlToBigInteger=function(e){var r=t.base64urlToBuffer(e);return new n.jsbn.BigInteger(o(r,"base16"),16)},t.base64urlToBuffer=function(e,t){var r=i(e,"base64urlpad");if(null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=a([new Uint8Array(t-r.length),r])}return r}},function(e,t,r){"use strict";var n=r(0),i=r(6),o=r(63).base64,a=r(429);e.exports={export:function(){var e=i(n.mark((function e(t,r){var i,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.create(),e.next=3,i.encrypt(t,r);case 3:return s=e.sent,e.abrupt("return",o.encode(s));case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()}},function(e,t,r){"use strict";var n=r(785),i=r(277),o=i.encodeText,a=i.decodeText,s=i.concat;function u(e){if(Object.prototype.hasOwnProperty.call(n.names,e))return n.names[e];if(Object.prototype.hasOwnProperty.call(n.codes,e))return n.codes[e];throw new Error("Unsupported encoding: ".concat(e))}(t=e.exports=function(e,t){if(!t)throw new Error("requires an encoded Uint8Array");var r=u(e),n=r.name,i=r.codeBuf;return function(e,t){u(e).decode(a(t))}(n,t),s([i,t],i.length+t.length)}).encode=function(e,t){var r=u(e),n=o(r.encode(t));return s([r.codeBuf,n],r.codeBuf.length+n.length)},t.decode=function(e){e instanceof Uint8Array&&(e=a(e));var t=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase()),u(e[0]).decode(e.substring(1))},t.isEncoded=function(e){if(e instanceof Uint8Array&&(e=a(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return u(e[0]).name}catch(t){return!1}},t.encoding=u,t.encodingFromData=function(e){return e instanceof Uint8Array&&(e=a(e)),u(e[0])};var c=Object.freeze(n.names),f=Object.freeze(n.codes);t.names=c,t.codes=f},function(e,t,r){"use strict";var n=r(21),i=new TextDecoder,o=new TextEncoder;e.exports={decodeText:function(e){return i.decode(e)},encodeText:function(e){return o.encode(e)},concat:function(e,t){var r,i=new Uint8Array(t),o=0,a=n(e);try{for(a.s();!(r=a.n()).done;){var s=r.value;i.set(s,o),o+=s.length}}catch(u){a.e(u)}finally{a.f()}return i}}},,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(815),i=r(94);function o(e){var t=new Float64Array(16);if(e)for(var r=0;r=0;--g){var m=r[g>>>3]>>>(7&g)&1;c(i,a,m),c(p,v,m),f(y,i,p),l(i,i,p),f(p,a,v),l(a,a,v),d(v,y),d(b,i),h(i,p,i),h(p,a,y),f(y,i,p),l(i,i,p),d(a,i),l(p,v,b),h(i,p,s),f(i,i,v),h(p,p,i),h(i,v,b),h(v,a,n),d(a,y),c(i,a,m),c(p,v,m)}for(g=0;g<16;g++)n[g+16]=i[g],n[g+32]=p[g],n[g+48]=a[g],n[g+64]=v[g];var w=n.subarray(32),k=n.subarray(16);!function(e,t){for(var r=o(),n=0;n<16;n++)r[n]=t[n];for(n=253;n>=0;n--)d(r,r),2!==n&&4!==n&&h(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}(w,w),h(k,k,w);var S=new Uint8Array(32);return function(e,t){for(var r=o(),n=o(),i=0;i<16;i++)n[i]=t[i];u(n),u(n),u(n);for(var a=0;a<2;a++){for(r[0]=n[0]-65517,i=1;i<15;i++)r[i]=n[i]-65535-(r[i-1]>>16&1),r[i-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);var s=r[15]>>16&1;r[14]&=65535,c(n,r,1-s)}for(i=0;i<16;i++)e[2*i]=255&n[i],e[2*i+1]=n[i]>>8}(S,k),S}function v(e){return p(e,a)}function y(e){if(e.length!==t.SECRET_KEY_LENGTH)throw new Error("x25519: seed must be "+t.SECRET_KEY_LENGTH+" bytes");var r=new Uint8Array(e);return{publicKey:v(r),secretKey:r}}t.scalarMult=p,t.scalarMultBase=v,t.generateKeyPairFromSeed=y,t.generateKeyPair=function(e){var t=n.randomBytes(32,e),r=y(t);return i.wipe(t),r},t.sharedKey=function(e,r,n){if(void 0===n&&(n=!1),e.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(r.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");var i=p(e,r);if(n){for(var o=0,a=0;a>>8}Object.defineProperty(t,"__esModule",{value:!0}),t.select=function(e,t,r){return~(e-1)&t|e-1&r},t.lessOrEqual=function(e,t){return(0|e)-(0|t)-1>>>31&1},t.compare=n,t.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==n(e,t)}},function(e,t,r){"use strict";var n=r(41),i=n.Reader,o=n.Writer,a=n.util,s=n.roots["libp2p-crypto-keys"]||(n.roots["libp2p-crypto-keys"]={});s.KeyType=function(){var e={},t=Object.create(e);return t[e[0]="RSA"]=0,t[e[1]="Ed25519"]=1,t[e[2]="Secp256k1"]=2,t}(),s.PublicKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw a.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw a.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof s.PublicKey)return e;var t=new s.PublicKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?a.base64.decode(e.Data,t.Data=a.newBuffer(a.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=a.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?s.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?a.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),s.PrivateKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw a.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw a.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof s.PrivateKey)return e;var t=new s.PrivateKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?a.base64.decode(e.Data,t.Data=a.newBuffer(a.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=a.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?s.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?a.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=s},function(e,t,r){"use strict";r(34),r(114);var n=r(18),i=r(116).fromString,o=r(117).toString,a=r(207).concat;t.bigIntegerToUintBase64url=function(e,t){var r=Uint8Array.from(e.abs().toByteArray());if(r=0===r[0]?r.slice(1):r,null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=a([new Uint8Array(t-r.length),r])}return o(r,"base64url")},t.base64urlToBigInteger=function(e){var r=t.base64urlToBuffer(e);return new n.jsbn.BigInteger(o(r,"base16"),16)},t.base64urlToBuffer=function(e,t){var r=i(e,"base64urlpad");if(null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=a([new Uint8Array(t-r.length),r])}return r}},function(e,t,r){"use strict";var n=r(0),i=r(6),o=r(63).base64,a=r(446);e.exports={export:function(){var e=i(n.mark((function e(t,r){var i,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.create(),e.next=3,i.encrypt(t,r);case 3:return s=e.sent,e.abrupt("return",o.encode(s));case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()}},function(e,t,r){"use strict";r.r(t),r.d(t,"CURVE",(function(){return y})),r.d(t,"ExtendedPoint",(function(){return E})),r.d(t,"Point",(function(){return A})),r.d(t,"Signature",(function(){return x})),r.d(t,"SignResult",(function(){return x})),r.d(t,"getPublicKey",(function(){return Q})),r.d(t,"sign",(function(){return ee})),r.d(t,"verify",(function(){return re})),r.d(t,"utils",(function(){return oe}));var n=r(51),i=r(0),o=r.n(i),a=r(25),s=r(5),u=r(7),c=r(504),f=r.n(c),l=BigInt(0),h=BigInt(1),d=BigInt(2),p=BigInt(8),v=BigInt(255),y={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:Math.pow(d,v)-BigInt(19),n:Math.pow(d,BigInt(252))+BigInt("27742317777372353535851937790883648493"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")},b=32,g=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),m=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),w=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),k=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),S=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),E=function(){function e(t,r,n,i){Object(s.a)(this,e),this.x=t,this.y=r,this.z=n,this.t=i}return Object(u.a)(e,[{key:"toRistrettoBytes",value:function(){var e,t=this.x,r=this.y,n=this.z,i=this.t,o=N(N(n+r)*N(n-r)),a=N(t*r),s=F(N(o*Math.pow(a,d))).value,u=N(s*o),c=N(s*a),f=N(u*c*i);if(R(i*f)){var l=N(r*g),h=N(t*g);t=l,r=h,e=N(u*w)}else e=c;R(t*f)&&(r=N(-r));var p=N((n-r)*e);return R(p)&&(p=N(-p)),P(p,b)}},{key:"equals",value:function(e){var t=e;return N(this.t*t.z)===N(t.t*this.z)}},{key:"negate",value:function(){return new e(N(-this.x),this.y,this.z,N(-this.t))}},{key:"double",value:function(){var t=this.x,r=this.y,n=this.z,i=y.a,o=N(Math.pow(t,d)),a=N(Math.pow(r,d)),s=N(d*Math.pow(n,d)),u=N(i*o),c=N(Math.pow(t+r,d)-o-a),f=N(u+a),l=N(f-s),h=N(u-a),p=N(c*l),v=N(f*h),b=N(c*h);return new e(p,v,N(l*f),b)}},{key:"add",value:function(t){var r=this.x,n=this.y,i=this.z,o=this.t,a=t.x,s=t.y,u=t.z,c=t.t,f=N((n-r)*(s+a)),h=N((n+r)*(s-a)),p=N(h-f);if(p===l)return this.double();var v=N(i*d*c),y=N(o*d*u),b=N(y+v),g=N(h+f),m=N(y-v),w=N(b*p),k=N(g*m),S=N(b*m);return new e(w,k,N(p*g),S)}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiplyUnsafe",value:function(t){var r=Y(t);if(r===h)return this;for(var n=e.ZERO,i=this;r>l;)r&h&&(n=n.add(i)),i=i.double(),r>>=h;return n}},{key:"precomputeWindow",value:function(e){for(var t=256/e+1,r=[],n=this,i=n,o=0;o>=l,v>u&&(v-=f,t+=h),0===v){var y=i[p];d%2&&(y=y.negate()),a=a.add(y)}else{var b=i[p+Math.abs(v)-1];v<0&&(b=b.negate()),o=o.add(b)}}return[o,a]}},{key:"multiply",value:function(t,r){var n=Y(t);return e.normalizeZ(this.wNAF(n,r))[0]}},{key:"toAffine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:L(this.z),t=N(this.x*e),r=N(this.y*e);return new A(t,r)}}],[{key:"fromAffine",value:function(t){if(!(t instanceof A))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return t.equals(A.ZERO)?e.ZERO:new e(t.x,t.y,h,N(t.x*t.y))}},{key:"toAffineBatch",value:function(e){var t=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y.P,r=e.length,n=new Array(r),i=h,o=0;o=0;a--)if(e[a]!==l){var s=N(i*e[a],t);e[a]=N(i*n[a],t),i=s}return e}(e.map((function(e){return e.z})));return e.map((function(e,r){return e.toAffine(t[r])}))}},{key:"normalizeZ",value:function(e){return this.toAffineBatch(e).map(this.fromAffine)}},{key:"fromRistrettoHash",value:function(e){var t=D(e.slice(0,b)),r=this.calcElligatorRistrettoMap(t),n=D(e.slice(b,64)),i=this.calcElligatorRistrettoMap(n);return r.add(i)}},{key:"calcElligatorRistrettoMap",value:function(t){var r=y.d,n=N(g*t*t),i=N((n+h)*k),o=BigInt(-1),a=N((o-r*n)*N(n+r)),s=U(i,a),u=s.isValid,c=s.value,f=N(c*t);R(f)||(f=N(-f)),u||(c=f),u||(o=n);var l=N(o*(n-h)*S-a),d=c*c,p=N((c+c)*a),v=N(l*m),b=N(h-d),w=N(h+d);return new e(N(p*w),N(b*v),N(v*w),N(p*b))}},{key:"fromRistrettoBytes",value:function(t){var r=y.a,n=y.d,i="ExtendedPoint.fromRistrettoBytes: Cannot convert bytes to Ristretto Point",o=D(t);if(!function(e,t){if(e.length!==t.length)return!1;for(var r=0;r=0;r-=2,n++)t[n]=C(e[r]+e[r+1]);var i=this.x&h?128:0;return t[31]|=i,t}},{key:"toHex",value:function(){return M(this.toRawBytes())}},{key:"toX25519",value:function(){return N((h+this.y)*L(h-this.y))}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"negate",value:function(){return new e(N(-this.x),this.y)}},{key:"add",value:function(e){return E.fromAffine(this).add(E.fromAffine(e)).toAffine()}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiply",value:function(e){return E.fromAffine(this).multiply(e,this).toAffine()}}],[{key:"fromHex",value:function(t){var r=y.d,n=y.P,i=t instanceof Uint8Array?t:O(t);if(32!==i.length)throw new Error("Point.fromHex: expected 32 bytes");var o=i[31],a=-129&o,s=0!==(128&o),u=B(Uint8Array.from(Array.from(i.slice(0,31)).concat(a)));if(u>=n)throw new Error("Point.fromHex expects hex <= Fp");var c=N(u*u),f=U(N(c-h),N(r*c+h)),l=f.isValid,d=f.value;if(!l)throw new Error("Point.fromHex: invalid y coordinate");return s!==((d&h)===h)&&(d=N(-d)),new e(d,u)}},{key:"fromPrivateKey",value:function(){var t=Object(a.a)(o.a.mark((function t(r){var n;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,W(r);case 2:return n=t.sent,t.abrupt("return",e.BASE.multiply(H(n)));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}]),e}();A.BASE=new A(y.Gx,y.Gy),A.ZERO=new A(l,h);var x=function(){function e(t,r){Object(s.a)(this,e),this.r=t,this.s=r}return Object(u.a)(e,[{key:"toRawBytes",value:function(){var e=O(I(this.s)).reverse(),t=new Uint8Array(b);t.set(e);var r=new Uint8Array(64);return r.set(this.r.toRawBytes()),r.set(t,32),r}},{key:"toHex",value:function(){return M(this.toRawBytes())}}],[{key:"fromHex",value:function(t){t=J(t);var r=A.fromHex(t.slice(0,32)),n=B(t.slice(32));if(!q(n))throw new Error("Signature.fromHex expects s <= CURVE.n");return new e(r,n)}}]),e}();function T(){for(var e=arguments.length,t=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:b,r=I(e).padStart(2*t,"0");return O(r).reverse()}function R(e){return(N(e)&h)===h}function B(e){for(var t=l,r=0;r1&&void 0!==arguments[1]?arguments[1]:y.P,r=e%t;return r>=l?r:t+r}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y.P;if(e===l||t<=l)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));for(var r=N(e,t),n=t,i=l,o=h,a=h,s=l;r!==l;){var u=n/r,c=n%r,f=i-a*u,d=o-s*u;n=r,r=c,i=a,o=s,a=f,s=d}var p=n;if(p!==h)throw new Error("invert: does not exist");return N(i,t)}function j(e,t){for(var r=y.P,n=e;t-- >l;)n*=n,n%=r;return n}function U(e,t){var r=N(t*t*t),i=N(r*r*t),o=N(e*r*function(e){var t=y.P,r=[5,10,20,40,80].map((function(e){return BigInt(e)})),i=Object(n.a)(r,5),o=i[0],a=i[1],s=i[2],u=i[3],c=i[4],f=e*e%t*e%t,l=j(f,d)*f%t,p=j(l,h)*e%t,v=j(p,o)*p%t,b=j(v,a)*v%t,g=j(b,s)*b%t,m=j(g,u)*g%t,w=j(m,c)*m%t,k=j(w,c)*m%t,S=j(k,a)*v%t;return j(S,d)*e%t}(e*i)),a=N(t*o*o),s=o,u=N(o*g),c=a===e,f=a===N(-e),l=a===N(-e*g);return c&&(o=s),(f||l)&&(o=u),R(o)&&(o=N(-o)),{isValid:c||f,value:o}}function F(e){return U(h,e)}function K(){return z.apply(this,arguments)}function z(){return(z=Object(a.a)(o.a.mark((function e(){var t,r,n,i=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=T.apply(void 0,i),e.next=3,oe.sha512(t);case 3:return r=e.sent,n=B(r),e.abrupt("return",N(n,y.n));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V(e){return e.slice(b)}function H(e){var t=e.slice(0,b);return t[0]&=248,t[31]&=127,t[31]|=64,N(B(t),y.n)}function J(e){return e instanceof Uint8Array?e:O(e)}function q(e){return 0G)throw new Error(r);t=O(n.toString(16).padStart(64,"0"))}else if("string"===typeof e){if(64!==e.length)throw new Error(r);t=O(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error(r);t=e}return t}function W(e){return Z.apply(this,arguments)}function Z(){return(Z=Object(a.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,oe.sha512(X(t));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Y(e){if("number"===typeof e&&e>0&&Number.isSafeInteger(e))return BigInt(e);if("bigint"===typeof e&&q(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function Q(e){return $.apply(this,arguments)}function $(){return($=Object(a.a)(o.a.mark((function e(t){var r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A.fromPrivateKey(t);case 2:return r=e.sent,e.abrupt("return","string"===typeof t?r.toHex():r.toRawBytes());case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ee(e,t){return te.apply(this,arguments)}function te(){return(te=Object(a.a)(o.a.mark((function e(t,r){var n,i,a,s,u,c,f,l,h;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W(r);case 2:return n=e.sent,i=H(n),a=A.BASE.multiply(i),s=J(t),e.next=8,K(V(n),s);case 8:return u=e.sent,c=A.BASE.multiply(u),e.next=12,K(c.toRawBytes(),a.toRawBytes(),s);case 12:return f=e.sent,l=N(u+f*i,y.n),h=new x(c,l),e.abrupt("return","string"===typeof t?h.toHex():h.toRawBytes());case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function re(e,t,r){return ne.apply(this,arguments)}function ne(){return(ne=Object(a.a)(o.a.mark((function e(t,r,n){var i,a,s,u;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=J(r),n instanceof A||(n=A.fromHex(n)),t instanceof x||(t=x.fromHex(t)),e.next=5,K(t.r.toRawBytes(),n.toRawBytes(),r);case 5:return i=e.sent,a=E.fromAffine(n).multiplyUnsafe(i),s=E.BASE.multiply(t.s),u=E.fromAffine(t.r).add(a),e.abrupt("return",u.subtract(s).multiplyUnsafe(p).equals(E.ZERO));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}A.BASE._setWindowSize(8);var ie={node:f.a,web:"object"===typeof self&&"crypto"in self?self.crypto:void 0},oe={TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],randomBytes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(ie.web)return ie.web.getRandomValues(new Uint8Array(e));if(ie.node){var t=ie.node.randomBytes;return new Uint8Array(t(e).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:function(){return oe.randomBytes(32)},sha512:function(){var e=Object(a.a)(o.a.mark((function e(t){var r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ie.web){e.next=7;break}return e.next=3,ie.web.subtle.digest("SHA-512",t.buffer);case 3:return r=e.sent,e.abrupt("return",new Uint8Array(r));case 7:if(!ie.node){e.next=11;break}return e.abrupt("return",Uint8Array.from(ie.node.createHash("sha512").update(t).digest()));case 11:throw new Error("The environment doesn't have sha512 function");case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),precompute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A.BASE,r=t.equals(A.BASE)?t:new A(t.x,t.y);return r._setWindowSize(e),r.multiply(h),r}}},function(e,t,r){"use strict";r.r(t),r.d(t,"CURVE",(function(){return g})),r.d(t,"Point",(function(){return E})),r.d(t,"Signature",(function(){return A})),r.d(t,"SignResult",(function(){return x})),r.d(t,"getPublicKey",(function(){return $})),r.d(t,"recoverPublicKey",(function(){return ee})),r.d(t,"getSharedSecret",(function(){return re})),r.d(t,"sign",(function(){return ie})),r.d(t,"signSync",(function(){return ae})),r.d(t,"verify",(function(){return se})),r.d(t,"schnorr",(function(){return be})),r.d(t,"utils",(function(){return me}));var n=r(74),i=r(0),o=r.n(i),a=r(51),s=r(25),u=r(5),c=r(7),f=r(505),l=r.n(f),h=BigInt(0),d=BigInt(1),p=BigInt(2),v=BigInt(3),y=BigInt(8),b=Math.pow(p,BigInt(256)),g={a:h,b:BigInt(7),P:b-Math.pow(p,BigInt(32))-BigInt(977),n:b-BigInt("432420386565659656852420866394968145599"),h:d,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")};function m(e){var t=g.a,r=g.b;return j(Math.pow(e,v)+t*e+r)}var w=g.a===h,k=function(){function e(t,r,n){Object(u.a)(this,e),this.x=t,this.y=r,this.z=n}return Object(c.a)(e,[{key:"equals",value:function(e){var t=this,r=e,n=j(t.z*t.z),i=j(t.z*n),o=j(r.z*r.z),a=j(r.z*o);return j(t.x*o)===j(n*r.x)&&j(t.y*a)===j(i*r.y)}},{key:"negate",value:function(){return new e(this.x,j(-this.y),this.z)}},{key:"double",value:function(){var t=this.x,r=this.y,n=this.z,i=j(Math.pow(t,p)),o=j(Math.pow(r,p)),a=j(Math.pow(o,p)),s=j(p*(j(j(Math.pow(t+o,p)))-i-a)),u=j(v*i),c=j(Math.pow(u,p)),f=j(c-p*s);return new e(f,j(u*(s-f)-y*a),j(p*r*n))}},{key:"add",value:function(t){if(!(t instanceof e))throw new TypeError("JacobianPoint#add: expected JacobianPoint");var r=this.x,n=this.y,i=this.z,o=t.x,a=t.y,s=t.z;if(o===h||a===h)return this;if(r===h||n===h)return t;var u=j(Math.pow(i,p)),c=j(Math.pow(s,p)),f=j(r*c),l=j(o*u),d=j(n*s*c),v=j(j(a*i)*u),y=j(l-f),b=j(v-d);if(y===h)return b===h?this.double():e.ZERO;var g=j(Math.pow(y,p)),m=j(y*g),w=j(f*g),k=j(Math.pow(b,p)-m-p*w);return new e(k,j(b*(w-k)-d*m),j(i*s*y))}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiplyUnsafe",value:function(t){var r=L(t);if(!w){for(var n=e.ZERO,i=this;r>h;)r&d&&(n=n.add(i)),i=i.double(),r>>=d;return n}for(var o=V(r),a=o.k1neg,s=o.k1,u=o.k2neg,c=o.k2,f=e.ZERO,l=e.ZERO,p=this;s>h||c>h;)s&d&&(f=f.add(p)),c&d&&(l=l.add(p)),p=p.double(),s>>=d,c>>=d;return a&&(f=f.negate()),u&&(l=l.negate()),l=new e(j(l.x*g.beta),l.y,l.z),f.add(l)}},{key:"precomputeWindow",value:function(e){for(var t=w?128/e+1:256/e+1,r=[],n=this,i=n,o=0;o>=l,v>u&&(v-=f,t+=d),0===v){var y=i[p];h%2&&(y=y.negate()),a=a.add(y)}else{var b=i[p+Math.abs(v)-1];v<0&&(b=b.negate()),o=o.add(b)}}return{p:o,f:a}}},{key:"multiply",value:function(t,r){var n,i,o=L(t);if(w){var a=V(o),s=a.k1neg,u=a.k1,c=a.k2neg,f=a.k2,l=this.wNAF(u,r),h=l.p,d=l.f,p=this.wNAF(f,r),v=p.p,y=p.f;s&&(h=h.negate()),c&&(v=v.negate()),v=new e(j(v.x*g.beta),v.y,v.z),n=h.add(v),i=d.add(y)}else{var b=this.wNAF(o,r);n=b.p,i=b.f}return e.normalizeZ([n,i])[0]}},{key:"toAffine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:F(this.z),t=Math.pow(e,p),r=j(this.x*t),n=j(this.y*t*e);return new E(r,n)}}],[{key:"fromAffine",value:function(t){if(!(t instanceof E))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new e(t.x,t.y,d)}},{key:"toAffineBatch",value:function(e){var t=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.P,r=e.length,n=new Array(r),i=d,o=0;o=0;a--)if(e[a]!==h){var s=j(i*e[a],t);e[a]=j(i*n[a],t),i=s}return e}(e.map((function(e){return e.z})));return e.map((function(e,r){return e.toAffine(t[r])}))}},{key:"normalizeZ",value:function(t){return e.toAffineBatch(t).map(e.fromAffine)}}]),e}();k.BASE=new k(g.Gx,g.Gy,d),k.ZERO=new k(h,d,h);var S=new WeakMap,E=function(){function e(t,r){Object(u.a)(this,e),this.x=t,this.y=r}return Object(c.a)(e,[{key:"_setWindowSize",value:function(e){this._WINDOW_SIZE=e,S.delete(this)}},{key:"toRawBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return R(this.toHex(e))}},{key:"toHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=C(this.x);return e?"".concat(this.y&d?"03":"02").concat(t):"04".concat(t).concat(C(this.y))}},{key:"toHexX",value:function(){return this.toHex(!0).slice(2)}},{key:"toRawX",value:function(){return this.toRawBytes(!0).slice(1)}},{key:"assertValidity",value:function(){var e="Point is not on elliptic curve",t=g.P,r=this.x,n=this.y;if(r===h||n===h||r>=t||n>=t)throw new Error(e);if((j(n*n)-m(r))%t!==h)throw new Error(e)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"negate",value:function(){return new e(this.x,j(-this.y))}},{key:"double",value:function(){return k.fromAffine(this).double().toAffine()}},{key:"add",value:function(e){return k.fromAffine(this).add(k.fromAffine(e)).toAffine()}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiply",value:function(e){return k.fromAffine(this).multiply(e,this).toAffine()}}],[{key:"fromCompressedHex",value:function(t){var r=32===t.length,n=D(r?t:t.slice(1)),i=function(e){var t=g.P,r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),s=BigInt(88),u=e*e*e%t,c=u*u*e%t,f=U(c,v)*c%t,l=U(f,v)*c%t,h=U(l,p)*u%t,d=U(h,n)*h%t,y=U(d,i)*d%t,b=U(y,a)*y%t,m=U(b,s)*b%t,w=U(m,a)*y%t,k=U(w,v)*c%t,S=U(k,o)*d%t,E=U(S,r)*u%t;return U(E,p)}(m(n)),o=(i&d)===d;r?o&&(i=j(-i)):1===(1&t[0])!==o&&(i=j(-i));var a=new e(n,i);return a.assertValidity(),a}},{key:"fromUncompressedHex",value:function(t){var r=new e(D(t.slice(1,33)),D(t.slice(33)));return r.assertValidity(),r}},{key:"fromHex",value:function(e){var t=B(e),r=t[0];if(32===t.length||33===t.length&&(2===r||3===r))return this.fromCompressedHex(t);if(65===t.length&&4===r)return this.fromUncompressedHex(t);throw new Error("Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ".concat(t.length))}},{key:"fromPrivateKey",value:function(t){return e.BASE.multiply(Z(t))}},{key:"fromSignature",value:function(t,r,n){var i=t instanceof Uint8Array?D(t):P(t),o=Q(r),a=o.r,s=o.s;if(0!==n&&1!==n)throw new Error("Cannot recover signature: invalid yParity bit");var u=2+(1&n),c=e.fromHex("0".concat(u).concat(C(a))),f=k.fromAffine(c).multiplyUnsafe(s),l=k.BASE.multiply(i),h=F(a,g.n),d=f.subtract(l).multiplyUnsafe(h).toAffine();return d.assertValidity(),d}}]),e}();function _(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}E.BASE=new E(g.Gx,g.Gy),E.ZERO=new E(h,h);var A=function(){function e(t,r){Object(u.a)(this,e),this.r=t,this.s=r}return Object(c.a)(e,[{key:"assertValidity",value:function(){var e=this.r,t=this.s;if(!X(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!X(t))throw new Error("Invalid Signature: s must be 0 < s < n")}},{key:"toDERRawBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return R(this.toDERHex(e))}},{key:"toDERHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=_(I(this.s));if(e)return t;var r=_(I(this.r)),n=I(r.length/2),i=I(t.length/2),o=I(r.length/2+t.length/2+4);return"30".concat(o,"02").concat(n).concat(r,"02").concat(i).concat(t)}},{key:"toRawBytes",value:function(){return this.toDERRawBytes()}},{key:"toHex",value:function(){return this.toDERHex()}},{key:"toCompactRawBytes",value:function(){return R(this.toCompactHex())}},{key:"toCompactHex",value:function(){return C(this.r)+C(this.s)}}],[{key:"fromCompact",value:function(t){if("string"!==typeof t&&!(t instanceof Uint8Array))throw new TypeError("Signature.fromCompact: Expected string or Uint8Array");var r=t instanceof Uint8Array?M(t):t;if(128!==r.length)throw new Error("Signature.fromCompact: Expected 64-byte hex");var n=new e(P(r.slice(0,64)),P(r.slice(64,128)));return n.assertValidity(),n}},{key:"fromDER",value:function(t){var r="Signature.fromDER";if("string"!==typeof t&&!(t instanceof Uint8Array))throw new TypeError("".concat(r,": Expected string or Uint8Array"));var n=t instanceof Uint8Array?M(t):t,i=N(n.slice(2,4));if("30"!==n.slice(0,2)||i!==n.length-4||"02"!==n.slice(4,6))throw new Error("".concat(r,": Invalid signature ").concat(n));var o=N(n.slice(6,8)),a=8+o,s=n.slice(8,a);if(s.startsWith("00")&&N(s.slice(2,4))<=127)throw new Error("".concat(r,": Invalid r with trailing length"));var u=P(s);if("02"!==n.slice(a,a+2))throw new Error("".concat(r,": Invalid r-s separator"));var c=N(n.slice(a+2,a+4)),f=i-c-o-10;if(f>0||-4===f)throw new Error("".concat(r,": Invalid total length"));if(c>i-o-4)throw new Error("".concat(r,": Invalid s"));var l=a+4,h=n.slice(l,l+c);if(h.startsWith("00")&&N(h.slice(2,4))<=127)throw new Error("".concat(r,": Invalid s with trailing length"));var d=new e(u,P(h));return d.assertValidity(),d}},{key:"fromHex",value:function(e){return this.fromDER(e)}}]),e}(),x=A;function T(){for(var e=arguments.length,t=new Array(e),r=0;r0&&Number.isSafeInteger(e))return BigInt(e);if("bigint"===typeof e&&X(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.P,r=e%t;return r>=0?r:t+r}function U(e,t){for(var r=g.P,n=e;t-- >h;)n*=n,n%=r;return n}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.P;if(e===h||t<=h)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));for(var r=j(e,t),n=t,i=h,o=d,a=d,s=h;r!==h;){var u=n/r,c=n%r,f=i-a*u,l=o-s*u;n=r,r=c,i=a,o=s,a=f,s=l}var p=n;if(p!==d)throw new Error("invert: does not exist");return j(i,t)}var K=function(e,t){return(e+t/p)/t},z=Math.pow(p,BigInt(128));function V(e){var t=g.n,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-d*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=K(o*e,t),s=K(-n*e,t),u=j(e-a*r-s*i,t),c=j(-a*n-s*o,t),f=u>z,l=c>z;if(f&&(u=t-u),l&&(c=t-c),u>z||c>z)throw new Error("splitScalarEndo: Endomorphism failed");return{k1neg:f,k1:u,k2neg:l,k2:c}}function H(e,t){if(null==e)throw new Error('sign: expected valid msgHash, not "'.concat(e,'"'));var r=O("string"===typeof e?P(e):D(e));return{h1:r,h1n:D(r),x:O(t),v:new Uint8Array(32).fill(1),k:new Uint8Array(32).fill(0),b0:Uint8Array.from([0]),b1:Uint8Array.from([1])}}function J(e,t){return q.apply(this,arguments)}function q(){return(q=Object(s.a)(o.a.mark((function e(t,r){var n,i,a,s,u,c,f,l,h,d,p,v;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Z(r),i=H(t,n),a=i.h1,s=i.h1n,u=i.x,c=i.v,f=i.k,l=i.b0,h=i.b1,d=me.hmacSha256,e.next=5,d(f,c,l,u,a);case 5:return f=e.sent,e.next=8,d(f,c);case 8:return c=e.sent,e.next=11,d(f,c,h,u,a);case 11:return f=e.sent,e.next=14,d(f,c);case 14:c=e.sent,p=0;case 16:if(!(p<1e3)){e.next=32;break}return e.next=19,d(f,c);case 19:if(c=e.sent,!(v=W(c,s,n))){e.next=23;break}return e.abrupt("return",v);case 23:return e.next=25,d(f,c,l);case 25:return f=e.sent,e.next=28,d(f,c);case 28:c=e.sent;case 29:p++,e.next=16;break;case 32:throw new TypeError("secp256k1: Tried 1,000 k values for sign(), all were invalid");case 33:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G(e,t){var r=Z(t),n=H(e,r),i=n.h1,o=n.h1n,a=n.x,s=n.v,u=n.k,c=n.b0,f=n.b1,l=me.hmacSha256Sync;if(!l)throw new Error("utils.hmacSha256Sync is undefined, you need to set it");if((u=l(u,s,c,a,i))instanceof Promise)throw new Error("To use sync sign(), ensure utils.hmacSha256 is sync");s=l(u,s),u=l(u,s,f,a,i),s=l(u,s);for(var h=0;h<1e3;h++){var d=W(s=l(u,s),o,r);if(d)return d;u=l(u,s,c),s=l(u,s)}throw new TypeError("secp256k1: Tried 1,000 k values for sign(), all were invalid")}function X(e){return 00)t=BigInt(e);else if("string"===typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=P(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=D(e)}if(!X(t))throw new Error("Expected private key: 0 < key < n");return t}function Y(e){return e instanceof E?(e.assertValidity(),e):E.fromHex(e)}function Q(e){return e instanceof A?(e.assertValidity(),e):A.fromDER(e)}function $(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=E.fromPrivateKey(e);return"string"===typeof e?r.toHex(t):r.toRawBytes(t)}function ee(e,t,r){var n=E.fromSignature(e,t,r);return"string"===typeof e?n.toHex():n.toRawBytes()}function te(e){var t=e instanceof Uint8Array,r="string"===typeof e,n=(t||r)&&e.length;return t?33===n||65===n:r?66===n||130===n:e instanceof E}function re(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(te(e))throw new TypeError("getSharedSecret: first arg must be private key");if(!te(t))throw new TypeError("getSharedSecret: second arg must be public key");var n=Y(t);n.assertValidity();var i=n.multiply(Z(e));return"string"===typeof e?i.toHex(r):i.toRawBytes(r)}function ne(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=Object(a.a)(e,3),i=n[0],o=n[1],s=n[2],u=t.canonical,c=t.der,f=t.recovered,l=(i.x===o?0:2)|Number(i.y&d),h=s,p=g.n>>d;s>p&&u&&(h=g.n-s,l^=1);var v=new A(o,h);v.assertValidity();var y=!1===c?v.toCompactHex():v.toDERHex(),b=r?y:R(y);return f?[b,l]:b}function ie(e,t){return oe.apply(this,arguments)}function oe(){return(oe=Object(s.a)(o.a.mark((function e(t,r){var n,i=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:{},e.t0=ne,e.next=4,J(t,r);case 4:return e.t1=e.sent,e.t2=n,e.t3="string"===typeof t,e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t3));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ae(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return ne(G(e,t),r,"string"===typeof e)}function se(e,t,r){var n,i=g.n;try{n=Q(e)}catch(y){return!1}var o=n,a=o.r,s=o.s,u=function(e){"string"!==typeof e&&(e=M(e));var t=P(e||"0"),r=e.length/2*8-256;return r>0&&(t>>=BigInt(r)),t>=g.n&&(t-=g.n),t}(t);if(u===h)return!1;var c=k.fromAffine(Y(r)),f=F(s,i),l=j(u*f,i),d=j(a*f,i),p=k.BASE.multiply(l),v=c.multiplyUnsafe(d);return j(p.add(v).toAffine().x,i)===a}function ue(e){return ce.apply(this,arguments)}function ce(){return(ce=Object(s.a)(o.a.mark((function e(t){var r,n,i,a,s,u,c=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new Uint8Array(t.split("").map((function(e){return e.charCodeAt(0)}))),e.next=3,me.sha256(r);case 3:for(n=e.sent,i=c.length,a=new Array(i>1?i-1:0),s=1;s=g.P||r>=g.n)throw new Error("Invalid signature")}return Object(c.a)(e,[{key:"toHex",value:function(){return C(this.r)+C(this.s)}},{key:"toRawBytes",value:function(){return R(this.toHex())}}],[{key:"fromHex",value:function(t){var r=B(t);if(64!==r.length)throw new TypeError("SchnorrSignature.fromHex: expected 64 bytes, not ".concat(r.length));return new e(D(r.slice(0,32)),D(r.slice(32)))}}]),e}();function pe(){return(pe=Object(s.a)(o.a.mark((function e(t,r){var n,i,a,s,u,c,f,l,d,p,v,y,b,m,w,k=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=k.length>2&&void 0!==k[2]?k[2]:me.randomBytes(),null!=t){e.next=3;break}throw new TypeError('sign: Expected valid message, not "'.concat(t,'"'));case 3:if(r||(r=h),i=g.n,a=B(t),s=Z(r),32===(u=B(n)).length){e.next=10;break}throw new TypeError("sign: Expected 32 bytes of aux randomness");case 10:return c=E.fromPrivateKey(s),f=he(c)?s:i-s,e.next=14,ue("BIP0340/aux",u);case 14:return l=e.sent,d=f^l,e.next=18,ue("BIP0340/nonce",O(d),c.toRawX(),a);case 18:if(p=e.sent,(v=j(p,i))!==h){e.next=22;break}throw new Error("sign: Creation of signature failed. k is zero");case 22:return y=E.fromPrivateKey(v),b=he(y)?v:i-v,e.next=26,fe(y.x,c,a);case 26:return m=e.sent,w=new de(y.x,j(b+m*f,i)),e.next=30,ve(w.toRawBytes(),a,c.toRawX());case 30:if(e.sent){e.next=33;break}throw new Error("sign: Invalid signature produced");case 33:return e.abrupt("return","string"===typeof t?w.toHex():w.toRawBytes());case 34:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ve(e,t,r){return ye.apply(this,arguments)}function ye(){return(ye=Object(s.a)(o.a.mark((function e(t,r,n){var i,a,s,u,c,f,l;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t instanceof de?t:de.fromHex(t),a="string"===typeof r?R(r):r,s=Y(n),e.next=5,fe(i.r,s,a);case 5:if(u=e.sent,c=E.fromPrivateKey(i.s),f=s.multiply(u),!(l=c.subtract(f)).equals(E.BASE)&&he(l)&&l.x===i.r){e.next=11;break}return e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var be={Signature:de,getPublicKey:function(e){var t=E.fromPrivateKey(e);return"string"===typeof e?t.toHexX():t.toRawX()},sign:function(e,t){return pe.apply(this,arguments)},verify:ve};E.BASE._setWindowSize(8);var ge={node:l.a,web:"object"===typeof self&&"crypto"in self?self.crypto:void 0},me={isValidPrivateKey:function(e){try{return Z(e),!0}catch(t){return!1}},randomBytes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(ge.web)return ge.web.getRandomValues(new Uint8Array(e));if(ge.node){var t=ge.node.randomBytes;return new Uint8Array(t(e).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:function(){for(var e=8;e--;){var t=me.randomBytes(32),r=D(t);if(X(r)&&r!==d)return t}throw new Error("Valid private key was not found in 8 iterations. PRNG is broken")},sha256:function(){var e=Object(s.a)(o.a.mark((function e(t){var r,n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ge.web){e.next=7;break}return e.next=3,ge.web.subtle.digest("SHA-256",t.buffer);case 3:return r=e.sent,e.abrupt("return",new Uint8Array(r));case 7:if(!ge.node){e.next=12;break}return n=ge.node.createHash,e.abrupt("return",Uint8Array.from(n("sha256").update(t).digest()));case 12:throw new Error("The environment doesn't have sha256 function");case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),hmacSha256:function(){var e=Object(s.a)(o.a.mark((function e(t){var r,i,a,s,u,c,f,l,h,d,p,v=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=v.length,i=new Array(r>1?r-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E.BASE,r=t===E.BASE?t:new E(t.x,t.y);return r._setWindowSize(e),r.multiply(v),r}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DUMP_SESSION_KEYS=t.NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG=t.NOISE_MSG_MAX_LENGTH_BYTES=void 0,t.NOISE_MSG_MAX_LENGTH_BYTES=65535,t.NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG=t.NOISE_MSG_MAX_LENGTH_BYTES-16,t.DUMP_SESSION_KEYS=Object({NODE_ENV:"production",PUBLIC_URL:"/js-waku/eth-pm-wallet",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}).DUMP_SESSION_KEYS},function(e,t,r){"use strict";var n=r(0),i=r(45),o=r(44),a=r(30),s=function(){var e=o(n.mark((function e(t,r){var o,s,u,c,f,l,h;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=!0,s=!1,e.prev=2,c=a(t);case 4:return e.next=6,i(c.next());case 6:return f=e.sent,o=f.done,e.next=10,i(f.value);case 10:if(l=e.sent,o){e.next=21;break}return h=l,e.next=15,i(r(h));case 15:if(!e.sent){e.next=18;break}return e.next=18,h;case 18:o=!0,e.next=4;break;case 21:e.next=27;break;case 23:e.prev=23,e.t0=e.catch(2),s=!0,u=e.t0;case 27:if(e.prev=27,e.prev=28,o||null==c.return){e.next=32;break}return e.next=32,i(c.return());case 32:if(e.prev=32,!s){e.next=35;break}throw u;case 35:return e.finish(32);case 36:return e.finish(27);case 37:case"end":return e.stop()}}),e,null,[[2,23,27,37],[28,,32,36]])})));return function(t,r){return e.apply(this,arguments)}}();e.exports=s},function(e,t,r){"use strict";e.exports={DIAL_TIMEOUT:3e4,MAX_PARALLEL_DIALS:100,MAX_PER_PEER_DIALS:4,MAX_ADDRS_TO_DIAL:25,METRICS:{computeThrottleMaxQueueSize:1e3,computeThrottleTimeout:2e3,movingAverageIntervals:[6e4,3e5,9e5],maxOldPeersRetention:50}}},function(e,t,r){"use strict";e.exports={ADVERTISE_BOOT_DELAY:9e5,ADVERTISE_TTL:18e5,CIRCUIT_PROTO_CODE:290,HOP_METADATA_KEY:"hop_relay",HOP_METADATA_VALUE:"true",RELAY_RENDEZVOUS_NS:"/libp2p/relay"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.equals=function(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"utf8",r=n[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.encoder.encode(e).substring(1)}},function(e,t,r){"use strict";var n=r(0),i=r(86),o=r(6),a=r(79),s=r(95),u=r(60),c=r(15),f=r(472),l=r(452),h=f("\n");t.encode=function(e){return s.encode.single(new a([e,h]))},t.write=function(e,r){return e.push(t.encode(r))},t.writeAll=function(e,r){e.push(r.reduce((function(e,r){return e.append(t.encode(r))}),new a))},t.read=function(){var e=o(n.mark((function e(t){var r,o,a,f,d;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=1,i(r={},Symbol.asyncIterator,(function(){return this})),i(r,"next",(function(){return t.next(o)})),a=r,f=function(e){o=e},e.next=5,u(a,s.decode({onLength:f}),l);case 5:if((d=e.sent).get(d.length-1)===h[0]){e.next=8;break}throw c(new Error("missing newline"),"ERR_INVALID_MULTISTREAM_SELECT_MESSAGE");case 8:return e.abrupt("return",d.shallowSlice(0,-1));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},function(e,t,r){"use strict";var n=r(41),i=n.Reader,o=n.Writer,a=n.util,s=n.roots["libp2p-crypto-keys"]||(n.roots["libp2p-crypto-keys"]={});s.KeyType=function(){var e={},t=Object.create(e);return t[e[0]="RSA"]=0,t[e[1]="Ed25519"]=1,t[e[2]="Secp256k1"]=2,t}(),s.PublicKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw a.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw a.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof s.PublicKey)return e;var t=new s.PublicKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?a.base64.decode(e.Data,t.Data=a.newBuffer(a.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=a.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?s.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?a.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),s.PrivateKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw a.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw a.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof s.PrivateKey)return e;var t=new s.PrivateKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?a.base64.decode(e.Data,t.Data=a.newBuffer(a.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=a.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?s.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?a.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=s},function(e,t,r){"use strict";r(34),r(114);var n=r(18),i=r(119).fromString,o=r(120).toString,a=r(215).concat;t.bigIntegerToUintBase64url=function(e,t){var r=Uint8Array.from(e.abs().toByteArray());if(r=0===r[0]?r.slice(1):r,null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=a([new Uint8Array(t-r.length),r])}return o(r,"base64url")},t.base64urlToBigInteger=function(e){var r=t.base64urlToBuffer(e);return new n.jsbn.BigInteger(o(r,"base16"),16)},t.base64urlToBuffer=function(e,t){var r=i(e,"base64urlpad");if(null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=a([new Uint8Array(t-r.length),r])}return r}},function(e,t,r){"use strict";var n=r(0),i=r(6),o=r(63).base64,a=r(482);e.exports={export:function(){var e=i(n.mark((function e(t,r){var i,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.create(),e.next=3,i.encrypt(t,r);case 3:return s=e.sent,e.abrupt("return",o.encode(s));case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()}},,,function(e,t){e.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(x){}function n(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function i(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},a={};function s(e,t){var r,n,i;return t?(i=0<=(e>>>=0)&&e<256)&&(n=a[e])?n:(r=c(e,(0|e)<0?-1:0,!0),i&&(a[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=o[e])?n:(r=c(e,e<0?-1:0,!1),i&&(o[e]=r),r)}function u(e,t){if(isNaN(e))return t?g:b;if(t){if(e<0)return g;if(e>=p)return E}else{if(e<=-v)return _;if(e+1>=v)return S}return e<0?u(-e,t).neg():c(e%d|0,e/d|0,t)}function c(e,t,r){return new n(e,t,r)}n.fromInt=s,n.fromNumber=u,n.fromBits=c;var f=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return b;if("number"===typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||360)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var i=u(f(r,8)),o=b,a=0;a>>0:this.low},A.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},A.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((o=s).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},A.getHighBits=function(){return this.high},A.getHighBitsUnsigned=function(){return this.high>>>0},A.getLowBits=function(){return this.low},A.getLowBitsUnsigned=function(){return this.low>>>0},A.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},A.isOdd=function(){return 1===(1&this.low)},A.isEven=function(){return 0===(1&this.low)},A.equals=function(e){return i(e)||(e=h(e)),(this.unsigned===e.unsigned||this.high>>>31!==1||e.high>>>31!==1)&&(this.high===e.high&&this.low===e.low)},A.eq=A.equals,A.notEquals=function(e){return!this.eq(e)},A.neq=A.notEquals,A.ne=A.notEquals,A.lessThan=function(e){return this.comp(e)<0},A.lt=A.lessThan,A.lessThanOrEqual=function(e){return this.comp(e)<=0},A.lte=A.lessThanOrEqual,A.le=A.lessThanOrEqual,A.greaterThan=function(e){return this.comp(e)>0},A.gt=A.greaterThan,A.greaterThanOrEqual=function(e){return this.comp(e)>=0},A.gte=A.greaterThanOrEqual,A.ge=A.greaterThanOrEqual,A.compare=function(e){if(i(e)||(e=h(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},A.comp=A.compare,A.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add(m)},A.neg=A.negate,A.add=function(e){i(e)||(e=h(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,a=e.high>>>16,s=65535&e.high,u=e.low>>>16,f=0,l=0,d=0,p=0;return d+=(p+=o+(65535&e.low))>>>16,l+=(d+=n+u)>>>16,f+=(l+=r+s)>>>16,f+=t+a,c((d&=65535)<<16|(p&=65535),(f&=65535)<<16|(l&=65535),this.unsigned)},A.subtract=function(e){return i(e)||(e=h(e)),this.add(e.neg())},A.sub=A.subtract,A.multiply=function(e){if(this.isZero())return b;if(i(e)||(e=h(e)),r)return c(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return b;if(this.eq(_))return e.isOdd()?_:b;if(e.eq(_))return this.isOdd()?_:b;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(y)&&e.lt(y))return u(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,a=65535&this.low,s=e.high>>>16,f=65535&e.high,l=e.low>>>16,d=65535&e.low,p=0,v=0,g=0,m=0;return g+=(m+=a*d)>>>16,v+=(g+=o*d)>>>16,g&=65535,v+=(g+=a*l)>>>16,p+=(v+=n*d)>>>16,v&=65535,p+=(v+=o*l)>>>16,v&=65535,p+=(v+=a*f)>>>16,p+=t*d+n*l+o*f+a*s,c((g&=65535)<<16|(m&=65535),(p&=65535)<<16|(v&=65535),this.unsigned)},A.mul=A.multiply,A.divide=function(e){if(i(e)||(e=h(e)),e.isZero())throw Error("division by zero");var t,n,o;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?r.div_u:r.div_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?g:b;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return w;o=g}else{if(this.eq(_))return e.eq(m)||e.eq(k)?_:e.eq(_)?m:(t=this.shr(1).div(e).shl(1)).eq(b)?e.isNegative()?m:k:(n=this.sub(e.mul(t)),o=t.add(n.div(e)));if(e.eq(_))return this.unsigned?g:b;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=b}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(t)/Math.LN2),s=a<=48?1:f(2,a-48),l=u(t),d=l.mul(e);d.isNegative()||d.gt(n);)d=(l=u(t-=s,this.unsigned)).mul(e);l.isZero()&&(l=m),o=o.add(l),n=n.sub(d)}return o},A.div=A.divide,A.modulo=function(e){return i(e)||(e=h(e)),r?c((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},A.mod=A.modulo,A.rem=A.modulo,A.not=function(){return c(~this.low,~this.high,this.unsigned)},A.and=function(e){return i(e)||(e=h(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},A.or=function(e){return i(e)||(e=h(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},A.xor=function(e){return i(e)||(e=h(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},A.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0===(e&=63)?this:e<32?c(this.low<>>32-e,this.unsigned):c(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},A.shr=A.shiftRight,A.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},A.shru=A.shiftRightUnsigned,A.shr_u=A.shiftRightUnsigned,A.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},A.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},A.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},A.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},A.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},,function(e,t,r){"use strict";t.codes={ERR_INVALID_SIGNATURE_POLICY:"ERR_INVALID_SIGNATURE_POLICY",ERR_UNHANDLED_SIGNATURE_POLICY:"ERR_UNHANDLED_SIGNATURE_POLICY",ERR_MISSING_SIGNATURE:"ERR_MISSING_SIGNATURE",ERR_MISSING_SEQNO:"ERR_MISSING_SEQNO",ERR_INVALID_SIGNATURE:"ERR_INVALID_SIGNATURE",ERR_UNEXPECTED_FROM:"ERR_UNEXPECTED_FROM",ERR_UNEXPECTED_SIGNATURE:"ERR_UNEXPECTED_SIGNATURE",ERR_UNEXPECTED_KEY:"ERR_UNEXPECTED_KEY",ERR_UNEXPECTED_SEQNO:"ERR_UNEXPECTED_SEQNO"}},function(e,t,r){"use strict";var n=r(205),i=r(15);e.exports=function(e){if(isNaN(e)||e<=0)throw i(new Error("random bytes length must be a Number bigger than 0"),"ERR_INVALID_LENGTH");return n(e)}},function(e,t,r){"use strict";var n=r(41),i=n.Reader,o=n.Writer,a=n.util,s=n.roots["libp2p-crypto-keys"]||(n.roots["libp2p-crypto-keys"]={});s.KeyType=function(){var e={},t=Object.create(e);return t[e[0]="RSA"]=0,t[e[1]="Ed25519"]=1,t[e[2]="Secp256k1"]=2,t}(),s.PublicKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw a.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw a.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof s.PublicKey)return e;var t=new s.PublicKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?a.base64.decode(e.Data,t.Data=a.newBuffer(a.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=a.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?s.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?a.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),s.PrivateKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw a.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw a.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof s.PrivateKey)return e;var t=new s.PrivateKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?a.base64.decode(e.Data,t.Data=a.newBuffer(a.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=a.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?s.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?a.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=s},function(e,t,r){"use strict";r(34),r(114);var n=r(18),i=r(96).fromString,o=r(85).toString,a=r(180).concat;t.bigIntegerToUintBase64url=function(e,t){var r=Uint8Array.from(e.abs().toByteArray());if(r=0===r[0]?r.slice(1):r,null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=a([new Uint8Array(t-r.length),r])}return o(r,"base64url")},t.base64urlToBigInteger=function(e){var r=t.base64urlToBuffer(e);return new n.jsbn.BigInteger(o(r,"base16"),16)},t.base64urlToBuffer=function(e,t){var r=i(e,"base64urlpad");if(null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=a([new Uint8Array(t-r.length),r])}return r}},function(e,t,r){"use strict";var n=r(0),i=r(6),o=r(63).base64,a=r(494);e.exports={export:function(){var e=i(n.mark((function e(t,r){var i,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.create(),e.next=3,i.encrypt(t,r);case 3:return s=e.sent,e.abrupt("return",o.encode(s));case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()}},,function(e,t,r){"use strict";e.exports=r(1067)},function(e,t,r){"use strict";r.r(t),r.d(t,"batch",(function(){return k})),r.d(t,"buffer",(function(){return A})),r.d(t,"collect",(function(){return T})),r.d(t,"concat",(function(){return I})),r.d(t,"consume",(function(){return R})),r.d(t,"filter",(function(){return N})),r.d(t,"flatMap",(function(){return z})),r.d(t,"flatTransform",(function(){return V})),r.d(t,"flatten",(function(){return L})),r.d(t,"fromStream",(function(){return G})),r.d(t,"getIterator",(function(){return S})),r.d(t,"map",(function(){return K})),r.d(t,"merge",(function(){return X})),r.d(t,"parallelFlatMap",(function(){return $})),r.d(t,"parallelMap",(function(){return Q})),r.d(t,"parallelMerge",(function(){return ee})),r.d(t,"pipeline",(function(){return Z})),r.d(t,"reduce",(function(){return ie})),r.d(t,"take",(function(){return se})),r.d(t,"tap",(function(){return fe})),r.d(t,"time",(function(){return ve})),r.d(t,"transform",(function(){return ye})),r.d(t,"writeToStream",(function(){return me}));var n=r(51);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(25),a=r(74),s=r(0);function u(e,t){var r={},n=!1;function i(r,i){return n=!0,i=new Promise((function(t){t(e[r](i))})),{done:!1,value:t(i)}}return"function"===typeof Symbol&&Symbol.iterator&&(r[Symbol.iterator]=function(){return this}),r.next=function(e){return n?(n=!1,e):i("next",e)},"function"===typeof e.throw&&(r.throw=function(e){if(n)throw n=!1,e;return i("throw",e)}),"function"===typeof e.return&&(r.return=function(e){return n?(n=!1,e):i("return",e)}),r}function c(e){this.wrapped=e}function f(e){return new c(e)}function l(e){var t,r;function n(t,r){try{var o=e[t](r),a=o.value,s=a instanceof c;Promise.resolve(s?a.wrapped:a).then((function(e){s?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(u){i("throw",u)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null};r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!==typeof e.return&&(this.return=void 0)}function h(e){return function(){return new l(e.apply(this,arguments))}}function d(e){var t;if("undefined"!==typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}"function"===typeof Symbol&&Symbol.asyncIterator&&(l.prototype[Symbol.asyncIterator]=function(){return this}),l.prototype.next=function(e){return this._invoke("next",e)},l.prototype.throw=function(e){return this._invoke("throw",e)},l.prototype.return=function(e){return this._invoke("return",e)};var p=s.mark(w),v=s.mark(_),y=s.mark(O),b=s.mark(ae),g=s.mark(pe);function m(){return(m=h(s.mark((function e(t,r){var n,i,o,a,u,c,l,h;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],i=!0,o=!1,e.prev=3,u=d(r);case 5:return e.next=7,f(u.next());case 7:return c=e.sent,i=c.done,e.next=11,f(c.value);case 11:if(l=e.sent,i){e.next=22;break}if(h=l,n.push(h),n.length!==t){e.next=19;break}return e.next=18,n;case 18:n=[];case 19:i=!0,e.next=5;break;case 22:e.next=28;break;case 24:e.prev=24,e.t0=e.catch(3),o=!0,a=e.t0;case 28:if(e.prev=28,e.prev=29,i||null==u.return){e.next=33;break}return e.next=33,f(u.return());case 33:if(e.prev=33,!o){e.next=36;break}throw a;case 36:return e.finish(33);case 37:return e.finish(28);case 38:if(!(n.length>0)){e.next=41;break}return e.next=41,n;case 41:case"end":return e.stop()}}),e,null,[[3,24,28,38],[29,,33,37]])})))).apply(this,arguments)}function w(e,t){var r,n,i,o;return s.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:r=[],n=Object(a.a)(t),s.prev=2,n.s();case 4:if((i=n.n()).done){s.next=13;break}if(o=i.value,r.push(o),r.length!==e){s.next=11;break}return s.next=10,r;case 10:r=[];case 11:s.next=4;break;case 13:s.next=18;break;case 15:s.prev=15,s.t0=s.catch(2),n.e(s.t0);case 18:return s.prev=18,n.f(),s.finish(18);case 21:if(!(r.length>0)){s.next=24;break}return s.next=24,r;case 24:case"end":return s.stop()}}),p,null,[[2,15,18,21]])}function k(e,t){return void 0===t?function(t){return k(e,t)}:t[Symbol.asyncIterator]?function(e,t){return m.apply(this,arguments)}(e,t):w(e,t)}function S(e){if("function"===typeof e.next)return e;if("function"===typeof e[Symbol.iterator])return e[Symbol.iterator]();if("function"===typeof e[Symbol.asyncIterator])return e[Symbol.asyncIterator]();throw new TypeError('"values" does not to conform to any of the iterator or iterable protocols')}function E(){var e,t;return{promise:new Promise((function(r,n){t=r,e=n})),reject:e,resolve:t}}function _(e,t){var r,n,i,o,u,c,f,l;return s.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:r=[],s.prev=1,i=Object(a.a)(t),s.prev=3,i.s();case 5:if((o=i.n()).done){s.next=14;break}if(u=o.value,r.push(u),!(r.length<=e)){s.next=10;break}return s.abrupt("continue",12);case 10:return s.next=12,r.shift();case 12:s.next=5;break;case 14:s.next=19;break;case 16:s.prev=16,s.t0=s.catch(3),i.e(s.t0);case 19:return s.prev=19,i.f(),s.finish(19);case 22:s.next=27;break;case 24:s.prev=24,s.t1=s.catch(1),n=s.t1;case 27:c=0,f=r;case 28:if(!(c0&&n.length>0;){var e=a.shift(),t=n.shift(),r=t.error,i=t.value;r?e.reject(r):e.resolve({done:!1,value:i})}for(;a.length>0&&c;)(0,a.shift().resolve)({done:!0,value:void 0})}function l(){return h.apply(this,arguments)}function h(){return(h=Object(o.a)(s.mark((function t(){var i,o,a;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!c){t.next=2;break}return t.abrupt("return");case 2:if(!u){t.next=4;break}return t.abrupt("return");case 4:if(!(n.length>=e)){t.next=6;break}return t.abrupt("return");case 6:return u=!0,t.prev=7,t.next=10,r.next();case 10:i=t.sent,o=i.done,a=i.value,o?c=!0:n.push({value:a}),t.next=20;break;case 16:t.prev=16,t.t0=t.catch(7),c=!0,n.push({error:t.t0});case 20:f(),u=!1,l();case 23:case"end":return t.stop()}}),t,null,[[7,16]])})))).apply(this,arguments)}function d(){return(d=Object(o.a)(s.mark((function e(){var t,r,i,o;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n.length>0)){e.next=6;break}if(t=n.shift(),r=t.error,i=t.value,!r){e.next=4;break}throw r;case 4:return l(),e.abrupt("return",{done:!1,value:i});case 6:if(!c){e.next=8;break}return e.abrupt("return",{done:!0,value:void 0});case 8:return o=E(),a.push(o),l(),e.abrupt("return",o.promise);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var p=i({next:function(){return d.apply(this,arguments)}},Symbol.asyncIterator,(function(){return p}));return p}(e,t):_(e,t)}function x(){return(x=Object(o.a)(s.mark((function e(t){var r,n,i,o,a,u,c,f;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=[],n=!0,i=!1,e.prev=3,a=d(t);case 5:return e.next=7,a.next();case 7:return u=e.sent,n=u.done,e.next=11,u.value;case 11:if(c=e.sent,n){e.next=18;break}f=c,r.push(f);case 15:n=!0,e.next=5;break;case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(3),i=!0,o=e.t0;case 24:if(e.prev=24,e.prev=25,n||null==a.return){e.next=29;break}return e.next=29,a.return();case 29:if(e.prev=29,!i){e.next=32;break}throw o;case 32:return e.finish(29);case 33:return e.finish(24);case 34:return e.abrupt("return",r);case 35:case"end":return e.stop()}}),e,null,[[3,20,24,34],[25,,29,33]])})))).apply(this,arguments)}function T(e){return e[Symbol.asyncIterator]?function(e){return x.apply(this,arguments)}(e):Array.from(e)}function M(e){return C.apply(this,arguments)}function C(){return(C=h(s.mark((function e(t){var r,n,i,o,a,c,l;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=!0,n=!1,e.prev=2,o=d(t);case 4:return e.next=6,f(o.next());case 6:return a=e.sent,r=a.done,e.next=10,f(a.value);case 10:if(c=e.sent,r){e.next=17;break}return l=c,e.delegateYield(u(d(l),f),"t0",14);case 14:r=!0,e.next=4;break;case 17:e.next=23;break;case 19:e.prev=19,e.t1=e.catch(2),n=!0,i=e.t1;case 23:if(e.prev=23,e.prev=24,r||null==o.return){e.next=28;break}return e.next=28,f(o.return());case 28:if(e.prev=28,!n){e.next=31;break}throw i;case 31:return e.finish(28);case 32:return e.finish(23);case 33:case"end":return e.stop()}}),e,null,[[2,19,23,33],[24,,28,32]])})))).apply(this,arguments)}function O(e){var t,r,n;return s.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:t=Object(a.a)(e),i.prev=1,t.s();case 3:if((r=t.n()).done){i.next=8;break}return n=r.value,i.delegateYield(n,"t0",6);case 6:i.next=3;break;case 8:i.next=13;break;case 10:i.prev=10,i.t1=i.catch(1),t.e(i.t1);case 13:return i.prev=13,t.f(),i.finish(13);case 16:case"end":return i.stop()}}),y,null,[[1,10,13,16]])}function I(){for(var e=arguments.length,t=new Array(e),r=0;r0&&a.length>0;)(0,u.shift().resolve)({done:!1,value:a.shift()});for(;u.length>0&&0===l&&c;){var e=u.shift(),t=e.resolve,r=e.reject;h?(r(h),h=null):t({done:!0,value:void 0})}}function v(){return y.apply(this,arguments)}function y(){return(y=Object(o.a)(s.mark((function t(){var r,i,o;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!c){t.next=3;break}return p(),t.abrupt("return");case 3:if(!f){t.next=5;break}return t.abrupt("return");case 5:if(!(l+a.length>=e)){t.next=7;break}return t.abrupt("return");case 7:return f=!0,l++,t.prev=9,t.next=12,n.next();case 12:r=t.sent,i=r.done,o=r.value,i?(c=!0,l--,p()):b(o),t.next=24;break;case 18:t.prev=18,t.t0=t.catch(9),c=!0,l--,h=t.t0,p();case 24:f=!1,v();case 26:case"end":return t.stop()}}),t,null,[[9,18]])})))).apply(this,arguments)}function b(e){return g.apply(this,arguments)}function g(){return(g=Object(o.a)(s.mark((function e(r){var n,i,o,u,f,y,b,g;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(r);case 3:if(!(n=e.sent)||!n[Symbol.asyncIterator]){e.next=40;break}i=!0,o=!1,e.prev=7,f=d(n);case 9:return e.next=11,f.next();case 11:return y=e.sent,i=y.done,e.next=15,y.value;case 15:if(b=e.sent,i){e.next=22;break}g=b,a.push(g);case 19:i=!0,e.next=9;break;case 22:e.next=28;break;case 24:e.prev=24,e.t0=e.catch(7),o=!0,u=e.t0;case 28:if(e.prev=28,e.prev=29,i||null==f.return){e.next=33;break}return e.next=33,f.return();case 33:if(e.prev=33,!o){e.next=36;break}throw u;case 36:return e.finish(33);case 37:return e.finish(28);case 38:e.next=41;break;case 40:a.push(n);case 41:e.next=47;break;case 43:e.prev=43,e.t1=e.catch(0),c=!0,h=e.t1;case 47:l--,p(),v();case 50:case"end":return e.stop()}}),e,null,[[0,43],[7,24,28,38],[29,,33,37]])})))).apply(this,arguments)}function m(){return(m=Object(o.a)(s.mark((function e(){var t,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==a.length){e.next=5;break}return t=E(),u.push(t),v(),e.abrupt("return",t.promise);case 5:return r=a.shift(),v(),e.abrupt("return",{done:!1,value:r});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var w=i({next:function(){return m.apply(this,arguments)}},Symbol.asyncIterator,(function(){return w}));return w}(e,t,r)))}function H(e){return J.apply(this,arguments)}function J(){return(J=Object(o.a)(s.mark((function e(t){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){t.once("readable",(function(){e()}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function q(){return(q=h(s.mark((function e(t){var r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(r=t.read())){e.next=6;break}return e.next=5,r;case 5:return e.abrupt("continue",0);case 6:if(!t._readableState.ended){e.next=8;break}return e.abrupt("break",12);case 8:return e.next=10,f(H(t));case 10:e.next=0;break;case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G(e){return"function"===typeof e[Symbol.asyncIterator]?e:function(e){return q.apply(this,arguments)}(e)}function X(){return W.apply(this,arguments)}function W(){return(W=h(s.mark((function e(){var t,r,n,i,o,u,c,l,h=arguments;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=h.length,r=new Array(t),n=0;n0)){e.next=29;break}o=Object(a.a)(i),e.prev=4,o.s();case 6:if((u=o.n()).done){e.next=19;break}return c=u.value,e.next=10,f(c.next());case 10:if(!(l=e.sent).done){e.next=15;break}i.delete(c),e.next=17;break;case 15:return e.next=17,l.value;case 17:e.next=6;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(4),o.e(e.t0);case 24:return e.prev=24,o.f(),e.finish(24);case 27:e.next=2;break;case 29:case"end":return e.stop()}}),e,null,[[4,21,24,27]])})))).apply(this,arguments)}function Z(e){for(var t=e(),r=arguments.length,n=new Array(r>1?r-1:0),i=1;i0)return e();p=e,d=t}))},g=function(e){var t=Promise.resolve(e.next()).then(function(){var r=Object(o.a)(s.mark((function r(n){var i,o;return s.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:i=n.done,o=n.value,i||l.set(e,o),c.delete(t);case 3:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}());c.add(t),t.then(y,v)},m=Object(a.a)(u);try{for(m.s();!(w=m.n()).done;)k=w.value,g(k)}catch(C){m.e(C)}finally{m.f()}case 13:if(0!==c.size||0!==l.size){e.next=16;break}return e.abrupt("return");case 16:return e.next=18,f(b());case 18:E=Object(a.a)(l),e.prev=19,E.s();case 21:if((_=E.n()).done){e.next=29;break}return A=Object(n.a)(_.value,2),x=A[0],T=A[1],l.delete(x),e.next=26,T;case 26:g(x);case 27:e.next=21;break;case 29:e.next=34;break;case 31:e.prev=31,e.t0=e.catch(19),E.e(e.t0);case 34:return e.prev=34,E.f(),e.finish(34);case 37:e.next=13;break;case 39:case"end":return e.stop()}}),e,null,[[19,31,34,37]])})))).apply(this,arguments)}function re(e,t,r){return ne.apply(this,arguments)}function ne(){return(ne=Object(o.a)(s.mark((function e(t,r,n){var i,o,a,u,c,f,l,h;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=r,o=!0,a=!1,e.prev=3,c=d(n);case 5:return e.next=7,c.next();case 7:return f=e.sent,o=f.done,e.next=11,f.value;case 11:if(l=e.sent,o){e.next=20;break}return h=l,e.next=16,t(i,h);case 16:i=e.sent;case 17:o=!0,e.next=5;break;case 20:e.next=26;break;case 22:e.prev=22,e.t0=e.catch(3),a=!0,u=e.t0;case 26:if(e.prev=26,e.prev=27,o||null==c.return){e.next=31;break}return e.next=31,c.return();case 31:if(e.prev=31,!a){e.next=34;break}throw u;case 34:return e.finish(31);case 35:return e.finish(26);case 36:return e.abrupt("return",i);case 37:case"end":return e.stop()}}),e,null,[[3,22,26,36],[27,,31,35]])})))).apply(this,arguments)}function ie(e,t,r){return void 0===t?function(t,r){return r?re(e,t,r):ie(e,t)}:void 0===r?function(r){return ie(e,t,r)}:re(e,t,r)}function oe(){return(oe=h(s.mark((function e(t,r){var n,i,o,a,u,c,l,h;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0,i=!0,o=!1,e.prev=3,u=d(r);case 5:return e.next=7,f(u.next());case 7:return c=e.sent,i=c.done,e.next=11,f(c.value);case 11:if(l=e.sent,i){e.next=22;break}return h=l,e.next=16,h;case 16:if(!(++n>=t)){e.next=19;break}return e.abrupt("break",22);case 19:i=!0,e.next=5;break;case 22:e.next=28;break;case 24:e.prev=24,e.t0=e.catch(3),o=!0,a=e.t0;case 28:if(e.prev=28,e.prev=29,i||null==u.return){e.next=33;break}return e.next=33,f(u.return());case 33:if(e.prev=33,!o){e.next=36;break}throw a;case 36:return e.finish(33);case 37:return e.finish(28);case 38:case"end":return e.stop()}}),e,null,[[3,24,28,38],[29,,33,37]])})))).apply(this,arguments)}function ae(e,t){var r,n,i,o;return s.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:r=0,n=Object(a.a)(t),s.prev=2,n.s();case 4:if((i=n.n()).done){s.next=13;break}return o=i.value,s.next=8,o;case 8:if(!(++r>=e)){s.next=11;break}return s.abrupt("break",13);case 11:s.next=4;break;case 13:s.next=18;break;case 15:s.prev=15,s.t0=s.catch(2),n.e(s.t0);case 18:return s.prev=18,n.f(),s.finish(18);case 21:case"end":return s.stop()}}),b,null,[[2,15,18,21]])}function se(e,t){return void 0===t?function(t){return se(e,t)}:t[Symbol.asyncIterator]?function(e,t){return oe.apply(this,arguments)}(e,t):ae(e,t)}function ue(e,t){return ce.apply(this,arguments)}function ce(){return(ce=h(s.mark((function e(t,r){var n,i,o,a,u,c,l;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!0,i=!1,e.prev=2,a=d(r);case 4:return e.next=6,f(a.next());case 6:return u=e.sent,n=u.done,e.next=10,f(u.value);case 10:if(c=e.sent,n){e.next=20;break}return l=c,e.next=15,f(t(l));case 15:return e.next=17,l;case 17:n=!0,e.next=4;break;case 20:e.next=26;break;case 22:e.prev=22,e.t0=e.catch(2),i=!0,o=e.t0;case 26:if(e.prev=26,e.prev=27,n||null==a.return){e.next=31;break}return e.next=31,f(a.return());case 31:if(e.prev=31,!i){e.next=34;break}throw o;case 34:return e.finish(31);case 35:return e.finish(26);case 36:case"end":return e.stop()}}),e,null,[[2,22,26,36],[27,,31,35]])})))).apply(this,arguments)}function fe(e,t){return void 0===t?function(t){return ue(e,t)}:ue(e,t)}function le(e,t){var r=e[0]+t[0],n=e[1]+t[1];if(n>=1e9){var i=n%1e9;r+=(n-i)/1e9,n=i}return[r,n]}function he(e,t){return de.apply(this,arguments)}function de(){return(de=h(s.mark((function e(t,r){var n,i,o,a,u,c,l;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r[Symbol.asyncIterator](),i=[0,0];case 2:return o=process.hrtime(),e.next=6,f(n.next());case 6:if(a=e.sent,u=a.value,c=a.done,l=process.hrtime(o),i=le(i,l),t.progress&&t.progress(l,i),!c){e.next=15;break}return t.total&&t.total(i),e.abrupt("return",u);case 15:return e.next=17,u;case 17:e.next=2;break;case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pe(e,t){var r,n,i,o,a,u,c;return s.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:r=t[Symbol.iterator](),n=[0,0];case 2:if(i=process.hrtime(),o=r.next(),a=o.value,u=o.done,c=process.hrtime(i),n=le(n,c),e.progress&&e.progress(c,n),!u){s.next=11;break}return e.total&&e.total(n),s.abrupt("return",a);case 11:return s.next=13,a;case 13:s.next=2;break;case 15:case"end":return s.stop()}}),g)}function ve(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return void 0===t?function(t){return ve(e,t)}:void 0!==t[Symbol.asyncIterator]?he(e,t):pe(e,t)}function ye(e,t,r){return void 0===t?function(t,r){return r?ye(e,t,r):ye(e,t)}:void 0===r?function(r){return ye(e,t,r)}:function(e,t,r){var n=S(r),a=[],u=[],c=!1,f=!1,l=0,h=null;function d(){for(;u.length>0&&a.length>0;)(0,u.shift().resolve)({done:!1,value:a.shift()});for(;u.length>0&&0===l&&c;){var e=u.shift(),t=e.resolve,r=e.reject;h?(r(h),h=null):t({done:!0,value:void 0})}}function p(){return v.apply(this,arguments)}function v(){return(v=Object(o.a)(s.mark((function t(){var r,i,o;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!c){t.next=3;break}return d(),t.abrupt("return");case 3:if(!f){t.next=5;break}return t.abrupt("return");case 5:if(!(l+a.length>=e)){t.next=7;break}return t.abrupt("return");case 7:return f=!0,l++,t.prev=9,t.next=12,n.next();case 12:r=t.sent,i=r.done,o=r.value,i?(c=!0,l--,d()):y(o),t.next=24;break;case 18:t.prev=18,t.t0=t.catch(9),c=!0,l--,h=t.t0,d();case 24:f=!1,p();case 26:case"end":return t.stop()}}),t,null,[[9,18]])})))).apply(this,arguments)}function y(e){return b.apply(this,arguments)}function b(){return(b=Object(o.a)(s.mark((function e(r){var n;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(r);case 3:n=e.sent,a.push(n),e.next=11;break;case 7:e.prev=7,e.t0=e.catch(0),c=!0,h=e.t0;case 11:l--,d(),p();case 14:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function g(){return(g=Object(o.a)(s.mark((function e(){var t,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==a.length){e.next=5;break}return t=E(),u.push(t),p(),e.abrupt("return",t.promise);case 5:return r=a.shift(),p(),e.abrupt("return",{done:!1,value:r});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var m=i({next:function(){return g.apply(this,arguments)}},Symbol.asyncIterator,(function(){return m}));return m}(e,t,r)}function be(e,t){return ge.apply(this,arguments)}function ge(){return(ge=Object(o.a)(s.mark((function e(t,r){var n,i,o,a,u,c,f,l,h,p,v,y,b,g;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=null,i=null,o=null,a=function(e){n=e,i&&i(e)},u=function(){o&&o()},c=function(){t.removeListener("error",a),t.removeListener("drain",u)},t.once("error",a),f=function(){return new Promise((function(e,r){if(n)return r(n);t.once("drain",u),o=e,i=r}))},l=!0,h=!1,e.prev=10,v=d(r);case 12:return e.next=14,v.next();case 14:return y=e.sent,l=y.done,e.next=18,y.value;case 18:if(b=e.sent,l){e.next=29;break}if(g=b,!1!==t.write(g)){e.next=24;break}return e.next=24,f();case 24:if(!n){e.next=26;break}return e.abrupt("break",29);case 26:l=!0,e.next=12;break;case 29:e.next=35;break;case 31:e.prev=31,e.t0=e.catch(10),h=!0,p=e.t0;case 35:if(e.prev=35,e.prev=36,l||null==v.return){e.next=40;break}return e.next=40,v.return();case 40:if(e.prev=40,!h){e.next=43;break}throw p;case 43:return e.finish(40);case 44:return e.finish(35);case 45:if(c(),!n){e.next=48;break}throw n;case 48:case"end":return e.stop()}}),e,null,[[10,31,35,45],[36,,40,44]])})))).apply(this,arguments)}function me(e,t){return void 0===t?function(t){return be(e,t)}:be(e,t)}},function(e,t,r){"use strict";for(var n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",i={},o=0;o>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 u(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=s(t)^n>>5}for(t=s(t),r=0;rt)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var o=(e=r).lastIndexOf("1");if(-1===o)return"No separator character for "+e;if(0===o)return"Missing prefix for "+e;var a=e.slice(0,o),c=e.slice(o+1);if(c.length<6)return"Data too short";var f=u(a);if("string"===typeof f)return f;for(var l=[],h=0;h=c.length||l.push(p)}return 1!==f?"Invalid checksum for "+e:{prefix:a,words:l}}function f(e,t,r,n){for(var i=0,o=0,a=(1<=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<=t)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var i=u(e=e.toLowerCase());if("string"===typeof i)throw new Error(i);for(var o=e+"1",a=0;a>5!==0)throw new Error("Non 5-bit word");i=s(i)^c,o+=n.charAt(c)}for(a=0;a<6;++a)i=s(i);for(i^=1,a=0;a<6;++a){o+=n.charAt(i>>5*(5-a)&31)}return o},toWordsUnsafe:function(e){var t=f(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=f(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=f(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=f(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},function(e,t,r){"use strict";var n=r(4),i=r(12),o=r(1),a=r.n(o),s=(r(24),r(38)),u=r(16),c=r(35),f=r(70),l=r(19),h=r(222),d=r(102),p=r(100),v=r(184),y=r(124),b=r(148);function g(e,t){var r=Object.create(null);return e&&o.Children.map(e,(function(e){return e})).forEach((function(e){r[e.key]=function(e){return t&&Object(o.isValidElement)(e)?t(e):e}(e)})),r}function m(e,t,r){return null!=r[t]?r[t]:e.props[t]}function w(e,t,r){var n=g(e.children),i=function(e,t){function r(r){return r in t?t[r]:e[r]}e=e||{},t=t||{};var n,i=Object.create(null),o=[];for(var a in e)a in t?o.length&&(i[a]=o,o=[]):o.push(a);var s={};for(var u in t){if(i[u])for(n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=t.pulsate,i=void 0!==n&&n,o=t.center,s=void 0===o?a||t.pulsate:o,u=t.fakeElement,c=void 0!==u&&u;if("mousedown"===e.type&&b.current)b.current=!1;else{"touchstart"===e.type&&(b.current=!0);var f,l,h,d=c?null:w.current,p=d?d.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)f=Math.round(p.width/2),l=Math.round(p.height/2);else{var v=e.touches?e.touches[0]:e,y=v.clientX,S=v.clientY;f=Math.round(y-p.left),l=Math.round(S-p.top)}if(s)(h=Math.sqrt((2*Math.pow(p.width,2)+Math.pow(p.height,2))/3))%2===0&&(h+=1);else{var E=2*Math.max(Math.abs((d?d.clientWidth:0)-f),f)+2,_=2*Math.max(Math.abs((d?d.clientHeight:0)-l),l)+2;h=Math.sqrt(Math.pow(E,2)+Math.pow(_,2))}e.touches?null===m.current&&(m.current=function(){k({pulsate:i,rippleX:f,rippleY:l,rippleSize:h,cb:r})},g.current=setTimeout((function(){m.current&&(m.current(),m.current=null)}),80)):k({pulsate:i,rippleX:f,rippleY:l,rippleSize:h,cb:r})}}),[a,k]),_=o.useCallback((function(){S({},{pulsate:!0})}),[S]),x=o.useCallback((function(e,t){if(clearTimeout(g.current),"touchend"===e.type&&m.current)return e.persist(),m.current(),m.current=null,void(g.current=setTimeout((function(){x(e,t)})));m.current=null,p((function(e){return e.length>0?e.slice(1):e})),y.current=t}),[]);return o.useImperativeHandle(t,(function(){return{pulsate:_,start:S,stop:x}}),[_,S,x]),o.createElement("span",Object(n.a)({className:Object(u.a)(s.root,c),ref:w},f),o.createElement(E,{component:null,exit:!0},h))})),T=Object(l.a)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(o.memo(x)),M=o.forwardRef((function(e,t){var r=e.action,a=e.buttonRef,l=e.centerRipple,d=void 0!==l&&l,p=e.children,v=e.classes,y=e.className,b=e.component,g=void 0===b?"button":b,m=e.disabled,w=void 0!==m&&m,k=e.disableRipple,S=void 0!==k&&k,E=e.disableTouchRipple,_=void 0!==E&&E,A=e.focusRipple,x=void 0!==A&&A,M=e.focusVisibleClassName,C=e.onBlur,O=e.onClick,I=e.onFocus,P=e.onFocusVisible,R=e.onKeyDown,B=e.onKeyUp,D=e.onMouseDown,N=e.onMouseLeave,L=e.onMouseUp,j=e.onTouchEnd,U=e.onTouchMove,F=e.onTouchStart,K=e.onDragLeave,z=e.tabIndex,V=void 0===z?0:z,H=e.TouchRippleProps,J=e.type,q=void 0===J?"button":J,G=Object(i.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),X=o.useRef(null);var W=o.useRef(null),Z=o.useState(!1),Y=Z[0],Q=Z[1];w&&Y&&Q(!1);var $=Object(h.a)(),ee=$.isFocusVisible,te=$.onBlurVisible,re=$.ref;function ne(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_;return Object(f.a)((function(n){return t&&t(n),!r&&W.current&&W.current[e](n),!0}))}o.useImperativeHandle(r,(function(){return{focusVisible:function(){Q(!0),X.current.focus()}}}),[]),o.useEffect((function(){Y&&x&&!S&&W.current.pulsate()}),[S,x,Y]);var ie=ne("start",D),oe=ne("stop",K),ae=ne("stop",L),se=ne("stop",(function(e){Y&&e.preventDefault(),N&&N(e)})),ue=ne("start",F),ce=ne("stop",j),fe=ne("stop",U),le=ne("stop",(function(e){Y&&(te(e),Q(!1)),C&&C(e)}),!1),he=Object(f.a)((function(e){X.current||(X.current=e.currentTarget),ee(e)&&(Q(!0),P&&P(e)),I&&I(e)})),de=function(){var e=s.findDOMNode(X.current);return g&&"button"!==g&&!("A"===e.tagName&&e.href)},pe=o.useRef(!1),ve=Object(f.a)((function(e){x&&!pe.current&&Y&&W.current&&" "===e.key&&(pe.current=!0,e.persist(),W.current.stop(e,(function(){W.current.start(e)}))),e.target===e.currentTarget&&de()&&" "===e.key&&e.preventDefault(),R&&R(e),e.target===e.currentTarget&&de()&&"Enter"===e.key&&!w&&(e.preventDefault(),O&&O(e))})),ye=Object(f.a)((function(e){x&&" "===e.key&&W.current&&Y&&!e.defaultPrevented&&(pe.current=!1,e.persist(),W.current.stop(e,(function(){W.current.pulsate(e)}))),B&&B(e),O&&e.target===e.currentTarget&&de()&&" "===e.key&&!e.defaultPrevented&&O(e)})),be=g;"button"===be&&G.href&&(be="a");var ge={};"button"===be?(ge.type=q,ge.disabled=w):("a"===be&&G.href||(ge.role="button"),ge["aria-disabled"]=w);var me=Object(c.a)(a,t),we=Object(c.a)(re,X),ke=Object(c.a)(me,we),Se=o.useState(!1),Ee=Se[0],_e=Se[1];o.useEffect((function(){_e(!0)}),[]);var Ae=Ee&&!S&&!w;return o.createElement(be,Object(n.a)({className:Object(u.a)(v.root,y,Y&&[v.focusVisible,M],w&&v.disabled),onBlur:le,onClick:O,onFocus:he,onKeyDown:ve,onKeyUp:ye,onMouseDown:ie,onMouseLeave:se,onMouseUp:ae,onDragLeave:oe,onTouchEnd:ce,onTouchMove:fe,onTouchStart:ue,ref:ke,tabIndex:w?-1:V},ge,G),p,Ae?o.createElement(T,Object(n.a)({ref:W,center:d},H)):null)}));t.a=Object(l.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(M)},,,,,,function(e,t,r){(function(e){!function(t){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof e?e:"undefined"!=typeof self?self:{};function n(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((void 0===t||null===t)&&r.path)}},r.exports),r.exports}var i=n((function(e){!function(t){for(var r=[null,0,{}],n=10,i=44032,o=4352,a=4449,s=4519,u=19,c=21,f=28,l=c*f,h=u*l,d=function(e,t){this.codepoint=e,this.feature=t},p={},v=[],y=0;y<=255;++y)v[y]=0;var b=[function(e,t,n){return t<60||13311>8&255]>n&&(p[t]=i),i},function(e,t,r){return r?e(t,r):new d(t,null)},function(e,t,r){var n;if(t=55296&&e<=56319},d.isLowSurrogate=function(e){return e>=56320&&e<=57343},d.prototype.prepFeature=function(){this.feature||(this.feature=d.fromCharCode(this.codepoint,!0).feature)},d.prototype.toString=function(){if(this.codepoint<65536)return String.fromCharCode(this.codepoint);var e=this.codepoint-65536;return String.fromCharCode(Math.floor(e/1024)+55296,e%1024+56320)},d.prototype.getDecomp=function(){return this.prepFeature(),this.feature[0]||null},d.prototype.isCompatibility=function(){return this.prepFeature(),!!this.feature[1]&&256&this.feature[1]},d.prototype.isExclude=function(){return this.prepFeature(),!!this.feature[1]&&512&this.feature[1]},d.prototype.getCanonicalClass=function(){return this.prepFeature(),this.feature[1]?255&this.feature[1]:0},d.prototype.getComposite=function(e){if(this.prepFeature(),!this.feature[2])return null;var t=this.feature[2][e.codepoint];return t?d.fromCharCode(t):null};var g=function(e){this.str=e,this.cursor=0};g.prototype.next=function(){if(this.str&&this.cursor0&&!(this.resBuf[r-1].getCanonicalClass()<=e);--r);this.resBuf.splice(r,0,t)}while(0!==e);return this.resBuf.shift()};var k=function(e){this.it=e,this.procBuf=[],this.resBuf=[],this.lastClass=null};k.prototype.next=function(){for(;0===this.resBuf.length;){var e=this.it.next();if(!e){this.resBuf=this.procBuf,this.procBuf=[];break}if(0===this.procBuf.length)this.lastClass=e.getCanonicalClass(),this.procBuf.push(e);else{var t=this.procBuf[0].getComposite(e),r=e.getCanonicalClass();t&&(this.lastClass255||(i=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");a+=n.charAt((t=r<<16|i<<8|o)>>18&63)+n.charAt(t>>12&63)+n.charAt(t>>6&63)+n.charAt(63&t)}return u?a.slice(0,u-3)+"===".substring(u):a},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!i.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");e+="==".slice(2-(3&e.length));for(var t,r,o,a="",s=0;s>16&255):64===o?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return a}}}(t)}));!function(){var e=[];try{for(var t=[],n=["NFD","NFC","NFKD","NFKC"],a=0;a>>0,8|i.mapKey[c.keyType],c.keyType),void 0===h?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",f,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,l,t),r("}")("}")):c.repeated?(r("if(%s!=null&&%s.length){",t,t),c.packed&&void 0!==i.packed[l]?r("w.uint32(%i).fork()",(c.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",l,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===h?a(r,c,f,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(c.id<<3|h)>>>0,l,t)),r("}")):(c.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,c.name),void 0===h?a(r,c,f,t):r("w.uint32(%i).%s(%s)",(c.id<<3|h)>>>0,l,t))}return r("return w")};var n=r(83),i=r(153),o=r(56);function a(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},function(e,t,r){"use strict";e.exports=g;var n=r(152);((g.prototype=Object.create(n.prototype)).constructor=g).className="Type";var i=r(83),o=r(187),a=r(129),s=r(327),u=r(328),c=r(239),f=r(238),l=r(237),h=r(56),d=r(325),p=r(330),v=r(331),y=r(332),b=r(333);function g(e,t){n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function m(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(g.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t>>3){");for(var r=0;r>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===i.basic[u]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",u),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',c):t("%s[k]=value",c)):s.repeated?(t("if(!(%s&&%s.length))",c,c)("%s=[]",c),void 0!==i.packed[u]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":u=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,u)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,u?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function s(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var o=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,o?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=o.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n-1){var r=e.substring(t);if(r in a)return r}return null}function l(e,t){try{if(f.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),f.isString(t)){o.filename=e;var n,a=o(t,i,r),l=0;if(a.imports)for(;l-1))if(i.files.push(e),e in a)s?l(e,a[e]):(++p,setTimeout((function(){--p,l(e,a[e])})));else if(s){var r;try{r=f.fs.readFileSync(e).toString("utf8")}catch(o){return void(t||u(o))}l(e,r)}else++p,i.fetch(e,(function(r,o){--p,n&&(r?t?p||u(null,i):u(r):l(e,o))}))}var p=0;f.isString(t)&&(t=[t]);for(var v,y=0;y-1&&this.deferred.splice(t,1)}}else if(e instanceof u)d.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?("string"===typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):k(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?k(e,a,t,!1):x(e,a)):k(e,a,t,!1))):n||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=S?e=S:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function _(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(A,e):A(e))}function A(e){d("emit readable"),e.emit("readable"),O(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(T,e,t))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function B(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):_(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e0?I(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?f:m;function c(t,n){d("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),e.removeListener("close",b),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",y),e.removeListener("unpipe",c),r.removeListener("end",f),r.removeListener("end",m),r.removeListener("data",v),h=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function f(){d("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",c);var l=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,O(e))}}(r);e.on("drain",l);var h=!1;var p=!1;function v(t){d("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==B(o.pipes,e))&&!h&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function y(t){d("onerror",t),m(),e.removeListener("error",y),0===s(e,"error")&&e.emit("error",t)}function b(){e.removeListener("finish",g),m()}function g(){d("onfinish"),e.removeListener("close",b),m()}function m(){d("unpipe"),r.unpipe(e)}return r.on("data",v),function(e,t,r){if("function"===typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",y),e.once("close",b),e.once("finish",g),e.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),e},m.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){"use strict";var n=t;n.base=r(190),n.short=r(578),n.mont=r(579),n.edwards=r(580)},function(e,t,r){"use strict";var n=r(75).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(75),i=r(157),o=r(352),a=r(66),s=n.sum32,u=n.sum32_4,c=n.sum32_5,f=o.ch32,l=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,v=o.g1_256,y=i.BlockHash,b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function g(){if(!(this instanceof g))return new g;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}n.inherits(g,y),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.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 r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){(t=e.exports=r(357)).Stream=t,t.Readable=t,t.Writable=r(361),t.Duplex=r(132),t.Transform=r(362),t.PassThrough=r(606),t.finished=r(250),t.pipeline=r(607)},function(e,t,r){"use strict";(function(t,n){var i;e.exports=A,A.ReadableState=_;r(57).EventEmitter;var o=function(e,t){return e.listeners(t).length},a=r(358),s=r(13).Buffer,u=t.Uint8Array||function(){};var c,f=r(601);c=f&&f.debuglog?f.debuglog("stream"):function(){};var l,h,d,p=r(602),v=r(359),y=r(360).getHighWaterMark,b=r(131).codes,g=b.ERR_INVALID_ARG_TYPE,m=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,k=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(23)(A,a);var S=v.errorOrDestroy,E=["error","close","destroy","pause","resume"];function _(e,t,n){i=i||r(132),e=e||{},"boolean"!==typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(155).StringDecoder),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function A(e){if(i=i||r(132),!(this instanceof A))return new A(e);var t=this instanceof i;this._readableState=new _(e,this,t),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function x(e,t,r,n,i){c("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,I(e)))}(e,a);else if(i||(o=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof u||"string"===typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(a,t)),o)S(e,o);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)),n)a.endEmitted?S(e,new k):T(e,a,t,!0);else if(a.ended)S(e,new m);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?T(e,a,t,!1):P(e,a)):T(e,a,t,!1)}else n||(a.reading=!1,P(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=M?e=M:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(I,e))}function I(e){var t=e._readableState;c("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 P(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){c("readable nexttick read 0"),e.read(0)}function N(e,t){c("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(c("flow",t.flowing);t.flowing&&null!==e.read(););}function j(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(F,t,e))}function F(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function K(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):O(this),null;if(0===(e=C(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e0?j(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){S(this,new w("_read()"))},A.prototype.pipe=function(e,t){var r=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,c("pipe count=%d opts=%j",i.pipesCount,t);var a=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?u:y;function s(t,n){c("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",v),e.removeListener("drain",f),e.removeListener("error",d),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",h),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function u(){c("onend"),e.end()}i.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",s);var f=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",f);var l=!1;function h(t){c("ondata");var n=e.write(t);c("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==K(i.pipes,e))&&!l&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(t){c("onerror",t),y(),e.removeListener("error",d),0===o(e,"error")&&S(e,t)}function p(){e.removeListener("finish",v),y()}function v(){c("onfinish"),e.removeListener("close",p),y()}function y(){c("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"===typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",p),e.once("finish",v),e.emit("pipe",r),i.flowing||(c("pipe resume"),r.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?O(this):i.reading||n.nextTick(D,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(B,this),r},A.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(B,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(N,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!==i&&void 0!==i)&&((r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause())))})),e)void 0===this[i]&&"function"===typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new k(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,r){r(new v("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,r){var i=this._writableState;return"function"===typeof e?(r=e,e=null,t=null):"function"===typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,I(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(e,t){t(e)}}).call(this,r(36),r(39))},function(e,t,r){"use strict";e.exports=f;var n=r(131).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(132);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function h(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}n(u,i),u.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},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,v=0|this._g,y=0|this._h,b=0;b<16;++b)r[b]=e.readInt32BE(4*b);for(;b<64;++b)r[b]=0|(((t=r[b-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[b-7]+d(r[b-15])+r[b-16];for(var g=0;g<64;++g){var m=y+h(u)+c(u,p,v)+a[g]+r[g]|0,w=l(n)+f(n,i,o)|0;y=v,v=p,p=u,u=s+m|0,s=o,o=i,i=n,n=m+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=v+this._g|0,this._h=y+this._h|0},u.prototype._hash=function(){var e=o.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=u},function(e,t,r){var n=r(23),i=r(133),o=r(28).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 u(){this.init(),this._w=s,i.call(this,128,112)}function c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function h(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 p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function v(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function y(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}n(u,i),u.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},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,g=0|this._gh,m=0|this._hh,w=0|this._al,k=0|this._bl,S=0|this._cl,E=0|this._dl,_=0|this._el,A=0|this._fl,x=0|this._gl,T=0|this._hl,M=0;M<32;M+=2)t[M]=e.readInt32BE(4*M),t[M+1]=e.readInt32BE(4*M+4);for(;M<160;M+=2){var C=t[M-30],O=t[M-30+1],I=d(C,O),P=p(O,C),R=v(C=t[M-4],O=t[M-4+1]),B=y(O,C),D=t[M-14],N=t[M-14+1],L=t[M-32],j=t[M-32+1],U=P+N|0,F=I+D+b(U,P)|0;F=(F=F+R+b(U=U+B|0,B)|0)+L+b(U=U+j|0,j)|0,t[M]=F,t[M+1]=U}for(var K=0;K<160;K+=2){F=t[K],U=t[K+1];var z=f(r,n,i),V=f(w,k,S),H=l(r,w),J=l(w,r),q=h(s,_),G=h(_,s),X=a[K],W=a[K+1],Z=c(s,u,g),Y=c(_,A,x),Q=T+G|0,$=m+q+b(Q,T)|0;$=($=($=$+Z+b(Q=Q+Y|0,Y)|0)+X+b(Q=Q+W|0,W)|0)+F+b(Q=Q+U|0,U)|0;var ee=J+V|0,te=H+z+b(ee,J)|0;m=g,T=x,g=u,x=A,u=s,A=_,s=o+$+b(_=E+Q|0,E)|0,o=i,E=S,i=n,S=k,n=r,k=w,r=$+te+b(w=Q+ee|0,Q)|0}this._al=this._al+w|0,this._bl=this._bl+k|0,this._cl=this._cl+S|0,this._dl=this._dl+E|0,this._el=this._el+_|0,this._fl=this._fl+A|0,this._gl=this._gl+x|0,this._hl=this._hl+T|0,this._ah=this._ah+r+b(this._al,w)|0,this._bh=this._bh+n+b(this._bl,k)|0,this._ch=this._ch+i+b(this._cl,S)|0,this._dh=this._dh+o+b(this._dl,E)|0,this._eh=this._eh+s+b(this._el,_)|0,this._fh=this._fh+u+b(this._fl,A)|0,this._gh=this._gh+g+b(this._gl,x)|0,this._hh=this._hh+m+b(this._hl,T)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+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=u},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,r){"use strict";var n=r(29),i=r(98);function o(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}var a=o("utf8","u",(function(e){return"u"+new TextDecoder("utf8").decode(e)}),(function(e){return(new TextEncoder).encode(e.substring(1))})),s=o("ascii","a",(function(e){for(var t="a",r=0;r=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,t){t=t||{};var c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var u=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*s;case"weeks":case"week":case"w":return u*a;case"days":case"day":case"d":return u*o;case"hours":case"hour":case"hrs":case"hr":case"h":return u*i;case"minutes":case"minute":case"mins":case"min":case"m":return u*n;case"seconds":case"second":case"secs":case"sec":case"s":return u*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(e);if("number"===c&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return u(e,t,o,"day");if(t>=i)return u(e,t,i,"hour");if(t>=n)return u(e,t,n,"minute");if(t>=r)return u(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=n)return Math.round(e/n)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";var n=r(662),i=r(195),o=r(90).CID,a=r(67).base32,s=r(58).base58btc,u=r(88),c=r(91),f=r(194).toString,l=r(667).fromString,h=r(380).concat;function d(e,t){return t instanceof Uint8Array?d.toString(e,t):d.toBytes(e,t)}function p(e){if(!n.isIP(e))throw new Error("invalid ip address");return n.toBytes(e)}function v(e){var t=new ArrayBuffer(2);return new DataView(t).setUint16(0,e),new Uint8Array(t)}function y(e){return new DataView(e.buffer).getUint16(e.byteOffset)}function b(e){var t=e.slice(0,e.length-2),r=e.slice(e.length-2);return f(t,"base32")+":"+y(r)}e.exports=d,d.toString=function(e,t){switch(i(e).code){case 4:case 41:return function(e){var t=n.toString(e);if(!t||!n.isIP(t))throw new Error("invalid ip address");return t}(t);case 6:case 273:case 33:case 132:return y(t).toString();case 53:case 54:case 55:case 56:case 400:case 777:return function(e){var t=c.decode(e);if((e=e.slice(c.decode.bytes)).length!==t)throw new Error("inconsistent lengths");return f(e)}(t);case 421:return function(e){var t=c.decode(e),r=e.slice(c.decode.bytes);if(r.length!==t)throw new Error("inconsistent lengths");return f(r,"base58btc")}(t);case 444:case 445:return b(t);default:return f(t,"base16")}},d.toBytes=function(e,t){switch(i(e).code){case 4:case 41:return p(t);case 6:case 273:case 33:case 132:return v(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 777:return function(e){var t=l(e),r=Uint8Array.from(c.encode(t.length));return h([r,t],r.length+t.length)}(t);case 421:return function(e){var t;t="Q"===e[0]||"1"===e[0]?u.decode(s.decode("z".concat(e))).bytes:o.parse(e).multihash.bytes;var r=Uint8Array.from(c.encode(t.length));return h([r,t],r.length+t.length)}(t);case 444:return function(e){var t=e.split(":");if(2!==t.length)throw new Error("failed to parse onion addr: "+t+" does not contain a port number");if(16!==t[0].length)throw new Error("failed to parse onion addr: "+t[0]+" not a Tor onion address.");var r=a.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");var i=v(n);return h([r,i],r.length+i.length)}(t);case 445:return function(e){var t=e.split(":");if(2!==t.length)throw new Error("failed to parse onion addr: "+t+" does not contain a port number");if(56!==t[0].length)throw new Error("failed to parse onion addr: "+t[0]+" not a Tor onion3 address.");var r=a.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");var i=v(n);return h([r,i],r.length+i.length)}(t);default:return l(t,"base16")}}},function(e,t,r){"use strict";var n="[a-fA-F\\d:]",i=function(e){return e&&e.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(n,")|(?<=").concat(n,")(?=\\s|$))"):""},o="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",a="[a-fA-F\\d]{1,4}",s="\n(?:\n(?:".concat(a,":){7}(?:").concat(a,"|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:").concat(a,":){6}(?:").concat(o,"|:").concat(a,"|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:").concat(a,":){5}(?::").concat(o,"|(?::").concat(a,"){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:").concat(a,":){4}(?:(?::").concat(a,"){0,1}:").concat(o,"|(?::").concat(a,"){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:").concat(a,":){3}(?:(?::").concat(a,"){0,2}:").concat(o,"|(?::").concat(a,"){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:").concat(a,":){2}(?:(?::").concat(a,"){0,3}:").concat(o,"|(?::").concat(a,"){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:").concat(a,":){1}(?:(?::").concat(a,"){0,4}:").concat(o,"|(?::").concat(a,"){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::").concat(a,"){0,5}:").concat(o,"|(?::").concat(a,"){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),u=new RegExp("(?:^".concat(o,"$)|(?:^").concat(s,"$)")),c=new RegExp("^".concat(o,"$")),f=new RegExp("^".concat(s,"$")),l=function(e){return e&&e.exact?u:new RegExp("(?:".concat(i(e)).concat(o).concat(i(e),")|(?:").concat(i(e)).concat(s).concat(i(e),")"),"g")};l.v4=function(e){return e&&e.exact?c:new RegExp("".concat(i(e)).concat(o).concat(i(e)),"g")},l.v6=function(e){return e&&e.exact?f:new RegExp("".concat(i(e)).concat(s).concat(i(e)),"g")},e.exports=l},function(e,t,r){"use strict";var n=r(29),i=r(98);function o(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}var a=o("utf8","u",(function(e){return"u"+new TextDecoder("utf8").decode(e)}),(function(e){return(new TextEncoder).encode(e.substring(1))})),s=o("ascii","a",(function(e){for(var t="a",r=0;rr)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.lengthr||t!==t)throw new TypeError("Bad key length")}},function(e,t,r){(function(t,r){var n;if(t.process&&t.process.browser)n="utf-8";else if(t.process&&t.process.version){n=parseInt(r.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else n="utf-8";e.exports=n}).call(this,r(36),r(39))},function(e,t,r){var n=r(384),i=r(251),o=r(252),a=r(28).Buffer,s=r(387),u=r(388),c=r(390),f=a.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(e,t,r){var s=function(e){function t(t){return o(e).update(t).digest()}function r(e){return(new i).update(e).digest()}return"rmd160"===e||"ripemd160"===e?r:"md5"===e?n:t}(e),u="sha512"===e||"sha384"===e?128:64;t.length>u?t=s(t):t.length>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var 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(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},t.rip=function(e,t,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.pc1=function(e,t,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var 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|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.r28shl=function(e,t){return e<>>28-t};var n=[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,i){for(var o=0,a=0,s=n.length>>>1,u=0;u>>n[u]&1;for(u=s;u>>n[u]&1;r[i+0]=o>>>0,r[i+1]=a>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=e>>>o&63;for(o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var i=[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 r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(t>>>18-6*n&63)]}return r>>>0};var o=[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,r=0;r>>o[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length>>1];r=o.r28shl(r,s),i=o.r28shl(i,s),o.pc2(r,i,e.keys,a)}},u.prototype._update=function(e,t,r,n){var i=this._desState,a=o.readUInt32BE(e,t),s=o.readUInt32BE(e,t+4);o.ip(a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,a,s,i.tmp,0):this._decrypt(i,a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],o.writeUInt32BE(r,a,n),o.writeUInt32BE(r,s,n+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n>>0,a=h}o.rip(s,a,n,i)},u.prototype._decrypt=function(e,t,r,n,i){for(var a=r,s=t,u=e.keys.length-2;u>=0;u-=2){var c=e.keys[u],f=e.keys[u+1];o.expand(a,e.tmp,0),c^=e.tmp[0],f^=e.tmp[1];var l=o.substitute(c,f),h=a;a=(s^o.permute(l))>>>0,s=h}o.rip(a,s,n,i)}},function(e,t,r){var n=r(163),i=r(28).Buffer,o=r(394);function a(e){var t=e._cipher.encryptBlockRaw(e._prev);return o(e._prev),t}t.encrypt=function(e,t){var r=Math.ceil(t.length/16),o=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*r)]);for(var s=0;se;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(c))for(;r.mod(f).cmp(l);)r.iadd(d)}else for(;r.mod(o).cmp(h);)r.iadd(d);if(y(p=r.shrn(1))&&y(r)&&b(p)&&b(r)&&a.test(p)&&a.test(r))return r}}},function(e,t,r){var n=r(14),i=r(247);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},o.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},o.prototype.test=function(e,t,r){var i=e.bitLength(),o=n.mont(e),a=new n(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),u=0;!s.testn(u);u++);for(var c=e.shrn(u),f=s.toRed(o);t>0;t--){var l=this._randrange(new n(2),s);r&&r(l);var h=l.toRed(o).redPow(c);if(0!==h.cmp(a)&&0!==h.cmp(f)){for(var d=1;d0;t--){var f=this._randrange(new n(2),a),l=e.gcd(f);if(0!==l.cmpn(1))return l;var h=f.toRed(i).redPow(u);if(0!==h.cmp(o)&&0!==h.cmp(c)){for(var d=1;d=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=u(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(M){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=d[e],f=p[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var v=l.modrn(f).toString(e);r=(l=l.idivn(f)).isZero()?v+r:h[c-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function v(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,v=d>>>13,y=0|a[2],b=8191&y,g=y>>>13,m=0|a[3],w=8191&m,k=m>>>13,S=0|a[4],E=8191&S,_=S>>>13,A=0|a[5],x=8191&A,T=A>>>13,M=0|a[6],C=8191&M,O=M>>>13,I=0|a[7],P=8191&I,R=I>>>13,B=0|a[8],D=8191&B,N=B>>>13,L=0|a[9],j=8191&L,U=L>>>13,F=0|s[0],K=8191&F,z=F>>>13,V=0|s[1],H=8191&V,J=V>>>13,q=0|s[2],G=8191&q,X=q>>>13,W=0|s[3],Z=8191&W,Y=W>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],le=8191&fe,he=fe>>>13,de=0|s[9],pe=8191&de,ve=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(c+(n=Math.imul(l,K))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,K)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,z))+Math.imul(v,K)|0,o=Math.imul(v,z);var be=(c+(n=n+Math.imul(l,H)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(h,H)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,K),i=(i=Math.imul(b,z))+Math.imul(g,K)|0,o=Math.imul(g,z),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,J)|0;var ge=(c+(n=n+Math.imul(l,G)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,K),i=(i=Math.imul(w,z))+Math.imul(k,K)|0,o=Math.imul(k,z),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,J)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,X)|0;var me=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(E,K),i=(i=Math.imul(E,z))+Math.imul(_,K)|0,o=Math.imul(_,z),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0;var we=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,K),i=(i=Math.imul(x,z))+Math.imul(T,K)|0,o=Math.imul(T,z),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,Y)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var ke=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(C,K),i=(i=Math.imul(C,z))+Math.imul(O,K)|0,o=Math.imul(O,z),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,J)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var Se=(c+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(P,K),i=(i=Math.imul(P,z))+Math.imul(R,K)|0,o=Math.imul(R,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var Ee=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,z))+Math.imul(N,K)|0,o=Math.imul(N,z),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var _e=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,he)|0)+Math.imul(h,le)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(j,K),i=(i=Math.imul(j,z))+Math.imul(U,K)|0,o=Math.imul(U,z),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(v,le)|0,o=o+Math.imul(v,he)|0;var Ae=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ve)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,ve)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(j,H),i=(i=Math.imul(j,J))+Math.imul(U,H)|0,o=Math.imul(U,J),n=n+Math.imul(D,G)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,Y)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(b,le)|0,i=(i=i+Math.imul(b,he)|0)+Math.imul(g,le)|0,o=o+Math.imul(g,he)|0;var xe=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(j,G),i=(i=Math.imul(j,X))+Math.imul(U,G)|0,o=Math.imul(U,X),n=n+Math.imul(D,Z)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,he)|0;var Te=(c+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ve)|0)+Math.imul(g,pe)|0))<<13)|0;c=((o=o+Math.imul(g,ve)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(j,Z),i=(i=Math.imul(j,Y))+Math.imul(U,Z)|0,o=Math.imul(U,Y),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,n=n+Math.imul(E,le)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,he)|0;var Me=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(j,$),i=(i=Math.imul(j,ee))+Math.imul(U,$)|0,o=Math.imul(U,ee),n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(x,le)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(T,le)|0,o=o+Math.imul(T,he)|0;var Ce=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ve)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(j,re),i=(i=Math.imul(j,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,n=n+Math.imul(C,le)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(O,le)|0,o=o+Math.imul(O,he)|0;var Oe=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ve)|0)+Math.imul(T,pe)|0))<<13)|0;c=((o=o+Math.imul(T,ve)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(j,oe),i=(i=Math.imul(j,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,n=n+Math.imul(P,le)|0,i=(i=i+Math.imul(P,he)|0)+Math.imul(R,le)|0,o=o+Math.imul(R,he)|0;var Ie=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ve)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ve)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(j,ue),i=(i=Math.imul(j,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,he)|0)+Math.imul(N,le)|0,o=o+Math.imul(N,he)|0;var Pe=(c+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ve)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(j,le),i=(i=Math.imul(j,he))+Math.imul(U,le)|0,o=Math.imul(U,he);var Re=(c+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ve)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Be=(c+(n=Math.imul(j,pe))|0)+((8191&(i=(i=Math.imul(j,ve))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ve))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=ye,u[1]=be,u[2]=ge,u[3]=me,u[4]=we,u[5]=ke,u[6]=Se,u[7]=Ee,u[8]=_e,u[9]=Ae,u[10]=xe,u[11]=Te,u[12]=Me,u[13]=Ce,u[14]=Oe,u[15]=Ie,u[16]=Pe,u[17]=Re,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function b(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function g(e,t,r){return b(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(y=v),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):r<63?v(this,e,t):r<1024?b(this,e,t):g(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=t.clone();!t.isZero();){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,v=1;0===(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0===(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new x(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function k(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){k.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){k.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){k.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}k.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},k.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},k.prototype.split=function(e,t){e.iushrn(this.n,0,t)},k.prototype.imulK=function(e){return e.imul(this.k)},i(S,k),S.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new S;else if("p224"===e)t=new E;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},x.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},x.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")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(f(e,e.umod(this.m)._forceRed(this)),e)},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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var v=d,y=0;0!==v.cmp(s);y++)v=v.redSqr();n(y=0;n--){for(var c=t.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},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},o.mont=function(e){return new T(e)},i(T,x),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(156)(e))},function(e,t,r){"use strict";var n=t;n.bignum=r(14),n.define=r(697).define,n.base=r(700),n.constants=r(701),n.decoders=r(404),n.encoders=r(402)},function(e,t,r){"use strict";var n=t;n.der=r(403),n.pem=r(698)},function(e,t,r){"use strict";var n=r(23),i=r(261).Buffer,o=r(262),a=r(264);function s(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new u,this.tree._init(e.body)}function u(e){o.call(this,"der",e)}function c(e){return e<10?"0"+e:e}e.exports=s,s.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(u,o),u.prototype._encodeComposite=function(e,t,r,n){var o=function(e,t,r,n){var i;"seqof"===e?e="seq":"setof"===e&&(e="set");if(a.tagByName.hasOwnProperty(e))i=a.tagByName[e];else{if("number"!==typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);i=e}if(i>=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=a.tagClassByName[r||"universal"]<<6}(e,t,r,this.reporter);if(n.length<128){var s=i.alloc(2);return s[0]=o,s[1]=n.length,this._createEncoderBuffer([s,n])}for(var u=1,c=n.length;c>=256;c>>=8)u++;var f=i.alloc(2+u);f[0]=o,f[1]=128|u;for(var l=1+u,h=n.length;h>0;l--,h>>=8)f[l]=255&h;return this._createEncoderBuffer([f,n])},u.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=i.alloc(2*e.length),n=0;n=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;u>>=7)a++}for(var c=i.alloc(a),f=c.length-1,l=e.length-1;l>=0;l--){var h=e[l];for(c[f--]=127&h;(h>>=7)>0;)c[f--]=128|127&h}return this._createEncoderBuffer(c)},u.prototype._encodeTime=function(e,t){var r,n=new Date(e);return"gentime"===t?r=[c(n.getUTCFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(n.getUTCFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(e,t){if("string"===typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!==typeof e&&!i.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=i.from(r)}if(i.isBuffer(e)){var n=e.length;0===e.length&&n++;var o=i.alloc(n);return e.copy(o),0===e.length&&(o[0]=0),this._createEncoderBuffer(o)}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 u=new Array(a),c=u.length-1;c>=0;c--)u[c]=255&e,e>>=8;return 128&u[0]&&u.unshift(0),this._createEncoderBuffer(i.from(u))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"===typeof e&&(e=e(t)),e._getEncoder("der").tree},u.prototype._skipDefault=function(e,t,r){var n,i=this._baseState;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n>6],i=0===(32&r);if(31===(31&r)){var o=r;for(r=0;128===(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function l(e,t,r){var n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0===(128&n))return n;var i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(var o=0;o>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.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),r=0;r>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(77),i=r(166),o=r(414),a=r(108),s=n.sum32,u=n.sum32_4,c=n.sum32_5,f=o.ch32,l=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,v=o.g1_256,y=i.BlockHash,b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function g(){if(!(this instanceof g))return new g;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}n.inherits(g,y),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n4){var r=e;e=n.util.createBuffer();for(var i=0;i0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}a(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),a(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=s(8*t.length());var o=t.length()%this.blockSize;for(o&&t.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),a(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),a(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,o=new Array(i),a=0;a>>1,i=new Array(r);i[n]=e.slice(0);for(var o=n>>>1;o>0;)this.pow(i[2*o],i[o]=[]),o>>=1;for(o=2;o>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function y(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}l.create=h(),l.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(l.alloc=i.pool(l.alloc,i.Array.prototype.subarray)),l.prototype._push=function(e,t,r){return this.tail=this.tail.next=new u(e,t,r),this.len+=t,this},p.prototype=Object.create(u.prototype),p.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(v,10,o.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=o.from(e);return this._push(v,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(v,t.length(),t)},l.prototype.bool=function(e){return this._push(d,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=o.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var b=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n>>0;if(!t)return this._push(d,1,0);if(i.isString(e)){var r=l.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(b,t,e)},l.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(d,1,0)},l.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new u(c,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},l._configure=function(e){n=e,l.create=h(),n._configure()}},function(e,t,r){"use strict";e.exports=u;var n,i=r(111),o=i.LongBits,a=i.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var c="undefined"!==typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},f=function(){return i.Buffer?function(e){return(u.create=function(e){return i.Buffer.isBuffer(e)?new n(e):c(e)})(e)}:c};function l(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw s(this,8);return new o(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=f(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return e}}(),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},u.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},u.prototype.skip=function(e){if("number"===typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!==(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){n=e,u.create=f(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(u.prototype,{int64:function(){return l.call(this)[t](!1)},uint64:function(){return l.call(this)[t](!0)},sint64:function(){return l.call(this).zzDecode()[t](!1)},fixed64:function(){return d.call(this)[t](!0)},sfixed64:function(){return d.call(this)[t](!1)}})}},function(e,t,r){(function(t){var n=r(18);r(762),r(112),r(34);var i,o=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(271)),e.exports=n.pbkdf2=o.pbkdf2=function(e,r,o,a,s,u){if("function"===typeof s&&(u=s,s=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===s||"object"!==typeof s)&&(i.pbkdf2Sync.length>4||!s||"sha1"===s))return"string"!==typeof s&&(s="sha1"),e=t.from(e,"binary"),r=t.from(r,"binary"),u?4===i.pbkdf2Sync.length?i.pbkdf2(e,r,o,a,(function(e,t){if(e)return u(e);u(null,t.toString("binary"))})):i.pbkdf2(e,r,o,a,s,(function(e,t){if(e)return u(e);u(null,t.toString("binary"))})):4===i.pbkdf2Sync.length?i.pbkdf2Sync(e,r,o,a).toString("binary"):i.pbkdf2Sync(e,r,o,a,s).toString("binary");if("undefined"!==typeof s&&null!==s||(s="sha1"),"string"===typeof s){if(!(s in n.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=n.md[s].create()}var c=s.digestLength;if(a>4294967295*c){var f=new Error("Derived key is too long.");if(u)return u(f);throw f}var l=Math.ceil(a/c),h=a-(l-1)*c,d=n.hmac.create();d.start(s,e);var p,v,y,b="";if(!u){for(var g=1;g<=l;++g){d.start(null,null),d.update(r),d.update(n.util.int32ToBytes(g)),p=y=d.digest().getBytes();for(var m=2;m<=o;++m)d.start(null,null),d.update(y),v=d.digest().getBytes(),p=n.util.xorBytes(p,v,c),y=v;b+=gl)return u(null,b);d.start(null,null),d.update(r),d.update(n.util.int32ToBytes(g)),p=y=d.digest().getBytes(),m=2,k()}function k(){if(m<=o)return d.start(null,null),d.update(y),v=d.digest().getBytes(),p=n.util.xorBytes(p,v,c),y=v,++m,n.util.setImmediate(k);b+=g0&&void 0!==arguments[0]?arguments[0]:{},t=e.algorithm,r=void 0===t?"AES-GCM":t,u=e.nonceLength,c=void 0===u?12:u,f=e.keyLength,l=void 0===f?16:f,h=e.digest,d=void 0===h?"SHA-256":h,p=e.saltLength,v=void 0===p?16:p,y=e.iterations,b=void 0===y?32767:y,g=s.get();function m(e,t){return w.apply(this,arguments)}function w(){return(w=i(n.mark((function e(t,i){var s,u,f,h,p,y,m;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=g.getRandomValues(new Uint8Array(v)),u=g.getRandomValues(new Uint8Array(c)),f={name:r,iv:u},h={name:"PBKDF2",salt:s,iterations:b,hash:{name:d}},e.next=6,g.subtle.importKey("raw",a(i),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]);case 6:return p=e.sent,e.next=9,g.subtle.deriveKey(h,p,{name:r,length:l},!0,["encrypt"]);case 9:return y=e.sent,e.next=12,g.subtle.encrypt(f,y,t);case 12:return m=e.sent,e.abrupt("return",o([s,f.iv,new Uint8Array(m)]));case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e,t){return S.apply(this,arguments)}function S(){return(S=i(n.mark((function e(t,i){var o,s,u,f,h,p,y,m;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.slice(0,v),s=t.slice(v,v+c),u=t.slice(v+c),f={name:r,iv:s},h={name:"PBKDF2",salt:o,iterations:b,hash:{name:d}},e.next=7,g.subtle.importKey("raw",a(i),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]);case 7:return p=e.sent,e.next=10,g.subtle.deriveKey(h,p,{name:r,length:l},!0,["decrypt"]);case 10:return y=e.sent,e.next=13,g.subtle.decrypt(f,y,u);case 13:return m=e.sent,e.abrupt("return",new Uint8Array(m));case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return l*=8,{encrypt:m,decrypt:k}}}},function(e,t,r){(function(t){var n=r(18);r(114),r(113),r(137),r(34);var i=r(771),o=i.publicKeyValidator,a=i.privateKeyValidator;if("undefined"===typeof s)var s=n.jsbn.BigInteger;var u=n.util.ByteBuffer,c="undefined"===typeof t?Uint8Array:t;n.pki=n.pki||{},e.exports=n.pki.ed25519=n.ed25519=n.ed25519||{};var f=n.ed25519;function l(e){var r=e.message;if(r instanceof Uint8Array||r instanceof c)return r;var n=e.encoding;if(void 0===r){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');r=e.md.digest().getBytes(),n="binary"}if("string"===typeof r&&!n)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"===typeof r){if("undefined"!==typeof t)return t.from(r,n);r=new u(r,n)}else if(!(r instanceof u))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var i=new c(r.length()),o=0;o=0;--r)j(n,n),1!==r&&U(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),U(r,r,i),U(r,r,o),U(r,r,o),U(e[0],r,o),j(n,e[0]),U(n,n,o),T(n,i)&&U(e[0],e[0],m);if(j(n,e[0]),U(n,n,o),T(n,i))return-1;C(e[0])===t[31]>>7&&L(e[0],h,e[0]);return U(e[3],e[0],e[1]),0}(s,n))return-1;for(i=0;i=0};var h=D(),d=D([1]),p=D([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),v=D([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),y=D([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),b=D([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),g=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),m=D([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function w(e,r){var i=n.md.sha512.create(),o=new u(e);i.update(o.getBytes(r),"binary");var a=i.digest().getBytes();if("undefined"!==typeof t)return t.from(a,"binary");for(var s=new c(f.constants.HASH_BYTE_LENGTH),l=0;l<64;++l)s[l]=a.charCodeAt(l);return s}function k(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;++i)t[i]+=r-(t[31]>>4)*g[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*g[i];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function S(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;k(e,t)}function E(e,t){var r=D(),n=D(),i=D(),o=D(),a=D(),s=D(),u=D(),c=D(),f=D();L(r,e[1],e[0]),L(f,t[1],t[0]),U(r,r,f),N(n,e[0],e[1]),N(f,t[0],t[1]),U(n,n,f),U(i,e[3],t[3]),U(i,i,v),U(o,e[2],t[2]),N(o,o,o),L(a,n,r),L(s,o,i),N(u,o,i),N(c,n,r),U(e[0],a,s),U(e[1],c,u),U(e[2],u,s),U(e[3],a,c)}function _(e,t,r){for(var n=0;n<4;++n)B(e[n],t[n],r)}function A(e,t){var r=D(),n=D(),i=D();!function(e,t){var r,n=D();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)j(n,n),2!==r&&4!==r&&U(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(i,t[2]),U(r,t[0],i),U(n,t[1],i),x(e,n),e[31]^=C(r)<<7}function x(e,t){var r,n,i,o=D(),a=D();for(r=0;r<16;++r)a[r]=t[r];for(R(a),R(a),R(a),n=0;n<2;++n){for(o[0]=a[0]-65517,r=1;r<15;++r)o[r]=a[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=a[15]-32767-(o[14]>>16&1),i=o[15]>>16&1,o[14]&=65535,B(a,o,1-i)}for(r=0;r<16;r++)e[2*r]=255&a[r],e[2*r+1]=a[r]>>8}function T(e,t){var r=new c(32),n=new c(32);return x(r,e),x(n,t),M(r,0,n,0)}function M(e,t,r,n){return function(e,t,r,n,i){var o,a=0;for(o=0;o>>8)-1}(e,t,r,n,32)}function C(e){var t=new c(32);return x(t,e),1&t[0]}function O(e,t,r){var n,i;for(P(e[0],h),P(e[1],d),P(e[2],d),P(e[3],h),i=255;i>=0;--i)_(e,t,n=r[i/8|0]>>(7&i)&1),E(t,e),E(e,e),_(e,t,n)}function I(e,t){var r=[D(),D(),D(),D()];P(r[0],y),P(r[1],b),P(r[2],d),U(r[3],y,b),O(e,r,t)}function P(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function R(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function B(e,t,r){for(var n,i=~(r-1),o=0;o<16;++o)n=i&(e[o]^t[o]),e[o]^=n,t[o]^=n}function D(e){var t,r=new Float64Array(16);if(e)for(t=0;t=r)){t.next=39;break}return v=o.shallowSlice(0,r),o.consume(r),t.next=29,v;case 29:if(r=t.sent){t.next=37;break}if(!o.length){t.next=36;break}return t.next=34,o;case 34:r=t.sent,o=new s;case 36:return t.abrupt("break",39);case 37:t.next=24;break;case 39:u=!0,t.next=8;break;case 42:t.next=48;break;case 44:t.prev=44,t.t0=t.catch(6),c=!0,f=t.t0;case 48:if(t.prev=48,t.prev=49,u||null==l.return){t.next=53;break}return t.next=53,i(l.return());case 53:if(t.prev=53,!c){t.next=56;break}throw f;case 56:return t.finish(53);case 57:return t.finish(48);case 58:if(!r){t.next=60;break}throw Object.assign(new Error("stream ended before ".concat(r," bytes became available")),{code:"ERR_UNDER_READ",buffer:o});case 60:case"end":return t.stop()}}),t,null,[[6,44,48,58],[49,,53,57]])})))();return t.next(),t}},function(e,t,r){var n=r(8),i=r(9),o=r(824);e.exports=function(){"use strict";function e(t){n(this,e),this.hwm=t||16,this.head=new o(this.hwm),this.tail=this.head}return i(e,[{key:"push",value:function(e){if(!this.head.push(e)){var t=this.head;this.head=t.next=new o(2*this.head.buffer.length),this.head.push(e)}}},{key:"shift",value:function(){var e=this.tail.shift();if(void 0===e&&this.tail.next){var t=this.tail.next;return this.tail.next=null,this.tail=t,this.tail.shift()}return e}},{key:"isEmpty",value:function(){return this.head.isEmpty()}}]),e}()},function(e,t,r){"use strict";var n=r(91),i=r(13).Buffer;e.exports=function e(t,r,o){var a=n.encode(t,r,o);return e.bytes=n.encode.bytes,r||i.from(a)}},function(e,t,r){"use strict";var n=r(91),i=r(13).Buffer;e.exports=function e(t){var r,o=n.decode(i.isBuffer(t)?t:(r=t,new Proxy({},{get:function(e,t){return"l"===t[0]?r[t]:r.get(parseInt(t))}})));return e.bytes=n.decode.bytes,o}},function(e,t){e.exports=function(e){if(e){if("function"===typeof e[Symbol.iterator])return e[Symbol.iterator]();if("function"===typeof e[Symbol.asyncIterator])return e[Symbol.asyncIterator]();if("function"===typeof e.next)return e}throw new Error("argument is not an iterator or iterable")}},function(e,t,r){"use strict";var n=r(0),i=r(6),o=r(8),a=r(9);Object.defineProperty(t,"__esModule",{value:!0}),t.XXHandshake=void 0;var s=r(13),u=r(831),c=r(115),f=r(174),l=r(209),h=function(){function e(t,r,n,i,a,c,f){o(this,e),this.isInitiator=t,this.payload=r,this.prologue=n,this.staticKeypair=i,this.connection=a,c&&(this.remotePeer=c),this.xx=null!==f&&void 0!==f?f:new u.XX,this.session=this.xx.initSession(this.isInitiator,this.prologue,this.staticKeypair),this.remoteEarlyData=s.Buffer.alloc(0)}return a(e,[{key:"propose",value:function(){var e=i(n.mark((function e(){var t,r,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f.logLocalStaticKeys(this.session.hs.s),!this.isInitiator){e.next=9;break}f.logger("Stage 0 - Initiator starting to send first message."),t=this.xx.sendMessage(this.session,s.Buffer.alloc(0)),this.connection.writeLP(l.encode0(t)),f.logger("Stage 0 - Initiator finished sending first message."),f.logLocalEphemeralKeys(this.session.hs.e),e.next=20;break;case 9:return f.logger("Stage 0 - Responder waiting to receive first message..."),e.t0=l,e.next=13,this.connection.readLP();case 13:if(e.t1=e.sent.slice(),r=e.t0.decode0.call(e.t0,e.t1),i=this.xx.recvMessage(this.session,r),i.valid){e.next=18;break}throw new Error("xx handshake stage 0 validation fail");case 18:f.logger("Stage 0 - Responder received first message."),f.logRemoteEphemeralKey(this.session.hs.re);case 20:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"exchange",value:function(){var e=i(n.mark((function e(){var t,r,i,o,a,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isInitiator){e.next=37;break}return f.logger("Stage 1 - Initiator waiting to receive first message from responder..."),e.t0=l,e.next=5,this.connection.readLP();case 5:if(e.t1=e.sent.slice(),t=e.t0.decode1.call(e.t0,e.t1),r=this.xx.recvMessage(this.session,t),i=r.plaintext,r.valid){e.next=10;break}throw new Error("xx handshake stage 1 validation fail");case 10:return f.logger("Stage 1 - Initiator received the message."),f.logRemoteEphemeralKey(this.session.hs.re),f.logRemoteStaticKey(this.session.hs.rs),f.logger("Initiator going to check remote's signature..."),e.prev=14,e.next=17,c.decodePayload(i);case 17:if(o=e.sent,e.t2=this.remotePeer,e.t2){e.next=23;break}return e.next=22,c.getPeerIdFromPayload(o);case 22:e.t2=e.sent;case 23:return this.remotePeer=e.t2,e.next=26,c.verifySignedPayload(t.ns,o,this.remotePeer);case 26:this.remotePeer=e.sent,this.setRemoteEarlyData(o.data),e.next=34;break;case 30:throw e.prev=30,e.t3=e.catch(14),a=e.t3,new Error("Error occurred while verifying signed payload: ".concat(a.message));case 34:f.logger("All good with the signature!"),e.next=42;break;case 37:f.logger("Stage 1 - Responder sending out first message with signed payload and static key."),s=this.xx.sendMessage(this.session,this.payload),this.connection.writeLP(l.encode1(s)),f.logger("Stage 1 - Responder sent the second handshake message with signed payload."),f.logLocalEphemeralKeys(this.session.hs.e);case 42:case"end":return e.stop()}}),e,this,[[14,30]])})));return function(){return e.apply(this,arguments)}}()},{key:"finish",value:function(){var e=i(n.mark((function e(){var t,r,i,o,a,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isInitiator){e.next=7;break}f.logger("Stage 2 - Initiator sending third handshake message."),t=this.xx.sendMessage(this.session,this.payload),this.connection.writeLP(l.encode2(t)),f.logger("Stage 2 - Initiator sent message with signed payload."),e.next=36;break;case 7:return f.logger("Stage 2 - Responder waiting for third handshake message..."),e.t0=l,e.next=11,this.connection.readLP();case 11:if(e.t1=e.sent.slice(),r=e.t0.decode2.call(e.t0,e.t1),i=this.xx.recvMessage(this.session,r),o=i.plaintext,i.valid){e.next=16;break}throw new Error("xx handshake stage 2 validation fail");case 16:return f.logger("Stage 2 - Responder received the message, finished handshake."),e.prev=17,e.next=20,c.decodePayload(o);case 20:if(a=e.sent,e.t2=this.remotePeer,e.t2){e.next=26;break}return e.next=25,c.getPeerIdFromPayload(a);case 25:e.t2=e.sent;case 26:return this.remotePeer=e.t2,e.next=29,c.verifySignedPayload(this.session.hs.rs,a,this.remotePeer);case 29:this.setRemoteEarlyData(a.data),e.next=36;break;case 32:throw e.prev=32,e.t3=e.catch(17),s=e.t3,new Error("Error occurred while verifying signed payload: ".concat(s.message));case 36:f.logCipherState(this.session);case 37:case"end":return e.stop()}}),e,this,[[17,32]])})));return function(){return e.apply(this,arguments)}}()},{key:"encrypt",value:function(e,t){var r=this.getCS(t);return this.xx.encryptWithAd(r,s.Buffer.alloc(0),e)}},{key:"decrypt",value:function(e,t){var r=this.getCS(t,!1);return this.xx.decryptWithAd(r,s.Buffer.alloc(0),e)}},{key:"getRemoteStaticKey",value:function(){return this.session.hs.rs}},{key:"getCS",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e.cs1||!e.cs2)throw new Error("Handshake not completed properly, cipher state does not exist.");return this.isInitiator?t?e.cs1:e.cs2:t?e.cs2:e.cs1}},{key:"setRemoteEarlyData",value:function(e){e&&(this.remoteEarlyData=s.Buffer.from(e.buffer,e.byteOffset,e.length))}}]),e}();t.XXHandshake=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(206),i=r(94);t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var o=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._temp),this.reset()},e.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[r++],t--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(r=s(this._temp,this._state,e,r,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[r++],t--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,i=t/536870912|0,o=t<<3,a=t%64<56?64:128;this._buffer[r]=128;for(var u=r+1;u0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.state),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA256=o;var a=new Int32Array([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 s(e,t,r,i,o){for(;o>=64;){for(var s=t[0],u=t[1],c=t[2],f=t[3],l=t[4],h=t[5],d=t[6],p=t[7],v=0;v<16;v++){var y=i+4*v;e[v]=n.readUint32BE(r,y)}for(v=16;v<64;v++){var b=e[v-2],g=(b>>>17|b<<15)^(b>>>19|b<<13)^b>>>10,m=((b=e[v-15])>>>7|b<<25)^(b>>>18|b<<14)^b>>>3;e[v]=(g+e[v-7]|0)+(m+e[v-16]|0)}for(v=0;v<64;v++){g=(((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&h^~l&d)|0)+(p+(a[v]+e[v]|0)|0)|0,m=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&u^s&c^u&c)|0;p=d,d=h,h=l,l=f+g|0,f=c,c=u,u=s,s=g+m|0}t[0]+=s,t[1]+=u,t[2]+=c,t[3]+=f,t[4]+=l,t[5]+=h,t[6]+=d,t[7]+=p,i+=64,o-=64}return i}t.hash=function(e){var t=new o;t.update(e);var r=t.digest();return t.clean(),r}},function(e,t,r){"use strict";var n=r(29),i=r(98);function o(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}var a=o("utf8","u",(function(e){return"u"+new TextDecoder("utf8").decode(e)}),(function(e){return(new TextEncoder).encode(e.substring(1))})),s=o("ascii","a",(function(e){for(var t="a",r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.algorithm,r=void 0===t?"AES-GCM":t,u=e.nonceLength,c=void 0===u?12:u,f=e.keyLength,l=void 0===f?16:f,h=e.digest,d=void 0===h?"SHA-256":h,p=e.saltLength,v=void 0===p?16:p,y=e.iterations,b=void 0===y?32767:y,g=s.get();function m(e,t){return w.apply(this,arguments)}function w(){return(w=i(n.mark((function e(t,i){var s,u,f,h,p,y,m;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=g.getRandomValues(new Uint8Array(v)),u=g.getRandomValues(new Uint8Array(c)),f={name:r,iv:u},h={name:"PBKDF2",salt:s,iterations:b,hash:{name:d}},e.next=6,g.subtle.importKey("raw",a(i),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]);case 6:return p=e.sent,e.next=9,g.subtle.deriveKey(h,p,{name:r,length:l},!0,["encrypt"]);case 9:return y=e.sent,e.next=12,g.subtle.encrypt(f,y,t);case 12:return m=e.sent,e.abrupt("return",o([s,f.iv,new Uint8Array(m)]));case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e,t){return S.apply(this,arguments)}function S(){return(S=i(n.mark((function e(t,i){var o,s,u,f,h,p,y,m;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.slice(0,v),s=t.slice(v,v+c),u=t.slice(v+c),f={name:r,iv:s},h={name:"PBKDF2",salt:o,iterations:b,hash:{name:d}},e.next=7,g.subtle.importKey("raw",a(i),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]);case 7:return p=e.sent,e.next=10,g.subtle.deriveKey(h,p,{name:r,length:l},!0,["decrypt"]);case 10:return y=e.sent,e.next=13,g.subtle.decrypt(f,y,u);case 13:return m=e.sent,e.abrupt("return",new Uint8Array(m));case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return l*=8,{encrypt:m,decrypt:k}}}},function(e,t,r){"use strict";var n=r(205),i=r(15);e.exports=function(e){if(isNaN(e)||e<=0)throw i(new Error("random bytes length must be a Number bigger than 0"),"ERR_INVALID_LENGTH");return n(e)}},function(e,t,r){"use strict";var n=r(40),i=r(48),o=r(8),a=r(9),s=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),u=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return u(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractHandshake=t.MIN_NONCE=void 0;var f=r(13),l=c(r(279)),h=c(r(444)),d=r(854),p=r(115),v=r(174);t.MIN_NONCE=0;var y=function(){function e(){o(this,e)}return a(e,[{key:"encryptWithAd",value:function(e,t,r){var n=this.encrypt(e.k,e.n,t,r);return this.setNonce(e,this.incrementNonce(e.n)),n}},{key:"decryptWithAd",value:function(e,t,r){var n=this.decrypt(e.k,e.n,t,r),i=n.plaintext,o=n.valid;return this.setNonce(e,this.incrementNonce(e.n)),{plaintext:i,valid:o}}},{key:"hasKey",value:function(e){return!this.isEmptyKey(e.k)}},{key:"setNonce",value:function(e,t){e.n=t}},{key:"createEmptyKey",value:function(){return f.Buffer.alloc(32)}},{key:"isEmptyKey",value:function(e){return this.createEmptyKey().equals(e)}},{key:"incrementNonce",value:function(e){return e+1}},{key:"nonceToBytes",value:function(e){var t=f.Buffer.alloc(12);return t.writeUInt32LE(e,4),t}},{key:"encrypt",value:function(e,t,r,n){var i=this.nonceToBytes(t),o=new d.ChaCha20Poly1305(e).seal(i,n,r);return f.Buffer.from(o.buffer,o.byteOffset,o.length)}},{key:"encryptAndHash",value:function(e,t){var r;return r=this.hasKey(e.cs)?this.encryptWithAd(e.cs,e.h,t):t,this.mixHash(e,r),r}},{key:"decrypt",value:function(e,t,r,n){var i=this.nonceToBytes(t),o=new d.ChaCha20Poly1305(e).open(i,n,r);return o?{plaintext:f.Buffer.from(o.buffer,o.byteOffset,o.length),valid:!0}:{plaintext:f.Buffer.from(""),valid:!1}}},{key:"decryptAndHash",value:function(e,t){var r,n=!0;if(this.hasKey(e.cs)){var i=this.decryptWithAd(e.cs,e.h,t);r=i.plaintext,n=i.valid}else r=t;return this.mixHash(e,t),{plaintext:r,valid:n}}},{key:"dh",value:function(e,t){try{var r=l.sharedKey(e,t),n=f.Buffer.from(r.buffer,r.byteOffset,r.length),i=f.Buffer.alloc(32);return n.copy(i),i}catch(o){return v.logger(o.message),f.Buffer.alloc(32)}}},{key:"mixHash",value:function(e,t){e.h=this.getHash(e.h,t)}},{key:"getHash",value:function(e,t){var r=h.hash(f.Buffer.from([].concat(i(e),i(t))));return f.Buffer.from(r.buffer,r.byteOffset,r.length)}},{key:"mixKey",value:function(e,t){var r=p.getHkdf(e.ck,t),i=n(r,2),o=i[0],a=i[1];e.cs=this.initializeKey(a),e.ck=o}},{key:"initializeKey",value:function(e){return{k:e,n:t.MIN_NONCE}}},{key:"initializeSymmetric",value:function(e){var t=f.Buffer.from(e,"utf-8"),r=this.hashProtocolName(t),n=r,i=this.createEmptyKey();return{cs:this.initializeKey(i),ck:n,h:r}}},{key:"hashProtocolName",value:function(e){if(e.length<=32){var t=f.Buffer.alloc(32);return e.copy(t),t}return this.getHash(e,f.Buffer.alloc(0))}},{key:"split",value:function(e){var t=p.getHkdf(e.ck,f.Buffer.alloc(0)),r=n(t,2),i=r[0],o=r[1];return{cs1:this.initializeKey(i),cs2:this.initializeKey(o)}}},{key:"writeMessageRegular",value:function(e,t){var r=this.encryptWithAd(e,f.Buffer.alloc(0),t);return{ne:this.createEmptyKey(),ns:f.Buffer.alloc(0),ciphertext:r}}},{key:"readMessageRegular",value:function(e,t){return this.decryptWithAd(e,f.Buffer.alloc(0),t.ciphertext)}}]),e}();t.AbstractHandshake=y},function(e,t,r){"use strict";var n=r(0),i=r(45),o=r(44),a=r(30),s=r(15),u=r(289),c=r(865),f=r(450);function l(){return(l=o(n.mark((function e(t){var r,o,u,c,f,l,h,d,p,v=arguments;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=v.length>1&&void 0!==v[1]?v[1]:1,o=0,u=!0,c=!1,e.prev=4,l=a(t);case 6:return e.next=8,i(l.next());case 8:return h=e.sent,u=h.done,e.next=12,i(h.value);case 12:if(d=e.sent,u){e.next=21;break}return p=d,o++,e.next=18,p;case 18:u=!0,e.next=6;break;case 21:e.next=27;break;case 23:e.prev=23,e.t0=e.catch(4),c=!0,f=e.t0;case 27:if(e.prev=27,e.prev=28,u||null==l.return){e.next=32;break}return e.next=32,i(l.return());case 32:if(e.prev=32,!c){e.next=35;break}throw f;case 35:return e.finish(32);case 36:return e.finish(27);case 37:if(!(o","main":"src/index.js","types":"dist/src/index.d.ts","typesVersions":{"*":{"src/*":["dist/src/*","dist/src/*/index"]}},"files":["dist","src"],"scripts":{"lint":"aegir lint","build":"aegir build","build:proto":"npm run build:proto:circuit && npm run build:proto:identify && npm run build:proto:plaintext && npm run build:proto:address-book && npm run build:proto:proto-book && npm run build:proto:peer-record && npm run build:proto:envelope","build:proto:circuit":"pbjs -t static-module -w commonjs -r libp2p-circuit --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/circuit/protocol/index.js ./src/circuit/protocol/index.proto","build:proto:identify":"pbjs -t static-module -w commonjs -r libp2p-identify --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/identify/message.js ./src/identify/message.proto","build:proto:plaintext":"pbjs -t static-module -w commonjs -r libp2p-plaintext --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/insecure/proto.js ./src/insecure/proto.proto","build:proto:address-book":"pbjs -t static-module -w commonjs -r libp2p-address-book --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/peer-store/persistent/pb/address-book.js ./src/peer-store/persistent/pb/address-book.proto","build:proto:proto-book":"pbjs -t static-module -w commonjs -r libp2p-proto-book --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/peer-store/persistent/pb/proto-book.js ./src/peer-store/persistent/pb/proto-book.proto","build:proto:peer-record":"pbjs -t static-module -w commonjs -r libp2p-peer-record --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/record/peer-record/peer-record.js ./src/record/peer-record/peer-record.proto","build:proto:envelope":"pbjs -t static-module -w commonjs -r libp2p-envelope --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/record/envelope/envelope.js ./src/record/envelope/envelope.proto","build:proto-types":"npm run build:proto-types:circuit && npm run build:proto-types:identify && npm run build:proto-types:plaintext && npm run build:proto-types:address-book && npm run build:proto-types:proto-book && npm run build:proto-types:peer-record && npm run build:proto-types:envelope","build:proto-types:circuit":"pbts -o src/circuit/protocol/index.d.ts src/circuit/protocol/index.js","build:proto-types:identify":"pbts -o src/identify/message.d.ts src/identify/message.js","build:proto-types:plaintext":"pbts -o src/insecure/proto.d.ts src/insecure/proto.js","build:proto-types:address-book":"pbts -o src/peer-store/persistent/pb/address-book.d.ts src/peer-store/persistent/pb/address-book.js","build:proto-types:proto-book":"pbts -o src/peer-store/persistent/pb/proto-book.d.ts src/peer-store/persistent/pb/proto-book.js","build:proto-types:peer-record":"pbts -o src/record/peer-record/peer-record.d.ts src/record/peer-record/peer-record.js","build:proto-types:envelope":"pbts -o src/record/envelope/envelope.d.ts src/record/envelope/envelope.js","test":"aegir test","test:ts":"aegir build --no-bundle && npm run test --prefix test/ts-use","test:node":"aegir test -t node -f \\"./test/**/*.{node,spec}.js\\"","test:browser":"aegir test -t browser","test:examples":"cd examples && npm run test:all","prepare":"aegir build --no-bundle","release":"aegir release -t node -t browser","release-minor":"aegir release --type minor -t node -t browser","release-major":"aegir release --type major -t node -t browser","coverage":"nyc --reporter=text --reporter=lcov npm run test:node"},"repository":{"type":"git","url":"https://github.com/libp2p/js-libp2p.git"},"keywords":["libp2p","network","p2p","peer","peer-to-peer","IPFS"],"bugs":{"url":"https://github.com/libp2p/js-libp2p/issues"},"homepage":"https://libp2p.io","license":"MIT","engines":{"node":">=14.0.0"},"browser":{"@motrix/nat-api":false},"eslintConfig":{"extends":"ipfs","ignorePatterns":["!.aegir.js","test/ts-use"]},"dependencies":{"@motrix/nat-api":"^0.3.1","@vascosantos/moving-average":"^1.1.0","abort-controller":"^3.0.0","aggregate-error":"^3.1.0","any-signal":"^2.1.1","bignumber.js":"^9.0.1","class-is":"^1.1.0","debug":"^4.3.1","err-code":"^3.0.0","es6-promisify":"^6.1.1","events":"^3.3.0","hashlru":"^2.3.0","interface-datastore":"^5.1.1","it-all":"^1.0.4","it-buffer":"^0.1.2","it-drain":"^1.0.3","it-filter":"^1.0.1","it-first":"^1.0.4","it-handshake":"^2.0.0","it-length-prefixed":"^5.0.2","it-map":"^1.0.4","it-merge":"^1.0.0","it-pipe":"^1.1.0","it-take":"^1.0.0","libp2p-crypto":"^0.19.4","libp2p-interfaces":"^1.0.0","libp2p-utils":"^0.4.0","mafmt":"^10.0.0","merge-options":"^3.0.4","multiaddr":"^10.0.0","multiformats":"^9.0.0","multistream-select":"^2.0.0","mutable-proxy":"^1.0.0","node-forge":"^0.10.0","p-any":"^3.0.0","p-fifo":"^1.0.0","p-retry":"^4.4.0","p-settle":"^4.1.1","peer-id":"^0.15.0","private-ip":"^2.1.0","protobufjs":"^6.10.2","retimer":"^3.0.0","sanitize-filename":"^1.6.3","set-delayed-interval":"^1.0.0","streaming-iterables":"^6.0.0","timeout-abort-controller":"^1.1.1","uint8arrays":"^3.0.0","varint":"^6.0.0","wherearewe":"^1.0.0","xsalsa20":"^1.1.0"},"devDependencies":{"@chainsafe/libp2p-noise":"^4.0.0","@nodeutils/defaults-deep":"^1.1.0","@types/es6-promisify":"^6.0.0","@types/node":"^16.0.1","@types/node-forge":"^0.10.1","@types/varint":"^6.0.0","abortable-iterator":"^3.0.0","aegir":"^33.1.1","buffer":"^6.0.3","delay":"^5.0.0","interop-libp2p":"^0.4.0","into-stream":"^6.0.0","ipfs-http-client":"^50.1.1","it-concat":"^2.0.0","it-pair":"^1.0.0","it-pushable":"^1.4.0","libp2p":".","libp2p-bootstrap":"^0.13.0","libp2p-delegated-content-routing":"^0.11.0","libp2p-delegated-peer-routing":"^0.10.0","libp2p-floodsub":"^0.27.0","libp2p-gossipsub":"^0.11.0","libp2p-interfaces-compliance-tests":"^1.0.0","libp2p-kad-dht":"^0.23.0","libp2p-mdns":"^0.17.0","libp2p-mplex":"^0.10.1","libp2p-tcp":"^0.17.0","libp2p-webrtc-star":"^0.23.0","libp2p-websockets":"^0.16.0","nock":"^13.0.3","p-defer":"^3.0.0","p-times":"^3.0.0","p-wait-for":"^3.2.0","rimraf":"^3.0.2","sinon":"^11.1.1","util":"^0.12.3"},"contributors":["Vasco Santos ","David Dias ","Jacob Heun ","Alex Potsides ","Alan Shaw ","Cayman ","Pedro Teixeira ","Friedel Ziegelmayer ","Maciej Kr\xfcger ","Hugo Dias ","Volker Mische ","Chris Dostert ","dirkmc ","Richard Littauer ","zeim839 <50573884+zeim839@users.noreply.github.com>","Ryan Bell ","a1300 ","\u1d20\u026a\u1d04\u1d1b\u1d0f\u0280 \u0299\u1d0a\u1d07\u029f\u1d0b\u029c\u1d0f\u029f\u1d0d ","Andrew Nesbitt ","Elven ","Franck Royer ","Giovanni T. Parra ","Samlior ","Thomas Eizinger ","acolytec3 <17355484+acolytec3@users.noreply.github.com>","Didrik Nordstr\xf6m ","Irakli Gozalishvili ","Joel Gustafson ","John Rees ","Jo\xe3o Santos ","Julien Bouquillon ","Kevin Kwok ","Kevin Lacker ","Lars Gierth ","Ethan Lam ","Marcin Tojek ","Michael Burns <5170+mburns@users.noreply.github.com>","Miguel Mota ","Nuno Nogueira ","Dmitriy Ryajov ","Philipp Muens ","RasmusErik Voel Jensen ","Diogo Silva ","Robert Kiel ","phillmac ","robertkiel ","Smite Chow ","Soeren ","S\xf6nke Hahn ","TJKoury ","shresthagrawal <34920931+shresthagrawal@users.noreply.github.com>","Tiago Alves ","Daijiro Wachi ","Yusef Napora ","Zane Starr ","swedneck <40505480+swedneck@users.noreply.github.com>","Aleksei ","Cindy Wu ","Aditya Bose <13054902+adbose@users.noreply.github.com>","Chris Bratlien ","ebinks ","greenSnot ","Bernd Strehl ","Francis Gulotta ","isan_rivkin ","Florian-Merle ","mayerwin ","Guy Sviry <32539816+guysv@users.noreply.github.com>","Henrique Dias ","mcclure ","Felipe Martins ","Fei Liu "]}')},function(e,t,r){"use strict";var n=r(48),i=r(875);function o(e,t){var r=i(e.multiaddr),n=i(t.multiaddr);return r&&!n?1:!r&&n||e.isCertified&&!t.isCertified?-1:!e.isCertified&&t.isCertified?1:0}e.exports.publicAddressesFirst=function(e){return n(e).sort(o)}},function(e,t,r){"use strict";e.exports=r(876)},function(e,t,r){"use strict";var n=r(48),i=r(0),o=r(40),a=r(21),s=r(6),u=r(29),c=r(8),f=r(9),l=r(22),h=Object.assign(l("libp2p:transports"),{error:l("libp2p:transports:err")}),d=r(878),p=r(50).codes,v=r(15),y=r(461).updateSelfPeerRecord,b=function(){function e(t){var r=t.libp2p,n=t.upgrader,i=t.faultTolerance,o=void 0===i?g.FATAL_ALL:i;c(this,e),this.libp2p=r,this.upgrader=n,this._transports=new Map,this._listeners=new Map,this._listenerOptions=new Map,this.faultTolerance=o}return f(e,[{key:"add",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(h("adding %s",e),!e)throw v(new Error("Transport must have a valid key, was given '".concat(e,"'")),p.ERR_INVALID_KEY);if(this._transports.has(e))throw v(new Error("There is already a transport with this key"),p.ERR_DUPLICATE_TRANSPORT);var n=new t(u(u({},r),{},{libp2p:this.libp2p,upgrader:this.upgrader}));this._transports.set(e,n),this._listenerOptions.set(e,r.listenerOptions||{}),this._listeners.has(e)||this._listeners.set(e,[])}},{key:"close",value:function(){var e=s(i.mark((function e(){var t,r,n,s,u,c,f,l,d,p;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=[],r=a(this._listeners);try{for(r.s();!(n=r.n()).done;)for(s=o(n.value,2),u=s[0],c=s[1],h("closing listeners for %s",u);c.length;)(f=c.pop()).removeAllListeners("listening"),f.removeAllListeners("close"),t.push(f.close())}catch(i){r.e(i)}finally{r.f()}return e.next=5,Promise.all(t);case 5:h("all listeners closed"),l=a(this._listeners.keys());try{for(l.s();!(d=l.n()).done;)p=d.value,this._listeners.set(p,[])}catch(i){l.e(i)}finally{l.f()}case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"dial",value:function(){var e=s(i.mark((function e(t,r){var n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.transportForMultiaddr(t)){e.next=3;break}throw v(new Error("No transport available for address ".concat(String(t))),p.ERR_TRANSPORT_UNAVAILABLE);case 3:return e.prev=3,e.next=6,n.dial(t,r);case 6:return e.abrupt("return",e.sent);case 9:throw e.prev=9,e.t0=e.catch(3),e.t0.code||(e.t0.code=p.ERR_TRANSPORT_DIAL_FAILED),e.t0;case 13:case"end":return e.stop()}}),e,this,[[3,9]])})));return function(t,r){return e.apply(this,arguments)}}()},{key:"getAddrs",value:function(){var e,t=[],r=a(this._listeners.values());try{for(r.s();!(e=r.n()).done;){var i,o=e.value,s=a(o);try{for(s.s();!(i=s.n()).done;){var u=i.value;t=[].concat(n(t),n(u.getAddrs()))}}catch(c){s.e(c)}finally{s.f()}}}catch(c){r.e(c)}finally{r.f()}return t}},{key:"getTransports",value:function(){return this._transports.values()}},{key:"transportForMultiaddr",value:function(e){var t,r=a(this._transports.values());try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.filter([e]).length)return n}}catch(i){r.e(i)}finally{r.f()}return null}},{key:"listen",value:function(){var e=s(i.mark((function e(t){var r,n,s,u,c,f,l,b,m,w,k,S,E,_,A=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&0!==t.length){e.next=3;break}return h("no addresses were provided for listening, this node is dial only"),e.abrupt("return");case 3:r=[],n=a(this._transports.entries()),e.prev=5,n.s();case 7:if((s=n.n()).done){e.next=24;break}u=o(s.value,2),c=u[0],f=u[1],l=f.filter(t),b=[],m=a(l);try{for(m.s();!(w=m.n()).done;)k=w.value,h("creating listener for %s on %s",c,k),S=f.createListener(this._listenerOptions.get(c)),this._listeners.get(c).push(S),S.on("listening",(function(){return y(A.libp2p)})),S.on("close",(function(){return y(A.libp2p)})),b.push(S.listen(k))}catch(i){m.e(i)}finally{m.f()}if(0!==b.length){e.next=16;break}return r.push(c),e.abrupt("continue",22);case 16:return e.next=18,d(b);case 18:if(E=e.sent,E.find((function(e){return!0===e.isFulfilled}))||this.faultTolerance===g.NO_FATAL){e.next=22;break}throw v(new Error("Transport (".concat(c,") could not listen on any available address")),p.ERR_NO_VALID_ADDRESSES);case 22:e.next=7;break;case 24:e.next=29;break;case 26:e.prev=26,e.t0=e.catch(5),n.e(e.t0);case 29:return e.prev=29,n.f(),e.finish(29);case 32:if(r.length!==this._transports.size){e.next=37;break}if(_="no valid addresses were provided for transports [".concat(r,"]"),this.faultTolerance!==g.FATAL_ALL){e.next=36;break}throw v(new Error(_),p.ERR_NO_VALID_ADDRESSES);case 36:h("libp2p in dial mode only: ".concat(_));case 37:case"end":return e.stop()}}),e,this,[[5,26,29,32]])})));return function(t){return e.apply(this,arguments)}}()},{key:"remove",value:function(){var e=s(i.mark((function e(t){var r,n,o;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h("removing %s",t),!this._listeners.has(t)){e.next=21;break}r=a(this._listeners.get(t)),e.prev=3,r.s();case 5:if((n=r.n()).done){e.next=13;break}return(o=n.value).removeAllListeners("listening"),o.removeAllListeners("close"),e.next=11,o.close();case 11:e.next=5;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(3),r.e(e.t0);case 18:return e.prev=18,r.f(),e.finish(18);case 21:this._transports.delete(t),this._listeners.delete(t);case 23:case"end":return e.stop()}}),e,this,[[3,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"removeAll",value:function(){var e=s(i.mark((function e(){var t,r,n,o;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=[],r=a(this._transports.keys());try{for(r.s();!(n=r.n()).done;)o=n.value,t.push(this.remove(o))}catch(i){r.e(i)}finally{r.f()}return e.next=5,Promise.all(t);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),g={FATAL_ALL:0,NO_FATAL:1};b.FaultTolerance=g,e.exports=b},function(e,t,r){"use strict";var n=r(0),i=r(6),o=r(212),a=r(293);function s(){return(s=i(n.mark((function e(t){var r,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new a({peerId:t.peerId,multiaddrs:t.multiaddrs}),e.next=3,o.seal(r,t.peerId);case 3:i=e.sent,t.peerStore.addressBook.consumePeerRecord(i);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}e.exports.updateSelfPeerRecord=function(e){return s.apply(this,arguments)}},function(e,t,r){"use strict";var n=r(29),i=r(98);function o(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}var a=o("utf8","u",(function(e){return"u"+new TextDecoder("utf8").decode(e)}),(function(e){return(new TextEncoder).encode(e.substring(1))})),s=o("ascii","a",(function(e){for(var t="a",r=0;r0?(a._scheduled=a._rescheduled-(o()-a._started),a._schedule(a._scheduled)):(a._triggered=!0,t.apply(null,a._args))},this._timer=setTimeout(this._timerWrapper,r)}return i(e,[{key:"reschedule",value:function(e){e||(e=this._scheduled);var t=o();t+e-(this._started+this._scheduled)<0?(clearTimeout(this._timer),this._schedule(e)):this._triggered?this._schedule(e):(this._started=t,this._rescheduled=e)}},{key:"_schedule",value:function(e){this._triggered=!1,this._started=o(),this._rescheduled=0,this._scheduled=e,this._timer=setTimeout(this._timerWrapper,e)}},{key:"clear",value:function(){clearTimeout(this._timer)}}]),e}();e.exports=function(){if("function"!==typeof arguments[0])throw new Error("callback needed");if("number"!==typeof arguments[1])throw new Error("timeout needed");var e;if(arguments.length>0){e=new Array(arguments.length-2);for(var t=0;t0)try{var t,r=n(this._cancelHandlers);try{for(r.s();!(t=r.n()).done;){(0,t.value)()}}catch(i){r.e(i)}finally{r.f()}}catch(o){return void this._reject(o)}this._rejectOnCancel&&this._reject(new u(e))}}},{key:"isCanceled",get:function(){return this._isCanceled}}],[{key:"fn",value:function(t){return function(){for(var r=arguments.length,n=new Array(r),i=0;i0&&void 0!==arguments[0]?arguments[0]:"utf8";return s(this._buf,e)}},{key:"uint8Array",value:function(){return this._buf}},{key:Symbol.toStringTag,get:function(){return"Key(".concat(this.toString(),")")}},{key:"clean",value:function(){if(this._buf&&0!==this._buf.byteLength||(this._buf=f),this._buf[0]!==l){var e=new Uint8Array(this._buf.byteLength+1);e.fill(l,0,1),e.set(this._buf,1),this._buf=e}for(;this._buf.byteLength>1&&this._buf[this._buf.byteLength-1]===l;)this._buf=this._buf.subarray(0,-1)}},{key:"less",value:function(e){for(var t=this.list(),r=e.list(),n=0;no)return!1}return t.length1&&void 0!==arguments[1]?arguments[1]:"utf8";return"utf8"===t||"utf-8"===t?i.encode(e):"ascii"===t?o(e):n(t).decode(e)}},function(e,t,r){"use strict";var n=r(6),i=r(0),o=r(8),a=r(9),s=r(45),u=r(44),c=r(30),f=r(474).sortAll,l=r(453),h=r(289),d=r(450),p=function(){function e(){o(this,e)}return a(e,[{key:"open",value:function(){return Promise.reject(new Error(".open is not implemented"))}},{key:"close",value:function(){return Promise.reject(new Error(".close is not implemented"))}},{key:"put",value:function(e,t,r){return Promise.reject(new Error(".put is not implemented"))}},{key:"get",value:function(e,t){return Promise.reject(new Error(".get is not implemented"))}},{key:"has",value:function(e,t){return Promise.reject(new Error(".has is not implemented"))}},{key:"delete",value:function(e,t){return Promise.reject(new Error(".delete is not implemented"))}},{key:"putMany",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u(i.mark((function n(){var o,a,u,f,l,h,d,p,v;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=!0,a=!1,n.prev=2,f=c(e);case 4:return n.next=6,s(f.next());case 6:return l=n.sent,o=l.done,n.next=10,s(l.value);case 10:if(h=n.sent,o){n.next=20;break}return p=(d=h).key,v=d.value,n.next=15,s(t.put(p,v,r));case 15:return n.next=17,{key:p,value:v};case 17:o=!0,n.next=4;break;case 20:n.next=26;break;case 22:n.prev=22,n.t0=n.catch(2),a=!0,u=n.t0;case 26:if(n.prev=26,n.prev=27,o||null==f.return){n.next=31;break}return n.next=31,s(f.return());case 31:if(n.prev=31,!a){n.next=34;break}throw u;case 34:return n.finish(31);case 35:return n.finish(26);case 36:case"end":return n.stop()}}),n,null,[[2,22,26,36],[27,,31,35]])})))()}},{key:"getMany",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u(i.mark((function n(){var o,a,u,f,l,h,d;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=!0,a=!1,n.prev=2,f=c(e);case 4:return n.next=6,s(f.next());case 6:return l=n.sent,o=l.done,n.next=10,s(l.value);case 10:if(h=n.sent,o){n.next=18;break}return d=h,n.next=15,t.get(d,r);case 15:o=!0,n.next=4;break;case 18:n.next=24;break;case 20:n.prev=20,n.t0=n.catch(2),a=!0,u=n.t0;case 24:if(n.prev=24,n.prev=25,o||null==f.return){n.next=29;break}return n.next=29,s(f.return());case 29:if(n.prev=29,!a){n.next=32;break}throw u;case 32:return n.finish(29);case 33:return n.finish(24);case 34:case"end":return n.stop()}}),n,null,[[2,20,24,34],[25,,29,33]])})))()}},{key:"deleteMany",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u(i.mark((function n(){var o,a,u,f,l,h,d;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=!0,a=!1,n.prev=2,f=c(e);case 4:return n.next=6,s(f.next());case 6:return l=n.sent,o=l.done,n.next=10,s(l.value);case 10:if(h=n.sent,o){n.next=20;break}return d=h,n.next=15,s(t.delete(d,r));case 15:return n.next=17,d;case 17:o=!0,n.next=4;break;case 20:n.next=26;break;case 22:n.prev=22,n.t0=n.catch(2),a=!0,u=n.t0;case 26:if(n.prev=26,n.prev=27,o||null==f.return){n.next=31;break}return n.next=31,s(f.return());case 31:if(n.prev=31,!a){n.next=34;break}throw u;case 34:return n.finish(31);case 35:return n.finish(26);case 36:case"end":return n.stop()}}),n,null,[[2,22,26,36],[27,,31,35]])})))()}},{key:"batch",value:function(){var e=this,t=[],r=[];return{put:function(e,r){t.push({key:e,value:r})},delete:function(e){r.push(e)},commit:function(){var o=n(i.mark((function n(o){return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,l(e.putMany(t,o));case 2:return t=[],n.next=5,l(e.deleteMany(r,o));case 5:r=[];case 6:case"end":return n.stop()}}),n)})));return function(e){return o.apply(this,arguments)}}()}}},{key:"_all",value:function(e,t){return u(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("._all is not implemented");case 1:case"end":return e.stop()}}),e)})))()}},{key:"_allKeys",value:function(e,t){return u(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("._allKeys is not implemented");case 1:case"end":return e.stop()}}),e)})))()}},{key:"query",value:function(e,t){var r=this._all(e,t);if(null!=e.prefix&&(r=h(r,(function(t){return t.key.toString().startsWith(e.prefix)}))),Array.isArray(e.filters)&&(r=e.filters.reduce((function(e,t){return h(e,t)}),r)),Array.isArray(e.orders)&&(r=e.orders.reduce((function(e,t){return f(e,t)}),r)),null!=e.offset){var n=0;r=h(r,(function(){return n++>=e.offset}))}return null!=e.limit&&(r=d(r,e.limit)),r}},{key:"queryKeys",value:function(e,t){var r=this._allKeys(e,t);if(null!=e.prefix&&(r=h(r,(function(t){return t.toString().startsWith(e.prefix)}))),Array.isArray(e.filters)&&(r=e.filters.reduce((function(e,t){return h(e,t)}),r)),Array.isArray(e.orders)&&(r=e.orders.reduce((function(e,t){return f(e,t)}),r)),null!=e.offset){var n=0;r=h(r,(function(){return n++>=e.offset}))}return null!=e.limit&&(r=d(r,e.limit)),r}}]),e}();e.exports=p},function(e,t,r){"use strict";var n=r(0),i=r(44),o=r(45),a=r(30),s=r(138),u=r(918),c=r(919);e.exports={sortAll:function(e,t){return i(n.mark((function r(){var i;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,o(c(e));case 2:return i=r.sent,r.delegateYield(s(a(i.sort(t)),o),"t0",4);case 4:case"end":return r.stop()}}),r)})))()},tmpdir:u,replaceStartWith:function(e,t){var r=new RegExp("^"+t);return e.replace(r,"")}}},function(e,t,r){"use strict";var n=r(15);e.exports={dbOpenFailedError:function(e){return e=e||new Error("Cannot open database"),n(e,"ERR_DB_OPEN_FAILED")},dbDeleteFailedError:function(e){return e=e||new Error("Delete failed"),n(e,"ERR_DB_DELETE_FAILED")},dbWriteFailedError:function(e){return e=e||new Error("Write failed"),n(e,"ERR_DB_WRITE_FAILED")},notFoundError:function(e){return e=e||new Error("Not Found"),n(e,"ERR_NOT_FOUND")},abortedError:function(e){return e=e||new Error("Aborted"),n(e,"ERR_ABORTED")}}},function(e,t,r){var n=r(18);r(167),r(62),r(270),r(112),r(923),r(168),r(272),r(925),r(78),r(34);var i=n.asn1,o=e.exports=n.pki=n.pki||{},a=o.oids,s={};s.CN=a.commonName,s.commonName="CN",s.C=a.countryName,s.countryName="C",s.L=a.localityName,s.localityName="L",s.ST=a.stateOrProvinceName,s.stateOrProvinceName="ST",s.O=a.organizationName,s.organizationName="O",s.OU=a.organizationalUnitName,s.organizationalUnitName="OU",s.E=a.emailAddress,s.emailAddress="E";var u=n.pki.rsa.publicKeyValidator,c={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},f={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},l={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},u,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},h={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[l,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function d(e,t){"string"===typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var d=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=d.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,d.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);f=e.value.value;if(e.keyIdentifier){var p=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;f.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,p))}if(e.authorityCertIssuer){var y=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[v(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];f.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,y))}if(e.serialNumber){var b=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);f.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,b))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);f=e.value.value;var g,m=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),w=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(h=0;h2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(l.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=l[0],u.validity.notAfter=l[1],u.tbsCertificate=r.tbsCertificate,t){var h;if(u.md=null,u.signatureOid in a)switch(a[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create();break;case"RSASSA-PSS":u.md=n.md.sha256.create()}if(null===u.md)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=u.signatureOid,h;var v=i.toDer(u.tbsCertificate);u.md.update(v.getBytes())}var b=n.md.sha1.create();u.issuer.getField=function(e){return d(u.issuer,e)},u.issuer.addField=function(e){y([e]),u.issuer.attributes.push(e)},u.issuer.attributes=o.RDNAttributesAsArray(r.certIssuer,b),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=b.digest().toHex();var g=n.md.sha1.create();return u.subject.getField=function(e){return d(u.subject,e)},u.subject.addField=function(e){y([e]),u.subject.attributes.push(e)},u.subject.attributes=o.RDNAttributesAsArray(r.certSubject,g),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=g.digest().toHex(),r.certExtensions?u.extensions=o.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=o.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},o.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r1&&(r=u.value.charCodeAt(1),o=u.value.length>2?u.value.charCodeAt(2):0),t.digitalSignature=128===(128&r),t.nonRepudiation=64===(64&r),t.keyEncipherment=32===(32&r),t.dataEncipherment=16===(16&r),t.keyAgreement=8===(8&r),t.keyCertSign=4===(4&r),t.cRLSign=2===(2&r),t.encipherOnly=1===(1&r),t.decipherOnly=128===(128&o)}else if("basicConstraints"===t.name){(u=i.fromDer(t.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?t.cA=0!==u.value[0].value.charCodeAt(0):t.cA=!1;var s=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?s=u.value[0].value:u.value.length>1&&(s=u.value[1].value),null!==s&&(t.pathLenConstraint=i.derToInteger(s))}else if("extKeyUsage"===t.name)for(var u=i.fromDer(t.value),c=0;c1&&(r=u.value.charCodeAt(1)),t.client=128===(128&r),t.server=64===(64&r),t.email=32===(32&r),t.objsign=16===(16&r),t.reserved=8===(8&r),t.sslCA=4===(4&r),t.emailCA=2===(2&r),t.objCA=1===(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var l;t.altNames=[];u=i.fromDer(t.value);for(var h=0;h=w&&e0&&a.value.push(o.certificateExtensionsToAsn1(e.extensions)),a},o.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),v(e.subject),o.publicKeyToAsn1(e.publicKey),m(e)])},o.distinguishedNameToAsn1=function(e){return v(e)},o.certificateToAsn1=function(e){var t=e.tbsCertificate||o.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),g(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},o.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;nf.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:o.certificateError.certificate_expired,notBefore:f.validity.notBefore,notAfter:f.validity.notAfter,now:a}),null===u){if(null===(l=t[0]||e.getIssuer(f))&&f.isIssuer(f)&&(h=!0,l=f),l){var d=l;n.util.isArray(d)||(d=[d]);for(var p=!1;!p&&d.length>0;){l=d.shift();try{p=l.verify(f)}catch(S){}}p||(u={message:"Certificate signature is invalid.",error:o.certificateError.bad_certificate})}null!==u||l&&!h||e.hasCertificate(f)||(u={message:"Certificate is not trusted.",error:o.certificateError.unknown_ca})}if(null===u&&l&&!f.isIssuer(l)&&(u={message:"Certificate issuer is invalid.",error:o.certificateError.bad_certificate}),null===u)for(var v={keyUsage:!0,basicConstraints:!0},y=0;null===u&&yg.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:o.certificateError.bad_certificate})}var w=null===u||u.error,k=r.verify?r.verify(w,c,i):w;if(!0!==k)throw!0===w&&(u={message:"The application rejected the certificate.",error:o.certificateError.bad_certificate}),(k||0===k)&&("object"!==typeof k||n.util.isArray(k)?"string"===typeof k&&(u.error=k):(k.message&&(u.message=k.message),k.error&&(u.error=k.error))),u;u=null,s=!1,++c}while(t.length>0);return!0}},function(e,t,r){"use strict";t.PROTOCOL_ID="/multistream/1.0.0"},function(e,t,r){"use strict";var n=r(48),i=r(8),o=r(9),a=r(61),s=r(26),u=r(27),c=r(15),f=r(57).EventEmitter,l=r(43),h=r(942),d=r(943),p=r(944),v=r(945),y=r(50).codes.ERR_INVALID_PARAMETERS,b=function(e){s(r,e);var t=u(r);function r(e){var n,o=e.peerId;return i(this,r),(n=t.call(this))._peerId=o,n.addressBook=new h(a(n)),n.keyBook=new d(a(n)),n.metadataBook=new p(a(n)),n.protoBook=new v(a(n)),n}return o(r,[{key:"start",value:function(){}},{key:"stop",value:function(){}},{key:"peers",get:function(){var e=this,t=new Set([].concat(n(this.addressBook.data.keys()),n(this.keyBook.data.keys()),n(this.protoBook.data.keys()),n(this.metadataBook.data.keys())));this._peerId&&t.delete(this._peerId.toB58String());var r=new Map;return t.forEach((function(t){r.set(t,e.get(l.createFromB58String(t)))})),r}},{key:"delete",value:function(e){var t=this.addressBook.delete(e),r=this.keyBook.delete(e),n=this.protoBook.delete(e),i=this.metadataBook.delete(e);return t||r||n||i}},{key:"get",value:function(e){if(!l.isPeerId(e))throw c(new Error("peerId must be an instance of peer-id"),y);var t=this.keyBook.data.get(e.toB58String()),r=this.addressBook.get(e),n=this.metadataBook.get(e),i=this.protoBook.get(e);if(t||r||n||i)return{id:t||e,addresses:r||[],protocols:i||[],metadata:n}}}]),r}(f);e.exports=b},function(e,t,r){"use strict";var n=r(0),i=r(40),o=r(6),a=r(22),s=Object.assign(a("libp2p:ping"),{error:a("libp2p:ping:err")}),u=r(15),c=r(267),f=r(60).pipe,l=r(281).toBuffer,h=r(312),d=h.collect,p=h.take,v=r(292).equals,y=r(953),b=y.PROTOCOL_NAME,g=y.PING_LENGTH,m=y.PROTOCOL_VERSION;function w(){return(w=o(n.mark((function e(t,r){var o,a,h,y,w,k,S,E,_,A;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o="/".concat(t._config.protocolPrefix,"/").concat(b,"/").concat(m),s("dialing %s to %s",o,r.toB58String?r.toB58String():r),e.next=4,t.dial(r);case 4:return a=e.sent,e.next=7,a.newStream(o);case 7:return h=e.sent,y=h.stream,w=Date.now(),k=c.randomBytes(g),e.next=13,f([k],y,(function(e){return p(1,e)}),l,d);case 13:if(S=e.sent,E=i(S,1),_=E[0],A=Date.now(),v(k,_)){e.next=19;break}throw u(new Error("Received wrong ping ack"),"ERR_WRONG_PING_ACK");case 19:return e.abrupt("return",A-w);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(t=e.exports=function(e,t){return w.apply(this,arguments)}).mount=function(e){e.handle("/".concat(e._config.protocolPrefix,"/").concat(b,"/").concat(m),(function(e){var t=e.stream;return f(t,t)}))},t.unmount=function(e){e.unhandle("/".concat(e._config.protocolPrefix,"/").concat(b,"/").concat(m))}},function(e,t,r){(function(t){e.exports=function(){return"undefined"!==typeof window&&"object"===typeof window.process&&"renderer"===window.process.type||(!("undefined"===typeof t||"object"!==typeof t.versions||!t.versions.electron)||"object"===typeof navigator&&"string"===typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0)}}).call(this,r(39))},function(e,t,r){"use strict";var n=r(29),i=r(98);function o(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}var a=o("utf8","u",(function(e){return"u"+new TextDecoder("utf8").decode(e)}),(function(e){return(new TextEncoder).encode(e.substring(1))})),s=o("ascii","a",(function(e){for(var t="a",r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.algorithm,r=void 0===t?"AES-GCM":t,u=e.nonceLength,c=void 0===u?12:u,f=e.keyLength,l=void 0===f?16:f,h=e.digest,d=void 0===h?"SHA-256":h,p=e.saltLength,v=void 0===p?16:p,y=e.iterations,b=void 0===y?32767:y,g=s.get();function m(e,t){return w.apply(this,arguments)}function w(){return(w=i(n.mark((function e(t,i){var s,u,f,h,p,y,m;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=g.getRandomValues(new Uint8Array(v)),u=g.getRandomValues(new Uint8Array(c)),f={name:r,iv:u},h={name:"PBKDF2",salt:s,iterations:b,hash:{name:d}},e.next=6,g.subtle.importKey("raw",a(i),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]);case 6:return p=e.sent,e.next=9,g.subtle.deriveKey(h,p,{name:r,length:l},!0,["encrypt"]);case 9:return y=e.sent,e.next=12,g.subtle.encrypt(f,y,t);case 12:return m=e.sent,e.abrupt("return",o([s,f.iv,new Uint8Array(m)]));case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e,t){return S.apply(this,arguments)}function S(){return(S=i(n.mark((function e(t,i){var o,s,u,f,h,p,y,m;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.slice(0,v),s=t.slice(v,v+c),u=t.slice(v+c),f={name:r,iv:s},h={name:"PBKDF2",salt:o,iterations:b,hash:{name:d}},e.next=7,g.subtle.importKey("raw",a(i),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]);case 7:return p=e.sent,e.next=10,g.subtle.deriveKey(h,p,{name:r,length:l},!0,["decrypt"]);case 10:return y=e.sent,e.next=13,g.subtle.decrypt(f,y,u);case 13:return m=e.sent,e.abrupt("return",new Uint8Array(m));case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return l*=8,{encrypt:m,decrypt:k}}}},function(e,t,r){"use strict";var n=r(205),i=r(15);e.exports=function(e){if(isNaN(e)||e<=0)throw i(new Error("random bytes length must be a Number bigger than 0"),"ERR_INVALID_LENGTH");return n(e)}},function(e,t,r){"use strict";var n=r(0),i=r(45),o=r(44),a=r(30),s=1<<20;e.exports=function(e){e=e||s;var t=function(t){if(t.data&&t.data.length>e)throw Object.assign(new Error("message size too large!"),{code:"ERR_MSG_TOO_BIG"})};return function(e){return function(){var r=o(n.mark((function r(){var o,s,u,c,f,l,h;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o=!0,s=!1,r.prev=2,c=a(e);case 4:return r.next=6,i(c.next());case 6:return f=r.sent,o=f.done,r.next=10,i(f.value);case 10:if(l=r.sent,o){r.next=19;break}return h=l,Array.isArray(h)?h.forEach(t):t(h),r.next=16,h;case 16:o=!0,r.next=4;break;case 19:r.next=25;break;case 21:r.prev=21,r.t0=r.catch(2),s=!0,u=r.t0;case 25:if(r.prev=25,r.prev=26,o||null==c.return){r.next=30;break}return r.next=30,i(c.return());case 30:if(r.prev=30,!s){r.next=33;break}throw u;case 33:return r.finish(30);case 34:return r.finish(25);case 35:case"end":return r.stop()}}),r,null,[[2,21,25,35],[26,,30,34]])})));return function(){return r.apply(this,arguments)}}()()}},e.exports.MAX_MSG_SIZE=s},function(e,t,r){"use strict";var n=Object.freeze({NEW_STREAM:0,MESSAGE_RECEIVER:1,MESSAGE_INITIATOR:2,CLOSE_RECEIVER:3,CLOSE_INITIATOR:4,RESET_RECEIVER:5,RESET_INITIATOR:6});t.MessageTypes=n,t.InitiatorMessageTypes=Object.freeze({NEW_STREAM:n.NEW_STREAM,MESSAGE:n.MESSAGE_INITIATOR,CLOSE:n.CLOSE_INITIATOR,RESET:n.RESET_INITIATOR}),t.ReceiverMessageTypes=Object.freeze({MESSAGE:n.MESSAGE_RECEIVER,CLOSE:n.CLOSE_RECEIVER,RESET:n.RESET_RECEIVER}),t.MessageTypeNames=Object.freeze(Object.entries(n).reduce((function(e,t){return e[t[1]]=t[0],e}),{}))},function(e,t,r){"use strict";var n=r(8),i=r(9),o="undefined"!==typeof navigator&&"ReactNative"===navigator.product;var a=self.URL,s=o?"http://localhost":self.location.protocol+"//"+self.location.host,u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;n(this,e),this.super=new a(t,r),this.path=this.pathname+this.search,this.auth=this.username&&this.password?this.username+":"+this.password:null,this.query=this.search&&this.search.startsWith("?")?this.search.slice(1):null}return i(e,[{key:"hash",get:function(){return this.super.hash},set:function(e){this.super.hash=e}},{key:"host",get:function(){return this.super.host},set:function(e){this.super.host=e}},{key:"hostname",get:function(){return this.super.hostname},set:function(e){this.super.hostname=e}},{key:"href",get:function(){return this.super.href},set:function(e){this.super.href=e}},{key:"origin",get:function(){return this.super.origin}},{key:"password",get:function(){return this.super.password},set:function(e){this.super.password=e}},{key:"pathname",get:function(){return this.super.pathname},set:function(e){this.super.pathname=e}},{key:"port",get:function(){return this.super.port},set:function(e){this.super.port=e}},{key:"protocol",get:function(){return this.super.protocol},set:function(e){this.super.protocol=e}},{key:"search",get:function(){return this.super.search},set:function(e){this.super.search=e}},{key:"searchParams",get:function(){return this.super.searchParams}},{key:"username",get:function(){return this.super.username},set:function(e){this.super.username=e}},{key:"toJSON",value:function(){return this.super.toJSON()}},{key:"toString",value:function(){return this.super.toString()}},{key:"format",value:function(){return this.toString()}}],[{key:"createObjectURL",value:function(e){return a.createObjectURL(e)}},{key:"revokeObjectURL",value:function(e){a.revokeObjectURL(e)}}]),e}();e.exports={URLWithLegacySupport:u,URLSearchParams:self.URLSearchParams,defaultBase:s,format:function(e){if("string"===typeof e)return new a(e).toString();if(!(e instanceof a)){var t=e.username&&e.password?"".concat(e.username,":").concat(e.password,"@"):"",r=e.auth?e.auth+"@":"",n=e.port?":"+e.port:"",i=e.protocol?e.protocol+"//":"",o=e.host||"",s=e.hostname||"",u=e.search||(e.query?"?"+e.query:""),c=e.hash||"",f=e.pathname||"",l=e.path||f+u;return"".concat(i).concat(t||r).concat(o||s+n).concat(l).concat(c)}}}},function(e,t,r){"use strict";t.CODE_P2P=421,t.CODE_CIRCUIT=290,t.CODE_TCP=6,t.CODE_WS=477,t.CODE_WSS=478,t.CLOSE_TIMEOUT=2e3},function(e,t,r){"use strict";var n=r(294),i=r(487),o=i.CODE_CIRCUIT,a=i.CODE_P2P,s=i.CODE_TCP,u=i.CODE_WS,c=i.CODE_WSS;e.exports={all:function(e){return e.filter((function(e){if(e.protoCodes().includes(o))return!1;var t=e.decapsulateCode(a);return n.WebSockets.matches(t)||n.WebSocketsSecure.matches(t)}))},dnsWss:function(e){return e.filter((function(e){if(e.protoCodes().includes(o))return!1;var t=e.decapsulateCode(a);return n.WebSocketsSecure.matches(t)&&n.DNS.matches(t.decapsulateCode(s).decapsulateCode(c))}))},dnsWsOrWss:function(e){return e.filter((function(e){if(e.protoCodes().includes(o))return!1;var t=e.decapsulateCode(a);return n.WebSockets.matches(t)?n.DNS.matches(t.decapsulateCode(s).decapsulateCode(u)):n.WebSocketsSecure.matches(t)&&n.DNS.matches(t.decapsulateCode(s).decapsulateCode(c))}))}}},function(e,t,r){var n=r(0),i=r(6),o=r(30),a=r(79),s={string:function(){return""},buffer:function(){return a()}};e.exports=function(){var e=i(n.mark((function e(t,r){var i,a,u,c,f,l,h,d,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=r||{}).type||s[r.type]){e.next=3;break}throw new Error('invalid type "'.concat(r.type,'"'));case 3:u=!0,c=!1,e.prev=5,l=o(t);case 7:return e.next=9,l.next();case 9:return h=e.sent,u=h.done,e.next=13,h.value;case 13:if(d=e.sent,u){e.next=21;break}p=d,i||(a=r.type||("string"===typeof p?"string":"buffer"),i=s[a]()),"string"===a?i+=p:i.append(p);case 18:u=!0,e.next=7;break;case 21:e.next=27;break;case 23:e.prev=23,e.t0=e.catch(5),c=!0,f=e.t0;case 27:if(e.prev=27,e.prev=28,u||null==l.return){e.next=32;break}return e.next=32,l.return();case 32:if(e.prev=32,!c){e.next=35;break}throw f;case 35:return e.finish(32);case 36:return e.finish(27);case 37:return e.abrupt("return",i||s[r.type||"buffer"]());case 38:case"end":return e.stop()}}),e,null,[[5,23,27,37],[28,,32,36]])})));return function(t,r){return e.apply(this,arguments)}}()},,,function(e,t,r){"use strict";var n=r(41),i=n.Reader,o=n.Writer,a=n.util,s=n.roots["libp2p-pubsub-rpc"]||(n.roots["libp2p-pubsub-rpc"]={});s.RPC=function(){function e(e){if(this.subscriptions=[],this.msgs=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.subscriptions&&n.subscriptions.length||(n.subscriptions=[]),n.subscriptions.push(s.RPC.SubOpts.decode(e,e.uint32()));break;case 2:n.msgs&&n.msgs.length||(n.msgs=[]),n.msgs.push(s.RPC.Message.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof s.RPC)return e;var t=new s.RPC;if(e.subscriptions){if(!Array.isArray(e.subscriptions))throw TypeError(".RPC.subscriptions: array expected");t.subscriptions=[];for(var r=0;r>>3){case 1:n.subscribe=e.bool();break;case 2:n.topicID=e.string();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof s.RPC.SubOpts)return e;var t=new s.RPC.SubOpts;return null!=e.subscribe&&(t.subscribe=Boolean(e.subscribe)),null!=e.topicID&&(t.topicID=String(e.topicID)),t},e.toObject=function(e,t){t||(t={});var r={};return null!=e.subscribe&&e.hasOwnProperty("subscribe")&&(r.subscribe=e.subscribe,t.oneofs&&(r._subscribe="subscribe")),null!=e.topicID&&e.hasOwnProperty("topicID")&&(r.topicID=e.topicID,t.oneofs&&(r._topicID="topicID")),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.Message=function(){function e(e){if(this.topicIDs=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.from=e.bytes();break;case 2:n.data=e.bytes();break;case 3:n.seqno=e.bytes();break;case 4:n.topicIDs&&n.topicIDs.length||(n.topicIDs=[]),n.topicIDs.push(e.string());break;case 5:n.signature=e.bytes();break;case 6:n.key=e.bytes();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof s.RPC.Message)return e;var t=new s.RPC.Message;if(null!=e.from&&("string"===typeof e.from?a.base64.decode(e.from,t.from=a.newBuffer(a.base64.length(e.from)),0):e.from.length&&(t.from=e.from)),null!=e.data&&("string"===typeof e.data?a.base64.decode(e.data,t.data=a.newBuffer(a.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),null!=e.seqno&&("string"===typeof e.seqno?a.base64.decode(e.seqno,t.seqno=a.newBuffer(a.base64.length(e.seqno)),0):e.seqno.length&&(t.seqno=e.seqno)),e.topicIDs){if(!Array.isArray(e.topicIDs))throw TypeError(".RPC.Message.topicIDs: array expected");t.topicIDs=[];for(var r=0;r-1}:function(e){return t.has(e)};var i,o=n(e);try{for(o.s();!(i=o.n()).done;){if(r(i.value))return!0}}catch(a){o.e(a)}finally{o.f()}return!1},ensureArray:function(e){return Array.isArray(e)?e:[e]},normalizeInRpcMessage:function(e,t){var r=Object.assign({},e);return e.from instanceof Uint8Array&&(r.from=o(e.from,"base58btc")),t&&(r.receivedFrom=t),r},normalizeOutRpcMessage:function(e){var t=Object.assign({},e);return"string"===typeof e.from&&(t.from=a(e.from,"base58btc")),"string"===typeof e.data&&(t.data=a(e.data)),t}}},function(e,t,r){"use strict";var n=r(0),i=r(6),o=r(180).concat,a=r(96).fromString,s=r(220);e.exports={create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.algorithm,r=void 0===t?"AES-GCM":t,u=e.nonceLength,c=void 0===u?12:u,f=e.keyLength,l=void 0===f?16:f,h=e.digest,d=void 0===h?"SHA-256":h,p=e.saltLength,v=void 0===p?16:p,y=e.iterations,b=void 0===y?32767:y,g=s.get();function m(e,t){return w.apply(this,arguments)}function w(){return(w=i(n.mark((function e(t,i){var s,u,f,h,p,y,m;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=g.getRandomValues(new Uint8Array(v)),u=g.getRandomValues(new Uint8Array(c)),f={name:r,iv:u},h={name:"PBKDF2",salt:s,iterations:b,hash:{name:d}},e.next=6,g.subtle.importKey("raw",a(i),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]);case 6:return p=e.sent,e.next=9,g.subtle.deriveKey(h,p,{name:r,length:l},!0,["encrypt"]);case 9:return y=e.sent,e.next=12,g.subtle.encrypt(f,y,t);case 12:return m=e.sent,e.abrupt("return",o([s,f.iv,new Uint8Array(m)]));case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e,t){return S.apply(this,arguments)}function S(){return(S=i(n.mark((function e(t,i){var o,s,u,f,h,p,y,m;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.slice(0,v),s=t.slice(v,v+c),u=t.slice(v+c),f={name:r,iv:s},h={name:"PBKDF2",salt:o,iterations:b,hash:{name:d}},e.next=7,g.subtle.importKey("raw",a(i),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]);case 7:return p=e.sent,e.next=10,g.subtle.deriveKey(h,p,{name:r,length:l},!0,["decrypt"]);case 10:return y=e.sent,e.next=13,g.subtle.decrypt(f,y,u);case 13:return m=e.sent,e.abrupt("return",new Uint8Array(m));case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return l*=8,{encrypt:m,decrypt:k}}}},function(e,t,r){"use strict";var n=r(8),i=r(9),o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&o(t,e,r);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Heartbeat=void 0;var u=s(r(135)),c=r(496),f=r(76),l=function(){function e(t){n(this,e),this.gossipsub=t}return i(e,[{key:"start",value:function(){var e=this;if(!this._heartbeatTimer){var t=this._heartbeat.bind(this),r=setTimeout((function(){t(),e._heartbeatTimer.runPeriodically(t,e.gossipsub._options.heartbeatInterval)}),u.GossipsubHeartbeatInitialDelay);this._heartbeatTimer={_intervalId:void 0,runPeriodically:function(t,r){e._heartbeatTimer._intervalId=setInterval(t,r)},cancel:function(){clearTimeout(r),clearInterval(e._heartbeatTimer._intervalId)}}}}},{key:"stop",value:function(){this._heartbeatTimer&&(this._heartbeatTimer.cancel(),this._heartbeatTimer=null)}},{key:"_heartbeat",value:function(){var e=this,t=this.gossipsub._options,r=t.D,n=t.Dlo,i=t.Dhi,o=t.Dscore,a=t.Dout,s=t.fanoutTTL;this.gossipsub.heartbeatTicks++;var l=new Map,h=function(t){var r=l.get(t);return void 0===r&&(r=e.gossipsub.score.score(t),l.set(t,r)),r},d=new Map,p=new Map,v=new Map;this.gossipsub._clearBackoff(),this.gossipsub.peerhave.clear(),this.gossipsub.iasked.clear(),this.gossipsub._applyIwantPenalties(),this.gossipsub._directConnect(),this.gossipsub.mesh.forEach((function(t,s){var l=function(r){e.gossipsub.log("HEARTBEAT: Remove mesh link to %s in %s",r,s),e.gossipsub.score.prune(r,s),e.gossipsub._addBackoff(r,s),t.delete(r);var n=p.get(r);n?n.push(s):p.set(r,[s])},y=function(r){e.gossipsub.log("HEARTBEAT: Add mesh link to %s in %s",r,s),e.gossipsub.score.graft(r,s),t.add(r);var n=d.get(r);n?n.push(s):d.set(r,[s])};if(t.forEach((function(t){var r=h(t);r<0&&(e.gossipsub.log("HEARTBEAT: Prune peer %s with negative score: score=%d, topic=%s",t,r,s),l(t),v.set(t,!0))})),t.size=0})).forEach(y)}if(t.size>i){var m=Array.from(t);m.sort((function(e,t){return h(t)-h(e)})),m=m.slice(0,o).concat(f.shuffle(m.slice(o)));var w=0;if(m.slice(0,r).forEach((function(t){e.gossipsub.outbound.get(t)&&w++})),w0;r--)m[r]=m[r-1];m[0]=t};if(w>0)for(var S=w,E=1;E0;E++)e.gossipsub.outbound.get(m[E])&&(k(E),S--);for(var _=r-w,A=r;A0;A++)e.gossipsub.outbound.get(m[A])&&(k(A),_--)}m.slice(r).forEach(l)}if(t.size>=n){var x=0;if(t.forEach((function(t){e.gossipsub.outbound.get(t)&&x++})),x=0})).forEach(y)}}if(e.gossipsub.heartbeatTicks%u.GossipsubOpportunisticGraftTicks===0&&t.size>1){var C=Array.from(t).sort((function(e,t){return h(e)-h(t)})),O=Math.floor(t.size/2),I=h(C[O]);if(II})).forEach((function(t){e.gossipsub.log("HEARTBEAT: Opportunistically graft peer %s on topic %s",t,s),y(t)}))}}e.gossipsub._emitGossip(s,t)}));var y=this.gossipsub._now();this.gossipsub.lastpub.forEach((function(t,r){t+s=e.gossipsub._options.scoreThresholds.publishThreshold})).forEach((function(e){t.add(e)}))}e.gossipsub._emitGossip(n,t)})),this.gossipsub._sendGraftPrune(d,p,v),this.gossipsub._flush(),this.gossipsub.messageCache.shift(),this.gossipsub.emit("gossipsub:heartbeat")}}]),e}();t.Heartbeat=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGossipPeers=void 0;var n=r(76);t.getGossipPeers=function(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0},o=e.topics.get(t);if(!o)return new Set;var a=[];return o.forEach((function(t){var r=e.peers.get(t);r&&n.hasGossipProtocol(r.protocol)&&i(t)&&a.push(t)})),a=n.shuffle(a),r>0&&a.length>r&&(a=a.slice(0,r)),new Set(a)}},function(e,t,r){"use strict";var n=r(40);Object.defineProperty(t,"__esModule",{value:!0}),t.validateTopicScoreParams=t.validatePeerScoreParams=t.createTopicScoreParams=t.createPeerScoreParams=t.defaultTopicScoreParams=t.defaultPeerScoreParams=void 0;var i=r(498),o=r(15);function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Object.assign({},t.defaultTopicScoreParams),e)}function s(e){if(e.topicWeight<0)throw o(new Error("invalid topic weight; must be >= 0"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(0===e.timeInMeshQuantum)throw o(new Error("invalid TimeInMeshQuantum; must be non zero"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(e.timeInMeshWeight<0)throw o(new Error("invalid TimeInMeshWeight; must be positive (or 0 to disable)"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.timeInMeshWeight&&e.timeInMeshQuantum<=0)throw o(new Error("invalid TimeInMeshQuantum; must be positive"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.timeInMeshWeight&&e.timeInMeshCap<=0)throw o(new Error("invalid TimeInMeshCap; must be positive"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(e.firstMessageDeliveriesWeight<0)throw o(new Error("invallid FirstMessageDeliveriesWeight; must be positive (or 0 to disable)"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.firstMessageDeliveriesWeight&&(e.firstMessageDeliveriesDecay<=0||e.firstMessageDeliveriesDecay>=1))throw o(new Error("invalid FirstMessageDeliveriesDecay; must be between 0 and 1"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.firstMessageDeliveriesWeight&&e.firstMessageDeliveriesCap<=0)throw o(new Error("invalid FirstMessageDeliveriesCap; must be positive"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(e.meshMessageDeliveriesWeight>0)throw o(new Error("invalid MeshMessageDeliveriesWeight; must be negative (or 0 to disable)"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.meshMessageDeliveriesWeight&&(e.meshMessageDeliveriesDecay<=0||e.meshMessageDeliveriesDecay>=1))throw o(new Error("invalid MeshMessageDeliveriesDecay; must be between 0 and 1"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.meshMessageDeliveriesWeight&&e.meshMessageDeliveriesCap<=0)throw o(new Error("invalid MeshMessageDeliveriesCap; must be positive"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.meshMessageDeliveriesWeight&&e.meshMessageDeliveriesThreshold<=0)throw o(new Error("invalid MeshMessageDeliveriesThreshold; must be positive"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(e.meshMessageDeliveriesWindow<0)throw o(new Error("invalid MeshMessageDeliveriesWindow; must be non-negative"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.meshMessageDeliveriesWeight&&e.meshMessageDeliveriesActivation<1e3)throw o(new Error("invalid MeshMessageDeliveriesActivation; must be at least 1s"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(e.meshFailurePenaltyWeight>0)throw o(new Error("invalid MeshFailurePenaltyWeight; must be negative (or 0 to disable)"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.meshFailurePenaltyWeight&&(e.meshFailurePenaltyDecay<=0||e.meshFailurePenaltyDecay>=1))throw o(new Error("invalid MeshFailurePenaltyDecay; must be between 0 and 1"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(e.invalidMessageDeliveriesWeight>0)throw o(new Error("invalid InvalidMessageDeliveriesWeight; must be negative (or 0 to disable)"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(e.invalidMessageDeliveriesDecay<=0||e.invalidMessageDeliveriesDecay>=1)throw o(new Error("invalid InvalidMessageDeliveriesDecay; must be between 0 and 1"),i.ERR_INVALID_PEER_SCORE_PARAMS)}t.defaultPeerScoreParams={topics:{},topicScoreCap:10,appSpecificScore:function(){return 0},appSpecificWeight:10,IPColocationFactorWeight:-5,IPColocationFactorThreshold:10,IPColocationFactorWhitelist:new Set,behaviourPenaltyWeight:-10,behaviourPenaltyDecay:.2,decayInterval:1e3,decayToZero:.1,retainScore:36e5},t.defaultTopicScoreParams={topicWeight:.5,timeInMeshWeight:1,timeInMeshQuantum:1,timeInMeshCap:3600,firstMessageDeliveriesWeight:1,firstMessageDeliveriesDecay:.5,firstMessageDeliveriesCap:2e3,meshMessageDeliveriesWeight:-1,meshMessageDeliveriesDecay:.5,meshMessageDeliveriesCap:100,meshMessageDeliveriesThreshold:20,meshMessageDeliveriesWindow:10,meshMessageDeliveriesActivation:5e3,meshFailurePenaltyWeight:-1,meshFailurePenaltyDecay:.5,invalidMessageDeliveriesWeight:-1,invalidMessageDeliveriesDecay:.3},t.createPeerScoreParams=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Object.assign(Object.assign({},t.defaultPeerScoreParams),e),{topics:e.topics?Object.entries(e.topics).reduce((function(e,t){var r=n(t,2),i=r[0],o=r[1];return e[i]=a(o),e}),{}):{}})},t.createTopicScoreParams=a,t.validatePeerScoreParams=function(e){for(var t=0,r=Object.entries(e.topics);t0)throw o(new Error("invalid IPColocationFactorWeight; must be negative (or 0 to disable)"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.IPColocationFactorWeight&&e.IPColocationFactorThreshold<1)throw o(new Error("invalid IPColocationFactorThreshold; must be at least 1"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(e.behaviourPenaltyWeight>0)throw o(new Error("invalid BehaviourPenaltyWeight; must be negative (or 0 to disable)"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.behaviourPenaltyWeight&&(e.behaviourPenaltyDecay<=0||e.behaviourPenaltyDecay>=1))throw o(new Error("invalid BehaviourPenaltyDecay; must be between 0 and 1"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(e.decayInterval<1e3)throw o(new Error("invalid DecayInterval; must be at least 1s"),i.ERR_INVALID_PEER_SCORE_PARAMS);if(e.decayToZero<=0||e.decayToZero>=1)throw o(new Error("invalid DecayToZero; must be between 0 and 1"),i.ERR_INVALID_PEER_SCORE_PARAMS)},t.validateTopicScoreParams=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERR_INVALID_PEER_SCORE_THRESHOLDS=t.ERR_INVALID_PEER_SCORE_PARAMS=void 0,t.ERR_INVALID_PEER_SCORE_PARAMS="ERR_INVALID_PEER_SCORE_PARAMS",t.ERR_INVALID_PEER_SCORE_THRESHOLDS="ERR_INVALID_PEER_SCORE_THRESHOLDS"},,,,function(e,t,r){"use strict";var n;r.r(t),r.d(t,"v1",(function(){return v})),r.d(t,"v3",(function(){return A})),r.d(t,"v4",(function(){return x})),r.d(t,"v5",(function(){return C})),r.d(t,"NIL",(function(){return O})),r.d(t,"version",(function(){return I})),r.d(t,"validate",(function(){return s})),r.d(t,"stringify",(function(){return h})),r.d(t,"parse",(function(){return y}));var i=new Uint8Array(16);function o(){if(!n&&!(n="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!==typeof msCrypto&&"function"===typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}var a=/^(?:[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;for(var s=function(e){return"string"===typeof e&&a.test(e)},u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));var f,l,h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!s(r))throw TypeError("Stringified UUID is invalid");return r},d=0,p=0;var v=function(e,t,r){var n=t&&r||0,i=t||new Array(16),a=(e=e||{}).node||f,s=void 0!==e.clockseq?e.clockseq:l;if(null==a||null==s){var u=e.random||(e.rng||o)();null==a&&(a=f=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==s&&(s=l=16383&(u[6]<<8|u[7]))}var c=void 0!==e.msecs?e.msecs:Date.now(),v=void 0!==e.nsecs?e.nsecs:p+1,y=c-d+(v-p)/1e4;if(y<0&&void 0===e.clockseq&&(s=s+1&16383),(y<0||c>d)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=c,p=v,l=s;var b=(1e4*(268435455&(c+=122192928e5))+v)%4294967296;i[n++]=b>>>24&255,i[n++]=b>>>16&255,i[n++]=b>>>8&255,i[n++]=255&b;var g=c/4294967296*1e4&268435455;i[n++]=g>>>8&255,i[n++]=255&g,i[n++]=g>>>24&15|16,i[n++]=g>>>16&255,i[n++]=s>>>8|128,i[n++]=255&s;for(var m=0;m<6;++m)i[n+m]=a[m];return t||h(i)};var y=function(e){if(!s(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};var b=function(e,t,r){function n(e,n,i,o){if("string"===typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r>>9<<4)+1}function m(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function w(e,t,r,n,i,o){return m((a=m(m(t,e),m(n,o)))<<(s=i)|a>>>32-s,r);var a,s}function k(e,t,r,n,i,o,a){return w(t&r|~t&n,e,t,i,o,a)}function S(e,t,r,n,i,o,a){return w(t&n|r&~n,e,t,i,o,a)}function E(e,t,r,n,i,o,a){return w(t^r^n,e,t,i,o,a)}function _(e,t,r,n,i,o,a){return w(r^(t|~n),e,t,i,o,a)}var A=b("v3",48,(function(e){if("string"===typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r>5]>>>i%32&255,a=parseInt(n.charAt(o>>>4&15)+n.charAt(15&o),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<>5]|=(255&e[n/8])<>>32-t}var C=b("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"===typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var i=0;i>>0;m=g,g=b,b=M(y,30)>>>0,y=v,v=S}r[0]=r[0]+v>>>0,r[1]=r[1]+y>>>0,r[2]=r[2]+b>>>0,r[3]=r[3]+g>>>0,r[4]=r[4]+m>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),O="00000000-0000-0000-0000-000000000000";var I=function(e){if(!s(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},function(e,t,r){"use strict";r.r(t),r.d(t,"nanoid",(function(){return s})),r.d(t,"customAlphabet",(function(){return a})),r.d(t,"customRandom",(function(){return o})),r.d(t,"urlAlphabet",(function(){return n})),r.d(t,"random",(function(){return i}));var n="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";var i=function(e){return crypto.getRandomValues(new Uint8Array(e))},o=function(e,t,r){var n=(2<0&&void 0!==arguments[0]?arguments[0]:21,t="",r=crypto.getRandomValues(new Uint8Array(e));e--;){var n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t}},,,function(e,t,r){"use strict";function n(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";var n=r(1065),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={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 u(e){return n.isMemo(e)?a:s[e.$$typeof]||i}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=a;var c=Object.defineProperty,f=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!==typeof r){if(p){var i=d(r);i&&i!==p&&e(t,i,n)}var a=f(r);l&&(a=a.concat(l(r)));for(var s=u(t),v=u(r),y=0;y>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),l=s((function(e,t){var r=t;r.assert=u,r.toArray=f.toArray,r.zero2=f.zero2,r.toHex=f.toHex,r.encode=f.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0===(1&u)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0===(1&c)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"===typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new i.a(e,"hex","le")}})),h=l.getNAF,d=l.getJSF,p=l.assert;function v(e,t){this.type=e,this.p=new i.a(t.p,16),this.red=t.prime?i.a.red(t.prime):i.a.mont(this.p),this.zero=new i.a(0).toRed(this.red),this.one=new i.a(1).toRed(this.red),this.two=new i.a(2).toRed(this.red),this.n=t.n&&new i.a(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var y=v;function b(e,t){this.curve=e,this.type=t,this.precomputed=null}v.prototype.point=function(){throw new Error("Not implemented")},v.prototype.validate=function(){throw new Error("Not implemented")},v.prototype._fixedNafMul=function(e,t){p(e.precomputed);var r=e._getDoubles(),n=h(t,1,this._bitLength),i=(1<=o;u--)a=(a<<1)+n[u];s.push(a)}for(var c=this.jpoint(null,null,null),f=this.jpoint(null,null,null),l=i;l>0;l--){for(o=0;o=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var c=o[s];p(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},v.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,u=this._wnafT1,c=this._wnafT2,f=this._wnafT3,l=0;for(o=0;o=1;o-=2){var v=o-1,y=o;if(1===u[v]&&1===u[y]){var b=[t[v],null,null,t[y]];0===t[v].y.cmp(t[y].y)?(b[1]=t[v].add(t[y]),b[2]=t[v].toJ().mixedAdd(t[y].neg())):0===t[v].y.cmp(t[y].y.redNeg())?(b[1]=t[v].toJ().mixedAdd(t[y]),b[2]=t[v].add(t[y].neg())):(b[1]=t[v].toJ().mixedAdd(t[y]),b[2]=t[v].toJ().mixedAdd(t[y].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],m=d(r[v],r[y]);for(l=Math.max(m[0].length,l),f[v]=new Array(l),f[y]=new Array(l),a=0;a=0;o--){for(var _=0;o>=0;){var A=!0;for(a=0;a=0&&_++,S=S.dblp(_),o<0)break;for(a=0;a0?s=c[a][x-1>>1]:x<0&&(s=c[a][-x-1>>1].neg()),S="affine"===s.type?S.mixedAdd(s):S.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},b.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},w.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},w.prototype.pointFromX=function(e,t){(e=new i.a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},w.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},w.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},S.prototype.isInfinity=function(){return this.inf},S.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},S.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},S.prototype.getX=function(){return this.x.fromRed()},S.prototype.getY=function(){return this.y.fromRed()},S.prototype.mul=function(e){return e=new i.a(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},S.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},S.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},S.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},S.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},S.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},g(E,y.BasePoint),w.prototype.jpoint=function(e,t,r){return new E(this,e,t,r)},E.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},E.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},E.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),l=n.redMul(c),h=u.redSqr().redIAdd(f).redISub(l).redISub(l),d=u.redMul(l.redISub(h)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},E.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),f=r.redMul(u),l=s.redSqr().redIAdd(c).redISub(f).redISub(f),h=s.redMul(f.redISub(l)).redISub(i.redMul(c)),d=this.z.redMul(a);return this.curve.jpoint(l,h,d)},E.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},E.prototype.inspect=function(){return this.isInfinity()?"":""},E.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var _=s((function(e,t){var r=t;r.base=y,r.short=k,r.mont=null,r.edwards=null})),A=s((function(e,t){var r,n=t,i=l.assert;function o(e){"short"===e.type?this.curve=new _.short(e):"edwards"===e.type?this.curve=new _.edwards(e):this.curve=new _.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,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{r=null.crash()}catch(u){r=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",r]})}));function x(e){if(!(this instanceof x))return new x(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=f.toArray(e.entropy,e.entropyEnc||"hex"),r=f.toArray(e.nonce,e.nonceEnc||"hex"),n=f.toArray(e.pers,e.persEnc||"hex");u(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var T=x;x.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},x.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(n=r,r=t,t=null),r&&(r=f.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var I=l.assert;function P(e,t){if(e instanceof P)return e;this._importDER(e,t)||(I(e.r&&e.s,"Signature without r or s"),this.r=new i.a(e.r,16),this.s=new i.a(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var R=P;function B(){this.place=0}function D(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function N(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}P.prototype._importDER=function(e,t){e=l.toArray(e,t);var r=new B;if(48!==e[r.place++])return!1;var n=D(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=D(e,r);if(!1===o)return!1;var a=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var s=D(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var u=e.slice(r.place,s+r.place);if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new i.a(a),this.s=new i.a(u),this.recoveryParam=null,!0},P.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=N(t),r=N(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];L(n,t.length),(n=n.concat(t)).push(2),L(n,r.length);var i=n.concat(r),o=[48];return L(o,i.length),o=o.concat(i),l.encode(o,e)};var j=function(){throw new Error("unsupported")},U=l.assert;function F(e){if(!(this instanceof F))return new F(e);"string"===typeof e&&(U(Object.prototype.hasOwnProperty.call(A,e),"Unknown curve "+e),e=A[e]),e instanceof A.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var K=F;F.prototype.keyPair=function(e){return new O(this,e)},F.prototype.keyFromPrivate=function(e,t){return O.fromPrivate(this,e,t)},F.prototype.keyFromPublic=function(e,t){return O.fromPublic(this,e,t)},F.prototype.genKeyPair=function(e){e||(e={});for(var t=new T({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||j(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i.a(2));;){var o=new i.a(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},F.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},F.prototype.sign=function(e,t,r,n){"object"===typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i.a(e,16));for(var o=this.n.byteLength(),a=t.getPrivate().toArray("be",o),s=e.toArray("be",o),u=new T({hash:this.hash,entropy:a,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new i.a(1)),f=0;;f++){var l=n.k?n.k(f):new i.a(u.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(c)>=0)){var h=this.g.mul(l);if(!h.isInfinity()){var d=h.getX(),p=d.umod(this.n);if(0!==p.cmpn(0)){var v=l.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var y=(h.getY().isOdd()?1:0)|(0!==d.cmp(p)?2:0);return n.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),y^=1),new R({r:p,s:v,recoveryParam:y})}}}}}},F.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i.a(e,16)),r=this.keyFromPublic(r,n);var o=(t=new R(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),f=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),f)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),f)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},F.prototype.recoverPubKey=function(e,t,r,n){U((3&r)===r,"The recovery param is more than two bits"),t=new R(t,n);var o=this.n,a=new i.a(e),s=t.r,u=t.s,c=1&r,f=r>>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),c):this.curve.pointFromX(s,c);var l=t.r.invm(o),h=o.sub(a).mul(l).umod(o),d=u.mul(l).umod(o);return this.g.mulAdd(h,s,d)},F.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new R(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var z=s((function(e,t){var r=t;r.version="6.5.4",r.utils=l,r.rand=function(){throw new Error("unsupported")},r.curve=_,r.curves=A,r.ec=K,r.eddsa=null})).ec}).call(this,r(36))},function(e,t,r){(function(t,r){!function(){"use strict";var n="object"===typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"===typeof t&&t.versions&&t.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"===typeof e&&e.exports,o="0123456789abcdef".split(""),a=[0,8,16,24],s=[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],c=["hex","buffer","arrayBuffer","array"],f=function(e,t,r){return function(n){return new k(e,t,e).update(n)[r]()}},l=function(e,t,r){return function(n,i){return new k(e,t,i).update(n)[r]()}},h=function(e,t){var r=f(e,t,"hex");r.create=function(){return new k(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}k.prototype.update=function(e){var t="string"!==typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,i=e.length,o=this.blocks,s=this.byteCount,u=this.blockCount,c=0,f=this.s;c>2]|=e[c]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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=o[u],r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+o[15&e]+o[e>>12&15]+o[e>>8&15]+o[e>>20&15]+o[e>>16&15]+o[e>>28&15]+o[e>>24&15];s%t===0&&(S(r),a=0)}return i&&(e=r[a],i>0&&(u+=o[e>>4&15]+o[15&e]),i>1&&(u+=o[e>>12&15]+o[e>>8&15]),i>2&&(u+=o[e>>20&15]+o[e>>16&15])),u},k.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r===0&&S(n)}return o&&(e=s<<2,t=n[a],o>0&&(u[e]=255&t),o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u};var S=function(e){var t,r,n,i,o,a,u,c,f,l,h,d,p,v,y,b,g,m,w,k,S,E,_,A,x,T,M,C,O,I,P,R,B,D,N,L,j,U,F,K,z,V,H,J,q,G,X,W,Z,Y,Q,$,ee,te,re,ne,ie,oe,ae,se,ue,ce,fe;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],f=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(c<<1|f>>>31),r=o^(f<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(l<<1|h>>>31),r=u^(h<<1|l>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(d<<1|p>>>31),r=f^(p<<1|d>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=l^(i<<1|o>>>31),r=h^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],y=e[1],G=e[11]<<4|e[10]>>>28,X=e[10]<<4|e[11]>>>28,C=e[20]<<3|e[21]>>>29,O=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,V=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,D=e[2]<<1|e[3]>>>31,N=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,W=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,I=e[33]<<13|e[32]>>>19,P=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,m=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,B=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,k=e[36]<<21|e[37]>>>11,S=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,J=e[8]<<27|e[9]>>>5,q=e[9]<<27|e[8]>>>5,T=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,K=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,_=e[49]<<14|e[48]>>>18,e[0]=v^~b&m,e[1]=y^~g&w,e[10]=A^~T&C,e[11]=x^~M&O,e[20]=D^~L&U,e[21]=N^~j&F,e[30]=J^~G&W,e[31]=q^~X&Z,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=b^~m&k,e[3]=g^~w&S,e[12]=T^~C&I,e[13]=M^~O&P,e[22]=L^~U&K,e[23]=j^~F&z,e[32]=G^~W&Y,e[33]=X^~Z&Q,e[42]=ne^~oe&se,e[43]=ie^~ae&ue,e[4]=m^~k&E,e[5]=w^~S&_,e[14]=C^~I&R,e[15]=O^~P&B,e[24]=U^~K&V,e[25]=F^~z&H,e[34]=W^~Y&$,e[35]=Z^~Q&ee,e[44]=oe^~se&ce,e[45]=ae^~ue&fe,e[6]=k^~E&v,e[7]=S^~_&y,e[16]=I^~R&A,e[17]=P^~B&x,e[26]=K^~V&D,e[27]=z^~H&N,e[36]=Y^~$&J,e[37]=Q^~ee&q,e[46]=se^~ce&te,e[47]=ue^~fe&re,e[8]=E^~v&b,e[9]=_^~y&g,e[18]=R^~A&T,e[19]=B^~x&M,e[28]=V^~D&L,e[29]=H^~N&j,e[38]=$^~J&G,e[39]=ee^~q&X,e[48]=ce^~te&ne,e[49]=fe^~re&ie,e[0]^=s[n],e[1]^=s[n+1]};if(i)e.exports=p;else for(y=0;y0&&(10===arguments[0]?M||(M=!0,A.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?A.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",S.b.errors.UNEXPECTED_ARGUMENT,{}):A.throwError("BigNumber.toString does not accept parameters",S.b.errors.UNEXPECTED_ARGUMENT,{})),P(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(x,O(t)):t.match(/^-?[0-9]+$/)?new e(x,O(new _(t))):A.throwArgumentError("invalid BigNumber string","value",t);if("number"===typeof t)return t%1&&R("underflow","BigNumber.from",t),(t>=T||t<=-T)&&R("overflow","BigNumber.from",t),e.from(String(t));var r=t;if("bigint"===typeof r)return e.from(r.toString());if(Object(m.j)(r))return e.from(Object(m.i)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"===typeof n)return e.from(n)}else{var i=r._hex;if(null==i&&"BigNumber"===r.type&&(i=r.hex),"string"===typeof i&&(Object(m.l)(i)||"-"===i[0]&&Object(m.l)(i.substring(1))))return e.from(i)}return A.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}]),e}();function O(e){if("string"!==typeof e)return O(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&A.throwArgumentError("invalid hex","value",e),"0x00"===(e=O(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 I(e){return C.from(O(e))}function P(e){var t=C.from(e).toHexString();return"-"===t[0]?new _("-"+t.substring(3),16):new _(t.substring(2),16)}function R(e,t,r){var n={fault:e,operation:t};return null!=r&&(n.value=r),A.throwError(e,S.b.errors.NUMERIC_FAULT,n)}var B=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},D=new S.b("properties/5.3.0");function N(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function L(e,t){for(var r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!==typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function j(e){return B(this,void 0,void 0,g.a.mark((function t(){var r,n;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Object.keys(e).map((function(t){var r=e[t];return Promise.resolve(r).then((function(e){return{key:t,value:e}}))})),t.next=3,Promise.all(r);case 3:return n=t.sent,t.abrupt("return",n.reduce((function(e,t){return e[t.key]=t.value,e}),{}));case 5:case"end":return t.stop()}}),t)})))}function U(e,t){e&&"object"===typeof e||D.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((function(r){t[r]||D.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function F(e){var t={};for(var r in e)t[r]=e[r];return t}var K={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function z(e){if(void 0===e||null===e||K[typeof e])return!0;if(Array.isArray(e)||"object"===typeof e){if(!Object.isFrozen(e))return!1;for(var t=Object.keys(e),r=0;rthis.wordSize&&G.throwError("value out-of-bounds",S.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(m.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(r){e._data[t]=e._getValue(r)}}}]),e}(),Y=function(){function e(t,r,n,i){Object(v.a)(this,e),N(this,"_data",Object(m.a)(t)),N(this,"wordSize",r||32),N(this,"_coerceFunc",n),N(this,"allowLoose",i),this._offset=0}return Object(y.a)(e,[{key:"data",get:function(){return Object(m.i)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,r){return this._coerceFunc?this._coerceFunc(t,r):e.coerce(t,r)}},{key:"_peekBytes",value:function(e,t,r){var n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:G.throwError("data out-of-bounds",S.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}},{key:"readValue",value:function(){return C.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}}]),e}(),Q=r(514),$=r.n(Q);function ee(e){return"0x"+$.a.keccak_256(Object(m.a)(e))}var te=new S.b("rlp/5.3.0");function re(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function ne(e,t,r){for(var n=0,i=0;it+1+n&&te.throwError("child data too short",S.b.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function se(e,t){if(0===e.length&&te.throwError("data too short",S.b.errors.BUFFER_OVERRUN,{}),e[t]>=248){var r=e[t]-247;t+1+r>e.length&&te.throwError("data short segment too short",S.b.errors.BUFFER_OVERRUN,{});var n=ne(e,t+1,r);return t+1+r+n>e.length&&te.throwError("data long segment too short",S.b.errors.BUFFER_OVERRUN,{}),ae(e,t,t+1+r,r+n)}if(e[t]>=192){var i=e[t]-192;return t+1+i>e.length&&te.throwError("data array too short",S.b.errors.BUFFER_OVERRUN,{}),ae(e,t,t+1,i)}if(e[t]>=184){var o=e[t]-183;t+1+o>e.length&&te.throwError("data array too short",S.b.errors.BUFFER_OVERRUN,{});var a=ne(e,t+1,o);return t+1+o+a>e.length&&te.throwError("data array too short",S.b.errors.BUFFER_OVERRUN,{}),{consumed:1+o+a,result:Object(m.i)(e.slice(t+1+o,t+1+o+a))}}if(e[t]>=128){var s=e[t]-128;return t+1+s>e.length&&te.throwError("data too short",S.b.errors.BUFFER_OVERRUN,{}),{consumed:1+s,result:Object(m.i)(e.slice(t+1,t+1+s))}}return{consumed:1,result:Object(m.i)(e[t])}}function ue(e){var t=Object(m.a)(e),r=se(t,0);return r.consumed!==t.length&&te.throwArgumentError("invalid rlp data","data",e),r.result}var ce=new S.b("address/5.3.0");function fe(e){Object(m.l)(e,20)||ce.throwArgumentError("invalid address","address",e);for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0);for(var i=Object(m.a)(ee(r)),o=0;o<40;o+=2)i[o>>1]>>4>=8&&(t[o]=t[o].toUpperCase()),(15&i[o>>1])>=8&&(t[o+1]=t[o+1].toUpperCase());return"0x"+t.join("")}for(var le={},he=0;he<10;he++)le[String(he)]=String(he);for(var de=0;de<26;de++)le[String.fromCharCode(65+de)]=String(10+de);var pe,ve=Math.floor((pe=9007199254740991,Math.log10?Math.log10(pe):Math.log(pe)/Math.LN10));function ye(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>=ve;){var r=t.substring(0,ve);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function be(e){var t,r=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),r=fe(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&r!==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)!==ye(e)&&ce.throwArgumentError("bad icap checksum","address",e),t=e.substring(4),r=new _(t,36).toString(16);r.length<40;)r="0"+r;r=fe("0x"+r)}else ce.throwArgumentError("invalid address","address",e);return r}function ge(e){try{return be(e),!0}catch(t){}return!1}function me(e){for(var t,r=(t=be(e).substring(2),new _(t,16).toString(36)).toUpperCase();r.length<30;)r="0"+r;return"XE"+ye("XE00"+r)+r}function we(e){var t=null;try{t=be(e.from)}catch(n){ce.throwArgumentError("missing from address","transaction",e)}var r=Object(m.o)(Object(m.a)(C.from(e.nonce).toHexString()));return be(Object(m.e)(ee(oe([t,r])),12))}function ke(e,t,r){return 32!==Object(m.d)(t)&&ce.throwArgumentError("salt must be 32 bytes","salt",t),32!==Object(m.d)(r)&&ce.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),be(Object(m.e)(ee(Object(m.b)(["0xff",be(e),t,r])),12))}var Se,Ee,_e=new S.b("strings/5.3.0");function Ae(e,t,r,n,i){if(e===Ee.BAD_PREFIX||e===Ee.UNEXPECTED_CONTINUE){for(var o=0,a=t+1;a>6===2;a++)o++;return o}return e===Ee.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Se||(Se={})),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"}(Ee||(Ee={}));var xe=Object.freeze({error:function(e,t,r,n,i){return _e.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:Ae,replace:function(e,t,r,n,i){return e===Ee.OVERLONG?(n.push(i),0):(n.push(65533),Ae(e,t,r))}});function Te(e,t){null==t&&(t=xe.error),e=Object(m.a)(e);for(var r=[],n=0;n>7!==0){var o=null,a=null;if(192===(224&i))o=1,a=127;else if(224===(240&i))o=2,a=2047;else{if(240!==(248&i)){n+=t(128===(192&i)?Ee.UNEXPECTED_CONTINUE:Ee.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length)n+=t(Ee.OVERRUN,n-1,e,r);else{for(var s=i&(1<<8-o-1)-1,u=0;u1114111?n+=t(Ee.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(Ee.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(Ee.OVERLONG,n-1-o,e,r,s):r.push(s))}}else r.push(i)}return r}function Me(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Se.current;t!=Se.current&&(_e.checkNormalize(),e=e.normalize(t));for(var r=[],n=0;n>6|192),r.push(63&i|128);else if(55296==(64512&i)){n++;var o=e.charCodeAt(n);if(n>=e.length||56320!==(64512&o))throw new Error("invalid utf-8 string");var a=65536+((1023&i)<<10)+(1023&o);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return Object(m.a)(r)}function Ce(e){var t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Oe(e,t){return'"'+Te(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?Ce(e):Ce(55296+((e-=65536)>>10&1023))+Ce(56320+(1023&e))})).join("")+'"'}function Ie(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 Pe(e,t){return Ie(Te(e,t))}function Re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Se.current;return Te(Me(e,t))}function Be(e){return ee(Me(e))}var De=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(e){return Object(v.a)(this,r),t.call(this,"address","address",e,!1)}return Object(y.a)(r,[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(e,t){try{be(t)}catch(r){this._throwError(r.message,t)}return e.writeValue(t)}},{key:"decode",value:function(e){return be(Object(m.h)(e.readValue().toHexString(),20))}}]),r}(W),Ne=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(e){var n;return Object(v.a)(this,r),(n=t.call(this,e.name,e.type,void 0,e.dynamic)).coder=e,n}return Object(y.a)(r,[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(e,t){return this.coder.encode(e,t)}},{key:"decode",value:function(e){return this.coder.decode(e)}}]),r}(W),Le=new S.b(q);function je(e,t,r){var n=null;if(Array.isArray(r))n=r;else if(r&&"object"===typeof r){var i={};n=t.map((function(e){var t=e.localName;return t||Le.throwError("cannot encode object for signature with missing names",S.b.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]&&Le.throwError("cannot encode object for signature with duplicate names",S.b.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]=!0,r[t]}))}else Le.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&Le.throwArgumentError("types/value length mismatch","tuple",r);var o=new Z(e.wordSize),a=new Z(e.wordSize),s=[];t.forEach((function(e,t){var r=n[t];if(e.dynamic){var i=a.length;e.encode(a,r);var u=o.writeUpdatableValue();s.push((function(e){u(e+i)}))}else e.encode(o,r)})),s.forEach((function(e){e(o.length)}));var u=e.appendWriter(o);return u+=e.appendWriter(a)}function Ue(e,t){var r=[],n=e.subReader(0);t.forEach((function(t){var i=null;if(t.dynamic){var o=e.readValue(),a=n.subReader(o.toNumber());try{i=t.decode(a)}catch(s){if(s.code===S.b.errors.BUFFER_OVERRUN)throw s;(i=s).baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(s){if(s.code===S.b.errors.BUFFER_OVERRUN)throw s;(i=s).baseType=t.name,i.name=t.localName,i.type=t.type}void 0!=i&&r.push(i)}));var i=t.reduce((function(e,t){var r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach((function(e,t){var n=e.localName;if(n&&1===i[n]&&("length"===n&&(n="_length"),null==r[n])){var o=r[t];o instanceof Error?Object.defineProperty(r,n,{get:function(){throw o}}):r[n]=o}}));for(var o=function(e){var t=r[e];t instanceof Error&&Object.defineProperty(r,e,{get:function(){throw t}})},a=0;a=0?n:"")+"]",s=-1===n||e.dynamic;return(o=t.call(this,"array",a,i,s)).coder=e,o.length=n,o}return Object(y.a)(r,[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],r=0;re._data.length&&Le.throwError("insufficient data length",S.b.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var r=[],n=0;n=0||"tuple"===e)&&at[t])return!0;return(ot[t]||"payable"===t)&&nt.throwArgumentError("invalid modifier","name",t),!1}function ut(e,t){for(var r in t)N(e,r,t[r])}var ct=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),ft=new RegExp(/^(.*)\[([0-9]*)\]$/),lt=function(){function e(t,r){Object(v.a)(this,e),t!==it&&nt.throwError("use fromString",S.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),ut(this,r);var n=this.type.match(ft);ut(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return Object(y.a)(e,[{key:"format",value:function(e){if(e||(e=ct.sighash),ct[e]||nt.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 r="";return"array"===this.baseType?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==ct.sighash&&(r+=this.type),r+="("+this.components.map((function(t){return t.format(e)})).join(e===ct.full?", ":",")+")"):r+=this.type,e!==ct.sighash&&(!0===this.indexed&&(r+=" indexed"),e===ct.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(t,r){return"string"===typeof t?e.fromString(t,r):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(it,{name:t.name||null,type:St(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,r){return n=function(e,t){var r=e;function n(t){nt.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function i(e){var r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");for(var o={type:"",name:"",state:{allowType:!0}},a=o,s=0;s2&&nt.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||nt.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=C.from(r[1]),r[0]):e}function yt(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 bt(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&&nt.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&nt.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||nt.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&&nt.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&&nt.throwArgumentError("unable to determine stateMutability","value",e),t}var gt=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.apply(this,arguments)}return Object(y.a)(r,[{key:"format",value:function(e){if(e||(e=ct.sighash),ct[e]||nt.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&&nt.throwError("cannot format a constructor for sighash",S.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?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isConstructorFragment(e))return e;"constructor"!==e.type&&nt.throwArgumentError("invalid constructor object","value",e);var t=bt(e);t.constant&&nt.throwArgumentError("constructor cannot be constant","value",e);var n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(lt.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?C.from(e.gas):null};return new r(it,n)}},{key:"fromString",value:function(e){var t={type:"constructor"},n=(e=vt(e,t)).match(At);return n&&"constructor"===n[1].trim()||nt.throwArgumentError("invalid constructor string","value",e),t.inputs=ht(n[2].trim(),!1),yt(n[3].trim(),t),r.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),r}(dt),mt=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.apply(this,arguments)}return Object(y.a)(r,[{key:"format",value:function(e){if(e||(e=ct.sighash),ct[e]||nt.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?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isFunctionFragment(e))return e;"function"!==e.type&&nt.throwArgumentError("invalid function object","value",e);var t=bt(e),n={type:e.type,name:_t(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?C.from(e.gas):null};return new r(it,n)}},{key:"fromString",value:function(e){var t={type:"function"},n=(e=vt(e,t)).split(" returns ");n.length>2&&nt.throwArgumentError("invalid function string","value",e);var i=n[0].match(At);if(i||nt.throwArgumentError("invalid function signature","value",e),t.name=i[1].trim(),t.name&&_t(t.name),t.inputs=ht(i[2],!1),yt(i[3].trim(),t),n.length>1){var o=n[1].match(At);""==o[1].trim()&&""==o[3].trim()||nt.throwArgumentError("unexpected tokens","value",e),t.outputs=ht(o[2],!1)}else t.outputs=[];return r.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),r}(gt);function wt(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||nt.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var kt=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.apply(this,arguments)}return Object(y.a)(r,[{key:"format",value:function(e){if(e||(e=ct.sighash),ct[e]||nt.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?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isErrorFragment(e))return e;"error"!==e.type&&nt.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:_t(e.name),inputs:e.inputs?e.inputs.map(lt.fromObject):[]};return wt(new r(it,t))}},{key:"fromString",value:function(e){var t={type:"error"},n=e.match(At);return n||nt.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&_t(t.name),t.inputs=ht(n[2],!1),wt(r.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),r}(dt);function St(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var Et=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function _t(e){return e&&e.match(Et)||nt.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var At=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");var xt=new S.b(q),Tt=new RegExp(/^bytes([0-9]*)$/),Mt=new RegExp(/^(u?int)([0-9]*)$/),Ct=function(){function e(t){Object(v.a)(this,e),xt.checkNew(this instanceof e?this.constructor:void 0,e),N(this,"coerceFunc",t||null)}return Object(y.a)(e,[{key:"_getCoder",value:function(e){var t=this;switch(e.baseType){case"address":return new De(e.name);case"bool":return new Ke(e.name);case"string":return new tt(e.name);case"bytes":return new Ve(e.name);case"array":return new Fe(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new rt((e.components||[]).map((function(e){return t._getCoder(e)})),e.name);case"":return new Je(e.name)}var r=e.type.match(Mt);if(r){var n=parseInt(r[2]||"256");return(0===n||n>256||n%8!==0)&&xt.throwArgumentError("invalid "+r[1]+" bit length","param",e),new et(n/8,"int"===r[1],e.name)}if(r=e.type.match(Tt)){var i=parseInt(r[1]);return(0===i||i>32)&&xt.throwArgumentError("invalid bytes length","param",e),new He(i,e.name)}return xt.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new Y(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new Z(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,r=e.map((function(e){return t._getCoder(lt.from(e))}));return new rt(r,"_").defaultValue()}},{key:"encode",value:function(e,t){var r=this;e.length!==t.length&&xt.throwError("types/values length mismatch",S.b.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var n=e.map((function(e){return r._getCoder(lt.from(e))})),i=new rt(n,"_"),o=this._getWriter();return i.encode(o,t),o.data}},{key:"decode",value:function(e,t,r){var n=this,i=e.map((function(e){return n._getCoder(lt.from(e))}));return new rt(i,"_").decode(this._getReader(Object(m.a)(t),r))}}]),e}(),Ot=new Ct,It=new S.b(q),Pt=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.apply(this,arguments)}return r}(J),Rt=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.apply(this,arguments)}return r}(J),Bt=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.apply(this,arguments)}return Object(y.a)(r,null,[{key:"isIndexed",value:function(e){return!(!e||!e._isIndexed)}}]),r}(J),Dt={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Nt(e,t){var r=new Error("deferred error during ABI decoding triggered accessing ".concat(e));return r.error=t,r}var Lt=function(){function e(t){var r=this;Object(v.a)(this,e),It.checkNew(this instanceof e?this.constructor:void 0,e);N(this,"fragments",("string"===typeof t?JSON.parse(t):t).map((function(e){return dt.from(e)})).filter((function(e){return null!=e}))),N(this,"_abiCoder",L(this instanceof e?this.constructor:void 0,"getAbiCoder")()),N(this,"functions",{}),N(this,"errors",{}),N(this,"events",{}),N(this,"structs",{}),this.fragments.forEach((function(e){var t=null;switch(e.type){case"constructor":return r.deploy?void It.warn("duplicate definition - constructor"):void N(r,"deploy",e);case"function":t=r.functions;break;case"event":t=r.events;break;case"error":t=r.errors;break;default:return}var n=e.format();t[n]?It.warn("duplicate definition - "+n):t[n]=e})),this.deploy||N(this,"deploy",gt.from({payable:!1,type:"constructor"})),N(this,"_isInterface",!0)}return Object(y.a)(e,[{key:"format",value:function(e){e||(e=ct.full),e===ct.sighash&&It.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(m.l)(e)){for(var t in this.functions)if(e===this.getSighash(t))return this.functions[t];It.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){var r=e.trim(),n=Object.keys(this.functions).filter((function(e){return e.split("(")[0]===r}));return 0===n.length?It.throwArgumentError("no matching function","name",r):n.length>1&&It.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var i=this.functions[mt.fromString(e).format()];return i||It.throwArgumentError("no matching function","signature",e),i}},{key:"getEvent",value:function(e){if(Object(m.l)(e)){var t=e.toLowerCase();for(var r in this.events)if(t===this.getEventTopic(r))return this.events[r];It.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.events).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?It.throwArgumentError("no matching event","name",n):i.length>1&&It.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}var o=this.events[pt.fromString(e).format()];return o||It.throwArgumentError("no matching event","signature",e),o}},{key:"getError",value:function(e){if(Object(m.l)(e)){var t=L(this.constructor,"getSighash");for(var r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}It.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?It.throwArgumentError("no matching error","name",n):i.length>1&&It.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}var o=this.errors[mt.fromString(e).format()];return o||It.throwArgumentError("no matching error","signature",e),o}},{key:"getSighash",value:function(e){return"string"===typeof e&&(e=this.getFunction(e)),L(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"===typeof e&&(e=this.getEvent(e)),L(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:"decodeFunctionData",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var r=Object(m.a)(t);return Object(m.i)(r.slice(0,4))!==this.getSighash(e)&&It.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",Object(m.i)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),Object(m.i)(Object(m.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var r=Object(m.a)(t),n=null,i=null,o=null,a=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(c){}break;case 4:var s=Object(m.i)(r.slice(0,4)),u=Dt[s];if(u)i=this._abiCoder.decode(u.inputs,r.slice(4)),o=u.name,a=u.signature,u.reason&&(n=i[0]);else try{var c=this.getError(s);i=this._abiCoder.decode(c.inputs,r.slice(4)),o=c.name,a=c.format()}catch(c){console.log(c)}}return It.throwError("call revert exception",S.b.errors.CALL_EXCEPTION,{method:e.format(),errorArgs:i,errorName:o,errorSignature:a,reason:n})}},{key:"encodeFunctionResult",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),Object(m.i)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var r=this;"string"===typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&It.throwError("too many arguments for "+e.format(),S.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});var n=[];e.anonymous||n.push(this.getEventTopic(e));var i=function(e,t){return"string"===e.type?Be(t):"bytes"===e.type?ee(Object(m.i)(t)):("address"===e.type&&r._abiCoder.encode(["address"],[t]),Object(m.h)(Object(m.i)(t),32))};for(t.forEach((function(t,r){var o=e.inputs[r];o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?It.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((function(e){return i(o,e)}))):n.push(i(o,t)):null!=t&&It.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}},{key:"encodeEventLog",value:function(e,t){var r=this;"string"===typeof e&&(e=this.getEvent(e));var n=[],i=[],o=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&It.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,a){var s=t[a];if(e.indexed)if("string"===e.type)n.push(Be(s));else if("bytes"===e.type)n.push(ee(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([e.type],[s]))}else i.push(e),o.push(s)})),{data:this._abiCoder.encode(i,o),topics:n}}},{key:"decodeEventLog",value:function(e,t,r){if("string"===typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){var n=this.getEventTopic(e);Object(m.l)(r[0],32)&&r[0].toLowerCase()===n||It.throwError("fragment/topic mismatch",S.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var i=[],o=[],a=[];e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(i.push(lt.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(i.push(e),a.push(!1)):(o.push(e),a.push(!1))}));var s=null!=r?this._abiCoder.decode(i,Object(m.b)(r)):null,u=this._abiCoder.decode(o,t,!0),c=[],f=0,l=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==s)c[t]=new Bt({_isIndexed:!0,hash:null});else if(a[t])c[t]=new Bt({_isIndexed:!0,hash:s[l++]});else try{c[t]=s[l++]}catch(n){c[t]=n}else try{c[t]=u[f++]}catch(n){c[t]=n}if(e.name&&null==c[e.name]){var r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{get:function(){throw Nt("property ".concat(JSON.stringify(e.name)),r)}}):c[e.name]=r}}));for(var h=function(e){var t=c[e];t instanceof Error&&Object.defineProperty(c,e,{get:function(){throw Nt("index ".concat(e),t)}})},d=0;d=0)throw e;return zt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",S.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:r})}))),null==r.chainId?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then((function(t){return 0!==t[1]&&t[0]!==t[1]&&zt.throwArgumentError("chainId address mismatch","transaction",e),t[0]})),t.next=10,j(r);case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}}),t,this)})))}},{key:"_checkProvider",value:function(e){this.provider||zt.throwError("missing provider",S.b.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),qt=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(e,n){var i;return Object(v.a)(this,r),zt.checkNew(this instanceof r?this.constructor:void 0,r),i=t.call(this),N(Object(f.a)(i),"address",e),N(Object(f.a)(i),"provider",n||null),i}return Object(y.a)(r,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(e,t){return Promise.resolve().then((function(){zt.throwError(e,S.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,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(e){return new r(this.address,e)}}]),r}(Jt),Gt=r(513),Xt=new S.b("signing-key/5.3.0"),Wt=null;function Zt(){return Wt||(Wt=new Gt.a("secp256k1")),Wt}var Yt=function(){function e(t){Object(v.a)(this,e),N(this,"curve","secp256k1"),N(this,"privateKey",Object(m.i)(t));var r=Zt().keyFromPrivate(Object(m.a)(this.privateKey));N(this,"publicKey","0x"+r.getPublic(!1,"hex")),N(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),N(this,"_isSigningKey",!0)}return Object(y.a)(e,[{key:"_addPoint",value:function(e){var t=Zt().keyFromPublic(Object(m.a)(this.publicKey)),r=Zt().keyFromPublic(Object(m.a)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(e){var t=Zt().keyFromPrivate(Object(m.a)(this.privateKey)),r=Object(m.a)(e);32!==r.length&&Xt.throwArgumentError("bad digest length","digest",e);var n=t.sign(r,{canonical:!0});return Object(m.n)({recoveryParam:n.recoveryParam,r:Object(m.h)("0x"+n.r.toString(16),32),s:Object(m.h)("0x"+n.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(e){var t=Zt().keyFromPrivate(Object(m.a)(this.privateKey)),r=Zt().keyFromPublic(Object(m.a)($t(e)));return Object(m.h)("0x"+t.derive(r.getPublic()).toString(16),32)}}],[{key:"isSigningKey",value:function(e){return!(!e||!e._isSigningKey)}}]),e}();function Qt(e,t){var r=Object(m.n)(t),n={r:Object(m.a)(r.r),s:Object(m.a)(r.s)};return"0x"+Zt().recoverPubKey(Object(m.a)(e),n,r.recoveryParam).encode("hex",!1)}function $t(e,t){var r=Object(m.a)(e);if(32===r.length){var n=new Yt(r);return t?"0x"+Zt().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?t?Object(m.i)(r):"0x"+Zt().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+Zt().keyFromPublic(r).getPublic(!0,"hex"):Object(m.i)(r):Xt.throwArgumentError("invalid public or private key","key","[REDACTED]")}var er=new S.b("transactions/5.3.0");function tr(e){return"0x"===e?null:be(e)}function rr(e){return"0x"===e?Ge:C.from(e)}var nr=[{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"}],ir={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0};function or(e){var t=$t(e);return be(Object(m.e)(ee(Object(m.e)(t,1)),12))}function ar(e,t){return or(Qt(Object(m.a)(e),t))}function sr(e,t){var r=Object(m.o)(C.from(e).toHexString());return r.length>32&&er.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function ur(e,t){return{address:be(e),storageKeys:(t||[]).map((function(t,r){return 32!==Object(m.d)(t)&&er.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(r,"]"),t),t.toLowerCase()}))}}function cr(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&er.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),ur(e[0],e[1])):ur(e.address,e.storageKeys)}));var t=Object.keys(e).map((function(t){var r=e[t].reduce((function(e,t){return e[t]=!0,e}),{});return ur(t,Object.keys(r).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function fr(e,t){var r,n=[sr(e.chainId||0,"chainId"),sr(e.nonce||0,"nonce"),sr(e.gasPrice||0,"gasPrice"),sr(e.gasLimit||0,"gasLimit"),null!=e.to?be(e.to):"0x",sr(e.value||0,"value"),e.data||"0x",(r=e.accessList||[],cr(r).map((function(e){return[e.address,e.storageKeys]})))];if(t){var i=Object(m.n)(t);n.push(sr(i.recoveryParam,"recoveryParam")),n.push(Object(m.o)(i.r)),n.push(Object(m.o)(i.s))}return Object(m.c)(["0x01",oe(n)])}function lr(e,t){if(null==e.type)return null!=e.accessList&&er.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){U(e,ir);var r=[];nr.forEach((function(t){var n=e[t.name]||[],i={};t.numeric&&(i.hexPad="left"),n=Object(m.a)(Object(m.i)(n,i)),t.length&&n.length!==t.length&&n.length>0&&er.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Object(m.o)(n)).length>t.maxLength&&er.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),r.push(Object(m.i)(n))}));var n=0;if(null!=e.chainId?"number"!==typeof(n=e.chainId)&&er.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!Object(m.k)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(Object(m.i)(n)),r.push("0x"),r.push("0x")),!t)return oe(r);var i=Object(m.n)(t),o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&er.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&er.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(Object(m.i)(o)),r.push(Object(m.o)(Object(m.a)(i.r))),r.push(Object(m.o)(Object(m.a)(i.s))),oe(r)}(e,t);switch(e.type){case 1:return fr(e,t)}return er.throwError("unsupported transaction type: ".concat(e.type),S.b.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function hr(e){var t=Object(m.a)(e);if(t[0]>127)return function(e){var t=ue(e);9!==t.length&&6!==t.length&&er.throwArgumentError("invalid raw transaction","rawTransaction",e);var r={nonce:rr(t[0]).toNumber(),gasPrice:rr(t[1]),gasLimit:rr(t[2]),to:tr(t[3]),value:rr(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=C.from(t[6]).toNumber()}catch(a){return console.log(a),r}if(r.r=Object(m.h)(t[7],32),r.s=Object(m.h)(t[8],32),C.from(r.r).isZero()&&C.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,i=t.slice(0,6);0!==r.chainId&&(i.push(Object(m.i)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);var o=ee(oe(i));try{r.from=ar(o,{r:Object(m.i)(r.r),s:Object(m.i)(r.s),recoveryParam:n})}catch(a){console.log(a)}r.hash=ee(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){var t=ue(e.slice(1));8!==t.length&&11!==t.length&&er.throwArgumentError("invalid component count for transaction type: 1","payload",Object(m.i)(e));var r={type:1,chainId:rr(t[0]).toNumber(),nonce:rr(t[1]).toNumber(),gasPrice:rr(t[2]),gasLimit:rr(t[3]),to:tr(t[4]),value:rr(t[5]),data:t[6],accessList:cr(t[7])};if(8===t.length)return r;try{var n=rr(t[8]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");r.v=n}catch(o){er.throwArgumentError("invalid v for transaction type: 1","v",t[8])}r.r=Object(m.h)(t[9],32),r.s=Object(m.h)(t[10],32);try{var i=ee(fr(r));r.from=ar(i,{r:r.r,s:r.s,recoveryParam:r.v})}catch(o){console.log(o)}return r.hash=ee(e),r}(t)}return er.throwError("unsupported transaction type: ".concat(t[0]),S.b.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var dr=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},pr=new S.b("contracts/5.3.0"),vr={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0};function yr(e,t){return dr(this,void 0,void 0,g.a.mark((function r(){var n,i;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t;case 2:return n=r.sent,r.prev=3,r.abrupt("return",be(n));case 7:r.prev=7,r.t0=r.catch(3);case 9:return e||pr.throwError("a provider or signer is needed to resolve ENS names",S.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"}),r.next=12,e.resolveName(n);case 12:return null==(i=r.sent)&&pr.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r.abrupt("return",i);case 15:case"end":return r.stop()}}),r,null,[[3,7]])})))}function br(e,t,r){return dr(this,void 0,void 0,g.a.mark((function n(){return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Array.isArray(r)){n.next=4;break}return n.next=3,Promise.all(r.map((function(r,n){return br(e,Array.isArray(t)?t[n]:t[r.name],r)})));case 3:return n.abrupt("return",n.sent);case 4:if("address"!==r.type){n.next=8;break}return n.next=7,yr(e,t);case 7:return n.abrupt("return",n.sent);case 8:if("tuple"!==r.type){n.next=12;break}return n.next=11,br(e,t,r.components);case 11:return n.abrupt("return",n.sent);case 12:if("array"!==r.baseType){n.next=18;break}if(Array.isArray(t)){n.next=15;break}return n.abrupt("return",Promise.reject(new Error("invalid value for array")));case 15:return n.next=17,Promise.all(t.map((function(t){return br(e,t,r.arrayChildren)})));case 17:return n.abrupt("return",n.sent);case 18:return n.abrupt("return",t);case 19:case"end":return n.stop()}}),n)})))}function gr(e,t,r){return dr(this,void 0,void 0,g.a.mark((function n(){var i,o,a,s,u,c,f,l,h,d,p=this;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i={},r.length===t.inputs.length+1&&"object"===typeof r[r.length-1]&&(i=F(r.pop())),pr.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?i.from?i.from=j({override:yr(e.signer,i.from),signer:e.signer.getAddress()}).then((function(e){return dr(p,void 0,void 0,g.a.mark((function t(){return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return be(e.signer)!==e.override&&pr.throwError("Contract with a Signer cannot override from",S.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.abrupt("return",e.override);case 2:case"end":return t.stop()}}),t)})))})):i.from=e.signer.getAddress():i.from&&(i.from=yr(e.provider,i.from)),n.next=6,j({args:br(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:j(i)||{}});case 6:if(o=n.sent,a=e.interface.encodeFunctionData(t,o.args),s={data:a,to:o.address},null!=(u=o.overrides).nonce&&(s.nonce=C.from(u.nonce).toNumber()),null!=u.gasLimit&&(s.gasLimit=C.from(u.gasLimit)),null!=u.gasPrice&&(s.gasPrice=C.from(u.gasPrice)),null!=u.from&&(s.from=u.from),null!=u.type&&(s.type=u.type),null!=u.accessList&&(s.accessList=cr(u.accessList)),null==s.gasLimit&&null!=t.gas){for(c=21e3,f=Object(m.a)(a),l=0;l1)){var r=t[0];try{null==i[e]&&N(i,e,i[r])}catch(n){}null==i.functions[e]&&N(i.functions,e,i.functions[r]),null==i.callStatic[e]&&N(i.callStatic,e,i.callStatic[r]),null==i.populateTransaction[e]&&N(i.populateTransaction,e,i.populateTransaction[r]),null==i.estimateGas[e]&&N(i.estimateGas,e,i.estimateGas[r])}}))}return Object(y.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&&pr.throwError("contract not deployed",S.b.errors.UNSUPPORTED_OPERATION,{contractAddress:t.address,operation:"getDeployed"}),t}))),this._deployedPromise}},{key:"fallback",value:function(e){var t=this;this.signer||pr.throwError("sending a transactions require a signer",S.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var r=F(e||{});return["from","to"].forEach((function(e){null!=r[e]&&pr.throwError("cannot override "+e,S.b.errors.UNSUPPORTED_OPERATION,{operation:e})})),r.to=this.resolvedAddress,this.deployed().then((function(){return t.signer.sendTransaction(r)}))}},{key:"connect",value:function(e){"string"===typeof e&&(e=new qt(e,this.provider));var t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&N(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 Er);if("event"===e)return this._normalizeRunningEvent(new Sr("event",null));if("*"===e)return this._normalizeRunningEvent(new Ar(this.address,this.interface));var t=this.interface.getEvent(e);return this._normalizeRunningEvent(new _r(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{var r=e.topics[0];if("string"!==typeof r)throw new Error("invalid topic");var n=this.interface.getEvent(r);return this._normalizeRunningEvent(new _r(this.address,this.interface,n,e.topics))}catch(o){}var i={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Sr(kr(i),i))}return this._normalizeRunningEvent(new Ar(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,r){var n=this,i=H(t);return i.removeListener=function(){r&&(e.removeListener(r),n._checkRunningEvents(e))},i.getBlock=function(){return n.provider.getBlock(t.blockHash)},i.getTransaction=function(){return n.provider.getTransaction(t.transactionHash)},i.getTransactionReceipt=function(){return n.provider.getTransactionReceipt(t.transactionHash)},e.prepareEvent(i),i}},{key:"_addEventListener",value:function(e,t,r){var n=this;if(this.provider||pr.throwError("events require a provider or a signer with a provider",S.b.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){var i=function(r){var i=n._wrapEvent(e,r,t);if(null==i.decodeError)try{var o=e.getEmit(i);n.emit.apply(n,[e.filter].concat(Object(c.a)(o)))}catch(a){i.decodeError=a.error}null!=e.filter&&n.emit("event",i),null!=i.decodeError&&n.emit("error",i.decodeError,i)};this._wrappedEmits[e.tag]=i,null!=e.filter&&this.provider.on(e.filter,i)}}},{key:"queryFilter",value:function(e,t,r){var n=this,i=this._getRunningEvent(e),o=F(i.filter);return"string"===typeof t&&Object(m.l)(t,32)?(null!=r&&pr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),o.blockHash=t):(o.fromBlock=null!=t?t:0,o.toBlock=null!=r?r:"latest"),this.provider.getLogs(o).then((function(e){return e.map((function(e){return n._wrapEvent(i,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),r=arguments.length,n=new Array(r>1?r-1:0),i=1;i0;return this._checkRunningEvents(t),o}},{key:"listenerCount",value:function(e){var t=this;return this.provider?null==e?Object.keys(this._runningEvents).reduce((function(e,r){return e+t._runningEvents[r].listenerCount()}),0):this._getRunningEvent(e).listenerCount():0}},{key:"listeners",value:function(e){var t=this;if(!this.provider)return[];if(null==e){var r=function(){var e=[];for(var r in t._runningEvents)t._runningEvents[r].listeners().forEach((function(t){e.push(t)}));return{v:e}}();if("object"===typeof r)return r.v}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 r=this._runningEvents[t];r.removeAllListeners(),this._checkRunningEvents(r)}return this}var n=this._getRunningEvent(e);return n.removeAllListeners(),this._checkRunningEvents(n),this}},{key:"off",value:function(e,t){if(!this.provider)return this;var r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}},{key:"removeListener",value:function(e,t){return this.off(e,t)}}],[{key:"getContractAddress",value:function(e){return we(e)}},{key:"getInterface",value:function(e){return Lt.isInterface(e)?e:new Lt(e)}},{key:"isIndexed",value:function(e){return Bt.isIndexed(e)}}]),e}(),Tr=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.apply(this,arguments)}return r}(xr),Mr=function(){function e(t,r,n){Object(v.a)(this,e);var i=null;"0x"!==(i="string"===typeof r?r:Object(m.j)(r)?Object(m.i)(r):r&&"string"===typeof r.object?r.object:"!").substring(0,2)&&(i="0x"+i),(!Object(m.l)(i)||i.length%2)&&pr.throwArgumentError("invalid bytecode","bytecode",r),n&&!Jt.isSigner(n)&&pr.throwArgumentError("invalid signer","signer",n),N(this,"bytecode",i),N(this,"interface",L(this instanceof e?this.constructor:void 0,"getInterface")(t)),N(this,"signer",n||null)}return Object(y.a)(e,[{key:"getDeployTransaction",value:function(){for(var e={},t=arguments.length,r=new Array(t),n=0;n=0&&e<=256&&!(e%1)?"1"+Br.substring(0,e):Cr.throwArgumentError("invalid decimal size","decimals",e)}function Nr(e,t){null==t&&(t=0);var r=Dr(t),n=(e=C.from(e)).lt(Ir);n&&(e=e.mul(Pr));for(var i=e.mod(r).toString();i.length2&&Cr.throwArgumentError("too many decimal points","value",e);var o=i[0],a=i[1];for(o||(o="0"),a||(a="0"),a.replace(/^([0-9]*?)(0*)$/,(function(e,t,r){return t})).length>r.length-1&&Rr("fractional component exceeds decimals","underflow","parseFixed");a.length80&&Cr.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new e(Or,r,n,i)}}]),e}(),Ur=function(){function e(t,r,n,i){Object(v.a)(this,e),Cr.checkNew(this instanceof e?this.constructor:void 0,e),t!==Or&&Cr.throwError("cannot use FixedNumber constructor; use FixedNumber.from",S.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}return Object(y.a)(e,[{key:"_checkFormat",value:function(e){this.format.name!==e.format.name&&Cr.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}},{key:"addUnsafe",value:function(t){this._checkFormat(t);var r=Lr(this._value,this.format.decimals),n=Lr(t._value,t.format.decimals);return e.fromValue(r.add(n),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(t){this._checkFormat(t);var r=Lr(this._value,this.format.decimals),n=Lr(t._value,t.format.decimals);return e.fromValue(r.sub(n),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(t){this._checkFormat(t);var r=Lr(this._value,this.format.decimals),n=Lr(t._value,t.format.decimals);return e.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(t){this._checkFormat(t);var r=Lr(this._value,this.format.decimals),n=Lr(t._value,t.format.decimals);return e.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}},{key:"floor",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(Fr)),r}},{key:"ceiling",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(Fr)),r}},{key:"round",value:function(t){null==t&&(t=0);var r=this.toString().split(".");if(1===r.length&&r.push("0"),(t<0||t>80||t%1)&&Cr.throwArgumentError("invalid decimal count","decimals",t),r[1].length<=t)return this;var n=e.from("1"+Br.substring(0,t),this.format),i=Kr.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(e){if(null==e)return this._hex;e%8&&Cr.throwArgumentError("invalid byte width","width",e);var t=C.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Object(m.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,r,n){return null!=n||null==r||function(e){return null!=e&&(C.isBigNumber(e)||"number"===typeof e&&e%1===0||"string"===typeof e&&!!e.match(/^-?[0-9]+$/)||Object(m.l)(e)||"bigint"===typeof e||Object(m.j)(e))}(r)||(n=r,r=null),null==r&&(r=0),null==n&&(n="fixed"),e.fromString(Nr(t,r),jr.from(n))}},{key:"fromString",value:function(t,r){null==r&&(r="fixed");var n=jr.from(r),i=Lr(t,n.decimals);!n.signed&&i.lt(Ir)&&Rr("unsigned value cannot be negative","overflow","value",t);var o=null;n.signed?o=i.toTwos(n.width).toHexString():(o=i.toHexString(),o=Object(m.h)(o,n.width/8));var a=Nr(i,n.decimals);return new e(Or,o,a,n)}},{key:"fromBytes",value:function(t,r){null==r&&(r="fixed");var n=jr.from(r);if(Object(m.a)(t).length>n.width/8)throw new Error("overflow");var i=C.from(t);n.signed&&(i=i.fromTwos(n.width));var o=i.toTwos((n.signed?0:1)+n.width).toHexString(),a=Nr(i,n.decimals);return new e(Or,o,a,n)}},{key:"from",value:function(t,r){if("string"===typeof t)return e.fromString(t,r);if(Object(m.j)(t))return e.fromBytes(t,r);try{return e.fromValue(t,0,r)}catch(n){if(n.code!==S.b.errors.INVALID_ARGUMENT)throw n}return Cr.throwArgumentError("invalid FixedNumber value","value",t)}},{key:"isFixedNumber",value:function(e){return!(!e||!e._isFixedNumber)}}]),e}(),Fr=Ur.from(1),Kr=Ur.from("0.5");function zr(e){return"string"===typeof e&&(e=Me(e)),ee(Object(m.b)([Me("\x19Ethereum Signed Message:\n"),Me(String(e.length)),e]))}var Vr="hash/5.3.0",Hr=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Jr=new S.b(Vr),qr=new Uint8Array(32);qr.fill(0);var Gr=C.from(-1),Xr=C.from(0),Wr=C.from(1),Zr=C.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Yr=Object(m.h)(Wr.toHexString(),32),Qr=Object(m.h)(Xr.toHexString(),32),$r={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},en=["name","version","chainId","verifyingContract","salt"];function tn(e){return function(t){return"string"!==typeof t&&Jr.throwArgumentError("invalid domain value for ".concat(JSON.stringify(e)),"domain.".concat(e),t),t}}var rn={name:tn("name"),version:tn("version"),chainId:function(e){try{return C.from(e).toString()}catch(t){}return Jr.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return be(e).toLowerCase()}catch(t){}return Jr.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{var t=Object(m.a)(e);if(32!==t.length)throw new Error("bad length");return Object(m.i)(t)}catch(r){}return Jr.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function nn(e){var t=e.match(/^(u?)int(\d*)$/);if(t){var r=""===t[1],n=parseInt(t[2]||"256");(n%8!==0||n>256||t[2]&&t[2]!==String(n))&&Jr.throwArgumentError("invalid numeric width","type",e);var i=Zr.mask(r?n-1:n),o=r?i.add(Wr).mul(Gr):Xr;return function(t){var r=C.from(t);return(r.lt(o)||r.gt(i))&&Jr.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),Object(m.h)(r.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))&&Jr.throwArgumentError("invalid bytes width","type",e),function(t){return Object(m.a)(t).length!==s&&Jr.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=Object(m.a)(e),r=t.length%32;return r?Object(m.c)([t,qr.slice(r)]):Object(m.i)(t)}(t)}}switch(e){case"address":return function(e){return Object(m.h)(be(e),32)};case"bool":return function(e){return e?Yr:Qr};case"bytes":return function(e){return ee(e)};case"string":return function(e){return Be(e)}}return null}function on(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var an,sn=function(){function e(t){Object(v.a)(this,e),N(this,"types",Object.freeze(H(t))),N(this,"_encoderCache",{}),N(this,"_types",{});var r={},n={},i={};Object.keys(t).forEach((function(e){r[e]={},n[e]=[],i[e]={}}));var o=function(e){var i={};t[e].forEach((function(o){i[o.name]&&Jr.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(e)),"types",t),i[o.name]=!0;var a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===e&&Jr.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),nn(a)||(n[a]||Jr.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",t),n[a].push(e),r[e][a]=!0)}))};for(var a in t)o(a);var s=Object.keys(n).filter((function(e){return 0===n[e].length}));for(var u in 0===s.length?Jr.throwArgumentError("missing primary type","types",t):s.length>1&&Jr.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),N(this,"primaryType",s[0]),function e(o,a){a[o]&&Jr.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",t),a[o]=!0,Object.keys(r[o]).forEach((function(t){n[t]&&(e(t,a),Object.keys(a).forEach((function(e){i[e][t]=!0})))})),delete a[o]}(this.primaryType,{}),i){var c=Object.keys(i[u]);c.sort(),this._types[u]=on(u,t[u])+c.map((function(e){return on(e,t[e])})).join("")}}return Object(y.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,r=nn(e);if(r)return r;var n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var i=n[1],o=this.getEncoder(i),a=parseInt(n[3]);return function(e){a>=0&&e.length!==a&&Jr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var r=e.map(o);return t._types[i]&&(r=r.map(ee)),ee(Object(m.c)(r))}}var s=this.types[e];if(s){var u=Be(this._types[e]);return function(e){var r=s.map((function(r){var n=r.name,i=r.type,o=t.getEncoder(i)(e[n]);return t._types[i]?ee(o):o}));return r.unshift(u),Object(m.c)(r)}}return Jr.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||Jr.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 ee(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,r){var n=this;if(nn(e))return r(e,t);var i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){var o=i[1],a=parseInt(i[3]);return a>=0&&t.length!==a&&Jr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return n._visit(o,e,r)}))}var s=this.types[e];return s?s.reduce((function(e,i){var o=i.name,a=i.type;return e[o]=n._visit(a,t[o],r),e}),{}):Jr.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}],[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,r,n){return e.from(r).hashStruct(t,n)}},{key:"hashDomain",value:function(t){var r=[];for(var n in t){var i=$r[n];i||Jr.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",t),r.push({name:n,type:i})}return r.sort((function(e,t){return en.indexOf(e.name)-en.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:r},t)}},{key:"encode",value:function(t,r,n){return Object(m.c)(["0x1901",e.hashDomain(t),e.from(r).hash(n)])}},{key:"hash",value:function(t,r,n){return ee(e.encode(t,r,n))}},{key:"resolveNames",value:function(t,r,n,i){return Hr(this,void 0,void 0,g.a.mark((function o(){var a,s,u;return g.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:t=F(t),a={},t.verifyingContract&&!Object(m.l)(t.verifyingContract,20)&&(a[t.verifyingContract]="0x"),(s=e.from(r)).visit(n,(function(e,t){return"address"!==e||Object(m.l)(t,20)||(a[t]="0x"),t})),o.t0=g.a.keys(a);case 6:if((o.t1=o.t0()).done){o.next=13;break}return u=o.t1.value,o.next=10,i(u);case 10:a[u]=o.sent,o.next=6;break;case 13:return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),n=s.visit(n,(function(e,t){return"address"===e&&a[t]?a[t]:t})),o.abrupt("return",{domain:t,value:n});case 16:case"end":return o.stop()}}),o)})))}},{key:"getPayload",value:function(t,r,n){e.hashDomain(t);var i={},o=[];en.forEach((function(e){var r=t[e];null!=r&&(i[e]=rn[e](r),o.push({name:e,type:$r[e]}))}));var a=e.from(r),s=F(r);return s.EIP712Domain?Jr.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):s.EIP712Domain=o,a.encode(n),{types:s,domain:i,primaryType:a.primaryType,message:a.visit(n,(function(e,t){if(e.match(/^bytes(\d*)/))return Object(m.i)(Object(m.a)(t));if(e.match(/^u?int/))return C.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&Jr.throwArgumentError("invalid string","value",t),t}return Jr.throwArgumentError("unsupported type","type",e)}))}}}]),e}(),un=function(){function e(t){Object(v.a)(this,e),N(this,"alphabet",t),N(this,"base",t.length),N(this,"_alphabetMap",{}),N(this,"_leader",t.charAt(0));for(var r=0;r0;)r.push(i%this.base),i=i/this.base|0}for(var a="",s=0;0===t[s]&&s=0;--u)a+=this.alphabet[r[u]];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 r=0;r>=8;for(;i>0;)t.push(255&i),i>>=8}for(var a=0;e[a]===this._leader&&a>24&255,f[t.length+1]=l>>16&255,f[t.length+2]=l>>8&255,f[t.length+3]=255&l;var h=Object(m.a)(yn(i,e,f));o||(o=h.length,s=new Uint8Array(o),a=n-((u=Math.ceil(n/o))-1)*o),s.set(h);for(var d=1;d=65&&e<=90||e>=97&&e<=123})))}function Cn(e){if(null==Tn&&((Tn="A/bacoAbdomenAbejaAbiertoAbogadoAbonoAbortoAbrazoAbrirAbueloAbusoAcabarAcademiaAccesoAccio/nAceiteAcelgaAcentoAceptarA/cidoAclararAcne/AcogerAcosoActivoActoActrizActuarAcudirAcuerdoAcusarAdictoAdmitirAdoptarAdornoAduanaAdultoAe/reoAfectarAficio/nAfinarAfirmarA/gilAgitarAgoni/aAgostoAgotarAgregarAgrioAguaAgudoA/guilaAgujaAhogoAhorroAireAislarAjedrezAjenoAjusteAlacra/nAlambreAlarmaAlbaA/lbumAlcaldeAldeaAlegreAlejarAlertaAletaAlfilerAlgaAlgodo/nAliadoAlientoAlivioAlmaAlmejaAlmi/barAltarAltezaAltivoAltoAlturaAlumnoAlzarAmableAmanteAmapolaAmargoAmasarA/mbarA/mbitoAmenoAmigoAmistadAmorAmparoAmplioAnchoAncianoAnclaAndarAnde/nAnemiaA/nguloAnilloA/nimoAni/sAnotarAntenaAntiguoAntojoAnualAnularAnuncioA~adirA~ejoA~oApagarAparatoApetitoApioAplicarApodoAporteApoyoAprenderAprobarApuestaApuroAradoAra~aArarA/rbitroA/rbolArbustoArchivoArcoArderArdillaArduoA/reaA/ridoAriesArmoni/aArne/sAromaArpaArpo/nArregloArrozArrugaArteArtistaAsaAsadoAsaltoAscensoAsegurarAseoAsesorAsientoAsiloAsistirAsnoAsombroA/speroAstillaAstroAstutoAsumirAsuntoAtajoAtaqueAtarAtentoAteoA/ticoAtletaA/tomoAtraerAtrozAtu/nAudazAudioAugeAulaAumentoAusenteAutorAvalAvanceAvaroAveAvellanaAvenaAvestruzAvio/nAvisoAyerAyudaAyunoAzafra/nAzarAzoteAzu/carAzufreAzulBabaBaborBacheBahi/aBaileBajarBalanzaBalco/nBaldeBambu/BancoBandaBa~oBarbaBarcoBarnizBarroBa/sculaBasto/nBasuraBatallaBateri/aBatirBatutaBau/lBazarBebe/BebidaBelloBesarBesoBestiaBichoBienBingoBlancoBloqueBlusaBoaBobinaBoboBocaBocinaBodaBodegaBoinaBolaBoleroBolsaBombaBondadBonitoBonoBonsa/iBordeBorrarBosqueBoteBoti/nBo/vedaBozalBravoBrazoBrechaBreveBrilloBrincoBrisaBrocaBromaBronceBroteBrujaBruscoBrutoBuceoBucleBuenoBueyBufandaBufo/nBu/hoBuitreBultoBurbujaBurlaBurroBuscarButacaBuzo/nCaballoCabezaCabinaCabraCacaoCada/verCadenaCaerCafe/Cai/daCaima/nCajaCajo/nCalCalamarCalcioCaldoCalidadCalleCalmaCalorCalvoCamaCambioCamelloCaminoCampoCa/ncerCandilCanelaCanguroCanicaCantoCa~aCa~o/nCaobaCaosCapazCapita/nCapoteCaptarCapuchaCaraCarbo/nCa/rcelCaretaCargaCari~oCarneCarpetaCarroCartaCasaCascoCaseroCaspaCastorCatorceCatreCaudalCausaCazoCebollaCederCedroCeldaCe/lebreCelosoCe/lulaCementoCenizaCentroCercaCerdoCerezaCeroCerrarCertezaCe/spedCetroChacalChalecoChampu/ChanclaChapaCharlaChicoChisteChivoChoqueChozaChuletaChuparCiclo/nCiegoCieloCienCiertoCifraCigarroCimaCincoCineCintaCipre/sCircoCiruelaCisneCitaCiudadClamorClanClaroClaseClaveClienteClimaCli/nicaCobreCoccio/nCochinoCocinaCocoCo/digoCodoCofreCogerCoheteCoji/nCojoColaColchaColegioColgarColinaCollarColmoColumnaCombateComerComidaCo/modoCompraCondeConejoCongaConocerConsejoContarCopaCopiaCorazo/nCorbataCorchoCordo/nCoronaCorrerCoserCosmosCostaCra/neoCra/terCrearCrecerCrei/doCremaCri/aCrimenCriptaCrisisCromoCro/nicaCroquetaCrudoCruzCuadroCuartoCuatroCuboCubrirCucharaCuelloCuentoCuerdaCuestaCuevaCuidarCulebraCulpaCultoCumbreCumplirCunaCunetaCuotaCupo/nCu/pulaCurarCuriosoCursoCurvaCutisDamaDanzaDarDardoDa/tilDeberDe/bilDe/cadaDecirDedoDefensaDefinirDejarDelfi/nDelgadoDelitoDemoraDensoDentalDeporteDerechoDerrotaDesayunoDeseoDesfileDesnudoDestinoDesvi/oDetalleDetenerDeudaDi/aDiabloDiademaDiamanteDianaDiarioDibujoDictarDienteDietaDiezDifi/cilDignoDilemaDiluirDineroDirectoDirigirDiscoDise~oDisfrazDivaDivinoDobleDoceDolorDomingoDonDonarDoradoDormirDorsoDosDosisDrago/nDrogaDuchaDudaDueloDue~oDulceDu/oDuqueDurarDurezaDuroE/banoEbrioEcharEcoEcuadorEdadEdicio/nEdificioEditorEducarEfectoEficazEjeEjemploElefanteElegirElementoElevarElipseE/liteElixirElogioEludirEmbudoEmitirEmocio/nEmpateEmpe~oEmpleoEmpresaEnanoEncargoEnchufeEnci/aEnemigoEneroEnfadoEnfermoEnga~oEnigmaEnlaceEnormeEnredoEnsayoEnse~arEnteroEntrarEnvaseEnvi/oE/pocaEquipoErizoEscalaEscenaEscolarEscribirEscudoEsenciaEsferaEsfuerzoEspadaEspejoEspi/aEsposaEspumaEsqui/EstarEsteEstiloEstufaEtapaEternoE/ticaEtniaEvadirEvaluarEventoEvitarExactoExamenExcesoExcusaExentoExigirExilioExistirE/xitoExpertoExplicarExponerExtremoFa/bricaFa/bulaFachadaFa/cilFactorFaenaFajaFaldaFalloFalsoFaltarFamaFamiliaFamosoFarao/nFarmaciaFarolFarsaFaseFatigaFaunaFavorFaxFebreroFechaFelizFeoFeriaFerozFe/rtilFervorFesti/nFiableFianzaFiarFibraFiccio/nFichaFideoFiebreFielFieraFiestaFiguraFijarFijoFilaFileteFilialFiltroFinFincaFingirFinitoFirmaFlacoFlautaFlechaFlorFlotaFluirFlujoFlu/orFobiaFocaFogataFogo/nFolioFolletoFondoFormaForroFortunaForzarFosaFotoFracasoFra/gilFranjaFraseFraudeFrei/rFrenoFresaFri/oFritoFrutaFuegoFuenteFuerzaFugaFumarFuncio/nFundaFurgo/nFuriaFusilFu/tbolFuturoGacelaGafasGaitaGajoGalaGaleri/aGalloGambaGanarGanchoGangaGansoGarajeGarzaGasolinaGastarGatoGavila/nGemeloGemirGenGe/neroGenioGenteGeranioGerenteGermenGestoGiganteGimnasioGirarGiroGlaciarGloboGloriaGolGolfoGolosoGolpeGomaGordoGorilaGorraGotaGoteoGozarGradaGra/ficoGranoGrasaGratisGraveGrietaGrilloGripeGrisGritoGrosorGru/aGruesoGrumoGrupoGuanteGuapoGuardiaGuerraGui/aGui~oGuionGuisoGuitarraGusanoGustarHaberHa/bilHablarHacerHachaHadaHallarHamacaHarinaHazHaza~aHebillaHebraHechoHeladoHelioHembraHerirHermanoHe/roeHervirHieloHierroHi/gadoHigieneHijoHimnoHistoriaHocicoHogarHogueraHojaHombreHongoHonorHonraHoraHormigaHornoHostilHoyoHuecoHuelgaHuertaHuesoHuevoHuidaHuirHumanoHu/medoHumildeHumoHundirHuraca/nHurtoIconoIdealIdiomaI/doloIglesiaIglu/IgualIlegalIlusio/nImagenIma/nImitarImparImperioImponerImpulsoIncapazI/ndiceInerteInfielInformeIngenioInicioInmensoInmuneInnatoInsectoInstanteIntere/sI/ntimoIntuirInu/tilInviernoIraIrisIroni/aIslaIsloteJabali/Jabo/nJamo/nJarabeJardi/nJarraJaulaJazmi/nJefeJeringaJineteJornadaJorobaJovenJoyaJuergaJuevesJuezJugadorJugoJugueteJuicioJuncoJunglaJunioJuntarJu/piterJurarJustoJuvenilJuzgarKiloKoalaLabioLacioLacraLadoLadro/nLagartoLa/grimaLagunaLaicoLamerLa/minaLa/mparaLanaLanchaLangostaLanzaLa/pizLargoLarvaLa/stimaLataLa/texLatirLaurelLavarLazoLealLeccio/nLecheLectorLeerLegio/nLegumbreLejanoLenguaLentoLe~aLeo/nLeopardoLesio/nLetalLetraLeveLeyendaLibertadLibroLicorLi/derLidiarLienzoLigaLigeroLimaLi/miteLimo/nLimpioLinceLindoLi/neaLingoteLinoLinternaLi/quidoLisoListaLiteraLitioLitroLlagaLlamaLlantoLlaveLlegarLlenarLlevarLlorarLloverLluviaLoboLocio/nLocoLocuraLo/gicaLogroLombrizLomoLonjaLoteLuchaLucirLugarLujoLunaLunesLupaLustroLutoLuzMacetaMachoMaderaMadreMaduroMaestroMafiaMagiaMagoMai/zMaldadMaletaMallaMaloMama/MamboMamutMancoMandoManejarMangaManiqui/ManjarManoMansoMantaMa~anaMapaMa/quinaMarMarcoMareaMarfilMargenMaridoMa/rmolMarro/nMartesMarzoMasaMa/scaraMasivoMatarMateriaMatizMatrizMa/ximoMayorMazorcaMechaMedallaMedioMe/dulaMejillaMejorMelenaMelo/nMemoriaMenorMensajeMenteMenu/MercadoMerengueMe/ritoMesMeso/nMetaMeterMe/todoMetroMezclaMiedoMielMiembroMigaMilMilagroMilitarMillo/nMimoMinaMineroMi/nimoMinutoMiopeMirarMisaMiseriaMisilMismoMitadMitoMochilaMocio/nModaModeloMohoMojarMoldeMolerMolinoMomentoMomiaMonarcaMonedaMonjaMontoMo~oMoradaMorderMorenoMorirMorroMorsaMortalMoscaMostrarMotivoMoverMo/vilMozoMuchoMudarMuebleMuelaMuerteMuestraMugreMujerMulaMuletaMultaMundoMu~ecaMuralMuroMu/sculoMuseoMusgoMu/sicaMusloNa/carNacio/nNadarNaipeNaranjaNarizNarrarNasalNatalNativoNaturalNa/useaNavalNaveNavidadNecioNe/ctarNegarNegocioNegroNeo/nNervioNetoNeutroNevarNeveraNichoNidoNieblaNietoNi~ezNi~oNi/tidoNivelNoblezaNocheNo/minaNoriaNormaNorteNotaNoticiaNovatoNovelaNovioNubeNucaNu/cleoNudilloNudoNueraNueveNuezNuloNu/meroNutriaOasisObesoObispoObjetoObraObreroObservarObtenerObvioOcaOcasoOce/anoOchentaOchoOcioOcreOctavoOctubreOcultoOcuparOcurrirOdiarOdioOdiseaOesteOfensaOfertaOficioOfrecerOgroOi/doOi/rOjoOlaOleadaOlfatoOlivoOllaOlmoOlorOlvidoOmbligoOndaOnzaOpacoOpcio/nO/peraOpinarOponerOptarO/pticaOpuestoOracio/nOradorOralO/rbitaOrcaOrdenOrejaO/rganoOrgi/aOrgulloOrienteOrigenOrillaOroOrquestaOrugaOsadi/aOscuroOseznoOsoOstraOto~oOtroOvejaO/vuloO/xidoOxi/genoOyenteOzonoPactoPadrePaellaPa/ginaPagoPai/sPa/jaroPalabraPalcoPaletaPa/lidoPalmaPalomaPalparPanPanalPa/nicoPanteraPa~ueloPapa/PapelPapillaPaquetePararParcelaParedParirParoPa/rpadoParquePa/rrafoPartePasarPaseoPasio/nPasoPastaPataPatioPatriaPausaPautaPavoPayasoPeato/nPecadoPeceraPechoPedalPedirPegarPeinePelarPelda~oPeleaPeligroPellejoPeloPelucaPenaPensarPe~o/nPeo/nPeorPepinoPeque~oPeraPerchaPerderPerezaPerfilPericoPerlaPermisoPerroPersonaPesaPescaPe/simoPesta~aPe/taloPetro/leoPezPezu~aPicarPicho/nPiePiedraPiernaPiezaPijamaPilarPilotoPimientaPinoPintorPinzaPi~aPiojoPipaPirataPisarPiscinaPisoPistaPito/nPizcaPlacaPlanPlataPlayaPlazaPleitoPlenoPlomoPlumaPluralPobrePocoPoderPodioPoemaPoesi/aPoetaPolenPolici/aPolloPolvoPomadaPomeloPomoPompaPonerPorcio/nPortalPosadaPoseerPosiblePostePotenciaPotroPozoPradoPrecozPreguntaPremioPrensaPresoPrevioPrimoPri/ncipePrisio/nPrivarProaProbarProcesoProductoProezaProfesorProgramaProlePromesaProntoPropioPro/ximoPruebaPu/blicoPucheroPudorPuebloPuertaPuestoPulgaPulirPulmo/nPulpoPulsoPumaPuntoPu~alPu~oPupaPupilaPure/QuedarQuejaQuemarQuererQuesoQuietoQui/micaQuinceQuitarRa/banoRabiaRaboRacio/nRadicalRai/zRamaRampaRanchoRangoRapazRa/pidoRaptoRasgoRaspaRatoRayoRazaRazo/nReaccio/nRealidadReba~oReboteRecaerRecetaRechazoRecogerRecreoRectoRecursoRedRedondoReducirReflejoReformaRefra/nRefugioRegaloRegirReglaRegresoRehe/nReinoRei/rRejaRelatoRelevoRelieveRellenoRelojRemarRemedioRemoRencorRendirRentaRepartoRepetirReposoReptilResRescateResinaRespetoRestoResumenRetiroRetornoRetratoReunirReve/sRevistaReyRezarRicoRiegoRiendaRiesgoRifaRi/gidoRigorRinco/nRi~o/nRi/oRiquezaRisaRitmoRitoRizoRobleRoceRociarRodarRodeoRodillaRoerRojizoRojoRomeroRomperRonRoncoRondaRopaRoperoRosaRoscaRostroRotarRubi/RuborRudoRuedaRugirRuidoRuinaRuletaRuloRumboRumorRupturaRutaRutinaSa/badoSaberSabioSableSacarSagazSagradoSalaSaldoSaleroSalirSalmo/nSalo/nSalsaSaltoSaludSalvarSambaSancio/nSandi/aSanearSangreSanidadSanoSantoSapoSaqueSardinaSarte/nSastreSata/nSaunaSaxofo/nSeccio/nSecoSecretoSectaSedSeguirSeisSelloSelvaSemanaSemillaSendaSensorSe~alSe~orSepararSepiaSequi/aSerSerieSermo/nServirSesentaSesio/nSetaSetentaSeveroSexoSextoSidraSiestaSieteSigloSignoSi/labaSilbarSilencioSillaSi/mboloSimioSirenaSistemaSitioSituarSobreSocioSodioSolSolapaSoldadoSoledadSo/lidoSoltarSolucio/nSombraSondeoSonidoSonoroSonrisaSopaSoplarSoporteSordoSorpresaSorteoSoste/nSo/tanoSuaveSubirSucesoSudorSuegraSueloSue~oSuerteSufrirSujetoSulta/nSumarSuperarSuplirSuponerSupremoSurSurcoSure~oSurgirSustoSutilTabacoTabiqueTablaTabu/TacoTactoTajoTalarTalcoTalentoTallaTalo/nTama~oTamborTangoTanqueTapaTapeteTapiaTapo/nTaquillaTardeTareaTarifaTarjetaTarotTarroTartaTatuajeTauroTazaTazo/nTeatroTechoTeclaTe/cnicaTejadoTejerTejidoTelaTele/fonoTemaTemorTemploTenazTenderTenerTenisTensoTeori/aTerapiaTercoTe/rminoTernuraTerrorTesisTesoroTestigoTeteraTextoTezTibioTiburo/nTiempoTiendaTierraTiesoTigreTijeraTildeTimbreTi/midoTimoTintaTi/oTi/picoTipoTiraTiro/nTita/nTi/tereTi/tuloTizaToallaTobilloTocarTocinoTodoTogaToldoTomarTonoTontoToparTopeToqueTo/raxToreroTormentaTorneoToroTorpedoTorreTorsoTortugaTosToscoToserTo/xicoTrabajoTractorTraerTra/ficoTragoTrajeTramoTranceTratoTraumaTrazarTre/bolTreguaTreintaTrenTreparTresTribuTrigoTripaTristeTriunfoTrofeoTrompaTroncoTropaTroteTrozoTrucoTruenoTrufaTuberi/aTuboTuertoTumbaTumorTu/nelTu/nicaTurbinaTurismoTurnoTutorUbicarU/lceraUmbralUnidadUnirUniversoUnoUntarU~aUrbanoUrbeUrgenteUrnaUsarUsuarioU/tilUtopi/aUvaVacaVaci/oVacunaVagarVagoVainaVajillaValeVa/lidoValleValorVa/lvulaVampiroVaraVariarVaro/nVasoVecinoVectorVehi/culoVeinteVejezVelaVeleroVelozVenaVencerVendaVenenoVengarVenirVentaVenusVerVeranoVerboVerdeVeredaVerjaVersoVerterVi/aViajeVibrarVicioVi/ctimaVidaVi/deoVidrioViejoViernesVigorVilVillaVinagreVinoVi~edoVioli/nViralVirgoVirtudVisorVi/speraVistaVitaminaViudoVivazViveroVivirVivoVolca/nVolumenVolverVorazVotarVotoVozVueloVulgarYacerYateYeguaYemaYernoYesoYodoYogaYogurZafiroZanjaZapatoZarzaZonaZorroZumoZurdo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" ").map((function(e){return function(e){var t=[];return Array.prototype.forEach.call(Me(e),(function(e){47===e?(t.push(204),t.push(129)):126===e?(t.push(110),t.push(204),t.push(131)):t.push(e)})),Pe(t)}(e)}))).forEach((function(e,t){xn[Mn(e)]=t})),"0xf74fb7092aeacdfbf8959557de22098da512207fb9f109cb526994938cf40300"!==mn.check(e)))throw Tn=null,new Error("BIP39 Wordlist for es (Spanish) FAILED")}var On=new(function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.call(this,"es")}return Object(y.a)(r,[{key:"getWord",value:function(e){return Cn(this),Tn[e]}},{key:"getWordIndex",value:function(e){return Cn(this),xn[Mn(e)]}}]),r}(mn));mn.register(On);var In=null,Pn={};function Rn(e){return gn.checkNormalize(),Pe(Array.prototype.filter.call(Me(e.normalize("NFD").toLowerCase()),(function(e){return e>=65&&e<=90||e>=97&&e<=123})))}function Bn(e){if(null==In&&((In="AbaisserAbandonAbdiquerAbeilleAbolirAborderAboutirAboyerAbrasifAbreuverAbriterAbrogerAbruptAbsenceAbsoluAbsurdeAbusifAbyssalAcade/mieAcajouAcarienAccablerAccepterAcclamerAccoladeAccrocheAccuserAcerbeAchatAcheterAcidulerAcierAcompteAcque/rirAcronymeActeurActifActuelAdepteAde/quatAdhe/sifAdjectifAdjugerAdmettreAdmirerAdopterAdorerAdoucirAdresseAdroitAdulteAdverbeAe/rerAe/ronefAffaireAffecterAfficheAffreuxAffublerAgacerAgencerAgileAgiterAgraferAgre/ableAgrumeAiderAiguilleAilierAimableAisanceAjouterAjusterAlarmerAlchimieAlerteAlge-breAlgueAlie/nerAlimentAlle/gerAlliageAllouerAllumerAlourdirAlpagaAltesseAlve/oleAmateurAmbiguAmbreAme/nagerAmertumeAmidonAmiralAmorcerAmourAmovibleAmphibieAmpleurAmusantAnalyseAnaphoreAnarchieAnatomieAncienAne/antirAngleAngoisseAnguleuxAnimalAnnexerAnnonceAnnuelAnodinAnomalieAnonymeAnormalAntenneAntidoteAnxieuxApaiserApe/ritifAplanirApologieAppareilAppelerApporterAppuyerAquariumAqueducArbitreArbusteArdeurArdoiseArgentArlequinArmatureArmementArmoireArmureArpenterArracherArriverArroserArsenicArte/rielArticleAspectAsphalteAspirerAssautAsservirAssietteAssocierAssurerAsticotAstreAstuceAtelierAtomeAtriumAtroceAttaqueAttentifAttirerAttraperAubaineAubergeAudaceAudibleAugurerAuroreAutomneAutrucheAvalerAvancerAvariceAvenirAverseAveugleAviateurAvideAvionAviserAvoineAvouerAvrilAxialAxiomeBadgeBafouerBagageBaguetteBaignadeBalancerBalconBaleineBalisageBambinBancaireBandageBanlieueBannie-reBanquierBarbierBarilBaronBarqueBarrageBassinBastionBatailleBateauBatterieBaudrierBavarderBeletteBe/lierBeloteBe/ne/ficeBerceauBergerBerlineBermudaBesaceBesogneBe/tailBeurreBiberonBicycleBiduleBijouBilanBilingueBillardBinaireBiologieBiopsieBiotypeBiscuitBisonBistouriBitumeBizarreBlafardBlagueBlanchirBlessantBlinderBlondBloquerBlousonBobardBobineBoireBoiserBolideBonbonBondirBonheurBonifierBonusBordureBorneBotteBoucleBoueuxBougieBoulonBouquinBourseBoussoleBoutiqueBoxeurBrancheBrasierBraveBrebisBre-cheBreuvageBricolerBrigadeBrillantBriocheBriqueBrochureBroderBronzerBrousseBroyeurBrumeBrusqueBrutalBruyantBuffleBuissonBulletinBureauBurinBustierButinerButoirBuvableBuvetteCabanonCabineCachetteCadeauCadreCafe/ineCaillouCaissonCalculerCalepinCalibreCalmerCalomnieCalvaireCamaradeCame/raCamionCampagneCanalCanetonCanonCantineCanularCapableCaporalCapriceCapsuleCapterCapucheCarabineCarboneCaresserCaribouCarnageCarotteCarreauCartonCascadeCasierCasqueCassureCauserCautionCavalierCaverneCaviarCe/dilleCeintureCe/lesteCelluleCendrierCensurerCentralCercleCe/re/bralCeriseCernerCerveauCesserChagrinChaiseChaleurChambreChanceChapitreCharbonChasseurChatonChaussonChavirerChemiseChenilleChe/quierChercherChevalChienChiffreChignonChime-reChiotChlorureChocolatChoisirChoseChouetteChromeChuteCigareCigogneCimenterCine/maCintrerCirculerCirerCirqueCiterneCitoyenCitronCivilClaironClameurClaquerClasseClavierClientClignerClimatClivageClocheClonageCloporteCobaltCobraCocasseCocotierCoderCodifierCoffreCognerCohe/sionCoifferCoincerCole-reColibriCollineColmaterColonelCombatCome/dieCommandeCompactConcertConduireConfierCongelerConnoterConsonneContactConvexeCopainCopieCorailCorbeauCordageCornicheCorpusCorrectCorte-geCosmiqueCostumeCotonCoudeCoupureCourageCouteauCouvrirCoyoteCrabeCrainteCravateCrayonCre/atureCre/diterCre/meuxCreuserCrevetteCriblerCrierCristalCrite-reCroireCroquerCrotaleCrucialCruelCrypterCubiqueCueillirCuille-reCuisineCuivreCulminerCultiverCumulerCupideCuratifCurseurCyanureCycleCylindreCyniqueDaignerDamierDangerDanseurDauphinDe/battreDe/biterDe/borderDe/briderDe/butantDe/calerDe/cembreDe/chirerDe/ciderDe/clarerDe/corerDe/crireDe/cuplerDe/daleDe/ductifDe/esseDe/fensifDe/filerDe/frayerDe/gagerDe/givrerDe/glutirDe/graferDe/jeunerDe/liceDe/logerDemanderDemeurerDe/molirDe/nicherDe/nouerDentelleDe/nuderDe/partDe/penserDe/phaserDe/placerDe/poserDe/rangerDe/roberDe/sastreDescenteDe/sertDe/signerDe/sobe/irDessinerDestrierDe/tacherDe/testerDe/tourerDe/tresseDevancerDevenirDevinerDevoirDiableDialogueDiamantDicterDiffe/rerDige/rerDigitalDigneDiluerDimancheDiminuerDioxydeDirectifDirigerDiscuterDisposerDissiperDistanceDivertirDiviserDocileDocteurDogmeDoigtDomaineDomicileDompterDonateurDonjonDonnerDopamineDortoirDorureDosageDoseurDossierDotationDouanierDoubleDouceurDouterDoyenDragonDraperDresserDribblerDroitureDuperieDuplexeDurableDurcirDynastieE/blouirE/carterE/charpeE/chelleE/clairerE/clipseE/cloreE/cluseE/coleE/conomieE/corceE/couterE/craserE/cre/merE/crivainE/crouE/cumeE/cureuilE/difierE/duquerEffacerEffectifEffigieEffortEffrayerEffusionE/galiserE/garerE/jecterE/laborerE/largirE/lectronE/le/gantE/le/phantE/le-veE/ligibleE/litismeE/logeE/luciderE/luderEmballerEmbellirEmbryonE/meraudeE/missionEmmenerE/motionE/mouvoirEmpereurEmployerEmporterEmpriseE/mulsionEncadrerEnche-reEnclaveEncocheEndiguerEndosserEndroitEnduireE/nergieEnfanceEnfermerEnfouirEngagerEnginEngloberE/nigmeEnjamberEnjeuEnleverEnnemiEnnuyeuxEnrichirEnrobageEnseigneEntasserEntendreEntierEntourerEntraverE/nume/rerEnvahirEnviableEnvoyerEnzymeE/olienE/paissirE/pargneE/patantE/pauleE/picerieE/pide/mieE/pierE/pilogueE/pineE/pisodeE/pitapheE/poqueE/preuveE/prouverE/puisantE/querreE/quipeE/rigerE/rosionErreurE/ruptionEscalierEspadonEspe-ceEspie-gleEspoirEspritEsquiverEssayerEssenceEssieuEssorerEstimeEstomacEstradeE/tage-reE/talerE/tancheE/tatiqueE/teindreE/tendoirE/ternelE/thanolE/thiqueEthnieE/tirerE/tofferE/toileE/tonnantE/tourdirE/trangeE/troitE/tudeEuphorieE/valuerE/vasionE/ventailE/videnceE/viterE/volutifE/voquerExactExage/rerExaucerExcellerExcitantExclusifExcuseExe/cuterExempleExercerExhalerExhorterExigenceExilerExisterExotiqueExpe/dierExplorerExposerExprimerExquisExtensifExtraireExulterFableFabuleuxFacetteFacileFactureFaiblirFalaiseFameuxFamilleFarceurFarfeluFarineFaroucheFascinerFatalFatigueFauconFautifFaveurFavoriFe/brileFe/conderFe/de/rerFe/linFemmeFe/murFendoirFe/odalFermerFe/roceFerveurFestivalFeuilleFeutreFe/vrierFiascoFicelerFictifFide-leFigureFilatureFiletageFilie-reFilleulFilmerFilouFiltrerFinancerFinirFioleFirmeFissureFixerFlairerFlammeFlasqueFlatteurFle/auFle-cheFleurFlexionFloconFloreFluctuerFluideFluvialFolieFonderieFongibleFontaineForcerForgeronFormulerFortuneFossileFoudreFouge-reFouillerFoulureFourmiFragileFraiseFranchirFrapperFrayeurFre/gateFreinerFrelonFre/mirFre/ne/sieFre-reFriableFrictionFrissonFrivoleFroidFromageFrontalFrotterFruitFugitifFuiteFureurFurieuxFurtifFusionFuturGagnerGalaxieGalerieGambaderGarantirGardienGarnirGarrigueGazelleGazonGe/antGe/latineGe/luleGendarmeGe/ne/ralGe/nieGenouGentilGe/ologieGe/ome-treGe/raniumGermeGestuelGeyserGibierGiclerGirafeGivreGlaceGlaiveGlisserGlobeGloireGlorieuxGolfeurGommeGonflerGorgeGorilleGoudronGouffreGoulotGoupilleGourmandGoutteGraduelGraffitiGraineGrandGrappinGratuitGravirGrenatGriffureGrillerGrimperGrognerGronderGrotteGroupeGrugerGrutierGruye-reGue/pardGuerrierGuideGuimauveGuitareGustatifGymnasteGyrostatHabitudeHachoirHalteHameauHangarHannetonHaricotHarmonieHarponHasardHe/liumHe/matomeHerbeHe/rissonHermineHe/ronHe/siterHeureuxHibernerHibouHilarantHistoireHiverHomardHommageHomoge-neHonneurHonorerHonteuxHordeHorizonHorlogeHormoneHorribleHouleuxHousseHublotHuileuxHumainHumbleHumideHumourHurlerHydromelHygie-neHymneHypnoseIdylleIgnorerIguaneIlliciteIllusionImageImbiberImiterImmenseImmobileImmuableImpactImpe/rialImplorerImposerImprimerImputerIncarnerIncendieIncidentInclinerIncoloreIndexerIndiceInductifIne/ditIneptieInexactInfiniInfligerInformerInfusionInge/rerInhalerInhiberInjecterInjureInnocentInoculerInonderInscrireInsecteInsigneInsoliteInspirerInstinctInsulterIntactIntenseIntimeIntrigueIntuitifInutileInvasionInventerInviterInvoquerIroniqueIrradierIrre/elIrriterIsolerIvoireIvresseJaguarJaillirJambeJanvierJardinJaugerJauneJavelotJetableJetonJeudiJeunesseJoindreJoncherJonglerJoueurJouissifJournalJovialJoyauJoyeuxJubilerJugementJuniorJuponJuristeJusticeJuteuxJuve/nileKayakKimonoKiosqueLabelLabialLabourerLace/rerLactoseLaguneLaineLaisserLaitierLambeauLamelleLampeLanceurLangageLanterneLapinLargeurLarmeLaurierLavaboLavoirLectureLe/galLe/gerLe/gumeLessiveLettreLevierLexiqueLe/zardLiasseLibe/rerLibreLicenceLicorneLie-geLie-vreLigatureLigoterLigueLimerLimiteLimonadeLimpideLine/aireLingotLionceauLiquideLisie-reListerLithiumLitigeLittoralLivreurLogiqueLointainLoisirLombricLoterieLouerLourdLoutreLouveLoyalLubieLucideLucratifLueurLugubreLuisantLumie-reLunaireLundiLuronLutterLuxueuxMachineMagasinMagentaMagiqueMaigreMaillonMaintienMairieMaisonMajorerMalaxerMale/ficeMalheurMaliceMalletteMammouthMandaterManiableManquantManteauManuelMarathonMarbreMarchandMardiMaritimeMarqueurMarronMartelerMascotteMassifMate/rielMatie-reMatraqueMaudireMaussadeMauveMaximalMe/chantMe/connuMe/dailleMe/decinMe/diterMe/duseMeilleurMe/langeMe/lodieMembreMe/moireMenacerMenerMenhirMensongeMentorMercrediMe/riteMerleMessagerMesureMe/talMe/te/oreMe/thodeMe/tierMeubleMiaulerMicrobeMietteMignonMigrerMilieuMillionMimiqueMinceMine/ralMinimalMinorerMinuteMiracleMiroiterMissileMixteMobileModerneMoelleuxMondialMoniteurMonnaieMonotoneMonstreMontagneMonumentMoqueurMorceauMorsureMortierMoteurMotifMoucheMoufleMoulinMoussonMoutonMouvantMultipleMunitionMurailleMure-neMurmureMuscleMuse/umMusicienMutationMuterMutuelMyriadeMyrtilleMyste-reMythiqueNageurNappeNarquoisNarrerNatationNationNatureNaufrageNautiqueNavireNe/buleuxNectarNe/fasteNe/gationNe/gligerNe/gocierNeigeNerveuxNettoyerNeuroneNeutronNeveuNicheNickelNitrateNiveauNobleNocifNocturneNoirceurNoisetteNomadeNombreuxNommerNormatifNotableNotifierNotoireNourrirNouveauNovateurNovembreNoviceNuageNuancerNuireNuisibleNume/roNuptialNuqueNutritifObe/irObjectifObligerObscurObserverObstacleObtenirObturerOccasionOccuperOce/anOctobreOctroyerOctuplerOculaireOdeurOdorantOffenserOfficierOffrirOgiveOiseauOisillonOlfactifOlivierOmbrageOmettreOnctueuxOndulerOne/reuxOniriqueOpaleOpaqueOpe/rerOpinionOpportunOpprimerOpterOptiqueOrageuxOrangeOrbiteOrdonnerOreilleOrganeOrgueilOrificeOrnementOrqueOrtieOscillerOsmoseOssatureOtarieOuraganOursonOutilOutragerOuvrageOvationOxydeOxyge-neOzonePaisiblePalacePalmare-sPalourdePalperPanachePandaPangolinPaniquerPanneauPanoramaPantalonPapayePapierPapoterPapyrusParadoxeParcelleParesseParfumerParlerParoleParrainParsemerPartagerParureParvenirPassionPaste-quePaternelPatiencePatronPavillonPavoiserPayerPaysagePeignePeintrePelagePe/licanPellePelousePeluchePendulePe/ne/trerPe/niblePensifPe/nuriePe/pitePe/plumPerdrixPerforerPe/riodePermuterPerplexePersilPertePeserPe/talePetitPe/trirPeuplePharaonPhobiePhoquePhotonPhrasePhysiquePianoPicturalPie-cePierrePieuvrePilotePinceauPipettePiquerPiroguePiscinePistonPivoterPixelPizzaPlacardPlafondPlaisirPlanerPlaquePlastronPlateauPleurerPlexusPliagePlombPlongerPluiePlumagePochettePoe/siePoe-tePointePoirierPoissonPoivrePolairePolicierPollenPolygonePommadePompierPonctuelPonde/rerPoneyPortiquePositionPosse/derPosturePotagerPoteauPotionPoucePoulainPoumonPourprePoussinPouvoirPrairiePratiquePre/cieuxPre/direPre/fixePre/ludePre/nomPre/sencePre/textePre/voirPrimitifPrincePrisonPriverProble-meProce/derProdigeProfondProgre-sProieProjeterProloguePromenerPropreProspe-reProte/gerProuesseProverbePrudencePruneauPsychosePublicPuceronPuiserPulpePulsarPunaisePunitifPupitrePurifierPuzzlePyramideQuasarQuerelleQuestionQuie/tudeQuitterQuotientRacineRaconterRadieuxRagondinRaideurRaisinRalentirRallongeRamasserRapideRasageRatisserRavagerRavinRayonnerRe/actifRe/agirRe/aliserRe/animerRecevoirRe/citerRe/clamerRe/colterRecruterReculerRecyclerRe/digerRedouterRefaireRe/flexeRe/formerRefrainRefugeRe/galienRe/gionRe/glageRe/gulierRe/ite/rerRejeterRejouerRelatifReleverReliefRemarqueReme-deRemiseRemonterRemplirRemuerRenardRenfortReniflerRenoncerRentrerRenvoiReplierReporterRepriseReptileRequinRe/serveRe/sineuxRe/soudreRespectResterRe/sultatRe/tablirRetenirRe/ticuleRetomberRetracerRe/unionRe/ussirRevancheRevivreRe/volteRe/vulsifRichesseRideauRieurRigideRigolerRincerRiposterRisibleRisqueRituelRivalRivie-reRocheuxRomanceRompreRonceRondinRoseauRosierRotatifRotorRotuleRougeRouilleRouleauRoutineRoyaumeRubanRubisRucheRuelleRugueuxRuinerRuisseauRuserRustiqueRythmeSablerSaboterSabreSacocheSafariSagesseSaisirSaladeSaliveSalonSaluerSamediSanctionSanglierSarcasmeSardineSaturerSaugrenuSaumonSauterSauvageSavantSavonnerScalpelScandaleSce/le/ratSce/narioSceptreSche/maScienceScinderScoreScrutinSculpterSe/anceSe/cableSe/cherSecouerSe/cre/terSe/datifSe/duireSeigneurSe/jourSe/lectifSemaineSemblerSemenceSe/minalSe/nateurSensibleSentenceSe/parerSe/quenceSereinSergentSe/rieuxSerrureSe/rumServiceSe/sameSe/virSevrageSextupleSide/ralSie-cleSie/gerSifflerSigleSignalSilenceSiliciumSimpleSince-reSinistreSiphonSiropSismiqueSituerSkierSocialSocleSodiumSoigneuxSoldatSoleilSolitudeSolubleSombreSommeilSomnolerSondeSongeurSonnetteSonoreSorcierSortirSosieSottiseSoucieuxSoudureSouffleSouleverSoupapeSourceSoutirerSouvenirSpacieuxSpatialSpe/cialSphe-reSpiralStableStationSternumStimulusStipulerStrictStudieuxStupeurStylisteSublimeSubstratSubtilSubvenirSucce-sSucreSuffixeSugge/rerSuiveurSulfateSuperbeSupplierSurfaceSuricateSurmenerSurpriseSursautSurvieSuspectSyllabeSymboleSyme/trieSynapseSyntaxeSyste-meTabacTablierTactileTaillerTalentTalismanTalonnerTambourTamiserTangibleTapisTaquinerTarderTarifTartineTasseTatamiTatouageTaupeTaureauTaxerTe/moinTemporelTenailleTendreTeneurTenirTensionTerminerTerneTerribleTe/tineTexteThe-meThe/orieThe/rapieThoraxTibiaTie-deTimideTirelireTiroirTissuTitaneTitreTituberTobogganTole/rantTomateToniqueTonneauToponymeTorcheTordreTornadeTorpilleTorrentTorseTortueTotemToucherTournageTousserToxineTractionTraficTragiqueTrahirTrainTrancherTravailTre-fleTremperTre/sorTreuilTriageTribunalTricoterTrilogieTriompheTriplerTriturerTrivialTromboneTroncTropicalTroupeauTuileTulipeTumulteTunnelTurbineTuteurTutoyerTuyauTympanTyphonTypiqueTyranUbuesqueUltimeUltrasonUnanimeUnifierUnionUniqueUnitaireUniversUraniumUrbainUrticantUsageUsineUsuelUsureUtileUtopieVacarmeVaccinVagabondVagueVaillantVaincreVaisseauValableValiseVallonValveVampireVanilleVapeurVarierVaseuxVassalVasteVecteurVedetteVe/ge/talVe/hiculeVeinardVe/loceVendrediVe/ne/rerVengerVenimeuxVentouseVerdureVe/rinVernirVerrouVerserVertuVestonVe/te/ranVe/tusteVexantVexerViaducViandeVictoireVidangeVide/oVignetteVigueurVilainVillageVinaigreViolonVipe-reVirementVirtuoseVirusVisageViseurVisionVisqueuxVisuelVitalVitesseViticoleVitrineVivaceVivipareVocationVoguerVoileVoisinVoitureVolailleVolcanVoltigerVolumeVoraceVortexVoterVouloirVoyageVoyelleWagonXe/nonYachtZe-breZe/nithZesteZoologie".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" ").map((function(e){return function(e){var t=[];return Array.prototype.forEach.call(Me(e),(function(e){47===e?(t.push(204),t.push(129)):45===e?(t.push(204),t.push(128)):t.push(e)})),Pe(t)}(e)}))).forEach((function(e,t){Pn[Rn(e)]=t})),"0x51deb7ae009149dc61a6bd18a918eb7ac78d2775726c68e598b92d002519b045"!==mn.check(e)))throw In=null,new Error("BIP39 Wordlist for fr (French) FAILED")}var Dn=new(function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.call(this,"fr")}return Object(y.a)(r,[{key:"getWord",value:function(e){return Bn(this),In[e]}},{key:"getWordIndex",value:function(e){return Bn(this),Pn[Rn(e)]}}]),r}(mn));mn.register(Dn);var Nn=["AQRASRAGBAGUAIRAHBAghAURAdBAdcAnoAMEAFBAFCBKFBQRBSFBCXBCDBCHBGFBEQBpBBpQBIkBHNBeOBgFBVCBhBBhNBmOBmRBiHBiFBUFBZDBvFBsXBkFBlcBjYBwDBMBBTBBTRBWBBWXXaQXaRXQWXSRXCFXYBXpHXOQXHRXhRXuRXmXXbRXlXXwDXTRXrCXWQXWGaBWaKcaYgasFadQalmaMBacAKaRKKBKKXKKjKQRKDRKCYKCRKIDKeVKHcKlXKjHKrYNAHNBWNaRNKcNIBNIONmXNsXNdXNnBNMBNRBNrXNWDNWMNFOQABQAHQBrQXBQXFQaRQKXQKDQKOQKFQNBQNDQQgQCXQCDQGBQGDQGdQYXQpBQpQQpHQLXQHuQgBQhBQhCQuFQmXQiDQUFQZDQsFQdRQkHQbRQlOQlmQPDQjDQwXQMBQMDQcFQTBQTHQrDDXQDNFDGBDGQDGRDpFDhFDmXDZXDbRDMYDRdDTRDrXSAhSBCSBrSGQSEQSHBSVRShYShkSyQSuFSiBSdcSoESocSlmSMBSFBSFKSFNSFdSFcCByCaRCKcCSBCSRCCrCGbCEHCYXCpBCpQCIBCIHCeNCgBCgFCVECVcCmkCmwCZXCZFCdRClOClmClFCjDCjdCnXCwBCwXCcRCFQCFjGXhGNhGDEGDMGCDGCHGIFGgBGVXGVEGVRGmXGsXGdYGoSGbRGnXGwXGwDGWRGFNGFLGFOGFdGFkEABEBDEBFEXOEaBEKSENBENDEYXEIgEIkEgBEgQEgHEhFEudEuFEiBEiHEiFEZDEvBEsXEsFEdXEdREkFEbBEbRElFEPCEfkEFNYAEYAhYBNYQdYDXYSRYCEYYoYgQYgRYuRYmCYZTYdBYbEYlXYjQYRbYWRpKXpQopQnpSFpCXpIBpISphNpdBpdRpbRpcZpFBpFNpFDpFopFrLADLBuLXQLXcLaFLCXLEhLpBLpFLHXLeVLhILdHLdRLoDLbRLrXIABIBQIBCIBsIBoIBMIBRIXaIaRIKYIKRINBINuICDIGBIIDIIkIgRIxFIyQIiHIdRIbYIbRIlHIwRIMYIcRIRVITRIFBIFNIFQOABOAFOBQOaFONBONMOQFOSFOCDOGBOEQOpBOLXOIBOIFOgQOgFOyQOycOmXOsXOdIOkHOMEOMkOWWHBNHXNHXWHNXHDuHDRHSuHSRHHoHhkHmRHdRHkQHlcHlRHwBHWcgAEgAggAkgBNgBQgBEgXOgYcgLXgHjgyQgiBgsFgdagMYgWSgFQgFEVBTVXEVKBVKNVKDVKYVKRVNBVNYVDBVDxVSBVSRVCjVGNVLXVIFVhBVhcVsXVdRVbRVlRhBYhKYhDYhGShxWhmNhdahdkhbRhjohMXhTRxAXxXSxKBxNBxEQxeNxeQxhXxsFxdbxlHxjcxFBxFNxFQxFOxFoyNYyYoybcyMYuBQuBRuBruDMuCouHBudQukkuoBulVuMXuFEmCYmCRmpRmeDmiMmjdmTFmFQiADiBOiaRiKRiNBiNRiSFiGkiGFiERipRiLFiIFihYibHijBijEiMXiWBiFBiFCUBQUXFUaRUNDUNcUNRUNFUDBUSHUCDUGBUGFUEqULNULoUIRUeEUeYUgBUhFUuRUiFUsXUdFUkHUbBUjSUjYUwXUMDUcHURdUTBUrBUrXUrQZAFZXZZaRZKFZNBZQFZCXZGBZYdZpBZLDZIFZHXZHNZeQZVRZVFZmXZiBZvFZdFZkFZbHZbFZwXZcCZcRZRBvBQvBGvBLvBWvCovMYsAFsBDsaRsKFsNFsDrsSHsSFsCXsCRsEBsEHsEfspBsLBsLDsIgsIRseGsbRsFBsFQsFSdNBdSRdCVdGHdYDdHcdVbdySduDdsXdlRdwXdWYdWcdWRkBMkXOkaRkNIkNFkSFkCFkYBkpRkeNkgBkhVkmXksFklVkMBkWDkFNoBNoaQoaFoNBoNXoNaoNEoSRoEroYXoYCoYbopRopFomXojkowXorFbBEbEIbdBbjYlaRlDElMXlFDjKjjSRjGBjYBjYkjpRjLXjIBjOFjeVjbRjwBnXQnSHnpFnLXnINnMBnTRwXBwXNwXYwNFwQFwSBwGFwLXwLDweNwgBwuHwjDwnXMBXMpFMIBMeNMTHcaQcNBcDHcSFcCXcpBcLXcLDcgFcuFcnXcwXccDcTQcrFTQErXNrCHrpFrgFrbFrTHrFcWNYWNbWEHWMXWTR","ABGHABIJAEAVAYJQALZJAIaRAHNXAHdcAHbRAZJMAZJRAZTRAdVJAklmAbcNAjdRAMnRAMWYAWpRAWgRAFgBAFhBAFdcBNJBBNJDBQKBBQhcBQlmBDEJBYJkBYJTBpNBBpJFBIJBBIJDBIcABOKXBOEJBOVJBOiJBOZJBepBBeLXBeIFBegBBgGJBVJXBuocBiJRBUJQBlXVBlITBwNFBMYVBcqXBTlmBWNFBWiJBWnRBFGHBFwXXKGJXNJBXNZJXDTTXSHSXSVRXSlHXCJDXGQJXEhXXYQJXYbRXOfXXeNcXVJFXhQJXhEJXdTRXjdXXMhBXcQTXRGBXTEBXTnQXFCXXFOFXFgFaBaFaBNJaBCJaBpBaBwXaNJKaNJDaQIBaDpRaEPDaHMFamDJalEJaMZJaFaFaFNBaFQJaFLDaFVHKBCYKBEBKBHDKXaFKXGdKXEJKXpHKXIBKXZDKXwXKKwLKNacKNYJKNJoKNWcKDGdKDTRKChXKGaRKGhBKGbRKEBTKEaRKEPTKLMDKLWRKOHDKVJcKdBcKlIBKlOPKFSBKFEPKFpFNBNJNJBQNBGHNBEPNBHXNBgFNBVXNBZDNBsXNBwXNNaRNNJDNNJENNJkNDCJNDVDNGJRNJiDNZJNNsCJNJFNNFSBNFCXNFEPNFLXNFIFQJBFQCaRQJEQQLJDQLJFQIaRQOqXQHaFQHHQQVJXQVJDQhNJQmEIQZJFQsJXQJrFQWbRDJABDBYJDXNFDXCXDXLXDXZDDXsJDQqXDSJFDJCXDEPkDEqXDYmQDpSJDOCkDOGQDHEIDVJDDuDuDWEBDJFgSBNDSBSFSBGHSBIBSBTQSKVYSJQNSJQiSJCXSEqXSJYVSIiJSOMYSHAHSHaQSeCFSepQSegBSHdHSHrFShSJSJuHSJUFSkNRSrSrSWEBSFaHSJFQSFCXSFGDSFYXSFODSFgBSFVXSFhBSFxFSFkFSFbBSFMFCADdCJXBCXaFCXKFCXNFCXCXCXGBCXEJCXYBCXLDCXIBCXOPCXHXCXgBCXhBCXiBCXlDCXcHCJNBCJNFCDCJCDGBCDVXCDhBCDiDCDJdCCmNCpJFCIaRCOqXCHCHCHZJCViJCuCuCmddCJiFCdNBCdHhClEJCnUJCreSCWlgCWTRCFBFCFNBCFYBCFVFCFhFCFdSCFTBCFWDGBNBGBQFGJBCGBEqGBpBGBgQGNBEGNJYGNkOGNJRGDUFGJpQGHaBGJeNGJeEGVBlGVKjGiJDGvJHGsVJGkEBGMIJGWjNGFBFGFCXGFGBGFYXGFpBGFMFEASJEAWpEJNFECJVEIXSEIQJEOqXEOcFEeNcEHEJEHlFEJgFEhlmEmDJEmZJEiMBEUqXEoSREPBFEPXFEPKFEPSFEPEFEPpFEPLXEPIBEJPdEPcFEPTBEJnXEqlHEMpREFCXEFODEFcFYASJYJAFYBaBYBVXYXpFYDhBYCJBYJGFYYbRYeNcYJeVYiIJYZJcYvJgYvJRYJsXYsJFYMYMYreVpBNHpBEJpBwXpQxFpYEJpeNDpJeDpeSFpeCHpHUJpHbBpHcHpmUJpiiJpUJrpsJuplITpFaBpFQqpFGBpFEfpFYBpFpBpFLJpFIDpFgBpFVXpFyQpFuFpFlFpFjDpFnXpFwXpJFMpFTBLXCJLXEFLXhFLXUJLXbFLalmLNJBLSJQLCLCLGJBLLDJLHaFLeNFLeSHLeCXLepFLhaRLZsJLsJDLsJrLocaLlLlLMdbLFNBLFSBLFEHLFkFIBBFIBXFIBaQIBKXIBSFIBpHIBLXIBgBIBhBIBuHIBmXIBiFIBZXIBvFIBbFIBjQIBwXIBWFIKTRIQUJIDGFICjQIYSRIINXIJeCIVaRImEkIZJFIvJRIsJXIdCJIJoRIbBQIjYBIcqXITFVIreVIFKFIFSFIFCJIFGFIFLDIFIBIJFOIFgBIFVXIJFhIFxFIFmXIFdHIFbBIJFrIJFWOBGBOQfXOOKjOUqXOfXBOqXEOcqXORVJOFIBOFlDHBIOHXiFHNTRHCJXHIaRHHJDHHEJHVbRHZJYHbIBHRsJHRkDHWlmgBKFgBSBgBCDgBGHgBpBgBIBgBVJgBuBgBvFgKDTgQVXgDUJgGSJgOqXgmUMgZIJgTUJgWIEgFBFgFNBgFDJgFSFgFGBgFYXgJFOgFgQgFVXgFhBgFbHgJFWVJABVQKcVDgFVOfXVeDFVhaRVmGdViJYVMaRVFNHhBNDhBCXhBEqhBpFhBLXhNJBhSJRheVXhhKEhxlmhZIJhdBQhkIJhbMNhMUJhMZJxNJgxQUJxDEkxDdFxSJRxplmxeSBxeCXxeGFxeYXxepQxegBxWVcxFEQxFLXxFIBxFgBxFxDxFZtxFdcxFbBxFwXyDJXyDlcuASJuDJpuDIBuCpJuGSJuIJFueEFuZIJusJXudWEuoIBuWGJuFBcuFKEuFNFuFQFuFDJuFGJuFVJuFUtuFdHuFTBmBYJmNJYmQhkmLJDmLJomIdXmiJYmvJRmsJRmklmmMBymMuCmclmmcnQiJABiJBNiJBDiBSFiBCJiBEFiBYBiBpFiBLXiBTHiJNciDEfiCZJiECJiJEqiOkHiHKFieNDiHJQieQcieDHieSFieCXieGFieEFieIHiegFihUJixNoioNXiFaBiFKFiFNDiFEPiFYXitFOitFHiFgBiFVEiFmXiFitiFbBiFMFiFrFUCXQUIoQUIJcUHQJUeCEUHwXUUJDUUqXUdWcUcqXUrnQUFNDUFSHUFCFUFEfUFLXUtFOZBXOZXSBZXpFZXVXZEQJZEJkZpDJZOqXZeNHZeCDZUqXZFBQZFEHZFLXvBAFvBKFvBCXvBEPvBpHvBIDvBgFvBuHvQNJvFNFvFGBvFIBvJFcsXCDsXLXsXsXsXlFsXcHsQqXsJQFsEqXseIFsFEHsFjDdBxOdNpRdNJRdEJbdpJRdhZJdnSJdrjNdFNJdFQHdFhNkNJDkYaRkHNRkHSRkVbRkuMRkjSJkcqDoSJFoEiJoYZJoOfXohEBoMGQocqXbBAFbBXFbBaFbBNDbBGBbBLXbBTBbBWDbGJYbIJHbFQqbFpQlDgQlOrFlVJRjGEBjZJRnXvJnXbBnEfHnOPDngJRnxfXnUJWwXEJwNpJwDpBwEfXwrEBMDCJMDGHMDIJMLJDcQGDcQpHcqXccqNFcqCXcFCJRBSBRBGBRBEJRBpQTBNFTBQJTBpBTBVXTFABTFSBTFCFTFGBTFMDrXCJrXLDrDNJrEfHrFQJrFitWNjdWNTR","AKLJMANOPFASNJIAEJWXAYJNRAIIbRAIcdaAeEfDAgidRAdjNYAMYEJAMIbRAFNJBAFpJFBBIJYBDZJFBSiJhBGdEBBEJfXBEJqXBEJWRBpaUJBLXrXBIYJMBOcfXBeEfFBestXBjNJRBcDJOBFEqXXNvJRXDMBhXCJNYXOAWpXONJWXHDEBXeIaRXhYJDXZJSJXMDJOXcASJXFVJXaBQqXaBZJFasXdQaFSJQaFEfXaFpJHaFOqXKBNSRKXvJBKQJhXKEJQJKEJGFKINJBKIJjNKgJNSKVElmKVhEBKiJGFKlBgJKjnUJKwsJYKMFIJKFNJDKFIJFKFOfXNJBSFNJBCXNBpJFNJBvQNJBMBNJLJXNJOqXNJeCXNJeGFNdsJCNbTKFNwXUJQNFEPQDiJcQDMSJQSFpBQGMQJQJeOcQyCJEQUJEBQJFBrQFEJqDXDJFDJXpBDJXIMDGiJhDIJGRDJeYcDHrDJDVXgFDkAWpDkIgRDjDEqDMvJRDJFNFDJFIBSKclmSJQOFSJQVHSJQjDSJGJBSJGJFSECJoSHEJqSJHTBSJVJDSViJYSZJNBSJsJDSFSJFSFEfXSJFLXCBUJVCJXSBCJXpBCXVJXCJXsXCJXdFCJNJHCLIJgCHiJFCVNJMChCJhCUHEJCsJTRCJdYcCoQJCCFEfXCFIJgCFUJxCFstFGJBaQGJBIDGQJqXGYJNRGJHKFGeQqDGHEJFGJeLXGHIiJGHdBlGUJEBGkIJTGFQPDGJFEqEAGegEJIJBEJVJXEhQJTEiJNcEJZJFEJoEqEjDEqEPDsXEPGJBEPOqXEPeQFEfDiDEJfEFEfepQEfMiJEqXNBEqDIDEqeSFEqVJXEMvJRYXNJDYXEJHYKVJcYYJEBYJeEcYJUqXYFpJFYFstXpAZJMpBSJFpNBNFpeQPDpHLJDpHIJFpHgJFpeitFpHZJFpJFADpFSJFpJFCJpFOqXpFitBpJFZJLXIJFLIJgRLVNJWLVHJMLwNpJLFGJBLFLJDLFOqXLJFUJIBDJXIBGJBIJBYQIJBIBIBOqXIBcqDIEGJFILNJTIIJEBIOiJhIJeNBIJeIBIhiJIIWoTRIJFAHIJFpBIJFuHIFUtFIJFTHOSBYJOEcqXOHEJqOvBpFOkVJrObBVJOncqDOcNJkHhNJRHuHJuHdMhBgBUqXgBsJXgONJBgHNJDgHHJQgJeitgHsJXgJyNagyDJBgZJDrgsVJQgkEJNgkjSJgJFAHgFCJDgFZtMVJXNFVXQfXVJXDJVXoQJVQVJQVDEfXVDvJHVEqNFVeQfXVHpJFVHxfXVVJSRVVmaRVlIJOhCXVJhHjYkhxCJVhWVUJhWiJcxBNJIxeEqDxfXBFxcFEPxFSJFxFYJXyBDQJydaUJyFOPDuYCJYuLvJRuHLJXuZJLDuFOPDuFZJHuFcqXmKHJdmCQJcmOsVJiJAGFitLCFieOfXiestXiZJMEikNJQirXzFiFQqXiFIJFiFZJFiFvtFUHpJFUteIcUteOcUVCJkUhdHcUbEJEUJqXQUMNJhURjYkUFitFZDGJHZJIxDZJVJXZJFDJZJFpQvBNJBvBSJFvJxBrseQqDsVFVJdFLJDkEJNBkmNJYkFLJDoQJOPoGsJRoEAHBoEJfFbBQqDbBZJHbFVJXlFIJBjYIrXjeitcjjCEBjWMNBwXQfXwXOaFwDsJXwCJTRwrCZJMDNJQcDDJFcqDOPRYiJFTBsJXTQIJBTFEfXTFLJDrXEJFrEJXMrFZJFWEJdEWYTlm","ABCDEFACNJTRAMBDJdAcNJVXBLNJEBXSIdWRXErNJkXYDJMBXZJCJaXMNJaYKKVJKcKDEJqXKDcNJhKVJrNYKbgJVXKFVJSBNBYBwDNJeQfXNJeEqXNhGJWENJFiJRQlIJbEQJfXxDQqXcfXQFNDEJQFwXUJDYcnUJDJIBgQDIUJTRDJFEqDSJQSJFSJQIJFSOPeZtSJFZJHCJXQfXCTDEqFGJBSJFGJBOfXGJBcqXGJHNJDGJRLiJEJfXEqEJFEJPEFpBEJYJBZJFYBwXUJYiJMEBYJZJyTYTONJXpQMFXFpeGIDdpJFstXpJFcPDLBVSJRLHQJqXLJFZJFIJBNJDIJBUqXIBkFDJIJEJPTIYJGWRIJeQPDIJeEfHIJFsJXOqGDSFHXEJqXgJCsJCgGQJqXgdQYJEgFMFNBgJFcqDVJwXUJVJFZJchIgJCCxOEJqXxOwXUJyDJBVRuscisciJBiJBieUtqXiJFDJkiFsJXQUGEZJcUJFsJXZtXIrXZDZJDrZJFNJDZJFstXvJFQqXvJFCJEsJXQJqkhkNGBbDJdTRbYJMEBlDwXUJMEFiJFcfXNJDRcNJWMTBLJXC","BraFUtHBFSJFdbNBLJXVJQoYJNEBSJBEJfHSJHwXUJCJdAZJMGjaFVJXEJPNJBlEJfFiJFpFbFEJqIJBVJCrIBdHiJhOPFChvJVJZJNJWxGFNIFLueIBQJqUHEJfUFstOZJDrlXEASJRlXVJXSFwVJNJWD","QJEJNNJDQJEJIBSFQJEJxegBQJEJfHEPSJBmXEJFSJCDEJqXLXNJFQqXIcQsFNJFIFEJqXUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD","IJBEJqXZJ"],Ln=null;function jn(e){return Object(m.i)(Me(e))}function Un(e){if(null===Ln){Ln=[];var t={};t[Pe([227,130,154])]=!1,t[Pe([227,130,153])]=!1,t[Pe([227,130,133])]=Pe([227,130,134]),t[Pe([227,129,163])]=Pe([227,129,164]),t[Pe([227,130,131])]=Pe([227,130,132]),t[Pe([227,130,135])]=Pe([227,130,136]);for(var r=3;r<=9;r++)for(var n=Nn[r-3],i=0;it?1:0})),"0xe3818de38284e3818f"===jn(Ln[442])&&"0xe3818de38283e3818f"===jn(Ln[443])){var u=Ln[442];Ln[442]=Ln[443],Ln[443]=u}if("0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600"!==mn.check(e))throw Ln=null,new Error("BIP39 Wordlist for ja (Japanese) FAILED")}function c(e){for(var r="",n=0;n=40?o=o+168-40:o>=19&&(o=o+97-19),Pe([225,132+(o>>6),128+(63&o)]));zn.push(n)}var o})),zn.sort(),"0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a"!==mn.check(e)))throw zn=null,new Error("BIP39 Wordlist for ko (Korean) FAILED")}var Hn=new(function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.call(this,"ko")}return Object(y.a)(r,[{key:"getWord",value:function(e){return Vn(this),zn[e]}},{key:"getWordIndex",value:function(e){return Vn(this),zn.indexOf(e)}}]),r}(mn));mn.register(Hn);var Jn=null;function qn(e){if(null==Jn&&(Jn="AbacoAbbaglioAbbinatoAbeteAbissoAbolireAbrasivoAbrogatoAccadereAccennoAccusatoAcetoneAchilleAcidoAcquaAcreAcrilicoAcrobataAcutoAdagioAddebitoAddomeAdeguatoAderireAdipeAdottareAdulareAffabileAffettoAffissoAffrantoAforismaAfosoAfricanoAgaveAgenteAgevoleAggancioAgireAgitareAgonismoAgricoloAgrumetoAguzzoAlabardaAlatoAlbatroAlberatoAlboAlbumeAlceAlcolicoAlettoneAlfaAlgebraAlianteAlibiAlimentoAllagatoAllegroAllievoAllodolaAllusivoAlmenoAlogenoAlpacaAlpestreAltalenaAlternoAlticcioAltroveAlunnoAlveoloAlzareAmalgamaAmanitaAmarenaAmbitoAmbratoAmebaAmericaAmetistaAmicoAmmassoAmmendaAmmirareAmmonitoAmoreAmpioAmpliareAmuletoAnacardoAnagrafeAnalistaAnarchiaAnatraAncaAncellaAncoraAndareAndreaAnelloAngeloAngolareAngustoAnimaAnnegareAnnidatoAnnoAnnuncioAnonimoAnticipoAnziApaticoAperturaApodeApparireAppetitoAppoggioApprodoAppuntoAprileArabicaArachideAragostaAraldicaArancioAraturaArazzoArbitroArchivioArditoArenileArgentoArgineArgutoAriaArmoniaArneseArredatoArringaArrostoArsenicoArsoArteficeArzilloAsciuttoAscoltoAsepsiAsetticoAsfaltoAsinoAsolaAspiratoAsproAssaggioAsseAssolutoAssurdoAstaAstenutoAsticeAstrattoAtavicoAteismoAtomicoAtonoAttesaAttivareAttornoAttritoAttualeAusilioAustriaAutistaAutonomoAutunnoAvanzatoAvereAvvenireAvvisoAvvolgereAzioneAzotoAzzimoAzzurroBabeleBaccanoBacinoBacoBadessaBadilataBagnatoBaitaBalconeBaldoBalenaBallataBalzanoBambinoBandireBaraondaBarbaroBarcaBaritonoBarlumeBaroccoBasilicoBassoBatostaBattutoBauleBavaBavosaBeccoBeffaBelgioBelvaBendaBenevoleBenignoBenzinaBereBerlinaBetaBibitaBiciBidoneBifidoBigaBilanciaBimboBinocoloBiologoBipedeBipolareBirbanteBirraBiscottoBisestoBisnonnoBisonteBisturiBizzarroBlandoBlattaBollitoBonificoBordoBoscoBotanicoBottinoBozzoloBraccioBradipoBramaBrancaBravuraBretellaBrevettoBrezzaBrigliaBrillanteBrindareBroccoloBrodoBronzinaBrulloBrunoBubboneBucaBudinoBuffoneBuioBulboBuonoBurloneBurrascaBussolaBustaCadettoCaducoCalamaroCalcoloCalesseCalibroCalmoCaloriaCambusaCamerataCamiciaCamminoCamolaCampaleCanapaCandelaCaneCaninoCanottoCantinaCapaceCapelloCapitoloCapogiroCapperoCapraCapsulaCarapaceCarcassaCardoCarismaCarovanaCarrettoCartolinaCasaccioCascataCasermaCasoCassoneCastelloCasualeCatastaCatenaCatrameCautoCavilloCedibileCedrataCefaloCelebreCellulareCenaCenoneCentesimoCeramicaCercareCertoCerumeCervelloCesoiaCespoCetoChelaChiaroChiccaChiedereChimeraChinaChirurgoChitarraCiaoCiclismoCifrareCignoCilindroCiottoloCircaCirrosiCitricoCittadinoCiuffoCivettaCivileClassicoClinicaCloroCoccoCodardoCodiceCoerenteCognomeCollareColmatoColoreColposoColtivatoColzaComaCometaCommandoComodoComputerComuneConcisoCondurreConfermaCongelareConiugeConnessoConoscereConsumoContinuoConvegnoCopertoCopioneCoppiaCopricapoCorazzaCordataCoricatoCorniceCorollaCorpoCorredoCorsiaCorteseCosmicoCostanteCotturaCovatoCratereCravattaCreatoCredereCremosoCrescitaCretaCricetoCrinaleCrisiCriticoCroceCronacaCrostataCrucialeCruscaCucireCuculoCuginoCullatoCupolaCuratoreCursoreCurvoCuscinoCustodeDadoDainoDalmataDamerinoDanielaDannosoDanzareDatatoDavantiDavveroDebuttoDecennioDecisoDeclinoDecolloDecretoDedicatoDefinitoDeformeDegnoDelegareDelfinoDelirioDeltaDemenzaDenotatoDentroDepositoDerapataDerivareDerogaDescrittoDesertoDesiderioDesumereDetersivoDevotoDiametroDicembreDiedroDifesoDiffusoDigerireDigitaleDiluvioDinamicoDinnanziDipintoDiplomaDipoloDiradareDireDirottoDirupoDisagioDiscretoDisfareDisgeloDispostoDistanzaDisumanoDitoDivanoDiveltoDividereDivoratoDobloneDocenteDoganaleDogmaDolceDomatoDomenicaDominareDondoloDonoDormireDoteDottoreDovutoDozzinaDragoDruidoDubbioDubitareDucaleDunaDuomoDupliceDuraturoEbanoEccessoEccoEclissiEconomiaEderaEdicolaEdileEditoriaEducareEgemoniaEgliEgoismoEgregioElaboratoElargireEleganteElencatoElettoElevareElficoElicaElmoElsaElusoEmanatoEmblemaEmessoEmiroEmotivoEmozioneEmpiricoEmuloEndemicoEnduroEnergiaEnfasiEnotecaEntrareEnzimaEpatiteEpilogoEpisodioEpocaleEppureEquatoreErarioErbaErbosoEredeEremitaErigereErmeticoEroeErosivoErranteEsagonoEsameEsanimeEsaudireEscaEsempioEsercitoEsibitoEsigenteEsistereEsitoEsofagoEsortatoEsosoEspansoEspressoEssenzaEssoEstesoEstimareEstoniaEstrosoEsultareEtilicoEtnicoEtruscoEttoEuclideoEuropaEvasoEvidenzaEvitatoEvolutoEvvivaFabbricaFaccendaFachiroFalcoFamigliaFanaleFanfaraFangoFantasmaFareFarfallaFarinosoFarmacoFasciaFastosoFasulloFaticareFatoFavolosoFebbreFecolaFedeFegatoFelpaFeltroFemminaFendereFenomenoFermentoFerroFertileFessuraFestivoFettaFeudoFiabaFiduciaFifaFiguratoFiloFinanzaFinestraFinireFioreFiscaleFisicoFiumeFlaconeFlamencoFleboFlemmaFloridoFluenteFluoroFobicoFocacciaFocosoFoderatoFoglioFolataFolcloreFolgoreFondenteFoneticoFoniaFontanaForbitoForchettaForestaFormicaFornaioForoFortezzaForzareFosfatoFossoFracassoFranaFrassinoFratelloFreccettaFrenataFrescoFrigoFrollinoFrondeFrugaleFruttaFucilataFucsiaFuggenteFulmineFulvoFumanteFumettoFumosoFuneFunzioneFuocoFurboFurgoneFuroreFusoFutileGabbianoGaffeGalateoGallinaGaloppoGamberoGammaGaranziaGarboGarofanoGarzoneGasdottoGasolioGastricoGattoGaudioGazeboGazzellaGecoGelatinaGelsoGemelloGemmatoGeneGenitoreGennaioGenotipoGergoGhepardoGhiaccioGhisaGialloGildaGineproGiocareGioielloGiornoGioveGiratoGironeGittataGiudizioGiuratoGiustoGlobuloGlutineGnomoGobbaGolfGomitoGommoneGonfioGonnaGovernoGracileGradoGraficoGrammoGrandeGrattareGravosoGraziaGrecaGreggeGrifoneGrigioGrinzaGrottaGruppoGuadagnoGuaioGuantoGuardareGufoGuidareIbernatoIconaIdenticoIdillioIdoloIdraIdricoIdrogenoIgieneIgnaroIgnoratoIlareIllesoIllogicoIlludereImballoImbevutoImboccoImbutoImmaneImmersoImmolatoImpaccoImpetoImpiegoImportoImprontaInalareInarcareInattivoIncantoIncendioInchinoIncisivoInclusoIncontroIncrocioIncuboIndagineIndiaIndoleIneditoInfattiInfilareInflittoIngaggioIngegnoIngleseIngordoIngrossoInnescoInodoreInoltrareInondatoInsanoInsettoInsiemeInsonniaInsulinaIntasatoInteroIntonacoIntuitoInumidireInvalidoInveceInvitoIperboleIpnoticoIpotesiIppicaIrideIrlandaIronicoIrrigatoIrrorareIsolatoIsotopoIstericoIstitutoIstriceItaliaIterareLabbroLabirintoLaccaLaceratoLacrimaLacunaLaddoveLagoLampoLancettaLanternaLardosoLargaLaringeLastraLatenzaLatinoLattugaLavagnaLavoroLegaleLeggeroLemboLentezzaLenzaLeoneLepreLesivoLessatoLestoLetteraleLevaLevigatoLiberoLidoLievitoLillaLimaturaLimitareLimpidoLineareLinguaLiquidoLiraLiricaLiscaLiteLitigioLivreaLocandaLodeLogicaLombareLondraLongevoLoquaceLorenzoLotoLotteriaLuceLucidatoLumacaLuminosoLungoLupoLuppoloLusingaLussoLuttoMacabroMacchinaMaceroMacinatoMadamaMagicoMagliaMagneteMagroMaiolicaMalafedeMalgradoMalintesoMalsanoMaltoMalumoreManaManciaMandorlaMangiareManifestoMannaroManovraMansardaMantideManubrioMappaMaratonaMarcireMarettaMarmoMarsupioMascheraMassaiaMastinoMaterassoMatricolaMattoneMaturoMazurcaMeandroMeccanicoMecenateMedesimoMeditareMegaMelassaMelisMelodiaMeningeMenoMensolaMercurioMerendaMerloMeschinoMeseMessereMestoloMetalloMetodoMettereMiagolareMicaMicelioMicheleMicroboMidolloMieleMiglioreMilanoMiliteMimosaMineraleMiniMinoreMirinoMirtilloMiscelaMissivaMistoMisurareMitezzaMitigareMitraMittenteMnemonicoModelloModificaModuloMoganoMogioMoleMolossoMonasteroMoncoMondinaMonetarioMonileMonotonoMonsoneMontatoMonvisoMoraMordereMorsicatoMostroMotivatoMotosegaMottoMovenzaMovimentoMozzoMuccaMucosaMuffaMughettoMugnaioMulattoMulinelloMultiploMummiaMuntoMuovereMuraleMusaMuscoloMusicaMutevoleMutoNababboNaftaNanometroNarcisoNariceNarratoNascereNastrareNaturaleNauticaNaviglioNebulosaNecrosiNegativoNegozioNemmenoNeofitaNerettoNervoNessunoNettunoNeutraleNeveNevroticoNicchiaNinfaNitidoNobileNocivoNodoNomeNominaNordicoNormaleNorvegeseNostranoNotareNotiziaNotturnoNovellaNucleoNullaNumeroNuovoNutrireNuvolaNuzialeOasiObbedireObbligoObeliscoOblioOboloObsoletoOccasioneOcchioOccidenteOccorrereOccultareOcraOculatoOdiernoOdorareOffertaOffrireOffuscatoOggettoOggiOgnunoOlandeseOlfattoOliatoOlivaOlogrammaOltreOmaggioOmbelicoOmbraOmegaOmissioneOndosoOnereOniceOnnivoroOnorevoleOntaOperatoOpinioneOppostoOracoloOrafoOrdineOrecchinoOreficeOrfanoOrganicoOrigineOrizzonteOrmaOrmeggioOrnativoOrologioOrrendoOrribileOrtensiaOrticaOrzataOrzoOsareOscurareOsmosiOspedaleOspiteOssaOssidareOstacoloOsteOtiteOtreOttagonoOttimoOttobreOvaleOvestOvinoOviparoOvocitoOvunqueOvviareOzioPacchettoPacePacificoPadellaPadronePaesePagaPaginaPalazzinaPalesarePallidoPaloPaludePandoroPannelloPaoloPaonazzoPapricaParabolaParcellaParerePargoloPariParlatoParolaPartireParvenzaParzialePassivoPasticcaPataccaPatologiaPattumePavonePeccatoPedalarePedonalePeggioPelosoPenarePendicePenisolaPennutoPenombraPensarePentolaPepePepitaPerbenePercorsoPerdonatoPerforarePergamenaPeriodoPermessoPernoPerplessoPersuasoPertugioPervasoPesatorePesistaPesoPestiferoPetaloPettinePetulantePezzoPiacerePiantaPiattinoPiccinoPicozzaPiegaPietraPifferoPigiamaPigolioPigroPilaPiliferoPillolaPilotaPimpantePinetaPinnaPinoloPioggiaPiomboPiramidePireticoPiritePirolisiPitonePizzicoPlaceboPlanarePlasmaPlatanoPlenarioPochezzaPoderosoPodismoPoesiaPoggiarePolentaPoligonoPollicePolmonitePolpettaPolsoPoltronaPolverePomicePomodoroPontePopolosoPorfidoPorosoPorporaPorrePortataPosaPositivoPossessoPostulatoPotassioPoterePranzoPrassiPraticaPreclusoPredicaPrefissoPregiatoPrelievoPremerePrenotarePreparatoPresenzaPretestoPrevalsoPrimaPrincipePrivatoProblemaProcuraProdurreProfumoProgettoProlungaPromessaPronomePropostaProrogaProtesoProvaPrudentePrugnaPruritoPsichePubblicoPudicaPugilatoPugnoPulcePulitoPulsantePuntarePupazzoPupillaPuroQuadroQualcosaQuasiQuerelaQuotaRaccoltoRaddoppioRadicaleRadunatoRafficaRagazzoRagioneRagnoRamarroRamingoRamoRandagioRantolareRapatoRapinaRappresoRasaturaRaschiatoRasenteRassegnaRastrelloRataRavvedutoRealeRecepireRecintoReclutaReconditoRecuperoRedditoRedimereRegalatoRegistroRegolaRegressoRelazioneRemareRemotoRennaReplicaReprimereReputareResaResidenteResponsoRestauroReteRetinaRetoricaRettificaRevocatoRiassuntoRibadireRibelleRibrezzoRicaricaRiccoRicevereRiciclatoRicordoRicredutoRidicoloRidurreRifasareRiflessoRiformaRifugioRigareRigettatoRighelloRilassatoRilevatoRimanereRimbalzoRimedioRimorchioRinascitaRincaroRinforzoRinnovoRinomatoRinsavitoRintoccoRinunciaRinvenireRiparatoRipetutoRipienoRiportareRipresaRipulireRisataRischioRiservaRisibileRisoRispettoRistoroRisultatoRisvoltoRitardoRitegnoRitmicoRitrovoRiunioneRivaRiversoRivincitaRivoltoRizomaRobaRoboticoRobustoRocciaRocoRodaggioRodereRoditoreRogitoRollioRomanticoRompereRonzioRosolareRospoRotanteRotondoRotulaRovescioRubizzoRubricaRugaRullinoRumineRumorosoRuoloRupeRussareRusticoSabatoSabbiareSabotatoSagomaSalassoSaldaturaSalgemmaSalivareSalmoneSaloneSaltareSalutoSalvoSapereSapidoSaporitoSaracenoSarcasmoSartoSassosoSatelliteSatiraSatolloSaturnoSavanaSavioSaziatoSbadiglioSbalzoSbancatoSbarraSbattereSbavareSbendareSbirciareSbloccatoSbocciatoSbrinareSbruffoneSbuffareScabrosoScadenzaScalaScambiareScandaloScapolaScarsoScatenareScavatoSceltoScenicoScettroSchedaSchienaSciarpaScienzaScindereScippoSciroppoScivoloSclerareScodellaScolpitoScompartoSconfortoScoprireScortaScossoneScozzeseScribaScrollareScrutinioScuderiaScultoreScuolaScuroScusareSdebitareSdoganareSeccaturaSecondoSedanoSeggiolaSegnalatoSegregatoSeguitoSelciatoSelettivoSellaSelvaggioSemaforoSembrareSemeSeminatoSempreSensoSentireSepoltoSequenzaSerataSerbatoSerenoSerioSerpenteSerraglioServireSestinaSetolaSettimanaSfaceloSfaldareSfamatoSfarzosoSfaticatoSferaSfidaSfilatoSfingeSfocatoSfoderareSfogoSfoltireSforzatoSfrattoSfruttatoSfuggitoSfumareSfusoSgabelloSgarbatoSgonfiareSgorbioSgrassatoSguardoSibiloSiccomeSierraSiglaSignoreSilenzioSillabaSimboloSimpaticoSimulatoSinfoniaSingoloSinistroSinoSintesiSinusoideSiparioSismaSistoleSituatoSlittaSlogaturaSlovenoSmarritoSmemoratoSmentitoSmeraldoSmilzoSmontareSmottatoSmussatoSnellireSnervatoSnodoSobbalzoSobrioSoccorsoSocialeSodaleSoffittoSognoSoldatoSolenneSolidoSollazzoSoloSolubileSolventeSomaticoSommaSondaSonettoSonniferoSopireSoppesoSopraSorgereSorpassoSorrisoSorsoSorteggioSorvolatoSospiroSostaSottileSpadaSpallaSpargereSpatolaSpaventoSpazzolaSpecieSpedireSpegnereSpelaturaSperanzaSpessoreSpettraleSpezzatoSpiaSpigolosoSpillatoSpinosoSpiraleSplendidoSportivoSposoSprangaSprecareSpronatoSpruzzoSpuntinoSquilloSradicareSrotolatoStabileStaccoStaffaStagnareStampatoStantioStarnutoStaseraStatutoSteloSteppaSterzoStilettoStimaStirpeStivaleStizzosoStonatoStoricoStrappoStregatoStriduloStrozzareStruttoStuccareStufoStupendoSubentroSuccosoSudoreSuggeritoSugoSultanoSuonareSuperboSupportoSurgelatoSurrogatoSussurroSuturaSvagareSvedeseSveglioSvelareSvenutoSveziaSviluppoSvistaSvizzeraSvoltaSvuotareTabaccoTabulatoTacciareTaciturnoTaleTalismanoTamponeTanninoTaraTardivoTargatoTariffaTarpareTartarugaTastoTatticoTavernaTavolataTazzaTecaTecnicoTelefonoTemerarioTempoTemutoTendoneTeneroTensioneTentacoloTeoremaTermeTerrazzoTerzettoTesiTesseratoTestatoTetroTettoiaTifareTigellaTimbroTintoTipicoTipografoTiraggioTiroTitanioTitoloTitubanteTizioTizzoneToccareTollerareToltoTombolaTomoTonfoTonsillaTopazioTopologiaToppaTorbaTornareTorroneTortoraToscanoTossireTostaturaTotanoTraboccoTracheaTrafilaTragediaTralcioTramontoTransitoTrapanoTrarreTraslocoTrattatoTraveTrecciaTremolioTrespoloTributoTrichecoTrifoglioTrilloTrinceaTrioTristezzaTrituratoTrivellaTrombaTronoTroppoTrottolaTrovareTruccatoTubaturaTuffatoTulipanoTumultoTunisiaTurbareTurchinoTutaTutelaUbicatoUccelloUccisoreUdireUditivoUffaUfficioUgualeUlisseUltimatoUmanoUmileUmorismoUncinettoUngereUnghereseUnicornoUnificatoUnisonoUnitarioUnteUovoUpupaUraganoUrgenzaUrloUsanzaUsatoUscitoUsignoloUsuraioUtensileUtilizzoUtopiaVacanteVaccinatoVagabondoVagliatoValangaValgoValicoVallettaValorosoValutareValvolaVampataVangareVanitosoVanoVantaggioVanveraVaporeVaranoVarcatoVarianteVascaVedettaVedovaVedutoVegetaleVeicoloVelcroVelinaVellutoVeloceVenatoVendemmiaVentoVeraceVerbaleVergognaVerificaVeroVerrucaVerticaleVescicaVessilloVestaleVeteranoVetrinaVetustoViandanteVibranteVicendaVichingoVicinanzaVidimareVigiliaVignetoVigoreVileVillanoViminiVincitoreViolaViperaVirgolaVirologoVirulentoViscosoVisioneVispoVissutoVisuraVitaVitelloVittimaVivandaVividoViziareVoceVogaVolatileVolereVolpeVoragineVulcanoZampognaZannaZappatoZatteraZavorraZefiroZelanteZeloZenzeroZerbinoZibettoZincoZirconeZittoZollaZoticoZuccheroZufoloZuluZuppa".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620"!==mn.check(e)))throw Jn=null,new Error("BIP39 Wordlist for it (Italian) FAILED")}var Gn=new(function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.call(this,"it")}return Object(y.a)(r,[{key:"getWord",value:function(e){return qn(this),Jn[e]}},{key:"getWordIndex",value:function(e){return qn(this),Jn.indexOf(e)}}]),r}(mn));mn.register(Gn);var Xn="}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN>2),128+Yn.indexOf(Xn[3*r+1]),128+Yn.indexOf(Xn[3*r+2])];if("zh_tw"===e.locale)for(var o=n%4;o<3;o++)i[o]=Yn.indexOf("FAZDC6BALcLZCA+GBARCW8wNCcDDZ8LVFBOqqDUiou+M42TFAyERXFb7EjhP+vmBFpFrUpfDV2F7eB+eCltCHJFWLFCED+pWTojEIHFXc3aFn4F68zqjEuKidS1QBVPDEhE7NA4mhMF7oThD49ot3FgtzHFCK0acW1x8DH1EmLoIlrWFBLE+y5+NA3Cx65wJHTaEZVaK1mWAmPGxgYCdxwOjTDIt/faOEhTl1vqNsKtJCOhJWuio2g07KLZEQsFBUpNtwEByBgxFslFheFbiEPvi61msDvApxCzB6rBCzox7joYA5UdDc+Cb4FSgIabpXFAj3bjkmFAxCZE+mD/SFf/0ELecYCt3nLoxC6WEZf2tKDB4oZvrEmqFkKk7BwILA7gtYBpsTq//D4jD0F0wEB9pyQ1BD5Ba0oYHDI+sbDFhvrHXdDHfgFEIJLi5r8qercNFBgFLC4bo5ERJtamWBDFy73KCEb6M8VpmEt330ygCTK58EIIFkYgF84gtGA9Uyh3m68iVrFbWFbcbqiCYHZ9J1jeRPbL8yswhMiDbhEhdNoSwFbZrLT740ABEqgCkO8J1BLd1VhKKR4sD1yUo0z+FF59Mvg71CFbyEhbHSFBKEIKyoQNgQppq9T0KAqePu0ZFGrXOHdKJqkoTFhYvpDNyuuznrN84thJbsCoO6Cu6Xlvntvy0QYuAExQEYtTUBf3CoCqwgGFZ4u1HJFzDVwEy3cjcpV4QvsPaBC3rCGyCF23o4K3pp2gberGgFEJEHo4nHICtyKH2ZqyxhN05KBBJIQlKh/Oujv/DH32VrlqFdIFC7Fz9Ct4kaqFME0UETLprnN9kfy+kFmtQBB0+5CFu0N9Ij8l/VvJDh2oq3hT6EzjTHKFN7ZjZwoTsAZ4Exsko6Fpa6WC+sduz8jyrLpegTv2h1EBeYpLpm2czQW0KoCcS0bCVXCmuWJDBjN1nQNLdF58SFJ0h7i3pC3oEOKy/FjBklL70XvBEEIWp2yZ04xObzAWDDJG7f+DbqBEA7LyiR95j7MDVdDViz2RE5vWlBMv5e4+VfhP3aXNPhvLSynb9O2x4uFBV+3jqu6d5pCG28/sETByvmu/+IJ0L3wb4rj9DNOLBF6XPIODr4L19U9RRofAG6Nxydi8Bki8BhGJbBAJKzbJxkZSlF9Q2Cu8oKqggB9hBArwLLqEBWEtFowy8XK8bEyw9snT+BeyFk1ZCSrdmgfEwFePTgCjELBEnIbjaDDPJm36rG9pztcEzT8dGk23SBhXBB1H4z+OWze0ooFzz8pDBYFvp9j9tvFByf9y4EFdVnz026CGR5qMr7fxMHN8UUdlyJAzlTBDRC28k+L4FB8078ljyD91tUj1ocnTs8vdEf7znbzm+GIjEZnoZE5rnLL700Xc7yHfz05nWxy03vBB9YGHYOWxgMQGBCR24CVYNE1hpfKxN0zKnfJDmmMgMmBWqNbjfSyFCBWSCGCgR8yFXiHyEj+VtD1FB3FpC1zI0kFbzifiKTLm9yq5zFmur+q8FHqjoOBWsBPiDbnCC2ErunV6cJ6TygXFYHYp7MKN9RUlSIS8/xBAGYLzeqUnBF4QbsTuUkUqGs6CaiDWKWjQK9EJkjpkTmNCPYXL"[t++])+(0==o?228:128);Wn[e.locale].push(Pe(i))}if(mn.check(e)!==Zn[e.locale])throw Wn[e.locale]=null,new Error("BIP39 Wordlist for "+e.locale+" (Chinese) FAILED")}}var $n=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(e){return Object(v.a)(this,r),t.call(this,"zh_"+e)}return Object(y.a)(r,[{key:"getWord",value:function(e){return Qn(this),Wn[this.locale][e]}},{key:"getWordIndex",value:function(e){return Qn(this),Wn[this.locale].indexOf(e)}},{key:"split",value:function(e){return(e=e.replace(/(?:\u3000| )+/g,"")).split("")}}]),r}(mn),ei=new $n("cn");mn.register(ei),mn.register(ei,"zh");var ti=new $n("tw");mn.register(ti);var ri={cz:Sn,en:An,es:On,fr:Dn,it:Gn,ja:Fn,ko:Hn,zh:ei,zh_cn:ei,zh_tw:ti},ni=new S.b("hdnode/5.3.0"),ii=C.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),oi=Me("Bitcoin seed"),ai=2147483648;function si(e){return(1<=256)throw new Error("Depth too large!");return ci(Object(m.b)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(m.i)(this.depth),this.parentFingerprint,Object(m.h)(Object(m.i)(this.index),4),this.chainCode,null!=this.privateKey?Object(m.b)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new e(li,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(t){if(t>4294967295)throw new Error("invalid index - "+String(t));var r=this.path;r&&(r+="/"+(2147483647&t));var n=new Uint8Array(37);if(t&ai){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(Object(m.a)(this.privateKey),1),r&&(r+="'")}else n.set(Object(m.a)(this.publicKey));for(var i=24;i>=0;i-=8)n[33+(i>>3)]=t>>24-i&255;var o=Object(m.a)(yn(an.sha512,this.chainCode,n)),a=o.slice(0,32),s=o.slice(32),u=null,c=null;this.privateKey?u=ui(C.from(a).add(this.privateKey).mod(ii)):c=new Yt(Object(m.i)(a))._addPoint(this.publicKey);var f=r,l=this.mnemonic;return l&&(f=Object.freeze({phrase:l.phrase,path:r,locale:l.locale||"en"})),new e(li,u,c,this.fingerprint,ui(s),t,this.depth+1,f)}},{key:"derivePath",value:function(e){var t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();for(var r=this,n=0;n=ai)throw new Error("invalid path index - "+i);r=r._derive(ai+o)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i);var a=parseInt(i);if(a>=ai)throw new Error("invalid path index - "+i);r=r._derive(a)}}return r}}],[{key:"_fromSeed",value:function(t,r){var n=Object(m.a)(t);if(n.length<16||n.length>64)throw new Error("invalid seed");var i=Object(m.a)(yn(an.sha512,oi,n));return new e(li,ui(i.slice(0,32)),null,"0x00000000",ui(i.slice(32)),0,0,r)}},{key:"fromMnemonic",value:function(t,r,n){return t=yi(vi(t,n=fi(n)),n),e._fromSeed(pi(t,r),{phrase:t,path:"m",locale:n.locale})}},{key:"fromSeed",value:function(t){return e._fromSeed(t,null)}},{key:"fromExtendedKey",value:function(t){var r=cn.decode(t);82===r.length&&ci(r.slice(0,78))===t||ni.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var n=r[4],i=Object(m.i)(r.slice(5,9)),o=parseInt(Object(m.i)(r.slice(9,13)).substring(2),16),a=Object(m.i)(r.slice(13,45)),s=r.slice(45,78);switch(Object(m.i)(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new e(li,null,Object(m.i)(s),i,a,o,n,null);case"0x0488ade4":case"0x04358394 ":if(0!==s[0])break;return new e(li,Object(m.i)(s.slice(1)),null,i,a,o,n,null)}return ni.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}]),e}();function pi(e,t){t||(t="");var r=Me("mnemonic"+t,Se.NFKD);return bn(Me(e,Se.NFKD),r,2048,64,"sha512")}function vi(e,t){t=fi(t),ni.checkNormalize();var r=t.split(e);if(r.length%3!==0)throw new Error("invalid mnemonic");for(var n=Object(m.a)(new Uint8Array(Math.ceil(11*r.length/8))),i=0,o=0;o>3]|=1<<7-i%8),i++}var u=32*r.length/3,c=si(r.length/3);if((Object(m.a)(pn(n.slice(0,u/8)))[0]&c)!==(n[n.length-1]&c))throw new Error("invalid checksum");return Object(m.i)(n.slice(0,u/8))}function yi(e,t){if(t=fi(t),(e=Object(m.a)(e)).length%4!==0||e.length<16||e.length>32)throw new Error("invalid entropy");for(var r=[0],n=11,i=0;i8?(r[r.length-1]<<=8,r[r.length-1]|=e[i],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[i]>>8-n,r.push(e[i]&(1<<8-n)-1),n+=3);var o=e.length/4,a=Object(m.a)(pn(e))[0]&si(o);return r[r.length-1]<<=o,r[r.length-1]|=a>>8-o,t.join(r.map((function(e){return t.getWord(e)})))}function bi(e,t){try{return vi(e,t),!0}catch(r){}return!1}function gi(e){return("number"!==typeof e||e<0||e>=ai||e%1)&&ni.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}var mi=r(1120),wi=r(72),ki=r.n(wi),Si=r(234),Ei=r.n(Si);function _i(e){return"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Object(m.a)(e)}function Ai(e,t){for(e=String(e);e.length=(r+=i.l)&&e<=r+i.h&&(e-r)%(i.d||1)===0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}var lo=co("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"),ho="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(e){return parseInt(e,16)})),po=[{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}],vo=uo("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"),yo=uo("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"),bo=uo("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!==0)throw new Error("bad data");for(var t=[],r=0;r=0)return[];if(e>=65024&&e<=65039)return[];var t=function(e){var t=fo(e,po);if(t)return[e+t.s];var r=vo[e];if(r)return r;var n=yo[e];return n?[e+n[0]]:bo[e]||null}(e);return t||[e]})),(r=Re(Ie(r=t.reduce((function(e,t){return t.forEach((function(t){e.push(t)})),e}),[])),Se.NFKC)).forEach((function(e){if(fo(e,go))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),r.forEach((function(e){if(fo(e,lo))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var n=Ie(r);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");if(n.length>63)throw new Error("too long");return n}var wo=new S.b(Vr),ko=new Uint8Array(32);ko.fill(0);var So=new RegExp("^((.*)\\.)?([^.]+)$");function Eo(e){try{for(var t=e.split("."),r=0;r0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);var i="object"===typeof e?e.throttleCallback:null,o="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Oo.assertArgument(o>0&&o%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);var a={},s=null,u={method:"GET"},c=!1,f=12e4;if("string"===typeof e)s=e;else if("object"===typeof e){if(null!=e&&null!=e.url||Oo.throwArgumentError("missing URL","connection.url",e),s=e.url,"number"===typeof e.timeout&&e.timeout>0&&(f=e.timeout),e.headers)for(var l in e.headers)a[l.toLowerCase()]={key:l,value:String(e.headers[l])},["if-none-match","if-modified-since"].indexOf(l.toLowerCase())>=0&&(c=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==s.substring(0,6)&&!0!==e.allowInsecureAuthentication&&Oo.throwError("basic authentication requires a secure https url",S.b.errors.INVALID_ARGUMENT,{argument:"url",url:s,user:e.user,password:"[REDACTED]"});var h=e.user+":"+e.password;a.authorization={key:"Authorization",value:"Basic "+xo(Me(h))}}}t&&(u.method="POST",u.body=t,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(t.length)}));var d={};Object.keys(a).forEach((function(e){var t=a[e];d[t.key]=t.value})),u.headers=d;var p=function(){var e=null;return{promise:new Promise((function(t,r){f&&(e=setTimeout((function(){null!=e&&(e=null,r(Oo.makeError("timeout",S.b.errors.TIMEOUT,{requestBody:Po(u.body,d["content-type"]),requestMethod:u.method,timeout:f,url:s})))}),f))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),v=function(){return Co(this,void 0,void 0,g.a.mark((function e(){var t,a,f,l,h,v,y,b,m;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t=300)&&(p.cancel(),Oo.throwError("bad response",S.b.errors.SERVER_ERROR,{status:a.statusCode,headers:a.headers,body:Po(v,a.headers?a.headers["content-type"]:null),requestBody:Po(u.body,d["content-type"]),requestMethod:u.method,url:s})),!r){e.next=52;break}return e.prev=29,e.next=32,r(v,a);case 32:return y=e.sent,p.cancel(),e.abrupt("return",y);case 37:if(e.prev=37,e.t1=e.catch(29),!(e.t1.throttleRetry&&ts)return void(a()&&n(new Error("retry limit reached")));var c=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));ct.ceiling&&(c=t.ceiling),setTimeout(i,c)}return null}),(function(e){a()&&n(e)}))}()}))}var No=r(313),Lo=r.n(No),jo="providers/5.3.1",Uo=new S.b(jo),Fo=function(){function e(){Object(v.a)(this,e),Uo.checkNew(this instanceof e?this.constructor:void 0,e),this.formats=this.getDefaultFormats()}return Object(y.a)(e,[{key:"getDefaultFormats",value:function(){var t=this,r={},n=this.address.bind(this),i=this.bigNumber.bind(this),o=this.blockTag.bind(this),a=this.data.bind(this),s=this.hash.bind(this),u=this.hex.bind(this),c=this.number.bind(this);return r.transaction={hash:s,type:e.allowNull(c,null),accessList:e.allowNull(this.accessList.bind(this),null),blockHash:e.allowNull(s,null),blockNumber:e.allowNull(c,null),transactionIndex:e.allowNull(c,null),confirmations:e.allowNull(c,null),from:n,gasPrice:i,gasLimit:i,to:e.allowNull(n,null),value:i,nonce:c,data:a,r:e.allowNull(this.uint256),s:e.allowNull(this.uint256),v:e.allowNull(c),creates:e.allowNull(n,null),raw:e.allowNull(a)},r.transactionRequest={from:e.allowNull(n),nonce:e.allowNull(c),gasLimit:e.allowNull(i),gasPrice:e.allowNull(i),to:e.allowNull(n),value:e.allowNull(i),data:e.allowNull((function(e){return t.data(e,!0)})),type:e.allowNull(c),accessList:e.allowNull(this.accessList.bind(this),null)},r.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:s,address:n,topics:e.arrayOf(s),data:a,logIndex:c,blockHash:s},r.receipt={to:e.allowNull(this.address,null),from:e.allowNull(this.address,null),contractAddress:e.allowNull(n,null),transactionIndex:c,root:e.allowNull(u),gasUsed:i,logsBloom:e.allowNull(a),blockHash:s,transactionHash:s,logs:e.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:e.allowNull(c,null),cumulativeGasUsed:i,status:e.allowNull(c)},r.block={hash:s,parentHash:s,number:c,timestamp:c,nonce:e.allowNull(u),difficulty:this.difficulty.bind(this),gasLimit:i,gasUsed:i,miner:n,extraData:a,transactions:e.allowNull(e.arrayOf(s))},r.blockWithTransactions=F(r.block),r.blockWithTransactions.transactions=e.allowNull(e.arrayOf(this.transactionResponse.bind(this))),r.filter={fromBlock:e.allowNull(o,void 0),toBlock:e.allowNull(o,void 0),blockHash:e.allowNull(s,void 0),address:e.allowNull(n,void 0),topics:e.allowNull(this.topics.bind(this),void 0)},r.filterLog={blockNumber:e.allowNull(c),blockHash:e.allowNull(s),transactionIndex:c,removed:e.allowNull(this.boolean.bind(this)),address:n,data:e.allowFalsish(a,"0x"),topics:e.arrayOf(s),transactionHash:s,logIndex:c},r}},{key:"accessList",value:function(e){return cr(e||[])}},{key:"number",value:function(e){return"0x"===e?0:C.from(e).toNumber()}},{key:"bigNumber",value:function(e){return C.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(m.l)(e))?e.toLowerCase():Uo.throwArgumentError("invalid hash","value",e)}},{key:"data",value:function(e,t){var r=this.hex(e,t);if(r.length%2!==0)throw new Error("invalid data; odd-length - "+e);return r}},{key:"address",value:function(e){return be(e)}},{key:"callAddress",value:function(e){if(!Object(m.l)(e,32))return null;var t=be(Object(m.e)(e,12));return t===Yi?null:t}},{key:"contractAddress",value:function(e){return we(e)}},{key:"blockTag",value:function(e){if(null==e)return"latest";if("earliest"===e)return"0x0";if("latest"===e||"pending"===e)return e;if("number"===typeof e||Object(m.l)(e))return Object(m.g)(e);throw new Error("invalid blockTag")}},{key:"hash",value:function(e,t){var r=this.hex(e,t);return 32!==Object(m.d)(r)?Uo.throwArgumentError("invalid hash","value",e):r}},{key:"difficulty",value:function(e){if(null==e)return null;var t=C.from(e);try{return t.toNumber()}catch(r){}return null}},{key:"uint256",value:function(e){if(!Object(m.l)(e))throw new Error("invalid uint256");return Object(m.h)(e,32)}},{key:"_block",value:function(t,r){return null!=t.author&&null==t.miner&&(t.miner=t.author),e.check(r,t)}},{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&&C.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&&null==t.accessList&&(t.accessList=[]);var r=e.check(this.formats.transaction,t);if(null!=t.chainId){var n=t.chainId;Object(m.l)(n)&&(n=C.from(n).toNumber()),r.chainId=n}else{var i=t.networkId;null==i&&null==r.v&&(i=t.chainId),Object(m.l)(i)&&(i=C.from(i).toNumber()),"number"!==typeof i&&null!=r.v&&((i=(r.v-35)/2)<0&&(i=0),i=parseInt(i)),"number"!==typeof i&&(i=0),r.chainId=i}return r.blockHash&&"x"===r.blockHash.replace(/0/g,"")&&(r.blockHash=null),r}},{key:"transaction",value:function(e){return hr(e)}},{key:"receiptLog",value:function(t){return e.check(this.formats.receiptLog,t)}},{key:"receipt",value:function(t){var r=e.check(this.formats.receipt,t);if(null!=r.root)if(r.root.length<=4){var n=C.from(r.root).toNumber();0===n||1===n?(null!=r.status&&r.status!==n&&Uo.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):Uo.throwArgumentError("invalid alt-root-status","value.root",r.root)}else 66!==r.root.length&&Uo.throwArgumentError("invalid root hash","value.root",r.root);return null!=r.status&&(r.byzantium=!0),r}},{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 r={};for(var n in e)try{var i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(o){throw o.checkKey=n,o.checkValue=t[n],o}return r}},{key:"allowNull",value:function(e,t){return function(r){return null==r?t:e(r)}}},{key:"allowFalsish",value:function(e,t){return function(r){return r?e(r):t}}},{key:"arrayOf",value:function(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");var r=[];return t.forEach((function(t){r.push(e(t))})),r}}}]),e}();function Ko(e){return e&&"function"===typeof e.isCommunityResource}function zo(e){return Ko(e)&&e.isCommunityResource()}var Vo=!1;function Ho(){Vo||(Vo=!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 Jo=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},qo=new S.b(jo);function Go(e){return null==e?"null":(32!==Object(m.d)(e)&&qo.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Xo(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[Go(e)]=!0}));var r=Object.keys(t);return r.sort(),r.join("|")}return Go(e)})).join("&")}function Wo(e){if("string"===typeof e){if(e=e.toLowerCase(),32===Object(m.d)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Xo(e);if(Ut.isForkEvent(e))throw qo.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+Xo(e.topics||[])}throw new Error("invalid event - "+e)}function Zo(){return(new Date).getTime()}function Yo(e){return new Promise((function(t){setTimeout(t,e)}))}var Qo=["block","network","pending","poll"],$o=function(){function e(t,r,n){Object(v.a)(this,e),N(this,"tag",t),N(this,"listener",r),N(this,"once",n)}return Object(y.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,r=e[1],n=""===(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})),i={};return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||Qo.indexOf(this.tag)>=0}}]),e}(),ea={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 ta(e){return Object(m.h)(C.from(e).toHexString(),32)}function ra(e){return cn.encode(Object(m.b)([e,Object(m.e)(pn(pn(e)),0,4)]))}var na=function(){function e(t,r,n){Object(v.a)(this,e),N(this,"provider",t),N(this,"name",n),N(this,"address",t.formatter.address(r))}return Object(y.a)(e,[{key:"_fetchBytes",value:function(e,t){return Jo(this,void 0,void 0,g.a.mark((function r(){var n,i,o,a;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n={to:this.address,data:Object(m.c)([e,_o(this.name),t||"0x"])},r.next=3,this.provider.call(n);case 3:if("0x"!==(i=r.sent)){r.next=6;break}return r.abrupt("return",null);case 6:return o=C.from(Object(m.e)(i,0,32)).toNumber(),a=C.from(Object(m.e)(i,o,o+32)).toNumber(),r.abrupt("return",Object(m.e)(i,o+32,o+32+a));case 9:case"end":return r.stop()}}),r,this)})))}},{key:"_getAddress",value:function(e,t){var r=ea[String(e)];if(null==r&&qo.throwError("unsupported coin type: ".concat(e),S.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")")}),"eth"===r.ilk)return this.provider.formatter.address(t);var n=Object(m.a)(t);if(null!=r.p2pkh){var i=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(i){var o=parseInt(i[1],16);if(i[2].length===2*o&&o>=1&&o<=75)return ra(Object(m.b)([[r.p2pkh],"0x"+i[2]]))}}if(null!=r.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 ra(Object(m.b)([[r.p2sh],"0x"+a[2]]))}}if(null!=r.prefix){var u=n[1],c=n[0];if(0===c?20!==u&&32!==u&&(c=-1):c=-1,c>=0&&n.length===2+u&&u>=1&&u<=75){var f=Lo.a.toWords(n.slice(2));return f.unshift(c),Lo.a.encode(r.prefix,f)}}return null}},{key:"getAddress",value:function(e){return Jo(this,void 0,void 0,g.a.mark((function t(){var r,n,i,o;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==e&&(e=60),60!==e){t.next=9;break}return r={to:this.address,data:"0x3b3b57de"+_o(this.name).substring(2)},t.next=5,this.provider.call(r);case 5:if("0x"!==(n=t.sent)&&n!==Qi){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",this.provider.formatter.callAddress(n));case 9:return t.next=11,this._fetchBytes("0xf1cb7e06",ta(e));case 11:if(null!=(i=t.sent)&&"0x"!==i){t.next=14;break}return t.abrupt("return",null);case 14:return null==(o=this._getAddress(e,i))&&qo.throwError("invalid or unsupported coin data",S.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:i}),t.abrupt("return",o);case 17:case"end":return t.stop()}}),t,this)})))}},{key:"getContentHash",value:function(){return Jo(this,void 0,void 0,g.a.mark((function e(){var t,r,n,i;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetchBytes("0xbc1c58d1");case 2:if(null!=(t=e.sent)&&"0x"!==t){e.next=5;break}return e.abrupt("return",null);case 5:if(!(r=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){e.next=10;break}if(n=parseInt(r[3],16),r[4].length!==2*n){e.next=10;break}return e.abrupt("return","ipfs://"+cn.encode("0x"+r[1]));case 10:if(!(i=t.match(/^0xe40101fa011b20([0-9a-f]*)$/))){e.next=14;break}if(64!==i[1].length){e.next=14;break}return e.abrupt("return","bzz://"+i[1]);case 14:return e.abrupt("return",qo.throwError("invalid or unsupported content hash data",S.b.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t}));case 15:case"end":return e.stop()}}),e,this)})))}},{key:"getText",value:function(e){return Jo(this,void 0,void 0,g.a.mark((function t(){var r,n;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Me(e),(r=Object(m.b)([ta(64),ta(r.length),r])).length%32!==0&&(r=Object(m.b)([r,Object(m.h)("0x",32-e.length%32)])),t.next=5,this._fetchBytes("0x59d1d43c",Object(m.i)(r));case 5:if(null!=(n=t.sent)&&"0x"!==n){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",Pe(n));case 9:case"end":return t.stop()}}),t,this)})))}}]),e}(),ia=null,oa=1,aa=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(e){var n;if(Object(v.a)(this,r),qo.checkNew(this instanceof r?this.constructor:void 0,Ft),(n=t.call(this))._events=[],n._emitted={block:-2},n.formatter=(this instanceof r?this.constructor:void 0).getFormatter(),N(Object(f.a)(n),"anyNetwork","any"===e),n.anyNetwork&&(e=n.detectNetwork()),e instanceof Promise)n._networkPromise=e,e.catch((function(e){})),n._ready().catch((function(e){}));else{var i=L(this instanceof r?this.constructor:void 0,"getNetwork")(e);i?(N(Object(f.a)(n),"_network",i),n.emit("network",i,null)):qo.throwArgumentError("invalid network","network",e)}return n._maxInternalBlockNumber=-1024,n._lastBlockNumber=-2,n._pollingInterval=4e3,n._fastQueryDate=0,n}return Object(y.a)(r,[{key:"_ready",value:function(){return Jo(this,void 0,void 0,g.a.mark((function e(){var t;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=this._network){e.next=17;break}if(t=null,!this._networkPromise){e.next=11;break}return e.prev=3,e.next=6,this._networkPromise;case 6:t=e.sent,e.next=11;break;case 9:e.prev=9,e.t0=e.catch(3);case 11:if(null!=t){e.next=15;break}return e.next=14,this.detectNetwork();case 14:t=e.sent;case 15:t||qo.throwError("no network detected",S.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:N(this,"_network",t),this.emit("network",t,null));case 17:return e.abrupt("return",this._network);case 18:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"ready",get:function(){var e=this;return Do((function(){return e._ready().then((function(e){return e}),(function(e){if(e.code!==S.b.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))}))}},{key:"_getInternalBlockNumber",value:function(e){return Jo(this,void 0,void 0,g.a.mark((function t(){var r,n,i,o,a=this;return g.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 r=this._internalBlockNumber,t.prev=5,t.next=8,r;case 8:if(n=t.sent,!(Zo()-n.respTime<=e)){t.next=11;break}return t.abrupt("return",n.blockNumber);case 11:return t.abrupt("break",20);case 14:if(t.prev=14,t.t0=t.catch(5),this._internalBlockNumber!==r){t.next=18;break}return t.abrupt("break",20);case 18:t.next=3;break;case 20:return i=Zo(),o=j({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(e){return null}),(function(e){return e}))}).then((function(e){var t=e.blockNumber,r=e.networkError;if(r)throw a._internalBlockNumber===o&&(a._internalBlockNumber=null),r;var n=Zo();return(t=C.from(t).toNumber())1e3)qo.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(n,")")),this.emit("error",qo.makeError("network block skew detected",S.b.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(i=this._emitted.block+1;i<=n;i++)this.emit("block",i);return this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((function(e){if("block"!==e){var t=o._emitted[e];"pending"!==t&&n-t>12&&delete o._emitted[e]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((function(e){switch(e.type){case"tx":var t=e.hash,i=o.getTransactionReceipt(t).then((function(e){return e&&null!=e.blockNumber?(o._emitted["t:"+t]=e.blockNumber,o.emit(t,e),null):null})).catch((function(e){o.emit("error",e)}));r.push(i);break;case"filter":var a=e.filter;a.fromBlock=o._lastBlockNumber+1,a.toBlock=n;var s=o.getLogs(a).then((function(e){0!==e.length&&e.forEach((function(e){o._emitted["b:"+e.blockHash]=e.blockNumber,o._emitted["t:"+e.transactionHash]=e.blockNumber,o.emit(a,e)}))})).catch((function(e){o.emit("error",e)}));r.push(s)}})),this._lastBlockNumber=n,Promise.all(r).then((function(){o.emit("didPoll",t)})).catch((function(e){o.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 Jo(this,void 0,void 0,g.a.mark((function e(){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",qo.throwError("provider does not support network detection",S.b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return e.stop()}}),e)})))}},{key:"getNetwork",value:function(){return Jo(this,void 0,void 0,g.a.mark((function e(){var t,r,n;return g.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(r=e.sent,t.chainId===r.chainId){e.next=23;break}if(!this.anyNetwork){e.next=20;break}return this._network=r,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",r,t),e.next=19,Yo(0);case 19:return e.abrupt("return",this._network);case 20:throw n=qo.makeError("underlying network changed",S.b.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:r}),this.emit("error",n),n;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=Zo();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,r){return Jo(this,void 0,void 0,g.a.mark((function n(){return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this._waitForTransaction(e,null==t?1:t,r||0,null));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"_waitForTransaction",value:function(e,t,r,n){return Jo(this,void 0,void 0,g.a.mark((function i(){var o,a=this;return g.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.getTransactionReceipt(e);case 2:if(!(((o=i.sent)?o.confirmations:0)>=t)){i.next=5;break}return i.abrupt("return",o);case 5:return i.abrupt("return",new Promise((function(i,o){var s=[],u=!1,c=function(){return!!u||(u=!0,s.forEach((function(e){e()})),!1)},f=function(e){e.confirmations0){var p=setTimeout((function(){c()||o(qo.makeError("timeout exceeded",S.b.errors.TIMEOUT,{timeout:r}))}),r);p.unref&&p.unref(),s.push((function(){clearTimeout(p)}))}})));case 6:case"end":return i.stop()}}),i,this)})))}},{key:"getBlockNumber",value:function(){return Jo(this,void 0,void 0,g.a.mark((function e(){return g.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 Jo(this,void 0,void 0,g.a.mark((function e(){var t;return g.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",C.from(t));case 9:return e.prev=9,e.t0=e.catch(5),e.abrupt("return",qo.throwError("bad result from backend",S.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 Jo(this,void 0,void 0,g.a.mark((function r(){var n,i;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,j({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getBalance",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",C.from(i));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",qo.throwError("bad result from backend",S.b.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(e,t){return Jo(this,void 0,void 0,g.a.mark((function r(){var n,i;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,j({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getTransactionCount",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",C.from(i).toNumber());case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",qo.throwError("bad result from backend",S.b.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getCode",value:function(e,t){return Jo(this,void 0,void 0,g.a.mark((function r(){var n,i;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,j({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getCode",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",Object(m.i)(i));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",qo.throwError("bad result from backend",S.b.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getStorageAt",value:function(e,t,r){return Jo(this,void 0,void 0,g.a.mark((function n(){var i,o;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,j({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((function(e){return Object(m.g)(e)}))});case 4:return i=n.sent,n.next=7,this.perform("getStorageAt",i);case 7:return o=n.sent,n.prev=8,n.abrupt("return",Object(m.i)(o));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",qo.throwError("bad result from backend",S.b.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:o,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(e,t,r){var n=this;if(null!=t&&32!==Object(m.d)(t))throw new Error("invalid response - sendTransaction");var i=e;return null!=t&&e.hash!==t&&qo.throwError("Transaction hash mismatch from Provider.sendTransaction.",S.b.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),i.wait=function(t,i){return Jo(n,void 0,void 0,g.a.mark((function n(){var o,a;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==t&&(t=1),null==i&&(i=0),o=void 0,0!==t&&null!=r&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r}),n.next=6,this._waitForTransaction(e.hash,t,i,o);case 6:if(null!=(a=n.sent)||0!==t){n.next=9;break}return n.abrupt("return",null);case 9:return this._emitted["t:"+e.hash]=a.blockNumber,0===a.status&&qo.throwError("transaction failed",S.b.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:a}),n.abrupt("return",a);case 12:case"end":return n.stop()}}),n,this)})))},i}},{key:"sendTransaction",value:function(e){return Jo(this,void 0,void 0,g.a.mark((function t(){var r,n,i,o;return g.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(m.i)(e)}));case 4:return r=t.sent,n=this.formatter.transaction(e),t.next=8,this._getInternalBlockNumber(100+2*this.pollingInterval);case 8:return i=t.sent,t.prev=9,t.next=12,this.perform("sendTransaction",{signedTransaction:r});case 12:return o=t.sent,t.abrupt("return",this._wrapTransaction(n,o,i));case 16:throw t.prev=16,t.t0=t.catch(9),t.t0.transaction=n,t.t0.transactionHash=n.hash,t.t0;case 21:case"end":return t.stop()}}),t,this,[[9,16]])})))}},{key:"_getTransactionRequest",value:function(e){return Jo(this,void 0,void 0,g.a.mark((function t(){var r,n,i=this;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return r=t.sent,n={},["from","to"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?i._getAddress(e):null})))})),["gasLimit","gasPrice","value"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?C.from(e):null})))})),["type"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return null!=e?e:null})))})),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?Object(m.i)(e):null})))})),t.t0=this.formatter,t.next=12,j(n);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 Jo(this,void 0,void 0,g.a.mark((function t(){var r,n=this;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,r={},null!=e.address&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach((function(t){null!=e[t]&&(r[t]=e[t])})),["fromBlock","toBlock"].forEach((function(t){null!=e[t]&&(r[t]=n._getBlockTag(e[t]))})),t.t0=this.formatter,t.next=10,j(r);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){return Jo(this,void 0,void 0,g.a.mark((function r(){var n,i;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,j({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("call",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",Object(m.i)(i));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",qo.throwError("bad result from backend",S.b.errors.SERVER_ERROR,{method:"call",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"estimateGas",value:function(e){return Jo(this,void 0,void 0,g.a.mark((function t(){var r,n;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,j({transaction:this._getTransactionRequest(e)});case 4:return r=t.sent,t.next=7,this.perform("estimateGas",r);case 7:return n=t.sent,t.prev=8,t.abrupt("return",C.from(n));case 12:return t.prev=12,t.t0=t.catch(8),t.abrupt("return",qo.throwError("bad result from backend",S.b.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:t.t0}));case 15:case"end":return t.stop()}}),t,this,[[8,12]])})))}},{key:"_getAddress",value:function(e){return Jo(this,void 0,void 0,g.a.mark((function t(){var r;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.resolveName(e);case 2:return null==(r=t.sent)&&qo.throwError("ENS name not configured",S.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName(".concat(JSON.stringify(e),")")}),t.abrupt("return",r);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"_getBlock",value:function(e,t){return Jo(this,void 0,void 0,g.a.mark((function r(){var n,i,o=this;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,e;case 4:if(e=r.sent,n=-128,i={includeTransactions:!!t},!Object(m.l)(e,32)){r.next=11;break}i.blockHash=e,r.next=23;break;case 11:return r.prev=11,r.t0=this.formatter,r.next=15,this._getBlockTag(e);case 15:r.t1=r.sent,i.blockTag=r.t0.blockTag.call(r.t0,r.t1),Object(m.l)(i.blockTag)&&(n=parseInt(i.blockTag.substring(2),16)),r.next=23;break;case 20:r.prev=20,r.t2=r.catch(11),qo.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e);case 23:return r.abrupt("return",Do((function(){return Jo(o,void 0,void 0,g.a.mark((function e(){var r,o,a,s,u;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.perform("getBlock",i);case 2:if(null!=(r=e.sent)){e.next=11;break}if(null==i.blockHash){e.next=7;break}if(null!=this._emitted["b:"+i.blockHash]){e.next=7;break}return e.abrupt("return",null);case 7:if(null==i.blockTag){e.next=10;break}if(!(n>this._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=32;break}o=null,a=0;case 14:if(!(ai.length)){t.next=24;break}return t.abrupt("return",null);case 24:return a=Pe(i.slice(0,o)),t.next=27,this.resolveName(a);case 27:if(t.sent==e){t.next=30;break}return t.abrupt("return",null);case 30:return t.abrupt("return",a);case 31:case"end":return t.stop()}}),t,this)})))}},{key:"perform",value:function(e,t){return qo.throwError(e+" not implemented",S.b.errors.NOT_IMPLEMENTED,{operation:e})}},{key:"_startEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_stopEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_addEventListener",value:function(e,t,r){var n=new $o(Wo(e),t,r);return this._events.push(n),this._startEvent(n),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,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&ua.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",S.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:o}),t}function la(e){return new Promise((function(t){setTimeout(t,e)}))}function ha(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 da(e){return e?e.toLowerCase():e}var pa={},va=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(e,n,i){var o;if(Object(v.a)(this,r),ua.checkNew(this instanceof r?this.constructor:void 0,r),o=t.call(this),e!==pa)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return N(Object(f.a)(o),"provider",n),null==i&&(i=0),"string"===typeof i?(N(Object(f.a)(o),"_address",o.provider.formatter.address(i)),N(Object(f.a)(o),"_index",null)):"number"===typeof i?(N(Object(f.a)(o),"_index",i),N(Object(f.a)(o),"_address",null)):ua.throwArgumentError("invalid address or index","addressOrIndex",i),o}return Object(y.a)(r,[{key:"connect",value:function(e){return ua.throwError("cannot alter JSON-RPC Signer connection",S.b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new ya(pa,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&&ua.throwError("unknown account #"+e._index,S.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),e.provider.formatter.address(t[e._index])}))}},{key:"sendUncheckedTransaction",value:function(e){var t=this;e=F(e);var r=this.getAddress().then((function(e){return e&&(e=e.toLowerCase()),e}));if(null==e.gasLimit){var n=F(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return j({tx:j(e),sender:r}).then((function(r){var n=r.tx,i=r.sender;null!=n.from?n.from.toLowerCase()!==i&&ua.throwArgumentError("from address mismatch","transaction",e):n.from=i;var o=t.provider.constructor.hexlifyTransaction(n,{from:!0});return t.provider.send("eth_sendTransaction",[o]).then((function(e){return e}),(function(e){return fa("sendTransaction",e,o)}))}))}},{key:"signTransaction",value:function(e){return ua.throwError("signing transactions is unsupported",S.b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(e){return sa(this,void 0,void 0,g.a.mark((function t(){var r,n,i=this;return g.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 r=t.sent,t.next=5,this.sendUncheckedTransaction(e);case 5:return n=t.sent,t.prev=6,t.next=9,Do((function(){return sa(i,void 0,void 0,g.a.mark((function e(){var t;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider.getTransaction(n);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,n,r));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=n,t.t0;case 16:case"end":return t.stop()}}),t,this,[[6,12]])})))}},{key:"signMessage",value:function(e){return sa(this,void 0,void 0,g.a.mark((function t(){var r,n;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"===typeof e?Me(e):e,t.next=3,this.getAddress();case 3:return n=t.sent,t.next=6,this.provider.send("eth_sign",[n.toLowerCase(),Object(m.i)(r)]);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"_signTypedData",value:function(e,t,r){return sa(this,void 0,void 0,g.a.mark((function n(){var i,o,a=this;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,sn.resolveNames(e,t,r,(function(e){return a.provider.resolveName(e)}));case 2:return i=n.sent,n.next=5,this.getAddress();case 5:return o=n.sent,n.next=8,this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(sn.getPayload(i.domain,t,i.value))]);case 8:return n.abrupt("return",n.sent);case 9:case"end":return n.stop()}}),n,this)})))}},{key:"unlock",value:function(e){return sa(this,void 0,void 0,g.a.mark((function t(){var r,n;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.provider,t.next=3,this.getAddress();case 3:return n=t.sent,t.abrupt("return",r.send("personal_unlockAccount",[n.toLowerCase(),e,null]));case 5:case"end":return t.stop()}}),t,this)})))}}]),r}(Jt),ya=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.apply(this,arguments)}return Object(y.a)(r,[{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(r){return t.provider.waitForTransaction(e,r)}}}))}}]),r}(va),ba={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0},ga=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(e,n){var i;Object(v.a)(this,r),ua.checkNew(this instanceof r?this.constructor:void 0,r);var o=n;return null==o&&(o=new Promise((function(e,t){setTimeout((function(){i.detectNetwork().then((function(t){e(t)}),(function(e){t(e)}))}),0)}))),i=t.call(this,o),e||(e=L(i.constructor,"defaultUrl")()),N(Object(f.a)(i),"connection","string"===typeof e?Object.freeze({url:e}):Object.freeze(F(e))),i._nextId=42,i}return Object(y.a)(r,[{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 sa(this,void 0,void 0,g.a.mark((function e(){var t,r;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,la(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 r=L(this.constructor,"getNetwork"),e.prev=21,e.abrupt("return",r(C.from(t).toNumber()));case 25:return e.prev=25,e.t2=e.catch(21),e.abrupt("return",ua.throwError("could not detect network",S.b.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e.t2}));case 28:return e.abrupt("return",ua.throwError("could not detect network",S.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 va(pa,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 r=this,n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:H(n),provider:this});var i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];var o=Bo(this.connection,JSON.stringify(n),ha).then((function(e){return r.emit("debug",{action:"response",request:n,response:e,provider:r}),e}),(function(e){throw r.emit("debug",{action:"response",error:e,request:n,provider:r}),e}));return i&&(this._cache[e]=o,setTimeout((function(){r._cache[e]=null}),0)),o}},{key:"prepareRequest",value:function(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[da(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[da(t.address),t.blockTag]];case"getCode":return["eth_getCode",[da(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[da(t.address),t.position,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",[L(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[L(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=da(t.filter.address)),["eth_getLogs",[t.filter]]}return null}},{key:"perform",value:function(e,t){return sa(this,void 0,void 0,g.a.mark((function r(){var n;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==(n=this.prepareRequest(e,t))&&ua.throwError(e+" not implemented",S.b.errors.NOT_IMPLEMENTED,{operation:e}),r.prev=2,r.next=5,this.send(n[0],n[1]);case 5:return r.abrupt("return",r.sent);case 8:return r.prev=8,r.t0=r.catch(2),r.abrupt("return",fa(e,r.t0,t));case 11:case"end":return r.stop()}}),r,this,[[2,8]])})))}},{key:"_startEvent",value:function(e){"pending"===e.tag&&this._startPending(),h(Object(l.a)(r.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(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;var n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return la(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((function(e){}))}(),r})).catch((function(e){}))}}},{key:"_stopEvent",value:function(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),h(Object(l.a)(r.prototype),"_stopEvent",this).call(this,e)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(e,t){var r=F(ba);if(t)for(var n in t)t[n]&&(r[n]=!0);U(e,r);var i={};return["gasLimit","gasPrice","type","nonce","value"].forEach((function(t){if(null!=e[t]){var r=Object(m.g)(e[t]);"gasLimit"===t&&(t="gas"),i[t]=r}})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=Object(m.i)(e[t]))})),e.accessList&&(i.accessList=cr(e.accessList)),i}}]),r}(aa),ma=null;try{if(null==(ma=WebSocket))throw new Error("inject please")}catch(Vs){var wa=new S.b(jo);ma=function(){wa.throwError("WebSockets not supported in this environment",S.b.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var ka=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Sa=new S.b(jo),Ea=1,_a=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(e,n){var i,o;Object(v.a)(this,r),"any"===n&&Sa.throwError("WebSocketProvider does not support 'any' network yet",S.b.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),(o=t.call(this,e,n))._pollingInterval=-1,o._wsReady=!1,N(Object(f.a)(o),"_websocket",new ma(o.connection.url)),N(Object(f.a)(o),"_requests",{}),N(Object(f.a)(o),"_subs",{}),N(Object(f.a)(o),"_subIds",{}),N(Object(f.a)(o),"_detectNetwork",h((i=Object(f.a)(o),Object(l.a)(r.prototype)),"detectNetwork",i).call(i)),o._websocket.onopen=function(){o._wsReady=!0,Object.keys(o._requests).forEach((function(e){o._websocket.send(o._requests[e].payload)}))},o._websocket.onmessage=function(e){var t=e.data,r=JSON.parse(t);if(null!=r.id){var n=String(r.id),i=o._requests[n];if(delete o._requests[n],void 0!==r.result)i.callback(null,r.result),o.emit("debug",{action:"response",request:JSON.parse(i.payload),response:r.result,provider:Object(f.a)(o)});else{var a=null;r.error?(N(a=new Error(r.error.message||"unknown error"),"code",r.error.code||null),N(a,"response",t)):a=new Error("unknown error"),i.callback(a,void 0),o.emit("debug",{action:"response",error:a,request:JSON.parse(i.payload),provider:Object(f.a)(o)})}}else if("eth_subscription"===r.method){var s=o._subs[r.params.subscription];s&&s.processFunc(r.params.result)}else console.warn("this should not happen")};var a=setInterval((function(){o.emit("poll")}),1e3);return a.unref&&a.unref(),o}return Object(y.a)(r,[{key:"detectNetwork",value:function(){return this._detectNetwork}},{key:"pollingInterval",get:function(){return 0},set:function(e){Sa.throwError("cannot set polling interval on WebSocketProvider",S.b.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}},{key:"resetEventsBlock",value:function(e){Sa.throwError("cannot reset events block on WebSocketProvider",S.b.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}},{key:"poll",value:function(){return ka(this,void 0,void 0,g.a.mark((function e(){return g.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&&Sa.throwError("cannot set polling on WebSocketProvider",S.b.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}},{key:"send",value:function(e,t){var r=this,n=Ea++;return new Promise((function(i,o){var a=JSON.stringify({method:e,params:t,id:n,jsonrpc:"2.0"});r.emit("debug",{action:"request",request:JSON.parse(a),provider:r}),r._requests[String(n)]={callback:function(e,t){return e?o(e):i(t)},payload:a},r._wsReady&&r._websocket.send(a)}))}},{key:"_subscribe",value:function(e,t,r){return ka(this,void 0,void 0,g.a.mark((function n(){var i,o,a=this;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==(i=this._subIds[e])&&(i=Promise.all(t).then((function(e){return a.send("eth_subscribe",e)})),this._subIds[e]=i),n.next=4,i;case 4:o=n.sent,this._subs[o]={tag:e,processFunc:r};case 6:case"end":return n.stop()}}),n,this)})))}},{key:"_startEvent",value:function(e){var t=this;switch(e.type){case"block":this._subscribe("block",["newHeads"],(function(e){var r=C.from(e.number).toNumber();t._emitted.block=r,t.emit("block",r)}));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(r){null==r.removed&&(r.removed=!1),t.emit(e.filter,t.formatter.filterLog(r))}));break;case"tx":var r=function(e){var r=e.hash;t.getTransactionReceipt(r).then((function(e){e&&t.emit(r,e)}))};r(e),this._subscribe("tx",["newHeads"],(function(e){t._events.filter((function(e){return"tx"===e.type})).forEach(r)}));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,r=e.tag;if("tx"===e.type){if(this._events.filter((function(e){return"tx"===e.type})).length)return;r="tx"}else if(this.listenerCount(e.event))return;var n=this._subIds[r];n&&(delete this._subIds[r],n.then((function(e){t._subs[e]&&(delete t._subs[e],t.send("eth_unsubscribe",[e]))})))}},{key:"destroy",value:function(){return ka(this,void 0,void 0,g.a.mark((function e(){var t=this;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._websocket.readyState!==ma.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"}}]),r}(ga),Aa=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},xa=new S.b(jo),Ta=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.apply(this,arguments)}return Object(y.a)(r,[{key:"detectNetwork",value:function(){var e=this,t=Object.create(null,{detectNetwork:{get:function(){return h(Object(l.a)(r.prototype),"detectNetwork",e)}}});return Aa(this,void 0,void 0,g.a.mark((function e(){var r;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(r=this.network)){e.next=7;break}return e.next=4,t.detectNetwork.call(this);case 4:(r=e.sent)||xa.throwError("no network detected",S.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(N(this,"_network",r),this.emit("network",r,null));case 7:return e.abrupt("return",r);case 8:case"end":return e.stop()}}),e,this)})))}}]),r}(ga),Ma=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(e,n){var i;Object(v.a)(this,r),xa.checkAbstract(this instanceof r?this.constructor:void 0,r),e=L(this instanceof r?this.constructor:void 0,"getNetwork")(e),n=L(this instanceof r?this.constructor:void 0,"getApiKey")(n);var o=L(this instanceof r?this.constructor:void 0,"getUrl")(e,n);return i=t.call(this,o,e),"string"===typeof n?N(Object(f.a)(i),"apiKey",n):null!=n&&Object.keys(n).forEach((function(e){N(Object(f.a)(i),e,n[e])})),i}return Object(y.a)(r,[{key:"_startPending",value:function(){xa.warn("WARNING: API provider does not support pending filters")}},{key:"isCommunityResource",value:function(){return!1}},{key:"getSigner",value:function(e){return xa.throwError("API provider does not support signing",S.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 xa.throwError("not implemented; sub-classes must override getUrl",S.b.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}]),r}(Ta),Ca=new S.b(jo),Oa="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",Ia=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(e,n){var i;Object(v.a)(this,r);var o=new Pa(e,n),a=o.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");return i=t.call(this,a,o.network),N(Object(f.a)(i),"apiKey",o.apiKey),i}return Object(y.a)(r,[{key:"isCommunityResource",value:function(){return this.apiKey===Oa}}]),r}(_a),Pa=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.apply(this,arguments)}return Object(y.a)(r,[{key:"isCommunityResource",value:function(){return this.apiKey===Oa}}],[{key:"getWebSocketProvider",value:function(e,t){return new Ia(e,t)}},{key:"getApiKey",value:function(e){return null==e?Oa:(e&&"string"!==typeof e&&Ca.throwArgumentError("invalid apiKey","apiKey",e),e)}},{key:"getUrl",value:function(e,t){var r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"ropsten":r="eth-ropsten.alchemyapi.io/v2/";break;case"rinkeby":r="eth-rinkeby.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.alchemyapi.io/v2/";break;case"kovan":r="eth-kovan.alchemyapi.io/v2/";break;default:Ca.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:function(e,r){return t===Oa&&Ho(),Promise.resolve(!0)}}}}]),r}(Ma),Ra=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Ba=new S.b(jo),Da=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(){return Object(v.a)(this,r),t.apply(this,arguments)}return Object(y.a)(r,[{key:"perform",value:function(e,t){var n=this,i=Object.create(null,{perform:{get:function(){return h(Object(l.a)(r.prototype),"perform",n)}}});return Ra(this,void 0,void 0,g.a.mark((function r(){var n;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("getBlockNumber"!==e){r.next=5;break}return r.next=3,i.perform.call(this,"getBlock",{blockTag:"latest"});case 3:return n=r.sent,r.abrupt("return",n.number);case 5:return r.abrupt("return",i.perform.call(this,e,t));case 6:case"end":return r.stop()}}),r,this)})))}}],[{key:"getApiKey",value:function(e){return null!=e&&Ba.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}},{key:"getUrl",value:function(e,t){var r=null;switch(e.name){case"homestead":r="https://cloudflare-eth.com/";break;default:Ba.throwArgumentError("unsupported network","network",arguments[0])}return r}}]),r}(Ma),Na=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},La=new S.b(jo);function ja(e){var t={};for(var r in e)if(null!=e[r]){var n=e[r];n={type:!0,gasLimit:!0,gasPrice:!0,nonce:!0,value:!0}[r]?Object(m.g)(Object(m.i)(n)):"accessList"===r?"["+cr(n).map((function(e){return'{address:"'.concat(e.address,'",storageKeys:["').concat(e.storageKeys.join('","'),'"]}')})).join(",")+"]":Object(m.i)(n),t[r]=n}return t}function Ua(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"OK"!=e.message){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 Fa(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 r=new Error("invalid response");throw r.result=JSON.stringify(e),r}if(e.error){var n=new Error(e.error.message||"unknown error");throw e.error.code&&(n.code=e.error.code),e.error.data&&(n.data=e.error.data),n}return e.result}function Ka(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}var za="9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB";function Va(e,t,r){if("call"===e&&t.code===S.b.errors.SERVER_ERROR){var n=t.error;if(n&&n.message.match("reverted")&&Object(m.l)(n.data))return n.data}var i=t.message;throw t.code===S.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/)&&La.throwError("insufficient funds for intrinsic transaction cost",S.b.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),i.match(/same hash was already imported|transaction nonce is too low/)&&La.throwError("nonce has already been used",S.b.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),i.match(/another transaction with same nonce/)&&La.throwError("replacement fee too low",S.b.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),i.match(/execution failed due to an exception/)&&La.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",S.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}var Ha=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(e,n){var i;return Object(v.a)(this,r),La.checkNew(this instanceof r?this.constructor:void 0,r),i=t.call(this,e),N(Object(f.a)(i),"baseUrl",i.getBaseUrl()),N(Object(f.a)(i),"apiKey",n||za),i}return Object(y.a)(r,[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io"}return La.throwArgumentError("unsupported network","network",name)}},{key:"getUrl",value:function(e,t){var r=Object.keys(t).reduce((function(e,r){var n=t[r];return null!=n&&(e+="&".concat(r,"=").concat(n)),e}),""),n=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(e).concat(r).concat(n)}},{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,r){return Na(this,void 0,void 0,g.a.mark((function n(){var i,o,a,s,u,c,f=this;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=r?this.getPostUrl():this.getUrl(e,t),o=r?this.getPostData(e,t):null,a="proxy"===e?Fa:Ua,this.emit("debug",{action:"request",request:i,provider:this}),s={url:i,throttleSlotInterval:1e3,throttleCallback:function(e,t){return f.isCommunityResource()&&Ho(),Promise.resolve(!0)}},u=null,o&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},u=Object.keys(o).map((function(e){return"".concat(e,"=").concat(o[e])})).join("&")),n.next=9,Bo(s,u,a||Fa);case 9:return c=n.sent,this.emit("debug",{action:"response",request:i,response:H(c),provider:this}),n.abrupt("return",c);case 12:case"end":return n.stop()}}),n,this)})))}},{key:"detectNetwork",value:function(){return Na(this,void 0,void 0,g.a.mark((function e(){return g.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 n=this,i=Object.create(null,{perform:{get:function(){return h(Object(l.a)(r.prototype),"perform",n)}}});return Na(this,void 0,void 0,g.a.mark((function r(){var n,o,a,s,u,c,f,l,h;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:r.t0=e,r.next="getBlockNumber"===r.t0?3:"getGasPrice"===r.t0?4:"getBalance"===r.t0?5:"getTransactionCount"===r.t0?6:"getCode"===r.t0?7:"getStorageAt"===r.t0?8:"sendTransaction"===r.t0?9:"getBlock"===r.t0?10:"getTransaction"===r.t0?13:"getTransactionReceipt"===r.t0?14:"call"===r.t0?15:"estimateGas"===r.t0?29:"getLogs"===r.t0?41:"getEtherPrice"===r.t0?65:72;break;case 3:return r.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"}));case 4:return r.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"}));case 5:return r.abrupt("return",this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag}));case 6:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag}));case 7:return r.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag}));case 8:return r.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag}));case 9:return r.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((function(e){return Va("sendTransaction",e,t.signedTransaction)})));case 10:if(!t.blockTag){r.next=12;break}return r.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 r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash}));case 14:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash}));case 15:if("latest"===t.blockTag){r.next=17;break}throw new Error("EtherscanProvider does not support blockTag for call");case 17:return(n=ja(t.transaction)).module="proxy",n.action="eth_call",r.prev=20,r.next=23,this.fetch("proxy",n,!0);case 23:return r.abrupt("return",r.sent);case 26:return r.prev=26,r.t1=r.catch(20),r.abrupt("return",Va("call",r.t1,t.transaction));case 29:return(o=ja(t.transaction)).module="proxy",o.action="eth_estimateGas",r.prev=32,r.next=35,this.fetch("proxy",o,!0);case 35:return r.abrupt("return",r.sent);case 38:return r.prev=38,r.t2=r.catch(32),r.abrupt("return",Va("estimateGas",r.t2,t.transaction));case 41:return a={action:"getLogs"},t.filter.fromBlock&&(a.fromBlock=Ka(t.filter.fromBlock)),t.filter.toBlock&&(a.toBlock=Ka(t.filter.toBlock)),t.filter.address&&(a.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&La.throwError("unsupported topic count",S.b.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length&&("string"===typeof(s=t.filter.topics[0])&&66===s.length||La.throwError("unsupported topic format",S.b.errors.UNSUPPORTED_OPERATION,{topic0:s}),a.topic0=s)),r.next=48,this.fetch("logs",a);case 48:u=r.sent,c={},f=0;case 51:if(!(f0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}var qa=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Ga=new S.b(jo);function Xa(){return(new Date).getTime()}function Wa(e){for(var t=null,r=0;rt?null:(n+i)/2}function Ya(e){if(null===e)return"null";if("number"===typeof e||"boolean"===typeof e)return JSON.stringify(e);if("string"===typeof e)return e;if(C.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((function(e){return Ya(e)})));if("object"===typeof e){var t=Object.keys(e);return t.sort(),"{"+t.map((function(t){var r=e[t];return r="function"===typeof r?"[function]":Ya(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}var Qa=1;function $a(e){var t=null,r=null,n=new Promise((function(n){t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return n},wait:function(e){return n=n.then(e)}}}var es=[S.b.errors.CALL_EXCEPTION,S.b.errors.INSUFFICIENT_FUNDS,S.b.errors.NONCE_EXPIRED,S.b.errors.REPLACEMENT_UNDERPRICED,S.b.errors.UNPREDICTABLE_GAS_LIMIT],ts=["address","args","errorArgs","errorSignature","method","transaction"];function rs(e,t){var r={weight:e.weight};return Object.defineProperty(r,"provider",{get:function(){return e.provider}}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function ns(e,t,r){var n=Ya;switch(t){case"getBlockNumber":return function(t){var r=t.map((function(e){return e.result})),n=Za(t.map((function(e){return e.result})),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),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 Za(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":n=function(e){return null==e?null:((e=F(e)).confirmations=-1,Ya(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=F(e)).transactions=e.transactions.map((function(e){return(e=F(e)).confirmations=-1,e})),Ya(e))}:function(e){return null==e?null:Ya(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){var n={};r.forEach((function(t){var r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++}));for(var i=Object.keys(n),o=0;o=t)return a.result}}}(n,e.quorum)}function is(e,t){return qa(this,void 0,void 0,g.a.mark((function r(){var n;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(null!=(n=e.provider).blockNumber&&n.blockNumber>=t||-1===t)){r.next=3;break}return r.abrupt("return",n);case 3:return r.abrupt("return",Do((function(){return new Promise((function(r,i){setTimeout((function(){return n.blockNumber>=t?r(n):e.cancelled?r(null):r(void 0)}),0)}))}),{oncePoll:n}));case 4:case"end":return r.stop()}}),r)})))}function os(e,t,r,n){return qa(this,void 0,void 0,g.a.mark((function i(){var o,a;return g.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:o=e.provider,i.t0=r,i.next="getBlockNumber"===i.t0||"getGasPrice"===i.t0?4:"getEtherPrice"===i.t0?5:"getBalance"===i.t0||"getTransactionCount"===i.t0||"getCode"===i.t0?8:"getStorageAt"===i.t0?13:"getBlock"===i.t0?18:"call"===i.t0||"estimateGas"===i.t0?23:"getTransaction"===i.t0||"getTransactionReceipt"===i.t0?28:"getLogs"===i.t0?29:35;break;case 4:return i.abrupt("return",o[r]());case 5:if(!o.getEtherPrice){i.next=7;break}return i.abrupt("return",o.getEtherPrice());case 7:return i.abrupt("break",35);case 8:if(!n.blockTag||!Object(m.l)(n.blockTag)){i.next=12;break}return i.next=11,is(e,t);case 11:o=i.sent;case 12:return i.abrupt("return",o[r](n.address,n.blockTag||"latest"));case 13:if(!n.blockTag||!Object(m.l)(n.blockTag)){i.next=17;break}return i.next=16,is(e,t);case 16:o=i.sent;case 17:return i.abrupt("return",o.getStorageAt(n.address,n.position,n.blockTag||"latest"));case 18:if(!n.blockTag||!Object(m.l)(n.blockTag)){i.next=22;break}return i.next=21,is(e,t);case 21:o=i.sent;case 22:return i.abrupt("return",o[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash));case 23:if(!n.blockTag||!Object(m.l)(n.blockTag)){i.next=27;break}return i.next=26,is(e,t);case 26:o=i.sent;case 27:return i.abrupt("return",o[r](n.transaction));case 28:return i.abrupt("return",o[r](n.transactionHash));case 29:if(!((a=n.filter).fromBlock&&Object(m.l)(a.fromBlock)||a.toBlock&&Object(m.l)(a.toBlock))){i.next=34;break}return i.next=33,is(e,t);case 33:o=i.sent;case 34:return i.abrupt("return",o.getLogs(a));case 35:return i.abrupt("return",Ga.throwError("unknown method error",S.b.errors.UNKNOWN_ERROR,{method:r,params:n}));case 36:case"end":return i.stop()}}),i)})))}var as=function(e){Object(d.a)(r,e);var t=Object(p.a)(r);function r(e,n){var i;Object(v.a)(this,r),Ga.checkNew(this instanceof r?this.constructor:void 0,r),0===e.length&&Ga.throwArgumentError("missing providers","providers",e);var o=e.map((function(e,t){if(Ft.isProvider(e)){var r=zo(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:r,priority:1})}var n=F(e);null==n.priority&&(n.priority=1),null==n.stallTimeout&&(n.stallTimeout=zo(e)?2e3:750),null==n.weight&&(n.weight=1);var i=n.weight;return(i%1||i>512||i<1)&&Ga.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),i),Object.freeze(n)})),a=o.reduce((function(e,t){return e+t.weight}),0);null==n?n=a/2:n>a&&Ga.throwArgumentError("quorum will always fail; larger than total weight","quorum",n);var s=Wa(o.map((function(e){return e.provider.network})));return null==s&&(s=new Promise((function(e,t){setTimeout((function(){i.detectNetwork().then(e,t)}),0)}))),i=t.call(this,s),N(Object(f.a)(i),"providerConfigs",Object.freeze(o)),N(Object(f.a)(i),"quorum",n),i._highestBlockNumber=-1,i}return Object(y.a)(r,[{key:"detectNetwork",value:function(){return qa(this,void 0,void 0,g.a.mark((function e(){var t;return g.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",Wa(t));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){return qa(this,void 0,void 0,g.a.mark((function r(){var n,i,o,a,s,u,c,f,l,h,d=this;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("sendTransaction"!==e){r.next=13;break}return r.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:n=r.sent,i=0;case 5:if(!(i=d.quorum)){r.next=19;break}if(void 0===(p=a(h))){r.next=15;break}return s.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),r.abrupt("return",{v:p});case 15:if(f){r.next=18;break}return r.next=18,$a(100).getPromise();case 18:f=!1;case 19:if(v=s.reduce((function(e,t){if(!t.done||null==t.error)return e;var r=t.error.code;return es.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{}),Object.keys(v).forEach((function(e){var t=v[e];if(!(t.weight256)throw new Error("invalid number type - "+e);return r&&(i=256),t=C.from(t).toTwos(i),Object(m.p)(t,i/8)}if(n=e.match(_s)){var o=parseInt(n[1]);if(String(o)!==n[1]||0===o||o>32)throw new Error("invalid bytes type - "+e);if(Object(m.a)(t).byteLength!==o)throw new Error("invalid value for "+e);return r?Object(m.a)((t+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):t}if((n=e.match(xs))&&Array.isArray(t)){var a=n[1];if(parseInt(n[2]||String(t.length))!=t.length)throw new Error("invalid value for "+e);var s=[];return t.forEach((function(e){s.push(Ts(a,e,!0))})),Object(m.b)(s)}throw new Error("invalid type - "+e)}function Ms(e,t){if(e.length!=t.length)throw new Error("type/value count mismatch");var r=[];return e.forEach((function(e,n){r.push(Ts(e,t[n]))})),Object(m.i)(Object(m.b)(r))}function Cs(e,t){return ee(Ms(e,t))}function Os(e,t){return pn(Ms(e,t))}function Is(e){var t=Me(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Object(m.i)(Object(m.b)([t,Qi]).slice(0,32))}function Ps(e){var t=Object(m.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 r=31;0===t[r-1];)r--;return Pe(t.slice(0,r))}var Rs=new S.b("units/5.3.0"),Bs=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Ds(e){var t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Rs.throwArgumentError("invalid value","value",e);var r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");var i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);for(var o=[];r.length;){if(r.length<=3){o.unshift(r);break}var a=r.length-3;o.unshift(r.substring(a)),r=r.substring(0,a)}return n+o.join(",")+i}function Ns(e,t){if("string"===typeof t){var r=Bs.indexOf(t);-1!==r&&(t=3*r)}return Nr(e,null!=t?t:18)}function Ls(e,t){if("string"!==typeof e&&Rs.throwArgumentError("value must be a string","value",e),"string"===typeof t){var r=Bs.indexOf(t);-1!==r&&(t=3*r)}return Lr(e,null!=t?t:18)}function js(e){return Ns(e,18)}function Us(e){return Ls(e,18)}var Fs="ethers/5.3.1",Ks=new S.b(Fs);try{var zs=window;null==zs._ethers&&(zs._ethers=u)}catch(Vs){}},function(e,t,r){"use strict";var n=r(73),i=r(12),o=r(1114),a=r(4),s=["xs","sm","md","lg","xl"];function u(e){var t=e.values,r=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,n=e.unit,o=void 0===n?"px":n,u=e.step,c=void 0===u?5:u,f=Object(i.a)(e,["values","unit","step"]);function l(e){var t="number"===typeof r[e]?r[e]:e;return"@media (min-width:".concat(t).concat(o,")")}function h(e,t){var n=s.indexOf(t);return n===s.length-1?l(e):"@media (min-width:".concat("number"===typeof r[e]?r[e]:e).concat(o,") and ")+"(max-width:".concat((-1!==n&&"number"===typeof r[s[n+1]]?r[s[n+1]]:t)-c/100).concat(o,")")}return Object(a.a)({keys:s,values:r,up:l,down:function(e){var t=s.indexOf(e)+1,n=r[s[t]];return t===s.length?l("xs"):"@media (max-width:".concat(("number"===typeof n&&t>0?n:e)-c/100).concat(o,")")},between:h,only:function(e){return h(e,e)},width:function(e){return r[e]}},f)}function c(e,t,r){var i;return Object(a.a)({gutters:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)({paddingLeft:t(2),paddingRight:t(2)},r,Object(n.a)({},e.up("sm"),Object(a.a)({paddingLeft:t(3),paddingRight:t(3)},r[e.up("sm")])))},toolbar:(i={minHeight:56},Object(n.a)(i,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(n.a)(i,e.up("sm"),{minHeight:64}),i)},r)}var f=r(519),l={black:"#000",white:"#fff"},h={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},d={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},p={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},v={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},y=r(233),b={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},g={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},m=r(59),w={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:l.white,default:h[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},k={text:{primary:l.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:h[800],default:"#303030"},action:{active:l.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function S(e,t,r,n){var i=n.light||n,o=n.dark||1.5*n;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:"light"===t?e.light=Object(m.d)(e.main,i):"dark"===t&&(e.dark=Object(m.a)(e.main,o)))}function E(e){var t=e.primary,r=void 0===t?{light:d[300],main:d[500],dark:d[700]}:t,n=e.secondary,s=void 0===n?{light:p.A200,main:p.A400,dark:p.A700}:n,u=e.error,c=void 0===u?{light:v[300],main:v[500],dark:v[700]}:u,E=e.warning,_=void 0===E?{light:y.a[300],main:y.a[500],dark:y.a[700]}:E,A=e.info,x=void 0===A?{light:b[300],main:b[500],dark:b[700]}:A,T=e.success,M=void 0===T?{light:g[300],main:g[500],dark:g[700]}:T,C=e.type,O=void 0===C?"light":C,I=e.contrastThreshold,P=void 0===I?3:I,R=e.tonalOffset,B=void 0===R?.2:R,D=Object(i.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function N(e){return Object(m.c)(e,k.text.primary)>=P?k.text.primary:w.text.primary}var L=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(a.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(f.a)(4,t));if("string"!==typeof e.main)throw new Error(Object(f.a)(5,JSON.stringify(e.main)));return S(e,"light",r,B),S(e,"dark",n,B),e.contrastText||(e.contrastText=N(e.main)),e},j={dark:k,light:w};return Object(o.a)(Object(a.a)({common:l,type:O,primary:L(r),secondary:L(s,"A400","A200","A700"),error:L(c),warning:L(_),info:L(x),success:L(M),grey:h,contrastThreshold:P,getContrastText:N,augmentColor:L,tonalOffset:B},j[O]),D)}function _(e){return Math.round(1e5*e)/1e5}var A={textTransform:"uppercase"},x='"Roboto", "Helvetica", "Arial", sans-serif';function T(e,t){var r="function"===typeof t?t(e):t,n=r.fontFamily,s=void 0===n?x:n,u=r.fontSize,c=void 0===u?14:u,f=r.fontWeightLight,l=void 0===f?300:f,h=r.fontWeightRegular,d=void 0===h?400:h,p=r.fontWeightMedium,v=void 0===p?500:p,y=r.fontWeightBold,b=void 0===y?700:y,g=r.htmlFontSize,m=void 0===g?16:g,w=r.allVariants,k=r.pxToRem,S=Object(i.a)(r,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var E=c/14,T=k||function(e){return"".concat(e/m*E,"rem")},M=function(e,t,r,n,i){return Object(a.a)({fontFamily:s,fontWeight:e,fontSize:T(t),lineHeight:r},s===x?{letterSpacing:"".concat(_(n/t),"em")}:{},i,w)},C={h1:M(l,96,1.167,-1.5),h2:M(l,60,1.2,-.5),h3:M(d,48,1.167,0),h4:M(d,34,1.235,.25),h5:M(d,24,1.334,0),h6:M(v,20,1.6,.15),subtitle1:M(d,16,1.75,.15),subtitle2:M(v,14,1.57,.1),body1:M(d,16,1.5,.15),body2:M(d,14,1.43,.15),button:M(v,14,1.75,.4,A),caption:M(d,12,1.66,.4),overline:M(d,12,2.66,1,A)};return Object(o.a)(Object(a.a)({htmlFontSize:m,pxToRem:T,round:_,fontFamily:s,fontSize:c,fontWeightLight:l,fontWeightRegular:d,fontWeightMedium:v,fontWeightBold:b},C),S,{clone:!1})}function M(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var C=["none",M(0,2,1,-1,0,1,1,0,0,1,3,0),M(0,3,1,-2,0,2,2,0,0,1,5,0),M(0,3,3,-2,0,3,4,0,0,1,8,0),M(0,2,4,-1,0,4,5,0,0,1,10,0),M(0,3,5,-1,0,5,8,0,0,1,14,0),M(0,3,5,-1,0,6,10,0,0,1,18,0),M(0,4,5,-2,0,7,10,1,0,2,16,1),M(0,5,5,-3,0,8,10,1,0,3,14,2),M(0,5,6,-3,0,9,12,1,0,3,16,2),M(0,6,6,-3,0,10,14,1,0,4,18,3),M(0,6,7,-4,0,11,15,1,0,4,20,3),M(0,7,8,-4,0,12,17,2,0,5,22,4),M(0,7,8,-4,0,13,19,2,0,5,24,4),M(0,7,9,-4,0,14,21,2,0,5,26,4),M(0,8,9,-5,0,15,22,2,0,6,28,5),M(0,8,10,-5,0,16,24,2,0,6,30,5),M(0,8,11,-5,0,17,26,2,0,6,32,5),M(0,9,11,-5,0,18,28,2,0,7,34,6),M(0,9,12,-6,0,19,29,2,0,7,36,6),M(0,10,13,-6,0,20,31,3,0,8,38,7),M(0,10,13,-6,0,21,33,3,0,8,40,7),M(0,10,14,-6,0,22,35,3,0,8,42,7),M(0,11,14,-7,0,23,36,3,0,9,44,8),M(0,11,15,-7,0,24,38,3,0,9,46,8)],O={borderRadius:4},I=r(147),P=(r(102),r(121));r(24);var R=function(e,t){return t?Object(o.a)(e,t,{clone:!1}):e},B={xs:0,sm:600,md:960,lg:1280,xl:1920},D={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(B[e],"px)")}};var N={m:"margin",p:"padding"},L={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},j={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},U=function(e){var t={};return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}((function(e){if(e.length>2){if(!j[e])return[e];e=j[e]}var t=e.split(""),r=Object(I.a)(t,2),n=r[0],i=r[1],o=N[n],a=L[i]||"";return Array.isArray(a)?a.map((function(e){return o+e})):[o+a]})),F=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function K(e){var t=e.spacing||8;return"number"===typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"===typeof t?t:function(){}}function z(e,t){return function(r){return e.reduce((function(e,n){return e[n]=function(e,t){if("string"===typeof t||null==t)return t;var r=e(Math.abs(t));return t>=0?r:"number"===typeof r?-r:"-".concat(r)}(t,r),e}),{})}}function V(e){var t=K(e.theme);return Object.keys(e).map((function(r){if(-1===F.indexOf(r))return null;var n=z(U(r),t),i=e[r];return function(e,t,r){if(Array.isArray(t)){var n=e.theme.breakpoints||D;return t.reduce((function(e,i,o){return e[n.up(n.keys[o])]=r(t[o]),e}),{})}if("object"===Object(P.a)(t)){var i=e.theme.breakpoints||D;return Object.keys(t).reduce((function(e,n){return e[i.up(n)]=r(t[n]),e}),{})}return r(t)}(e,i,n)})).reduce(R,{})}V.propTypes={},V.filterProps=F;function H(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=K({spacing:e}),r=function(){for(var e=arguments.length,r=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.duration,n=void 0===r?q.standard:r,o=t.easing,a=void 0===o?J.easeInOut:o,s=t.delay,u=void 0===s?0:s;Object(i.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof n?n:G(n)," ").concat(a," ").concat("string"===typeof u?u:G(u))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}},W=r(231);t.a=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,r=void 0===t?{}:t,n=e.mixins,a=void 0===n?{}:n,s=e.palette,f=void 0===s?{}:s,l=e.spacing,h=e.typography,d=void 0===h?{}:h,p=Object(i.a)(e,["breakpoints","mixins","palette","spacing","typography"]),v=E(f),y=u(r),b=H(l),g=Object(o.a)({breakpoints:y,direction:"ltr",mixins:c(y,b,a),overrides:{},palette:v,props:{},shadows:C,typography:T(v,d),spacing:b,shape:O,transitions:X,zIndex:W.a},p),m=arguments.length,w=new Array(m>1?m-1:0),k=1;k0&&Math.abs((e.outerHeightStyle||0)-l)>1||e.overflow!==h)?(E.current+=1,{overflow:h,outerHeightStyle:l}):e}))}),[s,g,e.placeholder]);a.useEffect((function(){var e=Object(d.a)((function(){E.current=0,T()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[T]),v((function(){T()})),a.useEffect((function(){E.current=0}),[l]);return a.createElement(a.Fragment,null,a.createElement("textarea",Object(i.a)({value:l,onChange:function(e){E.current=0,m||T(),r&&r(e)},ref:k,rows:g,style:Object(i.a)({height:A.outerHeightStyle,overflow:A.overflow?"hidden":null},f)},b)),a.createElement("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:S,tabIndex:-1,style:Object(i.a)({},y,f)}))})),g=r(125),m="undefined"===typeof window?a.useEffect:a.useLayoutEffect,w=a.forwardRef((function(e,t){var r=e["aria-describedby"],f=e.autoComplete,d=e.autoFocus,p=e.classes,v=e.className,y=(e.color,e.defaultValue),w=e.disabled,k=e.endAdornment,S=(e.error,e.fullWidth),E=void 0!==S&&S,_=e.id,A=e.inputComponent,x=void 0===A?"input":A,T=e.inputProps,M=void 0===T?{}:T,C=e.inputRef,O=(e.margin,e.multiline),I=void 0!==O&&O,P=e.name,R=e.onBlur,B=e.onChange,D=e.onClick,N=e.onFocus,L=e.onKeyDown,j=e.onKeyUp,U=e.placeholder,F=e.readOnly,K=e.renderSuffix,z=e.rows,V=e.rowsMax,H=e.rowsMin,J=e.startAdornment,q=e.type,G=void 0===q?"text":q,X=e.value,W=Object(n.a)(e,["aria-describedby","autoComplete","autoFocus","classes","className","color","defaultValue","disabled","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","rowsMax","rowsMin","startAdornment","type","value"]),Z=null!=M.value?M.value:X,Y=a.useRef(null!=Z).current,Q=a.useRef(),$=a.useCallback((function(e){0}),[]),ee=Object(h.a)(M.ref,$),te=Object(h.a)(C,ee),re=Object(h.a)(Q,te),ne=a.useState(!1),ie=ne[0],oe=ne[1],ae=Object(c.b)();var se=Object(u.a)({props:e,muiFormControl:ae,states:["color","disabled","error","hiddenLabel","margin","required","filled"]});se.focused=ae?ae.focused:ie,a.useEffect((function(){!ae&&w&&ie&&(oe(!1),R&&R())}),[ae,w,ie,R]);var ue=ae&&ae.onFilled,ce=ae&&ae.onEmpty,fe=a.useCallback((function(e){Object(g.b)(e)?ue&&ue():ce&&ce()}),[ue,ce]);m((function(){Y&&fe({value:Z})}),[Z,fe,Y]);a.useEffect((function(){fe(Q.current)}),[]);var le=x,he=Object(i.a)({},M,{ref:re});"string"!==typeof le?he=Object(i.a)({inputRef:re,type:G},he,{ref:null}):I?!z||V||H?(he=Object(i.a)({rows:z,rowsMax:V},he),le=b):le="textarea":he=Object(i.a)({type:G},he);return a.useEffect((function(){ae&&ae.setAdornedStart(Boolean(J))}),[ae,J]),a.createElement("div",Object(i.a)({className:Object(s.a)(p.root,p["color".concat(Object(l.a)(se.color||"primary"))],v,se.disabled&&p.disabled,se.error&&p.error,E&&p.fullWidth,se.focused&&p.focused,ae&&p.formControl,I&&p.multiline,J&&p.adornedStart,k&&p.adornedEnd,"dense"===se.margin&&p.marginDense),onClick:function(e){Q.current&&e.currentTarget===e.target&&Q.current.focus(),D&&D(e)},ref:t},W),J,a.createElement(c.a.Provider,{value:null},a.createElement(le,Object(i.a)({"aria-invalid":se.error,"aria-describedby":r,autoComplete:f,autoFocus:d,defaultValue:y,disabled:se.disabled,id:_,onAnimationStart:function(e){fe("mui-auto-fill-cancel"===e.animationName?Q.current:{value:"x"})},name:P,placeholder:U,readOnly:F,required:se.required,rows:z,value:Z,onKeyDown:L,onKeyUp:j},he,{className:Object(s.a)(p.input,M.className,se.disabled&&p.disabled,I&&p.inputMultiline,se.hiddenLabel&&p.inputHiddenLabel,J&&p.inputAdornedStart,k&&p.inputAdornedEnd,"search"===G&&p.inputTypeSearch,"dense"===se.margin&&p.inputMarginDense),onBlur:function(e){R&&R(e),M.onBlur&&M.onBlur(e),ae&&ae.onBlur?ae.onBlur(e):oe(!1)},onChange:function(e){if(!Y){var t=e.target||Q.current;if(null==t)throw new Error(Object(o.a)(1));fe({value:t.value})}for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i