diff --git a/apps/axelar/dynamicWidget/.Rbuildignore b/apps/axelar/dynamicWidget/.Rbuildignore new file mode 100644 index 0000000..014dbd3 --- /dev/null +++ b/apps/axelar/dynamicWidget/.Rbuildignore @@ -0,0 +1,6 @@ +^node_modules$ +^srcjs$ +^app\.R$ +^package\.json$ +^webpack\.config\.js$ +^yarn\.lock$ diff --git a/apps/axelar/dynamicWidget/.gitignore b/apps/axelar/dynamicWidget/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/apps/axelar/dynamicWidget/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/apps/axelar/dynamicWidget/DESCRIPTION b/apps/axelar/dynamicWidget/DESCRIPTION new file mode 100644 index 0000000..b9b42e4 --- /dev/null +++ b/apps/axelar/dynamicWidget/DESCRIPTION @@ -0,0 +1,16 @@ +Package: dynamicWidget +Title: What the Package Does (One Line, Title Case) +Version: 0.0.0.9000 +Authors@R: + person("First", "Last", , "first.last@example.com", role = c("aut", "cre"), + comment = c(ORCID = "YOUR-ORCID-ID")) +Description: What the package does (one paragraph). +License: `use_mit_license()`, `use_gpl3_license()` or friends to pick a + license +Encoding: UTF-8 +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.2.3 +Imports: + htmltools, + reactR, + shiny diff --git a/apps/axelar/dynamicWidget/NAMESPACE b/apps/axelar/dynamicWidget/NAMESPACE new file mode 100644 index 0000000..9276517 --- /dev/null +++ b/apps/axelar/dynamicWidget/NAMESPACE @@ -0,0 +1,7 @@ +# Generated by roxygen2: do not edit by hand + +export(dynamic_buttonInput) +export(updateDynamic_buttonInput) +importFrom(htmltools,htmlDependency) +importFrom(htmltools,tags) +importFrom(reactR,createReactShinyInput) diff --git a/apps/axelar/dynamicWidget/R/dynamic_button.R b/apps/axelar/dynamicWidget/R/dynamic_button.R new file mode 100644 index 0000000..08845d6 --- /dev/null +++ b/apps/axelar/dynamicWidget/R/dynamic_button.R @@ -0,0 +1,34 @@ +#' Dynamic Button +#' +#' React Button for multi-wallet connect using Dynamic SDK +#' +#' @importFrom reactR createReactShinyInput +#' @importFrom htmltools htmlDependency tags +#' +#' @export +dynamic_buttonInput <- function(inputId) { + reactR::createReactShinyInput( + inputId, + "dynamic_button", + htmltools::htmlDependency( + name = "dynamic_button-input", + version = "1.0.0", + src = "www/dynamicWidget/dynamic_button", + package = "dynamicWidget", + script = "dynamic_button.js" + ), + "", + list(), htmltools::tags$div + ) +} + +#' Dyanamic Button +#' +#' React Button for multi-wallet connect using Dynamic SDK +#' +#' @export +updateDynamic_buttonInput <- function(session, inputId, value, configuration = NULL) { + message <- list(value = value) + if (!is.null(configuration)) message$configuration <- configuration + session$sendInputMessage(inputId, message) +} diff --git a/apps/axelar/dynamicWidget/README.md b/apps/axelar/dynamicWidget/README.md new file mode 100644 index 0000000..e557562 --- /dev/null +++ b/apps/axelar/dynamicWidget/README.md @@ -0,0 +1,58 @@ +## setup: + +1. Install R and dependencies + +``` +brew install R +brew install libgit2 +brew install freetype +brew install harfbuzz fribidi +brew install libtiff +``` + + +2. Install required packages by running + + ``` + Rscript setup.R + ``` + +3. in the terminal create an R project with react? + +``` +~ R +> path <- file.path(getwd(), "flowAttestR") +> usethis::create_package(path) +> reactR::scaffoldReactShinyInput( + "wallet_connect", + list( + "reactstrap" = "^8.9.0" + ) +) +> quit() +Save workspace image? [y/n/c]: n +yarn install + +``` +## "exporting" + +R doesn't call it that but that's what we're doing + +``` + +cd +yarn run webpack --mode=development +R +devtools::document() +devtools::load_all() +-or- +devtools::install() +``` + + +## Running + +``` +cd + R -e "shiny::runApp('.')" +``` diff --git a/apps/axelar/dynamicWidget/app.R b/apps/axelar/dynamicWidget/app.R new file mode 100644 index 0000000..27dcb03 --- /dev/null +++ b/apps/axelar/dynamicWidget/app.R @@ -0,0 +1,16 @@ +library(shiny) +library(dynamicWidget) + +ui <- fluidPage( + titlePanel("reactR Input Example"), + dynamic_buttonInput("textInput"), + textOutput("textOutput") +) + +server <- function(input, output, session) { + output$textOutput <- renderText({ + sprintf("You entered: %s", input$textInput) + }) +} + +shinyApp(ui, server) diff --git a/apps/axelar/dynamicWidget/inst/www/dynamicWidget/dynamic_button/dynamic_button.js b/apps/axelar/dynamicWidget/inst/www/dynamicWidget/dynamic_button/dynamic_button.js new file mode 100644 index 0000000..cb45cb0 --- /dev/null +++ b/apps/axelar/dynamicWidget/inst/www/dynamicWidget/dynamic_button/dynamic_button.js @@ -0,0 +1,199 @@ +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1147)}([function(e,t,r){"use strict";e.exports=r(592)},function(e,t){e.exports=window.React},function(e,t,r){"use strict";r.r(t),r.d(t,"isBytesLike",(function(){return a})),r.d(t,"isBytes",(function(){return s})),r.d(t,"arrayify",(function(){return u})),r.d(t,"concat",(function(){return l})),r.d(t,"stripZeros",(function(){return f})),r.d(t,"zeroPad",(function(){return d})),r.d(t,"isHexString",(function(){return h})),r.d(t,"hexlify",(function(){return p})),r.d(t,"hexDataLength",(function(){return v})),r.d(t,"hexDataSlice",(function(){return b})),r.d(t,"hexConcat",(function(){return y})),r.d(t,"hexValue",(function(){return m})),r.d(t,"hexStripZeros",(function(){return g})),r.d(t,"hexZeroPad",(function(){return w})),r.d(t,"splitSignature",(function(){return _})),r.d(t,"joinSignature",(function(){return x}));var n=new(r(5).Logger)("bytes/5.7.0");function o(e){return!!e.toHexString}function i(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return i(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return h(e)&&!(e.length%2)||s(e)}function c(e){return"number"==typeof e&&e==e&&e%1==0}function s(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!c(e.length)||e.length<0)return!1;for(var t=0;t=256)return!1}return!0}function u(e,t){if(t||(t={}),"number"==typeof e){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),i(new Uint8Array(r))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),o(e)&&(e=e.toHexString()),h(e)){var a=e.substring(2);a.length%2&&("left"===t.hexPad?a="0"+a:"right"===t.hexPad?a+="0":n.throwArgumentError("hex data is odd-length","value",e));for(var c=[],u=0;ut&&n.throwArgumentError("value out of range","value",arguments[0]);var r=new Uint8Array(t);return r.set(e,t-e.length),i(r)}function h(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}function p(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid hexlify value");for(var r="";e;)r="0123456789abcdef"[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),o(e))return e.toHexString();if(h(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(s(e)){for(var i="0x",a=0;a>4]+"0123456789abcdef"[15&c]}return i}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 b(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 y(e){var t="0x";return e.forEach((function(e){t+=p(e).substring(2)})),t}function m(e){var t=g(p(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function g(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 _(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(e)){var r=u(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=p(r.slice(0,32)),t.s=p(r.slice(32,64))):65===r.length?(t.r=p(r.slice(0,32)),t.s=p(r.slice(32,64)),t.v=r[64]):n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=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 o=d(u(t._vs),32);t._vs=p(o);var i=o[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),o[0]&=127;var c=p(o);null==t.s?t.s=c:t.s!==c&&n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{var s=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==s&&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 l=u(t.s);l[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(l[0]|=128);var f=p(l);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.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function x(e){return p(l([(e=_(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},function(e,t,r){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)}var o=r(608)();e.exports=o;try{regeneratorRuntime=o}catch(e){"object"===("undefined"==typeof globalThis?"undefined":n(globalThis))?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},function(e,t,r){"use strict";r.r(t),r.d(t,"defineReadOnly",(function(){return l})),r.d(t,"getStatic",(function(){return f})),r.d(t,"resolveProperties",(function(){return d})),r.d(t,"checkProperties",(function(){return h})),r.d(t,"shallowCopy",(function(){return p})),r.d(t,"deepCopy",(function(){return y})),r.d(t,"Description",(function(){return m}));var n=r(5);function o(e,t){for(var r=0;r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function c(e){return(c="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)}var s=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function c(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,c)}s((n=n.apply(e,t||[])).next())}))},u=new n.Logger("properties/5.7.0");function l(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function f(e,t){for(var r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!==c(e.prototype))break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function d(e){return s(this,void 0,void 0,a().mark((function t(){var r,n;return 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 h(e,t){e&&"object"===c(e)||u.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((function(r){t[r]||u.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function p(e){var t={};for(var r in e)t[r]=e[r];return t}var v={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function b(e){if(function e(t){if(null==t||v[c(t)])return!0;if(Array.isArray(t)||"object"===c(t)){if(!Object.isFrozen(t))return!1;for(var r=Object.keys(t),n=0;nc[r]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n>4],r+=h[15&t[i]];o.push(e+"=Uint8Array(0x"+r+")")}else o.push(e+"="+JSON.stringify(t))}catch(t){o.push(e+"="+JSON.stringify(n[e].toString()))}})),o.push("code=".concat(r)),o.push("version=".concat(this.version));var i=t,c="";switch(r){case f.NUMERIC_FAULT:c="NUMERIC_FAULT";var s=t;switch(s){case"overflow":case"underflow":case"division-by-zero":c+="-"+s;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result"}break;case f.CALL_EXCEPTION:case f.INSUFFICIENT_FUNDS:case f.MISSING_NEW:case f.NONCE_EXPIRED:case f.REPLACEMENT_UNDERPRICED:case f.TRANSACTION_REPLACED:case f.UNPREDICTABLE_GAS_LIMIT:c=r}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);return u.reason=i,u.code=r,Object.keys(n).forEach((function(e){u[e]=n[e]})),u}},{key:"throwError",value:function(e,t,r){throw this.makeError(e,t,r)}},{key:"throwArgumentError",value:function(t,r,n){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:r,value:n})}},{key:"assert",value:function(e,t,r,n){e||this.throwError(t,r,n)}},{key:"assertArgument",value:function(e,t,r,n){e||this.throwArgumentError(t,r,n)}},{key:"checkNormalize",value:function(t){null==t&&(t="platform missing String.prototype.normalize"),d&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:d})}},{key:"checkSafeUint53",value:function(t,r){"number"==typeof t&&(null==r&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,r,n){n=n?": "+n:"",tr&&this.throwError("too many arguments"+n,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}},{key:"checkNew",value:function(t,r){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}},{key:"checkAbstract",value:function(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}}])&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();p.errors=f,p.levels=l},function(e,t,r){"use strict"; +/** + * Support for translating between Uint8Array instances and JavaScript + * native types. + * + * {@link module:Layout~Layout|Layout} is the basis of a class + * hierarchy that associates property names with sequences of encoded + * bytes. + * + * Layouts are supported for these scalar (numeric) types: + * * {@link module:Layout~UInt|Unsigned integers in little-endian + * format} with {@link module:Layout.u8|8-bit}, {@link + * module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit}, + * {@link module:Layout.u32|32-bit}, {@link + * module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit} + * representation ranges; + * * {@link module:Layout~UIntBE|Unsigned integers in big-endian + * format} with {@link module:Layout.u16be|16-bit}, {@link + * module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit}, + * {@link module:Layout.u40be|40-bit}, and {@link + * module:Layout.u48be|48-bit} representation ranges; + * * {@link module:Layout~Int|Signed integers in little-endian + * format} with {@link module:Layout.s8|8-bit}, {@link + * module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit}, + * {@link module:Layout.s32|32-bit}, {@link + * module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit} + * representation ranges; + * * {@link module:Layout~IntBE|Signed integers in big-endian format} + * with {@link module:Layout.s16be|16-bit}, {@link + * module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit}, + * {@link module:Layout.s40be|40-bit}, and {@link + * module:Layout.s48be|48-bit} representation ranges; + * * 64-bit integral values that decode to an exact (if magnitude is + * less than 2^53) or nearby integral Number in {@link + * module:Layout.nu64|unsigned little-endian}, {@link + * module:Layout.nu64be|unsigned big-endian}, {@link + * module:Layout.ns64|signed little-endian}, and {@link + * module:Layout.ns64be|unsigned big-endian} encodings; + * * 32-bit floating point values with {@link + * module:Layout.f32|little-endian} and {@link + * module:Layout.f32be|big-endian} representations; + * * 64-bit floating point values with {@link + * module:Layout.f64|little-endian} and {@link + * module:Layout.f64be|big-endian} representations; + * * {@link module:Layout.const|Constants} that take no space in the + * encoded expression. + * + * and for these aggregate types: + * * {@link module:Layout.seq|Sequence}s of instances of a {@link + * module:Layout~Layout|Layout}, with JavaScript representation as + * an Array and constant or data-dependent {@link + * module:Layout~Sequence#count|length}; + * * {@link module:Layout.struct|Structure}s that aggregate a + * heterogeneous sequence of {@link module:Layout~Layout|Layout} + * instances, with JavaScript representation as an Object; + * * {@link module:Layout.union|Union}s that support multiple {@link + * module:Layout~VariantLayout|variant layouts} over a fixed + * (padded) or variable (not padded) span of bytes, using an + * unsigned integer at the start of the data or a separate {@link + * module:Layout.unionLayoutDiscriminator|layout element} to + * determine which layout to use when interpreting the buffer + * contents; + * * {@link module:Layout.bits|BitStructure}s that contain a sequence + * of individual {@link + * module:Layout~BitStructure#addField|BitField}s packed into an 8, + * 16, 24, or 32-bit unsigned integer starting at the least- or + * most-significant bit; + * * {@link module:Layout.cstr|C strings} of varying length; + * * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link + * module:Layout~Blob#length|length} raw data. + * + * All {@link module:Layout~Layout|Layout} instances are immutable + * after construction, to prevent internal state from becoming + * inconsistent. + * + * @local Layout + * @local ExternalLayout + * @local GreedyCount + * @local OffsetLayout + * @local UInt + * @local UIntBE + * @local Int + * @local IntBE + * @local NearUInt64 + * @local NearUInt64BE + * @local NearInt64 + * @local NearInt64BE + * @local Float + * @local FloatBE + * @local Double + * @local DoubleBE + * @local Sequence + * @local Structure + * @local UnionDiscriminator + * @local UnionLayoutDiscriminator + * @local Union + * @local VariantLayout + * @local BitStructure + * @local BitField + * @local Boolean + * @local Blob + * @local CString + * @local Constant + * @local bindConstructorLayout + * @module Layout + * @license MIT + * @author Peter A. Bigot + * @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub} + */function n(){return(n="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=o(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function o(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}function i(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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 i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);rthis.span)throw new RangeError("indeterminate span");return this.span}},{key:"replicate",value:function(e){var t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}},{key:"fromArray",value:function(e){}}]),e}();function _(e,t){return t.property?e+"["+t.property+"]":e}t.Layout=w,t.nameWithProperty=_,t.bindConstructorLayout=function(e,t){if("function"!=typeof e)throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(e,"layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof w))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(t,"boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=function(){return new e},Object.defineProperty(e.prototype,"encode",{value:function(e,r){return t.encode(this,e,r)},writable:!0}),Object.defineProperty(e,"decode",{value:function(e,r){return t.decode(e,r)},writable:!0})};var x=function(e){c(r,e);var t=u(r);function r(){return p(this,r),t.apply(this,arguments)}return b(r,[{key:"isCount",value:function(){throw new Error("ExternalLayout is abstract")}}]),r}(w);t.ExternalLayout=x;var k=function(e){c(r,e);var t=u(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,o=arguments.length>1?arguments[1]:void 0;if(p(this,r),!Number.isInteger(n)||0>=n)throw new TypeError("elementSpan must be a (positive) integer");return(e=t.call(this,-1,o)).elementSpan=n,e}return b(r,[{key:"isCount",value:function(){return!0}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;m(e);var r=e.length-t;return Math.floor(r/this.elementSpan)}},{key:"encode",value:function(e,t,r){return 0}}]),r}(x);t.GreedyCount=k;var O=function(e){c(r,e);var t=u(r);function r(e){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0;if(p(this,r),!(e instanceof w))throw new TypeError("layout must be a Layout");if(!Number.isInteger(o))throw new TypeError("offset must be integer or undefined");return(n=t.call(this,e.span,i||e.property)).layout=e,n.offset=o,n}return b(r,[{key:"isCount",value:function(){return this.layout instanceof S||this.layout instanceof E}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.layout.decode(e,t+this.offset)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.layout.encode(e,t,r+this.offset)}}]),r}(x);t.OffsetLayout=O;var S=function(e){c(r,e);var t=u(r);function r(e,n){var o;if(p(this,r),6<(o=t.call(this,e,n)).span)throw new RangeError("span must not exceed 6 bytes");return o}return b(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return g(e).readUIntLE(t,this.span)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return g(t).writeUIntLE(e,r,this.span),this.span}}]),r}(w);t.UInt=S;var E=function(e){c(r,e);var t=u(r);function r(e,n){var o;if(p(this,r),6<(o=t.call(this,e,n)).span)throw new RangeError("span must not exceed 6 bytes");return o}return b(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return g(e).readUIntBE(t,this.span)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return g(t).writeUIntBE(e,r,this.span),this.span}}]),r}(w);t.UIntBE=E;var j=function(e){c(r,e);var t=u(r);function r(e,n){var o;if(p(this,r),6<(o=t.call(this,e,n)).span)throw new RangeError("span must not exceed 6 bytes");return o}return b(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return g(e).readIntLE(t,this.span)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return g(t).writeIntLE(e,r,this.span),this.span}}]),r}(w);t.Int=j;var I=function(e){c(r,e);var t=u(r);function r(e,n){var o;if(p(this,r),6<(o=t.call(this,e,n)).span)throw new RangeError("span must not exceed 6 bytes");return o}return b(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return g(e).readIntBE(t,this.span)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return g(t).writeIntBE(e,r,this.span),this.span}}]),r}(w);t.IntBE=I;var P=Math.pow(2,32);function A(e){var t=Math.floor(e/P);return{hi32:t,lo32:e-t*P}}function N(e,t){return e*P+t}var T=function(e){c(r,e);var t=u(r);function r(e){return p(this,r),t.call(this,8,e)}return b(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=g(e),n=r.readUInt32LE(t),o=r.readUInt32LE(t+4);return N(o,n)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=A(e),o=g(t);return o.writeUInt32LE(n.lo32,r),o.writeUInt32LE(n.hi32,r+4),8}}]),r}(w);t.NearUInt64=T;var R=function(e){c(r,e);var t=u(r);function r(e){return p(this,r),t.call(this,8,e)}return b(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=g(e),n=r.readUInt32BE(t),o=r.readUInt32BE(t+4);return N(n,o)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=A(e),o=g(t);return o.writeUInt32BE(n.hi32,r),o.writeUInt32BE(n.lo32,r+4),8}}]),r}(w);t.NearUInt64BE=R;var M=function(e){c(r,e);var t=u(r);function r(e){return p(this,r),t.call(this,8,e)}return b(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=g(e),n=r.readUInt32LE(t),o=r.readInt32LE(t+4);return N(o,n)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=A(e),o=g(t);return o.writeUInt32LE(n.lo32,r),o.writeInt32LE(n.hi32,r+4),8}}]),r}(w);t.NearInt64=M;var C=function(e){c(r,e);var t=u(r);function r(e){return p(this,r),t.call(this,8,e)}return b(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=g(e),n=r.readInt32BE(t),o=r.readUInt32BE(t+4);return N(n,o)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=A(e),o=g(t);return o.writeInt32BE(n.hi32,r),o.writeUInt32BE(n.lo32,r+4),8}}]),r}(w);t.NearInt64BE=C;var L=function(e){c(r,e);var t=u(r);function r(e){return p(this,r),t.call(this,4,e)}return b(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return g(e).readFloatLE(t)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return g(t).writeFloatLE(e,r),4}}]),r}(w);t.Float=L;var B=function(e){c(r,e);var t=u(r);function r(e){return p(this,r),t.call(this,4,e)}return b(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return g(e).readFloatBE(t)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return g(t).writeFloatBE(e,r),4}}]),r}(w);t.FloatBE=B;var F=function(e){c(r,e);var t=u(r);function r(e){return p(this,r),t.call(this,8,e)}return b(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return g(e).readDoubleLE(t)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return g(t).writeDoubleLE(e,r),8}}]),r}(w);t.Double=F;var D=function(e){c(r,e);var t=u(r);function r(e){return p(this,r),t.call(this,8,e)}return b(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return g(e).readDoubleBE(t)}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return g(t).writeDoubleBE(e,r),8}}]),r}(w);t.DoubleBE=D;var U=function(e){c(r,e);var t=u(r);function r(e,n,o){var i;if(p(this,r),!(e instanceof w))throw new TypeError("elementLayout must be a Layout");if(!(n instanceof x&&n.isCount()||Number.isInteger(n)&&0<=n))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");var a=-1;return!(n instanceof x)&&01&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var r=0,n=this.count;if(n instanceof x&&(n=n.decode(e,t)),01&&void 0!==arguments[1]?arguments[1]:0,r=[],n=0,o=this.count;for(o instanceof x&&(o=o.decode(e,t));n2&&void 0!==arguments[2]?arguments[2]:0,n=this.elementLayout,o=e.reduce((function(e,o){return e+n.encode(o,t,r+e)}),0);return this.count instanceof x&&this.count.encode(e.length,t,r),o}}]),r}(w);t.Sequence=U;var z=function(e){c(r,e);var t=u(r);function r(e,n,o){var a;if(p(this,r),!Array.isArray(e)||!e.reduce((function(e,t){return e&&t instanceof w}),!0))throw new TypeError("fields must be array of Layout instances");"boolean"==typeof n&&void 0===o&&(o=n,n=void 0);var c,s=i(e);try{for(s.s();!(c=s.n()).done;){var u=c.value;if(0>u.span&&void 0===u.property)throw new Error("fields cannot contain unnamed variable-length layout")}}catch(e){s.e(e)}finally{s.f()}var l=-1;try{l=e.reduce((function(e,t){return e+t.getSpan()}),0)}catch(e){}return(a=t.call(this,l,n)).fields=e,a.decodePrefixes=!!o,a}return b(r,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var r=0;try{r=this.fields.reduce((function(r,n){var o=n.getSpan(e,t);return t+=o,r+o}),0)}catch(e){throw new RangeError("indeterminate span")}return r}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;m(e);var r,n=this.makeDestinationObject(),o=i(this.fields);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(void 0!==a.property&&(n[a.property]=a.decode(e,t)),t+=a.getSpan(e,t),this.decodePrefixes&&e.length===t)break}}catch(e){o.e(e)}finally{o.f()}return n}},{key:"encode",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=n,a=0,c=0,s=i(this.fields);try{for(s.s();!(r=s.n()).done;){var u=r.value,l=u.span;if(c=0l&&(l=u.getSpan(t,n)))}a=n,n+=l}}catch(e){s.e(e)}finally{s.f()}return a+c-o}},{key:"fromArray",value:function(e){var t,r=this.makeDestinationObject(),n=i(this.fields);try{for(n.s();!(t=n.n()).done;){var o=t.value;void 0!==o.property&&0o.span?r=-1:0<=r&&(r+=o.span)}}catch(e){n.e(e)}finally{n.f()}}}]),r}(w);t.Structure=z;var W=function(){function e(t){p(this,e),this.property=t}return b(e,[{key:"decode",value:function(e,t){throw new Error("UnionDiscriminator is abstract")}},{key:"encode",value:function(e,t,r){throw new Error("UnionDiscriminator is abstract")}}]),e}();t.UnionDiscriminator=W;var q=function(e){c(r,e);var t=u(r);function r(e,n){var o;if(p(this,r),!(e instanceof x&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");return(o=t.call(this,n||e.property||"variant")).layout=e,o}return b(r,[{key:"decode",value:function(e,t){return this.layout.decode(e,t)}},{key:"encode",value:function(e,t,r){return this.layout.encode(e,t,r)}}]),r}(W);t.UnionLayoutDiscriminator=q;var G=function(e){c(r,e);var t=u(r);function r(e,n,o){var i,a;if(p(this,r),e instanceof S||e instanceof E)a=new q(new O(e));else if(e instanceof x&&e.isCount())a=new q(e);else{if(!(e instanceof W))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");a=e}if(void 0===n&&(n=null),!(null===n||n instanceof w))throw new TypeError("defaultLayout must be null or a Layout");if(null!==n){if(0>n.span)throw new Error("defaultLayout must have constant span");void 0===n.property&&(n=n.replicate("content"))}var c=-1;n&&0<=(c=n.span)&&(e instanceof S||e instanceof E)&&(c+=a.layout.span),(i=t.call(this,c,o)).discriminator=a,i.usesPrefixDiscriminator=e instanceof S||e instanceof E,i.defaultLayout=n,i.registry={};var s=i.defaultGetSourceVariant.bind(f(i));return i.getSourceVariant=function(e){return s(e)},i.configGetSourceVariant=function(e){s=e.bind(this)},i}return b(r,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var r=this.getVariant(e,t);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,t)}},{key:"defaultGetSourceVariant",value:function(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;var t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(var r in this.registry){var n=this.registry[r];if(n.property&&Object.prototype.hasOwnProperty.call(e,n.property))return n}throw new Error("unable to infer src variant")}},{key:"decode",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.discriminator,o=n.decode(e,r),i=this.registry[o];if(void 0===i){var a=this.defaultLayout,c=0;this.usesPrefixDiscriminator&&(c=n.layout.span),(t=this.makeDestinationObject())[n.property]=o,t[a.property]=a.decode(e,r+c)}else t=i.decode(e,r);return t}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.getSourceVariant(e);if(void 0===n){var o=this.discriminator,i=this.defaultLayout,a=0;return this.usesPrefixDiscriminator&&(a=o.layout.span),o.encode(e[o.property],t,r),a+i.encode(e[i.property],t,r+a)}return n.encode(e,t,r)}},{key:"addVariant",value:function(e,t,r){var n=new J(this,e,t,r);return this.registry[e]=n,n}},{key:"getVariant",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t=e instanceof Uint8Array?this.discriminator.decode(e,r):e,this.registry[t]}}]),r}(w);t.Union=G;var J=function(e){c(r,e);var t=u(r);function r(e,n,o,i){var a;if(p(this,r),!(e instanceof G))throw new TypeError("union must be a Union");if(!Number.isInteger(n)||0>n)throw new TypeError("variant must be a (non-negative) integer");if("string"==typeof o&&void 0===i&&(i=o,o=null),o){if(!(o instanceof w))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=o.span&&o.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!=typeof i)throw new TypeError("variant must have a String property")}var c=e.span;return 0>e.span&&0<=(c=o?o.span:0)&&e.usesPrefixDiscriminator&&(c+=e.discriminator.layout.span),(a=t.call(this,c,i)).union=e,a.variant=n,a.layout=o||null,a}return b(r,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);var n=0;return this.layout&&(n=this.layout.getSpan(e,t+r)),r+n}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");var n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,t+n):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=0;if(this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,r);var o=n;if(this.layout&&(this.layout.encode(e[this.property],t,r+n),o+=this.layout.getSpan(t,r+n),0<=this.union.span&&o>this.union.span))throw new Error("encoded variant overruns containing union");return o}},{key:"fromArray",value:function(e){if(this.layout)return this.layout.fromArray(e)}}]),r}(w);function H(e){return 0>e&&(e+=4294967296),e}t.VariantLayout=J;var V=function(e){c(r,e);var t=u(r);function r(e,n,o){var i;if(p(this,r),!(e instanceof S||e instanceof E))throw new TypeError("word must be a UInt or UIntBE layout");if("string"==typeof n&&void 0===o&&(o=n,n=!1),41&&void 0!==arguments[1]?arguments[1]:0,r=this.makeDestinationObject(),n=this.word.decode(e,t);this._packedSetValue(n);var o,a=i(this.fields);try{for(a.s();!(o=a.n()).done;){var c=o.value;void 0!==c.property&&(r[c.property]=c.decode(e))}}catch(e){a.e(e)}finally{a.f()}return r}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.word.decode(t,r);this._packedSetValue(n);var o,a=i(this.fields);try{for(a.s();!(o=a.n()).done;){var c=o.value;if(void 0!==c.property){var s=e[c.property];void 0!==s&&c.encode(s)}}}catch(e){a.e(e)}finally{a.f()}return this.word.encode(this._packedGetValue(),t,r)}},{key:"addField",value:function(e,t){var r=new K(this,e,t);return this.fields.push(r),r}},{key:"addBoolean",value:function(e){var t=new Y(this,e);return this.fields.push(t),t}},{key:"fieldFor",value:function(e){if("string"!=typeof e)throw new TypeError("property must be string");var t,r=i(this.fields);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.property===e)return n}}catch(e){r.e(e)}finally{r.f()}}}]),r}(w);t.BitStructure=V;var K=function(){function e(t,r,n){if(p(this,e),!(t instanceof V))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(r)||0>=r)throw new TypeError("bits must be positive integer");var o=8*t.span,i=t.fields.reduce((function(e,t){return e+t.bits}),0);if(r+i>o)throw new Error("bits too long for span remainder ("+(o-i)+" of "+o+" remain)");this.container=t,this.bits=r,this.valueMask=(1<>>this.start}},{key:"encode",value:function(e){if("number"!=typeof e||!Number.isInteger(e)||e!==H(e&this.valueMask))throw new TypeError(_("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);var t=this.container._packedGetValue(),r=H(e<r&&(r=this.length.decode(e,t)),r}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.span;return 0>r&&(r=this.length.decode(e,t)),g(e).slice(t,t+r)}},{key:"encode",value:function(e,t,r){var n=this.length;if(this.length instanceof x&&(n=e.length),!(e instanceof Uint8Array&&n===e.length))throw new TypeError(_("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>t.length)throw new RangeError("encoding overruns Uint8Array");var o=g(e);return g(t).write(o.toString("hex"),r,n,"hex"),this.length instanceof x&&this.length.encode(n,t,r),n}}]),r}(w);t.Blob=Z;var $=function(e){c(r,e);var t=u(r);function r(e){return p(this,r),t.call(this,-1,e)}return b(r,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;m(e);for(var r=t;r1&&void 0!==arguments[1]?arguments[1]:0,r=this.getSpan(e,t);return g(e).slice(t,t+r-1).toString("utf-8")}},{key:"encode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;"string"!=typeof e&&(e=String(e));var n=y.Buffer.from(e,"utf8"),o=n.length;if(r+o>t.length)throw new RangeError("encoding overruns Buffer");var i=g(t);return n.copy(i,r),i[r+o]=0,o+1}}]),r}(w);t.CString=$;var Q=function(e){c(r,e);var t=u(r);function r(e,n){var o;if(p(this,r),"string"==typeof e&&void 0===n&&(n=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");return(o=t.call(this,-1,n)).maxSpan=e,o}return b(r,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return m(e),e.length-t}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan2&&void 0!==arguments[2]?arguments[2]:0;"string"!=typeof e&&(e=String(e));var n=y.Buffer.from(e,"utf8"),o=n.length;if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return n.copy(g(t),r),o}}]),r}(w);t.UTF8=Q;var X=function(e){c(r,e);var t=u(r);function r(e,n){var o;return p(this,r),(o=t.call(this,0,n)).value=e,o}return b(r,[{key:"decode",value:function(e,t){return this.value}},{key:"encode",value:function(e,t,r){return 0}}]),r}(w);t.Constant=X,t.greedy=function(e,t){return new k(e,t)},t.offset=function(e,t,r){return new O(e,t,r)},t.u8=function(e){return new S(1,e)},t.u16=function(e){return new S(2,e)},t.u24=function(e){return new S(3,e)},t.u32=function(e){return new S(4,e)},t.u40=function(e){return new S(5,e)},t.u48=function(e){return new S(6,e)},t.nu64=function(e){return new T(e)},t.u16be=function(e){return new E(2,e)},t.u24be=function(e){return new E(3,e)},t.u32be=function(e){return new E(4,e)},t.u40be=function(e){return new E(5,e)},t.u48be=function(e){return new E(6,e)},t.nu64be=function(e){return new R(e)},t.s8=function(e){return new j(1,e)},t.s16=function(e){return new j(2,e)},t.s24=function(e){return new j(3,e)},t.s32=function(e){return new j(4,e)},t.s40=function(e){return new j(5,e)},t.s48=function(e){return new j(6,e)},t.ns64=function(e){return new M(e)},t.s16be=function(e){return new I(2,e)},t.s24be=function(e){return new I(3,e)},t.s32be=function(e){return new I(4,e)},t.s40be=function(e){return new I(5,e)},t.s48be=function(e){return new I(6,e)},t.ns64be=function(e){return new C(e)},t.f32=function(e){return new L(e)},t.f32be=function(e){return new B(e)},t.f64=function(e){return new F(e)},t.f64be=function(e){return new D(e)},t.struct=function(e,t,r){return new z(e,t,r)},t.bits=function(e,t,r){return new V(e,t,r)},t.seq=function(e,t,r){return new U(e,t,r)},t.union=function(e,t,r){return new G(e,t,r)},t.unionLayoutDiscriminator=function(e,t){return new q(e,t)},t.blob=function(e,t){return new Z(e,t)},t.cstr=function(e){return new $(e)},t.utf8=function(e,t){return new Q(e,t)},t.constant=function(e,t){return new X(e,t)}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return I})),r.d(t,"b",(function(){return de})),r.d(t,"c",(function(){return ae})),r.d(t,"d",(function(){return ce})),r.d(t,"e",(function(){return M})),r.d(t,"f",(function(){return L})),r.d(t,"g",(function(){return N})),r.d(t,"h",(function(){return B})),r.d(t,"i",(function(){return C})),r.d(t,"j",(function(){return pe})),r.d(t,"k",(function(){return le})),r.d(t,"l",(function(){return re})),r.d(t,"m",(function(){return ue})),r.d(t,"n",(function(){return Oe})),r.d(t,"o",(function(){return P})),r.d(t,"p",(function(){return A})),r.d(t,"q",(function(){return ee})),r.d(t,"r",(function(){return Pe})),r.d(t,"s",(function(){return be})),r.d(t,"t",(function(){return ve})),r.d(t,"u",(function(){return Ee})),r.d(t,"v",(function(){return Ae})),r.d(t,"w",(function(){return T})),r.d(t,"x",(function(){return R})),r.d(t,"y",(function(){return it})),r.d(t,"z",(function(){return he})),r.d(t,"A",(function(){return De})),r.d(t,"B",(function(){return Le})),r.d(t,"C",(function(){return Ue})),r.d(t,"D",(function(){return U})),r.d(t,"E",(function(){return Re})),r.d(t,"F",(function(){return ze})),r.d(t,"G",(function(){return Qe})),r.d(t,"H",(function(){return tt})),r.d(t,"I",(function(){return Ze})),r.d(t,"J",(function(){return Ve})),r.d(t,"K",(function(){return rt})),r.d(t,"L",(function(){return ot})),r.d(t,"M",(function(){return nt})),r.d(t,"N",(function(){return Te})),r.d(t,"O",(function(){return $e})),r.d(t,"P",(function(){return Ke})),r.d(t,"Q",(function(){return Ye})),r.d(t,"R",(function(){return Xe})),r.d(t,"S",(function(){return at})),r.d(t,"T",(function(){return He})),r.d(t,"U",(function(){return et})),r.d(t,"V",(function(){return Me})),r.d(t,"W",(function(){return Fe})),r.d(t,"X",(function(){return oe})),r.d(t,"Y",(function(){return ie})),r.d(t,"Z",(function(){return fe})),r.d(t,"ab",(function(){return ke})),r.d(t,"bb",(function(){return F})),r.d(t,"cb",(function(){return D}));var n=r(192),o=r(279),i=r(111),a=r(144),c=r(193),s=r(27),u=r(569),l=r(20),f=r(166),d=r(568),h=r(224),p=r(280);function v(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */v=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function u(e,t,r,o){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),c=new j(o||[]);return n(a,"_invoke",{value:k(e,r,c)}),a}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function d(){}function h(){}function p(){}var b={};s(b,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(I([])));g&&g!==t&&r.call(g,i)&&(b=g);var w=p.prototype=d.prototype=Object.create(b);function _(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var o;n(this,"_invoke",{value:function(n,i){function a(){return new t((function(o,a){!function n(o,i,a,c){var s=l(e[o],e,i);if("throw"!==s.type){var u=s.arg,f=u.value;return f&&"object"==m(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,c)}))}c(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function k(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function O(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,O(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function I(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function b(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function y(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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 i,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function m(e){return(m="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)}function g(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_(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 w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,c=[],s=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,t)||_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){if(e){if("string"==typeof e)return x(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)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u")throw new Error("Missing sender public key for type 1 envelope");var r=m(e.senderPublicKey)<"u"?Object(s.fromString)(e.senderPublicKey,S):void 0,o=m(e.iv)<"u"?Object(s.fromString)(e.iv,S):Object(i.randomBytes)(12);return function(e){if(M(e.type)===I){if(m(e.senderPublicKey)>"u")throw new Error("Missing sender public key for type 1 envelope");return Object(s.toString)(Object(s.concat)([e.type,e.senderPublicKey,e.iv,e.sealed]),E)}return Object(s.toString)(Object(s.concat)([e.type,e.iv,e.sealed]),E)}({type:t,sealed:new n.ChaCha20Poly1305(Object(s.fromString)(e.symKey,S)).seal(o,Object(s.fromString)(e.message,j)),iv:o,senderPublicKey:r})}function L(e){var t=new n.ChaCha20Poly1305(Object(s.fromString)(e.symKey,S)),r=B(e.encoded),o=r.sealed,i=r.iv,a=t.open(i,o);if(null===a)throw new Error("Failed to decrypt");return Object(s.toString)(a,j)}function B(e){var t=Object(s.fromString)(e,E),r=t.slice(0,1);if(M(r)===I){var n=t.slice(1,33),o=t.slice(33,45);return{type:r,sealed:t.slice(45),iv:o,senderPublicKey:n}}var i=t.slice(1,13);return{type:r,sealed:t.slice(13),iv:i}}function F(e,t){var r=B(e);return D({type:M(r.type),senderPublicKey:m(r.senderPublicKey)<"u"?Object(s.toString)(r.senderPublicKey,S):void 0,receiverPublicKey:null==t?void 0:t.receiverPublicKey})}function D(e){var t=(null==e?void 0:e.type)||0;if(t===I){if(m(null==e?void 0:e.senderPublicKey)>"u")throw new Error("missing sender public key");if(m(null==e?void 0:e.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:null==e?void 0:e.senderPublicKey,receiverPublicKey:null==e?void 0:e.receiverPublicKey}}function U(e){return e.type===I&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}var z=Object.defineProperty,W=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,J=function(e,t,r){return t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},H=function(e,t){for(var r in t||(t={}))q.call(t,r)&&J(e,r,t[r]);if(W){var n,o=y(W(t));try{for(o.s();!(n=o.n()).done;){r=n.value;G.call(t,r)&&J(e,r,t[r])}}catch(e){o.e(e)}finally{o.f()}}return e},V="react-native",K="node",Y="browser",Z="unknown",$="js";function Q(){return(void 0===e?"undefined":m(e))<"u"&&m(e.versions)<"u"&&m(e.versions.node)<"u"}function X(){return!Object(f.getDocument)()&&Object(f.getNavigator)()&&"ReactNative"===navigator.product?V:Q()?K:!Q()&&Object(f.getNavigator)()?Y:Z}function ee(){return Object(d.getWindowMetadata)()||{name:"",description:"",url:"",icons:[""]}}function te(e,t,r){var n=function(){var e=Object(u.a)();if(null===e)return"unknown";var t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[t,e.name,e.version].join("-"):[t,e.version].join("-")}(),o=function(){var e,t=X();return t===Y?[t,(null==(e=Object(f.getLocation)())?void 0:e.host)||"unknown"].join(":"):t}();return[[e,t].join("-"),[$,r].join("-"),n,o].join("/")}function re(e){var t=e.protocol,r=e.version,n=e.relayUrl,o=e.sdkVersion,i=e.auth,a=e.projectId,c=n.split("?"),s={auth:i,ua:te(t,r,o),projectId:a},u=function(e,t){var r=h.parse(e);return r=H(H({},r),t),e=h.stringify(r)}(c[1]||"",s);return c[0]+"?"+u}function ne(e,t){return e.filter((function(e){return t.includes(e)})).length===e.length}function oe(e){return Object.fromEntries(e.entries())}function ie(e){return new Map(Object.entries(e))}function ae(e){var t,r,n,o=Object(l.toMiliseconds)(e||l.FIVE_MINUTES);return{resolve:function(e){n&&t&&(clearTimeout(n),t(e))},reject:function(e){n&&r&&(clearTimeout(n),r(e))},done:function(){return new Promise((function(e,i){n=setTimeout(i,o),t=e,r=i}))}}}function ce(e,t){return new Promise(function(){var r=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){b(i,n,o,a,c,"next",e)}function c(e){b(i,n,o,a,c,"throw",e)}a(void 0)}))}}(v().mark((function r(n,o){var i,a;return v().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=setTimeout((function(){return o()}),t),r.next=3,e;case 3:a=r.sent,clearTimeout(i),n(a);case 5:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}())}function se(e,t){if("string"==typeof t&&t.startsWith("".concat(e,":")))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw new Error('Value must be "string" for expirer target type: topic');return"topic:".concat(t)}if("id"===e.toLowerCase()){if("number"!=typeof t)throw new Error('Value must be "number" for expirer target type: id');return"id:".concat(t)}throw new Error("Unknown expirer target type: ".concat(e))}function ue(e){return se("topic",e)}function le(e){return se("id",e)}function fe(e){var t=w(e.split(":"),2),r=t[0],n=t[1],o={id:void 0,topic:void 0};if("topic"===r&&"string"==typeof n)o.topic=n;else{if("id"!==r||!Number.isInteger(Number(n)))throw new Error("Invalid target, expected id:number or topic:string, got ".concat(r,":").concat(n));o.id=Number(n)}return o}function de(e,t){return Object(l.fromMiliseconds)((t||Date.now())+Object(l.toMiliseconds)(e))}function he(e){return Date.now()>=Object(l.toMiliseconds)(e)}function pe(e,t){return"".concat(e).concat(t?":".concat(t):"")}function ve(e){return(null==e?void 0:e.relay)||{protocol:"irn"}}function be(e){var t=p.RELAY_JSONRPC[e];if(m(t)>"u")throw new Error("Relay Protocol not supported: ".concat(e));return t}var ye=Object.defineProperty,me=Object.getOwnPropertySymbols,ge=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,_e=function(e,t,r){return t in e?ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};function xe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",r={},n="relay"+t;return Object.keys(e).forEach((function(t){if(t.startsWith(n)){var o=t.replace(n,""),i=e[t];r[o]=i}})),r}function ke(e){var t=e.indexOf(":"),r=-1!==e.indexOf("?")?e.indexOf("?"):void 0,n=e.substring(0,t),o=e.substring(t+1,r).split("@"),i=m(r)<"u"?e.substring(r):"",a=h.parse(i);return{protocol:n,topic:o[0],version:parseInt(o[1],10),symKey:a.symKey,relay:xe(a)}}function Oe(e){return"".concat(e.protocol,":").concat(e.topic,"@").concat(e.version,"?")+h.stringify(function(e,t){for(var r in t||(t={}))ge.call(t,r)&&_e(e,r,t[r]);if(me){var n,o=y(me(t));try{for(o.s();!(n=o.n()).done;){r=n.value;we.call(t,r)&&_e(e,r,t[r])}}catch(e){o.e(e)}finally{o.f()}}return e}({symKey:e.symKey},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",r="relay",n={};return Object.keys(e).forEach((function(o){var i=r+t+o;e[o]&&(n[i]=e[o])})),n}(e.relay)))}function Se(e){var t=[];return e.forEach((function(e){var r=w(e.split(":"),2),n=r[0],o=r[1];t.push("".concat(n,":").concat(o))})),t}function Ee(e,t){var r=Ve(e,t);if(r)throw new Error(r.message);for(var n={},o=0,i=Object.entries(e);o"u"}function Me(e,t){return!(!t||!Re(e))||"string"==typeof e&&Boolean(e.trim().length)}function Ce(e,t){return!(!t||!Re(e))||"number"==typeof e&&!isNaN(e)}function Le(e,t){var r=t.requiredNamespaces,n=Object.keys(e.namespaces),o=Object.keys(r),i=!0;return!!ne(o,n)&&(n.forEach((function(t){var n=e.namespaces[t],o=n.accounts,a=n.methods,c=n.events,s=Se(o),u=r[t];ne(k(t,u),s)&&ne(u.methods,a)&&ne(u.events,c)||(i=!1)})),i)}function Be(e){return!(!Me(e,!1)||!e.includes(":"))&&2===e.split(":").length}function Fe(e){if(Me(e,!1))try{return m(new URL(e))<"u"}catch(e){return!1}return!1}function De(e){var t;return null==(t=null==e?void 0:e.proposer)?void 0:t.publicKey}function Ue(e){return null==e?void 0:e.topic}function ze(e,t){var r=null;return Me(null==e?void 0:e.publicKey,!1)||(r=Pe("MISSING_OR_INVALID","".concat(t," controller public key should be a string"))),r}function We(e){var t=!0;return Ne(e)?e.length&&(t=e.every((function(e){return Me(e,!1)}))):t=!1,t}function qe(e,t){var r=null;return Object.entries(e).forEach((function(e){var n=w(e,2),o=n[0],i=n[1];if(!r){var a=function(e,t,r){var n=null;return Ne(t)?t.forEach((function(t){n||(!Be(t)||!t.includes(e))&&(n=Ae("UNSUPPORTED_CHAINS","".concat(r,", chain ").concat(t,' should be a string and conform to "namespace:chainId" format')))})):n=Ae("UNSUPPORTED_CHAINS","".concat(r,", chains ").concat(t,' should be an array of strings conforming to "namespace:chainId" format')),n}(o,k(o,i),"".concat(t," requiredNamespace"));a&&(r=a)}})),r}function Ge(e,t){var r=null;return Ne(e)?e.forEach((function(e){r||function(e){if(Me(e,!1)&&e.includes(":")){var t=e.split(":");if(3===t.length){var r=t[0]+":"+t[1];return!!t[2]&&Be(r)}}return!1}(e)||(r=Ae("UNSUPPORTED_ACCOUNTS","".concat(t,", account ").concat(e,' should be a string and conform to "namespace:chainId:address" format')))})):r=Ae("UNSUPPORTED_ACCOUNTS","".concat(t,', accounts should be an array of strings conforming to "namespace:chainId:address" format')),r}function Je(e,t){var r=null;return Object.values(e).forEach((function(e){if(!r){var n=function(e,t){var r=null;return We(null==e?void 0:e.methods)?We(null==e?void 0:e.events)||(r=Ae("UNSUPPORTED_EVENTS","".concat(t,", events should be an array of strings or empty array for no events"))):r=Ae("UNSUPPORTED_METHODS","".concat(t,", methods should be an array of strings or empty array for no methods")),r}(e,"".concat(t,", namespace"));n&&(r=n)}})),r}function He(e,t,r){var n=null;if(e&&Te(e)){var o=Je(e,t);o&&(n=o);var i=qe(e,t);i&&(n=i)}else n=Pe("MISSING_OR_INVALID","".concat(t,", ").concat(r," should be an object with data"));return n}function Ve(e,t){var r=null;if(e&&Te(e)){var n=Je(e,t);n&&(r=n);var o=function(e,t){var r=null;return Object.values(e).forEach((function(e){if(!r){var n=Ge(null==e?void 0:e.accounts,"".concat(t," namespace"));n&&(r=n)}})),r}(e,t);o&&(r=o)}else r=Pe("MISSING_OR_INVALID","".concat(t,", namespaces should be an object with data"));return r}function Ke(e){return Me(e.protocol,!0)}function Ye(e,t){var r=!1;return t&&!e?r=!0:e&&Ne(e)&&e.length&&e.forEach((function(e){r=Ke(e)})),r}function Ze(e){return"number"==typeof e}function $e(e){return m(e)<"u"&&null!==m(e)}function Qe(e){return!!(e&&"object"==m(e)&&e.code&&Ce(e.code,!1)&&e.message&&Me(e.message,!1))}function Xe(e){return!(Re(e)||!Me(e.method,!1))}function et(e){return!(Re(e)||Re(e.result)&&Re(e.error)||!Ce(e.id,!1)||!Me(e.jsonrpc,!1))}function tt(e){return!(Re(e)||!Me(e.name,!1))}function rt(e,t){return!(!Be(t)||!function(e){var t=[];return Object.values(e).forEach((function(e){t.push.apply(t,g(Se(e.accounts)))})),t}(e).includes(t))}function nt(e,t,r){return!!Me(r,!1)&&function(e,t){var r=[];return Object.values(e).forEach((function(e){Se(e.accounts).includes(t)&&r.push.apply(r,g(e.methods))})),r}(e,t).includes(r)}function ot(e,t,r){return!!Me(r,!1)&&function(e,t){var r=[];return Object.values(e).forEach((function(e){Se(e.accounts).includes(t)&&r.push.apply(r,g(e.events))})),r}(e,t).includes(r)}function it(e,t,r,n){var o=null,i=Object.keys(e);return ne(i,Object.keys(t))?i.forEach((function(n){if(!o){var i=Se(t[n].accounts);ne(k(n,e[n]),i)?ne(e[n].methods,t[n].methods)?ne(e[n].events,t[n].events)||(o=Pe("NON_CONFORMING_NAMESPACES","".concat(r," namespaces events don't satisfy namespace events for ").concat(n))):o=Pe("NON_CONFORMING_NAMESPACES","".concat(r," namespaces methods don't satisfy namespace methods for ").concat(n)):o=Pe("NON_CONFORMING_NAMESPACES","".concat(r," namespaces accounts don't satisfy namespace chains for ").concat(n))}})):o=Pe("NON_CONFORMING_NAMESPACES","".concat(r," namespaces keys don't satisfy ").concat(n)),o}function at(e,t){return Ce(e,!1)&&e<=t.max&&e>=t.min}}).call(this,r(59))},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)} +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */r.r(t),r.d(t,"__extends",(function(){return i})),r.d(t,"__assign",(function(){return a})),r.d(t,"__rest",(function(){return c})),r.d(t,"__decorate",(function(){return s})),r.d(t,"__param",(function(){return u})),r.d(t,"__metadata",(function(){return l})),r.d(t,"__awaiter",(function(){return f})),r.d(t,"__generator",(function(){return d})),r.d(t,"__createBinding",(function(){return h})),r.d(t,"__exportStar",(function(){return p})),r.d(t,"__values",(function(){return v})),r.d(t,"__read",(function(){return b})),r.d(t,"__spread",(function(){return y})),r.d(t,"__spreadArrays",(function(){return m})),r.d(t,"__await",(function(){return g})),r.d(t,"__asyncGenerator",(function(){return w})),r.d(t,"__asyncDelegator",(function(){return _})),r.d(t,"__asyncValues",(function(){return x})),r.d(t,"__makeTemplateObject",(function(){return k})),r.d(t,"__importStar",(function(){return O})),r.d(t,"__importDefault",(function(){return S})),r.d(t,"__classPrivateFieldGet",(function(){return E})),r.d(t,"__classPrivateFieldSet",(function(){return j}));var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0;s--)(i=e[s])&&(c=(a<3?i(c):a>3?i(t,r,c):i(t,r))||c);return a>3&&c&&Object.defineProperty(t,r,c),c}function u(e,t){return function(r,n){t(r,n,e)}}function l(e,t){if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function c(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,c)}s((n=n.apply(e,t||[])).next())}))}function d(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function y(){for(var e=[],t=0;t1||c(e,t)}))})}function c(e,t){try{(r=o[e](t)).value instanceof g?Promise.resolve(r.value.v).then(s,u):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function s(e){c("next",e)}function u(e){c("throw",e)}function l(e,t){e(t),i.shift(),i.length&&c(i[0][0],i[0][1])}}function _(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:g(e[n](t)),done:"return"===n}:o?o(t):t}:o}}function x(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=v(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}}function k(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function O(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function S(e){return e&&e.__esModule?e:{default:e}}function E(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function j(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},function(e,t){function r(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function c(e){r(a,o,i,c,s,"next",e)}function s(e){r(a,o,i,c,s,"throw",e)}c(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(21);function o(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;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function d(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=h(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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 i,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function h(e,t){if(e){if("string"==typeof e)return p(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)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:new x;v(this,e),this.configuration=r,this.fetchApi=function(e,r){return g(t,void 0,void 0,f().mark((function t(){var n,o,i,a,c,s,u,l;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n={url:e,init:r},o=d(this.middleware),t.prev=2,o.s();case 4:if((i=o.n()).done){t.next=15;break}if(!(a=i.value).pre){t.next=13;break}return t.next=9,a.pre(Object.assign({fetch:this.fetchApi},n));case 9:if(t.t0=t.sent,t.t0){t.next=12;break}t.t0=n;case 12:n=t.t0;case 13:t.next=4;break;case 15:t.next=20;break;case 17:t.prev=17,t.t1=t.catch(2),o.e(t.t1);case 20:return t.prev=20,o.f(),t.finish(20);case 23:return t.next=25,(this.configuration.fetchApi||fetch)(n.url,n.init);case 25:c=t.sent,s=d(this.middleware),t.prev=27,s.s();case 29:if((u=s.n()).done){t.next=40;break}if(!(l=u.value).post){t.next=38;break}return t.next=34,l.post({fetch:this.fetchApi,url:n.url,init:n.init,response:c.clone()});case 34:if(t.t2=t.sent,t.t2){t.next=37;break}t.t2=c;case 37:c=t.t2;case 38:t.next=29;break;case 40:t.next=45;break;case 42:t.prev=42,t.t3=t.catch(27),s.e(t.t3);case 45:return t.prev=45,s.f(),t.finish(45);case 48:return t.abrupt("return",c);case 49:case"end":return t.stop()}}),t,this,[[2,17,20,23],[27,42,45,48]])})))},this.middleware=r.middleware}return y(e,[{key:"withMiddleware",value:function(){var e,t=this.clone();return t.middleware=(e=t.middleware).concat.apply(e,arguments),t}},{key:"withPreMiddleware",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r=200&&a.status<300)){r.next=6;break}return r.abrupt("return",a);case 6:throw a;case 7:case"end":return r.stop()}}),r,this)})))}},{key:"createFetchParams",value:function(e,t){var r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));var n,o="undefined"!=typeof FormData&&e.body instanceof FormData||e.body instanceof URLSearchParams||(n=e.body,"undefined"!=typeof Blob&&n instanceof Blob)?e.body:JSON.stringify(e.body),i=Object.assign({},this.configuration.headers,e.headers);return{url:r,init:Object.assign({method:e.method,headers:i,body:o,credentials:this.configuration.credentials},t)}}},{key:"clone",value:function(){var e=new(0,this.constructor)(this.configuration);return e.middleware=this.middleware.slice(),e}}]),e}();t.BaseAPI=w;var _=function(e){!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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(i,e);var t,r,o=(t=i,r=a(),function(){var e,o=s(t);if(r){var i=s(this).constructor;e=Reflect.construct(o,arguments,i)}else e=o.apply(this,arguments);return n(this,e)});function i(e,t){var r;return v(this,i),(r=o.call(this,t)).field=e,r.name="RequiredError",r}return y(i)}(o(Error));t.RequiredError=_,t.COLLECTION_FORMATS={csv:",",ssv:" ",tsv:"\t",pipes:"|"};var x=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};v(this,e),this.configuration=t}return y(e,[{key:"basePath",get:function(){return null!=this.configuration.basePath?this.configuration.basePath:t.BASE_PATH}},{key:"fetchApi",get:function(){return this.configuration.fetchApi}},{key:"middleware",get:function(){return this.configuration.middleware||[]}},{key:"queryParamsStringify",get:function(){return this.configuration.queryParamsStringify||k}},{key:"username",get:function(){return this.configuration.username}},{key:"password",get:function(){return this.configuration.password}},{key:"apiKey",get:function(){var e=this.configuration.apiKey;if(e)return"function"==typeof e?e:function(){return e}}},{key:"accessToken",get:function(){var e=this,t=this.configuration.accessToken;if(t)return"function"==typeof t?t:function(){return g(e,void 0,void 0,f().mark((function e(){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t);case 1:case"end":return e.stop()}}),e)})))}}},{key:"headers",get:function(){return this.configuration.headers}},{key:"credentials",get:function(){return this.configuration.credentials}}]),e}();function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(e).map((function(r){var n=t+(t.length?"[".concat(r,"]"):r),o=e[r];if(o instanceof Array){var i=o.map((function(e){return encodeURIComponent(String(e))})).join("&".concat(encodeURIComponent(n),"="));return"".concat(encodeURIComponent(n),"=").concat(i)}return o instanceof Date?"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(o.toISOString())):o instanceof Object?k(o,n):"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(String(o)))})).filter((function(e){return e.length>0})).join("&")}t.Configuration=x,t.exists=function(e,t){var r=e[t];return null!=r},t.querystring=k,t.mapValues=function(e,t){return Object.keys(e).reduce((function(r,n){return Object.assign(Object.assign({},r),function(e,t,r){return(t=m(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},n,t(e[n])))}),{})},t.canConsumeForm=function(e){var t,r=d(e);try{for(r.s();!(t=r.n()).done;){if("multipart/form-data"===t.value.contentType)return!0}}catch(e){r.e(e)}finally{r.f()}return!1};var O=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};v(this,e),this.raw=t,this.transformer=r}return y(e,[{key:"value",value:function(){return g(this,void 0,void 0,f().mark((function e(){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this,e.next=3,this.raw.json();case 3:return e.t1=e.sent,e.abrupt("return",e.t0.transformer.call(e.t0,e.t1));case 5:case"end":return e.stop()}}),e,this)})))}}]),e}();t.JSONApiResponse=O;var S=function(){function e(t){v(this,e),this.raw=t}return y(e,[{key:"value",value:function(){return g(this,void 0,void 0,f().mark((function e(){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",void 0);case 1:case"end":return e.stop()}}),e)})))}}]),e}();t.VoidApiResponse=S;var E=function(){function e(t){v(this,e),this.raw=t}return y(e,[{key:"value",value:function(){return g(this,void 0,void 0,f().mark((function e(){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.raw.blob();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}}]),e}();t.BlobApiResponse=E;var j=function(){function e(t){v(this,e),this.raw=t}return y(e,[{key:"value",value:function(){return g(this,void 0,void 0,f().mark((function e(){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.raw.text();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}}]),e}();t.TextApiResponse=j},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(8),o=r(98),i=r(191),a=r(30),c=r(162),s=r(71),u=r(127);function l(e){return(l="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)}var f=function(e){function t(r,n,o){var a=e.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,arguments.length){case 0:a.destination=i.a;break;case 1:if(!r){a.destination=i.a;break}if("object"===l(r)){r instanceof t?(a.syncErrorThrowable=r.syncErrorThrowable,a.destination=r,r.add(a)):(a.syncErrorThrowable=!0,a.destination=new d(a,r));break}default:a.syncErrorThrowable=!0,a.destination=new d(a,r,n,o)}return a}return n.__extends(t,e),t.prototype[c.a]=function(){return this},t.create=function(e,r,n){var o=new t(e,r,n);return o.syncErrorThrowable=!1,o},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(a.a),d=function(e){function t(t,r,n,a){var c,s=e.call(this)||this;s._parentSubscriber=t;var u=s;return Object(o.a)(r)?c=r:r&&(c=r.next,n=r.error,a=r.complete,r!==i.a&&(u=Object.create(r),Object(o.a)(u.unsubscribe)&&s.add(u.unsubscribe.bind(u)),u.unsubscribe=s.unsubscribe.bind(s))),s._context=u,s._next=c,s._error=n,s._complete=a,s}return n.__extends(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;s.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,r=s.a.useDeprecatedSynchronousErrorHandling;if(this._error)r&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):Object(u.a)(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;Object(u.a)(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};s.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),s.a.useDeprecatedSynchronousErrorHandling)throw e;Object(u.a)(e)}},t.prototype.__tryOrSetError=function(e,t,r){if(!s.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,r)}catch(t){return s.a.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(Object(u.a)(t),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(f)},function(e,t,r){"use strict";(function(e){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +var n=r(586),o=r(587),i=r(588);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(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(s.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 U(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 U(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 P(this,t,r);case"utf8":case"utf-8":return E(this,t,r);case"ascii":return j(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,o);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,o){var i,a=1,c=e.length,s=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,c/=2,s/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=r;ic&&(r=c-s),i=r;i>=0;i--){for(var f=!0,d=0;do&&(n=o):n=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function E(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o239?4:u>223?3:u>191?2:1;if(o+f<=r)switch(f){case 1:u<128&&(l=u);break;case 2:128==(192&(i=e[o+1]))&&(s=(31&u)<<6|63&i)>127&&(l=s);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(s=(15&u)<<12|(63&i)<<6|63&a)>2047&&(s<55296||s>57343)&&(l=s);break;case 4:i=e[o+1],a=e[o+2],c=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&c)&&(s=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&c)>65535&&s<1114112&&(l=s)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(e){var t=e.length;if(t<=4096)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+=" ... ")),""},s.prototype.compare=function(e,t,r,n,o){if(!s.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===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),c=Math.min(i,a),u=this.slice(n,o),l=e.slice(t,r),f=0;fo)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return _(this,e,t,r);case"latin1":case"binary":return x(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;on)&&(r=n);for(var o="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,r,n,o,i){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function R(e,t,r,n){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-r,2);o>>8*(n?o:1-o)}function M(e,t,r,n){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-r,4);o>>8*(n?o:3-o)&255}function C(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,i){return i||C(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function B(e,t,r,n,i){return i||C(e,0,r,8),o.write(e,t,r,n,52,8),r+8}s.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&&(o*=256);)n+=this[e+--t]*o;return n},s.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||N(e,t,this.length);for(var n=this[e],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||N(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},s.prototype.readInt8=function(e,t){return t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),o.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),o.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),o.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),o.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||T(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+r},s.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);T(this,e,t,r,o-1,-o)}var i=0,a=1,c=0;for(this[t]=255&e;++i>0)-c&255;return t+r},s.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);T(this,e,t,r,o-1,-o)}var i=r-1,a=1,c=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===c&&0!==this[t+i+1]&&(c=1),this[t+i]=(e/a>>0)-c&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},s.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;--o)e[o+t]=this[o+r];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){for(var o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}}).call(this,r(46))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultStarknetTypedDataDomain=t.Keplr=t.getWalletConnectorByName=t.getChainInfo=t.isEmailOTPWalletConnector=t.isEmailWalletConnector=t.normalizeWalletName=t.isMobile=t.isIPhone=t.isIPad=t.generateMessageToSign=void 0;var n=r(19);r(585),n.__exportStar(r(589),t),n.__exportStar(r(932),t),n.__exportStar(r(62),t),n.__exportStar(r(293),t),n.__exportStar(r(92),t),n.__exportStar(r(461),t);var o=r(933);Object.defineProperty(t,"generateMessageToSign",{enumerable:!0,get:function(){return o.generateMessageToSign}});var i=r(118);Object.defineProperty(t,"isIPad",{enumerable:!0,get:function(){return i.isIPad}}),Object.defineProperty(t,"isIPhone",{enumerable:!0,get:function(){return i.isIPhone}}),Object.defineProperty(t,"isMobile",{enumerable:!0,get:function(){return i.isMobile}});var a=r(53);Object.defineProperty(t,"normalizeWalletName",{enumerable:!0,get:function(){return a.normalizeWalletName}});var c=r(466);Object.defineProperty(t,"isEmailWalletConnector",{enumerable:!0,get:function(){return c.isEmailWalletConnector}});var s=r(935);Object.defineProperty(t,"isEmailOTPWalletConnector",{enumerable:!0,get:function(){return s.isEmailOTPWalletConnector}});var u=r(468);Object.defineProperty(t,"getChainInfo",{enumerable:!0,get:function(){return u.getChainInfo}});var l=r(937);Object.defineProperty(t,"getWalletConnectorByName",{enumerable:!0,get:function(){return l.getWalletConnectorByName}}),n.__exportStar(r(319),t),n.__exportStar(r(374),t);var f=r(467);Object.defineProperty(t,"Keplr",{enumerable:!0,get:function(){return f.Keplr}}),n.__exportStar(r(425),t);var d=r(200);Object.defineProperty(t,"defaultStarknetTypedDataDomain",{enumerable:!0,get:function(){return d.defaultStarknetTypedDataDomain}})},function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return s})),r.d(t,"c",(function(){return u}));var n=r(8),o=r(12),i=r(16),a=r(125),c=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,r}return n.__extends(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(o.a),s=(o.a,function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(o.a));o.a;function u(e,t){if(!t.closed){if(e instanceof i.a)return e.subscribe(t);var r;try{r=Object(a.a)(e)(t)}catch(e){t.error(e)}return r}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(188),o=r(12),i=r(162),a=r(191);var c=r(89),s=r(160),u=r(71),l=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,c=function(e,t,r){if(e){if(e instanceof o.a)return e;if(e[i.a])return e[i.a]()}return e||t||r?new o.a(e,t,r):new o.a(a.a)}(e,t,r);if(n?c.add(n.call(c,this.source)):c.add(this.source||u.a.useDeprecatedSynchronousErrorHandling&&!c.syncErrorThrowable?this._subscribe(c):this._trySubscribe(c)),u.a.useDeprecatedSynchronousErrorHandling&&c.syncErrorThrowable&&(c.syncErrorThrowable=!1,c.syncErrorThrown))throw c.syncErrorValue;return c},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){u.a.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),Object(n.a)(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=f(t))((function(t,n){var o;o=r.subscribe((function(t){try{e(t)}catch(e){n(e),o&&o.unsubscribe()}}),n,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[c.a]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]&&arguments[1],r=e.toString("hex");return t?ie(r):r}function d(e){return e.toString("utf8")}function h(e){return e.readUIntBE(0,e.length)}function p(e){return g(l(e))}function v(e){return a()(e)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return f(v(e),t)}function y(e){return d(v(e))}function m(e){return h(v(e))}function g(e){return Array.from(e).map(M).join("")}function w(t){return e.from(oe(t),"hex")}function _(e){return l(w(e))}function x(e){return d(w(e))}function k(e){return m(_(e))}function O(e){return g(_(e))}function S(t){return e.from(t,"utf8")}function E(e){return l(S(e))}function j(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return f(S(e),t)}function I(e){var t=parseInt(e,10);return function(e,t){if(!e)throw new Error(t)}(!function(e){return void 0===e}(t),"Number can only safely store up to 53 bits"),t}function P(e){return g(E(e))}function A(e){return C(M(e))}function N(e){return L(M(e))}function T(e,t){return B(M(e),t)}function R(e){return"".concat(e)}function M(e){return te((e>>>0).toString(2))}function C(e){return v(L(e))}function L(e){return new Uint8Array(Q(e).map((function(e){return parseInt(e,2)})))}function B(e,t){return b(L(e),t)}function F(e){return y(L(e))}function D(e){return m(L(e))}function U(e){return!("string"!=typeof e||!new RegExp(/^[01]+$/).test(e))&&e.length%8==0}function z(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}function W(t){return e.isBuffer(t)}function q(e){return o.a.strict(e)&&!W(e)}function G(e){return!q(e)&&!W(e)&&void 0!==e.byteLength}function J(e){return W(e)?"buffer":q(e)?"typed-array":G(e)?"array-buffer":Array.isArray(e)?"array":u(e)}function H(e){return U(e)?"binary":z(e)?"hex":"utf8"}function V(){for(var t=arguments.length,r=new Array(t),n=0;n0&&(e=e.slice(r)),e}function Z(e,t){return e.slice(0,t)}function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=e%t;return r?(e-r)/t*t+t:e}function Q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=te(e).match(new RegExp(".{".concat(t,"}"),"gi"));return Array.from(r||[])}function X(e){return Q(e).map(se).join("")}function ee(e){return B(X(O(e)))}function te(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0";return re(e,$(e.length,t),r)}function re(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0";return ue(e,t,!0,r)}function ne(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0";return ue(e,t,!1,r)}function oe(e){return e.replace(/^0x/,"")}function ie(e){return e.startsWith("0x")?e:"0x".concat(e)}function ae(e){return(e=te(e=oe(e),2))&&(e=ie(e)),e}function ce(e){var t=e.startsWith("0x");return e=(e=oe(e)).startsWith("0")?e.substring(1):e,t?ie(e):e}function se(e){return e.split("").reverse().join("")}function ue(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"0",o=t-e.length,i=e;if(o>0){var a=n.repeat(o);i=r?a+e:e+a}return i}}.call(this,r(13).Buffer)},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.r(t),r.d(t,"__extends",(function(){return i})),r.d(t,"__assign",(function(){return a})),r.d(t,"__rest",(function(){return c})),r.d(t,"__decorate",(function(){return s})),r.d(t,"__param",(function(){return u})),r.d(t,"__metadata",(function(){return l})),r.d(t,"__awaiter",(function(){return f})),r.d(t,"__generator",(function(){return d})),r.d(t,"__createBinding",(function(){return h})),r.d(t,"__exportStar",(function(){return p})),r.d(t,"__values",(function(){return v})),r.d(t,"__read",(function(){return b})),r.d(t,"__spread",(function(){return y})),r.d(t,"__spreadArrays",(function(){return m})),r.d(t,"__spreadArray",(function(){return g})),r.d(t,"__await",(function(){return w})),r.d(t,"__asyncGenerator",(function(){return _})),r.d(t,"__asyncDelegator",(function(){return x})),r.d(t,"__asyncValues",(function(){return k})),r.d(t,"__makeTemplateObject",(function(){return O})),r.d(t,"__importStar",(function(){return E})),r.d(t,"__importDefault",(function(){return j})),r.d(t,"__classPrivateFieldGet",(function(){return I})),r.d(t,"__classPrivateFieldSet",(function(){return P})),r.d(t,"__classPrivateFieldIn",(function(){return A}));var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0;s--)(i=e[s])&&(c=(a<3?i(c):a>3?i(t,r,c):i(t,r))||c);return a>3&&c&&Object.defineProperty(t,r,c),c}function u(e,t){return function(r,n){t(r,n,e)}}function l(e,t){if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function c(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,c)}s((n=n.apply(e,t||[])).next())}))}function d(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(s){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function y(){for(var e=[],t=0;t1||c(e,t)}))})}function c(e,t){try{(r=o[e](t)).value instanceof w?Promise.resolve(r.value.v).then(s,u):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function s(e){c("next",e)}function u(e){c("throw",e)}function l(e,t){e(t),i.shift(),i.length&&c(i[0][0],i[0][1])}}function x(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:w(e[n](t)),done:"return"===n}:o?o(t):t}:o}}function k(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=v(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}}function O(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var S=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function E(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)&&h(t,e,r);return S(t,e),t}function j(e){return e&&e.__esModule?e:{default:e}}function I(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function P(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function A(e,t){if(null===t||"object"!==n(t)&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8);n.__exportStar(r(785),t),n.__exportStar(r(790),t),n.__exportStar(r(791),t),n.__exportStar(r(427),t)},function(e,t,r){var n=r(365);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";r.d(t,"g",(function(){return n.detectEnv})),r.d(t,"s",(function(){return n.isMobile})),r.d(t,"n",(function(){return n.isBrowser})),r.d(t,"k",(function(){return n.getLocation})),r.d(t,"i",(function(){return n.getClientMeta})),r.d(t,"C",(function(){return n.setLocal})),r.d(t,"j",(function(){return n.getLocal})),r.d(t,"B",(function(){return n.removeLocal})),r.d(t,"w",(function(){return n.mobileLinkChoiceKey})),r.d(t,"D",(function(){return i})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return f})),r.d(t,"d",(function(){return d})),r.d(t,"e",(function(){return h})),r.d(t,"f",(function(){return p})),r.d(t,"x",(function(){return I})),r.d(t,"y",(function(){return P})),r.d(t,"A",(function(){return y})),r.d(t,"E",(function(){return m})),r.d(t,"m",(function(){return g})),r.d(t,"h",(function(){return A})),r.d(t,"v",(function(){return C})),r.d(t,"z",(function(){return L})),r.d(t,"l",(function(){return T})),r.d(t,"a",(function(){return R})),r.d(t,"p",(function(){return _})),r.d(t,"r",(function(){return x})),r.d(t,"q",(function(){return k})),r.d(t,"o",(function(){return O})),r.d(t,"t",(function(){return S})),r.d(t,"u",(function(){return E}));var n=r(346),o=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],i=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],a={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"},c=r(221),s=r.n(c),u=r(18);function l(e){return u.arrayToBuffer(new Uint8Array(e))}function f(e,t){return u.arrayToHex(new Uint8Array(e),!t)}function d(e){return u.bufferToArray(e).buffer}function h(e){return u.hexToArray(e).buffer}function p(e,t){var r=u.removeHexPrefix(u.sanitizeHex(new s.a(e).toString(16)));return t?r:u.addHexPrefix(r)}var v=r(266);function b(e){return u.sanitizeHex(e)}var y=r(24).payloadId;function m(){return function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t}()}function g(e,t){var r,n=function(e,t){var r,n=a[e];return n&&(r="https://".concat(n,".infura.io/v3/").concat(t)),r}(e,t.infuraId);return t.custom&&t.custom[e]?r=t.custom[e]:n&&(r=n),r}function w(e,t){return u.isHexString(e,t)}function _(e){return void 0!==e.method}function x(e){return void 0!==e.result}function k(e){return void 0!==e.error}function O(e){return void 0!==e.event}function S(e){return o.includes(e)||e.startsWith("wc_")}function E(e){return!!e.method.startsWith("wc_")||!i.includes(e.method)}function j(e){e=Object(u.removeHexPrefix)(e.toLowerCase());for(var t,r=Object(u.removeHexPrefix)(Object(v.keccak_256)((t=e,u.utf8ToBuffer(t)))),n="",o=0;o7?n+=e[o].toUpperCase():n+=e[o];return Object(u.addHexPrefix)(n)}function I(e){var t,r,n;return(n=e)&&n.length&&!w(e[0])&&(e[0]=(t=e[0],u.utf8ToHex(t,!r))),e}function P(e){if(void 0!==e.type&&"0"!==e.type)return e;if(void 0===e.from||(!(t=e.from)||"0x"!==t.toLowerCase().substring(0,2)||!/^(0x)?[0-9a-f]{40}$/i.test(t)||!/^(0x)?[0-9a-f]{40}$/.test(t)&&!/^(0x)?[0-9A-F]{40}$/.test(t)&&t!==j(t)))throw new Error("Transaction object must include a valid 'from' value.");var t;function r(e){var t,r=e;return("number"==typeof e||"string"==typeof e&&!function(e){return""===e||"string"==typeof e&&""===e.trim()}(e))&&(w(e)?"string"==typeof e&&(r=b(e)):r=p(e)),"string"==typeof r&&(t=r,r=u.removeHexLeadingZeros(u.addHexPrefix(t))),r}var n={from:b(e.from),to:void 0===e.to?void 0:b(e.to),gasPrice:void 0===e.gasPrice?"":r(e.gasPrice),gas:void 0===e.gas?void 0===e.gasLimit?"":r(e.gasLimit):r(e.gas),value:void 0===e.value?"":r(e.value),nonce:void 0===e.nonce?"":r(e.nonce),data:void 0===e.data?"":b(e.data)||"0x"},o=["gasPrice","gas","value","nonce"];return Object.keys(n).forEach((function(e){(void 0===n[e]||"string"==typeof n[e]&&!n[e].trim().length)&&o.includes(e)&&delete n[e]})),n}function A(e){var t=e.message||"Failed or Rejected Request",r=-32e3;if(e&&!e.code)switch(t){case"Parse error":r=-32700;break;case"Invalid request":r=-32600;break;case"Method not found":r=-32601;break;case"Invalid params":r=-32602;break;case"Internal error":r=-32603;break;default:r=-32e3}var n={code:r,message:t};return e.data&&(n.data=e.data),n}var N=r(354);function T(e){var t=-1!==e.indexOf("?")?e.indexOf("?"):void 0;return void 0!==t?e.substr(t):""}function R(e,t){var r=M(e);return e=function(e){return N.stringify(e)}(r=Object.assign(Object.assign({},r),t))}function M(e){return N.parse(e)}function C(e){return void 0!==e.bridge}function L(e){var t=e.indexOf(":"),r=-1!==e.indexOf("?")?e.indexOf("?"):void 0,n=e.substring(0,t);var o=function(e){var t=e.split("@");return{handshakeTopic:t[0],version:parseInt(t[1],10)}}(e.substring(t+1,r));var i=function(e){var t=M(e);return{key:t.key||"",bridge:t.bridge||""}}(void 0!==r?e.substr(r):"");return Object.assign(Object.assign({protocol:n},o),i)}},function(e,t,r){(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,n){"use strict";function o(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 a(e,t,r){if(a.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 c;"object"===t(e)?e.exports=a:n.BN=a,a.BN=a,a.wordSize=26;try{c="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(602).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void o(!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 l(e,t,r,n){for(var i=0,a=0,c=Math.min(e.length,r),s=t;s=49?u-49+10:u>=17?u-17+10:u,o(u>=0&&a0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"===t(e))return this._initArray(e,r,n);"hex"===r&&(r=16),o(r===(0|r)&&r>=2&&r<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=a<>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(n=0,i=0;n>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this._strip()},a.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)o=u(e,t,n)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,a=i%n,c=Math.min(i,i-a)+r,s=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(e){a.prototype.inspect=d}else a.prototype.inspect=d;function d(){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"],p=[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],v=[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];a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,i=0,a=0;a>>24-n&16777215,(n+=2)>=26&&(n-=26,a--),r=0!==i||a!==this.length-1?h[6-s.length]+s+r:s+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=p[e],l=v[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var d=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?d+r:h[u-d.length]+d+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}o(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16,2)},c&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function b(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,c=67108863&a,s=a/67108864|0;r.words[0]=c;for(var u=1;u>>26,f=67108863&s,d=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=d;h++){var p=u-h|0;l+=(a=(o=0|e.words[p])*(i=0|t.words[h])+f)/67108864|0,f=67108863&a}r.words[u]=0|f,s=0|l}return 0!==s?r.words[u]=0|s:r.length--,r._strip()}a.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);o(n<=i,"byte array longer than desired length"),o(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,n),a},a.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,o=0,i=0;o>8&255),r>16&255),6===i?(r>24&255),n=0,i=0):(n=a>>>24,i+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===i?(r>=0&&(e[r--]=a>>24&255),n=0,i=0):(n=a>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.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},a.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},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,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)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){o("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){o("number"==typeof e&&e>=0);var r=e/26|0,n=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 o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,h=0|a[1],p=8191&h,v=h>>>13,b=0|a[2],y=8191&b,m=b>>>13,g=0|a[3],w=8191&g,_=g>>>13,x=0|a[4],k=8191&x,O=x>>>13,S=0|a[5],E=8191&S,j=S>>>13,I=0|a[6],P=8191&I,A=I>>>13,N=0|a[7],T=8191&N,R=N>>>13,M=0|a[8],C=8191&M,L=M>>>13,B=0|a[9],F=8191&B,D=B>>>13,U=0|c[0],z=8191&U,W=U>>>13,q=0|c[1],G=8191&q,J=q>>>13,H=0|c[2],V=8191&H,K=H>>>13,Y=0|c[3],Z=8191&Y,$=Y>>>13,Q=0|c[4],X=8191&Q,ee=Q>>>13,te=0|c[5],re=8191&te,ne=te>>>13,oe=0|c[6],ie=8191&oe,ae=oe>>>13,ce=0|c[7],se=8191&ce,ue=ce>>>13,le=0|c[8],fe=8191&le,de=le>>>13,he=0|c[9],pe=8191&he,ve=he>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(u+(n=Math.imul(f,z))|0)+((8191&(o=(o=Math.imul(f,W))+Math.imul(d,z)|0))<<13)|0;u=((i=Math.imul(d,W))+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(p,z),o=(o=Math.imul(p,W))+Math.imul(v,z)|0,i=Math.imul(v,W);var ye=(u+(n=n+Math.imul(f,G)|0)|0)+((8191&(o=(o=o+Math.imul(f,J)|0)+Math.imul(d,G)|0))<<13)|0;u=((i=i+Math.imul(d,J)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,z),o=(o=Math.imul(y,W))+Math.imul(m,z)|0,i=Math.imul(m,W),n=n+Math.imul(p,G)|0,o=(o=o+Math.imul(p,J)|0)+Math.imul(v,G)|0,i=i+Math.imul(v,J)|0;var me=(u+(n=n+Math.imul(f,V)|0)|0)+((8191&(o=(o=o+Math.imul(f,K)|0)+Math.imul(d,V)|0))<<13)|0;u=((i=i+Math.imul(d,K)|0)+(o>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(w,z),o=(o=Math.imul(w,W))+Math.imul(_,z)|0,i=Math.imul(_,W),n=n+Math.imul(y,G)|0,o=(o=o+Math.imul(y,J)|0)+Math.imul(m,G)|0,i=i+Math.imul(m,J)|0,n=n+Math.imul(p,V)|0,o=(o=o+Math.imul(p,K)|0)+Math.imul(v,V)|0,i=i+Math.imul(v,K)|0;var ge=(u+(n=n+Math.imul(f,Z)|0)|0)+((8191&(o=(o=o+Math.imul(f,$)|0)+Math.imul(d,Z)|0))<<13)|0;u=((i=i+Math.imul(d,$)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(k,z),o=(o=Math.imul(k,W))+Math.imul(O,z)|0,i=Math.imul(O,W),n=n+Math.imul(w,G)|0,o=(o=o+Math.imul(w,J)|0)+Math.imul(_,G)|0,i=i+Math.imul(_,J)|0,n=n+Math.imul(y,V)|0,o=(o=o+Math.imul(y,K)|0)+Math.imul(m,V)|0,i=i+Math.imul(m,K)|0,n=n+Math.imul(p,Z)|0,o=(o=o+Math.imul(p,$)|0)+Math.imul(v,Z)|0,i=i+Math.imul(v,$)|0;var we=(u+(n=n+Math.imul(f,X)|0)|0)+((8191&(o=(o=o+Math.imul(f,ee)|0)+Math.imul(d,X)|0))<<13)|0;u=((i=i+Math.imul(d,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(E,z),o=(o=Math.imul(E,W))+Math.imul(j,z)|0,i=Math.imul(j,W),n=n+Math.imul(k,G)|0,o=(o=o+Math.imul(k,J)|0)+Math.imul(O,G)|0,i=i+Math.imul(O,J)|0,n=n+Math.imul(w,V)|0,o=(o=o+Math.imul(w,K)|0)+Math.imul(_,V)|0,i=i+Math.imul(_,K)|0,n=n+Math.imul(y,Z)|0,o=(o=o+Math.imul(y,$)|0)+Math.imul(m,Z)|0,i=i+Math.imul(m,$)|0,n=n+Math.imul(p,X)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(v,X)|0,i=i+Math.imul(v,ee)|0;var _e=(u+(n=n+Math.imul(f,re)|0)|0)+((8191&(o=(o=o+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((i=i+Math.imul(d,ne)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,z),o=(o=Math.imul(P,W))+Math.imul(A,z)|0,i=Math.imul(A,W),n=n+Math.imul(E,G)|0,o=(o=o+Math.imul(E,J)|0)+Math.imul(j,G)|0,i=i+Math.imul(j,J)|0,n=n+Math.imul(k,V)|0,o=(o=o+Math.imul(k,K)|0)+Math.imul(O,V)|0,i=i+Math.imul(O,K)|0,n=n+Math.imul(w,Z)|0,o=(o=o+Math.imul(w,$)|0)+Math.imul(_,Z)|0,i=i+Math.imul(_,$)|0,n=n+Math.imul(y,X)|0,o=(o=o+Math.imul(y,ee)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(v,re)|0,i=i+Math.imul(v,ne)|0;var xe=(u+(n=n+Math.imul(f,ie)|0)|0)+((8191&(o=(o=o+Math.imul(f,ae)|0)+Math.imul(d,ie)|0))<<13)|0;u=((i=i+Math.imul(d,ae)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(T,z),o=(o=Math.imul(T,W))+Math.imul(R,z)|0,i=Math.imul(R,W),n=n+Math.imul(P,G)|0,o=(o=o+Math.imul(P,J)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,J)|0,n=n+Math.imul(E,V)|0,o=(o=o+Math.imul(E,K)|0)+Math.imul(j,V)|0,i=i+Math.imul(j,K)|0,n=n+Math.imul(k,Z)|0,o=(o=o+Math.imul(k,$)|0)+Math.imul(O,Z)|0,i=i+Math.imul(O,$)|0,n=n+Math.imul(w,X)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(_,X)|0,i=i+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,o=(o=o+Math.imul(y,ne)|0)+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0;var ke=(u+(n=n+Math.imul(f,se)|0)|0)+((8191&(o=(o=o+Math.imul(f,ue)|0)+Math.imul(d,se)|0))<<13)|0;u=((i=i+Math.imul(d,ue)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(C,z),o=(o=Math.imul(C,W))+Math.imul(L,z)|0,i=Math.imul(L,W),n=n+Math.imul(T,G)|0,o=(o=o+Math.imul(T,J)|0)+Math.imul(R,G)|0,i=i+Math.imul(R,J)|0,n=n+Math.imul(P,V)|0,o=(o=o+Math.imul(P,K)|0)+Math.imul(A,V)|0,i=i+Math.imul(A,K)|0,n=n+Math.imul(E,Z)|0,o=(o=o+Math.imul(E,$)|0)+Math.imul(j,Z)|0,i=i+Math.imul(j,$)|0,n=n+Math.imul(k,X)|0,o=(o=o+Math.imul(k,ee)|0)+Math.imul(O,X)|0,i=i+Math.imul(O,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(_,re)|0,i=i+Math.imul(_,ne)|0,n=n+Math.imul(y,ie)|0,o=(o=o+Math.imul(y,ae)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0,n=n+Math.imul(p,se)|0,o=(o=o+Math.imul(p,ue)|0)+Math.imul(v,se)|0,i=i+Math.imul(v,ue)|0;var Oe=(u+(n=n+Math.imul(f,fe)|0)|0)+((8191&(o=(o=o+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;u=((i=i+Math.imul(d,de)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,z),o=(o=Math.imul(F,W))+Math.imul(D,z)|0,i=Math.imul(D,W),n=n+Math.imul(C,G)|0,o=(o=o+Math.imul(C,J)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,J)|0,n=n+Math.imul(T,V)|0,o=(o=o+Math.imul(T,K)|0)+Math.imul(R,V)|0,i=i+Math.imul(R,K)|0,n=n+Math.imul(P,Z)|0,o=(o=o+Math.imul(P,$)|0)+Math.imul(A,Z)|0,i=i+Math.imul(A,$)|0,n=n+Math.imul(E,X)|0,o=(o=o+Math.imul(E,ee)|0)+Math.imul(j,X)|0,i=i+Math.imul(j,ee)|0,n=n+Math.imul(k,re)|0,o=(o=o+Math.imul(k,ne)|0)+Math.imul(O,re)|0,i=i+Math.imul(O,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,n=n+Math.imul(y,se)|0,o=(o=o+Math.imul(y,ue)|0)+Math.imul(m,se)|0,i=i+Math.imul(m,ue)|0,n=n+Math.imul(p,fe)|0,o=(o=o+Math.imul(p,de)|0)+Math.imul(v,fe)|0,i=i+Math.imul(v,de)|0;var Se=(u+(n=n+Math.imul(f,pe)|0)|0)+((8191&(o=(o=o+Math.imul(f,ve)|0)+Math.imul(d,pe)|0))<<13)|0;u=((i=i+Math.imul(d,ve)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,G),o=(o=Math.imul(F,J))+Math.imul(D,G)|0,i=Math.imul(D,J),n=n+Math.imul(C,V)|0,o=(o=o+Math.imul(C,K)|0)+Math.imul(L,V)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(T,Z)|0,o=(o=o+Math.imul(T,$)|0)+Math.imul(R,Z)|0,i=i+Math.imul(R,$)|0,n=n+Math.imul(P,X)|0,o=(o=o+Math.imul(P,ee)|0)+Math.imul(A,X)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(E,re)|0,o=(o=o+Math.imul(E,ne)|0)+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,n=n+Math.imul(k,ie)|0,o=(o=o+Math.imul(k,ae)|0)+Math.imul(O,ie)|0,i=i+Math.imul(O,ae)|0,n=n+Math.imul(w,se)|0,o=(o=o+Math.imul(w,ue)|0)+Math.imul(_,se)|0,i=i+Math.imul(_,ue)|0,n=n+Math.imul(y,fe)|0,o=(o=o+Math.imul(y,de)|0)+Math.imul(m,fe)|0,i=i+Math.imul(m,de)|0;var Ee=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;u=((i=i+Math.imul(v,ve)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,V),o=(o=Math.imul(F,K))+Math.imul(D,V)|0,i=Math.imul(D,K),n=n+Math.imul(C,Z)|0,o=(o=o+Math.imul(C,$)|0)+Math.imul(L,Z)|0,i=i+Math.imul(L,$)|0,n=n+Math.imul(T,X)|0,o=(o=o+Math.imul(T,ee)|0)+Math.imul(R,X)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(P,re)|0,o=(o=o+Math.imul(P,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(E,ie)|0,o=(o=o+Math.imul(E,ae)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,ae)|0,n=n+Math.imul(k,se)|0,o=(o=o+Math.imul(k,ue)|0)+Math.imul(O,se)|0,i=i+Math.imul(O,ue)|0,n=n+Math.imul(w,fe)|0,o=(o=o+Math.imul(w,de)|0)+Math.imul(_,fe)|0,i=i+Math.imul(_,de)|0;var je=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(o=(o=o+Math.imul(y,ve)|0)+Math.imul(m,pe)|0))<<13)|0;u=((i=i+Math.imul(m,ve)|0)+(o>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(F,Z),o=(o=Math.imul(F,$))+Math.imul(D,Z)|0,i=Math.imul(D,$),n=n+Math.imul(C,X)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(L,X)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(T,re)|0,o=(o=o+Math.imul(T,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(P,ie)|0,o=(o=o+Math.imul(P,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0,n=n+Math.imul(E,se)|0,o=(o=o+Math.imul(E,ue)|0)+Math.imul(j,se)|0,i=i+Math.imul(j,ue)|0,n=n+Math.imul(k,fe)|0,o=(o=o+Math.imul(k,de)|0)+Math.imul(O,fe)|0,i=i+Math.imul(O,de)|0;var Ie=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,ve)|0)+Math.imul(_,pe)|0))<<13)|0;u=((i=i+Math.imul(_,ve)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,X),o=(o=Math.imul(F,ee))+Math.imul(D,X)|0,i=Math.imul(D,ee),n=n+Math.imul(C,re)|0,o=(o=o+Math.imul(C,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(T,ie)|0,o=(o=o+Math.imul(T,ae)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,ae)|0,n=n+Math.imul(P,se)|0,o=(o=o+Math.imul(P,ue)|0)+Math.imul(A,se)|0,i=i+Math.imul(A,ue)|0,n=n+Math.imul(E,fe)|0,o=(o=o+Math.imul(E,de)|0)+Math.imul(j,fe)|0,i=i+Math.imul(j,de)|0;var Pe=(u+(n=n+Math.imul(k,pe)|0)|0)+((8191&(o=(o=o+Math.imul(k,ve)|0)+Math.imul(O,pe)|0))<<13)|0;u=((i=i+Math.imul(O,ve)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(F,re),o=(o=Math.imul(F,ne))+Math.imul(D,re)|0,i=Math.imul(D,ne),n=n+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,ae)|0,n=n+Math.imul(T,se)|0,o=(o=o+Math.imul(T,ue)|0)+Math.imul(R,se)|0,i=i+Math.imul(R,ue)|0,n=n+Math.imul(P,fe)|0,o=(o=o+Math.imul(P,de)|0)+Math.imul(A,fe)|0,i=i+Math.imul(A,de)|0;var Ae=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(o=(o=o+Math.imul(E,ve)|0)+Math.imul(j,pe)|0))<<13)|0;u=((i=i+Math.imul(j,ve)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,ie),o=(o=Math.imul(F,ae))+Math.imul(D,ie)|0,i=Math.imul(D,ae),n=n+Math.imul(C,se)|0,o=(o=o+Math.imul(C,ue)|0)+Math.imul(L,se)|0,i=i+Math.imul(L,ue)|0,n=n+Math.imul(T,fe)|0,o=(o=o+Math.imul(T,de)|0)+Math.imul(R,fe)|0,i=i+Math.imul(R,de)|0;var Ne=(u+(n=n+Math.imul(P,pe)|0)|0)+((8191&(o=(o=o+Math.imul(P,ve)|0)+Math.imul(A,pe)|0))<<13)|0;u=((i=i+Math.imul(A,ve)|0)+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(F,se),o=(o=Math.imul(F,ue))+Math.imul(D,se)|0,i=Math.imul(D,ue),n=n+Math.imul(C,fe)|0,o=(o=o+Math.imul(C,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0;var Te=(u+(n=n+Math.imul(T,pe)|0)|0)+((8191&(o=(o=o+Math.imul(T,ve)|0)+Math.imul(R,pe)|0))<<13)|0;u=((i=i+Math.imul(R,ve)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,fe),o=(o=Math.imul(F,de))+Math.imul(D,fe)|0,i=Math.imul(D,de);var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,ve)|0)+Math.imul(L,pe)|0))<<13)|0;u=((i=i+Math.imul(L,ve)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Me=(u+(n=Math.imul(F,pe))|0)+((8191&(o=(o=Math.imul(F,ve))+Math.imul(D,pe)|0))<<13)|0;return u=((i=Math.imul(D,ve))+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,s[0]=be,s[1]=ye,s[2]=me,s[3]=ge,s[4]=we,s[5]=_e,s[6]=xe,s[7]=ke,s[8]=Oe,s[9]=Se,s[10]=Ee,s[11]=je,s[12]=Ie,s[13]=Pe,s[14]=Ae,s[15]=Ne,s[16]=Te,s[17]=Re,s[18]=Me,0!==u&&(s[19]=u,r.length++),r};function m(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}r.words[i]=c,n=a,a=o}return 0!==n?r.words[i]=n:r.length--,r._strip()}function g(e,t,r){return m(e,t,r)}function w(e,t){this.x=e,this.y=t}Math.imul||(y=b),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):r<63?b(this,e,t):r<1024?m(this,e,t):g(this,e,t)},w.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},w.prototype.permute=function(e,t,r,n,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,r+=i/67108864|0,r+=a>>>26,this.words[n]=67108863&a}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>o&1}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,n=(e-r)/26,i=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!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=n);u--){var f=0|this.words[u];this.words[u]=l<<26-i|f>>>i,l=f&c}return s&&0!==l&&(s.words[s.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,r){return o(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){o("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(o(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 n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(o("number"==typeof e),o(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)-(s/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===c)return this._strip();for(o(-1===c),c=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,i=0|o.words[o.length-1];0!==(r=26-this._countBits(i))&&(o=o.ushln(r),n.iushln(r),i=0|o.words[o.length-1]);var c,s=n.length-o.length;if("mod"!==t){(c=new a(null)).length=s+1,c.words=new Array(c.length);for(var u=0;u=0;f--){var d=67108864*(0|n.words[o.length+f])+(0|n.words[o.length+f-1]);for(d=Math.min(d/i|0,67108863),n._ishlnsubmul(o,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,f),n.isZero()||(n.negative^=1);c&&(c.words[f]=d)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},a.prototype.divmod=function(e,t,r){return o(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(n=c.div.neg()),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.iadd(e)),{div:n,mod:i}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(n=c.div.neg()),{div:n,mod:c.mod}):0!=(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.isub(e)),{div:c.div,mod:i}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,i,c},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modrn=function(e){var t=e<0;t&&(e=-e),o(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*n+(0|this.words[i]))%e;return t?-n:n},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0;t&&(e=-e),o(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){o(0===e.negative),o(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new a(1),i=new a(0),c=new a(0),s=new a(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(l),i.isub(f)),n.iushrn(1),i.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;)(c.isOdd()||s.isOdd())&&(c.iadd(l),s.isub(f)),c.iushrn(1),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(c),i.isub(s)):(r.isub(t),c.isub(n),s.isub(i))}return{a:c,b:s,gcd:r.iushln(u)}},a.prototype._invmp=function(e){o(0===e.negative),o(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,i=new a(1),c=new a(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)c.isOdd()&&c.iadd(s),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(c)):(r.isub(t),c.isub(i))}return(n=0===t.cmpn(1)?i:c).cmpn(0)<0&&n.iadd(e),n},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){o("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,c&=67108863,this.words[a]=c}return 0!==i&&(this.words[a]=i,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,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),o(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){no&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new j(e)},a.prototype.toRed=function(e){return o(!this.red,"Already a number in reduction context"),o(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return o(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return o(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var _={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function O(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function j(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else o(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){j.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,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},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(k,x),k.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,o=i}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},k.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]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(_[e])return _[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new O;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return _[e]=t,t},j.prototype._verify1=function(e){o(0===e.negative,"red works only with positives"),o(e.red,"red works only with red numbers")},j.prototype._verify2=function(e,t){o(0==(e.negative|t.negative),"red works only with positives"),o(e.red&&e.red===t.red,"red works only with red numbers")},j.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(f(e,e.umod(this.m)._forceRed(this)),e)},j.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},j.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)},j.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},j.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)},j.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},j.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},j.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},j.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},j.prototype.isqr=function(e){return this.imul(e,e.clone())},j.prototype.sqr=function(e){return this.mul(e,e)},j.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(o(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);o(!n.isZero());var c=new a(1).toRed(this),s=c.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new a(2*l*l).toRed(this);0!==this.pow(l,u).cmp(s);)l.redIAdd(s);for(var f=this.pow(l,n),d=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),p=i;0!==h.cmp(c);){for(var v=h,b=0;0!==v.cmp(c);b++)v=v.redSqr();o(b=0;n--){for(var u=t.words[n],l=s-1;l>=0;l--){var f=u>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==f||0!==i?(i<<=1,i|=f,(4===++c||0===n&&0===l)&&(o=this.mul(o,r[i]),c=0,i=0)):c=0}s=26}return o},j.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},j.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new I(e)},i(I,j),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},I.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},I.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(131)(e))},function(e,t,r){"use strict";r(63);var n=r(164);r.d(t,"parseConnectionError",(function(){return n.d}));var o=r(402);r.o(o,"IJsonRpcProvider")&&r.d(t,"IJsonRpcProvider",(function(){return o.IJsonRpcProvider})),r.o(o,"formatJsonRpcError")&&r.d(t,"formatJsonRpcError",(function(){return o.formatJsonRpcError})),r.o(o,"formatJsonRpcRequest")&&r.d(t,"formatJsonRpcRequest",(function(){return o.formatJsonRpcRequest})),r.o(o,"formatJsonRpcResult")&&r.d(t,"formatJsonRpcResult",(function(){return o.formatJsonRpcResult})),r.o(o,"getBigIntRpcId")&&r.d(t,"getBigIntRpcId",(function(){return o.getBigIntRpcId})),r.o(o,"isHttpUrl")&&r.d(t,"isHttpUrl",(function(){return o.isHttpUrl})),r.o(o,"isJsonRpcError")&&r.d(t,"isJsonRpcError",(function(){return o.isJsonRpcError})),r.o(o,"isJsonRpcRequest")&&r.d(t,"isJsonRpcRequest",(function(){return o.isJsonRpcRequest})),r.o(o,"isJsonRpcResponse")&&r.d(t,"isJsonRpcResponse",(function(){return o.isJsonRpcResponse})),r.o(o,"isJsonRpcResult")&&r.d(t,"isJsonRpcResult",(function(){return o.isJsonRpcResult})),r.o(o,"isLocalhostUrl")&&r.d(t,"isLocalhostUrl",(function(){return o.isLocalhostUrl})),r.o(o,"isReactNative")&&r.d(t,"isReactNative",(function(){return o.isReactNative})),r.o(o,"isWsUrl")&&r.d(t,"isWsUrl",(function(){return o.isWsUrl})),r.o(o,"payloadId")&&r.d(t,"payloadId",(function(){return o.payloadId}));var i=r(403);r.d(t,"formatJsonRpcError",(function(){return i.a})),r.d(t,"formatJsonRpcRequest",(function(){return i.b})),r.d(t,"formatJsonRpcResult",(function(){return i.c})),r.d(t,"getBigIntRpcId",(function(){return i.d})),r.d(t,"payloadId",(function(){return i.e}));r(404);var a=r(405);r.o(a,"IJsonRpcProvider")&&r.d(t,"IJsonRpcProvider",(function(){return a.IJsonRpcProvider})),r.o(a,"isHttpUrl")&&r.d(t,"isHttpUrl",(function(){return a.isHttpUrl})),r.o(a,"isJsonRpcError")&&r.d(t,"isJsonRpcError",(function(){return a.isJsonRpcError})),r.o(a,"isJsonRpcRequest")&&r.d(t,"isJsonRpcRequest",(function(){return a.isJsonRpcRequest})),r.o(a,"isJsonRpcResponse")&&r.d(t,"isJsonRpcResponse",(function(){return a.isJsonRpcResponse})),r.o(a,"isJsonRpcResult")&&r.d(t,"isJsonRpcResult",(function(){return a.isJsonRpcResult})),r.o(a,"isLocalhostUrl")&&r.d(t,"isLocalhostUrl",(function(){return a.isLocalhostUrl})),r.o(a,"isReactNative")&&r.d(t,"isReactNative",(function(){return a.isReactNative})),r.o(a,"isWsUrl")&&r.d(t,"isWsUrl",(function(){return a.isWsUrl}));var c=r(409);r.d(t,"isHttpUrl",(function(){return c.a})),r.d(t,"isLocalhostUrl",(function(){return c.b})),r.d(t,"isWsUrl",(function(){return c.c}));var s=r(410);r.d(t,"isJsonRpcError",(function(){return s.a})),r.d(t,"isJsonRpcRequest",(function(){return s.b})),r.d(t,"isJsonRpcResponse",(function(){return s.c})),r.d(t,"isJsonRpcResult",(function(){return s.d}))},function(e,t,r){var n=r(731),o=r(400),i=r(237),a=r(732);e.exports=function(e){return n(e)||o(e)||i(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(t){return e.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(822),o=r(350),i=r(823),a=r(129),c=r(143),s=r(824);t.compare=n.compare,t.concat=o.concat,t.equals=i.equals,t.fromString=a.fromString,t.toString=c.toString,t.xor=s.xor},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return m})),r.d(t,"b",(function(){return x})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return w})),r.d(t,"e",(function(){return _})),r.d(t,"f",(function(){return S})),r.d(t,"g",(function(){return A})),r.d(t,"h",(function(){return I})),r.d(t,"i",(function(){return P}));var n=r(21),o=r.n(n),i=r(10),a=r.n(i),c=r(48),s=r.n(c),u=r(9),l=r.n(u),f=r(26),d=r.n(f),h=r(3),p=r.n(h),v=r(558),b=r.n(v),y=function(){var e,t=[];return{deliver:function(r){return l()(p.a.mark((function n(){return p.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t.push(r),e&&(e(t.shift()),e=void 0);case 2:case"end":return n.stop()}}),n)})))()},receive:function(){return new Promise((function(r){var n=t.shift();if(n)return r(n);e=r}))}}},m="INIT",g="SUBSCRIBE",w="UNSUBSCRIBE",_="UPDATED",x="SNAPSHOT",k="object"===("undefined"==typeof self?"undefined":d()(self))&&self.self===self&&self||"object"===(void 0===e?"undefined":d()(e))&&e.global===e&&e||"object"===("undefined"==typeof window?"undefined":d()(window))&&window.window===window&&window;k.FCL_REGISTRY=null==k.FCL_REGISTRY?{}:k.FCL_REGISTRY;var O=0,S=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(o,i){var a=n.expectReply||!1,c=null!=n.timeout?n.timeout:5e3;a&&c&&setTimeout((function(){return i(new Error("Timeout: ".concat(c,"ms passed without a response.")))}),c);var s={to:e,from:n.from,tag:t,data:r,timeout:c,reply:o,reject:i};try{k.FCL_REGISTRY[e]&&k.FCL_REGISTRY[e].mailbox.deliver(s),a||o(!0)}catch(t){console.error("FCL.Actor -- Could Not Deliver Message",s,k.FCL_REGISTRY[e],t)}}))},E=function(e){delete k.FCL_REGISTRY[e]},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(){var t=l()(p.a.mark((function t(r){var n;return p.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("function"!=typeof e[m]){t.next=3;break}return t.next=3,e[m](r);case 3:return t.next=6,r.receive();case 6:if(n=t.sent,t.prev=7,"EXIT"!==n.tag){t.next=13;break}if("function"!=typeof e.TERMINATE){t.next=12;break}return t.next=12,e.TERMINATE(r,n,n.data||{});case 12:return t.abrupt("break",25);case 13:return t.next=15,e[n.tag](r,n,n.data||{});case 15:t.next=20;break;case 17:t.prev=17,t.t0=t.catch(7),console.error("".concat(r.self()," Error"),n,t.t0);case 20:return t.prev=20,t.abrupt("continue",3);case 23:t.next=3;break;case 25:case"end":return t.stop()}}),t,null,[[7,17,20,23]])})));return function(e){return t.apply(this,arguments)}}()},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null==t&&(t=++O),null!=k.FCL_REGISTRY[t])return t;k.FCL_REGISTRY[t]={addr:t,mailbox:y(),subs:new Set,kvs:{},error:null};var r={self:function(){return t},receive:function(){return k.FCL_REGISTRY[t].mailbox.receive()},send:function(e,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return o.from=t,S(e,r,n,o)},sendSelf:function(e,r,n){k.FCL_REGISTRY[t]&&S(t,e,r,n)},broadcast:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.from=t;var o,i=s()(k.FCL_REGISTRY[t].subs);try{for(i.s();!(o=i.n()).done;){var a=o.value;S(a,e,r,n)}}catch(e){i.e(e)}finally{i.f()}},subscribe:function(e){return null!=e&&k.FCL_REGISTRY[t].subs.add(e)},unsubscribe:function(e){return null!=e&&k.FCL_REGISTRY[t].subs.delete(e)},subscriberCount:function(){return k.FCL_REGISTRY[t].subs.size},hasSubs:function(){return!!k.FCL_REGISTRY[t].subs.size},put:function(e,r){null!=e&&(k.FCL_REGISTRY[t].kvs[e]=r)},get:function(e,r){var n=k.FCL_REGISTRY[t].kvs[e];return null==n?r:n},delete:function(e){delete k.FCL_REGISTRY[t].kvs[e]},update:function(e,r){null!=e&&(k.FCL_REGISTRY[t].kvs[e]=r(k.FCL_REGISTRY[t].kvs[e]))},keys:function(){return Object.keys(k.FCL_REGISTRY[t].kvs)},all:function(){return k.FCL_REGISTRY[t].kvs},where:function(e){return Object.keys(k.FCL_REGISTRY[t].kvs).reduce((function(r,n){return e.test(n)?a()(a()({},r),{},o()({},n,k.FCL_REGISTRY[t].kvs[n])):r}),{})},merge:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(e).forEach((function(r){return k.FCL_REGISTRY[t].kvs[r]=e[r]}))},fatalError:function(e){k.FCL_REGISTRY[t].error=e;var r,n=s()(k.FCL_REGISTRY[t].subs);try{for(n.s();!(r=n.n()).done;){var o=r.value;S(o,_)}}catch(e){n.e(e)}finally{n.f()}}};return"object"===d()(e)&&(e=j(e)),b()(l()(p.a.mark((function n(){return p.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e(r);case 2:E(t);case 3:case"end":return n.stop()}}),n)})))),t};function P(e,t,r){t(e);var n=I(function(){var t=l()(p.a.mark((function t(n){var o,i;return p.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.send(e,g);case 1:return t.next=4,n.receive();case 4:if(o=t.sent,i=k.FCL_REGISTRY[e].error,"@EXIT"!==o.tag){t.next=9;break}return n.send(e,w),t.abrupt("return");case 9:if(!i){t.next=13;break}return r(null,i),n.send(e,w),t.abrupt("return");case 13:r(o.data,null),t.next=1;break;case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());return function(){return S(n,"@EXIT")}}function A(e,t){return t(e),S(e,x,null,{expectReply:!0,timeout:0})}}).call(this,r(46))},function(e,t,r){"use strict";r.r(t),r.d(t,"getAddress",(function(){return v})),r.d(t,"isAddress",(function(){return b})),r.d(t,"getIcapAddress",(function(){return y})),r.d(t,"getContractAddress",(function(){return m})),r.d(t,"getCreate2Address",(function(){return g}));var n=r(2),o=r(37),i=r(31),a=r(78),c=new(r(5).Logger)("address/5.7.0");function s(e){Object(n.isHexString)(e,20)||c.throwArgumentError("invalid address","address",e);for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),o=0;o<40;o++)r[o]=t[o].charCodeAt(0);for(var a=Object(n.arrayify)(Object(i.keccak256)(r)),s=0;s<40;s+=2)a[s>>1]>>4>=8&&(t[s]=t[s].toUpperCase()),(15&a[s>>1])>=8&&(t[s+1]=t[s+1].toUpperCase());return"0x"+t.join("")}for(var u={},l=0;l<10;l++)u[String(l)]=String(l);for(var f=0;f<26;f++)u[String.fromCharCode(65+f)]=String(10+f);var d,h=Math.floor((d=9007199254740991,Math.log10?Math.log10(d):Math.log(d)/Math.LN10));function p(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return u[e]})).join("");t.length>=h;){var r=t.substring(0,h);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function v(e){var t=null;if("string"!=typeof e&&c.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=s(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&c.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&c.throwArgumentError("bad icap checksum","address",e),t=Object(o.c)(e.substring(4));t.length<40;)t="0"+t;t=s("0x"+t)}else c.throwArgumentError("invalid address","address",e);return t}function b(e){try{return v(e),!0}catch(e){}return!1}function y(e){for(var t=Object(o.b)(v(e).substring(2)).toUpperCase();t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t}function m(e){var t=null;try{t=v(e.from)}catch(t){c.throwArgumentError("missing from address","transaction",e)}var r=Object(n.stripZeros)(Object(n.arrayify)(o.a.from(e.nonce).toHexString()));return v(Object(n.hexDataSlice)(Object(i.keccak256)(Object(a.encode)([t,r])),12))}function g(e,t,r){return 32!==Object(n.hexDataLength)(t)&&c.throwArgumentError("salt must be 32 bytes","salt",t),32!==Object(n.hexDataLength)(r)&&c.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),v(Object(n.hexDataSlice)(Object(i.keccak256)(Object(n.concat)(["0xff",v(e),t,r])),12))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(41),o=r(187),i=r(98),a=r(163);function c(e){return(c="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)}var s=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}var t;return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r=this._parentOrParents,c=this._ctorUnsubscribe,s=this._unsubscribe,l=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof e)r.remove(this);else if(null!==r)for(var f=0;f2&&(c.children=arguments.length>3?n.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===c[a]&&(c[a]=e.defaultProps[a]);return m(e,c,o,i,null)}function m(e,t,r,n,a){var c={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++i:a};return null==a&&null!=o.vnode&&o.vnode(c),c}function g(){return{current:null}}function w(e){return e.children}function _(e,t){this.props=e,this.context=t}function x(e,t){if(null==t)return e.__?x(e.__,e.__.__k.indexOf(e)+1):null;for(var r;tt&&c.sort(l));S.__r=0}function E(e,t,r,n,o,i,a,c,s,u){var l,f,p,v,b,y,g,_=n&&n.__k||h,k=_.length;for(r.__k=[],l=0;l0?m(v.type,v.props,v.key,v.ref?v.ref:null,v.__v):v)){if(v.__=r,v.__b=r.__b+1,null===(p=_[l])||p&&v.key==p.key&&v.type===p.type)_[l]=void 0;else for(f=0;f=0;t--)if((r=e.__k[t])&&(n=A(r)))return n;return null}function N(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||p.test(t)?r:r+"px"}function T(e,t,r,n,o){var i;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||N(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||N(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n||e.addEventListener(t,i?M:R,i):e.removeEventListener(t,i?M:R,i);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,r))}}function R(e){return this.l[e.type+!1](o.event?o.event(e):e)}function M(e){return this.l[e.type+!0](o.event?o.event(e):e)}function C(e,t,r,n,i,a,c,s,u){var l,f,d,h,p,b,y,m,g,x,k,O,S,j,I,P=t.type;if(void 0!==t.constructor)return null;null!=r.__h&&(u=r.__h,s=t.__e=r.__e,t.__h=null,a=[s]),(l=o.__b)&&l(t);try{e:if("function"==typeof P){if(m=t.props,g=(l=P.contextType)&&n[l.__c],x=l?g?g.props.value:l.__:n,r.__c?y=(f=t.__c=r.__c).__=f.__E:("prototype"in P&&P.prototype.render?t.__c=f=new P(m,x):(t.__c=f=new _(m,x),f.constructor=P,f.render=U),g&&g.sub(f),f.props=m,f.state||(f.state={}),f.context=x,f.__n=n,d=f.__d=!0,f.__h=[],f._sb=[]),null==f.__s&&(f.__s=f.state),null!=P.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=v({},f.__s)),v(f.__s,P.getDerivedStateFromProps(m,f.__s))),h=f.props,p=f.state,f.__v=t,d)null==P.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(null==P.getDerivedStateFromProps&&m!==h&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(m,x),!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(m,f.__s,x)||t.__v===r.__v){for(t.__v!==r.__v&&(f.props=m,f.state=f.__s,f.__d=!1),f.__e=!1,t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),k=0;k2&&(c.children=arguments.length>3?n.call(arguments,2):r),m(e.type,c,o||e.key,i||e.ref,null)}function G(e,t){var r={__c:t="__cC"+f++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,n;return this.getChildContext||(r=[],(n={})[t]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some((function(e){e.__e=!0,O(e)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}n=h.slice,o={__e:function(e,t,r,n){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,n||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},i=0,a=function(e){return null!=e&&void 0===e.constructor},_.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof e&&(e=e(v({},r),this.props)),e&&v(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),O(this))},_.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),O(this))},_.prototype.render=w,c=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},S.__r=0,f=0},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.ICONIC_SPRITE_URL=void 0,o(r(590),t);var i=r(146);Object.defineProperty(t,"ICONIC_SPRITE_URL",{enumerable:!0,get:function(){return i.ICONIC_SPRITE_URL}}),o(r(598),t)},function(e,t,r){"use strict";r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return f}));var n=r(8),o=r(16),i=r(12),a=r(30),c=r(90),s=r(270),u=r(162),l=function(e){function t(t){var r=e.call(this,t)||this;return r.destination=t,r}return n.__extends(t,e),t}(i.a),f=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return n.__extends(t,e),t.prototype[u.a]=function(){return new l(this)},t.prototype.lift=function(e){var t=new d(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new c.a;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),o=0;o=9007199254740991||t<=-9007199254740991)&&g("overflow","BigNumber.from",t),e.from(String(t));var r=t;if("bigint"==typeof r)return e.from(r.toString());if(Object(i.isBytes)(r))return e.from(Object(i.hexlify)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"==typeof n)return e.from(n)}else{var o=r._hex;if(null==o&&"BigNumber"===r.type&&(o=r.hex),"string"==typeof o&&(Object(i.isHexString)(o)||"-"===o[0]&&Object(i.isHexString)(o.substring(1))))return e.from(o)}return f.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}],(r=[{key:"fromTwos",value:function(e){return y(m(this).fromTwos(e))}},{key:"toTwos",value:function(e){return y(m(this).toTwos(e))}},{key:"abs",value:function(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}},{key:"add",value:function(e){return y(m(this).add(m(e)))}},{key:"sub",value:function(e){return y(m(this).sub(m(e)))}},{key:"div",value:function(t){return e.from(t).isZero()&&g("division-by-zero","div"),y(m(this).div(m(t)))}},{key:"mul",value:function(e){return y(m(this).mul(m(e)))}},{key:"mod",value:function(e){var t=m(e);return t.isNeg()&&g("division-by-zero","mod"),y(m(this).umod(t))}},{key:"pow",value:function(e){var t=m(e);return t.isNeg()&&g("negative-power","pow"),y(m(this).pow(t))}},{key:"and",value:function(e){var t=m(e);return(this.isNegative()||t.isNeg())&&g("unbound-bitwise-result","and"),y(m(this).and(t))}},{key:"or",value:function(e){var t=m(e);return(this.isNegative()||t.isNeg())&&g("unbound-bitwise-result","or"),y(m(this).or(t))}},{key:"xor",value:function(e){var t=m(e);return(this.isNegative()||t.isNeg())&&g("unbound-bitwise-result","xor"),y(m(this).xor(t))}},{key:"mask",value:function(e){return(this.isNegative()||e<0)&&g("negative-width","mask"),y(m(this).maskn(e))}},{key:"shl",value:function(e){return(this.isNegative()||e<0)&&g("negative-width","shl"),y(m(this).shln(e))}},{key:"shr",value:function(e){return(this.isNegative()||e<0)&&g("negative-width","shr"),y(m(this).shrn(e))}},{key:"eq",value:function(e){return m(this).eq(m(e))}},{key:"lt",value:function(e){return m(this).lt(m(e))}},{key:"lte",value:function(e){return m(this).lte(m(e))}},{key:"gt",value:function(e){return m(this).gt(m(e))}},{key:"gte",value:function(e){return m(this).gte(m(e))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return m(this).isZero()}},{key:"toNumber",value:function(){try{return m(this).toNumber()}catch(e){g("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(e){}return f.throwError("this platform does not support BigInt",a.Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?p||(p=!0,f.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?f.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",a.Logger.errors.UNEXPECTED_ARGUMENT,{}):f.throwError("BigNumber.toString does not accept parameters",a.Logger.errors.UNEXPECTED_ARGUMENT,{})),m(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}])&&u(t.prototype,r),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function b(e){if("string"!=typeof e)return b(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&f.throwArgumentError("invalid hex","value",e),"0x00"===(e=b(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 y(e){return v.from(b(e))}function m(e){var t=v.from(e).toHexString();return"-"===t[0]?new l("-"+t.substring(3),16):new l(t.substring(2),16)}function g(e,t,r){var n={fault:e,operation:t};return null!=r&&(n.value=r),f.throwError(e,a.Logger.errors.NUMERIC_FAULT,n)}function w(e){return new l(e,36).toString(16)}function _(e){return new l(e,16).toString(36)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;var n=r(8),o=n.__importDefault(r(140));Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return o.default}}),n.__exportStar(r(430),t),n.__exportStar(r(795),t)},function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return i}));var n=r(112),o=new(r(109).a)(n.a),i=o},function(e,t,r){"use strict";r.r(t),r.d(t,"TransactionTypes",(function(){return n})),r.d(t,"computeAddress",(function(){return m})),r.d(t,"recoverAddress",(function(){return g})),r.d(t,"accessListify",(function(){return x})),r.d(t,"serialize",(function(){return E})),r.d(t,"parse",(function(){return I}));var n,o=r(29),i=r(37),a=r(2),c=r(119),s=r(31),u=r(4),l=r(78),f=r(74),d=r(5),h=new d.Logger("transactions/5.7.0");function p(e){return"0x"===e?null:Object(o.getAddress)(e)}function v(e){return"0x"===e?c.h:i.a.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(n||(n={}));var b=[{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"}],y={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function m(e){var t=Object(f.computePublicKey)(e);return Object(o.getAddress)(Object(a.hexDataSlice)(Object(s.keccak256)(Object(a.hexDataSlice)(t,1)),12))}function g(e,t){return m(Object(f.recoverPublicKey)(Object(a.arrayify)(e),t))}function w(e,t){var r=Object(a.stripZeros)(i.a.from(e).toHexString());return r.length>32&&h.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function _(e,t){return{address:Object(o.getAddress)(e),storageKeys:(t||[]).map((function(t,r){return 32!==Object(a.hexDataLength)(t)&&h.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(r,"]"),t),t.toLowerCase()}))}}function x(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&h.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),_(e[0],e[1])):_(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 _(t,Object.keys(r).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function k(e){return x(e).map((function(e){return[e.address,e.storageKeys]}))}function O(e,t){if(null!=e.gasPrice){var r=i.a.from(e.gasPrice),n=i.a.from(e.maxFeePerGas||0);r.eq(n)||h.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}var c=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),w(e.maxFeePerGas||0,"maxFeePerGas"),w(e.gasLimit||0,"gasLimit"),null!=e.to?Object(o.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",k(e.accessList||[])];if(t){var s=Object(a.splitSignature)(t);c.push(w(s.recoveryParam,"recoveryParam")),c.push(Object(a.stripZeros)(s.r)),c.push(Object(a.stripZeros)(s.s))}return Object(a.hexConcat)(["0x02",l.encode(c)])}function S(e,t){var r=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.gasPrice||0,"gasPrice"),w(e.gasLimit||0,"gasLimit"),null!=e.to?Object(o.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",k(e.accessList||[])];if(t){var n=Object(a.splitSignature)(t);r.push(w(n.recoveryParam,"recoveryParam")),r.push(Object(a.stripZeros)(n.r)),r.push(Object(a.stripZeros)(n.s))}return Object(a.hexConcat)(["0x01",l.encode(r)])}function E(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&h.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){Object(u.checkProperties)(e,y);var r=[];b.forEach((function(t){var n=e[t.name]||[],o={};t.numeric&&(o.hexPad="left"),n=Object(a.arrayify)(Object(a.hexlify)(n,o)),t.length&&n.length!==t.length&&n.length>0&&h.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Object(a.stripZeros)(n)).length>t.maxLength&&h.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),r.push(Object(a.hexlify)(n))}));var n=0;if(null!=e.chainId?"number"!=typeof(n=e.chainId)&&h.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!Object(a.isBytesLike)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(Object(a.hexlify)(n)),r.push("0x"),r.push("0x")),!t)return l.encode(r);var o=Object(a.splitSignature)(t),i=27+o.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),i+=2*n+8,o.v>28&&o.v!==i&&h.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):o.v!==i&&h.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(Object(a.hexlify)(i)),r.push(Object(a.stripZeros)(Object(a.arrayify)(o.r))),r.push(Object(a.stripZeros)(Object(a.arrayify)(o.s))),l.encode(r)}(e,t);switch(e.type){case 1:return S(e,t);case 2:return O(e,t)}return h.throwError("unsupported transaction type: ".concat(e.type),d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function j(e,t,r){try{var n=v(t[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");e.v=n}catch(e){h.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Object(a.hexZeroPad)(t[1],32),e.s=Object(a.hexZeroPad)(t[2],32);try{var o=Object(s.keccak256)(r(e));e.from=g(o,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function I(e){var t=Object(a.arrayify)(e);if(t[0]>127)return function(e){var t=l.decode(e);9!==t.length&&6!==t.length&&h.throwArgumentError("invalid raw transaction","rawTransaction",e);var r={nonce:v(t[0]).toNumber(),gasPrice:v(t[1]),gasLimit:v(t[2]),to:p(t[3]),value:v(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=i.a.from(t[6]).toNumber()}catch(e){return r}if(r.r=Object(a.hexZeroPad)(t[7],32),r.s=Object(a.hexZeroPad)(t[8],32),i.a.from(r.r).isZero()&&i.a.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,o=t.slice(0,6);0!==r.chainId&&(o.push(Object(a.hexlify)(r.chainId)),o.push("0x"),o.push("0x"),n-=2*r.chainId+8);var c=Object(s.keccak256)(l.encode(o));try{r.from=g(c,{r:Object(a.hexlify)(r.r),s:Object(a.hexlify)(r.s),recoveryParam:n})}catch(e){}r.hash=Object(s.keccak256)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){var t=l.decode(e.slice(1));8!==t.length&&11!==t.length&&h.throwArgumentError("invalid component count for transaction type: 1","payload",Object(a.hexlify)(e));var r={type:1,chainId:v(t[0]).toNumber(),nonce:v(t[1]).toNumber(),gasPrice:v(t[2]),gasLimit:v(t[3]),to:p(t[4]),value:v(t[5]),data:t[6],accessList:x(t[7])};return 8===t.length||(r.hash=Object(s.keccak256)(e),j(r,t.slice(8),S)),r}(t);case 2:return function(e){var t=l.decode(e.slice(1));9!==t.length&&12!==t.length&&h.throwArgumentError("invalid component count for transaction type: 2","payload",Object(a.hexlify)(e));var r=v(t[2]),n=v(t[3]),o={type:2,chainId:v(t[0]).toNumber(),nonce:v(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:v(t[4]),to:p(t[5]),value:v(t[6]),data:t[7],accessList:x(t[8])};return 9===t.length||(o.hash=Object(s.keccak256)(e),j(o,t.slice(9),O)),o}(t)}return h.throwError("unsupported transaction type: ".concat(t[0]),d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}()},function(e,t,r){"use strict";r.r(t),r.d(t,"getWalletBookWallet",(function(){return i})),r.d(t,"getWalletIconUrl",(function(){return s})),r.d(t,"getWalletLinks",(function(){return u})),r.d(t,"getWalletPrimaryColor",(function(){return l})),r.d(t,"useWalletBook",(function(){return o})),r.d(t,"WalletIcon",(function(){return m}));r(35),r(1);var n=r(549),o=function(){return n};var i=function(e){var t,r,n=o(),i=null!==(r=null==(t=e)?void 0:t.toLowerCase().replace(/\W/g,""))&&void 0!==r?r:"undefined-wallet",a=n.wallets[i];if(!a)throw new Error("Wallet ".concat(e," not found in wallet book"));return a},a={iconicUrl:"https://iconic.dynamic-static-assets.com/icons/sprite.svg#{{id}}",walletConnectUrl:"https://registry.walletconnect.org/v2/logo/sm/{{id}}",iosUrl:"https://apps.apple.com/app/apple-store/{{id}}",androidUrl:"https://play.google.com/store/apps/details?id={{id}}",chromeUrl:"https://chrome.google.com/webstore/detail/{{id}}",firefoxUrl:"https://addons.mozilla.org/en-US/firefox/addon/{{id}}",edgeUrl:"https://microsoftedge.microsoft.com/addons/detail/{{id}}"},c=function(e,t){return t?a[e].replace("{{id}}",t):""},s=function(e){var t,r,n=i(e);return null!=n&&null!==(t=n.brand)&&void 0!==t&&t.spriteId?c("iconicUrl",n.brand.spriteId):null!=n&&null!==(r=n.brand)&&void 0!==r&&r.imageId?c("walletConnectUrl",n.brand.imageId):""},u=function(e){var t,r,n,o,a,s,u,l,f=i(e);return f?{android:c("androidUrl",null===(t=f.mobile)||void 0===t?void 0:t.androidId),brave:c("chromeUrl",null===(r=f.desktop)||void 0===r?void 0:r.chromeId),chrome:c("chromeUrl",null===(n=f.desktop)||void 0===n?void 0:n.chromeId),edge:null!==(o=c("edgeUrl",null===(a=f.desktop)||void 0===a?void 0:a.edgeId))&&void 0!==o?o:c("chromeUrl",null===(s=f.desktop)||void 0===s?void 0:s.chromeId),firefox:c("firefoxUrl",null===(u=f.desktop)||void 0===u?void 0:u.firefoxId),ios:c("iosUrl",null===(l=f.mobile)||void 0===l?void 0:l.iosId)}:{brave:"",android:"",chrome:"",edge:"",firefox:"",ios:""}},l=function(e){var t,r=i(e);return null==r||null===(t=r.brand)||void 0===t?void 0:t.primaryColor},f=r(0);function d(e){return(d="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)}var h=["walletName","children"];function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var m=function(e){var t=e.walletName,r=e.children,n=y(e,h),o=i(t);return o&&o.brand?Object(f.jsx)("img",v(v({"data-testid":"wallet-icon-".concat(t)},n),{},{alt:o.brand.alt,src:s(t)})):Object(f.jsx)(f.Fragment,{children:r})}},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)}var o,i="object"===("undefined"==typeof Reflect?"undefined":n(Reflect))?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};o=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 c=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 o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}m(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&m(e,"error",t,r)}(e,o,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+n(e))}function f(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var o,i,a,c;if(l(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),a=i[t]),void 0===a)a=i[t]=r,++e._eventsCount;else if("function"==typeof a?a=i[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=f(e))>0&&a.length>o&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,c=s,console&&console.warn&&console.warn(c)}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 p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=h.bind(n);return o.listener=r,n.wrapFn=o,o}function v(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(i=t[0]),i instanceof Error)throw i;var c=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw c.context=i,c}var s=o[e];if(void 0===s)return!1;if("function"==typeof s)a(s,this,t);else{var u=s.length,l=y(s,u);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return v(this,e,!0)},s.prototype.rawListeners=function(e){return v(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):b.call(e,t)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]}},function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"g",(function(){return i})),r.d(t,"a",(function(){return a})),r.d(t,"f",(function(){return c})),r.d(t,"e",(function(){return s})),r.d(t,"i",(function(){return u})),r.d(t,"j",(function(){return l})),r.d(t,"h",(function(){return n})),r.d(t,"d",(function(){return f})),r.d(t,"c",(function(){return d})),r.d(t,"k",(function(){return h})),r.d(t,"l",(function(){return p}));var n=512,o=256,i=256,a="AES-CBC",c="SHA-".concat(o),s="HMAC",u="SHA-256",l="SHA-512",f=("aes-".concat(o,"-cbc"),"sha".concat(i),"encrypt"),d="decrypt",h="sign",p="verify"},function(e,t,r){"use strict";r.d(t,"d",(function(){return h})),r.d(t,"a",(function(){return p})),r.d(t,"c",(function(){return v})),r.d(t,"b",(function(){return b}));var n=r(2),o=r(37),i=r(4),a=r(5),c=r(107);function s(e){return(s="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)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var r=0;rthis.wordSize&&d.throwError("value out-of-bounds",a.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(n.concat)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){e._data[t]=e._getValue(r)}}}]),e}(),b=function(){function e(t,r,o,a){u(this,e),Object(i.defineReadOnly)(this,"_data",Object(n.arrayify)(t)),Object(i.defineReadOnly)(this,"wordSize",r||32),Object(i.defineReadOnly)(this,"_coerceFunc",o),Object(i.defineReadOnly)(this,"allowLoose",a),this._offset=0}return f(e,[{key:"data",get:function(){return Object(n.hexlify)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,r){return this._coerceFunc?this._coerceFunc(t,r):e.coerce(t,r)}},{key:"_peekBytes",value:function(e,t,r){var n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:d.throwError("data out-of-bounds",a.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}},{key:"readValue",value:function(){return o.a.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}()},function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":r(window))&&(n=window)}e.exports=n},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(8),o=r(12);function i(e,t){return function(r){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new a(e,t))}}var a=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.project,this.thisArg))},e}(),c=function(e){function t(t,r,n){var o=e.call(this,t)||this;return o.project=r,o.count=0,o.thisArg=n||o,o}return n.__extends(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(o.a)},function(e,t,r){var n=r(237);e.exports=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=n(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";r.r(t),r.d(t,"defaultPath",(function(){return O})),r.d(t,"HDNode",(function(){return S})),r.d(t,"mnemonicToSeed",(function(){return E})),r.d(t,"mnemonicToEntropy",(function(){return j})),r.d(t,"entropyToMnemonic",(function(){return I})),r.d(t,"isValidMnemonic",(function(){return P})),r.d(t,"getAccountPath",(function(){return A}));var n=r(106),o=r(2),i=r(37),a=r(51),c=r(1149),s=r(4),u=r(74),l=r(159),f=r(254),d=r(40),h=r(1154);function p(e){return(p="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)}function v(e,t){for(var r=0;r64)throw new Error("invalid seed");var i=Object(o.arrayify)(Object(l.a)(f.a.sha512,m,n));return new e(k,w(i.slice(0,32)),null,"0x00000000",w(i.slice(32)),0,0,r)}},{key:"fromMnemonic",value:function(t,r,n){return t=I(j(t,n=x(n)),n),e._fromSeed(E(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=n.Base58.decode(t);82===r.length&&_(r.slice(0,78))===t||b.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var i=r[4],a=Object(o.hexlify)(r.slice(5,9)),c=parseInt(Object(o.hexlify)(r.slice(9,13)).substring(2),16),s=Object(o.hexlify)(r.slice(13,45)),u=r.slice(45,78);switch(Object(o.hexlify)(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new e(k,null,Object(o.hexlify)(u),a,s,c,i,null);case"0x0488ade4":case"0x04358394 ":if(0!==u[0])break;return new e(k,Object(o.hexlify)(u.slice(1)),null,a,s,c,i,null)}return b.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}],(r=[{key:"extendedKey",get:function(){if(this.depth>=256)throw new Error("Depth too large!");return _(Object(o.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(o.hexlify)(this.depth),this.parentFingerprint,Object(o.hexZeroPad)(Object(o.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?Object(o.concat)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new e(k,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(2147483648&t){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(Object(o.arrayify)(this.privateKey),1),r&&(r+="'")}else n.set(Object(o.arrayify)(this.publicKey));for(var a=24;a>=0;a-=8)n[33+(a>>3)]=t>>24-a&255;var c=Object(o.arrayify)(Object(l.a)(f.a.sha512,this.chainCode,n)),s=c.slice(0,32),d=c.slice(32),h=null,p=null;this.privateKey?h=w(i.a.from(s).add(this.privateKey).mod(y)):p=new u.SigningKey(Object(o.hexlify)(s))._addPoint(this.publicKey);var v=r,b=this.mnemonic;return b&&(v=Object.freeze({phrase:b.phrase,path:r,locale:b.locale||"en"})),new e(k,h,p,this.fingerprint,w(d),t,this.depth+1,v)}},{key:"derivePath",value:function(e){var t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();for(var r=this,n=0;n=2147483648)throw new Error("invalid path index - "+o);r=r._derive(2147483648+i)}else{if(!o.match(/^[0-9]+$/))throw new Error("invalid path component - "+o);var a=parseInt(o);if(a>=2147483648)throw new Error("invalid path index - "+o);r=r._derive(a)}}return r}}])&&v(t.prototype,r),a&&v(t,a),Object.defineProperty(t,"prototype",{writable:!1}),e}();function E(e,t){t||(t="");var r=Object(a.f)("mnemonic"+t,a.a.NFKD);return Object(c.a)(Object(a.f)(e,a.a.NFKD),r,2048,64,"sha512")}function j(e,t){t=x(t),b.checkNormalize();var r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");for(var n=Object(o.arrayify)(new Uint8Array(Math.ceil(11*r.length/8))),i=0,a=0;a>3]|=1<<7-i%8),i++}var u=32*r.length/3,f=g(r.length/3);if((Object(o.arrayify)(Object(l.c)(n.slice(0,u/8)))[0]&f)!==(n[n.length-1]&f))throw new Error("invalid checksum");return Object(o.hexlify)(n.slice(0,u/8))}function I(e,t){if(t=x(t),(e=Object(o.arrayify)(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");for(var r=[0],n=11,i=0;i8?(r[r.length-1]<<=8,r[r.length-1]|=e[i],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[i]>>8-n,r.push(e[i]&(1<<8-n)-1),n+=3);var a=e.length/4,c=Object(o.arrayify)(Object(l.c)(e))[0]&g(a);return r[r.length-1]<<=a,r[r.length-1]|=c>>8-a,t.join(r.map((function(e){return t.getWord(e)})))}function P(e,t){try{return j(e,t),!0}catch(e){}return!1}function A(e){return("number"!=typeof e||e<0||e>=2147483648||e%1)&&b.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}},function(e,t,r){"use strict";function n(e){return e&&"function"==typeof e.schedule}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return s})),r.d(t,"f",(function(){return l})),r.d(t,"d",(function(){return d})),r.d(t,"e",(function(){return h})),r.d(t,"h",(function(){return p})),r.d(t,"g",(function(){return v}));var n,o,i=r(2),a=new(r(5).Logger)("strings/5.7.0");function c(e,t,r,n,i){if(e===o.BAD_PREFIX||e===o.UNEXPECTED_CONTINUE){for(var a=0,c=t+1;c>6==2;c++)a++;return a}return e===o.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(n||(n={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(o||(o={}));var s=Object.freeze({error:function(e,t,r,n,o){return a.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:c,replace:function(e,t,r,n,i){return e===o.OVERLONG?(n.push(i),0):(n.push(65533),c(e,t,r))}});function u(e,t){null==t&&(t=s.error),e=Object(i.arrayify)(e);for(var r=[],n=0;n>7!=0){var c=null,u=null;if(192==(224&a))c=1,u=127;else if(224==(240&a))c=2,u=2047;else{if(240!=(248&a)){n+=t(128==(192&a)?o.UNEXPECTED_CONTINUE:o.BAD_PREFIX,n-1,e,r);continue}c=3,u=65535}if(n-1+c>=e.length)n+=t(o.OVERRUN,n-1,e,r);else{for(var l=a&(1<<8-c-1)-1,f=0;f1114111?n+=t(o.OUT_OF_RANGE,n-1-c,e,r,l):l>=55296&&l<=57343?n+=t(o.UTF16_SURROGATE,n-1-c,e,r,l):l<=u?n+=t(o.OVERLONG,n-1-c,e,r,l):r.push(l))}}else r.push(a)}return r}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.current;t!=n.current&&(a.checkNormalize(),e=e.normalize(t));for(var r=[],o=0;o>6|192),r.push(63&c|128);else if(55296==(64512&c)){o++;var s=e.charCodeAt(o);if(o>=e.length||56320!=(64512&s))throw new Error("invalid utf-8 string");var u=65536+((1023&c)<<10)+(1023&s);r.push(u>>18|240),r.push(u>>12&63|128),r.push(u>>6&63|128),r.push(63&u|128)}else r.push(c>>12|224),r.push(c>>6&63|128),r.push(63&c|128)}return Object(i.arrayify)(r)}function f(e){var t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function d(e,t){return'"'+u(e,t).map((function(e){if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?f(e):f(55296+((e-=65536)>>10&1023))+f(56320+(1023&e))})).join("")+'"'}function h(e){return e.map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function p(e,t){return h(u(e,t))}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.current;return u(l(e,t))}},function(e,t,r){"use strict";r.d(t,"d",(function(){return x})),r.d(t,"g",(function(){return O})),r.d(t,"e",(function(){return E})),r.d(t,"c",(function(){return j})),r.d(t,"a",(function(){return N})),r.d(t,"f",(function(){return T})),r.d(t,"b",(function(){return M}));var n=r(37),o=r(4),i=r(5),a=r(107);function c(e){return(c="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)}function s(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function u(e,t){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d(e);if(t){var o=d(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}function f(e,t){if(t&&("object"===c(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var r=0;r=0||"tuple"===e)&&g[t])return!0;return(m[t]||"payable"===t)&&b.throwArgumentError("invalid modifier","name",t),!1}function _(e,t){for(var r in t)Object(o.defineReadOnly)(e,r,t[r])}var x=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),k=new RegExp(/^(.*)\[([0-9]*)\]$/),O=function(){function e(t,r){h(this,e),t!==y&&b.throwError("use fromString",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),_(this,r);var n=this.type.match(k);_(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 v(e,[{key:"format",value:function(e){if(e||(e=x.sighash),x[e]||b.throwArgumentError("invalid format type","format",e),e===x.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!==x.sighash&&(r+=this.type),r+="("+this.components.map((function(t){return t.format(e)})).join(e===x.full?", ":",")+")"):r+=this.type,e!==x.sighash&&(!0===this.indexed&&(r+=" indexed"),e===x.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(y,{name:t.name||null,type:C(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 function(t){return e.fromObject({name:t.name,type:t.type,indexed:t.indexed,components:t.components})}(function(e,t){var r=e;function n(t){b.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function o(e){var r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");for(var i={type:"",name:"",state:{allowType:!0}},a=i,c=0;c2&&b.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||b.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=n.a.from(r[1]),r[0]):e}function P(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 A(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&&b.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&b.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||b.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&&b.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&&b.throwArgumentError("unable to determine stateMutability","value",e),t}var N=function(e){s(r,e);var t=l(r);function r(){return h(this,r),t.apply(this,arguments)}return v(r,[{key:"format",value:function(e){if(e||(e=x.sighash),x[e]||b.throwArgumentError("invalid format type","format",e),e===x.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===x.sighash&&b.throwError("cannot format a constructor for sighash",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===x.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&&b.throwArgumentError("invalid constructor object","value",e);var t=A(e);t.constant&&b.throwArgumentError("constructor cannot be constant","value",e);var o={name:null,type:e.type,inputs:e.inputs?e.inputs.map(O.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.a.from(e.gas):null};return new r(y,o)}},{key:"fromString",value:function(e){var t={type:"constructor"},n=(e=I(e,t)).match(F);return n&&"constructor"===n[1].trim()||b.throwArgumentError("invalid constructor string","value",e),t.inputs=S(n[2].trim(),!1),P(n[3].trim(),t),r.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),r}(E),T=function(e){s(r,e);var t=l(r);function r(){return h(this,r),t.apply(this,arguments)}return v(r,[{key:"format",value:function(e){if(e||(e=x.sighash),x[e]||b.throwArgumentError("invalid format type","format",e),e===x.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!==x.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===x.full?", ":",")+") ",e!==x.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&&b.throwArgumentError("invalid function object","value",e);var t=A(e),o={type:e.type,name:B(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(O.fromObject):[],outputs:e.outputs?e.outputs.map(O.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.a.from(e.gas):null};return new r(y,o)}},{key:"fromString",value:function(e){var t={type:"function"},n=(e=I(e,t)).split(" returns ");n.length>2&&b.throwArgumentError("invalid function string","value",e);var o=n[0].match(F);if(o||b.throwArgumentError("invalid function signature","value",e),t.name=o[1].trim(),t.name&&B(t.name),t.inputs=S(o[2],!1),P(o[3].trim(),t),n.length>1){var i=n[1].match(F);""==i[1].trim()&&""==i[3].trim()||b.throwArgumentError("unexpected tokens","value",e),t.outputs=S(i[2],!1)}else t.outputs=[];return r.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),r}(N);function R(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||b.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var M=function(e){s(r,e);var t=l(r);function r(){return h(this,r),t.apply(this,arguments)}return v(r,[{key:"format",value:function(e){if(e||(e=x.sighash),x[e]||b.throwArgumentError("invalid format type","format",e),e===x.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!==x.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===x.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&&b.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:B(e.name),inputs:e.inputs?e.inputs.map(O.fromObject):[]};return R(new r(y,t))}},{key:"fromString",value:function(e){var t={type:"error"},n=e.match(F);return n||b.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&B(t.name),t.inputs=S(n[2],!1),R(r.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),r}(E);function C(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var L=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function B(e){return e&&e.match(L)||b.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var F=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeWalletName=void 0;var n=r(600);Object.defineProperty(t,"normalizeWalletName",{enumerable:!0,get:function(){return n.normalizeWalletName}})},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return i}));var n=r(16),o=new n.a((function(e){return e.complete()}));function i(e){return e?function(e){return new n.a((function(t){return e.schedule((function(){return t.complete()}))}))}(e):o}},function(e,t,r){"use strict";r.r(t),r.d(t,"_fetchData",(function(){return m})),r.d(t,"fetchJson",(function(){return g})),r.d(t,"poll",(function(){return w}));var n=r(296),o=r(2),i=r(4),a=r(51),c=r(5);function s(e){return(s="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)}function u(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function f(e,t,r,o){var i=t&&t.prototype instanceof p?t:p,a=Object.create(i.prototype),c=new j(o||[]);return n(a,"_invoke",{value:k(e,r,c)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function p(){}function v(){}function b(){}var y={};l(y,i,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(I([])));g&&g!==t&&r.call(g,i)&&(y=g);var w=b.prototype=p.prototype=Object.create(y);function _(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var o;n(this,"_invoke",{value:function(n,i){function a(){return new t((function(o,a){!function n(o,i,a,c){var u=d(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==s(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,c)}))}c(u.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function k(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=d(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function O(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,O(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=d(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,h;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function I(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}var l=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function c(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,c)}s((n=n.apply(e,t||[])).next())}))};function f(e,t){return l(this,void 0,void 0,u().mark((function r(){var n,i,a,c,s;return u().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t={}),n={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0},!0!==t.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=t.fetchOptions&&((i=t.fetchOptions).mode&&(n.mode=i.mode),i.cache&&(n.cache=i.cache),i.credentials&&(n.credentials=i.credentials),i.redirect&&(n.redirect=i.redirect),i.referrer&&(n.referrer=i.referrer)),r.next=7,fetch(e,n);case 7:return a=r.sent,r.next=10,a.arrayBuffer();case 10:return c=r.sent,s={},a.headers.forEach?a.headers.forEach((function(e,t){s[t.toLowerCase()]=e})):a.headers.keys().forEach((function(e){s[e.toLowerCase()]=a.headers.get(e)})),r.abrupt("return",{headers:s,statusCode:a.status,statusMessage:a.statusText,body:Object(o.arrayify)(new Uint8Array(c))});case 14:case"end":return r.stop()}}),r)})))}function d(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */d=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function u(e,t,r,o){var i=t&&t.prototype instanceof p?t:p,a=Object.create(i.prototype),c=new j(o||[]);return n(a,"_invoke",{value:k(e,r,c)}),a}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function p(){}function v(){}function b(){}var y={};s(y,i,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(I([])));g&&g!==t&&r.call(g,i)&&(y=g);var w=b.prototype=p.prototype=Object.create(y);function _(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var o;n(this,"_invoke",{value:function(n,i){function a(){return new t((function(o,a){!function n(o,i,a,c){var s=l(e[o],e,i);if("throw"!==s.type){var u=s.arg,f=u.value;return f&&"object"==h(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,c)}))}c(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function k(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function O(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,O(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function I(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function h(e){return(h="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)}var p=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function c(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,c)}s((n=n.apply(e,t||[])).next())}))},v=new c.Logger("web/5.7.1");function b(e){return new Promise((function(t){setTimeout(t,e)}))}function y(e,t){if(null==e)return null;if("string"==typeof e)return e;if(Object(o.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Object(a.h)(e)}catch(e){}return Object(o.hexlify)(e)}return e}function m(e,t,r){var o="object"===h(e)&&null!=e.throttleLimit?e.throttleLimit:12;v.assertArgument(o>0&&o%1==0,"invalid connection throttle limit","connection.throttleLimit",o);var s="object"===h(e)?e.throttleCallback:null,u="object"===h(e)&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;v.assertArgument(u>0&&u%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",u);var l="object"===h(e)&&!!e.errorPassThrough,m={},g=null,w={method:"GET"},_=!1,x=12e4;if("string"==typeof e)g=e;else if("object"===h(e)){if(null!=e&&null!=e.url||v.throwArgumentError("missing URL","connection.url",e),g=e.url,"number"==typeof e.timeout&&e.timeout>0&&(x=e.timeout),e.headers)for(var k in e.headers)m[k.toLowerCase()]={key:k,value:String(e.headers[k])},["if-none-match","if-modified-since"].indexOf(k.toLowerCase())>=0&&(_=!0);if(w.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==g.substring(0,6)&&!0!==e.allowInsecureAuthentication&&v.throwError("basic authentication requires a secure https url",c.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:g,user:e.user,password:"[REDACTED]"});var O=e.user+":"+e.password;m.authorization={key:"Authorization",value:"Basic "+Object(n.b)(Object(a.f)(O))}}null!=e.skipFetchSetup&&(w.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(w.fetchOptions=Object(i.shallowCopy)(e.fetchOptions))}var S,E=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),j=g?g.match(E):null;if(j)try{var I={statusCode:200,statusMessage:"OK",headers:{"content-type":j[1]||"text/plain"},body:j[2]?Object(n.a)(j[3]):(S=j[3],Object(a.f)(S.replace(/%([0-9a-f][0-9a-f])/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))))},P=I.body;return r&&(P=r(I.body,I)),Promise.resolve(P)}catch(e){v.throwError("processing response error",c.Logger.errors.SERVER_ERROR,{body:y(j[1],j[2]),error:e,requestBody:null,requestMethod:"GET",url:g})}t&&(w.method="POST",w.body=t,null==m["content-type"]&&(m["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==m["content-length"]&&(m["content-length"]={key:"Content-Length",value:String(t.length)}));var A={};Object.keys(m).forEach((function(e){var t=m[e];A[t.key]=t.value})),w.headers=A;var N,T=(N=null,{promise:new Promise((function(e,t){x&&(N=setTimeout((function(){null!=N&&(N=null,t(v.makeError("timeout",c.Logger.errors.TIMEOUT,{requestBody:y(w.body,A["content-type"]),requestMethod:w.method,timeout:x,url:g})))}),x))})),cancel:function(){null!=N&&(clearTimeout(N),N=null)}}),R=function(){return p(this,void 0,void 0,d().mark((function e(){var t,n,i,a,h,p,m,x,k,O;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t=300)&&(T.cancel(),v.throwError("bad response",c.Logger.errors.SERVER_ERROR,{status:n.statusCode,headers:n.headers,body:y(m,n.headers?n.headers["content-type"]:null),requestBody:y(w.body,A["content-type"]),requestMethod:w.method,url:g})),!r){e.next=60;break}return e.prev=37,e.next=40,r(m,n);case 40:return x=e.sent,T.cancel(),e.abrupt("return",x);case 45:if(e.prev=45,e.t1=e.catch(37),!(e.t1.throttleRetry&&tc)return void(a()&&n(new Error("retry limit reached")));var u=t.interval*parseInt(String(Math.random()*Math.pow(2,s)));ut.ceiling&&(u=t.ceiling),setTimeout(o,u)}return null}),(function(e){a()&&n(e)}))}()}))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(16),o=r(125),i=r(265);function a(e,t){return t?Object(i.a)(e,t):e instanceof n.a?e:new n.a(Object(o.a)(e))}},function(e,t,r){"use strict";var n=r(281);function o(e){return(o="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)}var i="object"==("undefined"==typeof self?"undefined":o(self))&&self&&self.Object===Object&&self,a=n.a||i||Function("return this")();t.a=a},function(e,t,r){var n=t;n.utils=r(101),n.common=r(198),n.sha=r(610),n.ripemd=r(614),n.hmac=r(615),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){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var s,u=[],l=!1,f=-1;function d(){l&&s&&(l=!1,s.length?u=s.concat(u):f=-1,u.length&&h())}function h(){if(!l){var e=c(d);l=!0;for(var t=u.length;t;){for(s=u,u=[];++f1)for(var r=1;r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var u=s().mark(tt);function l(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}function f(e){var t=b();return function(){var r,n=m(e);if(t){var o=m(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d(this,r)}}function d(e,t){if(t&&("object"===k(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){var t="function"==typeof Map?new Map:void 0;return(p=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return v(e,arguments,m(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),y(r,e)})(e)}function v(e,t,r){return(v=b()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&y(o,r.prototype),o}).apply(null,arguments)}function b(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function y(e,t){return(y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w(e,t){for(var r=0;r=e.length?{done:!0}:{done:!1,value:e[n++]}},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 i,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function S(e,t){if(e){if("string"==typeof e)return E(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)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r)?=?)"),c("XRANGEIDENTIFIERLOOSE","".concat(o[i.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),c("XRANGEIDENTIFIER","".concat(o[i.NUMERICIDENTIFIER],"|x|X|\\*")),c("XRANGEPLAIN","[v=\\s]*(".concat(o[i.XRANGEIDENTIFIER],")(?:\\.(").concat(o[i.XRANGEIDENTIFIER],")(?:\\.(").concat(o[i.XRANGEIDENTIFIER],")(?:").concat(o[i.PRERELEASE],")?").concat(o[i.BUILD],"?)?)?")),c("XRANGEPLAINLOOSE","[v=\\s]*(".concat(o[i.XRANGEIDENTIFIERLOOSE],")(?:\\.(").concat(o[i.XRANGEIDENTIFIERLOOSE],")(?:\\.(").concat(o[i.XRANGEIDENTIFIERLOOSE],")(?:").concat(o[i.PRERELEASELOOSE],")?").concat(o[i.BUILD],"?)?)?")),c("XRANGE","^".concat(o[i.GTLT],"\\s*").concat(o[i.XRANGEPLAIN],"$")),c("XRANGELOOSE","^".concat(o[i.GTLT],"\\s*").concat(o[i.XRANGEPLAINLOOSE],"$")),c("COERCE","(^|[^\\d])(\\d{1,".concat(r,"})(?:\\.(\\d{1,").concat(r,"}))?(?:\\.(\\d{1,").concat(r,"}))?(?:$|[^\\d])")),c("COERCERTL",o[i.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM","(\\s*)".concat(o[i.LONETILDE],"\\s+"),!0),t.tildeTrimReplace="$1~",c("TILDE","^".concat(o[i.LONETILDE]).concat(o[i.XRANGEPLAIN],"$")),c("TILDELOOSE","^".concat(o[i.LONETILDE]).concat(o[i.XRANGEPLAINLOOSE],"$")),c("LONECARET","(?:\\^)"),c("CARETTRIM","(\\s*)".concat(o[i.LONECARET],"\\s+"),!0),t.caretTrimReplace="$1^",c("CARET","^".concat(o[i.LONECARET]).concat(o[i.XRANGEPLAIN],"$")),c("CARETLOOSE","^".concat(o[i.LONECARET]).concat(o[i.XRANGEPLAINLOOSE],"$")),c("COMPARATORLOOSE","^".concat(o[i.GTLT],"\\s*(").concat(o[i.LOOSEPLAIN],")$|^$")),c("COMPARATOR","^".concat(o[i.GTLT],"\\s*(").concat(o[i.FULLPLAIN],")$|^$")),c("COMPARATORTRIM","(\\s*)".concat(o[i.GTLT],"\\s*(").concat(o[i.LOOSEPLAIN],"|").concat(o[i.XRANGEPLAIN],")"),!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE","^\\s*(".concat(o[i.XRANGEPLAIN],")\\s+-\\s+(").concat(o[i.XRANGEPLAIN],")\\s*$")),c("HYPHENRANGELOOSE","^\\s*(".concat(o[i.XRANGEPLAINLOOSE],")\\s+-\\s+(").concat(o[i.XRANGEPLAINLOOSE],")\\s*$")),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0.0.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")})),H=/^[0-9]+$/,V=function(e,t){var r=H.test(e),n=H.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:eY)throw new TypeError("version is longer than ".concat(Y," characters"));G("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;var n=t.trim().match(r.loose?$[Q.LOOSE]:$[Q.FULL]);if(!n)throw new TypeError("Invalid Version: ".concat(t));if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Z||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Z||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Z||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: ".concat(e))}return this.format(),this.raw=this.version,this}}]),e}(),te=function(e,t,r){return new ee(e,r).compare(new ee(t,r))},re=function(e,t,r){return 0===te(e,t,r)},ne=function(e,t,r){return 0!==te(e,t,r)},oe=function(e,t,r){return te(e,t,r)>0},ie=function(e,t,r){return te(e,t,r)>=0},ae=function(e,t,r){return te(e,t,r)<0},ce=function(e,t,r){return te(e,t,r)<=0},se=function(e,t,r,n){switch(t){case"===":return"object"==k(e)&&(e=e.version),"object"==k(r)&&(r=r.version),e===r;case"!==":return"object"==k(e)&&(e=e.version),"object"==k(r)&&(r=r.version),e!==r;case"":case"=":case"==":return re(e,r,n);case"!=":return ne(e,r,n);case">":return oe(e,r,n);case">=":return ie(e,r,n);case"<":return ae(e,r,n);case"<=":return ce(e,r,n);default:throw new TypeError("Invalid operator: ".concat(t))}},ue=Symbol("SemVer ANY"),le=function(){function e(t,r){if(g(this,e),r&&"object"==k(r)||(r={loose:!!r,includePrerelease:!1}),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}G("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===ue?this.value="":this.value=this.operator+this.semver.version,G("comp",this)}return _(e,[{key:"parse",value:function(e){var t=this.options.loose?fe[de.COMPARATORLOOSE]:fe[de.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: ".concat(e));this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new ee(r[2],this.options.loose):this.semver=ue}},{key:"toString",value:function(){return this.value}},{key:"test",value:function(e){if(G("Comparator.test",e,this.options.loose),this.semver===ue||e===ue)return!0;if("string"==typeof e)try{e=new ee(e,this.options)}catch(e){return!1}return se(e,this.operator,this.semver,this.options)}},{key:"intersects",value:function(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");if(r&&"object"==k(r)||(r={loose:!!r,includePrerelease:!1}),""===this.operator)return""===this.value||new he(t.value,r).test(this.value);if(""===t.operator)return""===t.value||new he(this.value,r).test(t.semver);var n=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),i=this.semver.version===t.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),c=se(this.semver,"<",t.semver,r)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),s=se(this.semver,">",t.semver,r)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return n||o||i&&a||c||s}}],[{key:"ANY",get:function(){return ue}}]),e}(),fe=J.re,de=J.t,he=function(){function e(t,r){var n=this;if(g(this,e),r&&"object"==k(r)||(r={loose:!!r,includePrerelease:!1}),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof le)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map((function(e){return n.parseRange(e.trim())})).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(t));this.format()}return _(e,[{key:"format",value:function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(e){var t=this,r=this.options.loose;e=e.trim();var n=r?pe[ve.HYPHENRANGELOOSE]:pe[ve.HYPHENRANGE];e=e.replace(n,Ae(this.options.includePrerelease)),G("hyphen replace",e),e=e.replace(pe[ve.COMPARATORTRIM],be),G("comparator trim",e,pe[ve.COMPARATORTRIM]),e=(e=(e=e.replace(pe[ve.TILDETRIM],ye)).replace(pe[ve.CARETTRIM],me)).split(/\s+/).join(" ");var o=r?pe[ve.COMPARATORLOOSE]:pe[ve.COMPARATOR];return e.split(" ").map((function(e){return we(e,t.options)})).join(" ").split(/\s+/).map((function(e){return Pe(e,t.options)})).filter(this.options.loose?function(e){return!!e.match(o)}:function(){return!0}).map((function(e){return new le(e,t.options)}))}},{key:"intersects",value:function(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((function(e){return ge(e,r)&&t.set.some((function(t){return ge(t,r)&&e.every((function(e){return t.every((function(t){return e.intersects(t,r)}))}))}))}))}},{key:"test",value:function(e){if(!e)return!1;if("string"==typeof e)try{e=new ee(e,this.options)}catch(t){return!1}for(var t=0;t=".concat(r,".").concat(o,".0").concat(n," <").concat(r,".").concat(+o+1,".0-0"):">=".concat(r,".").concat(o,".0").concat(n," <").concat(+r+1,".0.0-0"):a?(G("replaceCaret pr",a),c="0"===r?"0"===o?">=".concat(r,".").concat(o,".").concat(i,"-").concat(a," <").concat(r,".").concat(o,".").concat(+i+1,"-0"):">=".concat(r,".").concat(o,".").concat(i,"-").concat(a," <").concat(r,".").concat(+o+1,".0-0"):">=".concat(r,".").concat(o,".").concat(i,"-").concat(a," <").concat(+r+1,".0.0-0")):(G("no pr"),c="0"===r?"0"===o?">=".concat(r,".").concat(o,".").concat(i).concat(n," <").concat(r,".").concat(o,".").concat(+i+1,"-0"):">=".concat(r,".").concat(o,".").concat(i).concat(n," <").concat(r,".").concat(+o+1,".0-0"):">=".concat(r,".").concat(o,".").concat(i," <").concat(+r+1,".0.0-0")),G("caret return",c),c}))},Ee=function(e,t){return G("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return je(e,t)})).join(" ")},je=function(e,t){e=e.trim();var r=t.loose?pe[ve.XRANGELOOSE]:pe[ve.XRANGE];return e.replace(r,(function(r,n,o,i,a,c){G("xRange",e,r,n,o,i,a,c);var s=_e(o),u=s||_e(i),l=u||_e(a),f=l;return"="===n&&f&&(n=""),c=t.includePrerelease?"-0":"",s?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(u&&(i=0),a=0,">"===n?(n=">=",u?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===n&&(n="<",u?o=+o+1:i=+i+1),"<"===n&&(c="-0"),r="".concat(n+o,".").concat(i,".").concat(a).concat(c)):u?r=">=".concat(o,".0.0").concat(c," <").concat(+o+1,".0.0-0"):l&&(r=">=".concat(o,".").concat(i,".0").concat(c," <").concat(o,".").concat(+i+1,".0-0")),G("xRange return",r),r}))},Ie=function(e,t){return G("replaceStars",e,t),e.trim().replace(pe[ve.STAR],"")},Pe=function(e,t){return G("replaceGTE0",e,t),e.trim().replace(pe[t.includePrerelease?ve.GTE0PRE:ve.GTE0],"")},Ae=function(e){return function(t,r,n,o,i,a,c,s,u,l,f,d,h){return"".concat(r=_e(n)?"":_e(o)?">=".concat(n,".0.0").concat(e?"-0":""):_e(i)?">=".concat(n,".").concat(o,".0").concat(e?"-0":""):a?">=".concat(r):">=".concat(r).concat(e?"-0":"")," ").concat(s=_e(u)?"":_e(l)?"<".concat(+u+1,".0.0-0"):_e(f)?"<".concat(u,".").concat(+l+1,".0-0"):d?"<=".concat(u,".").concat(l,".").concat(f,"-").concat(d):e?"<".concat(u,".").concat(l,".").concat(+f+1,"-0"):"<=".concat(s)).trim()}},Ne=function(e,t,r){for(var n=0;n0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0},Te=q.MAX_LENGTH,Re=J.re,Me=J.t,Ce=function(e,t){if(t&&"object"==k(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof ee)return e;if("string"!=typeof e||e.length>Te||!(t.loose?Re[Me.LOOSE]:Re[Me.FULL]).test(e))return null;try{return new ee(e,t)}catch(e){return null}},Le=J.re,Be=J.t;function Fe(e){return String.fromCharCode(parseInt(e.slice(1),16))}function De(e){return"%".concat("00".concat(e.charCodeAt(0).toString(16)).slice(-2))}function Ue(e){return function(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,Fe))}(JSON.stringify(e))}function ze(e){return JSON.parse(function(e){return decodeURIComponent(Array.from(atob(e),De).join(""))}(e))}function We(e){return void 0===e}function qe(e){return function(e){return null===e}(e)||We(e)}function Ge(e){if(!e)return!0;for(var t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var Je={};function He(e,t){return Object.assign(Je,t),e}var Ve={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},Ke=function(e){l(r,e);var t=f(r);function r(e,n){var o;return g(this,r),(o=t.call(this,"Magic SDK Error: [".concat(e,"] ").concat(n))).code=e,o.rawMessage=n,o.__proto__=Error,Object.setPrototypeOf(h(o),r.prototype),o}return _(r)}(p(Error)),Ye=function(e){l(r,e);var t=f(r);function r(e){var o;g(this,r),(o=t.call(this)).__proto__=Error;var i=Number(null==e?void 0:e.code);return o.rawMessage=(null==e?void 0:e.message)||"Internal error",o.code=function(e){return!qe(e)&&("number"==typeof e&&Object.values(n.e).includes(e))}(i)?i:n.e.InternalError,o.message="Magic RPC Error: [".concat(o.code,"] ").concat(o.rawMessage),o.data=(null==e?void 0:e.data)||void 0,Object.setPrototypeOf(h(o),r.prototype),o}return _(r)}(p(Error)),Ze=function(){function e(t,r){g(this,e),this.code=t,this.rawMessage=r,this.message="Magic SDK Warning: [".concat(t,"] ").concat(r)}return _(e,[{key:"log",value:function(){console.warn(this.message)}}]),e}(),$e=function(e){l(r,e);var t=f(r);function r(e,n,o,i){var a;return g(this,r),(a=t.call(this,"Magic Extension Error (".concat(e.name,"): [").concat(n,"] ").concat(o))).code=n,a.rawMessage=o,a.data=i,a.__proto__=Error,Object.setPrototypeOf(h(a),r.prototype),a}return _(r)}(p(Error)),Qe=function(){function e(t,r,n){g(this,e),this.code=r,this.rawMessage=n,this.message="Magic Extension Warning (".concat(t.name,"): [").concat(r,"] ").concat(n)}return _(e,[{key:"log",value:function(){console.warn(this.message)}}]),e}();function Xe(){return new Ke(n.f.ModalNotReady,"Modal is not ready.")}function et(){return new Ze(n.g.DuplicateIframe,"Duplicate iframes found.")}function tt(){var e;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(!(e1&&void 0!==arguments[1]?arguments[1]:[];return it({params:t,method:e,jsonrpc:"2.0",id:nt()})}var st=function(){function e(t){g(this,e),t instanceof e?(this._jsonrpc=t.payload.jsonrpc,this._id=t.payload.id,this._result=t.payload.result,this._error=t.payload.error):function(e){return!qe(e)&&!(We(e.jsonrpc)||We(e.id)||We(e.result)&&We(e.error))}(t)?(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=t.result,this._error=t.error):(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=void 0,this._error=void 0)}return _(e,[{key:"applyError",value:function(e){return this._error=e,this}},{key:"applyResult",value:function(e){return this._result=e,this}},{key:"hasError",get:function(){return void 0!==this._error&&null!==this._error}},{key:"hasResult",get:function(){return void 0!==this._result}},{key:"payload",get:function(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}}]),e}(),ut=function(e){l(r,e);var t=f(r);function r(){return g(this,r),t.apply(this,arguments)}return _(r)}(function(e,t,r){return r=null!=e?P(L(e)):{},function(e,t,r,n){if(t&&"object"==k(t)||"function"==typeof t){var o,i=O(M(t));try{var a=function(){var i=o.value;!B.call(e,i)&&i!==r&&A(e,i,{get:function(){return t[i]},enumerable:!(n=T(t,i))||n.enumerable})};for(i.s();!(o=i.n()).done;)a()}catch(e){i.e(e)}finally{i.f()}}return e}(!t&&e&&e.__esModule?r:A(r,"default",{value:e,enumerable:!0}),e)}(W()).default);function lt(){var e=new ut;return{emitter:e,createChainingEmitterMethod:function(t,r){return function(){for(var n=arguments.length,o=new Array(n),i=0;i 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.");return o.log(),new st(e).applyError({code:-32603,message:o.rawMessage}).payload}this.sendAsync(e,t)}},{key:"enable",value:function(){var e=ct("eth_accounts");return this.request(e)}},{key:"request",value:function(e){return this.prefixPayloadMethodForTestMode(e),o(m(r.prototype),"request",this).call(this,e)}},{key:"prefixPayloadMethodForTestMode",value:function(e){this.sdk.testMode&&(e.method="".concat("testMode/eth/").concat(e.method))}}]),r}(bt);function Yt(e,t){return t?new URL(e,t):new URL(e)}var Zt=["request","overlay","sdk"];var $t=function(e){l(r,e);var t=f(r);function r(){var e;g(this,r),(e=t.call(this,void 0)).__sdk_access_field_descriptors__=new Map,e.__is_initialized__=!1,e.utils={createPromiEvent:ht,isPromiEvent:dt,encodeJSON:Ue,decodeJSON:ze,createJsonRpcRequestPayload:ct,standardizeJsonRpcRequestPayload:at,storage:mt};var o=[h(e)].concat(a(function(e){for(var t=Object.getPrototypeOf(e),r=[t];t!==bt.prototype;)t=Object.getPrototypeOf(t),r.push(t);return r}(h(e))));return Zt.forEach((function(t){var r=o.map((function(e){return Object.getOwnPropertyDescriptor(e,t)})),i=r.findIndex((function(e){return!!e})),a=i>0,c=r[i];c&&(e.__sdk_access_field_descriptors__.set(t,{descriptor:c,isPrototypeField:a}),Object.defineProperty(h(e),t,{configurable:!0,get:function(){throw function(e){return new Ke(n.f.ExtensionNotInitialized,"Extensions must be initialized with a Magic SDK instance before `Extension.".concat(e,"` can be accessed. Do not invoke `Extension.").concat(e,"` inside an extension constructor."))}(t)}}))})),e}return _(r,[{key:"init",value:function(e){var t=this;this.__is_initialized__||(Zt.forEach((function(e){if(t.__sdk_access_field_descriptors__.has(e)){var r=t.__sdk_access_field_descriptors__.get(e),n=r.descriptor;r.isPrototypeField?delete t[e]:Object.defineProperty(t,e,n)}})),this.sdk=e,this.__is_initialized__=!0)}},{key:"createDeprecationWarning",value:function(e){var t=e.method,r=e.removalVersion,n=e.useInstead,o=n?" Use `".concat(n,"` instead."):"",i="`".concat(t,"` will be removed from this Extension in version `").concat(r,"`.").concat(o);return new Qe(this,"DEPRECATION_NOTICE",i)}},{key:"createWarning",value:function(e,t){return new Qe(this,e,t)}},{key:"createError",value:function(e,t,r){return new $e(this,e,t,r)}}]),r}(bt),Qt=function(e){l(r,e);var t=f(r);function r(){return g(this,r),t.apply(this,arguments)}return _(r)}($t),Xt=function(e){l(r,e);var t=f(r);function r(){return g(this,r),t.apply(this,arguments)}return _(r)}($t);Xt.Internal=Qt,Xt.Anonymous="anonymous extension";var er=function(e){l(r,e);var t=f(r);function r(){return g(this,r),t.apply(this,arguments)}return _(r,[{key:"purchase",value:function(e){var t=ct(n.d.NFTPurchase,[e]);return this.request(t)}}]),r}(bt);function tr(e){return!e.compat||null==e.compat[Je.sdkName]||("string"==typeof e.compat[Je.sdkName]?function(e,t,r){try{t=new he(t,r)}catch(e){return!1}return t.test(e)}(function(e,t){if(e instanceof ee)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;var r=null;if((t=t||{}).rtl){for(var n;(n=Le[Be.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),Le[Be.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;Le[Be.COERCERTL].lastIndex=-1}else r=e.match(Le[Be.COERCE]);return null===r?null:Ce("".concat(r[2],".").concat(r[3]||"0",".").concat(r[4]||"0"),t)}(Je.version),e.compat[Je.sdkName]):!!e.compat[Je.sdkName])}function rr(e){var t,r=this,o=null!=(t=null==e?void 0:e.extensions)?t:[],i={},a=[];if(Array.isArray(o)?o.forEach((function(e){tr(e)?(e.init(r),(e.name||e.name!==Xt.Anonymous)&&(r[e.name]=e),e instanceof Xt.Internal&&(Ge(e.config)||(i[e.name]=e.config))):a.push(e)})):Object.keys(o).forEach((function(e){if(tr(o[e])){o[e].init(r);var t=o[e];r[e]=t,t instanceof Xt.Internal&&(Ge(t.config)||(i[o[e].name]=t.config))}else a.push(o[e])})),a.length)throw function(e){var t="Some extensions are incompatible with `".concat(Je.sdkName,"@").concat(Je.version,"`:");return e.filter((function(e){return void 0!==e.compat&&null!==e.compat})).forEach((function(e){var r=e.compat[Je.sdkName];"string"==typeof r?t+="\n - Extension `".concat(e.name,"` supports version(s) `").concat(r,"`"):r||(t+="\n - Extension `".concat(e.name,"` does not support ").concat(Je.platform," environments."))})),new Ke(n.f.IncompatibleExtensions,t)}(a);return i}var nr=function(){function e(t,r){var o;if(g(this,e),this.apiKey=t,!t)throw new Ke(n.f.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.");"react-native"===Je.platform&&(null==r?void 0:r.endpoint)&&new Ze(n.g.ReactNativeEndpointConfiguration,"CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The `endpoint` parameter SHOULD NOT be provided. The Magic `