Skip to content

Instantly share code, notes, and snippets.

@spencercap
Created January 20, 2022 07:09
Show Gist options
  • Save spencercap/4d8bd213a206e9c9d7fcd9f4fb6b5ab3 to your computer and use it in GitHub Desktop.
Save spencercap/4d8bd213a206e9c9d7fcd9f4fb6b5ab3 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
(function (global){(function (){
const algonautjs = require('algonaut.js/dist/cjs/index.js');
global.window.algonautjs = algonautjs;
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"algonaut.js/dist/cjs/index.js":32}],2:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IBlockchainProvider = exports.IBlockchainAuthenticator = exports.IPendingRequests = void 0;
const misc_1 = require("./misc");
const provider_1 = require("./provider");
class IPendingRequests {
constructor(storage) {
this.storage = storage;
}
}
exports.IPendingRequests = IPendingRequests;
class IBlockchainAuthenticator extends misc_1.IEvents {
constructor(config) {
super();
this.config = config;
}
}
exports.IBlockchainAuthenticator = IBlockchainAuthenticator;
class IBlockchainProvider extends provider_1.IJsonRpcProvider {
constructor(connection, config) {
super(connection);
}
}
exports.IBlockchainProvider = IBlockchainProvider;
},{"./misc":5,"./provider":7}],3:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./blockchain"), exports);
tslib_1.__exportStar(require("./jsonrpc"), exports);
tslib_1.__exportStar(require("./misc"), exports);
tslib_1.__exportStar(require("./multi"), exports);
tslib_1.__exportStar(require("./provider"), exports);
tslib_1.__exportStar(require("./router"), exports);
tslib_1.__exportStar(require("./schema"), exports);
tslib_1.__exportStar(require("./validator"), exports);
},{"./blockchain":2,"./jsonrpc":4,"./misc":5,"./multi":6,"./provider":7,"./router":8,"./schema":9,"./validator":10,"tslib":72}],4:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
},{}],5:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IEvents = void 0;
class IEvents {
}
exports.IEvents = IEvents;
},{}],6:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IMultiServiceProvider = void 0;
const provider_1 = require("./provider");
class IMultiServiceProvider extends provider_1.IBaseJsonRpcProvider {
constructor(config) {
super();
this.config = config;
}
}
exports.IMultiServiceProvider = IMultiServiceProvider;
},{"./provider":7}],7:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IJsonRpcProvider = exports.IBaseJsonRpcProvider = exports.IJsonRpcConnection = void 0;
const misc_1 = require("./misc");
class IJsonRpcConnection extends misc_1.IEvents {
constructor(opts) {
super();
}
}
exports.IJsonRpcConnection = IJsonRpcConnection;
class IBaseJsonRpcProvider extends misc_1.IEvents {
constructor() {
super();
}
}
exports.IBaseJsonRpcProvider = IBaseJsonRpcProvider;
class IJsonRpcProvider extends IBaseJsonRpcProvider {
constructor(connection) {
super();
}
}
exports.IJsonRpcProvider = IJsonRpcProvider;
},{"./misc":5}],8:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IJsonRpcRouter = void 0;
class IJsonRpcRouter {
constructor(routes) {
this.routes = routes;
}
}
exports.IJsonRpcRouter = IJsonRpcRouter;
},{}],9:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
},{}],10:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IJsonRpcValidator = void 0;
class IJsonRpcValidator {
constructor(schemas) {
this.schemas = schemas;
}
}
exports.IJsonRpcValidator = IJsonRpcValidator;
},{}],11:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.STANDARD_ERROR_MAP = exports.SERVER_ERROR_CODE_RANGE = exports.RESERVED_ERROR_CODES = exports.SERVER_ERROR = exports.INTERNAL_ERROR = exports.INVALID_PARAMS = exports.METHOD_NOT_FOUND = exports.INVALID_REQUEST = exports.PARSE_ERROR = void 0;
exports.PARSE_ERROR = "PARSE_ERROR";
exports.INVALID_REQUEST = "INVALID_REQUEST";
exports.METHOD_NOT_FOUND = "METHOD_NOT_FOUND";
exports.INVALID_PARAMS = "INVALID_PARAMS";
exports.INTERNAL_ERROR = "INTERNAL_ERROR";
exports.SERVER_ERROR = "SERVER_ERROR";
exports.RESERVED_ERROR_CODES = [-32700, -32600, -32601, -32602, -32603];
exports.SERVER_ERROR_CODE_RANGE = [-32000, -32099];
exports.STANDARD_ERROR_MAP = {
[exports.PARSE_ERROR]: { code: -32700, message: "Parse error" },
[exports.INVALID_REQUEST]: { code: -32600, message: "Invalid Request" },
[exports.METHOD_NOT_FOUND]: { code: -32601, message: "Method not found" },
[exports.INVALID_PARAMS]: { code: -32602, message: "Invalid params" },
[exports.INTERNAL_ERROR]: { code: -32603, message: "Internal error" },
[exports.SERVER_ERROR]: { code: -32000, message: "Server error" },
};
},{}],12:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isNodeJs = void 0;
const tslib_1 = require("tslib");
const environment_1 = require("@pedrouid/environment");
exports.isNodeJs = environment_1.isNode;
tslib_1.__exportStar(require("@pedrouid/environment"), exports);
},{"@pedrouid/environment":21,"tslib":72}],13:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateJsonRpcError = exports.getErrorByCode = exports.getError = exports.isValidErrorCode = exports.isReservedErrorCode = exports.isServerErrorCode = void 0;
const constants_1 = require("./constants");
function isServerErrorCode(code) {
return code <= constants_1.SERVER_ERROR_CODE_RANGE[0] && code >= constants_1.SERVER_ERROR_CODE_RANGE[1];
}
exports.isServerErrorCode = isServerErrorCode;
function isReservedErrorCode(code) {
return constants_1.RESERVED_ERROR_CODES.includes(code);
}
exports.isReservedErrorCode = isReservedErrorCode;
function isValidErrorCode(code) {
return typeof code === "number";
}
exports.isValidErrorCode = isValidErrorCode;
function getError(type) {
if (!Object.keys(constants_1.STANDARD_ERROR_MAP).includes(type)) {
return constants_1.STANDARD_ERROR_MAP[constants_1.INTERNAL_ERROR];
}
return constants_1.STANDARD_ERROR_MAP[type];
}
exports.getError = getError;
function getErrorByCode(code) {
const match = Object.values(constants_1.STANDARD_ERROR_MAP).find(e => e.code === code);
if (!match) {
return constants_1.STANDARD_ERROR_MAP[constants_1.INTERNAL_ERROR];
}
return match;
}
exports.getErrorByCode = getErrorByCode;
function validateJsonRpcError(response) {
if (typeof response.error.code === "undefined") {
return { valid: false, error: "Missing code for JSON-RPC error" };
}
if (typeof response.error.message === "undefined") {
return { valid: false, error: "Missing message for JSON-RPC error" };
}
if (!isValidErrorCode(response.error.code)) {
return {
valid: false,
error: `Invalid error code type for JSON-RPC: ${response.error.code}`,
};
}
if (isReservedErrorCode(response.error.code)) {
const error = getErrorByCode(response.error.code);
if (error.message !== constants_1.STANDARD_ERROR_MAP[constants_1.INTERNAL_ERROR].message &&
response.error.message === error.message) {
return {
valid: false,
error: `Invalid error code message for JSON-RPC: ${response.error.code}`,
};
}
}
return { valid: true };
}
exports.validateJsonRpcError = validateJsonRpcError;
},{"./constants":11}],14:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatErrorMessage = exports.formatJsonRpcError = exports.formatJsonRpcResult = exports.formatJsonRpcRequest = exports.payloadId = void 0;
const error_1 = require("./error");
const constants_1 = require("./constants");
function payloadId() {
const date = Date.now() * Math.pow(10, 3);
const extra = Math.floor(Math.random() * Math.pow(10, 3));
return date + extra;
}
exports.payloadId = payloadId;
function formatJsonRpcRequest(method, params, id) {
return {
id: id || payloadId(),
jsonrpc: "2.0",
method,
params,
};
}
exports.formatJsonRpcRequest = formatJsonRpcRequest;
function formatJsonRpcResult(id, result) {
return {
id,
jsonrpc: "2.0",
result,
};
}
exports.formatJsonRpcResult = formatJsonRpcResult;
function formatJsonRpcError(id, error) {
return {
id,
jsonrpc: "2.0",
error: formatErrorMessage(error),
};
}
exports.formatJsonRpcError = formatJsonRpcError;
function formatErrorMessage(error) {
if (typeof error === "undefined") {
return error_1.getError(constants_1.INTERNAL_ERROR);
}
if (typeof error === "string") {
error = Object.assign(Object.assign({}, error_1.getError(constants_1.SERVER_ERROR)), { message: error });
}
if (error_1.isReservedErrorCode(error.code)) {
error = error_1.getErrorByCode(error.code);
}
if (!error_1.isServerErrorCode(error.code)) {
throw new Error("Error code is not in server code range");
}
return error;
}
exports.formatErrorMessage = formatErrorMessage;
},{"./constants":11,"./error":13}],15:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./constants"), exports);
tslib_1.__exportStar(require("./error"), exports);
tslib_1.__exportStar(require("./env"), exports);
tslib_1.__exportStar(require("./format"), exports);
tslib_1.__exportStar(require("./routing"), exports);
tslib_1.__exportStar(require("./types"), exports);
tslib_1.__exportStar(require("./validators"), exports);
},{"./constants":11,"./env":12,"./error":13,"./format":14,"./routing":16,"./types":17,"./validators":18,"tslib":72}],16:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isValidTrailingWildcardRoute = exports.isValidLeadingWildcardRoute = exports.isValidWildcardRoute = exports.isValidDefaultRoute = exports.isValidRoute = void 0;
function isValidRoute(route) {
if (route.includes("*")) {
return isValidWildcardRoute(route);
}
if (/\W/g.test(route)) {
return false;
}
return true;
}
exports.isValidRoute = isValidRoute;
function isValidDefaultRoute(route) {
return route === "*";
}
exports.isValidDefaultRoute = isValidDefaultRoute;
function isValidWildcardRoute(route) {
if (isValidDefaultRoute(route)) {
return true;
}
if (!route.includes("*")) {
return false;
}
if (route.split("*").length !== 2) {
return false;
}
if (route.split("*").filter(x => x.trim() === "").length !== 1) {
return false;
}
return true;
}
exports.isValidWildcardRoute = isValidWildcardRoute;
function isValidLeadingWildcardRoute(route) {
return !isValidDefaultRoute(route) && isValidWildcardRoute(route) && !route.split("*")[0].trim();
}
exports.isValidLeadingWildcardRoute = isValidLeadingWildcardRoute;
function isValidTrailingWildcardRoute(route) {
return !isValidDefaultRoute(route) && isValidWildcardRoute(route) && !route.split("*")[1].trim();
}
exports.isValidTrailingWildcardRoute = isValidTrailingWildcardRoute;
},{}],17:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("@json-rpc-tools/types"), exports);
},{"@json-rpc-tools/types":3,"tslib":72}],18:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isJsonRpcValidationInvalid = exports.isJsonRpcError = exports.isJsonRpcResult = exports.isJsonRpcResponse = exports.isJsonRpcRequest = exports.isJsonRpcPayload = void 0;
function isJsonRpcPayload(payload) {
return "id" in payload && "jsonrpc" in payload && payload.jsonrpc === "2.0";
}
exports.isJsonRpcPayload = isJsonRpcPayload;
function isJsonRpcRequest(payload) {
return isJsonRpcPayload(payload) && "method" in payload;
}
exports.isJsonRpcRequest = isJsonRpcRequest;
function isJsonRpcResponse(payload) {
return isJsonRpcPayload(payload) && (isJsonRpcResult(payload) || isJsonRpcError(payload));
}
exports.isJsonRpcResponse = isJsonRpcResponse;
function isJsonRpcResult(payload) {
return "result" in payload;
}
exports.isJsonRpcResult = isJsonRpcResult;
function isJsonRpcError(payload) {
return "error" in payload;
}
exports.isJsonRpcError = isJsonRpcError;
function isJsonRpcValidationInvalid(validation) {
return "error" in validation && validation.valid === false;
}
exports.isJsonRpcValidationInvalid = isJsonRpcValidationInvalid;
},{}],19:[function(require,module,exports){
(function (global){(function (){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isBrowserCryptoAvailable = exports.getSubtleCrypto = exports.getBrowerCrypto = void 0;
function getBrowerCrypto() {
return (global === null || global === void 0 ? void 0 : global.crypto) || (global === null || global === void 0 ? void 0 : global.msCrypto) || {};
}
exports.getBrowerCrypto = getBrowerCrypto;
function getSubtleCrypto() {
const browserCrypto = getBrowerCrypto();
return browserCrypto.subtle || browserCrypto.webkitSubtle;
}
exports.getSubtleCrypto = getSubtleCrypto;
function isBrowserCryptoAvailable() {
return !!getBrowerCrypto() && !!getSubtleCrypto();
}
exports.isBrowserCryptoAvailable = isBrowserCryptoAvailable;
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],20:[function(require,module,exports){
(function (process){(function (){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isBrowser = exports.isNode = exports.isReactNative = void 0;
function isReactNative() {
return (typeof document === 'undefined' &&
typeof navigator !== 'undefined' &&
navigator.product === 'ReactNative');
}
exports.isReactNative = isReactNative;
function isNode() {
return (typeof process !== 'undefined' &&
typeof process.versions !== 'undefined' &&
typeof process.versions.node !== 'undefined');
}
exports.isNode = isNode;
function isBrowser() {
return !isReactNative() && !isNode();
}
exports.isBrowser = isBrowser;
}).call(this)}).call(this,require('_process'))
},{"_process":223}],21:[function(require,module,exports){
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./crypto"), exports);
__exportStar(require("./env"), exports);
},{"./crypto":19,"./env":20}],22:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.detectEnv = detectEnv;
exports.detectOS = detectOS;
exports.getClientMeta = getClientMeta;
exports.getNavigatorOrThrow = exports.getNavigator = exports.getLocationOrThrow = exports.getLocation = exports.getLocalStorageOrThrow = exports.getLocalStorage = exports.getFromWindowOrThrow = exports.getFromWindow = exports.getDocumentOrThrow = exports.getDocument = exports.getCryptoOrThrow = exports.getCrypto = void 0;
exports.isAndroid = isAndroid;
exports.isBrowser = isBrowser;
exports.isIOS = isIOS;
exports.isMobile = isMobile;
exports.isNode = isNode;
var windowMetadata = _interopRequireWildcard(require("@walletconnect/window-metadata"));
var windowGetters = _interopRequireWildcard(require("@walletconnect/window-getters"));
var _detectBrowser = require("detect-browser");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function detectEnv(userAgent) {
return (0, _detectBrowser.detect)(userAgent);
}
function detectOS() {
const env = detectEnv();
return env && env.os ? env.os : undefined;
}
function isAndroid() {
const os = detectOS();
return os ? os.toLowerCase().includes("android") : false;
}
function isIOS() {
const os = detectOS();
return os ? os.toLowerCase().includes("ios") || os.toLowerCase().includes("mac") && navigator.maxTouchPoints > 1 : false;
}
function isMobile() {
const os = detectOS();
return os ? isAndroid() || isIOS() : false;
}
function isNode() {
const env = detectEnv();
const result = env && env.name ? env.name.toLowerCase() === "node" : false;
return result;
}
function isBrowser() {
const result = !isNode() && !!getNavigator();
return result;
}
const getFromWindow = windowGetters.getFromWindow;
exports.getFromWindow = getFromWindow;
const getFromWindowOrThrow = windowGetters.getFromWindowOrThrow;
exports.getFromWindowOrThrow = getFromWindowOrThrow;
const getDocumentOrThrow = windowGetters.getDocumentOrThrow;
exports.getDocumentOrThrow = getDocumentOrThrow;
const getDocument = windowGetters.getDocument;
exports.getDocument = getDocument;
const getNavigatorOrThrow = windowGetters.getNavigatorOrThrow;
exports.getNavigatorOrThrow = getNavigatorOrThrow;
const getNavigator = windowGetters.getNavigator;
exports.getNavigator = getNavigator;
const getLocationOrThrow = windowGetters.getLocationOrThrow;
exports.getLocationOrThrow = getLocationOrThrow;
const getLocation = windowGetters.getLocation;
exports.getLocation = getLocation;
const getCryptoOrThrow = windowGetters.getCryptoOrThrow;
exports.getCryptoOrThrow = getCryptoOrThrow;
const getCrypto = windowGetters.getCrypto;
exports.getCrypto = getCrypto;
const getLocalStorageOrThrow = windowGetters.getLocalStorageOrThrow;
exports.getLocalStorageOrThrow = getLocalStorageOrThrow;
const getLocalStorage = windowGetters.getLocalStorage;
exports.getLocalStorage = getLocalStorage;
function getClientMeta() {
return windowMetadata.getWindowMetadata();
}
},{"@walletconnect/window-getters":30,"@walletconnect/window-metadata":31,"detect-browser":37}],23:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _browser = require("./browser");
Object.keys(_browser).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _browser[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _browser[key];
}
});
});
var _json = require("./json");
Object.keys(_json).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _json[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _json[key];
}
});
});
var _local = require("./local");
Object.keys(_local).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _local[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _local[key];
}
});
});
var _mobile = require("./mobile");
Object.keys(_mobile).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _mobile[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _mobile[key];
}
});
});
var _registry = require("./registry");
Object.keys(_registry).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _registry[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _registry[key];
}
});
});
},{"./browser":22,"./json":24,"./local":25,"./mobile":26,"./registry":27}],24:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.safeJsonStringify = exports.safeJsonParse = void 0;
var safeJson = _interopRequireWildcard(require("@walletconnect/safe-json"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
const safeJsonParse = safeJson.safeJsonParse;
exports.safeJsonParse = safeJsonParse;
const safeJsonStringify = safeJson.safeJsonStringify;
exports.safeJsonStringify = safeJsonStringify;
},{"@walletconnect/safe-json":29}],25:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getLocal = getLocal;
exports.removeLocal = removeLocal;
exports.setLocal = setLocal;
var _json = require("./json");
var _browser = require("./browser");
function setLocal(key, data) {
const raw = (0, _json.safeJsonStringify)(data);
const local = (0, _browser.getLocalStorage)();
if (local) {
local.setItem(key, raw);
}
}
function getLocal(key) {
let data = null;
let raw = null;
const local = (0, _browser.getLocalStorage)();
if (local) {
raw = local.getItem(key);
}
data = raw ? (0, _json.safeJsonParse)(raw) : raw;
return data;
}
function removeLocal(key) {
const local = (0, _browser.getLocalStorage)();
if (local) {
local.removeItem(key);
}
}
},{"./browser":22,"./json":24}],26:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.formatIOSMobile = formatIOSMobile;
exports.getMobileLinkRegistry = getMobileLinkRegistry;
exports.getMobileRegistryEntry = getMobileRegistryEntry;
exports.mobileLinkChoiceKey = void 0;
exports.saveMobileLinkInfo = saveMobileLinkInfo;
var _local = require("./local");
const mobileLinkChoiceKey = "WALLETCONNECT_DEEPLINK_CHOICE";
exports.mobileLinkChoiceKey = mobileLinkChoiceKey;
function formatIOSMobile(uri, entry) {
const encodedUri = encodeURIComponent(uri);
return entry.universalLink ? `${entry.universalLink}/wc?uri=${encodedUri}` : entry.deepLink ? `${entry.deepLink}${entry.deepLink.endsWith(":") ? "//" : "/"}wc?uri=${encodedUri}` : "";
}
function saveMobileLinkInfo(data) {
const focusUri = data.href.split("?")[0];
(0, _local.setLocal)(mobileLinkChoiceKey, Object.assign(Object.assign({}, data), {
href: focusUri
}));
}
function getMobileRegistryEntry(registry, name) {
return registry.filter(entry => entry.name.toLowerCase().includes(name.toLowerCase()))[0];
}
function getMobileLinkRegistry(registry, whitelist) {
let links = registry;
if (whitelist) {
links = whitelist.map(name => getMobileRegistryEntry(registry, name)).filter(Boolean);
}
return links;
}
},{"./local":25}],27:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.formatMobileRegistry = formatMobileRegistry;
exports.formatMobileRegistryEntry = formatMobileRegistryEntry;
exports.getAppLogoUrl = getAppLogoUrl;
exports.getDappRegistryUrl = getDappRegistryUrl;
exports.getWalletRegistryUrl = getWalletRegistryUrl;
const API_URL = "https://registry.walletconnect.org";
function getWalletRegistryUrl() {
return API_URL + "/data/wallets.json";
}
function getDappRegistryUrl() {
return API_URL + "/data/dapps.json";
}
function getAppLogoUrl(id) {
return API_URL + "/logo/sm/" + id + ".jpeg";
}
function formatMobileRegistryEntry(entry, platform = "mobile") {
return {
name: entry.name || "",
shortName: entry.metadata.shortName || "",
color: entry.metadata.colors.primary || "",
logo: entry.id ? getAppLogoUrl(entry.id) : "",
universalLink: entry[platform].universal || "",
deepLink: entry[platform].native || ""
};
}
function formatMobileRegistry(registry, platform = "mobile") {
return Object.values(registry).filter(entry => !!entry[platform].universal || !!entry[platform].native).map(entry => formatMobileRegistryEntry(entry, platform));
}
},{}],28:[function(require,module,exports){
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("WalletConnect",[],e):"object"==typeof exports?exports.WalletConnect=e():t.WalletConnect=e()}(this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=41)}([function(t,e,r){"use strict";(function(t){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.removeHexLeadingZeros=e.sanitizeHex=e.addHexPrefix=e.removeHexPrefix=e.padRight=e.padLeft=e.sanitizeBytes=e.swapHex=e.swapBytes=e.splitBytes=e.calcByteLength=e.trimRight=e.trimLeft=e.concatArrays=e.concatBuffers=e.getEncoding=e.getType=e.isArrayBuffer=e.isTypedArray=e.isBuffer=e.isHexString=e.isBinaryString=e.binaryToNumber=e.binaryToUtf8=e.binaryToHex=e.binaryToArray=e.binaryToBuffer=e.numberToBinary=e.numberToUtf8=e.numberToHex=e.numberToArray=e.numberToBuffer=e.utf8ToBinary=e.utf8ToNumber=e.utf8ToHex=e.utf8ToArray=e.utf8ToBuffer=e.hexToBinary=e.hexToNumber=e.hexToUtf8=e.hexToArray=e.hexToBuffer=e.arrayToBinary=e.arrayToNumber=e.arrayToUtf8=e.arrayToHex=e.arrayToBuffer=e.bufferToBinary=e.bufferToNumber=e.bufferToUtf8=e.bufferToHex=e.bufferToArray=void 0;const i=n(r(16)),o=n(r(48));function s(t){return new Uint8Array(t)}function a(t,e=!1){const r=t.toString("hex");return e?P(r):r}function u(t){return t.toString("utf8")}function h(t){return t.readUIntBE(0,t.length)}function c(t){return o.default(t)}function f(t,e=!1){return a(c(t),e)}function l(t){return u(c(t))}function d(t){return h(c(t))}function p(t){return Array.from(t).map(b).join("")}function m(e){return t.from(C(e),"hex")}function g(t){return s(m(t))}function y(t){return p(g(t))}function v(e){return t.from(e,"utf8")}function w(t){return s(v(t))}function b(t){return B((t>>>0).toString(2))}function _(t){return c(M(t))}function M(t){return new Uint8Array(R(t).map(t=>parseInt(t,2)))}function S(t,e){return f(M(t),e)}function T(t){return!("string"!=typeof t||!new RegExp(/^[01]+$/).test(t))&&t.length%8==0}function O(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}function A(e){return t.isBuffer(e)}function k(t){return i.default.strict(t)&&!A(t)}function x(t){return!k(t)&&!A(t)&&void 0!==t.byteLength}function I(t,e=8){const r=t%e;return r?(t-r)/e*e+e:t}function R(t,e=8){const r=B(t).match(new RegExp(`.{${e}}`,"gi"));return Array.from(r||[])}function E(t){return R(t).map(U).join("")}function B(t,e=8,r="0"){return j(t,I(t.length,e),r)}function j(t,e,r="0"){return N(t,e,!0,r)}function C(t){return t.replace(/^0x/,"")}function P(t){return t.startsWith("0x")?t:"0x"+t}function U(t){return t.split("").reverse().join("")}function N(t,e,r,n="0"){const i=e-t.length;let o=t;if(i>0){const e=n.repeat(i);o=r?e+t:t+e}return o}e.bufferToArray=s,e.bufferToHex=a,e.bufferToUtf8=u,e.bufferToNumber=h,e.bufferToBinary=function(t){return p(s(t))},e.arrayToBuffer=c,e.arrayToHex=f,e.arrayToUtf8=l,e.arrayToNumber=d,e.arrayToBinary=p,e.hexToBuffer=m,e.hexToArray=g,e.hexToUtf8=function(t){return u(m(t))},e.hexToNumber=function(t){return d(g(t))},e.hexToBinary=y,e.utf8ToBuffer=v,e.utf8ToArray=w,e.utf8ToHex=function(t,e=!1){return a(v(t),e)},e.utf8ToNumber=function(t){const e=parseInt(t,10);return function(t,e){if(!t)throw new Error(e)}(!function(t){return void 0===t}(e),"Number can only safely store up to 53 bits"),e},e.utf8ToBinary=function(t){return p(w(t))},e.numberToBuffer=function(t){return _(b(t))},e.numberToArray=function(t){return M(b(t))},e.numberToHex=function(t,e){return S(b(t),e)},e.numberToUtf8=function(t){return""+t},e.numberToBinary=b,e.binaryToBuffer=_,e.binaryToArray=M,e.binaryToHex=S,e.binaryToUtf8=function(t){return l(M(t))},e.binaryToNumber=function(t){return d(M(t))},e.isBinaryString=T,e.isHexString=O,e.isBuffer=A,e.isTypedArray=k,e.isArrayBuffer=x,e.getType=function(t){return A(t)?"buffer":k(t)?"typed-array":x(t)?"array-buffer":Array.isArray(t)?"array":typeof t},e.getEncoding=function(t){return T(t)?"binary":O(t)?"hex":"utf8"},e.concatBuffers=function(...e){return t.concat(e)},e.concatArrays=function(...t){let e=[];return t.forEach(t=>e=e.concat(Array.from(t))),new Uint8Array([...e])},e.trimLeft=function(t,e){const r=t.length-e;return r>0&&(t=t.slice(r)),t},e.trimRight=function(t,e){return t.slice(0,e)},e.calcByteLength=I,e.splitBytes=R,e.swapBytes=E,e.swapHex=function(t){return S(E(y(t)))},e.sanitizeBytes=B,e.padLeft=j,e.padRight=function(t,e,r="0"){return N(t,e,!1,r)},e.removeHexPrefix=C,e.addHexPrefix=P,e.sanitizeHex=function(t){return(t=B(t=C(t),2))&&(t=P(t)),t},e.removeHexLeadingZeros=function(t){const e=t.startsWith("0x");return t=(t=C(t)).startsWith("0")?t.substring(1):t,e?P(t):t}}).call(this,r(15).Buffer)},function(t,e,r){"use strict";var n=r(35),i=r(5),o=r(36);function s(t){return Object(o.a)(t)}function a(){const t=s();return t&&t.os?t.os:void 0}function u(){return!!a()&&(function(){const t=a();return!!t&&t.toLowerCase().includes("android")}()||function(){const t=a();return!!t&&(t.toLowerCase().includes("ios")||t.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1)}())}function h(){return!function(){const t=s();return!(!t||!t.name)&&"node"===t.name.toLowerCase()}()&&!!c()}i.getFromWindow,i.getFromWindowOrThrow,i.getDocumentOrThrow,i.getDocument,i.getNavigatorOrThrow;const c=i.getNavigator,f=(i.getLocationOrThrow,i.getLocation),l=(i.getCryptoOrThrow,i.getCrypto,i.getLocalStorageOrThrow,i.getLocalStorage);function d(){return n.getWindowMetadata()}const p=function(t){if("string"!=typeof t)throw new Error("Cannot safe json parse value of type "+typeof t);try{return JSON.parse(t)}catch(e){return t}},m=function(t){return"string"==typeof t?t:JSON.stringify(t)};function g(t,e){const r=m(e),n=l();n&&n.setItem(t,r)}function y(t){let e=null,r=null;const n=l();return n&&(r=n.getItem(t)),e=r?p(r):r,e}function v(t){const e=l();e&&e.removeItem(t)}const w=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],b=["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"];var _=r(11),M=r.n(_),S=r(0);function T(t){return S.arrayToBuffer(new Uint8Array(t))}function O(t,e){return S.arrayToHex(new Uint8Array(t),!e)}function A(t){return S.bufferToArray(t).buffer}function k(t){return S.hexToArray(t).buffer}function x(t,e){const r=S.removeHexPrefix(S.sanitizeHex(new M.a(t).toString(16)));return e?r:S.addHexPrefix(r)}var I=r(37);function R(t){return S.sanitizeHex(t)}const E=r(38).payloadId;function B(){return((t,e)=>{for(e=t="";t++<36;e+=51*t&52?(15^t?8^Math.random()*(20^t?16:4):4).toString(16):"-");return e})()}function j(t,e){return S.isHexString(t,e)}function C(t){return void 0!==t.method}function P(t){return void 0!==t.result}function U(t){return void 0!==t.error}function N(t){return void 0!==t.event}function L(t){return w.includes(t)||t.startsWith("wc_")}function q(t){return!!t.method.startsWith("wc_")||!b.includes(t.method)}function D(t){t=Object(S.removeHexPrefix)(t.toLowerCase());const e=Object(S.removeHexPrefix)(Object(I.keccak_256)((r=t,S.utf8ToBuffer(r))));var r;let n="";for(let r=0;r<t.length;r++)parseInt(e[r],16)>7?n+=t[r].toUpperCase():n+=t[r];return Object(S.addHexPrefix)(n)}function W(t){var e,r,n;return(n=t)&&n.length&&!j(t[0])&&(t[0]=(e=t[0],S.utf8ToHex(e,!r))),t}function H(t){if(void 0!==t.type&&"0"!==t.type)return t;if(void 0===t.from||(!(e=t.from)||"0x"!==e.toLowerCase().substring(0,2)||!/^(0x)?[0-9a-f]{40}$/i.test(e)||!/^(0x)?[0-9a-f]{40}$/.test(e)&&!/^(0x)?[0-9A-F]{40}$/.test(e)&&e!==D(e)))throw new Error("Transaction object must include a valid 'from' value.");var e;function r(t){let e=t;var r;return("number"==typeof t||"string"==typeof t&&!function(t){return""===t||"string"==typeof t&&""===t.trim()}(t))&&(j(t)?"string"==typeof t&&(e=R(t)):e=x(t)),"string"==typeof e&&(r=e,e=S.removeHexLeadingZeros(S.addHexPrefix(r))),e}const n={from:R(t.from),to:void 0===t.to?"":R(t.to),gasPrice:void 0===t.gasPrice?"":r(t.gasPrice),gas:void 0===t.gas?void 0===t.gasLimit?"":r(t.gasLimit):r(t.gas),value:void 0===t.value?"":r(t.value),nonce:void 0===t.nonce?"":r(t.nonce),data:void 0===t.data?"":R(t.data)||"0x"},i=["gasPrice","gas","value","nonce"];return Object.keys(n).forEach(t=>{!n[t].trim().length&&i.includes(t)&&delete n[t]}),n}function F(t){const e=t.message||"Failed or Rejected Request";let r=-32e3;if(t&&!t.code)switch(e){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}return{code:r,message:e}}var Y=r(14);function z(t){const e=-1!==t.indexOf("?")?t.indexOf("?"):void 0;return void 0!==e?t.substr(e):""}function J(t,e){let r=Z(t);return r=Object.assign(Object.assign({},r),e),t=function(t){return Y.stringify(t)}(r)}function Z(t){return Y.parse(t)}function $(t){return void 0!==t.bridge}function K(t){const e=t.indexOf(":"),r=-1!==t.indexOf("?")?t.indexOf("?"):void 0,n=t.substring(0,e);const i=function(t){const e=t.split("@");return{handshakeTopic:e[0],version:parseInt(e[1],10)}}(t.substring(e+1,r));const o=function(t){const e=Z(t);return{key:e.key||"",bridge:e.bridge||""}}(void 0!==r?t.substr(r):"");return Object.assign(Object.assign({protocol:n},i),o)}r.d(e,"g",(function(){return s})),r.d(e,"r",(function(){return u})),r.d(e,"m",(function(){return h})),r.d(e,"k",(function(){return f})),r.d(e,"i",(function(){return d})),r.d(e,"B",(function(){return g})),r.d(e,"j",(function(){return y})),r.d(e,"A",(function(){return v})),r.d(e,"v",(function(){return"WALLETCONNECT_DEEPLINK_CHOICE"})),r.d(e,"C",(function(){return b})),r.d(e,"b",(function(){return T})),r.d(e,"c",(function(){return O})),r.d(e,"d",(function(){return A})),r.d(e,"e",(function(){return k})),r.d(e,"f",(function(){return x})),r.d(e,"w",(function(){return W})),r.d(e,"x",(function(){return H})),r.d(e,"z",(function(){return E})),r.d(e,"D",(function(){return B})),r.d(e,"h",(function(){return F})),r.d(e,"u",(function(){return $})),r.d(e,"y",(function(){return K})),r.d(e,"l",(function(){return z})),r.d(e,"a",(function(){return J})),r.d(e,"o",(function(){return C})),r.d(e,"q",(function(){return P})),r.d(e,"p",(function(){return U})),r.d(e,"n",(function(){return N})),r.d(e,"s",(function(){return L})),r.d(e,"t",(function(){return q}))},function(t,e,r){"use strict";r.d(e,"b",(function(){return 256})),r.d(e,"g",(function(){return 256})),r.d(e,"a",(function(){return"AES-CBC"})),r.d(e,"f",(function(){return"SHA-256"})),r.d(e,"e",(function(){return"HMAC"})),r.d(e,"i",(function(){return"SHA-256"})),r.d(e,"j",(function(){return"SHA-512"})),r.d(e,"h",(function(){return 512})),r.d(e,"d",(function(){return"encrypt"})),r.d(e,"c",(function(){return"decrypt"})),r.d(e,"k",(function(){return"sign"})),r.d(e,"l",(function(){return"verify"}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return n})),r.d(e,"c",(function(){return i})),r.d(e,"b",(function(){return o})),r.d(e,"d",(function(){return s})),r.d(e,"e",(function(){return a}));const n="INTERNAL_ERROR",i="SERVER_ERROR",o=[-32700,-32600,-32601,-32602,-32603],s=[-32e3,-32099],a={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[n]:{code:-32603,message:"Internal error"},[i]:{code:-32e3,message:"Server error"}}},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(50),e),i(r(51),e)},function(t,e,r){"use strict";function n(t){let e=void 0;return"undefined"!=typeof window&&void 0!==window[t]&&(e=window[t]),e}function i(t){const e=n(t);if(!e)throw new Error(t+" is not defined in Window");return e}Object.defineProperty(e,"__esModule",{value:!0}),e.getLocalStorage=e.getLocalStorageOrThrow=e.getCrypto=e.getCryptoOrThrow=e.getLocation=e.getLocationOrThrow=e.getNavigator=e.getNavigatorOrThrow=e.getDocument=e.getDocumentOrThrow=e.getFromWindowOrThrow=e.getFromWindow=void 0,e.getFromWindow=n,e.getFromWindowOrThrow=i,e.getDocumentOrThrow=function(){return i("document")},e.getDocument=function(){return n("document")},e.getNavigatorOrThrow=function(){return i("navigator")},e.getNavigator=function(){return n("navigator")},e.getLocationOrThrow=function(){return i("location")},e.getLocation=function(){return n("location")},e.getCryptoOrThrow=function(){return i("crypto")},e.getCrypto=function(){return n("crypto")},e.getLocalStorageOrThrow=function(){return i("localStorage")},e.getLocalStorage=function(){return n("localStorage")}},function(t,e,r){"use strict";r.d(e,"b",(function(){return s})),r.d(e,"a",(function(){return a})),r.d(e,"c",(function(){return u})),r.d(e,"d",(function(){return h})),r.d(e,"e",(function(){return c})),r.d(e,"f",(function(){return f}));var n=r(4),i=r(2);async function o(t,e=i.a){return n.getSubtleCrypto().importKey("raw",t,function(t){return t===i.a?{length:i.b,name:i.a}:{hash:{name:i.f},name:i.e}}(e),!0,function(t){return t===i.a?[i.d,i.c]:[i.k,i.l]}(e))}async function s(t,e,r){const s=n.getSubtleCrypto(),a=await o(e,i.a),u=await s.encrypt({iv:t,name:i.a},a,r);return new Uint8Array(u)}async function a(t,e,r){const s=n.getSubtleCrypto(),a=await o(e,i.a),u=await s.decrypt({iv:t,name:i.a},a,r);return new Uint8Array(u)}async function u(t,e){const r=n.getSubtleCrypto(),s=await o(t,i.e),a=await r.sign({length:i.g,name:i.e},s,e);return new Uint8Array(a)}async function h(t,e){const r=n.getSubtleCrypto(),s=await o(t,i.e),a=await r.sign({length:i.h,name:i.e},s,e);return new Uint8Array(a)}async function c(t){const e=n.getSubtleCrypto(),r=await e.digest({name:i.i},t);return new Uint8Array(r)}async function f(t){const e=n.getSubtleCrypto(),r=await e.digest({name:i.j},t);return new Uint8Array(r)}},function(t,e,r){"use strict";r.d(e,"c",(function(){return i})),r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return s}));var n=r(3);function i(t){return n.b.includes(t)}function o(t){return Object.keys(n.e).includes(t)?n.e[t]:n.e[n.a]}function s(t){const e=Object.values(n.e).find(e=>e.code===t);return e||n.e[n.a]}},function(t,e,r){"use strict";var n=r(27);r.d(e,"randomBytes",(function(){return n.a}));var i=r(28);r.d(e,"aesCbcDecrypt",(function(){return i.a})),r.d(e,"aesCbcEncrypt",(function(){return i.b}));var o=r(29);r.d(e,"hmacSha256Sign",(function(){return o.a}));r(34),r(10),r(2)},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));class n{}},function(t,e,r){"use strict";var n=r(30);r.o(n,"isConstantTime")&&r.d(e,"isConstantTime",(function(){return n.isConstantTime}));r(31);var i=r(32);r.o(i,"isConstantTime")&&r.d(e,"isConstantTime",(function(){return i.isConstantTime}));var o=r(33);r.d(e,"isConstantTime",(function(){return o.a}))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(44).Buffer}catch(t){}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o<i;o++){var s=t.charCodeAt(o)-48;n<<=4,n|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=t.length-6,n=0;r>=e;r-=6)i=a(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,h=0,c=r;c<a;c+=n)h=u(t,c,c+n,e),this.imuln(i),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var f=1;for(h=u(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-i;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,w=0|s[3],b=8191&w,_=w>>>13,M=0|s[4],S=8191&M,T=M>>>13,O=0|s[5],A=8191&O,k=O>>>13,x=0|s[6],I=8191&x,R=x>>>13,E=0|s[7],B=8191&E,j=E>>>13,C=0|s[8],P=8191&C,U=C>>>13,N=0|s[9],L=8191&N,q=N>>>13,D=0|a[0],W=8191&D,H=D>>>13,F=0|a[1],Y=8191&F,z=F>>>13,J=0|a[2],Z=8191&J,$=J>>>13,K=0|a[3],V=8191&K,Q=K>>>13,X=0|a[4],G=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(n=Math.imul(f,W))|0)+((8191&(i=(i=Math.imul(f,H))+Math.imul(l,W)|0))<<13)|0;h=((o=Math.imul(l,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,W),i=(i=Math.imul(p,H))+Math.imul(m,W)|0,o=Math.imul(m,H);var yt=(h+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,z)|0)+Math.imul(l,Y)|0))<<13)|0;h=((o=o+Math.imul(l,z)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,W),i=(i=Math.imul(y,H))+Math.imul(v,W)|0,o=Math.imul(v,H),n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,z)|0;var vt=(h+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,$)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(b,W),i=(i=Math.imul(b,H))+Math.imul(_,W)|0,o=Math.imul(_,H),n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,z)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,$)|0;var wt=(h+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(l,V)|0))<<13)|0;h=((o=o+Math.imul(l,Q)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(S,W),i=(i=Math.imul(S,H))+Math.imul(T,W)|0,o=Math.imul(T,H),n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,z)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,z)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,$)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Q)|0;var bt=(h+(n=n+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(l,G)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,W),i=(i=Math.imul(A,H))+Math.imul(k,W)|0,o=Math.imul(k,H),n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,z)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,z)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,W),i=(i=Math.imul(I,H))+Math.imul(R,W)|0,o=Math.imul(R,H),n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(h+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,H))+Math.imul(j,W)|0,o=Math.imul(j,H),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,z)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,z)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,Q)|0,n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(h+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(P,W),i=(i=Math.imul(P,H))+Math.imul(U,W)|0,o=Math.imul(U,H),n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,z)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,z)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,Q)|0,n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var Tt=(h+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(L,W),i=(i=Math.imul(L,H))+Math.imul(q,W)|0,o=Math.imul(q,H),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,z)|0)+Math.imul(U,Y)|0,o=o+Math.imul(U,z)|0,n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,$)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Q)|0,n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,lt)|0;var Ot=(h+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,Y),i=(i=Math.imul(L,z))+Math.imul(q,Y)|0,o=Math.imul(q,z),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(U,Z)|0,o=o+Math.imul(U,$)|0,n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,Q)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,Q)|0,n=n+Math.imul(I,G)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(y,ft)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,lt)|0;var At=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(L,Z),i=(i=Math.imul(L,$))+Math.imul(q,Z)|0,o=Math.imul(q,$),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,Q)|0)+Math.imul(U,V)|0,o=o+Math.imul(U,Q)|0,n=n+Math.imul(B,G)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var kt=(h+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,Q))+Math.imul(q,V)|0,o=Math.imul(q,Q),n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(U,G)|0,o=o+Math.imul(U,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ht)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(T,ft)|0,o=o+Math.imul(T,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,G),i=(i=Math.imul(L,tt))+Math.imul(q,G)|0,o=Math.imul(q,tt),n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,lt)|0;var It=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(L,rt),i=(i=Math.imul(L,nt))+Math.imul(q,rt)|0,o=Math.imul(q,nt),n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Rt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,st))+Math.imul(q,ot)|0,o=Math.imul(q,st),n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,lt)|0)+Math.imul(j,ft)|0,o=o+Math.imul(j,lt)|0;var Et=(h+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,ut),i=(i=Math.imul(L,ht))+Math.imul(q,ut)|0,o=Math.imul(q,ht),n=n+Math.imul(P,ft)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(U,ft)|0,o=o+Math.imul(U,lt)|0;var Bt=(h+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(L,ft),i=(i=Math.imul(L,lt))+Math.imul(q,ft)|0,o=Math.imul(q,lt);var jt=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,mt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(h+(n=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,mt))+Math.imul(q,pt)|0))<<13)|0;return h=((o=Math.imul(q,mt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=wt,u[4]=bt,u[5]=_t,u[6]=Mt,u[7]=St,u[8]=Tt,u[9]=Ot,u[10]=At,u[11]=kt,u[12]=xt,u[13]=It,u[14]=Rt,u[15]=Et,u[16]=Bt,u[17]=jt,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},m.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],m=n[c+d],g=r[c+d+s],y=n[c+d+s],v=f*g-l*y;y=f*y+l*g,g=v,r[c+d]=p+g,n[c+d]=m+y,r[c+d+s]=p-g,n[c+d+s]=m-y,d!==a&&(v=u*f-h*l,l=u*l+h*f,f=v)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},m.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},m.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),c=new Array(n),f=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,c,f,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=i);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,f);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,y),i(b,y),i(_,y),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var y=this.pow(f,new o(1).iushln(p-g-1));l=l.redMul(y),f=y.redSqr(),d=d.redMul(f),p=g}return l},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var f=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,M),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(43)(t))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,h=[],c=!1,f=-1;function l(){c&&u&&(c=!1,u.length?h=u.concat(h):f=-1,h.length&&d())}function d(){if(!c){var t=a(l);c=!0;for(var e=h.length;e;){for(u=h,h=[];++f<e;)u&&u[f].run();f=-1,e=h.length}u=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];h.push(new p(t,e)),1!==h.length||c||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";const n=r(52),i=r(53),o=r(54);function s(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function a(t,e){return e.encode?e.strict?n(t):encodeURIComponent(t):t}function u(t,e){return e.decode?i(t):t}function h(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function c(t){const e=(t=h(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function f(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function l(t,e){s((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);const r=function(t){let e;switch(t.arrayFormat){case"index":return(t,r,n)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===n[t]&&(n[t]={}),n[t][e[1]]=r):n[t]=r};case"bracket":return(t,r,n)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==n[t]?n[t]=[].concat(n[t],r):n[t]=[r]:n[t]=r};case"comma":case"separator":return(e,r,n)=>{const i="string"==typeof r&&r.split("").indexOf(t.arrayFormatSeparator)>-1?r.split(t.arrayFormatSeparator).map(e=>u(e,t)):null===r?r:u(r,t);n[e]=i};default:return(t,e,r)=>{void 0!==r[t]?r[t]=[].concat(r[t],e):r[t]=e}}}(e),n=Object.create(null);if("string"!=typeof t)return n;if(!(t=t.trim().replace(/^[?#&]/,"")))return n;for(const i of t.split("&")){let[t,s]=o(e.decode?i.replace(/\+/g," "):i,"=");s=void 0===s?null:["comma","separator"].includes(e.arrayFormat)?s:u(s,e),r(u(t,e),s,n)}for(const t of Object.keys(n)){const r=n[t];if("object"==typeof r&&null!==r)for(const t of Object.keys(r))r[t]=f(r[t],e);else n[t]=f(r,e)}return!1===e.sort?n:(!0===e.sort?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((t,e)=>{const r=n[e];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?t[e]=function t(e){return Array.isArray(e)?e.sort():"object"==typeof e?t(Object.keys(e)).sort((t,e)=>Number(t)-Number(e)).map(t=>e[t]):e}(r):t[e]=r,t},Object.create(null))}e.extract=c,e.parse=l,e.stringify=(t,e)=>{if(!t)return"";s((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);const r=r=>e.skipNull&&null==t[r]||e.skipEmptyString&&""===t[r],n=function(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{const i=r.length;return void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,[a(e,t),"[",i,"]"].join("")]:[...r,[a(e,t),"[",a(i,t),"]=",a(n,t)].join("")]};case"bracket":return e=>(r,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,[a(e,t),"[]"].join("")]:[...r,[a(e,t),"[]=",a(n,t)].join("")];case"comma":case"separator":return e=>(r,n)=>null==n||0===n.length?r:0===r.length?[[a(e,t),"=",a(n,t)].join("")]:[[r,a(n,t)].join(t.arrayFormatSeparator)];default:return e=>(r,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,a(e,t)]:[...r,[a(e,t),"=",a(n,t)].join("")]}}(e),i={};for(const e of Object.keys(t))r(e)||(i[e]=t[e]);const o=Object.keys(i);return!1!==e.sort&&o.sort(e.sort),o.map(r=>{const i=t[r];return void 0===i?"":null===i?a(r,e):Array.isArray(i)?i.reduce(n(r),[]).join("&"):a(r,e)+"="+a(i,e)}).filter(t=>t.length>0).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);const[r,n]=o(t,"#");return Object.assign({url:r.split("?")[0]||"",query:l(c(t),e)},e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:u(n,e)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0},r);const n=h(t.url).split("?")[0]||"",i=e.extract(t.url),o=e.parse(i,{sort:!1}),s=Object.assign(o,t.query);let u=e.stringify(s,r);u&&(u="?"+u);let c=function(t){let e="";const r=t.indexOf("#");return-1!==r&&(e=t.slice(r)),e}(t.url);return t.fragmentIdentifier&&(c="#"+a(t.fragmentIdentifier,r)),`${n}${u}${c}`}},function(t,e,r){"use strict";(function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
var n=r(45),i=r(46),o=r(47);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return h(this,t,e,r)}function h(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=l(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=a(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|d(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):l(t,e);if("Buffer"===e.type&&o(e.data))return l(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(c(e),t=a(t,e<0?0:0|d(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function l(t,e){var r=e.length<0?0:0|d(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(t).length;default:if(n)return D(t).length;e=(""+e).toLowerCase(),n=!0}}function m(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return x(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var c=-1;for(o=r;o<a;o++)if(h(t,o)===h(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var f=!0,l=0;l<u;l++)if(h(t,o+l)!==h(e,l)){f=!1;break}if(f)return o}return-1}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function b(t,e,r,n){return H(D(e,t.length-r),t,r,n)}function _(t,e,r,n){return H(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function M(t,e,r,n){return _(t,e,r,n)}function S(t,e,r,n){return H(W(e),t,r,n)}function T(t,e,r,n){return H(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,h=t[i],c=null,f=h>239?4:h>223?3:h>191?2:1;if(i+f<=r)switch(f){case 1:h<128&&(c=h);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&h)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&h)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return h(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,n){return c(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return f(null,t)},u.allocUnsafeSlow=function(t){return f(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):m.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),h=this.slice(n,i),c=t.slice(e,r),f=0;f<a;++f)if(h[f]!==c[f]){o=h[f],s=c[f];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return M(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function x(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function I(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=q(t[o]);return i}function R(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function E(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function j(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function C(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function P(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,o){return o||P(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,o){return o||P(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||E(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||E(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||E(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||E(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||E(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||E(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||E(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||E(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||E(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||E(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||E(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||E(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||E(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||E(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||E(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||E(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||E(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):C(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):C(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=u.isBuffer(t)?t:D(new u(t,n).toString()),a=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function q(t){return t<16?"0"+t.toString(16):t.toString(16)}function D(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(12))},function(t,e){t.exports=i,i.strict=o,i.loose=s;var r=Object.prototype.toString,n={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function i(t){return o(t)||s(t)}function o(t){return t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array}function s(t){return n[r.call(t)]}},function(t,e,r){"use strict";var n=r(4);r.o(n,"payloadId")&&r.d(e,"payloadId",(function(){return n.payloadId}));n.isNode},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));r(7),r(3);function n(){return Date.now()*Math.pow(10,3)+Math.floor(Math.random()*Math.pow(10,3))}},function(t,e,r){"use strict"},function(t,e,r){"use strict";r(21)},function(t,e,r){"use strict";r(22),r(9),r(23),r(24)},function(t,e){},function(t,e,r){"use strict";var n=r(9);n.a;n.a},function(t,e){},function(t,e,r){"use strict"},function(t,e,r){"use strict"},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(4);function i(t){return n.getBrowerCrypto().getRandomValues(new Uint8Array(t))}},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return o}));var n=r(6);function i(t,e,r){return Object(n.b)(t,e,r)}function o(t,e,r){return Object(n.a)(t,e,r)}},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(6);r(10);async function i(t,e){return await Object(n.c)(t,e)}},function(t,e,r){"use strict";var n=r(4);r.o(n,"isConstantTime")&&r.d(e,"isConstantTime",(function(){return n.isConstantTime}))},function(t,e,r){"use strict"},function(t,e){},function(t,e,r){"use strict";function n(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return 0===r}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";r(6)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getWindowMetadata=void 0;const n=r(5);e.getWindowMetadata=function(){let t,e;try{t=n.getDocumentOrThrow(),e=n.getLocationOrThrow()}catch(t){return null}function r(...e){const r=t.getElementsByTagName("meta");for(let t=0;t<r.length;t++){const n=r[t],i=["itemprop","property","name"].map(t=>n.getAttribute(t)).filter(t=>!!t&&e.includes(t));if(i.length&&i){const t=n.getAttribute("content");if(t)return t}}return""}const i=function(){let e=r("name","og:site_name","og:title","twitter:title");return e||(e=t.title),e}();return{description:r("description","og:description","twitter:description","keywords"),url:e.origin,icons:function(){const r=t.getElementsByTagName("link"),n=[];for(let t=0;t<r.length;t++){const i=r[t],o=i.getAttribute("rel");if(o&&o.toLowerCase().indexOf("icon")>-1){const t=i.getAttribute("href");if(t)if(-1===t.toLowerCase().indexOf("https:")&&-1===t.toLowerCase().indexOf("http:")&&0!==t.indexOf("//")){let r=e.protocol+"//"+e.host;if(0===t.indexOf("/"))r+=t;else{const n=e.pathname.split("/");n.pop();r+=n.join("/")+"/"+t}n.push(r)}else if(0===t.indexOf("//")){const r=e.protocol+t;n.push(r)}else n.push(t)}}return n}(),name:i}}},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return l}));var n=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),i=0;for(e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n},i=function(t,e,r){this.name=t,this.version=e,this.os=r,this.type="browser"},o=function(e){this.version=e,this.type="node",this.name="node",this.os=t.platform},s=function(t,e,r,n){this.name=t,this.version=e,this.os=r,this.bot=n,this.type="bot-device"},a=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},u=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},h=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,c=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],f=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function l(e){return e?p(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new u:"undefined"!=typeof navigator?p(navigator.userAgent):void 0!==t&&t.version?new o(t.version.slice(1)):null}function d(t){return""!==t&&c.reduce((function(e,r){var n=r[0],i=r[1];if(e)return e;var o=i.exec(t);return!!o&&[n,o]}),!1)}function p(t){var e=d(t);if(!e)return null;var r=e[0],o=e[1];if("searchbot"===r)return new a;var u=o[1]&&o[1].split(/[._]/).slice(0,3);u?u.length<3&&(u=n(u,function(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}(3-u.length))):u=[];var c=u.join("."),l=function(t){for(var e=0,r=f.length;e<r;e++){var n=f[e],i=n[0];if(n[1].exec(t))return i}return null}(t),p=h.exec(t);return p&&p[1]?new s(r,c,l,p[1]):new i(r,c,l)}}).call(this,r(13))},function(t,e,r){(function(n,i){var o;
/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.8.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2018
* @license MIT
*/!function(){"use strict";var s="input is invalid type",a="object"==typeof window,u=a?window:{};u.JS_SHA3_NO_WINDOW&&(a=!1);var h=!a&&"object"==typeof self;!u.JS_SHA3_NO_NODE_JS&&"object"==typeof n&&n.versions&&n.versions.node?u=i:h&&(u=self);var c=!u.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,f=r(49),l=!u.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),p=[4,1024,262144,67108864],m=[0,8,16,24],g=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],y=[224,256,384,512],v=[128,256],w=["hex","buffer","arrayBuffer","array","digest"],b={128:168,256:136};!u.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!l||!u.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var _=function(t,e,r){return function(n){return new U(t,e,t).update(n)[r]()}},M=function(t,e,r){return function(n,i){return new U(t,e,i).update(n)[r]()}},S=function(t,e,r){return function(e,n,i,o){return x["cshake"+t].update(e,n,i,o)[r]()}},T=function(t,e,r){return function(e,n,i,o){return x["kmac"+t].update(e,n,i,o)[r]()}},O=function(t,e,r,n){for(var i=0;i<w.length;++i){var o=w[i];t[o]=e(r,n,o)}return t},A=function(t,e){var r=_(t,e,"hex");return r.create=function(){return new U(t,e,t)},r.update=function(t){return r.create().update(t)},O(r,_,t,e)},k=[{name:"keccak",padding:[1,256,65536,16777216],bits:y,createMethod:A},{name:"sha3",padding:[6,1536,393216,100663296],bits:y,createMethod:A},{name:"shake",padding:[31,7936,2031616,520093696],bits:v,createMethod:function(t,e){var r=M(t,e,"hex");return r.create=function(r){return new U(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},O(r,M,t,e)}},{name:"cshake",padding:p,bits:v,createMethod:function(t,e){var r=b[t],n=S(t,0,"hex");return n.create=function(n,i,o){return i||o?new U(t,e,n).bytepad([i,o],r):x["shake"+t].create(n)},n.update=function(t,e,r,i){return n.create(e,r,i).update(t)},O(n,S,t,e)}},{name:"kmac",padding:p,bits:v,createMethod:function(t,e){var r=b[t],n=T(t,0,"hex");return n.create=function(n,i,o){return new N(t,e,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(t,e,r,i){return n.create(t,r,i).update(e)},O(n,T,t,e)}}],x={},I=[],R=0;R<k.length;++R)for(var E=k[R],B=E.bits,j=0;j<B.length;++j){var C=E.name+"_"+B[j];if(I.push(C),x[C]=E.createMethod(B[j],E.padding),"sha3"!==E.name){var P=E.name+B[j];I.push(P),x[P]=x[C]}}function U(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function N(t,e,r){U.call(this,t,e,r)}U.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}for(var n,i,o=this.blocks,a=this.byteCount,u=t.length,h=this.blockCount,c=0,f=this.s;c<u;){if(this.reset)for(this.reset=!1,o[0]=this.block,n=1;n<h+1;++n)o[n]=0;if(e)for(n=this.start;c<u&&n<a;++c)o[n>>2]|=t[c]<<m[3&n++];else for(n=this.start;c<u&&n<a;++c)(i=t.charCodeAt(c))<128?o[n>>2]|=i<<m[3&n++]:i<2048?(o[n>>2]|=(192|i>>6)<<m[3&n++],o[n>>2]|=(128|63&i)<<m[3&n++]):i<55296||i>=57344?(o[n>>2]|=(224|i>>12)<<m[3&n++],o[n>>2]|=(128|i>>6&63)<<m[3&n++],o[n>>2]|=(128|63&i)<<m[3&n++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++c)),o[n>>2]|=(240|i>>18)<<m[3&n++],o[n>>2]|=(128|i>>12&63)<<m[3&n++],o[n>>2]|=(128|i>>6&63)<<m[3&n++],o[n>>2]|=(128|63&i)<<m[3&n++]);if(this.lastByteIndex=n,n>=a){for(this.start=n-a,this.block=o[h],n=0;n<h;++n)f[n]^=o[n];L(f),this.reset=!0}else this.start=n}return this},U.prototype.encode=function(t,e){var r=255&t,n=1,i=[r];for(r=255&(t>>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},U.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}var n=0,i=t.length;if(e)n=i;else for(var o=0;o<t.length;++o){var a=t.charCodeAt(o);a<128?n+=1:a<2048?n+=2:a<55296||a>=57344?n+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(t),n},U.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n<t.length;++n)r+=this.encodeString(t[n]);var i=e-r%e,o=[];return o.length=i,this.update(o),this},U.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];L(n)}},U.prototype.toString=U.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<e&&s<n;++o,++s)t=r[o],a+=d[t>>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15];s%e==0&&(L(r),o=0)}return i&&(t=r[o],a+=d[t>>4&15]+d[15&t],i>1&&(a+=d[t>>12&15]+d[t>>8&15]),i>2&&(a+=d[t>>20&15]+d[t>>16&15])),a},U.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s<n;){for(o=0;o<e&&s<n;++o,++s)u[s]=r[o];s%e==0&&L(r)}return i&&(u[o]=r[o],t=t.slice(0,a)),t},U.prototype.buffer=U.prototype.arrayBuffer,U.prototype.digest=U.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)t=a<<2,e=n[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&L(n)}return o&&(t=a<<2,e=n[s],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},N.prototype=new U,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),U.prototype.finalize.call(this)};var L=function(t){var e,r,n,i,o,s,a,u,h,c,f,l,d,p,m,y,v,w,b,_,M,S,T,O,A,k,x,I,R,E,B,j,C,P,U,N,L,q,D,W,H,F,Y,z,J,Z,$,K,V,Q,X,G,tt,et,rt,nt,it,ot,st,at,ut,ht,ct;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(l=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|h>>>31),r=o^(h<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(c<<1|f>>>31),r=a^(f<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(l<<1|d>>>31),r=h^(d<<1|l>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(i<<1|o>>>31),r=f^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],m=t[1],Z=t[11]<<4|t[10]>>>28,$=t[10]<<4|t[11]>>>28,I=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,F=t[40]<<18|t[41]>>>14,Y=t[41]<<18|t[40]>>>14,P=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,K=t[22]<<10|t[23]>>>22,V=t[23]<<10|t[22]>>>22,E=t[33]<<13|t[32]>>>19,B=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,N=t[14]<<6|t[15]>>>26,L=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,Q=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,O=t[6]<<28|t[7]>>>4,A=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,q=t[26]<<25|t[27]>>>7,D=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,G=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,z=t[8]<<27|t[9]>>>5,J=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,x=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,W=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,T=t[49]<<14|t[48]>>>18,t[0]=p^~y&w,t[1]=m^~v&b,t[10]=O^~k&I,t[11]=A^~x&R,t[20]=P^~N&q,t[21]=U^~L&D,t[30]=z^~Z&K,t[31]=J^~$&V,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=v^~b&M,t[12]=k^~I&E,t[13]=x^~R&B,t[22]=N^~q&W,t[23]=L^~D&H,t[32]=Z^~K&Q,t[33]=$^~V&X,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=w^~_&S,t[5]=b^~M&T,t[14]=I^~E&j,t[15]=R^~B&C,t[24]=q^~W&F,t[25]=D^~H&Y,t[34]=K^~Q&G,t[35]=V^~X&tt,t[44]=ot^~at&ht,t[45]=st^~ut&ct,t[6]=_^~S&p,t[7]=M^~T&m,t[16]=E^~j&O,t[17]=B^~C&A,t[26]=W^~F&P,t[27]=H^~Y&U,t[36]=Q^~G&z,t[37]=X^~tt&J,t[46]=at^~ht&et,t[47]=ut^~ct&rt,t[8]=S^~p&y,t[9]=T^~m&v,t[18]=j^~O&k,t[19]=C^~A&x,t[28]=F^~P&N,t[29]=Y^~U&L,t[38]=G^~z&Z,t[39]=tt^~J&$,t[48]=ht^~et&nt,t[49]=ct^~rt&it,t[0]^=g[n],t[1]^=g[n+1]};if(c)t.exports=x;else{for(R=0;R<I.length;++R)u[I[R]]=x[I[R]];f&&(void 0===(o=function(){return x}.call(e,r,e,t))||(t.exports=o))}}()}).call(this,r(13),r(12))},function(t,e,r){"use strict";r(3),r(7);var n=r(17);r.o(n,"payloadId")&&r.d(e,"payloadId",(function(){return n.payloadId}));var i=r(18);r.d(e,"payloadId",(function(){return i.a}));r(19),r(20),r(25),r(26)},function(t,e,r){"use strict";(function(t){var n=r(1),i=r(40);const o=void 0!==t.WebSocket?t.WebSocket:r(55);e.a=class{constructor(t){if(this.opts=t,this._queue=[],this._events=[],this._subscriptions=[],this._protocol=t.protocol,this._version=t.version,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=t.subscriptions||[],this._netMonitor=t.netMonitor||new i.a,!t.url||"string"!=typeof t.url)throw new Error("Missing or invalid WebSocket url");this._url=t.url,this._netMonitor.on("online",()=>this._socketCreate())}set readyState(t){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(t){}get connecting(){return 0===this.readyState}set connected(t){}get connected(){return 1===this.readyState}set closing(t){}get closing(){return 2===this.readyState}set closed(t){}get closed(){return 3===this.readyState}open(){this._socketCreate()}close(){this._socketClose()}send(t,e,r){if(!e||"string"!=typeof e)throw new Error("Missing or invalid topic field");this._socketSend({topic:e,type:"pub",payload:t,silent:!!r})}subscribe(t){this._socketSend({topic:t,type:"sub",payload:"",silent:!0})}on(t,e){this._events.push({event:t,callback:e})}_socketCreate(){if(this._nextSocket)return;const t=function(t,e,r){var i,o;const s=(t.startsWith("https")?t.replace("https","wss"):t.startsWith("http")?t.replace("http","ws"):t).split("?"),a=Object(n.m)()?{protocol:e,version:r,env:"browser",host:(null===(i=Object(n.k)())||void 0===i?void 0:i.host)||""}:{protocol:e,version:r,env:(null===(o=Object(n.g)())||void 0===o?void 0:o.name)||""},u=Object(n.a)(Object(n.l)(s[1]||""),a);return s[0]+"?"+u}(this._url,this._protocol,this._version);if(this._nextSocket=new o(t),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=t=>this._socketReceive(t),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=t=>this._socketError(t),this._nextSocket.onclose=()=>{setTimeout(()=>{this._nextSocket=null,this._socketCreate()},1e3)}}_socketOpen(){this._socketClose(),this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}_socketClose(){this._socket&&(this._socket.onclose=()=>{},this._socket.close())}_socketSend(t){const e=JSON.stringify(t);this._socket&&1===this._socket.readyState?this._socket.send(e):(this._setToQueue(t),this._socketCreate())}async _socketReceive(t){let e;try{e=JSON.parse(t.data)}catch(t){return}if(this._socketSend({topic:e.topic,type:"ack",payload:"",silent:!0}),this._socket&&1===this._socket.readyState){const t=this._events.filter(t=>"message"===t.event);t&&t.length&&t.forEach(t=>t.callback(e))}}_socketError(t){const e=this._events.filter(t=>"error"===t.event);e&&e.length&&e.forEach(e=>e.callback(t))}_queueSubscriptions(){this._subscriptions.forEach(t=>this._queue.push({topic:t,type:"sub",payload:"",silent:!0})),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(t){this._queue.push(t)}_pushQueue(){this._queue.forEach(t=>this._socketSend(t)),this._queue=[]}}}).call(this,r(12))},function(t,e,r){"use strict";e.a=class{constructor(){this._eventEmitters=[],"undefined"!=typeof window&&void 0!==window.addEventListener&&(window.addEventListener("online",()=>this.trigger("online")),window.addEventListener("offline",()=>this.trigger("offline")))}on(t,e){this._eventEmitters.push({event:t,callback:e})}trigger(t){let e=[];t&&(e=this._eventEmitters.filter(e=>e.event===t)),e.forEach(t=>{t.callback()})}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(42),i=(0,n.__importDefault)(r(57)),o=(0,n.__importStar)(r(56));class s extends i.default{constructor(t,e){super({cryptoLib:o,connectorOpts:t,pushServerOpts:e})}}e.default=s},function(t,e,r){"use strict";r.r(e),r.d(e,"__extends",(function(){return i})),r.d(e,"__assign",(function(){return o})),r.d(e,"__rest",(function(){return s})),r.d(e,"__decorate",(function(){return a})),r.d(e,"__param",(function(){return u})),r.d(e,"__metadata",(function(){return h})),r.d(e,"__awaiter",(function(){return c})),r.d(e,"__generator",(function(){return f})),r.d(e,"__exportStar",(function(){return l})),r.d(e,"__values",(function(){return d})),r.d(e,"__read",(function(){return p})),r.d(e,"__spread",(function(){return m})),r.d(e,"__await",(function(){return g})),r.d(e,"__asyncGenerator",(function(){return y})),r.d(e,"__asyncDelegator",(function(){return v})),r.d(e,"__asyncValues",(function(){return w})),r.d(e,"__makeTemplateObject",(function(){return b})),r.d(e,"__importStar",(function(){return _})),r.d(e,"__importDefault",(function(){return M}));
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function i(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var o=function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&(r[n[i]]=t[n[i]])}return r}function a(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function u(t,e){return function(r,n){e(r,n,t)}}function h(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function c(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function f(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function l(t,e){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}function d(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function p(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function m(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}function g(t){return this instanceof g?(this.v=t,this):new g(t)}function y(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(t,e||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(t){i[t]&&(n[t]=function(e){return new Promise((function(r,n){o.push([t,e,r,n])>1||a(t,e)}))})}function a(t,e){try{(r=i[t](e)).value instanceof g?Promise.resolve(r.value.v).then(u,h):c(o[0][2],r)}catch(t){c(o[0][3],t)}var r}function u(t){a("next",t)}function h(t){a("throw",t)}function c(t,e){t(e),o.shift(),o.length&&a(o[0][0],o[0][1])}}function v(t){var e,r;return e={},n("next"),n("throw",(function(t){throw t})),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,i){e[n]=t[n]?function(e){return(r=!r)?{value:g(t[n](e)),done:"return"===n}:i?i(e):e}:i}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=d(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise((function(n,i){(function(t,e,r,n){Promise.resolve(n).then((function(e){t({value:e,done:r})}),e)})(n,i,(e=t[r](e)).done,e.value)}))}}}function b(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function _(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function M(t){return t&&t.__esModule?t:{default:t}}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";e.byteLength=function(t){var e=h(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=h(t),s=n[0],a=n[1],u=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),c=0,f=a>0?s-4:s;for(r=0;r<f;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[c++]=255&e);1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(c(t,s,s+16383>a?a:s+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function h(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var i,o,s=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,h=u>>1,c=-7,f=r?i-1:0,l=r?-1:1,d=t[e+f];for(f+=l,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+t[e+f],f+=l,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+t[e+f],f+=l,c-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=h}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,h=8*o-i-1,c=(1<<h)-1,f=c>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?l/u:l*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=c?(a=0,s=c):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,h+=i;h>0;t[r+d]=255&s,d+=p,s/=256,h-=8);t[r+d-p]|=128*m}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(e){var n=r(16).strict;t.exports=function(t){if(n(t)){var r=e.from(t.buffer);return t.byteLength!==t.buffer.byteLength&&(r=r.slice(t.byteOffset,t.byteOffset+t.byteLength)),r}return e.from(t)}}).call(this,r(15).Buffer)},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,r){"use strict";(function(t){function r(){return(null==t?void 0:t.crypto)||(null==t?void 0:t.msCrypto)||{}}function n(){const t=r();return t.subtle||t.webkitSubtle}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowserCryptoAvailable=e.getSubtleCrypto=e.getBrowerCrypto=void 0,e.getBrowerCrypto=r,e.getSubtleCrypto=n,e.isBrowserCryptoAvailable=function(){return!!r()&&!!n()}}).call(this,r(12))},function(t,e,r){"use strict";(function(t){function r(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function n(){return void 0!==t&&void 0!==t.versions&&void 0!==t.versions.node}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowser=e.isNode=e.isReactNative=void 0,e.isReactNative=r,e.isNode=n,e.isBrowser=function(){return!r()&&!n()}}).call(this,r(13))},function(t,e,r){"use strict";t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())},function(t,e,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),i=new RegExp("(%[a-f0-9]{2})+","gi");function o(t,e){try{return decodeURIComponent(t.join(""))}catch(t){}if(1===t.length)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],o(r),o(n))}function s(t){try{return decodeURIComponent(t)}catch(i){for(var e=t.match(n),r=1;r<e.length;r++)e=(t=o(e,r).join("")).match(n);return t}}t.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},r=i.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch(t){var n=s(r[0]);n!==r[0]&&(e[r[0]]=n)}r=i.exec(t)}e["%C2"]="�";for(var o=Object.keys(e),a=0;a<o.length;a++){var u=o[a];t=t.replace(new RegExp(u,"g"),e[u])}return t}(t)}}},function(t,e,r){"use strict";t.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const r=t.indexOf(e);return-1===r?[t]:[t.slice(0,r),t.slice(r+e.length)]}},function(t,e,r){"use strict";t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},function(t,e,r){"use strict";r.r(e),r.d(e,"generateKey",(function(){return s})),r.d(e,"verifyHmac",(function(){return a})),r.d(e,"encrypt",(function(){return u})),r.d(e,"decrypt",(function(){return h}));var n=r(8),i=r(0),o=r(1);async function s(t){const e=(t||256)/8,r=n.randomBytes(e);return Object(o.d)(i.arrayToBuffer(r))}async function a(t,e){const r=i.hexToArray(t.data),o=i.hexToArray(t.iv),s=i.hexToArray(t.hmac),a=i.arrayToHex(s,!1),u=i.concatArrays(r,o),h=await n.hmacSha256Sign(e,u),c=i.arrayToHex(h,!1);return i.removeHexPrefix(a)===i.removeHexPrefix(c)}async function u(t,e,r){const a=i.bufferToArray(Object(o.b)(e)),u=r||await s(128),h=i.bufferToArray(Object(o.b)(u)),c=i.arrayToHex(h,!1),f=JSON.stringify(t),l=i.utf8ToArray(f),d=await n.aesCbcEncrypt(h,a,l),p=i.arrayToHex(d,!1),m=i.concatArrays(d,h),g=await n.hmacSha256Sign(a,m);return{data:p,hmac:i.arrayToHex(g,!1),iv:c}}async function h(t,e){const r=i.bufferToArray(Object(o.b)(e));if(!r)throw new Error("Missing key: required for decryption");if(!await a(t,r))return null;const s=i.hexToArray(t.data),u=i.hexToArray(t.iv),h=await n.aesCbcDecrypt(u,r,s),c=i.arrayToUtf8(h);let f;try{f=JSON.parse(c)}catch(t){return null}return f}},function(t,e,r){"use strict";r.r(e);var n=r(1),i=r(39);var o=class{constructor(){this._eventEmitters=[]}subscribe(t){this._eventEmitters.push(t)}unsubscribe(t){this._eventEmitters=this._eventEmitters.filter(e=>e.event!==t)}trigger(t){let e,r=[];e=Object(n.o)(t)?t.method:Object(n.q)(t)||Object(n.p)(t)?"response:"+t.id:Object(n.n)(t)?t.event:"",e&&(r=this._eventEmitters.filter(t=>t.event===e)),r&&r.length||Object(n.s)(e)||Object(n.n)(e)||(r=this._eventEmitters.filter(t=>"call_request"===t.event)),r.forEach(e=>{if(Object(n.p)(t)){const r=new Error(t.error.message);e.callback(r,null)}else e.callback(null,t)})}};var s=class{constructor(t="walletconnect"){this.storageId=t}getSession(){let t=null;const e=Object(n.j)(this.storageId);return e&&Object(n.u)(e)&&(t=e),t}setSession(t){return Object(n.B)(this.storageId,t),t}removeSession(){Object(n.A)(this.storageId)}};const a="abcdefghijklmnopqrstuvwxyz0123456789".split("").map(t=>`https://${t}.bridge.walletconnect.org`);function u(){return a[Math.floor(Math.random()*a.length)]}e.default=class{constructor(t){if(this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new o,this._clientMeta=Object(n.i)()||t.connectorOpts.clientMeta||null,this._cryptoLib=t.cryptoLib,this._sessionStorage=t.sessionStorage||new s(t.connectorOpts.storageId),this._qrcodeModal=t.connectorOpts.qrcodeModal,this._qrcodeModalOptions=t.connectorOpts.qrcodeModalOptions,this._signingMethods=[...n.C,...t.connectorOpts.signingMethods||[]],!t.connectorOpts.bridge&&!t.connectorOpts.uri&&!t.connectorOpts.session)throw new Error("Missing one of the required parameters: bridge / uri / session");var e;t.connectorOpts.bridge&&(this.bridge=function(t){return"walletconnect.org"===function(t){return function(t){let e=t.indexOf("//")>-1?t.split("/")[2]:t.split("/")[0];return e=e.split(":")[0],e=e.split("?")[0],e}(t).split(".").slice(-2).join(".")}(t)}(e=t.connectorOpts.bridge)?u():e),t.connectorOpts.uri&&(this.uri=t.connectorOpts.uri);const r=t.connectorOpts.session||this._getStorageSession();r&&(this.session=r),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=t.transport||new i.a({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),t.connectorOpts.uri&&this._subscribeToSessionRequest(),t.pushServerOpts&&this._registerPushServer(t.pushServerOpts)}set bridge(t){t&&(this._bridge=t)}get bridge(){return this._bridge}set key(t){if(!t)return;const e=Object(n.e)(t);this._key=e}get key(){if(this._key){return Object(n.c)(this._key,!0)}return""}set clientId(t){t&&(this._clientId=t)}get clientId(){let t=this._clientId;return t||(t=this._clientId=Object(n.D)()),this._clientId}set peerId(t){t&&(this._peerId=t)}get peerId(){return this._peerId}set clientMeta(t){}get clientMeta(){let t=this._clientMeta;return t||(t=this._clientMeta=Object(n.i)()),t}set peerMeta(t){this._peerMeta=t}get peerMeta(){return this._peerMeta}set handshakeTopic(t){t&&(this._handshakeTopic=t)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(t){t&&(this._handshakeId=t)}get handshakeId(){return this._handshakeId}get uri(){return this._formatUri()}set uri(t){if(!t)return;const{handshakeTopic:e,bridge:r,key:n}=this._parseUri(t);this.handshakeTopic=e,this.bridge=r,this.key=n}set chainId(t){this._chainId=t}get chainId(){return this._chainId}set networkId(t){this._networkId=t}get networkId(){return this._networkId}set accounts(t){this._accounts=t}get accounts(){return this._accounts}set rpcUrl(t){this._rpcUrl=t}get rpcUrl(){return this._rpcUrl}set connected(t){}get connected(){return this._connected}set pending(t){}get pending(){return!!this._handshakeTopic}get session(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}}set session(t){t&&(this._connected=t.connected,this.accounts=t.accounts,this.chainId=t.chainId,this.bridge=t.bridge,this.key=t.key,this.clientId=t.clientId,this.clientMeta=t.clientMeta,this.peerId=t.peerId,this.peerMeta=t.peerMeta,this.handshakeId=t.handshakeId,this.handshakeTopic=t.handshakeTopic)}on(t,e){const r={event:t,callback:e};this._eventManager.subscribe(r)}off(t){this._eventManager.unsubscribe(t)}async createInstantRequest(t){this._key=await this._generateKey();const e=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(t)}]});this.handshakeId=e.id,this.handshakeTopic=Object(n.D)(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",()=>{throw new Error("User close QRCode Modal")});const r=()=>{this.killSession()};try{const t=await this._sendCallRequest(e);return t&&r(),t}catch(t){throw r(),t}}async connect(t){if(!this._qrcodeModal)throw new Error("QRCode Modal not provided");return this.connected?{chainId:this.chainId,accounts:this.accounts}:(await this.createSession(t),new Promise(async(t,e)=>{this.on("modal_closed",()=>e(new Error("User close QRCode Modal"))),this.on("connect",(r,n)=>{if(r)return e(r);t(n.params[0])})}))}async createSession(t){if(this._connected)throw new Error("Session currently connected");if(this.pending)return;this._key=await this._generateKey();const e=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:t&&t.chainId?t.chainId:null}]});this.handshakeId=e.id,this.handshakeTopic=Object(n.D)(),this._sendSessionRequest(e,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]})}approveSession(t){if(this._connected)throw new Error("Session currently connected");this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";const e={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},r={id:this.handshakeId,jsonrpc:"2.0",result:e};this._sendResponse(r),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(t){if(this._connected)throw new Error("Session currently connected");const e=t&&t.message?t.message:"Session Rejected",r=this._formatResponse({id:this.handshakeId,error:{message:e}});this._sendResponse(r),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:e}]}),this._removeStorageSession()}updateSession(t){if(!this._connected)throw new Error("Session currently disconnected");this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";const e={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},r=this._formatRequest({method:"wc_sessionUpdate",params:[e]});this._sendSessionRequest(r,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}async killSession(t){const e=t?t.message:"Session Disconnected",r=this._formatRequest({method:"wc_sessionUpdate",params:[{approved:!1,chainId:null,networkId:null,accounts:null}]});await this._sendRequest(r),this._handleSessionDisconnect(e)}async sendTransaction(t){if(!this._connected)throw new Error("Session currently disconnected");const e=Object(n.x)(t),r=this._formatRequest({method:"eth_sendTransaction",params:[e]});return await this._sendCallRequest(r)}async signTransaction(t){if(!this._connected)throw new Error("Session currently disconnected");const e=Object(n.x)(t),r=this._formatRequest({method:"eth_signTransaction",params:[e]});return await this._sendCallRequest(r)}async signMessage(t){if(!this._connected)throw new Error("Session currently disconnected");const e=this._formatRequest({method:"eth_sign",params:t});return await this._sendCallRequest(e)}async signPersonalMessage(t){if(!this._connected)throw new Error("Session currently disconnected");t=Object(n.w)(t);const e=this._formatRequest({method:"personal_sign",params:t});return await this._sendCallRequest(e)}async signTypedData(t){if(!this._connected)throw new Error("Session currently disconnected");const e=this._formatRequest({method:"eth_signTypedData",params:t});return await this._sendCallRequest(e)}async updateChain(t){if(!this._connected)throw new Error("Session currently disconnected");const e=this._formatRequest({method:"wallet_updateChain",params:[t]});return await this._sendCallRequest(e)}unsafeSend(t,e){return this._sendRequest(t,e),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:e}]}),new Promise((e,r)=>{this._subscribeToResponse(t.id,(t,n)=>{if(t)r(t);else{if(!n)throw new Error("Missing JSON RPC response");e(n)}})})}async sendCustomRequest(t,e){if(!this._connected)throw new Error("Session currently disconnected");switch(t.method){case"eth_accounts":return this.accounts;case"eth_chainId":return Object(n.f)(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":t.params&&(t.params[0]=Object(n.x)(t.params[0]));break;case"personal_sign":t.params&&(t.params=Object(n.w)(t.params))}const r=this._formatRequest(t);return await this._sendCallRequest(r,e)}approveRequest(t){if(!Object(n.q)(t))throw new Error('JSON-RPC success response must include "result" field');{const e=this._formatResponse(t);this._sendResponse(e)}}rejectRequest(t){if(!Object(n.p)(t))throw new Error('JSON-RPC error response must include "error" field');{const e=this._formatResponse(t);this._sendResponse(e)}}transportClose(){this._transport.close()}async _sendRequest(t,e){const r=this._formatRequest(t),i=await this._encrypt(r),o=void 0!==(null==e?void 0:e.topic)?e.topic:this.peerId,s=JSON.stringify(i),a=void 0!==(null==e?void 0:e.forcePushNotification)?!e.forcePushNotification:Object(n.t)(r);this._transport.send(s,o,a)}async _sendResponse(t){const e=await this._encrypt(t),r=this.peerId,n=JSON.stringify(e);this._transport.send(n,r,!0)}async _sendSessionRequest(t,e,r){this._sendRequest(t,r),this._subscribeToSessionResponse(t.id,e)}_sendCallRequest(t,e){return this._sendRequest(t,e),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:e}]}),this._subscribeToCallResponse(t.id)}_formatRequest(t){if(void 0===t.method)throw new Error('JSON RPC request must have valid "method" value');return{id:void 0===t.id?Object(n.z)():t.id,jsonrpc:"2.0",method:t.method,params:void 0===t.params?[]:t.params}}_formatResponse(t){if(void 0===t.id)throw new Error('JSON RPC request must have valid "id" value');const e={id:t.id,jsonrpc:"2.0"};if(Object(n.p)(t)){const r=Object(n.h)(t.error);return Object.assign(Object.assign(Object.assign({},e),t),{error:r})}if(Object(n.q)(t)){return Object.assign(Object.assign({},e),t)}throw new Error("JSON RPC response format is invalid")}_handleSessionDisconnect(t){const e=t||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),Object(n.A)(n.v)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:e}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(t,e){e&&e.approved?(this._connected?(e.chainId&&(this.chainId=e.chainId),e.accounts&&(this.accounts=e.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,e.chainId&&(this.chainId=e.chainId),e.accounts&&(this.accounts=e.accounts),e.peerId&&!this.peerId&&(this.peerId=e.peerId),e.peerMeta&&!this.peerMeta&&(this.peerMeta=e.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(t)}async _handleIncomingMessages(t){if(![this.clientId,this.handshakeTopic].includes(t.topic))return;let e;try{e=JSON.parse(t.payload)}catch(t){return}const r=await this._decrypt(e);r&&this._eventManager.trigger(r)}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(t,e){this.on("response:"+t,e)}_subscribeToSessionResponse(t,e){this._subscribeToResponse(t,(t,r)=>{t?this._handleSessionResponse(t.message):r.result?this._handleSessionResponse(e,r.result):r.error&&r.error.message?this._handleSessionResponse(r.error.message):this._handleSessionResponse(e)})}_subscribeToCallResponse(t){return new Promise((e,r)=>{this._subscribeToResponse(t,(t,n)=>{t?r(t):n.result?e(n.result):n.error&&n.error.message?r(new Error(n.error.message)):r(new Error("JSON RPC response format is invalid"))})})}_subscribeToInternalEvents(){this.on("display_uri",()=>{this._qrcodeModal&&this._qrcodeModal.open(this.uri,()=>{this._eventManager.trigger({event:"modal_closed",params:[]})},this._qrcodeModalOptions)}),this.on("connect",()=>{this._qrcodeModal&&this._qrcodeModal.close()}),this.on("call_request_sent",(t,e)=>{const{request:r}=e.params[0];if(Object(n.r)()&&this._signingMethods.includes(r.method)){const t=Object(n.j)(n.v);t&&(window.location.href=t.href)}}),this.on("wc_sessionRequest",(t,e)=>{t&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:t.toString()}]}),this.handshakeId=e.id,this.peerId=e.params[0].peerId,this.peerMeta=e.params[0].peerMeta;const r=Object.assign(Object.assign({},e),{method:"session_request"});this._eventManager.trigger(r)}),this.on("wc_sessionUpdate",(t,e)=>{t&&this._handleSessionResponse(t.message),this._handleSessionResponse("Session disconnected",e.params[0])})}_initTransport(){this._transport.on("message",t=>this._handleIncomingMessages(t)),this._transport.on("open",()=>this._eventManager.trigger({event:"transport_open",params:[]})),this._transport.on("close",()=>this._eventManager.trigger({event:"transport_close",params:[]})),this._transport.on("error",()=>this._eventManager.trigger({event:"transport_error",params:["Websocket connection failed"]})),this._transport.open()}_formatUri(){return`${this.protocol}:${this.handshakeTopic}@${this.version}?bridge=${encodeURIComponent(this.bridge)}&key=${this.key}`}_parseUri(t){const e=Object(n.y)(t);if(e.protocol===this.protocol){if(!e.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");const t=e.handshakeTopic;if(!e.bridge)throw Error("Invalid or missing bridge url parameter value");const r=decodeURIComponent(e.bridge);if(!e.key)throw Error("Invalid or missing key parameter value");return{handshakeTopic:t,bridge:r,key:e.key}}throw new Error("URI format is invalid")}async _generateKey(){if(this._cryptoLib){return await this._cryptoLib.generateKey()}return null}async _encrypt(t){const e=this._key;if(this._cryptoLib&&e){return await this._cryptoLib.encrypt(t,e)}return null}async _decrypt(t){const e=this._key;if(this._cryptoLib&&e){return await this._cryptoLib.decrypt(t,e)}return null}_getStorageSession(){let t=null;return this._sessionStorage&&(t=this._sessionStorage.getSession()),t}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(t){if(!t.url||"string"!=typeof t.url)throw Error("Invalid or missing pushServerOpts.url parameter value");if(!t.type||"string"!=typeof t.type)throw Error("Invalid or missing pushServerOpts.type parameter value");if(!t.token||"string"!=typeof t.token)throw Error("Invalid or missing pushServerOpts.token parameter value");const e={bridge:this.bridge,topic:this.clientId,type:t.type,token:t.token,peerName:"",language:t.language||""};this.on("connect",async(r,n)=>{if(r)throw r;if(t.peerMeta){const t=n.params[0].peerMeta.name;e.peerName=t}try{const r=await fetch(t.url+"/new",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)});if(!(await r.json()).success)throw Error("Failed to register in Push Server")}catch(r){throw Error("Failed to register in Push Server")}})}}}])}));
},{}],29:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.safeJsonParse = safeJsonParse;
exports.safeJsonStringify = safeJsonStringify;
function safeJsonParse(value) {
if (typeof value !== "string") {
throw new Error(`Cannot safe json parse value of type ${typeof value}`);
}
try {
return JSON.parse(value);
} catch (_a) {
return value;
}
}
function safeJsonStringify(value) {
return typeof value === "string" ? value : JSON.stringify(value);
}
},{}],30:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLocalStorage = exports.getLocalStorageOrThrow = exports.getCrypto = exports.getCryptoOrThrow = exports.getLocation = exports.getLocationOrThrow = exports.getNavigator = exports.getNavigatorOrThrow = exports.getDocument = exports.getDocumentOrThrow = exports.getFromWindowOrThrow = exports.getFromWindow = void 0;
function getFromWindow(name) {
let res = undefined;
if (typeof window !== "undefined" && typeof window[name] !== "undefined") {
res = window[name];
}
return res;
}
exports.getFromWindow = getFromWindow;
function getFromWindowOrThrow(name) {
const res = getFromWindow(name);
if (!res) {
throw new Error(`${name} is not defined in Window`);
}
return res;
}
exports.getFromWindowOrThrow = getFromWindowOrThrow;
function getDocumentOrThrow() {
return getFromWindowOrThrow("document");
}
exports.getDocumentOrThrow = getDocumentOrThrow;
function getDocument() {
return getFromWindow("document");
}
exports.getDocument = getDocument;
function getNavigatorOrThrow() {
return getFromWindowOrThrow("navigator");
}
exports.getNavigatorOrThrow = getNavigatorOrThrow;
function getNavigator() {
return getFromWindow("navigator");
}
exports.getNavigator = getNavigator;
function getLocationOrThrow() {
return getFromWindowOrThrow("location");
}
exports.getLocationOrThrow = getLocationOrThrow;
function getLocation() {
return getFromWindow("location");
}
exports.getLocation = getLocation;
function getCryptoOrThrow() {
return getFromWindowOrThrow("crypto");
}
exports.getCryptoOrThrow = getCryptoOrThrow;
function getCrypto() {
return getFromWindow("crypto");
}
exports.getCrypto = getCrypto;
function getLocalStorageOrThrow() {
return getFromWindowOrThrow("localStorage");
}
exports.getLocalStorageOrThrow = getLocalStorageOrThrow;
function getLocalStorage() {
return getFromWindow("localStorage");
}
exports.getLocalStorage = getLocalStorage;
},{}],31:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWindowMetadata = void 0;
const window_getters_1 = require("@walletconnect/window-getters");
function getWindowMetadata() {
let doc;
let loc;
try {
doc = window_getters_1.getDocumentOrThrow();
loc = window_getters_1.getLocationOrThrow();
}
catch (e) {
return null;
}
function getIcons() {
const links = doc.getElementsByTagName("link");
const icons = [];
for (let i = 0; i < links.length; i++) {
const link = links[i];
const rel = link.getAttribute("rel");
if (rel) {
if (rel.toLowerCase().indexOf("icon") > -1) {
const href = link.getAttribute("href");
if (href) {
if (href.toLowerCase().indexOf("https:") === -1 &&
href.toLowerCase().indexOf("http:") === -1 &&
href.indexOf("//") !== 0) {
let absoluteHref = loc.protocol + "//" + loc.host;
if (href.indexOf("/") === 0) {
absoluteHref += href;
}
else {
const path = loc.pathname.split("/");
path.pop();
const finalPath = path.join("/");
absoluteHref += finalPath + "/" + href;
}
icons.push(absoluteHref);
}
else if (href.indexOf("//") === 0) {
const absoluteUrl = loc.protocol + href;
icons.push(absoluteUrl);
}
else {
icons.push(href);
}
}
}
}
}
return icons;
}
function getWindowMetadataOfAny(...args) {
const metaTags = doc.getElementsByTagName("meta");
for (let i = 0; i < metaTags.length; i++) {
const tag = metaTags[i];
const attributes = ["itemprop", "property", "name"]
.map((target) => tag.getAttribute(target))
.filter((attr) => {
if (attr) {
return args.includes(attr);
}
return false;
});
if (attributes.length && attributes) {
const content = tag.getAttribute("content");
if (content) {
return content;
}
}
}
return "";
}
function getName() {
let name = getWindowMetadataOfAny("name", "og:site_name", "og:title", "twitter:title");
if (!name) {
name = doc.title;
}
return name;
}
function getDescription() {
const description = getWindowMetadataOfAny("description", "og:description", "twitter:description", "keywords");
return description;
}
const name = getName();
const description = getDescription();
const url = loc.origin;
const icons = getIcons();
const meta = {
description,
url,
icons,
name,
};
return meta;
}
exports.getWindowMetadata = getWindowMetadata;
},{"@walletconnect/window-getters":30}],32:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const buffer_1 = require("buffer");
const algosdk_min_1 = require("algosdk");
const index_min_1 = require("@walletconnect/client/dist/umd/index.min");
const algorand_walletconnect_qrcode_modal_1 = require("algorand-walletconnect-qrcode-modal");
const utils_1 = require("@json-rpc-tools/utils");
class Algonaut {
constructor(config) {
this.account = undefined;
this.address = undefined;
this.sKey = undefined;
this.mnemonic = undefined;
this.config = undefined;
this.sdk = undefined;
this.uiLoading = false;
this.walletConnect = {
connected: false,
connector: undefined,
accounts: [],
address: '',
assets: [],
chain: undefined
};
this.config = config;
this.algodClient = new algosdk_min_1.default.Algodv2(config.API_TOKEN, config.BASE_SERVER, config.PORT);
this.indexerClient = new algosdk_min_1.default.Indexer(config.API_TOKEN, config.BASE_SERVER, config.PORT);
this.sdk = algosdk_min_1.default;
}
getConfig() {
return this.config;
}
async checkStatus() {
const status = await this.algodClient.status().do();
console.log('Algorand network status: %o', status);
return status;
}
/** if you already have an account, set it here
* @param account an algosdk account already created
*
*/
setAccount(account) {
this.account = account;
this.address = account.addr;
this.mnemonic = algosdk_min_1.default.secretKeyToMnemonic(account.sk);
}
setWalletConnectAccount(address) {
this.account = {
addr: address,
sk: new Uint8Array([])
};
}
createWallet() {
this.account = algosdk_min_1.default.generateAccount();
if (this.account) {
this.address = this.account.addr;
this.mnemonic = algosdk_min_1.default.secretKeyToMnemonic(this.account.sk);
return {
address: this.account.addr,
mnemonic: this.mnemonic || ''
};
}
else {
throw new Error('There was no account: could not create algonaut wallet!');
}
}
recoverAccount(mnemonic) {
var _a;
try {
this.account = algosdk_min_1.default.mnemonicToSecretKey(mnemonic);
if (algosdk_min_1.default.isValidAddress((_a = this.account) === null || _a === void 0 ? void 0 : _a.addr)) {
return this.account;
}
}
catch (error) {
console.log(error);
return false;
}
}
/**
* General purpose method to await transaction confirmation
* @param txId a string id of the transacion you want to watch
* @param limitDelta how many rounds to wait, defaults to
*/
async waitForConfirmation(txId, limitDelta) {
let lastround = (await this.algodClient.status().do())['last-round'];
const limit = lastround + (limitDelta ? limitDelta : 50);
const returnValue = {
status: 'fail',
message: ''
};
while (lastround < limit) {
let pendingInfo = '';
try {
pendingInfo = await this.algodClient
.pendingTransactionInformation(txId)
.do();
console.log('waiting for confirmation');
}
catch (er) {
console.error(er.response.text);
}
if (pendingInfo['confirmed-round'] !== null &&
pendingInfo['confirmed-round'] > 0) {
console.log('Transaction confirmed in round ' + pendingInfo['confirmed-round']);
returnValue.status = 'success';
returnValue.message = 'Transaction confirmed in round ' + pendingInfo['confirmed-round'];
break;
}
lastround++;
}
return returnValue;
}
/**
* Creates a LogicSig from a base64 program string. Note that this method does not COMPILE
* the program, just builds an LSig from an already compiled base64 result!
* @param base64ProgramString
* @returns an algosdk LogicSigAccount
*/
generateLogicSig(base64ProgramString) {
const program = new Uint8Array(buffer_1.Buffer.from(base64ProgramString, 'base64'));
return new algosdk_min_1.default.LogicSigAccount(program);
}
/**
* Opt-in the current account for the a token or NFT ASA.
* @returns Promise resolving to confirmed transaction or error
*/
async optInApp(appIndex, appArgs, optionalFields) {
if (this.account && appIndex) {
console.log('opt in to app ' + appIndex);
const sender = this.account.addr;
const params = await this.algodClient.getTransactionParams().do();
const optInTransaction = algosdk_min_1.default.makeApplicationOptInTxnFromObject({
from: sender,
appIndex: appIndex,
suggestedParams: params,
appArgs: appArgs ? this.encodeArguments(appArgs) : undefined,
accounts: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.accounts) ? optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.accounts : undefined,
foreignApps: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.applications) ? optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.applications : undefined,
foreignAssets: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.assets) ? optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.assets : undefined
});
const txId = optInTransaction.txID().toString();
// Sign the transaction
const signedTxn = optInTransaction.signTxn(this.account.sk);
try {
await this.algodClient.sendRawTransaction(signedTxn).do();
// Wait for confirmation
const txStatus = await this.waitForConfirmation(txId);
return txStatus;
}
catch (er) {
console.log('error in opt in');
console.log(er.response.text);
return {
status: 'fail',
message: er.response.text,
error: er
};
}
}
else {
return {
status: 'fail',
message: 'no algo account found...'
};
}
}
/**
* Opt-in the current account for the a token or NFT ASA.
* @returns Promise resolving to confirmed transaction or error
*/
async optInASA(assetIndex) {
if (this.account) {
// define sender
const sender = this.account.addr;
// get node suggested parameters
const params = await this.algodClient.getTransactionParams().do();
// comment out the next two lines to use suggested fee
//params.fee = 1000;
//params.flatFee = true;
// create unsigned transaction
const txn = algosdk_min_1.default.makeAssetTransferTxnWithSuggestedParams(sender, sender, undefined, undefined, 0, undefined, assetIndex, params);
const txId = txn.txID().toString();
// Sign the transaction
const signedTxn = algosdk_min_1.default.signTransaction(txn, this.account.sk);
console.log('Signed transaction with txID: %s', txId);
// Submit the transaction
try {
await this.algodClient.sendRawTransaction(signedTxn.blob).do();
// Wait for confirmation
const txStatus = await this.waitForConfirmation(txId);
// display results
return txStatus;
}
catch (er) {
console.log('error in opt in');
console.log(er.response.text);
console.log(er);
return {
status: 'fail',
message: er.response.text,
error: er
};
}
}
else {
return {
status: 'fail',
message: 'no algo account found...'
};
}
}
/**
* Sync function that returns a correctly-encoded argument array for
* an algo transaction
* @param args must be an any[] array, as it will often need to be
* a mix of strings and numbers. Valid types are: string, number, and bigint
* @returns a Uint8Array of encoded arguments
*/
encodeArguments(args) {
const encodedArgs = [];
// loop through args and encode them based on type
args.forEach((arg) => {
if (typeof arg == 'number') {
encodedArgs.push(algosdk_min_1.default.encodeUint64(arg));
}
else if (typeof arg == 'bigint') {
encodedArgs.push(algosdk_min_1.default.encodeUint64(arg));
}
else if (typeof arg == 'string') {
encodedArgs.push(new Uint8Array(buffer_1.Buffer.from(arg)));
}
});
return encodedArgs;
}
/**
* Create ASA
*
*
* TBD: move optional params
* into a params object, add freeze, clawback, etc
*/
async createAsset(assetName, symbol, metaBlock, decimals, amount, assetURL, defaultFrozen, assetMetadataHash) {
if (!metaBlock) {
metaBlock = 'wot? wot wot?';
}
if (!defaultFrozen)
defaultFrozen = false;
if (!assetURL)
assetURL = undefined;
const metaBlockLength = metaBlock.length;
console.log('meta block is ' + metaBlockLength);
if (metaBlockLength > 511) {
console.warn('drat! this meta block is too long!');
return 'error';
}
const enc = new TextEncoder();
if (this.account) {
console.log('ok, starting ASA deploy');
// arbitrary data: 512 bytes, ~512 characters
const note = enc.encode(metaBlock);
const addr = this.account.addr;
const totalIssuance = amount;
const manager = this.account.addr;
const reserve = this.account.addr;
const freeze = this.account.addr;
const clawback = this.account.addr;
const params = await this.algodClient.getTransactionParams().do();
// signing and sending "txn" allows "addr" to create an asset
const txn = algosdk_min_1.default.makeAssetCreateTxnWithSuggestedParams(addr, note, totalIssuance, decimals, defaultFrozen, manager, reserve, freeze, clawback, symbol, assetName, assetURL, assetMetadataHash, params);
try {
const rawSignedTxn = txn.signTxn(this.account.sk);
const tx = await this.algodClient.sendRawTransaction(rawSignedTxn).do();
console.log('Transaction : ' + tx.txId);
let assetID = null;
console.log('waiting for confirmation...');
// wait for transaction to be confirmed
const txStatus = await this.waitForConfirmation(tx.txId);
// TBD: make sure this TX goes through!
// Get the new asset's information from the creator account
const ptx = await this.algodClient
.pendingTransactionInformation(tx.txId)
.do();
assetID = ptx['asset-index'];
console.log(name + ' asset created!');
console.log(assetID);
return assetID;
}
catch (er) {
console.log('transaction error');
console.log(er);
return 'error!';
}
}
else {
console.log('it looks like there there is no account.');
return 'no account';
}
}
async deleteApplication(appIndex) {
if (this.account && appIndex) {
try {
const sender = this.account.addr;
const params = await this.algodClient.getTransactionParams().do();
console.log('delete: ' + appIndex);
const txn = algosdk_min_1.default.makeApplicationDeleteTxn(sender, params, appIndex);
const txId = txn.txID().toString();
const signedTxn = txn.signTxn(this.account.sk);
await this.algodClient.sendRawTransaction(signedTxn).do();
await this.waitForConfirmation(txId);
// display results
const transactionResponse = await this.algodClient
.pendingTransactionInformation(txId)
.do();
const appId = transactionResponse['txn']['txn'].apid;
console.log('Deleted app-id: ', appId);
return {
status: 'success',
message: 'deleted app index ' + appId
};
}
catch (e) {
console.log(e);
throw new Error(e.response.text);
}
}
else {
return {
status: 'fail',
message: 'no account / algo'
};
}
}
async deleteASA(assetId) {
if (this.account && assetId) {
const sender = this.account.addr;
const enc = new TextEncoder();
// get node suggested parameters
const params = await this.algodClient.getTransactionParams().do();
const txn = algosdk_min_1.default.makeAssetDestroyTxnWithSuggestedParams(sender, enc.encode('doh!'), assetId, params);
const signedTxn = txn.signTxn(this.account.sk);
const tx = await this.algodClient.sendRawTransaction(signedTxn).do();
const conf = await this.waitForConfirmation(tx.txId);
console.log(conf);
return {
status: 'success',
message: 'asset ' + assetId + ' deleted'
};
}
else {
return {
status: 'fail',
message: 'there has no current account.'
};
}
}
/**
* Sends ASA to an address
* @param receiverAddress the address to send to
* @param assetIndex the index of the asset to send
* @param amount how much to send (based on the ASAs decimal setting)
* so to send 1 token with a decimal setting of 3, this value should be 1000
*
* @returns Promise resolving to confirmed transaction or error
*
*
* IMPORTANT: Before you can call this, the target account has to "opt-in"
* to the ASA index. You can't just send ASAs to people blind!
*
*/
async sendASA(receiverAddress, assetIndex, amount) {
if (this.account) {
try {
// Create transaction B to A
const transaction1 = algosdk_min_1.default.makeAssetTransferTxnWithSuggestedParamsFromObject({
from: this.account.addr,
to: receiverAddress,
amount: amount,
assetIndex: assetIndex,
suggestedParams: await this.algodClient.getTransactionParams().do()
});
const signedTx1 = algosdk_min_1.default.signTransaction(transaction1, this.account.sk);
const tx = await this.algodClient.sendRawTransaction(signedTx1.blob).do();
const txStatus = await this.waitForConfirmation(tx.txId);
return txStatus;
}
catch (e) {
return {
status: 'fail',
message: e.response.text,
error: e
};
}
}
else {
return {
status: 'fail',
message: 'there was no algo account...'
};
}
}
/**
* Call a "method" on a stateful contract. In TEAL, you're really giving
* an argument which branches to a specific place and reads the other args
* @param contractIndex
* @param args an array of arguments for the call
* @param optionalTransactionFields an AlgonautTransactionFields object with
* any additional fields you want to pass to this transaction
*/
async callApp(appIndex, args, optionalFields) {
if (this.account && appIndex && args.length) {
try {
const processedArgs = this.encodeArguments(args);
const params = await this.algodClient.getTransactionParams().do();
const callAppTransaction = algosdk_min_1.default.makeApplicationNoOpTxnFromObject({
from: this.account.addr,
suggestedParams: params,
appIndex: appIndex,
appArgs: processedArgs,
accounts: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.accounts) || undefined,
foreignApps: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.applications) || undefined,
foreignAssets: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.assets) || undefined
});
const txId = callAppTransaction.txID().toString();
// Sign the transaction
const signedTx = callAppTransaction.signTxn(this.account.sk);
// Submit the transaction
await this.algodClient.sendRawTransaction(signedTx).do();
// Wait for confirmation
const txStatus = await this.waitForConfirmation(txId);
// display results?
//await this.algodClient.pendingTransactionInformation(txId).do();
return txStatus;
}
catch (er) {
return {
status: 'fail',
message: er.response.text,
error: er
};
}
}
else {
return {
status: 'fail',
message: 'contract calls need a contract index and at least one argument'
};
}
}
/**
* Get an application's escrow account
* @param appId
* @returns escrow account address as string
*/
getAppEscrowAccount(appId) {
return algosdk_min_1.default.getApplicationAddress(appId);
}
/**
* Get info about an application
* @param appId
* @returns
*/
async getAppInfo(appId) {
const info = await this.algodClient.getApplicationByID(appId).do();
// decode state
const state = {
hasState: true,
globals: [],
locals: [],
creatorAddress: info.params.creator,
index: appId
};
for (let n = 0; n < info['params']['global-state'].length; n++) {
const stateItem = info['params']['global-state'][n];
const key = buffer_1.Buffer.from(stateItem.key, 'base64').toString();
const type = stateItem.value.type;
let value = undefined;
let valueAsAddr = '';
if (type == 1) {
value = buffer_1.Buffer.from(stateItem.value.bytes, 'base64').toString();
valueAsAddr = algosdk_min_1.default.encodeAddress(buffer_1.Buffer.from(stateItem.value.bytes, 'base64'));
}
else if (stateItem.value.type == 2) {
value = stateItem.value.uint;
}
state.globals.push({
key: key,
value: value || '',
address: valueAsAddr
});
}
return state;
}
/**
* Get info about an asset
* @param assetIndex
* @returns
*/
async getAssetInfo(assetIndex) {
const info = await this.algodClient.getAssetByID(assetIndex).do();
return info;
}
/**
* Create and deploy a new Smart Contract from TEAL code
*
* @param tealApprovalCode
* @param tealClearCode
* @param args
* @param localInts
* @param localBytes
* @param globalInts
* @param globalBytes
* @param optionalFields
* @returns AlgonautTransactionStatus
*/
async deployFromTeal(tealApprovalCode, tealClearCode, args, localInts = 8, localBytes = 8, globalInts = 8, globalBytes = 8, optionalFields) {
if (optionalFields && optionalFields.note && optionalFields.note.length > 1023) {
console.warn('drat! your note is too long!');
return {
status: 'fail',
message: 'your note is too long!'
};
}
else if (this.account) {
try {
const sender = this.account.addr;
const onComplete = algosdk_min_1.default.OnApplicationComplete.NoOpOC;
const params = await this.algodClient.getTransactionParams().do();
let approvalProgram = new Uint8Array();
let clearProgram = new Uint8Array();
approvalProgram = await this.compileProgram(tealApprovalCode);
clearProgram = await this.compileProgram(tealClearCode);
// create unsigned transaction
if (approvalProgram && clearProgram) {
const txn = algosdk_min_1.default.makeApplicationCreateTxn(sender, params, onComplete, approvalProgram, clearProgram, localInts, localBytes, globalInts, globalBytes, this.encodeArguments(args), (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.accounts) ? optionalFields.accounts : undefined, (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.applications) ? optionalFields.applications : undefined, (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.assets) ? optionalFields.assets : undefined, (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.note) ? new Uint8Array(buffer_1.Buffer.from(optionalFields.note, 'utf8')) : undefined);
const txId = txn.txID().toString();
// Sign the transaction
const signedTxn = txn.signTxn(this.account.sk);
console.log('Signed transaction with txID: %s', txId);
// Submit the transaction
await this.algodClient.sendRawTransaction(signedTxn).do();
// Wait for confirmation
const result = await this.waitForConfirmation(txId);
const transactionResponse = await this.algodClient
.pendingTransactionInformation(txId)
.do();
result.message = 'Created App ID: ' + transactionResponse['application-index'];
result.index = transactionResponse['application-index'];
result.meta = transactionResponse;
return result;
}
else {
return {
status: 'fail',
message: 'could not compile TEAL code'
};
}
}
catch (er) {
return {
status: 'fail',
message: er.message,
error: er
};
}
}
else {
return {
status: 'fail',
message: 'there was no account in context'
};
}
}
/**
* deploys a contract from an lsig account
* keep in mind that the local and global byte and int values have caps,
* 16 for local and 32 for global and that the cost of deploying the
* app goes up based on how many of these slots you want to allocate
*
* @param lsig
* @param tealApprovalCode
* @param tealClearCode
* @param noteText
* @param createArgs
* @param accounts
* @param localInts up to 16
* @param localBytes up to 16
* @param globalInts up to 32
* @param globalBytes up to 32
* @returns
*/
async deployTealWithLSig(lsig, tealApprovalCode, tealClearCode, noteText, createArgs, accounts, localInts, localBytes, globalInts, globalBytes) {
if (noteText.length > 511) {
return {
status: 'fail',
message: 'your note is too dang long!'
};
}
if (this.account) {
let encodedArgs = [];
if (createArgs && createArgs.length) {
encodedArgs = this.encodeArguments(createArgs);
}
const sender = lsig.address();
const onComplete = algosdk_min_1.default.OnApplicationComplete.NoOpOC;
const params = await this.algodClient.getTransactionParams().do();
let approvalProgram = new Uint8Array();
let clearProgram = new Uint8Array();
try {
approvalProgram = await this.compileProgram(tealApprovalCode);
clearProgram = await this.compileProgram(tealClearCode);
// create unsigned transaction
if (approvalProgram && clearProgram) {
const txn = algosdk_min_1.default.makeApplicationCreateTxn(sender, params, onComplete, approvalProgram, clearProgram, localInts, localBytes, globalInts, globalBytes, encodedArgs, accounts);
const txId = txn.txID().toString();
const signedTxn = algosdk_min_1.default.signLogicSigTransactionObject(txn, lsig);
await this.algodClient.sendRawTransaction(signedTxn.blob).do();
const txStatus = await this.waitForConfirmation(txId);
// TBD check txStatus
// display results
const transactionResponse = await this.algodClient
.pendingTransactionInformation(txId)
.do();
const appId = transactionResponse['application-index'];
return {
status: 'success',
message: 'created new app with id: ' + appId
};
}
}
catch (er) {
return {
status: 'fail',
message: er.response.text,
error: er
};
}
}
return {
status: 'fail',
message: 'no account'
};
}
async compileProgram(programSource) {
const encoder = new TextEncoder();
const programBytes = encoder.encode(programSource);
const compileResponse = await this.algodClient.compile(programBytes).do();
const compiledBytes = new Uint8Array(buffer_1.Buffer.from(compileResponse.result, 'base64'));
return compiledBytes;
}
async sendAlgo(toAddress, amount, note) {
// construct a transaction note
const encodedNote = note ? new Uint8Array(buffer_1.Buffer.from(note, 'utf8')) : new Uint8Array();
const suggestedParams = await this.algodClient.getTransactionParams().do();
if (this.account) {
try {
const txn = algosdk_min_1.default.makePaymentTxnWithSuggestedParamsFromObject({
from: this.account.addr,
to: toAddress,
amount: amount,
note: encodedNote,
suggestedParams
});
const signedTxn = txn.signTxn(this.account.sk);
const tx = await this.algodClient.sendRawTransaction(signedTxn).do();
// Wait for transaction to be confirmed
const txStatus = await this.waitForConfirmation(tx.txId);
return txStatus;
}
catch (e) {
return {
status: 'fail',
message: e.response.text,
error: e
};
}
}
else {
return {
status: 'fail',
message: 'there was no account'
};
}
}
/* BELOW HERE ARE ALL THE ALGO SIGNER APIS IF WE GO THAT ROUTE */
/**
* Function to determine if the AlgoSigner extension is installed.
* @returns Boolean
*/
isAlgoSignerInstalled() {
return typeof window.AlgoSigner !== 'undefined';
}
/**
* Connects to AlgoSigner extension
*/
async connectToAlgoSigner() {
return await window.AlgoSigner.connect();
}
/**
* Async function that returns list of accounts in the wallet.
* @param ledger must be 'TestNet' or 'MainNet'.
* @returns Array of Objects with address fields: [{ address: <String> }, ...]
*/
async getAccounts(ledger) {
await this.connectToAlgoSigner();
const accounts = await window.AlgoSigner.accounts({ ledger });
return accounts;
}
/**
* Fetch full account info for an account
* @param address the accress to read info for
* @returns Promise of type AccountInfo
*/
async getAccountInfo(address) {
console.log('checking algo balance');
const accountInfo = await this.algodClient.accountInformation(address).do();
return accountInfo;
}
/**
* Checks Algo balance of account
* @param address Wallet of balance to check
* @returns Promise resolving to Algo balance
*/
async getAlgoBalance(address) {
console.log('checking algo balance');
const accountInfo = await this.algodClient.accountInformation(address).do();
return accountInfo.amount;
}
/**
* Checks token balance of account
* @param address Wallet of balance to check
* @param assetIndex the ASA index
* @returns Promise resolving to token balance
*/
async getTokenBalance(address, assetIndex) {
const accountInfo = await this.algodClient.accountInformation(address).do();
console.log(accountInfo);
let stkBalance = 0;
console.log(accountInfo.assets);
accountInfo.assets.forEach((asset) => {
if (asset['asset-id'] == assetIndex) {
stkBalance = asset.amount;
}
});
return stkBalance;
}
/**
* Checks if account has at least one token (before playback)
* Keeping this here in case this is a faster/less expensive operation than checking actual balance
* @param address Address to check
* @param assetIndex the index of the ASA
*/
async accountHasTokens(address, assetIndex) {
return 'this is not done yet';
}
/**
*
* @param applicationIndex the applications index
*/
async getAppGlobalState(applicationIndex, creatorAddress) {
//! if you are reading an ADDRESS, you must do this:
// const addy = algosdk.encodeAddress(Buffer.from(stateItem.value.bytes, 'base64'));
const state = {
hasState: false,
globals: [],
locals: [],
creatorAddress: '',
index: applicationIndex
};
// read state
// can we detect addresses values and auto-convert them?
// maybe a 32-byte field gets an address field added?
const accountInfoResponse = await this.algodClient
.accountInformation(creatorAddress)
.do();
console.log(accountInfoResponse);
for (let i = 0; i < accountInfoResponse['created-apps'].length; i++) {
if (accountInfoResponse['created-apps'][i].id == applicationIndex) {
console.log('Found Application');
state.hasState = true;
for (let n = 0; n < accountInfoResponse['created-apps'][i]['params']['global-state'].length; n++) {
const stateItem = accountInfoResponse['created-apps'][i]['params']['global-state'][n];
const key = buffer_1.Buffer.from(stateItem.key, 'base64').toString();
const type = stateItem.value.type;
let value = undefined;
let valueAsAddr = '';
if (type == 1) {
value = buffer_1.Buffer.from(stateItem.value.bytes, 'base64').toString();
valueAsAddr = algosdk_min_1.default.encodeAddress(buffer_1.Buffer.from(stateItem.value.bytes, 'base64'));
}
else if (stateItem.value.type == 2) {
value = stateItem.value.uint;
}
state.globals.push({
key: key,
value: value || '',
address: valueAsAddr
});
}
}
}
return state;
}
/**
*
* @param applicationIndex the applications index
*/
async getAppLocalState(applicationIndex) {
var _a;
if (this.account) {
const state = {
hasState: false,
globals: [],
locals: [],
creatorAddress: '',
index: applicationIndex
};
// read state
// can we detect addresses values and auto-convert them?
// maybe a 32-byte field gets an address field added?
const accountInfoResponse = await this.algodClient
.accountInformation((_a = this.account) === null || _a === void 0 ? void 0 : _a.addr)
.do();
//console.log(accountInfoResponse);
for (let i = 0; i < accountInfoResponse['apps-local-state'].length; i++) {
if (accountInfoResponse['apps-local-state'][i].id == applicationIndex) {
console.log('Found Application');
state.hasState = true;
for (let n = 0; n < accountInfoResponse['apps-local-state'][i]['key-value'].length; n++) {
const stateItem = accountInfoResponse['apps-local-state'][i]['key-value'][n];
const key = buffer_1.Buffer.from(stateItem.key, 'base64').toString();
const type = stateItem.value.type;
let value = undefined;
let valueAsAddr = '';
if (type == 1) {
value = buffer_1.Buffer.from(stateItem.value.bytes, 'base64').toString();
valueAsAddr = algosdk_min_1.default.encodeAddress(buffer_1.Buffer.from(stateItem.value.bytes, 'base64'));
}
else if (stateItem.value.type == 2) {
value = stateItem.value.uint;
}
state.locals.push({
key: key,
value: value || '',
address: valueAsAddr
});
}
}
}
return state;
}
else {
throw new Error('there is no account');
}
}
async atomicOptInApp(appIndex, appArgs, optionalFields) {
if (this.account && appIndex) {
const sender = this.account.addr;
const params = await this.algodClient.getTransactionParams().do();
const optInTransaction = algosdk_min_1.default.makeApplicationOptInTxnFromObject({
from: sender,
appIndex: appIndex,
suggestedParams: params,
appArgs: appArgs ? this.encodeArguments(appArgs) : undefined,
accounts: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.accounts) ? optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.accounts : undefined,
foreignApps: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.applications) ? optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.applications : undefined,
foreignAssets: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.assets) ? optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.assets : undefined
});
return {
transaction: optInTransaction,
transactionSigner: this.account,
isLogigSig: false
};
}
else {
throw new Error('algonautjs has no account loaded!');
}
}
async atomicOptInASA(assetIndex) {
if (this.account && assetIndex) {
const params = await this.algodClient.getTransactionParams().do();
const optInTransaction = algosdk_min_1.default.makeAssetTransferTxnWithSuggestedParamsFromObject({
from: this.account.addr,
to: this.account.addr,
suggestedParams: params,
assetIndex: assetIndex,
amount: 0
});
return {
transaction: optInTransaction,
transactionSigner: this.account,
isLogigSig: false
};
}
else {
throw new Error('there was no account!');
}
}
async atomicCallApp(appIndex, args, optionalFields) {
if (this.account && appIndex && args.length) {
const processedArgs = this.encodeArguments(args);
const params = await this.algodClient.getTransactionParams().do();
const callAppTransaction = algosdk_min_1.default.makeApplicationNoOpTxnFromObject({
from: this.account.addr,
suggestedParams: params,
appIndex: appIndex,
appArgs: processedArgs,
accounts: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.accounts) || undefined,
foreignApps: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.applications) || undefined,
foreignAssets: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.assets) || undefined
});
return {
transaction: callAppTransaction,
transactionSigner: this.account,
isLogigSig: false
};
}
else {
throw new Error('there was no account!');
}
}
async atomicCallAppWithLSig(appIndex, args, logicSig, optionalFields) {
if (this.account && appIndex && args.length) {
const processedArgs = this.encodeArguments(args);
const params = await this.algodClient.getTransactionParams().do();
const callAppTransaction = algosdk_min_1.default.makeApplicationNoOpTxnFromObject({
from: logicSig.address(),
suggestedParams: params,
appIndex: appIndex,
appArgs: processedArgs,
accounts: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.accounts) || undefined,
foreignApps: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.applications) || undefined,
foreignAssets: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.assets) || undefined
});
return {
transaction: callAppTransaction,
transactionSigner: logicSig,
isLogigSig: true
};
}
else {
throw new Error('there was no account!');
}
}
async atomicAssetTransfer(toAddress, amount, asset) {
if (this.account) {
const transaction = algosdk_min_1.default.makeAssetTransferTxnWithSuggestedParamsFromObject({
from: this.account.addr,
to: toAddress,
amount: amount,
assetIndex: asset,
suggestedParams: await this.algodClient.getTransactionParams().do()
});
return {
transaction: transaction,
transactionSigner: this.account,
isLogigSig: false
};
}
else {
throw new Error('there is no account!');
}
}
async atomicAssetTransferWithLSig(toAddress, amount, asset, logicSig) {
if (logicSig) {
const transaction = algosdk_min_1.default.makeAssetTransferTxnWithSuggestedParamsFromObject({
from: logicSig.address(),
to: toAddress,
amount: amount,
assetIndex: asset,
suggestedParams: await this.algodClient.getTransactionParams().do()
});
return {
transaction: transaction,
transactionSigner: logicSig,
isLogigSig: true
};
}
else {
throw new Error('there is no logic sig object!');
}
}
async atomicPayment(toAddress, amount, optionalTxParams) {
if (this.account) {
const transaction = algosdk_min_1.default.makePaymentTxnWithSuggestedParamsFromObject({
from: this.account.addr,
to: toAddress,
amount: amount,
suggestedParams: await this.algodClient.getTransactionParams().do()
});
return {
transaction: transaction,
transactionSigner: this.account,
isLogigSig: false
};
}
else {
throw new Error('there is no account!');
}
}
async atomicPaymentWithLSig(toAddress, amount, logicSig, optionalTxParams) {
if (logicSig) {
const transaction = algosdk_min_1.default.makePaymentTxnWithSuggestedParamsFromObject({
from: logicSig.address(),
to: toAddress,
amount: amount,
suggestedParams: await this.algodClient.getTransactionParams().do()
});
return {
transaction: transaction,
transactionSigner: logicSig,
isLogigSig: true
};
}
else {
throw new Error('there is no account!');
}
}
/**
* run atomic takes an array of transactions to run in order, each
* of the atomic transaction methods needs to return an object containing
* the transaction and the signed transaction
* [ atomicSendASA(),
atomicSendAlgo(),
atomicCallApp()]
* @param transactions a Uint8Array of ALREADY SIGNED transactions
*/
async sendAtomicTransaction(transactions) {
try {
const txns = [];
const signed = [];
transactions.forEach((txn) => {
txns.push(txn.transaction);
});
// this is critical, if the group doesn't have an id
// the transactions are processed as one-offs!
const txnGroup = algosdk_min_1.default.assignGroupID(txns);
// sign all transactions in the group:
transactions.forEach((txn, i) => {
let signedTx;
if (txn.isLogigSig) {
signedTx = algosdk_min_1.default.signLogicSigTransaction(txnGroup[i], txn.transactionSigner);
}
else {
signedTx = algosdk_min_1.default.signTransaction(txnGroup[i], txn.transactionSigner.sk);
}
signed.push(signedTx.blob);
});
const tx = await this.algodClient.sendRawTransaction(signed).do();
console.log('Transaction : ' + tx.txId);
// Wait for transaction to be confirmed
const txStatus = await this.waitForConfirmation(tx.txId);
return txStatus;
}
catch (e) {
return {
status: 'fail',
message: e.response.text,
error: e
};
}
}
/**
* Prepare one or more transactions for wallet connect signature
*
* @param transactions one or more atomic transaction objects
* @returns an array of Transactions
*/
async createWalletConnectTransactions(transactions) {
console.log('start wc transaction builder');
const txns = [];
transactions.forEach((txn) => {
txns.push(txn.transaction);
});
console.log('done', txns);
return txns;
}
/**********************************************/
/***** Below are the Algo Signer APIs *********/
/**********************************************/
/**
* Sends a transaction via AlgoSigner.
* @param params Transaction parameters to send
* @returns Promise resolving to confirmed transaction or error
*/
async sendTxWithAlgoSigner(params) {
try {
// connect to algo signer extension
await this.connectToAlgoSigner();
// fetch current parameters from the al(l knowing)god
const txParams = await window.AlgoSigner.algod({
ledger: params.LEDGER,
path: '/v2/transactions/params'
});
// sign the transaction
const signedTx = await window.AlgoSigner.sign({
assetIndex: params.assetIndex || null,
from: params.from,
to: params.to,
amount: +params.amount,
note: params.note || '',
type: params.type,
fee: txParams['min-fee'],
firstRound: txParams['last-round'],
lastRound: txParams['last-round'] + 1000,
genesisID: txParams['genesis-id'],
genesisHash: txParams['genesis-hash'],
flatFee: true
});
// give us the signed transaction
const tx = window.AlgoSigner.send({
ledger: params.LEDGER,
tx: signedTx.blob
});
// wait for confirmation, return result
return this.waitForAlgoSignerConfirmation(tx);
}
catch (error) {
console.log(error);
throw new Error('Error sending transaction: ' + JSON.stringify(error));
}
}
/**
* Waits for confirmation of a transaction
* @param tx Transaction to monitor
* @returns Promise resolving to error or confirmed transaction
*/
async waitForAlgoSignerConfirmation(tx) {
console.log(`Transaction ${tx.txId} waiting for confirmation...`);
let status = await window.AlgoSigner.algod({
ledger: 'TestNet',
path: '/v2/transactions/pending/' + tx.txId
});
// eslint-disable-next-line no-constant-condition
while (true) {
if (status['confirmed-round'] !== null && status['confirmed-round'] > 0) {
//Got the completed Transaction
console.log(`Transaction confirmed in round ${status['confirmed-round']}.`);
break;
}
status = await window.AlgoSigner.algod({
ledger: 'TestNet',
path: '/v2/transactions/pending/' + tx.txId
});
}
return tx;
}
/*
* Wallet Connect API Stuff
*/
async disconnectAlgoWallet() {
var _a;
if (this.walletConnect.connected) {
(_a = this.walletConnect.connector) === null || _a === void 0 ? void 0 : _a.killSession();
}
}
async connectAlgoWallet(clientListener) {
console.log('connecting wallet: ');
// 4067ab2454244fb39835bfeafc285c8d
if (!clientListener)
clientListener = undefined;
const bridge = 'https://bridge.walletconnect.org';
this.walletConnect.connector = new index_min_1.default({
bridge,
apiKey: '4067ab2454244fb39835bfeafc285c8d',
qrcodeModal: algorand_walletconnect_qrcode_modal_1.default
});
console.log('connector created');
console.log(this.walletConnect.connector);
console.log('trying to create session');
// Check if connection is already established
if (!this.walletConnect.connector.connected) {
// create new session
this.walletConnect.connector.createSession();
console.log('session created');
}
this.subscribeToEvents(clientListener);
}
subscribeToEvents(clientListener) {
if (!this.walletConnect.connector) {
return;
}
this.walletConnect.connector.on('session_update', async (error, payload) => {
console.log('connector.on("session_update")');
if (error) {
throw error;
}
const { accounts } = payload.params[0];
if (clientListener)
clientListener.onSessionUpdate(payload);
this.onSessionUpdate(accounts);
});
this.walletConnect.connector.on('connect', (error, payload) => {
console.log('connector.on("connect")');
if (error) {
throw error;
}
if (clientListener)
clientListener.onConnect(payload);
this.onConnect(payload);
});
this.walletConnect.connector.on('disconnect', (error, payload) => {
console.log('connector.on("disconnect")');
if (error) {
console.log(payload);
throw error;
}
if (clientListener)
clientListener.onDisconnect(payload);
this.onDisconnect();
});
if (this.walletConnect.connector.connected) {
const { accounts } = this.walletConnect.connector;
const address = accounts[0];
this.walletConnect.connected = true;
this.walletConnect.accounts = accounts;
this.walletConnect.address = address;
this.onSessionUpdate(accounts);
}
}
async killSession() {
if (this.walletConnect.connector) {
this.walletConnect.connector.killSession();
}
this.resetApp();
}
// this should get a ChainType
async chainUpdate(newChain) {
this.walletConnect.chain = newChain;
}
async resetApp() {
console.log('reset app called');
console.log('TBD!');
}
// iinternal even type from example
async onConnect(payload) {
const { accounts } = payload.params[0];
const address = accounts[0];
this.setWalletConnectAccount(address);
this.walletConnect.connected = true;
this.walletConnect.accounts = accounts;
this.walletConnect.address = address;
}
onDisconnect() {
this.walletConnect.connected = false;
this.walletConnect.accounts = [];
this.walletConnect.address = '';
this.account = undefined;
}
async onSessionUpdate(accounts) {
this.walletConnect.address = accounts[0];
this.walletConnect.accounts = accounts;
this.setWalletConnectAccount(accounts[0]);
}
async sendWalletConnectTxns(walletTxns) {
if (this.walletConnect.connected) {
// encode txns
const txnsToSign = walletTxns.map(txn => {
const encodedTxn = buffer_1.Buffer.from(algosdk_min_1.default.encodeUnsignedTransaction(txn)).toString('base64');
return {
txn: encodedTxn,
message: 'txn description',
// Note: if the transaction does not need to be signed (because it's part of an atomic group
// that will be signed by another party), specify an empty singers array like so:
// signers: [],
};
});
const requestParams = [txnsToSign];
const request = (0, utils_1.formatJsonRpcRequest)('algo_signTxn', requestParams);
const result = await this.walletConnect.connector.sendCustomRequest(request);
const signedPartialTxns = result.map((r, i) => {
// run whatever error checks here
if (r == null) {
throw new Error(`Transaction at index ${i}: was not signed when it should have been`);
}
const rawSignedTxn = buffer_1.Buffer.from(r, 'base64');
return new Uint8Array(rawSignedTxn);
});
console.log('signed partial txns are');
console.log(signedPartialTxns);
if (signedPartialTxns) {
const tx = await this.algodClient.sendRawTransaction(signedPartialTxns).do();
console.log('Transaction : ' + tx.txId);
// Wait for transaction to be confirmed
const txStatus = await this.waitForConfirmation(tx.txId);
return txStatus;
}
else {
return {
status: 'fail',
message: 'there were no signed transactions returned'
};
}
}
else {
return {
status: 'fail',
message: 'There is no wallet connect session!'
};
}
}
}
exports.default = Algonaut;
},{"@json-rpc-tools/utils":15,"@walletconnect/client/dist/umd/index.min":28,"algorand-walletconnect-qrcode-modal":33,"algosdk":34,"buffer":134}],33:[function(require,module,exports){
(function (process){(function (){
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var browserUtils = require('@walletconnect/browser-utils');
var QRCode = _interopDefault(require('qrcode'));
var copy = _interopDefault(require('copy-to-clipboard'));
var React = require('preact/compat');
function open(uri) {
QRCode.toString(uri, {
type: "terminal"
}).then(console.log);
}
var WALLETCONNECT_STYLE_SHEET = ":root {\n --animation-duration: 300ms;\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes fadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.animated {\n animation-duration: var(--animation-duration);\n animation-fill-mode: both;\n}\n\n.fadeIn {\n animation-name: fadeIn;\n}\n\n.fadeOut {\n animation-name: fadeOut;\n}\n\n#walletconnect-wrapper {\n -webkit-user-select: none;\n align-items: center;\n display: flex;\n height: 100%;\n justify-content: center;\n left: 0;\n pointer-events: none;\n position: fixed;\n top: 0;\n user-select: none;\n width: 100%;\n z-index: 99999999999999;\n}\n\n.walletconnect-modal__headerLogo {\n height: 21px;\n}\n\n.walletconnect-modal__header p {\n color: #ffffff;\n font-size: 20px;\n font-weight: 600;\n margin: 0;\n align-items: flex-start;\n display: flex;\n flex: 1;\n margin-left: 5px;\n}\n\n.walletconnect-modal__close__wrapper {\n position: absolute;\n top: 0px;\n right: 0px;\n z-index: 10000;\n background: white;\n border-radius: 26px;\n padding: 6px;\n box-sizing: border-box;\n width: 26px;\n height: 26px;\n cursor: pointer;\n}\n\n.walletconnect-modal__close__icon {\n position: relative;\n top: 7px;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transform: rotate(45deg);\n}\n\n.walletconnect-modal__close__line1 {\n position: absolute;\n width: 100%;\n border: 1px solid rgb(48, 52, 59);\n}\n\n.walletconnect-modal__close__line2 {\n position: absolute;\n width: 100%;\n border: 1px solid rgb(48, 52, 59);\n transform: rotate(90deg);\n}\n\n.walletconnect-qrcode__base {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n background: rgba(37, 41, 46, 0.95);\n height: 100%;\n left: 0;\n pointer-events: auto;\n position: fixed;\n top: 0;\n transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);\n width: 100%;\n will-change: opacity;\n padding: 40px;\n box-sizing: border-box;\n}\n\n.walletconnect-qrcode__text {\n color: rgba(60, 66, 82, 0.6);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: 0;\n line-height: 1.1875em;\n margin: 10px 0 30px 0;\n text-align: center;\n width: 100%;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-qrcode__text {\n font-size: 4vw;\n }\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-qrcode__text {\n font-size: 14px;\n }\n}\n\n.walletconnect-qrcode__image {\n width: calc(100% - 30px);\n box-sizing: border-box;\n cursor: none;\n margin: 0 auto;\n}\n\n.walletconnect-qrcode__notification {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n font-size: 16px;\n padding: 16px 20px;\n border-radius: 16px;\n text-align: center;\n transition: all 0.1s ease-in-out;\n background: white;\n color: black;\n margin-bottom: -60px;\n opacity: 0;\n}\n\n.walletconnect-qrcode__notification.notification__show {\n opacity: 1;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-modal__header {\n height: 130px;\n }\n .walletconnect-modal__base {\n overflow: auto;\n }\n}\n\n@media only screen and (min-device-width: 415px) and (max-width: 768px) {\n #content {\n max-width: 768px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (min-width: 375px) and (max-width: 415px) {\n #content {\n max-width: 414px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (min-width: 320px) and (max-width: 375px) {\n #content {\n max-width: 375px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (max-width: 320px) {\n #content {\n max-width: 320px;\n box-sizing: border-box;\n }\n}\n\n.walletconnect-modal__base {\n -webkit-font-smoothing: antialiased;\n background: #ffffff;\n border-radius: 24px;\n box-shadow: 0 10px 50px 5px rgba(0, 0, 0, 0.4);\n font-family: ui-rounded, \"SF Pro Rounded\", \"SF Pro Text\", medium-content-sans-serif-font,\n -apple-system, BlinkMacSystemFont, ui-sans-serif, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell,\n \"Open Sans\", \"Helvetica Neue\", sans-serif;\n margin-top: 41px;\n padding: 24px 24px 22px;\n pointer-events: auto;\n position: relative;\n text-align: center;\n transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);\n will-change: transform;\n overflow: visible;\n transform: translateY(-50%);\n top: 50%;\n max-width: 500px;\n margin: auto;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-modal__base {\n padding: 24px 12px;\n }\n}\n\n.walletconnect-modal__base .hidden {\n transform: translateY(150%);\n transition: 0.125s cubic-bezier(0.4, 0, 1, 1);\n}\n\n.walletconnect-modal__header {\n align-items: center;\n display: flex;\n height: 26px;\n left: 0;\n justify-content: space-between;\n position: absolute;\n top: -42px;\n width: 100%;\n}\n\n.walletconnect-modal__base .wc-logo {\n align-items: center;\n display: flex;\n height: 26px;\n margin-top: 15px;\n padding-bottom: 15px;\n pointer-events: auto;\n}\n\n.walletconnect-modal__base .wc-logo div {\n background-color: #3399ff;\n height: 21px;\n margin-right: 5px;\n mask-image: url(\"images/wc-logo.svg\") center no-repeat;\n width: 32px;\n}\n\n.walletconnect-modal__base .wc-logo p {\n color: #ffffff;\n font-size: 20px;\n font-weight: 600;\n margin: 0;\n}\n\n.walletconnect-modal__base h2 {\n color: rgba(60, 66, 82, 0.6);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: 0;\n line-height: 1.1875em;\n margin: 0 0 19px 0;\n text-align: center;\n width: 100%;\n}\n\n.walletconnect-modal__base__row {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n align-items: center;\n border-radius: 20px;\n cursor: pointer;\n display: flex;\n height: 56px;\n justify-content: space-between;\n padding: 0 15px;\n position: relative;\n margin: 0px 0px 8px;\n text-align: left;\n transition: 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n will-change: transform;\n text-decoration: none;\n}\n\n.walletconnect-modal__base__row:hover {\n background: rgba(60, 66, 82, 0.06);\n}\n\n.walletconnect-modal__base__row:active {\n background: rgba(60, 66, 82, 0.06);\n transform: scale(0.975);\n transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n}\n\n.walletconnect-modal__base__row__h3 {\n color: #25292e;\n font-size: 20px;\n font-weight: 700;\n margin: 0;\n padding-bottom: 3px;\n}\n\n.walletconnect-modal__base__row__right {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.walletconnect-modal__base__row__right__app-icon {\n border-radius: 8px;\n height: 34px;\n margin: 0 11px 2px 0;\n width: 34px;\n background-size: 100%;\n box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);\n}\n\n.walletconnect-modal__base__row__right__caret {\n height: 18px;\n opacity: 0.3;\n transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n width: 8px;\n will-change: opacity;\n}\n\n.walletconnect-modal__base__row:hover .caret,\n.walletconnect-modal__base__row:active .caret {\n opacity: 0.6;\n}\n\n.walletconnect-modal__mobile__toggle {\n width: 80%;\n display: flex;\n margin: 0 auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n margin-bottom: 18px;\n background: #d4d5d9;\n}\n\n.walletconnect-modal__mobile__toggle_selector {\n width: calc(50% - 8px);\n background: white;\n position: absolute;\n border-radius: 5px;\n height: calc(100% - 8px);\n top: 4px;\n transition: all 0.2s ease-in-out;\n transform: translate3d(4px, 0, 0);\n}\n\n.walletconnect-modal__mobile__toggle.right__selected .walletconnect-modal__mobile__toggle_selector {\n transform: translate3d(calc(100% + 12px), 0, 0);\n}\n\n.walletconnect-modal__mobile__toggle a {\n font-size: 12px;\n width: 50%;\n text-align: center;\n padding: 8px;\n margin: 0;\n font-weight: 600;\n z-index: 1;\n}\n\n.walletconnect-modal__footer {\n display: flex;\n justify-content: center;\n margin-top: 20px;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-modal__footer {\n margin-top: 5vw;\n }\n}\n\n.walletconnect-modal__footer a {\n cursor: pointer;\n color: #898d97;\n font-size: 15px;\n margin: 0 auto;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-modal__footer a {\n font-size: 14px;\n }\n}\n\n.walletconnect-connect__buttons__wrapper {\n max-height: 44vh;\n}\n\n.walletconnect-connect__buttons__wrapper__android {\n margin: 50% 0;\n}\n\n.walletconnect-connect__buttons__wrapper__wrap {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n margin-top: 20px;\n margin-bottom: 10px;\n}\n\n@media only screen and (min-width: 768px) {\n .walletconnect-connect__buttons__wrapper__wrap {\n margin-top: 40px;\n }\n}\n\n.walletconnect-connect__button {\n background-color: rgb(64, 153, 255);\n padding: 12px;\n border-radius: 8px;\n text-decoration: none;\n color: rgb(255, 255, 255);\n font-weight: 500;\n}\n\n.walletconnect-connect__button__icon_anchor {\n cursor: pointer;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin: 8px;\n width: 42px;\n justify-self: center;\n flex-direction: column;\n text-decoration: none !important;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-connect__button__icon_anchor {\n margin: 4px;\n }\n}\n\n.walletconnect-connect__button__icon {\n border-radius: 10px;\n height: 42px;\n margin: 0;\n width: 42px;\n background-size: cover !important;\n box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);\n}\n\n.walletconnect-connect__button__text {\n color: #424952;\n font-size: 2.7vw;\n text-decoration: none !important;\n padding: 0;\n margin-top: 1.8vw;\n font-weight: 600;\n}\n\n@media only screen and (min-width: 768px) {\n .walletconnect-connect__button__text {\n font-size: 16px;\n margin-top: 12px;\n }\n}\n";
var WALLETCONNECT_LOGO_SVG_URL = "data:image/svg+xml,%3C?xml version='1.0' encoding='UTF-8'?%3E %3Csvg width='300px' height='185px' viewBox='0 0 300 185' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E %3C!-- Generator: Sketch 49.3 (51167) - http://www.bohemiancoding.com/sketch --%3E %3Ctitle%3EWalletConnect%3C/title%3E %3Cdesc%3ECreated with Sketch.%3C/desc%3E %3Cdefs%3E%3C/defs%3E %3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E %3Cg id='walletconnect-logo-alt' fill='%233B99FC' fill-rule='nonzero'%3E %3Cpath d='M61.4385429,36.2562612 C110.349767,-11.6319051 189.65053,-11.6319051 238.561752,36.2562612 L244.448297,42.0196786 C246.893858,44.4140867 246.893858,48.2961898 244.448297,50.690599 L224.311602,70.406102 C223.088821,71.6033071 221.106302,71.6033071 219.883521,70.406102 L211.782937,62.4749541 C177.661245,29.0669724 122.339051,29.0669724 88.2173582,62.4749541 L79.542302,70.9685592 C78.3195204,72.1657633 76.337001,72.1657633 75.1142214,70.9685592 L54.9775265,51.2530561 C52.5319653,48.8586469 52.5319653,44.9765439 54.9775265,42.5821357 L61.4385429,36.2562612 Z M280.206339,77.0300061 L298.128036,94.5769031 C300.573585,96.9713 300.573599,100.85338 298.128067,103.247793 L217.317896,182.368927 C214.872352,184.763353 210.907314,184.76338 208.461736,182.368989 C208.461726,182.368979 208.461714,182.368967 208.461704,182.368957 L151.107561,126.214385 C150.496171,125.615783 149.504911,125.615783 148.893521,126.214385 C148.893517,126.214389 148.893514,126.214393 148.89351,126.214396 L91.5405888,182.368927 C89.095052,184.763359 85.1300133,184.763399 82.6844276,182.369014 C82.6844133,182.369 82.684398,182.368986 82.6843827,182.36897 L1.87196327,103.246785 C-0.573596939,100.852377 -0.573596939,96.9702735 1.87196327,94.5758653 L19.7936929,77.028998 C22.2392531,74.6345898 26.2042918,74.6345898 28.6498531,77.028998 L86.0048306,133.184355 C86.6162214,133.782957 87.6074796,133.782957 88.2188704,133.184355 C88.2188796,133.184346 88.2188878,133.184338 88.2188969,133.184331 L145.571,77.028998 C148.016505,74.6345347 151.981544,74.6344449 154.427161,77.028798 C154.427195,77.0288316 154.427229,77.0288653 154.427262,77.028899 L211.782164,133.184331 C212.393554,133.782932 213.384814,133.782932 213.996204,133.184331 L271.350179,77.0300061 C273.79574,74.6355969 277.760778,74.6355969 280.206339,77.0300061 Z' id='WalletConnect'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/svg%3E";
var WALLETCONNECT_HEADER_TEXT = "WalletConnect";
var ANIMATION_DURATION = 300;
var DEFAULT_BUTTON_COLOR = "rgb(64, 153, 255)";
var WALLETCONNECT_WRAPPER_ID = "walletconnect-wrapper";
var WALLETCONNECT_STYLE_ID = "walletconnect-style-sheet";
var WALLETCONNECT_MODAL_ID = "walletconnect-qrcode-modal";
var WALLETCONNECT_CLOSE_BUTTON_ID = "walletconnect-qrcode-close";
var WALLETCONNECT_CTA_TEXT_ID = "walletconnect-qrcode-text";
var WALLETCONNECT_CONNECT_BUTTON_ID = "walletconnect-connect-button";
function Header(props) {
return React.createElement("div", {
className: "walletconnect-modal__header"
}, React.createElement("img", {
src: WALLETCONNECT_LOGO_SVG_URL,
className: "walletconnect-modal__headerLogo"
}), React.createElement("p", null, WALLETCONNECT_HEADER_TEXT), React.createElement("div", {
className: "walletconnect-modal__close__wrapper",
onClick: props.onClose
}, React.createElement("div", {
id: WALLETCONNECT_CLOSE_BUTTON_ID,
className: "walletconnect-modal__close__icon"
}, React.createElement("div", {
className: "walletconnect-modal__close__line1"
}), React.createElement("div", {
className: "walletconnect-modal__close__line2"
}))));
}
var officialAlgorandWallet = {
id: "23138217b046ae8d9d07e62b3337fb288c4445f92f64be067809cd0a8f9454b9",
name: "Algorand Wallet",
homepage: "https://algorandwallet.com/",
chains: ["algorand"],
app: {
browser: "",
ios: "https://apps.apple.com/us/app/algorand-wallet/id1459898525",
android: "https://play.google.com/store/apps/details?id=com.algorand.android",
mac: "",
windows: "",
linux: ""
},
mobile: {
native: "algorand-wc:",
universal: ""
},
desktop: {
native: "",
universal: ""
},
metadata: {
shortName: "Algorand Wallet",
colors: {
primary: "rgb(26, 174, 152)",
secondary: ""
}
}
};
var registry = {};
registry[officialAlgorandWallet.id] = officialAlgorandWallet;
function getAppLogoUrl(id) {
if (id === officialAlgorandWallet.id) {
return "https://algorand-app.s3.amazonaws.com/app-icons/Algorand-WalletConnect-128.png";
}
return "";
}
function formatMobileRegistryEntry(entry, platform) {
if ( platform === void 0 ) platform = "mobile";
return {
name: entry.name || "",
shortName: entry.metadata.shortName || "",
color: entry.metadata.colors.primary || "",
logo: entry.id ? getAppLogoUrl(entry.id) : "",
universalLink: entry[platform].universal || "",
deepLink: entry[platform].native || ""
};
}
function formatMobileRegistry(registry, platform) {
if ( platform === void 0 ) platform = "mobile";
return Object.values(registry).filter(function (entry) { return !!entry[platform].universal || !!entry[platform].native; }).map(function (entry) { return formatMobileRegistryEntry(entry, platform); });
}
function ConnectButton(props) {
return React.createElement("a", {
className: "walletconnect-connect__button",
href: props.href,
id: (WALLETCONNECT_CONNECT_BUTTON_ID + "-" + (props.name)),
onClick: props.onClick,
rel: "noopener noreferrer",
style: {
backgroundColor: props.color
},
target: "_blank"
}, props.name);
}
var CARET_SVG_URL = "data:image/svg+xml,%3Csvg width='8' height='18' viewBox='0 0 8 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M0.586301 0.213898C0.150354 0.552968 0.0718197 1.18124 0.41089 1.61719L5.2892 7.88931C5.57007 8.25042 5.57007 8.75608 5.2892 9.11719L0.410889 15.3893C0.071819 15.8253 0.150353 16.4535 0.586301 16.7926C1.02225 17.1317 1.65052 17.0531 1.98959 16.6172L6.86791 10.3451C7.7105 9.26174 7.7105 7.74476 6.86791 6.66143L1.98959 0.38931C1.65052 -0.0466374 1.02225 -0.125172 0.586301 0.213898Z' fill='%233C4252'/%3E %3C/svg%3E";
function WalletButton(props) {
var color = props.color;
var href = props.href;
var name = props.name;
var logo = props.logo;
var onClick = props.onClick;
return React.createElement("a", {
className: "walletconnect-modal__base__row",
href: href,
onClick: onClick,
rel: "noopener noreferrer",
target: "_blank"
}, React.createElement("h3", {
className: "walletconnect-modal__base__row__h3"
}, name), React.createElement("div", {
className: "walletconnect-modal__base__row__right"
}, React.createElement("div", {
className: "walletconnect-modal__base__row__right__app-icon",
style: {
background: ("url('" + logo + "') " + color),
backgroundSize: "100%"
}
}), React.createElement("img", {
src: CARET_SVG_URL,
className: "walletconnect-modal__base__row__right__caret"
})));
}
function WalletIcon(props) {
var color = props.color;
var href = props.href;
var name = props.name;
var logo = props.logo;
var onClick = props.onClick;
var fontSize = window.innerWidth < 768 ? ((name.length > 8 ? 2.5 : 2.7) + "vw") : "inherit";
return React.createElement("a", {
className: "walletconnect-connect__button__icon_anchor",
href: href,
onClick: onClick,
rel: "noopener noreferrer",
target: "_blank"
}, React.createElement("div", {
className: "walletconnect-connect__button__icon",
style: {
background: ("url('" + logo + "') " + color),
backgroundSize: "100%"
}
}), React.createElement("div", {
style: {
fontSize: fontSize
},
className: "walletconnect-connect__button__text"
}, name));
}
var GRID_MIN_COUNT = 5;
var LINKS_PER_PAGE = 12;
function LinkDisplay(props) {
var android = browserUtils.isAndroid();
var whitelist = props.qrcodeModalOptions && props.qrcodeModalOptions.mobileLinks ? props.qrcodeModalOptions.mobileLinks : undefined;
var ref = React.useState(1);
var page = ref[0];
var setPage = ref[1];
var ref$1 = React.useState(false);
var error = ref$1[0];
var setError = ref$1[1];
var ref$2 = React.useState([]);
var links = ref$2[0];
var setLinks = ref$2[1];
React.useEffect(function () {
var initMobileLinks = function () {
try {
if (android) { return Promise.resolve(); }
try {
var platform = props.mobile ? "mobile" : "desktop";
var _links = browserUtils.getMobileLinkRegistry(formatMobileRegistry(registry, platform), whitelist);
setLinks(_links);
} catch (e) {
console.error(e);
setError(true);
}
return Promise.resolve();
} catch (e) {
return Promise.reject(e);
}
};
initMobileLinks();
}, []);
var grid = links.length > GRID_MIN_COUNT;
var pages = Math.ceil(links.length / LINKS_PER_PAGE);
var range = [(page - 1) * LINKS_PER_PAGE + 1, page * LINKS_PER_PAGE];
var pageLinks = links.length ? links.filter(function (_, index) { return index + 1 >= range[0] && index + 1 <= range[1]; }) : [];
return React.createElement("div", null, React.createElement("p", {
id: WALLETCONNECT_CTA_TEXT_ID,
className: "walletconnect-qrcode__text"
}, android ? props.text.connect_mobile_wallet : props.text.choose_preferred_wallet), React.createElement("div", {
className: ("walletconnect-connect__buttons__wrapper" + (android ? "__android" : grid ? "__wrap" : ""))
}, !android ? pageLinks.length ? pageLinks.map(function (entry) {
var color = entry.color;
var name = entry.name;
var shortName = entry.shortName;
var logo = entry.logo;
var href = browserUtils.formatIOSMobile(props.uri, entry);
var handleClickIOS = React.useCallback(function () {
browserUtils.saveMobileLinkInfo({
name: name,
href: href
});
}, [pageLinks]);
return !grid ? React.createElement(WalletButton, {
color: color,
href: href,
name: name,
logo: logo,
onClick: handleClickIOS
}) : React.createElement(WalletIcon, {
color: color,
href: href,
name: shortName,
logo: logo,
onClick: handleClickIOS
});
}) : React.createElement(React.Fragment, null, React.createElement("p", null, error ? "Something went wrong" : "No wallets available")) : React.createElement(ConnectButton, {
name: props.text.connect,
color: DEFAULT_BUTTON_COLOR,
href: props.uri,
onClick: React.useCallback(function () {
browserUtils.saveMobileLinkInfo({
name: "Unknown",
href: props.uri
});
}, [])
})), !!(!android && pages > 1) && React.createElement("div", {
className: "walletconnect-modal__footer"
}, Array(pages).fill(0).map(function (_, index) {
var pageNumber = index + 1;
var selected = page === pageNumber;
return React.createElement("a", {
style: {
margin: "auto 10px",
fontWeight: selected ? "bold" : "normal"
},
onClick: function () { return setPage(pageNumber); }
}, pageNumber);
})));
}
function Notification(props) {
var show = !!props.message.trim();
return React.createElement("div", {
className: ("walletconnect-qrcode__notification" + (show ? " notification__show" : ""))
}, props.message);
}
var formatQRCodeImage = function (data) {
try {
var result = "";
return Promise.resolve(QRCode.toString(data, {
margin: 0,
type: "svg"
})).then(function (dataString) {
if (typeof dataString === "string") {
result = dataString.replace("<svg", "<svg class=\"walletconnect-qrcode__image\"");
}
return result;
});
} catch (e) {
return Promise.reject(e);
}
};
function QRCodeDisplay(props) {
var ref = React.useState("");
var notification = ref[0];
var setNotification = ref[1];
var ref$1 = React.useState("");
var svg = ref$1[0];
var setSvg = ref$1[1];
React.useEffect(function () {
try {
return Promise.resolve(formatQRCodeImage(props.uri)).then(function (_formatQRCodeImage) {
setSvg(_formatQRCodeImage);
});
} catch (e) {
Promise.reject(e);
}
}, []);
var copyToClipboard = function () {
var success = copy(props.uri);
if (success) {
setNotification(props.text.copied_to_clipboard);
setInterval(function () { return setNotification(""); }, 1200);
} else {
setNotification("Error");
setInterval(function () { return setNotification(""); }, 1200);
}
};
return React.createElement("div", null, React.createElement("p", {
id: WALLETCONNECT_CTA_TEXT_ID,
className: "walletconnect-qrcode__text"
}, props.text.scan_qrcode_with_wallet), React.createElement("div", {
dangerouslySetInnerHTML: {
__html: svg
}
}), React.createElement("div", {
className: "walletconnect-modal__footer"
}, React.createElement("a", {
onClick: copyToClipboard
}, props.text.copy_to_clipboard)), React.createElement(Notification, {
message: notification
}));
}
function Modal(props) {
var mobile = browserUtils.isMobile();
var ref = React.useState(!mobile);
var displayQRCode = ref[0];
var setDisplayQRCode = ref[1];
var displayProps = {
mobile: mobile,
text: props.text,
uri: props.uri,
qrcodeModalOptions: props.qrcodeModalOptions
};
var rightSelected = mobile ? displayQRCode : !displayQRCode;
return React.createElement("div", {
id: WALLETCONNECT_MODAL_ID,
className: "walletconnect-qrcode__base animated fadeIn"
}, React.createElement("div", {
className: "walletconnect-modal__base"
}, React.createElement(Header, {
onClose: props.onClose
}), React.createElement("div", {
className: ("walletconnect-modal__mobile__toggle" + (rightSelected ? " right__selected" : ""))
}, React.createElement("div", {
className: "walletconnect-modal__mobile__toggle_selector"
}), mobile ? React.createElement(React.Fragment, null, React.createElement("a", {
onClick: function () { return setDisplayQRCode(false); }
}, props.text.mobile), React.createElement("a", {
onClick: function () { return setDisplayQRCode(true); }
}, props.text.qrcode)) : React.createElement(React.Fragment, null, React.createElement("a", {
onClick: function () { return setDisplayQRCode(true); }
}, props.text.qrcode), React.createElement("a", {
onClick: function () { return setDisplayQRCode(false); }
}, props.text.desktop))), React.createElement("div", null, displayQRCode ? React.createElement(QRCodeDisplay, Object.assign({}, displayProps)) : React.createElement(LinkDisplay, Object.assign({}, displayProps)))));
}
var de = {
choose_preferred_wallet: "Wähle bevorzugte Wallet",
connect_mobile_wallet: "Verbinde mit Mobile Wallet",
scan_qrcode_with_wallet: "Scanne den QR-code mit einer WalletConnect kompatiblen Wallet",
connect: "Verbinden",
qrcode: "QR-Code",
mobile: "Mobile",
desktop: "Desktop",
copy_to_clipboard: "In die Zwischenablage kopieren",
copied_to_clipboard: "In die Zwischenablage kopiert!"
};
var en = {
choose_preferred_wallet: "Choose your preferred wallet",
connect_mobile_wallet: "Connect to Mobile Wallet",
scan_qrcode_with_wallet: "Scan QR code with a WalletConnect-compatible wallet",
connect: "Connect",
qrcode: "QR Code",
mobile: "Mobile",
desktop: "Desktop",
copy_to_clipboard: "Copy to clipboard",
copied_to_clipboard: "Copied to clipboard!"
};
var es = {
choose_preferred_wallet: "Elige tu billetera preferida",
connect_mobile_wallet: "Conectar a billetera móvil",
scan_qrcode_with_wallet: "Escanea el código QR con una billetera compatible con WalletConnect",
connect: "Conectar",
qrcode: "Código QR",
mobile: "Móvil",
desktop: "Desktop",
copy_to_clipboard: "Copiar",
copied_to_clipboard: "Copiado!"
};
var fr = {
choose_preferred_wallet: "Choisissez votre portefeuille préféré",
connect_mobile_wallet: "Se connecter au portefeuille mobile",
scan_qrcode_with_wallet: "Scannez le QR code avec un portefeuille compatible WalletConnect",
connect: "Se connecter",
qrcode: "QR Code",
mobile: "Mobile",
desktop: "Desktop",
copy_to_clipboard: "Copier",
copied_to_clipboard: "Copié!"
};
var ko = {
choose_preferred_wallet: "원하는 지갑을 선택하세요",
connect_mobile_wallet: "모바일 지갑과 연결",
scan_qrcode_with_wallet: "WalletConnect 지원 지갑에서 QR코드를 스캔하세요",
connect: "연결",
qrcode: "QR 코드",
mobile: "모바일",
desktop: "데스크탑",
copy_to_clipboard: "클립보드에 복사",
copied_to_clipboard: "클립보드에 복사되었습니다!"
};
var pt = {
choose_preferred_wallet: "Escolha sua carteira preferida",
connect_mobile_wallet: "Conectar-se à carteira móvel",
scan_qrcode_with_wallet: "Ler o código QR com uma carteira compatível com WalletConnect",
connect: "Conectar",
qrcode: "Código QR",
mobile: "Móvel",
desktop: "Desktop",
copy_to_clipboard: "Copiar",
copied_to_clipboard: "Copiado!"
};
var zh = {
choose_preferred_wallet: "选择你的钱包",
connect_mobile_wallet: "连接至移动端钱包",
scan_qrcode_with_wallet: "使用兼容 WalletConnect 的钱包扫描二维码",
connect: "连接",
qrcode: "二维码",
mobile: "移动",
desktop: "桌面",
copy_to_clipboard: "复制到剪贴板",
copied_to_clipboard: "复制到剪贴板成功!"
};
var fa = {
choose_preferred_wallet: "کیف پول مورد نظر خود را انتخاب کنید",
connect_mobile_wallet: "به کیف پول موبایل وصل شوید",
scan_qrcode_with_wallet: "کد QR را با یک کیف پول سازگار با WalletConnect اسکن کنید",
connect: "اتصال",
qrcode: "کد QR",
mobile: "سیار",
desktop: "دسکتاپ",
copy_to_clipboard: "کپی به کلیپ بورد",
copied_to_clipboard: "در کلیپ بورد کپی شد!"
};
var languages = {
de: de,
en: en,
es: es,
fr: fr,
ko: ko,
pt: pt,
zh: zh,
fa: fa
};
function injectStyleSheet() {
var doc = browserUtils.getDocumentOrThrow();
var prev = doc.getElementById(WALLETCONNECT_STYLE_ID);
if (prev) {
doc.head.removeChild(prev);
}
var style = doc.createElement("style");
style.setAttribute("id", WALLETCONNECT_STYLE_ID);
style.innerText = WALLETCONNECT_STYLE_SHEET;
doc.head.appendChild(style);
}
function renderWrapper() {
var doc = browserUtils.getDocumentOrThrow();
var wrapper = doc.createElement("div");
wrapper.setAttribute("id", WALLETCONNECT_WRAPPER_ID);
doc.body.appendChild(wrapper);
return wrapper;
}
function triggerCloseAnimation() {
var doc = browserUtils.getDocumentOrThrow();
var modal = doc.getElementById(WALLETCONNECT_MODAL_ID);
if (modal) {
modal.className = modal.className.replace("fadeIn", "fadeOut");
setTimeout(function () {
var wrapper = doc.getElementById(WALLETCONNECT_WRAPPER_ID);
if (wrapper) {
doc.body.removeChild(wrapper);
}
}, ANIMATION_DURATION);
}
}
function getWrappedCallback(cb) {
return function () {
triggerCloseAnimation();
if (cb) {
cb();
}
};
}
function getText() {
var lang = browserUtils.getNavigatorOrThrow().language.split("-")[0] || "en";
return languages[lang] || languages["en"];
}
function open$1(uri, cb, qrcodeModalOptions) {
injectStyleSheet();
var wrapper = renderWrapper();
React.render(React.createElement(Modal, {
text: getText(),
uri: uri,
onClose: getWrappedCallback(cb),
qrcodeModalOptions: qrcodeModalOptions
}), wrapper);
}
function close$1() {
triggerCloseAnimation();
}
var isNode = function () { return typeof process !== "undefined" && typeof process.versions !== "undefined" && typeof process.versions.node !== "undefined"; };
function open$2(uri, cb, qrcodeModalOptions) {
console.log(uri);
if (isNode()) {
open(uri);
} else {
open$1(uri, cb, qrcodeModalOptions);
}
}
function close$2() {
if (isNode()) ; else {
close$1();
}
}
var index = {
open: open$2,
close: close$2
};
module.exports = index;
}).call(this)}).call(this,require('_process'))
},{"@walletconnect/browser-utils":23,"_process":223,"copy-to-clipboard":36,"preact/compat":40,"qrcode":43}],34:[function(require,module,exports){
(function (process){(function (){
"use strict";
/*! For license information please see algosdk.min.js.LICENSE.txt */
!function (e, t) {
"object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.algosdk = t() : e.algosdk = t();
}(self, function () {
return (() => {
var __webpack_modules__ = {
5406: function (e) {
e.exports = 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;
}
return 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 = 0);
}([function (e, t, r) {
"use strict";
r.r(t), r.d(t, "encode", function () {
return k;
}), r.d(t, "decode", function () {
return H;
}), r.d(t, "decodeAsync", function () {
return W;
}), r.d(t, "decodeArrayStream", function () {
return X;
}), r.d(t, "decodeStream", function () {
return Y;
}), r.d(t, "Decoder", function () {
return z;
}), r.d(t, "Encoder", function () {
return _;
}), r.d(t, "ExtensionCodec", function () {
return S;
}), r.d(t, "ExtData", function () {
return f;
}), r.d(t, "EXT_TIMESTAMP", function () {
return y;
}), r.d(t, "encodeDateToTimeSpec", function () {
return b;
}), r.d(t, "encodeTimeSpecToTimestamp", function () {
return m;
}), r.d(t, "decodeTimestampToTimeSpec", function () {
return A;
}), r.d(t, "encodeTimestampExtension", function () {
return w;
}), r.d(t, "decodeTimestampExtension", function () {
return v;
});
var n = function (e, t) {
var r = "function" == typeof Symbol && e[Symbol.iterator];
if (!r) return e;
var n,
o,
s = r.call(e),
i = [];
try {
for (; (void 0 === t || t-- > 0) && !(n = s.next()).done;) i.push(n.value);
} catch (e) {
o = {
error: e
};
} finally {
try {
n && !n.done && (r = s.return) && r.call(s);
} finally {
if (o) throw o.error;
}
}
return i;
},
o = function () {
for (var e = [], t = 0; t < arguments.length; t++) e = e.concat(n(arguments[t]));
return e;
},
s = "undefined" != typeof process && "undefined" != typeof TextEncoder && "undefined" != typeof TextDecoder;
function i(e) {
for (var t = e.length, r = 0, n = 0; n < t;) {
var o = e.charCodeAt(n++);
if (0 != (4294967168 & o)) {
if (0 == (4294965248 & o)) r += 2;else {
if (o >= 55296 && o <= 56319 && n < t) {
var s = e.charCodeAt(n);
56320 == (64512 & s) && (++n, o = ((1023 & o) << 10) + (1023 & s) + 65536);
}
r += 0 == (4294901760 & o) ? 3 : 4;
}
} else r++;
}
return r;
}
var a = s ? new TextEncoder() : void 0,
c = "undefined" != typeof process ? 200 : 0,
u = (null == a ? void 0 : a.encodeInto) ? function (e, t, r) {
a.encodeInto(e, t.subarray(r));
} : function (e, t, r) {
t.set(a.encode(e), r);
};
function l(e, t, r) {
for (var n = t, s = n + r, i = [], a = ""; n < s;) {
var c = e[n++];
if (0 == (128 & c)) i.push(c);else if (192 == (224 & c)) {
var u = 63 & e[n++];
i.push((31 & c) << 6 | u);
} else if (224 == (240 & c)) {
u = 63 & e[n++];
var l = 63 & e[n++];
i.push((31 & c) << 12 | u << 6 | l);
} else if (240 == (248 & c)) {
var h = (7 & c) << 18 | (u = 63 & e[n++]) << 12 | (l = 63 & e[n++]) << 6 | 63 & e[n++];
h > 65535 && (h -= 65536, i.push(h >>> 10 & 1023 | 55296), h = 56320 | 1023 & h), i.push(h);
} else i.push(c);
i.length >= 4096 && (a += String.fromCharCode.apply(String, o(i)), i.length = 0);
}
return i.length > 0 && (a += String.fromCharCode.apply(String, o(i))), a;
}
var h = s ? new TextDecoder() : null,
p = "undefined" != typeof process ? 200 : 0,
f = function (e, t) {
this.type = e, this.data = t;
};
function d(e, t, r) {
var n = Math.floor(r / 4294967296),
o = r;
e.setUint32(t, n), e.setUint32(t + 4, o);
}
function g(e, t) {
var r = e.getInt32(t),
n = e.getUint32(t + 4),
o = r < Math.floor(Number.MIN_SAFE_INTEGER / 4294967296) || r === Math.floor(Number.MIN_SAFE_INTEGER / 4294967296) && 0 === n,
s = r > Math.floor(Number.MAX_SAFE_INTEGER / 4294967296);
return o || s ? BigInt(r) * BigInt(4294967296) + BigInt(n) : 4294967296 * r + n;
}
var y = -1;
function m(e) {
var t,
r = e.sec,
n = e.nsec;
if (r >= 0 && n >= 0 && r <= 17179869183) {
if (0 === n && r <= 4294967295) {
var o = new Uint8Array(4);
return (t = new DataView(o.buffer)).setUint32(0, r), o;
}
var s = r / 4294967296,
i = 4294967295 & r;
return o = new Uint8Array(8), (t = new DataView(o.buffer)).setUint32(0, n << 2 | 3 & s), t.setUint32(4, i), o;
}
return o = new Uint8Array(12), (t = new DataView(o.buffer)).setUint32(0, n), d(t, 4, r), o;
}
function b(e) {
var t = e.getTime(),
r = Math.floor(t / 1e3),
n = 1e6 * (t - 1e3 * r),
o = Math.floor(n / 1e9);
return {
sec: r + o,
nsec: n - 1e9 * o
};
}
function w(e) {
return e instanceof Date ? m(b(e)) : null;
}
function A(e) {
var t = new DataView(e.buffer, e.byteOffset, e.byteLength);
switch (e.byteLength) {
case 4:
return {
sec: t.getUint32(0),
nsec: 0
};
case 8:
var r = t.getUint32(0);
return {
sec: 4294967296 * (3 & r) + t.getUint32(4),
nsec: r >>> 2
};
case 12:
return {
sec: g(t, 4),
nsec: t.getUint32(0)
};
default:
throw new Error("Unrecognized data size for timestamp: " + e.length);
}
}
function v(e) {
var t = A(e);
return new Date(1e3 * t.sec + t.nsec / 1e6);
}
var x = {
type: y,
encode: w,
decode: v
},
S = function () {
function e() {
this.builtInEncoders = [], this.builtInDecoders = [], this.encoders = [], this.decoders = [], this.register(x);
}
return e.prototype.register = function (e) {
var t = e.type,
r = e.encode,
n = e.decode;
if (t >= 0) this.encoders[t] = r, this.decoders[t] = n;else {
var o = 1 + t;
this.builtInEncoders[o] = r, this.builtInDecoders[o] = n;
}
}, e.prototype.tryToEncode = function (e, t) {
for (var r = 0; r < this.builtInEncoders.length; r++) if (null != (n = this.builtInEncoders[r]) && null != (o = n(e, t))) return new f(-1 - r, o);
for (r = 0; r < this.encoders.length; r++) {
var n, o;
if (null != (n = this.encoders[r]) && null != (o = n(e, t))) return new f(r, o);
}
return e instanceof f ? e : null;
}, e.prototype.decode = function (e, t, r) {
var n = t < 0 ? this.builtInDecoders[-1 - t] : this.decoders[t];
return n ? n(e, t, r) : new f(t, e);
}, e.defaultCodec = new e(), e;
}();
function E(e) {
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : e instanceof ArrayBuffer ? new Uint8Array(e) : Uint8Array.from(e);
}
var T = function (e) {
var t = "function" == typeof Symbol && Symbol.iterator,
r = t && e[t],
n = 0;
if (r) return r.call(e);
if (e && "number" == typeof e.length) return {
next: function () {
return e && n >= 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 () {
function e(e, t, r, n, o, s, i, a) {
void 0 === e && (e = S.defaultCodec), void 0 === t && (t = void 0), void 0 === r && (r = 100), void 0 === n && (n = 2048), void 0 === o && (o = !1), void 0 === s && (s = !1), void 0 === i && (i = !1), void 0 === a && (a = !1), this.extensionCodec = e, this.context = t, this.maxDepth = r, this.initialBufferSize = n, this.sortKeys = o, this.forceFloat32 = s, this.ignoreUndefined = i, this.forceIntegerToFloat = a, this.pos = 0, this.view = new DataView(new ArrayBuffer(this.initialBufferSize)), this.bytes = new Uint8Array(this.view.buffer);
}
return e.prototype.getUint8Array = function () {
return this.bytes.subarray(0, this.pos);
}, e.prototype.reinitializeState = function () {
this.pos = 0;
}, e.prototype.encode = function (e) {
return this.reinitializeState(), this.doEncode(e, 1), this.getUint8Array();
}, e.prototype.doEncode = function (e, t) {
if (t > this.maxDepth) throw new Error("Too deep objects in depth " + t);
null == e ? this.encodeNil() : "boolean" == typeof e ? this.encodeBoolean(e) : "number" == typeof e ? this.encodeNumber(e) : "string" == typeof e ? this.encodeString(e) : "bigint" == typeof e ? this.encodebigint(e) : this.encodeObject(e, t);
}, e.prototype.ensureBufferSizeToWrite = function (e) {
var t = this.pos + e;
this.view.byteLength < t && this.resizeBuffer(2 * t);
}, e.prototype.resizeBuffer = function (e) {
var t = new ArrayBuffer(e),
r = new Uint8Array(t),
n = new DataView(t);
r.set(this.bytes), this.view = n, this.bytes = r;
}, e.prototype.encodeNil = function () {
this.writeU8(192);
}, e.prototype.encodeBoolean = function (e) {
!1 === e ? this.writeU8(194) : this.writeU8(195);
}, e.prototype.encodeNumber = function (e) {
Number.isSafeInteger(e) && !this.forceIntegerToFloat ? e >= 0 ? e < 128 ? this.writeU8(e) : e < 256 ? (this.writeU8(204), this.writeU8(e)) : e < 65536 ? (this.writeU8(205), this.writeU16(e)) : e < 4294967296 ? (this.writeU8(206), this.writeU32(e)) : (this.writeU8(207), this.writeU64(e)) : e >= -32 ? this.writeU8(224 | e + 32) : e >= -128 ? (this.writeU8(208), this.writeI8(e)) : e >= -32768 ? (this.writeU8(209), this.writeI16(e)) : e >= -2147483648 ? (this.writeU8(210), this.writeI32(e)) : (this.writeU8(211), this.writeI64(e)) : this.forceFloat32 ? (this.writeU8(202), this.writeF32(e)) : (this.writeU8(203), this.writeF64(e));
}, e.prototype.encodebigint = function (e) {
e >= BigInt(0) ? e < BigInt(128) ? this.writeU8(Number(e)) : e < BigInt(256) ? (this.writeU8(204), this.writeU8(Number(e))) : e < BigInt(65536) ? (this.writeU8(205), this.writeU16(Number(e))) : e < BigInt(4294967296) ? (this.writeU8(206), this.writeU32(Number(e))) : (this.writeU8(207), this.writeBig64(e)) : e >= BigInt(-32) ? this.writeU8(224 | Number(e) + 32) : e >= BigInt(-128) ? (this.writeU8(208), this.writeI8(Number(e))) : e >= BigInt(-32768) ? (this.writeU8(209), this.writeI16(Number(e))) : e >= BigInt(-2147483648) ? (this.writeU8(210), this.writeI32(Number(e))) : (this.writeU8(211), this.writeBig64(e));
}, e.prototype.writeStringHeader = function (e) {
if (e < 32) this.writeU8(160 + e);else if (e < 256) this.writeU8(217), this.writeU8(e);else if (e < 65536) this.writeU8(218), this.writeU16(e);else {
if (!(e < 4294967296)) throw new Error("Too long string: " + e + " bytes in UTF-8");
this.writeU8(219), this.writeU32(e);
}
}, e.prototype.encodeString = function (e) {
var t = e.length;
if (s && t > c) {
var r = i(e);
this.ensureBufferSizeToWrite(5 + r), this.writeStringHeader(r), u(e, this.bytes, this.pos), this.pos += r;
} else r = i(e), this.ensureBufferSizeToWrite(5 + r), this.writeStringHeader(r), function (e, t, r) {
for (var n = e.length, o = r, s = 0; s < n;) {
var i = e.charCodeAt(s++);
if (0 != (4294967168 & i)) {
if (0 == (4294965248 & i)) t[o++] = i >> 6 & 31 | 192;else {
if (i >= 55296 && i <= 56319 && s < n) {
var a = e.charCodeAt(s);
56320 == (64512 & a) && (++s, i = ((1023 & i) << 10) + (1023 & a) + 65536);
}
0 == (4294901760 & i) ? (t[o++] = i >> 12 & 15 | 224, t[o++] = i >> 6 & 63 | 128) : (t[o++] = i >> 18 & 7 | 240, t[o++] = i >> 12 & 63 | 128, t[o++] = i >> 6 & 63 | 128);
}
t[o++] = 63 & i | 128;
} else t[o++] = i;
}
}(e, this.bytes, this.pos), this.pos += r;
}, e.prototype.encodeObject = function (e, t) {
var r = this.extensionCodec.tryToEncode(e, this.context);
if (null != r) this.encodeExtension(r);else if (Array.isArray(e)) this.encodeArray(e, t);else if (ArrayBuffer.isView(e)) this.encodeBinary(e);else {
if ("object" != typeof e) throw new Error("Unrecognized object: " + Object.prototype.toString.apply(e));
this.encodeMap(e, t);
}
}, e.prototype.encodeBinary = function (e) {
var t = e.byteLength;
if (t < 256) this.writeU8(196), this.writeU8(t);else if (t < 65536) this.writeU8(197), this.writeU16(t);else {
if (!(t < 4294967296)) throw new Error("Too large binary: " + t);
this.writeU8(198), this.writeU32(t);
}
var r = E(e);
this.writeU8a(r);
}, e.prototype.encodeArray = function (e, t) {
var r,
n,
o = e.length;
if (o < 16) this.writeU8(144 + o);else if (o < 65536) this.writeU8(220), this.writeU16(o);else {
if (!(o < 4294967296)) throw new Error("Too large array: " + o);
this.writeU8(221), this.writeU32(o);
}
try {
for (var s = T(e), i = s.next(); !i.done; i = s.next()) {
var a = i.value;
this.doEncode(a, t + 1);
}
} catch (e) {
r = {
error: e
};
} finally {
try {
i && !i.done && (n = s.return) && n.call(s);
} finally {
if (r) throw r.error;
}
}
}, e.prototype.countWithoutUndefined = function (e, t) {
var r,
n,
o = 0;
try {
for (var s = T(t), i = s.next(); !i.done; i = s.next()) void 0 !== e[i.value] && o++;
} catch (e) {
r = {
error: e
};
} finally {
try {
i && !i.done && (n = s.return) && n.call(s);
} finally {
if (r) throw r.error;
}
}
return o;
}, e.prototype.encodeMap = function (e, t) {
var r,
n,
o = Object.keys(e);
this.sortKeys && o.sort();
var s = this.ignoreUndefined ? this.countWithoutUndefined(e, o) : o.length;
if (s < 16) this.writeU8(128 + s);else if (s < 65536) this.writeU8(222), this.writeU16(s);else {
if (!(s < 4294967296)) throw new Error("Too large map object: " + s);
this.writeU8(223), this.writeU32(s);
}
try {
for (var i = T(o), a = i.next(); !a.done; a = i.next()) {
var c = a.value,
u = e[c];
this.ignoreUndefined && void 0 === u || (this.encodeString(c), this.doEncode(u, t + 1));
}
} catch (e) {
r = {
error: e
};
} finally {
try {
a && !a.done && (n = i.return) && n.call(i);
} finally {
if (r) throw r.error;
}
}
}, e.prototype.encodeExtension = function (e) {
var t = e.data.length;
if (1 === t) this.writeU8(212);else if (2 === t) this.writeU8(213);else if (4 === t) this.writeU8(214);else if (8 === t) this.writeU8(215);else if (16 === t) this.writeU8(216);else if (t < 256) this.writeU8(199), this.writeU8(t);else if (t < 65536) this.writeU8(200), this.writeU16(t);else {
if (!(t < 4294967296)) throw new Error("Too large extension object: " + t);
this.writeU8(201), this.writeU32(t);
}
this.writeI8(e.type), this.writeU8a(e.data);
}, e.prototype.writeU8 = function (e) {
this.ensureBufferSizeToWrite(1), this.view.setUint8(this.pos, e), this.pos++;
}, e.prototype.writeU8a = function (e) {
var t = e.length;
this.ensureBufferSizeToWrite(t), this.bytes.set(e, this.pos), this.pos += t;
}, e.prototype.writeI8 = function (e) {
this.ensureBufferSizeToWrite(1), this.view.setInt8(this.pos, e), this.pos++;
}, e.prototype.writeU16 = function (e) {
this.ensureBufferSizeToWrite(2), this.view.setUint16(this.pos, e), this.pos += 2;
}, e.prototype.writeI16 = function (e) {
this.ensureBufferSizeToWrite(2), this.view.setInt16(this.pos, e), this.pos += 2;
}, e.prototype.writeU32 = function (e) {
this.ensureBufferSizeToWrite(4), this.view.setUint32(this.pos, e), this.pos += 4;
}, e.prototype.writeI32 = function (e) {
this.ensureBufferSizeToWrite(4), this.view.setInt32(this.pos, e), this.pos += 4;
}, e.prototype.writeF32 = function (e) {
this.ensureBufferSizeToWrite(4), this.view.setFloat32(this.pos, e), this.pos += 4;
}, e.prototype.writeF64 = function (e) {
this.ensureBufferSizeToWrite(8), this.view.setFloat64(this.pos, e), this.pos += 8;
}, e.prototype.writeU64 = function (e) {
this.ensureBufferSizeToWrite(8), function (e, t, r) {
var n = r / 4294967296,
o = r;
e.setUint32(t, n), e.setUint32(t + 4, o);
}(this.view, this.pos, e), this.pos += 8;
}, e.prototype.writeI64 = function (e) {
this.ensureBufferSizeToWrite(8), d(this.view, this.pos, e), this.pos += 8;
}, e.prototype.writeBig64 = function (e) {
this.ensureBufferSizeToWrite(8), function (e, t, r) {
var n = Number(r / BigInt(4294967296)),
o = Number(r % BigInt(4294967296));
n < 0 && 0 !== o && (n -= 1), e.setUint32(t, n), e.setUint32(t + 4, o);
}(this.view, this.pos, e), this.pos += 8;
}, e;
}(),
B = {};
function k(e, t) {
return void 0 === t && (t = B), new _(t.extensionCodec, t.context, t.maxDepth, t.initialBufferSize, t.sortKeys, t.forceFloat32, t.ignoreUndefined, t.forceIntegerToFloat).encode(e);
}
function I(e) {
return (e < 0 ? "-" : "") + "0x" + Math.abs(e).toString(16).padStart(2, "0");
}
var U = function () {
function e(e, t) {
void 0 === e && (e = 16), void 0 === t && (t = 16), this.maxKeyLength = e, this.maxLengthPerKey = t, this.hit = 0, this.miss = 0, this.caches = [];
for (var r = 0; r < this.maxKeyLength; r++) this.caches.push([]);
}
return e.prototype.canBeCached = function (e) {
return e > 0 && e <= this.maxKeyLength;
}, e.prototype.get = function (e, t, r) {
var n = this.caches[r - 1],
o = n.length;
e: for (var s = 0; s < o; s++) {
for (var i = n[s], a = i.bytes, c = 0; c < r; c++) if (a[c] !== e[t + c]) continue e;
return i.value;
}
return null;
}, e.prototype.store = function (e, t) {
var r = this.caches[e.length - 1],
n = {
bytes: e,
value: t
};
r.length >= this.maxLengthPerKey ? r[Math.random() * r.length | 0] = n : r.push(n);
}, e.prototype.decode = function (e, t, r) {
var n = this.get(e, t, r);
if (null != n) return this.hit++, n;
this.miss++;
var o = l(e, t, r),
s = Uint8Array.prototype.slice.call(e, t, t + r);
return this.store(s, o), o;
}, e;
}(),
C = function (e, t) {
var r,
n,
o,
s,
i = {
label: 0,
sent: function () {
if (1 & o[0]) throw o[1];
return o[1];
},
trys: [],
ops: []
};
return s = {
next: a(0),
throw: a(1),
return: a(2)
}, "function" == typeof Symbol && (s[Symbol.iterator] = function () {
return this;
}), s;
function a(s) {
return function (a) {
return function (s) {
if (r) throw new TypeError("Generator is already executing.");
for (; i;) try {
if (r = 1, n && (o = 2 & s[0] ? n.return : s[0] ? n.throw || ((o = n.return) && o.call(n), 0) : n.next) && !(o = o.call(n, s[1])).done) return o;
switch (n = 0, o && (s = [2 & s[0], o.value]), s[0]) {
case 0:
case 1:
o = s;
break;
case 4:
return i.label++, {
value: s[1],
done: !1
};
case 5:
i.label++, n = s[1], s = [0];
continue;
case 7:
s = i.ops.pop(), i.trys.pop();
continue;
default:
if (!((o = (o = i.trys).length > 0 && o[o.length - 1]) || 6 !== s[0] && 2 !== s[0])) {
i = 0;
continue;
}
if (3 === s[0] && (!o || s[1] > o[0] && s[1] < o[3])) {
i.label = s[1];
break;
}
if (6 === s[0] && i.label < o[1]) {
i.label = o[1], o = s;
break;
}
if (o && i.label < o[2]) {
i.label = o[2], i.ops.push(s);
break;
}
o[2] && i.ops.pop(), i.trys.pop();
continue;
}
s = t.call(e, i);
} catch (e) {
s = [6, e], n = 0;
} finally {
r = o = 0;
}
if (5 & s[0]) throw s[1];
return {
value: s[0] ? s[1] : void 0,
done: !0
};
}([s, a]);
};
}
},
R = function (e) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var t,
r = e[Symbol.asyncIterator];
return r ? r.call(e) : (e = "function" == typeof __values ? __values(e) : e[Symbol.iterator](), 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);
});
};
}
},
O = function (e) {
return this instanceof O ? (this.v = e, this) : new O(e);
},
D = function (e, t, r) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var n,
o = r.apply(e, t || []),
s = [];
return n = {}, i("next"), i("throw"), i("return"), n[Symbol.asyncIterator] = function () {
return this;
}, n;
function i(e) {
o[e] && (n[e] = function (t) {
return new Promise(function (r, n) {
s.push([e, t, r, n]) > 1 || a(e, t);
});
});
}
function a(e, t) {
try {
(r = o[e](t)).value instanceof O ? Promise.resolve(r.value.v).then(c, u) : l(s[0][2], r);
} catch (e) {
l(s[0][3], e);
}
var r;
}
function c(e) {
a("next", e);
}
function u(e) {
a("throw", e);
}
function l(e, t) {
e(t), s.shift(), s.length && a(s[0][0], s[0][1]);
}
},
N = new DataView(new ArrayBuffer(0)),
P = new Uint8Array(N.buffer),
L = function () {
try {
N.getInt8(0);
} catch (e) {
return e.constructor;
}
throw new Error("never reached");
}(),
F = new L("Insufficient data"),
j = new U(),
z = function () {
function e(e, t, r, n, o, s, i, a) {
void 0 === e && (e = S.defaultCodec), void 0 === t && (t = void 0), void 0 === r && (r = 4294967295), void 0 === n && (n = 4294967295), void 0 === o && (o = 4294967295), void 0 === s && (s = 4294967295), void 0 === i && (i = 4294967295), void 0 === a && (a = j), this.extensionCodec = e, this.context = t, this.maxStrLength = r, this.maxBinLength = n, this.maxArrayLength = o, this.maxMapLength = s, this.maxExtLength = i, this.keyDecoder = a, this.totalPos = 0, this.pos = 0, this.view = N, this.bytes = P, this.headByte = -1, this.stack = [];
}
return e.prototype.reinitializeState = function () {
this.totalPos = 0, this.headByte = -1;
}, e.prototype.setBuffer = function (e) {
this.bytes = E(e), this.view = function (e) {
if (e instanceof ArrayBuffer) return new DataView(e);
var t = E(e);
return new DataView(t.buffer, t.byteOffset, t.byteLength);
}(this.bytes), this.pos = 0;
}, e.prototype.appendBuffer = function (e) {
if (-1 !== this.headByte || this.hasRemaining()) {
var t = this.bytes.subarray(this.pos),
r = E(e),
n = new Uint8Array(t.length + r.length);
n.set(t), n.set(r, t.length), this.setBuffer(n);
} else this.setBuffer(e);
}, e.prototype.hasRemaining = function (e) {
return void 0 === e && (e = 1), this.view.byteLength - this.pos >= e;
}, e.prototype.createNoExtraBytesError = function (e) {
var t = this.view,
r = this.pos;
return new RangeError("Extra " + (t.byteLength - r) + " of " + t.byteLength + " byte(s) found at buffer[" + e + "]");
}, e.prototype.decode = function (e) {
return this.reinitializeState(), this.setBuffer(e), this.doDecodeSingleSync();
}, e.prototype.doDecodeSingleSync = function () {
var e = this.doDecodeSync();
if (this.hasRemaining()) throw this.createNoExtraBytesError(this.pos);
return e;
}, e.prototype.decodeAsync = function (e) {
var t, r, n, o;
return function (e, t, r, n) {
return new (r || (r = Promise))(function (o, s) {
function i(e) {
try {
c(n.next(e));
} catch (e) {
s(e);
}
}
function a(e) {
try {
c(n.throw(e));
} catch (e) {
s(e);
}
}
function c(e) {
var t;
e.done ? o(e.value) : (t = e.value, t instanceof r ? t : new r(function (e) {
e(t);
})).then(i, a);
}
c((n = n.apply(e, t || [])).next());
});
}(this, void 0, void 0, function () {
var s, i, a, c, u, l, h, p;
return C(this, function (f) {
switch (f.label) {
case 0:
s = !1, f.label = 1;
case 1:
f.trys.push([1, 6, 7, 12]), t = R(e), f.label = 2;
case 2:
return [4, t.next()];
case 3:
if ((r = f.sent()).done) return [3, 5];
if (a = r.value, s) throw this.createNoExtraBytesError(this.totalPos);
this.appendBuffer(a);
try {
i = this.doDecodeSync(), s = !0;
} catch (e) {
if (!(e instanceof L)) throw e;
}
this.totalPos += this.pos, f.label = 4;
case 4:
return [3, 2];
case 5:
return [3, 12];
case 6:
return c = f.sent(), n = {
error: c
}, [3, 12];
case 7:
return f.trys.push([7,, 10, 11]), r && !r.done && (o = t.return) ? [4, o.call(t)] : [3, 9];
case 8:
f.sent(), f.label = 9;
case 9:
return [3, 11];
case 10:
if (n) throw n.error;
return [7];
case 11:
return [7];
case 12:
if (s) {
if (this.hasRemaining()) throw this.createNoExtraBytesError(this.totalPos);
return [2, i];
}
throw l = (u = this).headByte, h = u.pos, p = u.totalPos, new RangeError("Insufficient data in parcing " + I(l) + " at " + p + " (" + h + " in the current buffer)");
}
});
});
}, e.prototype.decodeArrayStream = function (e) {
return this.decodeMultiAsync(e, !0);
}, e.prototype.decodeStream = function (e) {
return this.decodeMultiAsync(e, !1);
}, e.prototype.decodeMultiAsync = function (e, t) {
return D(this, arguments, function () {
var r, n, o, s, i, a, c, u, l;
return C(this, function (h) {
switch (h.label) {
case 0:
r = t, n = -1, h.label = 1;
case 1:
h.trys.push([1, 13, 14, 19]), o = R(e), h.label = 2;
case 2:
return [4, O(o.next())];
case 3:
if ((s = h.sent()).done) return [3, 12];
if (i = s.value, t && 0 === n) throw this.createNoExtraBytesError(this.totalPos);
this.appendBuffer(i), r && (n = this.readArraySize(), r = !1, this.complete()), h.label = 4;
case 4:
h.trys.push([4, 9,, 10]), h.label = 5;
case 5:
return [4, O(this.doDecodeSync())];
case 6:
return [4, h.sent()];
case 7:
return h.sent(), 0 == --n ? [3, 8] : [3, 5];
case 8:
return [3, 10];
case 9:
if (!((a = h.sent()) instanceof L)) throw a;
return [3, 10];
case 10:
this.totalPos += this.pos, h.label = 11;
case 11:
return [3, 2];
case 12:
return [3, 19];
case 13:
return c = h.sent(), u = {
error: c
}, [3, 19];
case 14:
return h.trys.push([14,, 17, 18]), s && !s.done && (l = o.return) ? [4, O(l.call(o))] : [3, 16];
case 15:
h.sent(), h.label = 16;
case 16:
return [3, 18];
case 17:
if (u) throw u.error;
return [7];
case 18:
return [7];
case 19:
return [2];
}
});
});
}, e.prototype.doDecodeSync = function () {
e: for (;;) {
var e = this.readHeadByte(),
t = void 0;
if (e >= 224) t = e - 256;else if (e < 192) {
if (e < 128) t = e;else if (e < 144) {
if (0 != (n = e - 128)) {
this.pushMapState(n), this.complete();
continue e;
}
t = {};
} else if (e < 160) {
if (0 != (n = e - 144)) {
this.pushArrayState(n), this.complete();
continue e;
}
t = [];
} else {
var r = e - 160;
t = this.decodeUtf8String(r, 0);
}
} else if (192 === e) t = null;else if (194 === e) t = !1;else if (195 === e) t = !0;else if (202 === e) t = this.readF32();else if (203 === e) t = this.readF64();else if (204 === e) t = this.readU8();else if (205 === e) t = this.readU16();else if (206 === e) t = this.readU32();else if (207 === e) t = this.readU64();else if (208 === e) t = this.readI8();else if (209 === e) t = this.readI16();else if (210 === e) t = this.readI32();else if (211 === e) t = this.readI64();else if (217 === e) r = this.lookU8(), t = this.decodeUtf8String(r, 1);else if (218 === e) r = this.lookU16(), t = this.decodeUtf8String(r, 2);else if (219 === e) r = this.lookU32(), t = this.decodeUtf8String(r, 4);else if (220 === e) {
if (0 !== (n = this.readU16())) {
this.pushArrayState(n), this.complete();
continue e;
}
t = [];
} else if (221 === e) {
if (0 !== (n = this.readU32())) {
this.pushArrayState(n), this.complete();
continue e;
}
t = [];
} else if (222 === e) {
if (0 !== (n = this.readU16())) {
this.pushMapState(n), this.complete();
continue e;
}
t = {};
} else if (223 === e) {
if (0 !== (n = this.readU32())) {
this.pushMapState(n), this.complete();
continue e;
}
t = {};
} else if (196 === e) {
var n = this.lookU8();
t = this.decodeBinary(n, 1);
} else if (197 === e) n = this.lookU16(), t = this.decodeBinary(n, 2);else if (198 === e) n = this.lookU32(), t = this.decodeBinary(n, 4);else if (212 === e) t = this.decodeExtension(1, 0);else if (213 === e) t = this.decodeExtension(2, 0);else if (214 === e) t = this.decodeExtension(4, 0);else if (215 === e) t = this.decodeExtension(8, 0);else if (216 === e) t = this.decodeExtension(16, 0);else if (199 === e) n = this.lookU8(), t = this.decodeExtension(n, 1);else if (200 === e) n = this.lookU16(), t = this.decodeExtension(n, 2);else {
if (201 !== e) throw new Error("Unrecognized type byte: " + I(e));
n = this.lookU32(), t = this.decodeExtension(n, 4);
}
this.complete();
for (var o = this.stack; o.length > 0;) {
var s = o[o.length - 1];
if (0 === s.type) {
if (s.array[s.position] = t, s.position++, s.position !== s.size) continue e;
o.pop(), t = s.array;
} else {
if (1 === s.type) {
if (void 0, "string" != (i = typeof t) && "number" !== i) throw new Error("The type of key must be string or number but " + typeof t);
s.key = t, s.type = 2;
continue e;
}
if (s.map[s.key] = t, s.readCount++, s.readCount !== s.size) {
s.key = null, s.type = 1;
continue e;
}
o.pop(), t = s.map;
}
}
return t;
}
var i;
}, e.prototype.readHeadByte = function () {
return -1 === this.headByte && (this.headByte = this.readU8()), this.headByte;
}, e.prototype.complete = function () {
this.headByte = -1;
}, e.prototype.readArraySize = function () {
var e = this.readHeadByte();
switch (e) {
case 220:
return this.readU16();
case 221:
return this.readU32();
default:
if (e < 160) return e - 144;
throw new Error("Unrecognized array type byte: " + I(e));
}
}, e.prototype.pushMapState = function (e) {
if (e > this.maxMapLength) throw new Error("Max length exceeded: map length (" + e + ") > maxMapLengthLength (" + this.maxMapLength + ")");
this.stack.push({
type: 1,
size: e,
key: null,
readCount: 0,
map: {}
});
}, e.prototype.pushArrayState = function (e) {
if (e > this.maxArrayLength) throw new Error("Max length exceeded: array length (" + e + ") > maxArrayLength (" + this.maxArrayLength + ")");
this.stack.push({
type: 0,
size: e,
array: new Array(e),
position: 0
});
}, e.prototype.decodeUtf8String = function (e, t) {
var r;
if (e > this.maxStrLength) throw new Error("Max length exceeded: UTF-8 byte length (" + e + ") > maxStrLength (" + this.maxStrLength + ")");
if (this.bytes.byteLength < this.pos + t + e) throw F;
var n,
o = this.pos + t;
return n = this.stateIsMapKey() && (null === (r = this.keyDecoder) || void 0 === r ? void 0 : r.canBeCached(e)) ? this.keyDecoder.decode(this.bytes, o, e) : s && e > p ? function (e, t, r) {
var n = e.subarray(t, t + r);
return h.decode(n);
}(this.bytes, o, e) : l(this.bytes, o, e), this.pos += t + e, n;
}, e.prototype.stateIsMapKey = function () {
return this.stack.length > 0 && 1 === this.stack[this.stack.length - 1].type;
}, e.prototype.decodeBinary = function (e, t) {
if (e > this.maxBinLength) throw new Error("Max length exceeded: bin length (" + e + ") > maxBinLength (" + this.maxBinLength + ")");
if (!this.hasRemaining(e + t)) throw F;
var r = this.pos + t,
n = this.bytes.subarray(r, r + e);
return this.pos += t + e, n;
}, e.prototype.decodeExtension = function (e, t) {
if (e > this.maxExtLength) throw new Error("Max length exceeded: ext length (" + e + ") > maxExtLength (" + this.maxExtLength + ")");
var r = this.view.getInt8(this.pos + t),
n = this.decodeBinary(e, t + 1);
return this.extensionCodec.decode(n, r, this.context);
}, e.prototype.lookU8 = function () {
return this.view.getUint8(this.pos);
}, e.prototype.lookU16 = function () {
return this.view.getUint16(this.pos);
}, e.prototype.lookU32 = function () {
return this.view.getUint32(this.pos);
}, e.prototype.readU8 = function () {
var e = this.view.getUint8(this.pos);
return this.pos++, e;
}, e.prototype.readI8 = function () {
var e = this.view.getInt8(this.pos);
return this.pos++, e;
}, e.prototype.readU16 = function () {
var e = this.view.getUint16(this.pos);
return this.pos += 2, e;
}, e.prototype.readI16 = function () {
var e = this.view.getInt16(this.pos);
return this.pos += 2, e;
}, e.prototype.readU32 = function () {
var e = this.view.getUint32(this.pos);
return this.pos += 4, e;
}, e.prototype.readI32 = function () {
var e = this.view.getInt32(this.pos);
return this.pos += 4, e;
}, e.prototype.readU64 = function () {
var e,
t,
r,
n,
o = (e = this.view, t = this.pos, r = e.getUint32(t), n = e.getUint32(t + 4), r > Math.floor(Number.MAX_SAFE_INTEGER / 4294967296) ? BigInt(r) * BigInt(4294967296) + BigInt(n) : 4294967296 * r + n);
return this.pos += 8, o;
}, e.prototype.readI64 = function () {
var e = g(this.view, this.pos);
return this.pos += 8, e;
}, e.prototype.readF32 = function () {
var e = this.view.getFloat32(this.pos);
return this.pos += 4, e;
}, e.prototype.readF64 = function () {
var e = this.view.getFloat64(this.pos);
return this.pos += 8, e;
}, e;
}(),
M = {};
function H(e, t) {
return void 0 === t && (t = M), new z(t.extensionCodec, t.context, t.maxStrLength, t.maxBinLength, t.maxArrayLength, t.maxMapLength, t.maxExtLength).decode(e);
}
var G = function (e, t) {
var r,
n,
o,
s,
i = {
label: 0,
sent: function () {
if (1 & o[0]) throw o[1];
return o[1];
},
trys: [],
ops: []
};
return s = {
next: a(0),
throw: a(1),
return: a(2)
}, "function" == typeof Symbol && (s[Symbol.iterator] = function () {
return this;
}), s;
function a(s) {
return function (a) {
return function (s) {
if (r) throw new TypeError("Generator is already executing.");
for (; i;) try {
if (r = 1, n && (o = 2 & s[0] ? n.return : s[0] ? n.throw || ((o = n.return) && o.call(n), 0) : n.next) && !(o = o.call(n, s[1])).done) return o;
switch (n = 0, o && (s = [2 & s[0], o.value]), s[0]) {
case 0:
case 1:
o = s;
break;
case 4:
return i.label++, {
value: s[1],
done: !1
};
case 5:
i.label++, n = s[1], s = [0];
continue;
case 7:
s = i.ops.pop(), i.trys.pop();
continue;
default:
if (!((o = (o = i.trys).length > 0 && o[o.length - 1]) || 6 !== s[0] && 2 !== s[0])) {
i = 0;
continue;
}
if (3 === s[0] && (!o || s[1] > o[0] && s[1] < o[3])) {
i.label = s[1];
break;
}
if (6 === s[0] && i.label < o[1]) {
i.label = o[1], o = s;
break;
}
if (o && i.label < o[2]) {
i.label = o[2], i.ops.push(s);
break;
}
o[2] && i.ops.pop(), i.trys.pop();
continue;
}
s = t.call(e, i);
} catch (e) {
s = [6, e], n = 0;
} finally {
r = o = 0;
}
if (5 & s[0]) throw s[1];
return {
value: s[0] ? s[1] : void 0,
done: !0
};
}([s, a]);
};
}
},
K = function (e) {
return this instanceof K ? (this.v = e, this) : new K(e);
},
q = function (e, t, r) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var n,
o = r.apply(e, t || []),
s = [];
return n = {}, i("next"), i("throw"), i("return"), n[Symbol.asyncIterator] = function () {
return this;
}, n;
function i(e) {
o[e] && (n[e] = function (t) {
return new Promise(function (r, n) {
s.push([e, t, r, n]) > 1 || a(e, t);
});
});
}
function a(e, t) {
try {
(r = o[e](t)).value instanceof K ? Promise.resolve(r.value.v).then(c, u) : l(s[0][2], r);
} catch (e) {
l(s[0][3], e);
}
var r;
}
function c(e) {
a("next", e);
}
function u(e) {
a("throw", e);
}
function l(e, t) {
e(t), s.shift(), s.length && a(s[0][0], s[0][1]);
}
};
function $(e) {
if (null == e) throw new Error("Assertion Failure: value must not be null nor undefined");
}
function V(e) {
return null != e[Symbol.asyncIterator] ? e : function (e) {
return q(this, arguments, function () {
var t, r, n, o;
return G(this, function (s) {
switch (s.label) {
case 0:
t = e.getReader(), s.label = 1;
case 1:
s.trys.push([1,, 9, 10]), s.label = 2;
case 2:
return [4, K(t.read())];
case 3:
return r = s.sent(), n = r.done, o = r.value, n ? [4, K(void 0)] : [3, 5];
case 4:
return [2, s.sent()];
case 5:
return $(o), [4, K(o)];
case 6:
return [4, s.sent()];
case 7:
return s.sent(), [3, 2];
case 8:
return [3, 10];
case 9:
return t.releaseLock(), [7];
case 10:
return [2];
}
});
});
}(e);
}
function W(e, t) {
return void 0 === t && (t = M), function (e, t, r, n) {
return new (r || (r = Promise))(function (o, s) {
function i(e) {
try {
c(n.next(e));
} catch (e) {
s(e);
}
}
function a(e) {
try {
c(n.throw(e));
} catch (e) {
s(e);
}
}
function c(e) {
var t;
e.done ? o(e.value) : (t = e.value, t instanceof r ? t : new r(function (e) {
e(t);
})).then(i, a);
}
c((n = n.apply(e, t || [])).next());
});
}(this, void 0, void 0, function () {
var r;
return function (e, t) {
var r,
n,
o,
s,
i = {
label: 0,
sent: function () {
if (1 & o[0]) throw o[1];
return o[1];
},
trys: [],
ops: []
};
return s = {
next: a(0),
throw: a(1),
return: a(2)
}, "function" == typeof Symbol && (s[Symbol.iterator] = function () {
return this;
}), s;
function a(s) {
return function (a) {
return function (s) {
if (r) throw new TypeError("Generator is already executing.");
for (; i;) try {
if (r = 1, n && (o = 2 & s[0] ? n.return : s[0] ? n.throw || ((o = n.return) && o.call(n), 0) : n.next) && !(o = o.call(n, s[1])).done) return o;
switch (n = 0, o && (s = [2 & s[0], o.value]), s[0]) {
case 0:
case 1:
o = s;
break;
case 4:
return i.label++, {
value: s[1],
done: !1
};
case 5:
i.label++, n = s[1], s = [0];
continue;
case 7:
s = i.ops.pop(), i.trys.pop();
continue;
default:
if (!((o = (o = i.trys).length > 0 && o[o.length - 1]) || 6 !== s[0] && 2 !== s[0])) {
i = 0;
continue;
}
if (3 === s[0] && (!o || s[1] > o[0] && s[1] < o[3])) {
i.label = s[1];
break;
}
if (6 === s[0] && i.label < o[1]) {
i.label = o[1], o = s;
break;
}
if (o && i.label < o[2]) {
i.label = o[2], i.ops.push(s);
break;
}
o[2] && i.ops.pop(), i.trys.pop();
continue;
}
s = t.call(e, i);
} catch (e) {
s = [6, e], n = 0;
} finally {
r = o = 0;
}
if (5 & s[0]) throw s[1];
return {
value: s[0] ? s[1] : void 0,
done: !0
};
}([s, a]);
};
}
}(this, function (n) {
return r = V(e), [2, new z(t.extensionCodec, t.context, t.maxStrLength, t.maxBinLength, t.maxArrayLength, t.maxMapLength, t.maxExtLength).decodeAsync(r)];
});
});
}
function X(e, t) {
void 0 === t && (t = M);
var r = V(e);
return new z(t.extensionCodec, t.context, t.maxStrLength, t.maxBinLength, t.maxArrayLength, t.maxMapLength, t.maxExtLength).decodeArrayStream(r);
}
function Y(e, t) {
void 0 === t && (t = M);
var r = V(e);
return new z(t.extensionCodec, t.context, t.maxStrLength, t.maxBinLength, t.maxArrayLength, t.maxMapLength, t.maxExtLength).decodeStream(r);
}
}]);
},
5155: (e, t) => {
"use strict";
t.byteLength = function (e) {
var t = c(e),
r = t[0],
n = t[1];
return 3 * (r + n) / 4 - n;
}, t.toByteArray = function (e) {
var t,
r,
s = c(e),
i = s[0],
a = s[1],
u = new o(function (e, t, r) {
return 3 * (t + r) / 4 - r;
}(0, i, a)),
l = 0,
h = a > 0 ? i - 4 : i;
for (r = 0; r < h; r += 4) t = n[e.charCodeAt(r)] << 18 | n[e.charCodeAt(r + 1)] << 12 | n[e.charCodeAt(r + 2)] << 6 | n[e.charCodeAt(r + 3)], u[l++] = t >> 16 & 255, u[l++] = t >> 8 & 255, u[l++] = 255 & t;
return 2 === a && (t = n[e.charCodeAt(r)] << 2 | n[e.charCodeAt(r + 1)] >> 4, u[l++] = 255 & t), 1 === a && (t = n[e.charCodeAt(r)] << 10 | n[e.charCodeAt(r + 1)] << 4 | n[e.charCodeAt(r + 2)] >> 2, u[l++] = t >> 8 & 255, u[l++] = 255 & t), u;
}, t.fromByteArray = function (e) {
for (var t, n = e.length, o = n % 3, s = [], i = 16383, a = 0, c = n - o; a < c; a += i) s.push(u(e, a, a + i > c ? c : a + i));
return 1 === o ? (t = e[n - 1], s.push(r[t >> 2] + r[t << 4 & 63] + "==")) : 2 === o && (t = (e[n - 2] << 8) + e[n - 1], s.push(r[t >> 10] + r[t >> 4 & 63] + r[t << 2 & 63] + "=")), s.join("");
};
for (var r = [], n = [], o = "undefined" != typeof Uint8Array ? Uint8Array : Array, s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = 0, a = s.length; i < a; ++i) r[i] = s[i], n[s.charCodeAt(i)] = i;
function c(e) {
var t = e.length;
if (t % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
var r = e.indexOf("=");
return -1 === r && (r = t), [r, r === t ? 0 : 4 - r % 4];
}
function u(e, t, n) {
for (var o, s, i = [], a = t; a < n; a += 3) o = (e[a] << 16 & 16711680) + (e[a + 1] << 8 & 65280) + (255 & e[a + 2]), i.push(r[(s = o) >> 18 & 63] + r[s >> 12 & 63] + r[s >> 6 & 63] + r[63 & s]);
return i.join("");
}
n["-".charCodeAt(0)] = 62, n["_".charCodeAt(0)] = 63;
},
5117: function (e, t, r) {
var n;
!function (o) {
"use strict";
var s,
i = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,
a = Math.ceil,
c = Math.floor,
u = "[BigNumber Error] ",
l = u + "Number primitive has more than 15 significant digits: ",
h = 1e14,
p = 14,
f = 9007199254740991,
d = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],
g = 1e7,
y = 1e9;
function m(e) {
var t = 0 | e;
return e > 0 || e === t ? t : t - 1;
}
function b(e) {
for (var t, r, n = 1, o = e.length, s = e[0] + ""; n < o;) {
for (t = e[n++] + "", r = p - t.length; r--; t = "0" + t);
s += t;
}
for (o = s.length; 48 === s.charCodeAt(--o););
return s.slice(0, o + 1 || 1);
}
function w(e, t) {
var r,
n,
o = e.c,
s = t.c,
i = e.s,
a = t.s,
c = e.e,
u = t.e;
if (!i || !a) return null;
if (r = o && !o[0], n = s && !s[0], r || n) return r ? n ? 0 : -a : i;
if (i != a) return i;
if (r = i < 0, n = c == u, !o || !s) return n ? 0 : !o ^ r ? 1 : -1;
if (!n) return c > u ^ r ? 1 : -1;
for (a = (c = o.length) < (u = s.length) ? c : u, i = 0; i < a; i++) if (o[i] != s[i]) return o[i] > s[i] ^ r ? 1 : -1;
return c == u ? 0 : c > u ^ r ? 1 : -1;
}
function A(e, t, r, n) {
if (e < t || e > r || e !== c(e)) throw Error(u + (n || "Argument") + ("number" == typeof e ? e < t || e > r ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(e));
}
function v(e) {
var t = e.c.length - 1;
return m(e.e / p) == t && e.c[t] % 2 != 0;
}
function x(e, t) {
return (e.length > 1 ? e.charAt(0) + "." + e.slice(1) : e) + (t < 0 ? "e" : "e+") + t;
}
function S(e, t, r) {
var n, o;
if (t < 0) {
for (o = r + "."; ++t; o += r);
e = o + e;
} else if (++t > (n = e.length)) {
for (o = r, t -= n; --t; o += r);
e += o;
} else t < n && (e = e.slice(0, t) + "." + e.slice(t));
return e;
}
(s = function e(t) {
var r,
n,
o,
s,
E,
T,
_,
B,
k,
I,
U = G.prototype = {
constructor: G,
toString: null,
valueOf: null
},
C = new G(1),
R = 20,
O = 4,
D = -7,
N = 21,
P = -1e7,
L = 1e7,
F = !1,
j = 1,
z = 0,
M = {
prefix: "",
groupSize: 3,
secondaryGroupSize: 0,
groupSeparator: ",",
decimalSeparator: ".",
fractionGroupSize: 0,
fractionGroupSeparator: " ",
suffix: ""
},
H = "0123456789abcdefghijklmnopqrstuvwxyz";
function G(e, t) {
var r,
s,
a,
u,
h,
d,
g,
y,
m = this;
if (!(m instanceof G)) return new G(e, t);
if (null == t) {
if (e && !0 === e._isBigNumber) return m.s = e.s, void (!e.c || e.e > L ? m.c = m.e = null : e.e < P ? m.c = [m.e = 0] : (m.e = e.e, m.c = e.c.slice()));
if ((d = "number" == typeof e) && 0 * e == 0) {
if (m.s = 1 / e < 0 ? (e = -e, -1) : 1, e === ~~e) {
for (u = 0, h = e; h >= 10; h /= 10, u++);
return void (u > L ? m.c = m.e = null : (m.e = u, m.c = [e]));
}
y = String(e);
} else {
if (!i.test(y = String(e))) return o(m, y, d);
m.s = 45 == y.charCodeAt(0) ? (y = y.slice(1), -1) : 1;
}
(u = y.indexOf(".")) > -1 && (y = y.replace(".", "")), (h = y.search(/e/i)) > 0 ? (u < 0 && (u = h), u += +y.slice(h + 1), y = y.substring(0, h)) : u < 0 && (u = y.length);
} else {
if (A(t, 2, H.length, "Base"), 10 == t) return V(m = new G(e), R + m.e + 1, O);
if (y = String(e), d = "number" == typeof e) {
if (0 * e != 0) return o(m, y, d, t);
if (m.s = 1 / e < 0 ? (y = y.slice(1), -1) : 1, G.DEBUG && y.replace(/^0\.0*|\./, "").length > 15) throw Error(l + e);
} else m.s = 45 === y.charCodeAt(0) ? (y = y.slice(1), -1) : 1;
for (r = H.slice(0, t), u = h = 0, g = y.length; h < g; h++) if (r.indexOf(s = y.charAt(h)) < 0) {
if ("." == s) {
if (h > u) {
u = g;
continue;
}
} else if (!a && (y == y.toUpperCase() && (y = y.toLowerCase()) || y == y.toLowerCase() && (y = y.toUpperCase()))) {
a = !0, h = -1, u = 0;
continue;
}
return o(m, String(e), d, t);
}
d = !1, (u = (y = n(y, t, 10, m.s)).indexOf(".")) > -1 ? y = y.replace(".", "") : u = y.length;
}
for (h = 0; 48 === y.charCodeAt(h); h++);
for (g = y.length; 48 === y.charCodeAt(--g););
if (y = y.slice(h, ++g)) {
if (g -= h, d && G.DEBUG && g > 15 && (e > f || e !== c(e))) throw Error(l + m.s * e);
if ((u = u - h - 1) > L) m.c = m.e = null;else if (u < P) m.c = [m.e = 0];else {
if (m.e = u, m.c = [], h = (u + 1) % p, u < 0 && (h += p), h < g) {
for (h && m.c.push(+y.slice(0, h)), g -= p; h < g;) m.c.push(+y.slice(h, h += p));
h = p - (y = y.slice(h)).length;
} else h -= g;
for (; h--; y += "0");
m.c.push(+y);
}
} else m.c = [m.e = 0];
}
function K(e, t, r, n) {
var o, s, i, a, c;
if (null == r ? r = O : A(r, 0, 8), !e.c) return e.toString();
if (o = e.c[0], i = e.e, null == t) c = b(e.c), c = 1 == n || 2 == n && (i <= D || i >= N) ? x(c, i) : S(c, i, "0");else if (s = (e = V(new G(e), t, r)).e, a = (c = b(e.c)).length, 1 == n || 2 == n && (t <= s || s <= D)) {
for (; a < t; c += "0", a++);
c = x(c, s);
} else if (t -= i, c = S(c, s, "0"), s + 1 > a) {
if (--t > 0) for (c += "."; t--; c += "0");
} else if ((t += s - a) > 0) for (s + 1 == a && (c += "."); t--; c += "0");
return e.s < 0 && o ? "-" + c : c;
}
function q(e, t) {
for (var r, n = 1, o = new G(e[0]); n < e.length; n++) {
if (!(r = new G(e[n])).s) {
o = r;
break;
}
t.call(o, r) && (o = r);
}
return o;
}
function $(e, t, r) {
for (var n = 1, o = t.length; !t[--o]; t.pop());
for (o = t[0]; o >= 10; o /= 10, n++);
return (r = n + r * p - 1) > L ? e.c = e.e = null : r < P ? e.c = [e.e = 0] : (e.e = r, e.c = t), e;
}
function V(e, t, r, n) {
var o,
s,
i,
u,
l,
f,
g,
y = e.c,
m = d;
if (y) {
e: {
for (o = 1, u = y[0]; u >= 10; u /= 10, o++);
if ((s = t - o) < 0) s += p, i = t, g = (l = y[f = 0]) / m[o - i - 1] % 10 | 0;else if ((f = a((s + 1) / p)) >= y.length) {
if (!n) break e;
for (; y.length <= f; y.push(0));
l = g = 0, o = 1, i = (s %= p) - p + 1;
} else {
for (l = u = y[f], o = 1; u >= 10; u /= 10, o++);
g = (i = (s %= p) - p + o) < 0 ? 0 : l / m[o - i - 1] % 10 | 0;
}
if (n = n || t < 0 || null != y[f + 1] || (i < 0 ? l : l % m[o - i - 1]), n = r < 4 ? (g || n) && (0 == r || r == (e.s < 0 ? 3 : 2)) : g > 5 || 5 == g && (4 == r || n || 6 == r && (s > 0 ? i > 0 ? l / m[o - i] : 0 : y[f - 1]) % 10 & 1 || r == (e.s < 0 ? 8 : 7)), t < 1 || !y[0]) return y.length = 0, n ? (t -= e.e + 1, y[0] = m[(p - t % p) % p], e.e = -t || 0) : y[0] = e.e = 0, e;
if (0 == s ? (y.length = f, u = 1, f--) : (y.length = f + 1, u = m[p - s], y[f] = i > 0 ? c(l / m[o - i] % m[i]) * u : 0), n) for (;;) {
if (0 == f) {
for (s = 1, i = y[0]; i >= 10; i /= 10, s++);
for (i = y[0] += u, u = 1; i >= 10; i /= 10, u++);
s != u && (e.e++, y[0] == h && (y[0] = 1));
break;
}
if (y[f] += u, y[f] != h) break;
y[f--] = 0, u = 1;
}
for (s = y.length; 0 === y[--s]; y.pop());
}
e.e > L ? e.c = e.e = null : e.e < P && (e.c = [e.e = 0]);
}
return e;
}
function W(e) {
var t,
r = e.e;
return null === r ? e.toString() : (t = b(e.c), t = r <= D || r >= N ? x(t, r) : S(t, r, "0"), e.s < 0 ? "-" + t : t);
}
return G.clone = e, G.ROUND_UP = 0, G.ROUND_DOWN = 1, G.ROUND_CEIL = 2, G.ROUND_FLOOR = 3, G.ROUND_HALF_UP = 4, G.ROUND_HALF_DOWN = 5, G.ROUND_HALF_EVEN = 6, G.ROUND_HALF_CEIL = 7, G.ROUND_HALF_FLOOR = 8, G.EUCLID = 9, G.config = G.set = function (e) {
var t, r;
if (null != e) {
if ("object" != typeof e) throw Error(u + "Object expected: " + e);
if (e.hasOwnProperty(t = "DECIMAL_PLACES") && (A(r = e[t], 0, y, t), R = r), e.hasOwnProperty(t = "ROUNDING_MODE") && (A(r = e[t], 0, 8, t), O = r), e.hasOwnProperty(t = "EXPONENTIAL_AT") && ((r = e[t]) && r.pop ? (A(r[0], -y, 0, t), A(r[1], 0, y, t), D = r[0], N = r[1]) : (A(r, -y, y, t), D = -(N = r < 0 ? -r : r))), e.hasOwnProperty(t = "RANGE")) if ((r = e[t]) && r.pop) A(r[0], -y, -1, t), A(r[1], 1, y, t), P = r[0], L = r[1];else {
if (A(r, -y, y, t), !r) throw Error(u + t + " cannot be zero: " + r);
P = -(L = r < 0 ? -r : r);
}
if (e.hasOwnProperty(t = "CRYPTO")) {
if ((r = e[t]) !== !!r) throw Error(u + t + " not true or false: " + r);
if (r) {
if ("undefined" == typeof crypto || !crypto || !crypto.getRandomValues && !crypto.randomBytes) throw F = !r, Error(u + "crypto unavailable");
F = r;
} else F = r;
}
if (e.hasOwnProperty(t = "MODULO_MODE") && (A(r = e[t], 0, 9, t), j = r), e.hasOwnProperty(t = "POW_PRECISION") && (A(r = e[t], 0, y, t), z = r), e.hasOwnProperty(t = "FORMAT")) {
if ("object" != typeof (r = e[t])) throw Error(u + t + " not an object: " + r);
M = r;
}
if (e.hasOwnProperty(t = "ALPHABET")) {
if ("string" != typeof (r = e[t]) || /^.?$|[+\-.\s]|(.).*\1/.test(r)) throw Error(u + t + " invalid: " + r);
H = r;
}
}
return {
DECIMAL_PLACES: R,
ROUNDING_MODE: O,
EXPONENTIAL_AT: [D, N],
RANGE: [P, L],
CRYPTO: F,
MODULO_MODE: j,
POW_PRECISION: z,
FORMAT: M,
ALPHABET: H
};
}, G.isBigNumber = function (e) {
if (!e || !0 !== e._isBigNumber) return !1;
if (!G.DEBUG) return !0;
var t,
r,
n = e.c,
o = e.e,
s = e.s;
e: if ("[object Array]" == {}.toString.call(n)) {
if ((1 === s || -1 === s) && o >= -y && o <= y && o === c(o)) {
if (0 === n[0]) {
if (0 === o && 1 === n.length) return !0;
break e;
}
if ((t = (o + 1) % p) < 1 && (t += p), String(n[0]).length == t) {
for (t = 0; t < n.length; t++) if ((r = n[t]) < 0 || r >= h || r !== c(r)) break e;
if (0 !== r) return !0;
}
}
} else if (null === n && null === o && (null === s || 1 === s || -1 === s)) return !0;
throw Error(u + "Invalid BigNumber: " + e);
}, G.maximum = G.max = function () {
return q(arguments, U.lt);
}, G.minimum = G.min = function () {
return q(arguments, U.gt);
}, G.random = (s = 9007199254740992, E = Math.random() * s & 2097151 ? function () {
return c(Math.random() * s);
} : function () {
return 8388608 * (1073741824 * Math.random() | 0) + (8388608 * Math.random() | 0);
}, function (e) {
var t,
r,
n,
o,
s,
i = 0,
l = [],
h = new G(C);
if (null == e ? e = R : A(e, 0, y), o = a(e / p), F) if (crypto.getRandomValues) {
for (t = crypto.getRandomValues(new Uint32Array(o *= 2)); i < o;) (s = 131072 * t[i] + (t[i + 1] >>> 11)) >= 9e15 ? (r = crypto.getRandomValues(new Uint32Array(2)), t[i] = r[0], t[i + 1] = r[1]) : (l.push(s % 1e14), i += 2);
i = o / 2;
} else {
if (!crypto.randomBytes) throw F = !1, Error(u + "crypto unavailable");
for (t = crypto.randomBytes(o *= 7); i < o;) (s = 281474976710656 * (31 & t[i]) + 1099511627776 * t[i + 1] + 4294967296 * t[i + 2] + 16777216 * t[i + 3] + (t[i + 4] << 16) + (t[i + 5] << 8) + t[i + 6]) >= 9e15 ? crypto.randomBytes(7).copy(t, i) : (l.push(s % 1e14), i += 7);
i = o / 7;
}
if (!F) for (; i < o;) (s = E()) < 9e15 && (l[i++] = s % 1e14);
for (o = l[--i], e %= p, o && e && (s = d[p - e], l[i] = c(o / s) * s); 0 === l[i]; l.pop(), i--);
if (i < 0) l = [n = 0];else {
for (n = -1; 0 === l[0]; l.splice(0, 1), n -= p);
for (i = 1, s = l[0]; s >= 10; s /= 10, i++);
i < p && (n -= p - i);
}
return h.e = n, h.c = l, h;
}), G.sum = function () {
for (var e = 1, t = arguments, r = new G(t[0]); e < t.length;) r = r.plus(t[e++]);
return r;
}, n = function () {
var e = "0123456789";
function t(e, t, r, n) {
for (var o, s, i = [0], a = 0, c = e.length; a < c;) {
for (s = i.length; s--; i[s] *= t);
for (i[0] += n.indexOf(e.charAt(a++)), o = 0; o < i.length; o++) i[o] > r - 1 && (null == i[o + 1] && (i[o + 1] = 0), i[o + 1] += i[o] / r | 0, i[o] %= r);
}
return i.reverse();
}
return function (n, o, s, i, a) {
var c,
u,
l,
h,
p,
f,
d,
g,
y = n.indexOf("."),
m = R,
w = O;
for (y >= 0 && (h = z, z = 0, n = n.replace(".", ""), f = (g = new G(o)).pow(n.length - y), z = h, g.c = t(S(b(f.c), f.e, "0"), 10, s, e), g.e = g.c.length), l = h = (d = t(n, o, s, a ? (c = H, e) : (c = e, H))).length; 0 == d[--h]; d.pop());
if (!d[0]) return c.charAt(0);
if (y < 0 ? --l : (f.c = d, f.e = l, f.s = i, d = (f = r(f, g, m, w, s)).c, p = f.r, l = f.e), y = d[u = l + m + 1], h = s / 2, p = p || u < 0 || null != d[u + 1], p = w < 4 ? (null != y || p) && (0 == w || w == (f.s < 0 ? 3 : 2)) : y > h || y == h && (4 == w || p || 6 == w && 1 & d[u - 1] || w == (f.s < 0 ? 8 : 7)), u < 1 || !d[0]) n = p ? S(c.charAt(1), -m, c.charAt(0)) : c.charAt(0);else {
if (d.length = u, p) for (--s; ++d[--u] > s;) d[u] = 0, u || (++l, d = [1].concat(d));
for (h = d.length; !d[--h];);
for (y = 0, n = ""; y <= h; n += c.charAt(d[y++]));
n = S(n, l, c.charAt(0));
}
return n;
};
}(), r = function () {
function e(e, t, r) {
var n,
o,
s,
i,
a = 0,
c = e.length,
u = t % g,
l = t / g | 0;
for (e = e.slice(); c--;) a = ((o = u * (s = e[c] % g) + (n = l * s + (i = e[c] / g | 0) * u) % g * g + a) / r | 0) + (n / g | 0) + l * i, e[c] = o % r;
return a && (e = [a].concat(e)), e;
}
function t(e, t, r, n) {
var o, s;
if (r != n) s = r > n ? 1 : -1;else for (o = s = 0; o < r; o++) if (e[o] != t[o]) {
s = e[o] > t[o] ? 1 : -1;
break;
}
return s;
}
function r(e, t, r, n) {
for (var o = 0; r--;) e[r] -= o, o = e[r] < t[r] ? 1 : 0, e[r] = o * n + e[r] - t[r];
for (; !e[0] && e.length > 1; e.splice(0, 1));
}
return function (n, o, s, i, a) {
var u,
l,
f,
d,
g,
y,
b,
w,
A,
v,
x,
S,
E,
T,
_,
B,
k,
I = n.s == o.s ? 1 : -1,
U = n.c,
C = o.c;
if (!(U && U[0] && C && C[0])) return new G(n.s && o.s && (U ? !C || U[0] != C[0] : C) ? U && 0 == U[0] || !C ? 0 * I : I / 0 : NaN);
for (A = (w = new G(I)).c = [], I = s + (l = n.e - o.e) + 1, a || (a = h, l = m(n.e / p) - m(o.e / p), I = I / p | 0), f = 0; C[f] == (U[f] || 0); f++);
if (C[f] > (U[f] || 0) && l--, I < 0) A.push(1), d = !0;else {
for (T = U.length, B = C.length, f = 0, I += 2, (g = c(a / (C[0] + 1))) > 1 && (C = e(C, g, a), U = e(U, g, a), B = C.length, T = U.length), E = B, x = (v = U.slice(0, B)).length; x < B; v[x++] = 0);
k = C.slice(), k = [0].concat(k), _ = C[0], C[1] >= a / 2 && _++;
do {
if (g = 0, (u = t(C, v, B, x)) < 0) {
if (S = v[0], B != x && (S = S * a + (v[1] || 0)), (g = c(S / _)) > 1) for (g >= a && (g = a - 1), b = (y = e(C, g, a)).length, x = v.length; 1 == t(y, v, b, x);) g--, r(y, B < b ? k : C, b, a), b = y.length, u = 1;else 0 == g && (u = g = 1), b = (y = C.slice()).length;
if (b < x && (y = [0].concat(y)), r(v, y, x, a), x = v.length, -1 == u) for (; t(C, v, B, x) < 1;) g++, r(v, B < x ? k : C, x, a), x = v.length;
} else 0 === u && (g++, v = [0]);
A[f++] = g, v[0] ? v[x++] = U[E] || 0 : (v = [U[E]], x = 1);
} while ((E++ < T || null != v[0]) && I--);
d = null != v[0], A[0] || A.splice(0, 1);
}
if (a == h) {
for (f = 1, I = A[0]; I >= 10; I /= 10, f++);
V(w, s + (w.e = f + l * p - 1) + 1, i, d);
} else w.e = l, w.r = +d;
return w;
};
}(), T = /^(-?)0([xbo])(?=\w[\w.]*$)/i, _ = /^([^.]+)\.$/, B = /^\.([^.]+)$/, k = /^-?(Infinity|NaN)$/, I = /^\s*\+(?=[\w.])|^\s+|\s+$/g, o = function (e, t, r, n) {
var o,
s = r ? t : t.replace(I, "");
if (k.test(s)) e.s = isNaN(s) ? null : s < 0 ? -1 : 1;else {
if (!r && (s = s.replace(T, function (e, t, r) {
return o = "x" == (r = r.toLowerCase()) ? 16 : "b" == r ? 2 : 8, n && n != o ? e : t;
}), n && (o = n, s = s.replace(_, "$1").replace(B, "0.$1")), t != s)) return new G(s, o);
if (G.DEBUG) throw Error(u + "Not a" + (n ? " base " + n : "") + " number: " + t);
e.s = null;
}
e.c = e.e = null;
}, U.absoluteValue = U.abs = function () {
var e = new G(this);
return e.s < 0 && (e.s = 1), e;
}, U.comparedTo = function (e, t) {
return w(this, new G(e, t));
}, U.decimalPlaces = U.dp = function (e, t) {
var r,
n,
o,
s = this;
if (null != e) return A(e, 0, y), null == t ? t = O : A(t, 0, 8), V(new G(s), e + s.e + 1, t);
if (!(r = s.c)) return null;
if (n = ((o = r.length - 1) - m(this.e / p)) * p, o = r[o]) for (; o % 10 == 0; o /= 10, n--);
return n < 0 && (n = 0), n;
}, U.dividedBy = U.div = function (e, t) {
return r(this, new G(e, t), R, O);
}, U.dividedToIntegerBy = U.idiv = function (e, t) {
return r(this, new G(e, t), 0, 1);
}, U.exponentiatedBy = U.pow = function (e, t) {
var r,
n,
o,
s,
i,
l,
h,
f,
d = this;
if ((e = new G(e)).c && !e.isInteger()) throw Error(u + "Exponent not an integer: " + W(e));
if (null != t && (t = new G(t)), i = e.e > 14, !d.c || !d.c[0] || 1 == d.c[0] && !d.e && 1 == d.c.length || !e.c || !e.c[0]) return f = new G(Math.pow(+W(d), i ? 2 - v(e) : +W(e))), t ? f.mod(t) : f;
if (l = e.s < 0, t) {
if (t.c ? !t.c[0] : !t.s) return new G(NaN);
(n = !l && d.isInteger() && t.isInteger()) && (d = d.mod(t));
} else {
if (e.e > 9 && (d.e > 0 || d.e < -1 || (0 == d.e ? d.c[0] > 1 || i && d.c[1] >= 24e7 : d.c[0] < 8e13 || i && d.c[0] <= 9999975e7))) return s = d.s < 0 && v(e) ? -0 : 0, d.e > -1 && (s = 1 / s), new G(l ? 1 / s : s);
z && (s = a(z / p + 2));
}
for (i ? (r = new G(.5), l && (e.s = 1), h = v(e)) : h = (o = Math.abs(+W(e))) % 2, f = new G(C);;) {
if (h) {
if (!(f = f.times(d)).c) break;
s ? f.c.length > s && (f.c.length = s) : n && (f = f.mod(t));
}
if (o) {
if (0 === (o = c(o / 2))) break;
h = o % 2;
} else if (V(e = e.times(r), e.e + 1, 1), e.e > 14) h = v(e);else {
if (0 == (o = +W(e))) break;
h = o % 2;
}
d = d.times(d), s ? d.c && d.c.length > s && (d.c.length = s) : n && (d = d.mod(t));
}
return n ? f : (l && (f = C.div(f)), t ? f.mod(t) : s ? V(f, z, O, void 0) : f);
}, U.integerValue = function (e) {
var t = new G(this);
return null == e ? e = O : A(e, 0, 8), V(t, t.e + 1, e);
}, U.isEqualTo = U.eq = function (e, t) {
return 0 === w(this, new G(e, t));
}, U.isFinite = function () {
return !!this.c;
}, U.isGreaterThan = U.gt = function (e, t) {
return w(this, new G(e, t)) > 0;
}, U.isGreaterThanOrEqualTo = U.gte = function (e, t) {
return 1 === (t = w(this, new G(e, t))) || 0 === t;
}, U.isInteger = function () {
return !!this.c && m(this.e / p) > this.c.length - 2;
}, U.isLessThan = U.lt = function (e, t) {
return w(this, new G(e, t)) < 0;
}, U.isLessThanOrEqualTo = U.lte = function (e, t) {
return -1 === (t = w(this, new G(e, t))) || 0 === t;
}, U.isNaN = function () {
return !this.s;
}, U.isNegative = function () {
return this.s < 0;
}, U.isPositive = function () {
return this.s > 0;
}, U.isZero = function () {
return !!this.c && 0 == this.c[0];
}, U.minus = function (e, t) {
var r,
n,
o,
s,
i = this,
a = i.s;
if (t = (e = new G(e, t)).s, !a || !t) return new G(NaN);
if (a != t) return e.s = -t, i.plus(e);
var c = i.e / p,
u = e.e / p,
l = i.c,
f = e.c;
if (!c || !u) {
if (!l || !f) return l ? (e.s = -t, e) : new G(f ? i : NaN);
if (!l[0] || !f[0]) return f[0] ? (e.s = -t, e) : new G(l[0] ? i : 3 == O ? -0 : 0);
}
if (c = m(c), u = m(u), l = l.slice(), a = c - u) {
for ((s = a < 0) ? (a = -a, o = l) : (u = c, o = f), o.reverse(), t = a; t--; o.push(0));
o.reverse();
} else for (n = (s = (a = l.length) < (t = f.length)) ? a : t, a = t = 0; t < n; t++) if (l[t] != f[t]) {
s = l[t] < f[t];
break;
}
if (s && (o = l, l = f, f = o, e.s = -e.s), (t = (n = f.length) - (r = l.length)) > 0) for (; t--; l[r++] = 0);
for (t = h - 1; n > a;) {
if (l[--n] < f[n]) {
for (r = n; r && !l[--r]; l[r] = t);
--l[r], l[n] += h;
}
l[n] -= f[n];
}
for (; 0 == l[0]; l.splice(0, 1), --u);
return l[0] ? $(e, l, u) : (e.s = 3 == O ? -1 : 1, e.c = [e.e = 0], e);
}, U.modulo = U.mod = function (e, t) {
var n,
o,
s = this;
return e = new G(e, t), !s.c || !e.s || e.c && !e.c[0] ? new G(NaN) : !e.c || s.c && !s.c[0] ? new G(s) : (9 == j ? (o = e.s, e.s = 1, n = r(s, e, 0, 3), e.s = o, n.s *= o) : n = r(s, e, 0, j), (e = s.minus(n.times(e))).c[0] || 1 != j || (e.s = s.s), e);
}, U.multipliedBy = U.times = function (e, t) {
var r,
n,
o,
s,
i,
a,
c,
u,
l,
f,
d,
y,
b,
w,
A,
v = this,
x = v.c,
S = (e = new G(e, t)).c;
if (!(x && S && x[0] && S[0])) return !v.s || !e.s || x && !x[0] && !S || S && !S[0] && !x ? e.c = e.e = e.s = null : (e.s *= v.s, x && S ? (e.c = [0], e.e = 0) : e.c = e.e = null), e;
for (n = m(v.e / p) + m(e.e / p), e.s *= v.s, (c = x.length) < (f = S.length) && (b = x, x = S, S = b, o = c, c = f, f = o), o = c + f, b = []; o--; b.push(0));
for (w = h, A = g, o = f; --o >= 0;) {
for (r = 0, d = S[o] % A, y = S[o] / A | 0, s = o + (i = c); s > o;) r = ((u = d * (u = x[--i] % A) + (a = y * u + (l = x[i] / A | 0) * d) % A * A + b[s] + r) / w | 0) + (a / A | 0) + y * l, b[s--] = u % w;
b[s] = r;
}
return r ? ++n : b.splice(0, 1), $(e, b, n);
}, U.negated = function () {
var e = new G(this);
return e.s = -e.s || null, e;
}, U.plus = function (e, t) {
var r,
n = this,
o = n.s;
if (t = (e = new G(e, t)).s, !o || !t) return new G(NaN);
if (o != t) return e.s = -t, n.minus(e);
var s = n.e / p,
i = e.e / p,
a = n.c,
c = e.c;
if (!s || !i) {
if (!a || !c) return new G(o / 0);
if (!a[0] || !c[0]) return c[0] ? e : new G(a[0] ? n : 0 * o);
}
if (s = m(s), i = m(i), a = a.slice(), o = s - i) {
for (o > 0 ? (i = s, r = c) : (o = -o, r = a), r.reverse(); o--; r.push(0));
r.reverse();
}
for ((o = a.length) - (t = c.length) < 0 && (r = c, c = a, a = r, t = o), o = 0; t;) o = (a[--t] = a[t] + c[t] + o) / h | 0, a[t] = h === a[t] ? 0 : a[t] % h;
return o && (a = [o].concat(a), ++i), $(e, a, i);
}, U.precision = U.sd = function (e, t) {
var r,
n,
o,
s = this;
if (null != e && e !== !!e) return A(e, 1, y), null == t ? t = O : A(t, 0, 8), V(new G(s), e, t);
if (!(r = s.c)) return null;
if (n = (o = r.length - 1) * p + 1, o = r[o]) {
for (; o % 10 == 0; o /= 10, n--);
for (o = r[0]; o >= 10; o /= 10, n++);
}
return e && s.e + 1 > n && (n = s.e + 1), n;
}, U.shiftedBy = function (e) {
return A(e, -9007199254740991, f), this.times("1e" + e);
}, U.squareRoot = U.sqrt = function () {
var e,
t,
n,
o,
s,
i = this,
a = i.c,
c = i.s,
u = i.e,
l = R + 4,
h = new G("0.5");
if (1 !== c || !a || !a[0]) return new G(!c || c < 0 && (!a || a[0]) ? NaN : a ? i : 1 / 0);
if (0 == (c = Math.sqrt(+W(i))) || c == 1 / 0 ? (((t = b(a)).length + u) % 2 == 0 && (t += "0"), c = Math.sqrt(+t), u = m((u + 1) / 2) - (u < 0 || u % 2), n = new G(t = c == 1 / 0 ? "5e" + u : (t = c.toExponential()).slice(0, t.indexOf("e") + 1) + u)) : n = new G(c + ""), n.c[0]) for ((c = (u = n.e) + l) < 3 && (c = 0);;) if (s = n, n = h.times(s.plus(r(i, s, l, 1))), b(s.c).slice(0, c) === (t = b(n.c)).slice(0, c)) {
if (n.e < u && --c, "9999" != (t = t.slice(c - 3, c + 1)) && (o || "4999" != t)) {
+t && (+t.slice(1) || "5" != t.charAt(0)) || (V(n, n.e + R + 2, 1), e = !n.times(n).eq(i));
break;
}
if (!o && (V(s, s.e + R + 2, 0), s.times(s).eq(i))) {
n = s;
break;
}
l += 4, c += 4, o = 1;
}
return V(n, n.e + R + 1, O, e);
}, U.toExponential = function (e, t) {
return null != e && (A(e, 0, y), e++), K(this, e, t, 1);
}, U.toFixed = function (e, t) {
return null != e && (A(e, 0, y), e = e + this.e + 1), K(this, e, t);
}, U.toFormat = function (e, t, r) {
var n,
o = this;
if (null == r) null != e && t && "object" == typeof t ? (r = t, t = null) : e && "object" == typeof e ? (r = e, e = t = null) : r = M;else if ("object" != typeof r) throw Error(u + "Argument not an object: " + r);
if (n = o.toFixed(e, t), o.c) {
var s,
i = n.split("."),
a = +r.groupSize,
c = +r.secondaryGroupSize,
l = r.groupSeparator || "",
h = i[0],
p = i[1],
f = o.s < 0,
d = f ? h.slice(1) : h,
g = d.length;
if (c && (s = a, a = c, c = s, g -= s), a > 0 && g > 0) {
for (s = g % a || a, h = d.substr(0, s); s < g; s += a) h += l + d.substr(s, a);
c > 0 && (h += l + d.slice(s)), f && (h = "-" + h);
}
n = p ? h + (r.decimalSeparator || "") + ((c = +r.fractionGroupSize) ? p.replace(new RegExp("\\d{" + c + "}\\B", "g"), "$&" + (r.fractionGroupSeparator || "")) : p) : h;
}
return (r.prefix || "") + n + (r.suffix || "");
}, U.toFraction = function (e) {
var t,
n,
o,
s,
i,
a,
c,
l,
h,
f,
g,
y,
m = this,
w = m.c;
if (null != e && (!(c = new G(e)).isInteger() && (c.c || 1 !== c.s) || c.lt(C))) throw Error(u + "Argument " + (c.isInteger() ? "out of range: " : "not an integer: ") + W(c));
if (!w) return new G(m);
for (t = new G(C), h = n = new G(C), o = l = new G(C), y = b(w), i = t.e = y.length - m.e - 1, t.c[0] = d[(a = i % p) < 0 ? p + a : a], e = !e || c.comparedTo(t) > 0 ? i > 0 ? t : h : c, a = L, L = 1 / 0, c = new G(y), l.c[0] = 0; f = r(c, t, 0, 1), 1 != (s = n.plus(f.times(o))).comparedTo(e);) n = o, o = s, h = l.plus(f.times(s = h)), l = s, t = c.minus(f.times(s = t)), c = s;
return s = r(e.minus(n), o, 0, 1), l = l.plus(s.times(h)), n = n.plus(s.times(o)), l.s = h.s = m.s, g = r(h, o, i *= 2, O).minus(m).abs().comparedTo(r(l, n, i, O).minus(m).abs()) < 1 ? [h, o] : [l, n], L = a, g;
}, U.toNumber = function () {
return +W(this);
}, U.toPrecision = function (e, t) {
return null != e && A(e, 1, y), K(this, e, t, 2);
}, U.toString = function (e) {
var t,
r = this,
o = r.s,
s = r.e;
return null === s ? o ? (t = "Infinity", o < 0 && (t = "-" + t)) : t = "NaN" : (null == e ? t = s <= D || s >= N ? x(b(r.c), s) : S(b(r.c), s, "0") : 10 === e ? t = S(b((r = V(new G(r), R + s + 1, O)).c), r.e, "0") : (A(e, 2, H.length, "Base"), t = n(S(b(r.c), s, "0"), 10, e, o, !0)), o < 0 && r.c[0] && (t = "-" + t)), t;
}, U.valueOf = U.toJSON = function () {
return W(this);
}, U._isBigNumber = !0, null != t && G.set(t), G;
}()).default = s.BigNumber = s, void 0 === (n = function () {
return s;
}.call(t, r, t, e)) || (e.exports = n);
}();
},
2486: (e, t, r) => {
"use strict";
const n = r(5155),
o = r(4525),
s = "function" == typeof Symbol && "function" == typeof Symbol.for ? Symbol.for("nodejs.util.inspect.custom") : null;
t.Buffer = c, t.SlowBuffer = function (e) {
return +e != e && (e = 0), c.alloc(+e);
}, t.INSPECT_MAX_BYTES = 50;
const i = 2147483647;
function a(e) {
if (e > i) throw new RangeError('The value "' + e + '" is invalid for option "size"');
const t = new Uint8Array(e);
return Object.setPrototypeOf(t, c.prototype), t;
}
function c(e, t, r) {
if ("number" == typeof e) {
if ("string" == typeof t) throw new TypeError('The "string" argument must be of type string. Received type number');
return h(e);
}
return u(e, t, r);
}
function u(e, t, r) {
if ("string" == typeof e) return function (e, t) {
if ("string" == typeof t && "" !== t || (t = "utf8"), !c.isEncoding(t)) throw new TypeError("Unknown encoding: " + t);
const r = 0 | g(e, t);
let n = a(r);
const o = n.write(e, t);
return o !== r && (n = n.slice(0, o)), n;
}(e, t);
if (ArrayBuffer.isView(e)) return function (e) {
if (X(e, Uint8Array)) {
const t = new Uint8Array(e);
return f(t.buffer, t.byteOffset, t.byteLength);
}
return p(e);
}(e);
if (null == e) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e);
if (X(e, ArrayBuffer) || e && X(e.buffer, ArrayBuffer)) return f(e, t, r);
if ("undefined" != typeof SharedArrayBuffer && (X(e, SharedArrayBuffer) || e && X(e.buffer, SharedArrayBuffer))) return f(e, t, r);
if ("number" == typeof e) throw new TypeError('The "value" argument must not be of type number. Received type number');
const n = e.valueOf && e.valueOf();
if (null != n && n !== e) return c.from(n, t, r);
const o = function (e) {
if (c.isBuffer(e)) {
const t = 0 | d(e.length),
r = a(t);
return 0 === r.length || e.copy(r, 0, 0, t), r;
}
return void 0 !== e.length ? "number" != typeof e.length || Y(e.length) ? a(0) : p(e) : "Buffer" === e.type && Array.isArray(e.data) ? p(e.data) : void 0;
}(e);
if (o) return o;
if ("undefined" != typeof Symbol && null != Symbol.toPrimitive && "function" == typeof e[Symbol.toPrimitive]) return c.from(e[Symbol.toPrimitive]("string"), t, r);
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e);
}
function l(e) {
if ("number" != typeof e) throw new TypeError('"size" argument must be of type number');
if (e < 0) throw new RangeError('The value "' + e + '" is invalid for option "size"');
}
function h(e) {
return l(e), a(e < 0 ? 0 : 0 | d(e));
}
function p(e) {
const t = e.length < 0 ? 0 : 0 | d(e.length),
r = a(t);
for (let n = 0; n < t; n += 1) r[n] = 255 & e[n];
return r;
}
function f(e, t, r) {
if (t < 0 || e.byteLength < t) throw new RangeError('"offset" is outside of buffer bounds');
if (e.byteLength < t + (r || 0)) throw new RangeError('"length" is outside of buffer bounds');
let n;
return n = void 0 === t && void 0 === r ? new Uint8Array(e) : void 0 === r ? new Uint8Array(e, t) : new Uint8Array(e, t, r), Object.setPrototypeOf(n, c.prototype), n;
}
function d(e) {
if (e >= i) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i.toString(16) + " bytes");
return 0 | e;
}
function g(e, t) {
if (c.isBuffer(e)) return e.length;
if (ArrayBuffer.isView(e) || X(e, ArrayBuffer)) return e.byteLength;
if ("string" != typeof e) throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof e);
const r = e.length,
n = arguments.length > 2 && !0 === arguments[2];
if (!n && 0 === r) return 0;
let o = !1;
for (;;) switch (t) {
case "ascii":
case "latin1":
case "binary":
return r;
case "utf8":
case "utf-8":
return $(e).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return 2 * r;
case "hex":
return r >>> 1;
case "base64":
return V(e).length;
default:
if (o) return n ? -1 : $(e).length;
t = ("" + t).toLowerCase(), o = !0;
}
}
function y(e, t, r) {
let 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 U(this, t, r);
case "utf8":
case "utf-8":
return _(this, t, r);
case "ascii":
return k(this, t, r);
case "latin1":
case "binary":
return I(this, t, r);
case "base64":
return T(this, t, r);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return C(this, t, r);
default:
if (n) throw new TypeError("Unknown encoding: " + e);
e = (e + "").toLowerCase(), n = !0;
}
}
function m(e, t, r) {
const n = e[t];
e[t] = e[r], e[r] = n;
}
function b(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), Y(r = +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 = c.from(t, n)), c.isBuffer(t)) return 0 === t.length ? -1 : w(e, t, r, n, o);
if ("number" == typeof t) return t &= 255, "function" == typeof Uint8Array.prototype.indexOf ? o ? Uint8Array.prototype.indexOf.call(e, t, r) : Uint8Array.prototype.lastIndexOf.call(e, t, r) : w(e, [t], r, n, o);
throw new TypeError("val must be string, number or Buffer");
}
function w(e, t, r, n, o) {
let s,
i = 1,
a = e.length,
c = 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;
i = 2, a /= 2, c /= 2, r /= 2;
}
function u(e, t) {
return 1 === i ? e[t] : e.readUInt16BE(t * i);
}
if (o) {
let n = -1;
for (s = r; s < a; s++) if (u(e, s) === u(t, -1 === n ? 0 : s - n)) {
if (-1 === n && (n = s), s - n + 1 === c) return n * i;
} else -1 !== n && (s -= s - n), n = -1;
} else for (r + c > a && (r = a - c), s = r; s >= 0; s--) {
let r = !0;
for (let n = 0; n < c; n++) if (u(e, s + n) !== u(t, n)) {
r = !1;
break;
}
if (r) return s;
}
return -1;
}
function A(e, t, r, n) {
r = Number(r) || 0;
const o = e.length - r;
n ? (n = Number(n)) > o && (n = o) : n = o;
const s = t.length;
let i;
for (n > s / 2 && (n = s / 2), i = 0; i < n; ++i) {
const n = parseInt(t.substr(2 * i, 2), 16);
if (Y(n)) return i;
e[r + i] = n;
}
return i;
}
function v(e, t, r, n) {
return W($(t, e.length - r), e, r, n);
}
function x(e, t, r, n) {
return W(function (e) {
const t = [];
for (let r = 0; r < e.length; ++r) t.push(255 & e.charCodeAt(r));
return t;
}(t), e, r, n);
}
function S(e, t, r, n) {
return W(V(t), e, r, n);
}
function E(e, t, r, n) {
return W(function (e, t) {
let r, n, o;
const s = [];
for (let i = 0; i < e.length && !((t -= 2) < 0); ++i) r = e.charCodeAt(i), n = r >> 8, o = r % 256, s.push(o), s.push(n);
return s;
}(t, e.length - r), e, r, n);
}
function T(e, t, r) {
return 0 === t && r === e.length ? n.fromByteArray(e) : n.fromByteArray(e.slice(t, r));
}
function _(e, t, r) {
r = Math.min(e.length, r);
const n = [];
let o = t;
for (; o < r;) {
const t = e[o];
let s = null,
i = t > 239 ? 4 : t > 223 ? 3 : t > 191 ? 2 : 1;
if (o + i <= r) {
let r, n, a, c;
switch (i) {
case 1:
t < 128 && (s = t);
break;
case 2:
r = e[o + 1], 128 == (192 & r) && (c = (31 & t) << 6 | 63 & r, c > 127 && (s = c));
break;
case 3:
r = e[o + 1], n = e[o + 2], 128 == (192 & r) && 128 == (192 & n) && (c = (15 & t) << 12 | (63 & r) << 6 | 63 & n, c > 2047 && (c < 55296 || c > 57343) && (s = c));
break;
case 4:
r = e[o + 1], n = e[o + 2], a = e[o + 3], 128 == (192 & r) && 128 == (192 & n) && 128 == (192 & a) && (c = (15 & t) << 18 | (63 & r) << 12 | (63 & n) << 6 | 63 & a, c > 65535 && c < 1114112 && (s = c));
}
}
null === s ? (s = 65533, i = 1) : s > 65535 && (s -= 65536, n.push(s >>> 10 & 1023 | 55296), s = 56320 | 1023 & s), n.push(s), o += i;
}
return function (e) {
const t = e.length;
if (t <= B) return String.fromCharCode.apply(String, e);
let r = "",
n = 0;
for (; n < t;) r += String.fromCharCode.apply(String, e.slice(n, n += B));
return r;
}(n);
}
t.kMaxLength = i, c.TYPED_ARRAY_SUPPORT = function () {
try {
const e = new Uint8Array(1),
t = {
foo: function () {
return 42;
}
};
return Object.setPrototypeOf(t, Uint8Array.prototype), Object.setPrototypeOf(e, t), 42 === e.foo();
} catch (e) {
return !1;
}
}(), c.TYPED_ARRAY_SUPPORT || "undefined" == typeof console || "function" != typeof console.error || console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."), Object.defineProperty(c.prototype, "parent", {
enumerable: !0,
get: function () {
if (c.isBuffer(this)) return this.buffer;
}
}), Object.defineProperty(c.prototype, "offset", {
enumerable: !0,
get: function () {
if (c.isBuffer(this)) return this.byteOffset;
}
}), c.poolSize = 8192, c.from = function (e, t, r) {
return u(e, t, r);
}, Object.setPrototypeOf(c.prototype, Uint8Array.prototype), Object.setPrototypeOf(c, Uint8Array), c.alloc = function (e, t, r) {
return function (e, t, r) {
return l(e), e <= 0 ? a(e) : void 0 !== t ? "string" == typeof r ? a(e).fill(t, r) : a(e).fill(t) : a(e);
}(e, t, r);
}, c.allocUnsafe = function (e) {
return h(e);
}, c.allocUnsafeSlow = function (e) {
return h(e);
}, c.isBuffer = function (e) {
return null != e && !0 === e._isBuffer && e !== c.prototype;
}, c.compare = function (e, t) {
if (X(e, Uint8Array) && (e = c.from(e, e.offset, e.byteLength)), X(t, Uint8Array) && (t = c.from(t, t.offset, t.byteLength)), !c.isBuffer(e) || !c.isBuffer(t)) throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
if (e === t) return 0;
let r = e.length,
n = t.length;
for (let o = 0, s = Math.min(r, n); o < s; ++o) if (e[o] !== t[o]) {
r = e[o], n = t[o];
break;
}
return r < n ? -1 : n < r ? 1 : 0;
}, c.isEncoding = function (e) {
switch (String(e).toLowerCase()) {
case "hex":
case "utf8":
case "utf-8":
case "ascii":
case "latin1":
case "binary":
case "base64":
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return !0;
default:
return !1;
}
}, c.concat = function (e, t) {
if (!Array.isArray(e)) throw new TypeError('"list" argument must be an Array of Buffers');
if (0 === e.length) return c.alloc(0);
let r;
if (void 0 === t) for (t = 0, r = 0; r < e.length; ++r) t += e[r].length;
const n = c.allocUnsafe(t);
let o = 0;
for (r = 0; r < e.length; ++r) {
let t = e[r];
if (X(t, Uint8Array)) o + t.length > n.length ? (c.isBuffer(t) || (t = c.from(t)), t.copy(n, o)) : Uint8Array.prototype.set.call(n, t, o);else {
if (!c.isBuffer(t)) throw new TypeError('"list" argument must be an Array of Buffers');
t.copy(n, o);
}
o += t.length;
}
return n;
}, c.byteLength = g, c.prototype._isBuffer = !0, c.prototype.swap16 = function () {
const e = this.length;
if (e % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
for (let t = 0; t < e; t += 2) m(this, t, t + 1);
return this;
}, c.prototype.swap32 = function () {
const e = this.length;
if (e % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
for (let t = 0; t < e; t += 4) m(this, t, t + 3), m(this, t + 1, t + 2);
return this;
}, c.prototype.swap64 = function () {
const e = this.length;
if (e % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
for (let t = 0; t < e; t += 8) m(this, t, t + 7), m(this, t + 1, t + 6), m(this, t + 2, t + 5), m(this, t + 3, t + 4);
return this;
}, c.prototype.toString = function () {
const e = this.length;
return 0 === e ? "" : 0 === arguments.length ? _(this, 0, e) : y.apply(this, arguments);
}, c.prototype.toLocaleString = c.prototype.toString, c.prototype.equals = function (e) {
if (!c.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
return this === e || 0 === c.compare(this, e);
}, c.prototype.inspect = function () {
let e = "";
const r = t.INSPECT_MAX_BYTES;
return e = this.toString("hex", 0, r).replace(/(.{2})/g, "$1 ").trim(), this.length > r && (e += " ... "), "<Buffer " + e + ">";
}, s && (c.prototype[s] = c.prototype.inspect), c.prototype.compare = function (e, t, r, n, o) {
if (X(e, Uint8Array) && (e = c.from(e, e.offset, e.byteLength)), !c.isBuffer(e)) throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof e);
if (void 0 === t && (t = 0), void 0 === r && (r = e ? e.length : 0), void 0 === n && (n = 0), void 0 === 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;
let s = (o >>>= 0) - (n >>>= 0),
i = (r >>>= 0) - (t >>>= 0);
const a = Math.min(s, i),
u = this.slice(n, o),
l = e.slice(t, r);
for (let e = 0; e < a; ++e) if (u[e] !== l[e]) {
s = u[e], i = l[e];
break;
}
return s < i ? -1 : i < s ? 1 : 0;
}, c.prototype.includes = function (e, t, r) {
return -1 !== this.indexOf(e, t, r);
}, c.prototype.indexOf = function (e, t, r) {
return b(this, e, t, r, !0);
}, c.prototype.lastIndexOf = function (e, t, r) {
return b(this, e, t, r, !1);
}, c.prototype.write = function (e, t, r, n) {
if (void 0 === t) n = "utf8", r = this.length, t = 0;else if (void 0 === r && "string" == typeof t) n = t, r = this.length, t = 0;else {
if (!isFinite(t)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
t >>>= 0, isFinite(r) ? (r >>>= 0, void 0 === n && (n = "utf8")) : (n = r, r = void 0);
}
const o = this.length - t;
if ((void 0 === r || r > o) && (r = o), e.length > 0 && (r < 0 || t < 0) || t > this.length) throw new RangeError("Attempt to write outside buffer bounds");
n || (n = "utf8");
let s = !1;
for (;;) switch (n) {
case "hex":
return A(this, e, t, r);
case "utf8":
case "utf-8":
return v(this, e, t, r);
case "ascii":
case "latin1":
case "binary":
return x(this, e, t, r);
case "base64":
return S(this, e, t, r);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return E(this, e, t, r);
default:
if (s) throw new TypeError("Unknown encoding: " + n);
n = ("" + n).toLowerCase(), s = !0;
}
}, c.prototype.toJSON = function () {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
};
};
const B = 4096;
function k(e, t, r) {
let n = "";
r = Math.min(e.length, r);
for (let o = t; o < r; ++o) n += String.fromCharCode(127 & e[o]);
return n;
}
function I(e, t, r) {
let n = "";
r = Math.min(e.length, r);
for (let o = t; o < r; ++o) n += String.fromCharCode(e[o]);
return n;
}
function U(e, t, r) {
const n = e.length;
(!t || t < 0) && (t = 0), (!r || r < 0 || r > n) && (r = n);
let o = "";
for (let n = t; n < r; ++n) o += J[e[n]];
return o;
}
function C(e, t, r) {
const n = e.slice(t, r);
let o = "";
for (let e = 0; e < n.length - 1; e += 2) o += String.fromCharCode(n[e] + 256 * n[e + 1]);
return o;
}
function R(e, t, r) {
if (e % 1 != 0 || e < 0) throw new RangeError("offset is not uint");
if (e + t > r) throw new RangeError("Trying to access beyond buffer length");
}
function O(e, t, r, n, o, s) {
if (!c.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance');
if (t > o || t < s) throw new RangeError('"value" argument is out of bounds');
if (r + n > e.length) throw new RangeError("Index out of range");
}
function D(e, t, r, n, o) {
H(t, n, o, e, r, 7);
let s = Number(t & BigInt(4294967295));
e[r++] = s, s >>= 8, e[r++] = s, s >>= 8, e[r++] = s, s >>= 8, e[r++] = s;
let i = Number(t >> BigInt(32) & BigInt(4294967295));
return e[r++] = i, i >>= 8, e[r++] = i, i >>= 8, e[r++] = i, i >>= 8, e[r++] = i, r;
}
function N(e, t, r, n, o) {
H(t, n, o, e, r, 7);
let s = Number(t & BigInt(4294967295));
e[r + 7] = s, s >>= 8, e[r + 6] = s, s >>= 8, e[r + 5] = s, s >>= 8, e[r + 4] = s;
let i = Number(t >> BigInt(32) & BigInt(4294967295));
return e[r + 3] = i, i >>= 8, e[r + 2] = i, i >>= 8, e[r + 1] = i, i >>= 8, e[r] = i, r + 8;
}
function P(e, t, r, n, o, s) {
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, s) {
return t = +t, r >>>= 0, s || P(e, 0, r, 4), o.write(e, t, r, n, 23, 4), r + 4;
}
function F(e, t, r, n, s) {
return t = +t, r >>>= 0, s || P(e, 0, r, 8), o.write(e, t, r, n, 52, 8), r + 8;
}
c.prototype.slice = function (e, t) {
const r = this.length;
(e = ~~e) < 0 ? (e += r) < 0 && (e = 0) : e > r && (e = r), (t = void 0 === t ? r : ~~t) < 0 ? (t += r) < 0 && (t = 0) : t > r && (t = r), t < e && (t = e);
const n = this.subarray(e, t);
return Object.setPrototypeOf(n, c.prototype), n;
}, c.prototype.readUintLE = c.prototype.readUIntLE = function (e, t, r) {
e >>>= 0, t >>>= 0, r || R(e, t, this.length);
let n = this[e],
o = 1,
s = 0;
for (; ++s < t && (o *= 256);) n += this[e + s] * o;
return n;
}, c.prototype.readUintBE = c.prototype.readUIntBE = function (e, t, r) {
e >>>= 0, t >>>= 0, r || R(e, t, this.length);
let n = this[e + --t],
o = 1;
for (; t > 0 && (o *= 256);) n += this[e + --t] * o;
return n;
}, c.prototype.readUint8 = c.prototype.readUInt8 = function (e, t) {
return e >>>= 0, t || R(e, 1, this.length), this[e];
}, c.prototype.readUint16LE = c.prototype.readUInt16LE = function (e, t) {
return e >>>= 0, t || R(e, 2, this.length), this[e] | this[e + 1] << 8;
}, c.prototype.readUint16BE = c.prototype.readUInt16BE = function (e, t) {
return e >>>= 0, t || R(e, 2, this.length), this[e] << 8 | this[e + 1];
}, c.prototype.readUint32LE = c.prototype.readUInt32LE = function (e, t) {
return e >>>= 0, t || R(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3];
}, c.prototype.readUint32BE = c.prototype.readUInt32BE = function (e, t) {
return e >>>= 0, t || R(e, 4, this.length), 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
}, c.prototype.readBigUInt64LE = Q(function (e) {
G(e >>>= 0, "offset");
const t = this[e],
r = this[e + 7];
void 0 !== t && void 0 !== r || K(e, this.length - 8);
const n = t + 256 * this[++e] + 65536 * this[++e] + this[++e] * 2 ** 24,
o = this[++e] + 256 * this[++e] + 65536 * this[++e] + r * 2 ** 24;
return BigInt(n) + (BigInt(o) << BigInt(32));
}), c.prototype.readBigUInt64BE = Q(function (e) {
G(e >>>= 0, "offset");
const t = this[e],
r = this[e + 7];
void 0 !== t && void 0 !== r || K(e, this.length - 8);
const n = t * 2 ** 24 + 65536 * this[++e] + 256 * this[++e] + this[++e],
o = this[++e] * 2 ** 24 + 65536 * this[++e] + 256 * this[++e] + r;
return (BigInt(n) << BigInt(32)) + BigInt(o);
}), c.prototype.readIntLE = function (e, t, r) {
e >>>= 0, t >>>= 0, r || R(e, t, this.length);
let n = this[e],
o = 1,
s = 0;
for (; ++s < t && (o *= 256);) n += this[e + s] * o;
return o *= 128, n >= o && (n -= Math.pow(2, 8 * t)), n;
}, c.prototype.readIntBE = function (e, t, r) {
e >>>= 0, t >>>= 0, r || R(e, t, this.length);
let n = t,
o = 1,
s = this[e + --n];
for (; n > 0 && (o *= 256);) s += this[e + --n] * o;
return o *= 128, s >= o && (s -= Math.pow(2, 8 * t)), s;
}, c.prototype.readInt8 = function (e, t) {
return e >>>= 0, t || R(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e];
}, c.prototype.readInt16LE = function (e, t) {
e >>>= 0, t || R(e, 2, this.length);
const r = this[e] | this[e + 1] << 8;
return 32768 & r ? 4294901760 | r : r;
}, c.prototype.readInt16BE = function (e, t) {
e >>>= 0, t || R(e, 2, this.length);
const r = this[e + 1] | this[e] << 8;
return 32768 & r ? 4294901760 | r : r;
}, c.prototype.readInt32LE = function (e, t) {
return e >>>= 0, t || R(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
}, c.prototype.readInt32BE = function (e, t) {
return e >>>= 0, t || R(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
}, c.prototype.readBigInt64LE = Q(function (e) {
G(e >>>= 0, "offset");
const t = this[e],
r = this[e + 7];
void 0 !== t && void 0 !== r || K(e, this.length - 8);
const n = this[e + 4] + 256 * this[e + 5] + 65536 * this[e + 6] + (r << 24);
return (BigInt(n) << BigInt(32)) + BigInt(t + 256 * this[++e] + 65536 * this[++e] + this[++e] * 2 ** 24);
}), c.prototype.readBigInt64BE = Q(function (e) {
G(e >>>= 0, "offset");
const t = this[e],
r = this[e + 7];
void 0 !== t && void 0 !== r || K(e, this.length - 8);
const n = (t << 24) + 65536 * this[++e] + 256 * this[++e] + this[++e];
return (BigInt(n) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + 65536 * this[++e] + 256 * this[++e] + r);
}), c.prototype.readFloatLE = function (e, t) {
return e >>>= 0, t || R(e, 4, this.length), o.read(this, e, !0, 23, 4);
}, c.prototype.readFloatBE = function (e, t) {
return e >>>= 0, t || R(e, 4, this.length), o.read(this, e, !1, 23, 4);
}, c.prototype.readDoubleLE = function (e, t) {
return e >>>= 0, t || R(e, 8, this.length), o.read(this, e, !0, 52, 8);
}, c.prototype.readDoubleBE = function (e, t) {
return e >>>= 0, t || R(e, 8, this.length), o.read(this, e, !1, 52, 8);
}, c.prototype.writeUintLE = c.prototype.writeUIntLE = function (e, t, r, n) {
e = +e, t >>>= 0, r >>>= 0, n || O(this, e, t, r, Math.pow(2, 8 * r) - 1, 0);
let o = 1,
s = 0;
for (this[t] = 255 & e; ++s < r && (o *= 256);) this[t + s] = e / o & 255;
return t + r;
}, c.prototype.writeUintBE = c.prototype.writeUIntBE = function (e, t, r, n) {
e = +e, t >>>= 0, r >>>= 0, n || O(this, e, t, r, Math.pow(2, 8 * r) - 1, 0);
let o = r - 1,
s = 1;
for (this[t + o] = 255 & e; --o >= 0 && (s *= 256);) this[t + o] = e / s & 255;
return t + r;
}, c.prototype.writeUint8 = c.prototype.writeUInt8 = function (e, t, r) {
return e = +e, t >>>= 0, r || O(this, e, t, 1, 255, 0), this[t] = 255 & e, t + 1;
}, c.prototype.writeUint16LE = c.prototype.writeUInt16LE = function (e, t, r) {
return e = +e, t >>>= 0, r || O(this, e, t, 2, 65535, 0), this[t] = 255 & e, this[t + 1] = e >>> 8, t + 2;
}, c.prototype.writeUint16BE = c.prototype.writeUInt16BE = function (e, t, r) {
return e = +e, t >>>= 0, r || O(this, e, t, 2, 65535, 0), this[t] = e >>> 8, this[t + 1] = 255 & e, t + 2;
}, c.prototype.writeUint32LE = c.prototype.writeUInt32LE = function (e, t, r) {
return e = +e, t >>>= 0, r || O(this, e, t, 4, 4294967295, 0), this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = 255 & e, t + 4;
}, c.prototype.writeUint32BE = c.prototype.writeUInt32BE = function (e, t, r) {
return e = +e, t >>>= 0, r || O(this, e, t, 4, 4294967295, 0), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e, t + 4;
}, c.prototype.writeBigUInt64LE = Q(function (e, t = 0) {
return D(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
}), c.prototype.writeBigUInt64BE = Q(function (e, t = 0) {
return N(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
}), c.prototype.writeIntLE = function (e, t, r, n) {
if (e = +e, t >>>= 0, !n) {
const n = Math.pow(2, 8 * r - 1);
O(this, e, t, r, n - 1, -n);
}
let o = 0,
s = 1,
i = 0;
for (this[t] = 255 & e; ++o < r && (s *= 256);) e < 0 && 0 === i && 0 !== this[t + o - 1] && (i = 1), this[t + o] = (e / s >> 0) - i & 255;
return t + r;
}, c.prototype.writeIntBE = function (e, t, r, n) {
if (e = +e, t >>>= 0, !n) {
const n = Math.pow(2, 8 * r - 1);
O(this, e, t, r, n - 1, -n);
}
let o = r - 1,
s = 1,
i = 0;
for (this[t + o] = 255 & e; --o >= 0 && (s *= 256);) e < 0 && 0 === i && 0 !== this[t + o + 1] && (i = 1), this[t + o] = (e / s >> 0) - i & 255;
return t + r;
}, c.prototype.writeInt8 = function (e, t, r) {
return e = +e, t >>>= 0, r || O(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = 255 & e, t + 1;
}, c.prototype.writeInt16LE = function (e, t, r) {
return e = +e, t >>>= 0, r || O(this, e, t, 2, 32767, -32768), this[t] = 255 & e, this[t + 1] = e >>> 8, t + 2;
}, c.prototype.writeInt16BE = function (e, t, r) {
return e = +e, t >>>= 0, r || O(this, e, t, 2, 32767, -32768), this[t] = e >>> 8, this[t + 1] = 255 & e, t + 2;
}, c.prototype.writeInt32LE = function (e, t, r) {
return e = +e, t >>>= 0, r || O(this, e, t, 4, 2147483647, -2147483648), this[t] = 255 & e, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24, t + 4;
}, c.prototype.writeInt32BE = function (e, t, r) {
return e = +e, t >>>= 0, r || O(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e, t + 4;
}, c.prototype.writeBigInt64LE = Q(function (e, t = 0) {
return D(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
}), c.prototype.writeBigInt64BE = Q(function (e, t = 0) {
return N(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
}), c.prototype.writeFloatLE = function (e, t, r) {
return L(this, e, t, !0, r);
}, c.prototype.writeFloatBE = function (e, t, r) {
return L(this, e, t, !1, r);
}, c.prototype.writeDoubleLE = function (e, t, r) {
return F(this, e, t, !0, r);
}, c.prototype.writeDoubleBE = function (e, t, r) {
return F(this, e, t, !1, r);
}, c.prototype.copy = function (e, t, r, n) {
if (!c.isBuffer(e)) throw new TypeError("argument should be a Buffer");
if (r || (r = 0), n || 0 === n || (n = this.length), t >= e.length && (t = e.length), t || (t = 0), n > 0 && n < r && (n = r), n === r) return 0;
if (0 === e.length || 0 === this.length) return 0;
if (t < 0) throw new RangeError("targetStart out of bounds");
if (r < 0 || r >= this.length) throw new RangeError("Index out of range");
if (n < 0) throw new RangeError("sourceEnd out of bounds");
n > this.length && (n = this.length), e.length - t < n - r && (n = e.length - t + r);
const o = n - r;
return this === e && "function" == typeof Uint8Array.prototype.copyWithin ? this.copyWithin(t, r, n) : Uint8Array.prototype.set.call(e, this.subarray(r, n), t), o;
}, c.prototype.fill = function (e, t, r, n) {
if ("string" == typeof e) {
if ("string" == typeof t ? (n = t, t = 0, r = this.length) : "string" == typeof r && (n = r, r = this.length), void 0 !== n && "string" != typeof n) throw new TypeError("encoding must be a string");
if ("string" == typeof n && !c.isEncoding(n)) throw new TypeError("Unknown encoding: " + n);
if (1 === e.length) {
const t = e.charCodeAt(0);
("utf8" === n && t < 128 || "latin1" === n) && (e = t);
}
} else "number" == typeof e ? e &= 255 : "boolean" == typeof e && (e = Number(e));
if (t < 0 || this.length < t || this.length < r) throw new RangeError("Out of range index");
if (r <= t) return this;
let o;
if (t >>>= 0, r = void 0 === r ? this.length : r >>> 0, e || (e = 0), "number" == typeof e) for (o = t; o < r; ++o) this[o] = e;else {
const s = c.isBuffer(e) ? e : c.from(e, n),
i = s.length;
if (0 === i) throw new TypeError('The value "' + e + '" is invalid for argument "value"');
for (o = 0; o < r - t; ++o) this[o + t] = s[o % i];
}
return this;
};
const j = {};
function z(e, t, r) {
j[e] = class extends r {
constructor() {
super(), Object.defineProperty(this, "message", {
value: t.apply(this, arguments),
writable: !0,
configurable: !0
}), this.name = `${this.name} [${e}]`, this.stack, delete this.name;
}
get code() {
return e;
}
set code(e) {
Object.defineProperty(this, "code", {
configurable: !0,
enumerable: !0,
value: e,
writable: !0
});
}
toString() {
return `${this.name} [${e}]: ${this.message}`;
}
};
}
function M(e) {
let t = "",
r = e.length;
const n = "-" === e[0] ? 1 : 0;
for (; r >= n + 4; r -= 3) t = `_${e.slice(r - 3, r)}${t}`;
return `${e.slice(0, r)}${t}`;
}
function H(e, t, r, n, o, s) {
if (e > r || e < t) {
const n = "bigint" == typeof t ? "n" : "";
let o;
throw o = s > 3 ? 0 === t || t === BigInt(0) ? `>= 0${n} and < 2${n} ** ${8 * (s + 1)}${n}` : `>= -(2${n} ** ${8 * (s + 1) - 1}${n}) and < 2 ** ${8 * (s + 1) - 1}${n}` : `>= ${t}${n} and <= ${r}${n}`, new j.ERR_OUT_OF_RANGE("value", o, e);
}
!function (e, t, r) {
G(t, "offset"), void 0 !== e[t] && void 0 !== e[t + r] || K(t, e.length - (r + 1));
}(n, o, s);
}
function G(e, t) {
if ("number" != typeof e) throw new j.ERR_INVALID_ARG_TYPE(t, "number", e);
}
function K(e, t, r) {
if (Math.floor(e) !== e) throw G(e, r), new j.ERR_OUT_OF_RANGE(r || "offset", "an integer", e);
if (t < 0) throw new j.ERR_BUFFER_OUT_OF_BOUNDS();
throw new j.ERR_OUT_OF_RANGE(r || "offset", `>= ${r ? 1 : 0} and <= ${t}`, e);
}
z("ERR_BUFFER_OUT_OF_BOUNDS", function (e) {
return e ? `${e} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
}, RangeError), z("ERR_INVALID_ARG_TYPE", function (e, t) {
return `The "${e}" argument must be of type number. Received type ${typeof t}`;
}, TypeError), z("ERR_OUT_OF_RANGE", function (e, t, r) {
let n = `The value of "${e}" is out of range.`,
o = r;
return Number.isInteger(r) && Math.abs(r) > 2 ** 32 ? o = M(String(r)) : "bigint" == typeof r && (o = String(r), (r > BigInt(2) ** BigInt(32) || r < -(BigInt(2) ** BigInt(32))) && (o = M(o)), o += "n"), n += ` It must be ${t}. Received ${o}`, n;
}, RangeError);
const q = /[^+/0-9A-Za-z-_]/g;
function $(e, t) {
let r;
t = t || 1 / 0;
const n = e.length;
let o = null;
const s = [];
for (let i = 0; i < n; ++i) {
if (r = e.charCodeAt(i), r > 55295 && r < 57344) {
if (!o) {
if (r > 56319) {
(t -= 3) > -1 && s.push(239, 191, 189);
continue;
}
if (i + 1 === n) {
(t -= 3) > -1 && s.push(239, 191, 189);
continue;
}
o = r;
continue;
}
if (r < 56320) {
(t -= 3) > -1 && s.push(239, 191, 189), o = r;
continue;
}
r = 65536 + (o - 55296 << 10 | r - 56320);
} else o && (t -= 3) > -1 && s.push(239, 191, 189);
if (o = null, r < 128) {
if ((t -= 1) < 0) break;
s.push(r);
} else if (r < 2048) {
if ((t -= 2) < 0) break;
s.push(r >> 6 | 192, 63 & r | 128);
} else if (r < 65536) {
if ((t -= 3) < 0) break;
s.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;
s.push(r >> 18 | 240, r >> 12 & 63 | 128, r >> 6 & 63 | 128, 63 & r | 128);
}
}
return s;
}
function V(e) {
return n.toByteArray(function (e) {
if ((e = (e = e.split("=")[0]).trim().replace(q, "")).length < 2) return "";
for (; e.length % 4 != 0;) e += "=";
return e;
}(e));
}
function W(e, t, r, n) {
let o;
for (o = 0; o < n && !(o + r >= t.length || o >= e.length); ++o) t[o + r] = e[o];
return o;
}
function X(e, t) {
return e instanceof t || null != e && null != e.constructor && null != e.constructor.name && e.constructor.name === t.name;
}
function Y(e) {
return e != e;
}
const J = function () {
const e = "0123456789abcdef",
t = new Array(256);
for (let r = 0; r < 16; ++r) {
const n = 16 * r;
for (let o = 0; o < 16; ++o) t[n + o] = e[r] + e[o];
}
return t;
}();
function Q(e) {
return "undefined" == typeof BigInt ? Z : e;
}
function Z() {
throw new Error("BigInt not supported");
}
},
7615: (e, t, r) => {
"use strict";
var n = r(1801),
o = r(2550),
s = o(n("String.prototype.indexOf"));
e.exports = function (e, t) {
var r = n(e, !!t);
return "function" == typeof r && s(e, ".prototype.") > -1 ? o(r) : r;
};
},
2550: (e, t, r) => {
"use strict";
var n = r(1930),
o = r(1801),
s = o("%Function.prototype.apply%"),
i = o("%Function.prototype.call%"),
a = o("%Reflect.apply%", !0) || n.call(i, s),
c = o("%Object.getOwnPropertyDescriptor%", !0),
u = o("%Object.defineProperty%", !0),
l = o("%Math.max%");
if (u) try {
u({}, "a", {
value: 1
});
} catch (e) {
u = null;
}
e.exports = function (e) {
var t = a(n, i, arguments);
if (c && u) {
var r = c(t, "length");
r.configurable && u(t, "length", {
value: 1 + l(0, e.length - (arguments.length - 1))
});
}
return t;
};
var h = function () {
return a(n, s, arguments);
};
u ? u(e.exports, "apply", {
value: h
}) : e.exports.apply = h;
},
1069: e => {
function t(e) {
if (e) return function (e) {
for (var r in t.prototype) e[r] = t.prototype[r];
return e;
}(e);
}
e.exports = t, t.prototype.on = t.prototype.addEventListener = function (e, t) {
return this._callbacks = this._callbacks || {}, (this._callbacks["$" + e] = this._callbacks["$" + e] || []).push(t), this;
}, t.prototype.once = function (e, t) {
function r() {
this.off(e, r), t.apply(this, arguments);
}
return r.fn = t, this.on(e, r), this;
}, t.prototype.off = t.prototype.removeListener = t.prototype.removeAllListeners = t.prototype.removeEventListener = function (e, t) {
if (this._callbacks = this._callbacks || {}, 0 == arguments.length) return this._callbacks = {}, this;
var r,
n = this._callbacks["$" + e];
if (!n) return this;
if (1 == arguments.length) return delete this._callbacks["$" + e], this;
for (var o = 0; o < n.length; o++) if ((r = n[o]) === t || r.fn === t) {
n.splice(o, 1);
break;
}
return 0 === n.length && delete this._callbacks["$" + e], this;
}, t.prototype.emit = function (e) {
this._callbacks = this._callbacks || {};
for (var t = new Array(arguments.length - 1), r = this._callbacks["$" + e], n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
if (r) {
n = 0;
for (var o = (r = r.slice(0)).length; n < o; ++n) r[n].apply(this, t);
}
return this;
}, t.prototype.listeners = function (e) {
return this._callbacks = this._callbacks || {}, this._callbacks["$" + e] || [];
}, t.prototype.hasListeners = function (e) {
return !!this.listeners(e).length;
};
},
5799: e => {
e.exports = n, n.default = n, n.stable = i, n.stableStringify = i;
var t = [],
r = [];
function n(e, n, s) {
var i;
for (o(e, "", [], void 0), i = 0 === r.length ? JSON.stringify(e, n, s) : JSON.stringify(e, c(n), s); 0 !== t.length;) {
var a = t.pop();
4 === a.length ? Object.defineProperty(a[0], a[1], a[3]) : a[0][a[1]] = a[2];
}
return i;
}
function o(e, n, s, i) {
var a;
if ("object" == typeof e && null !== e) {
for (a = 0; a < s.length; a++) if (s[a] === e) {
var c = Object.getOwnPropertyDescriptor(i, n);
return void (void 0 !== c.get ? c.configurable ? (Object.defineProperty(i, n, {
value: "[Circular]"
}), t.push([i, n, e, c])) : r.push([e, n]) : (i[n] = "[Circular]", t.push([i, n, e])));
}
if (s.push(e), Array.isArray(e)) for (a = 0; a < e.length; a++) o(e[a], a, s, e);else {
var u = Object.keys(e);
for (a = 0; a < u.length; a++) {
var l = u[a];
o(e[l], l, s, e);
}
}
s.pop();
}
}
function s(e, t) {
return e < t ? -1 : e > t ? 1 : 0;
}
function i(e, n, o) {
var s,
i = a(e, "", [], void 0) || e;
for (s = 0 === r.length ? JSON.stringify(i, n, o) : JSON.stringify(i, c(n), o); 0 !== t.length;) {
var u = t.pop();
4 === u.length ? Object.defineProperty(u[0], u[1], u[3]) : u[0][u[1]] = u[2];
}
return s;
}
function a(e, n, o, i) {
var c;
if ("object" == typeof e && null !== e) {
for (c = 0; c < o.length; c++) if (o[c] === e) {
var u = Object.getOwnPropertyDescriptor(i, n);
return void (void 0 !== u.get ? u.configurable ? (Object.defineProperty(i, n, {
value: "[Circular]"
}), t.push([i, n, e, u])) : r.push([e, n]) : (i[n] = "[Circular]", t.push([i, n, e])));
}
if ("function" == typeof e.toJSON) return;
if (o.push(e), Array.isArray(e)) for (c = 0; c < e.length; c++) a(e[c], c, o, e);else {
var l = {},
h = Object.keys(e).sort(s);
for (c = 0; c < h.length; c++) {
var p = h[c];
a(e[p], p, o, e), l[p] = e[p];
}
if (void 0 === i) return l;
t.push([i, n, e]), i[n] = l;
}
o.pop();
}
}
function c(e) {
return e = void 0 !== e ? e : function (e, t) {
return t;
}, function (t, n) {
if (r.length > 0) for (var o = 0; o < r.length; o++) {
var s = r[o];
if (s[1] === t && s[0] === n) {
n = "[Circular]", r.splice(o, 1);
break;
}
}
return e.call(this, t, n);
};
}
},
9930: e => {
"use strict";
var t = "Function.prototype.bind called on incompatible ",
r = Array.prototype.slice,
n = Object.prototype.toString,
o = "[object Function]";
e.exports = function (e) {
var s = this;
if ("function" != typeof s || n.call(s) !== o) throw new TypeError(t + s);
for (var i, a = r.call(arguments, 1), c = function () {
if (this instanceof i) {
var t = s.apply(this, a.concat(r.call(arguments)));
return Object(t) === t ? t : this;
}
return s.apply(e, a.concat(r.call(arguments)));
}, u = Math.max(0, s.length - a.length), l = [], h = 0; h < u; h++) l.push("$" + h);
if (i = Function("binder", "return function (" + l.join(",") + "){ return binder.apply(this,arguments); }")(c), s.prototype) {
var p = function () {};
p.prototype = s.prototype, i.prototype = new p(), p.prototype = null;
}
return i;
};
},
1930: (e, t, r) => {
"use strict";
var n = r(9930);
e.exports = Function.prototype.bind || n;
},
1801: (e, t, r) => {
"use strict";
var n,
o = SyntaxError,
s = Function,
i = TypeError,
a = function (e) {
try {
return s('"use strict"; return (' + e + ").constructor;")();
} catch (e) {}
},
c = Object.getOwnPropertyDescriptor;
if (c) try {
c({}, "");
} catch (e) {
c = null;
}
var u = function () {
throw new i();
},
l = c ? function () {
try {
return u;
} catch (e) {
try {
return c(arguments, "callee").get;
} catch (e) {
return u;
}
}
}() : u,
h = r(9905)(),
p = Object.getPrototypeOf || function (e) {
return e.__proto__;
},
f = {},
d = "undefined" == typeof Uint8Array ? n : p(Uint8Array),
g = {
"%AggregateError%": "undefined" == typeof AggregateError ? n : AggregateError,
"%Array%": Array,
"%ArrayBuffer%": "undefined" == typeof ArrayBuffer ? n : ArrayBuffer,
"%ArrayIteratorPrototype%": h ? p([][Symbol.iterator]()) : n,
"%AsyncFromSyncIteratorPrototype%": n,
"%AsyncFunction%": f,
"%AsyncGenerator%": f,
"%AsyncGeneratorFunction%": f,
"%AsyncIteratorPrototype%": f,
"%Atomics%": "undefined" == typeof Atomics ? n : Atomics,
"%BigInt%": "undefined" == typeof BigInt ? n : BigInt,
"%Boolean%": Boolean,
"%DataView%": "undefined" == typeof DataView ? n : DataView,
"%Date%": Date,
"%decodeURI%": decodeURI,
"%decodeURIComponent%": decodeURIComponent,
"%encodeURI%": encodeURI,
"%encodeURIComponent%": encodeURIComponent,
"%Error%": Error,
"%eval%": eval,
"%EvalError%": EvalError,
"%Float32Array%": "undefined" == typeof Float32Array ? n : Float32Array,
"%Float64Array%": "undefined" == typeof Float64Array ? n : Float64Array,
"%FinalizationRegistry%": "undefined" == typeof FinalizationRegistry ? n : FinalizationRegistry,
"%Function%": s,
"%GeneratorFunction%": f,
"%Int8Array%": "undefined" == typeof Int8Array ? n : Int8Array,
"%Int16Array%": "undefined" == typeof Int16Array ? n : Int16Array,
"%Int32Array%": "undefined" == typeof Int32Array ? n : Int32Array,
"%isFinite%": isFinite,
"%isNaN%": isNaN,
"%IteratorPrototype%": h ? p(p([][Symbol.iterator]())) : n,
"%JSON%": "object" == typeof JSON ? JSON : n,
"%Map%": "undefined" == typeof Map ? n : Map,
"%MapIteratorPrototype%": "undefined" != typeof Map && h ? p(new Map()[Symbol.iterator]()) : n,
"%Math%": Math,
"%Number%": Number,
"%Object%": Object,
"%parseFloat%": parseFloat,
"%parseInt%": parseInt,
"%Promise%": "undefined" == typeof Promise ? n : Promise,
"%Proxy%": "undefined" == typeof Proxy ? n : Proxy,
"%RangeError%": RangeError,
"%ReferenceError%": ReferenceError,
"%Reflect%": "undefined" == typeof Reflect ? n : Reflect,
"%RegExp%": RegExp,
"%Set%": "undefined" == typeof Set ? n : Set,
"%SetIteratorPrototype%": "undefined" != typeof Set && h ? p(new Set()[Symbol.iterator]()) : n,
"%SharedArrayBuffer%": "undefined" == typeof SharedArrayBuffer ? n : SharedArrayBuffer,
"%String%": String,
"%StringIteratorPrototype%": h ? p(""[Symbol.iterator]()) : n,
"%Symbol%": h ? Symbol : n,
"%SyntaxError%": o,
"%ThrowTypeError%": l,
"%TypedArray%": d,
"%TypeError%": i,
"%Uint8Array%": "undefined" == typeof Uint8Array ? n : Uint8Array,
"%Uint8ClampedArray%": "undefined" == typeof Uint8ClampedArray ? n : Uint8ClampedArray,
"%Uint16Array%": "undefined" == typeof Uint16Array ? n : Uint16Array,
"%Uint32Array%": "undefined" == typeof Uint32Array ? n : Uint32Array,
"%URIError%": URIError,
"%WeakMap%": "undefined" == typeof WeakMap ? n : WeakMap,
"%WeakRef%": "undefined" == typeof WeakRef ? n : WeakRef,
"%WeakSet%": "undefined" == typeof WeakSet ? n : WeakSet
},
y = function e(t) {
var r;
if ("%AsyncFunction%" === t) r = a("async function () {}");else if ("%GeneratorFunction%" === t) r = a("function* () {}");else if ("%AsyncGeneratorFunction%" === t) r = a("async function* () {}");else if ("%AsyncGenerator%" === t) {
var n = e("%AsyncGeneratorFunction%");
n && (r = n.prototype);
} else if ("%AsyncIteratorPrototype%" === t) {
var o = e("%AsyncGenerator%");
o && (r = p(o.prototype));
}
return g[t] = r, r;
},
m = {
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
"%ArrayPrototype%": ["Array", "prototype"],
"%ArrayProto_entries%": ["Array", "prototype", "entries"],
"%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
"%ArrayProto_keys%": ["Array", "prototype", "keys"],
"%ArrayProto_values%": ["Array", "prototype", "values"],
"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
"%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
"%BooleanPrototype%": ["Boolean", "prototype"],
"%DataViewPrototype%": ["DataView", "prototype"],
"%DatePrototype%": ["Date", "prototype"],
"%ErrorPrototype%": ["Error", "prototype"],
"%EvalErrorPrototype%": ["EvalError", "prototype"],
"%Float32ArrayPrototype%": ["Float32Array", "prototype"],
"%Float64ArrayPrototype%": ["Float64Array", "prototype"],
"%FunctionPrototype%": ["Function", "prototype"],
"%Generator%": ["GeneratorFunction", "prototype"],
"%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
"%Int8ArrayPrototype%": ["Int8Array", "prototype"],
"%Int16ArrayPrototype%": ["Int16Array", "prototype"],
"%Int32ArrayPrototype%": ["Int32Array", "prototype"],
"%JSONParse%": ["JSON", "parse"],
"%JSONStringify%": ["JSON", "stringify"],
"%MapPrototype%": ["Map", "prototype"],
"%NumberPrototype%": ["Number", "prototype"],
"%ObjectPrototype%": ["Object", "prototype"],
"%ObjProto_toString%": ["Object", "prototype", "toString"],
"%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
"%PromisePrototype%": ["Promise", "prototype"],
"%PromiseProto_then%": ["Promise", "prototype", "then"],
"%Promise_all%": ["Promise", "all"],
"%Promise_reject%": ["Promise", "reject"],
"%Promise_resolve%": ["Promise", "resolve"],
"%RangeErrorPrototype%": ["RangeError", "prototype"],
"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
"%RegExpPrototype%": ["RegExp", "prototype"],
"%SetPrototype%": ["Set", "prototype"],
"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
"%StringPrototype%": ["String", "prototype"],
"%SymbolPrototype%": ["Symbol", "prototype"],
"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
"%TypedArrayPrototype%": ["TypedArray", "prototype"],
"%TypeErrorPrototype%": ["TypeError", "prototype"],
"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
"%URIErrorPrototype%": ["URIError", "prototype"],
"%WeakMapPrototype%": ["WeakMap", "prototype"],
"%WeakSetPrototype%": ["WeakSet", "prototype"]
},
b = r(1930),
w = r(9284),
A = b.call(Function.call, Array.prototype.concat),
v = b.call(Function.apply, Array.prototype.splice),
x = b.call(Function.call, String.prototype.replace),
S = b.call(Function.call, String.prototype.slice),
E = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,
T = /\\(\\)?/g,
_ = function (e) {
var t = S(e, 0, 1),
r = S(e, -1);
if ("%" === t && "%" !== r) throw new o("invalid intrinsic syntax, expected closing `%`");
if ("%" === r && "%" !== t) throw new o("invalid intrinsic syntax, expected opening `%`");
var n = [];
return x(e, E, function (e, t, r, o) {
n[n.length] = r ? x(o, T, "$1") : t || e;
}), n;
},
B = function (e, t) {
var r,
n = e;
if (w(m, n) && (n = "%" + (r = m[n])[0] + "%"), w(g, n)) {
var s = g[n];
if (s === f && (s = y(n)), void 0 === s && !t) throw new i("intrinsic " + e + " exists, but is not available. Please file an issue!");
return {
alias: r,
name: n,
value: s
};
}
throw new o("intrinsic " + e + " does not exist!");
};
e.exports = function (e, t) {
if ("string" != typeof e || 0 === e.length) throw new i("intrinsic name must be a non-empty string");
if (arguments.length > 1 && "boolean" != typeof t) throw new i('"allowMissing" argument must be a boolean');
var r = _(e),
n = r.length > 0 ? r[0] : "",
s = B("%" + n + "%", t),
a = s.name,
u = s.value,
l = !1,
h = s.alias;
h && (n = h[0], v(r, A([0, 1], h)));
for (var p = 1, f = !0; p < r.length; p += 1) {
var d = r[p],
y = S(d, 0, 1),
m = S(d, -1);
if (('"' === y || "'" === y || "`" === y || '"' === m || "'" === m || "`" === m) && y !== m) throw new o("property names with quotes must have matching quotes");
if ("constructor" !== d && f || (l = !0), w(g, a = "%" + (n += "." + d) + "%")) u = g[a];else if (null != u) {
if (!(d in u)) {
if (!t) throw new i("base intrinsic for " + e + " exists, but the property is not available.");
return;
}
if (c && p + 1 >= r.length) {
var b = c(u, d);
u = (f = !!b) && "get" in b && !("originalValue" in b.get) ? b.get : u[d];
} else f = w(u, d), u = u[d];
f && !l && (g[a] = u);
}
}
return u;
};
},
9905: (e, t, r) => {
"use strict";
var n = "undefined" != typeof Symbol && Symbol,
o = r(5682);
e.exports = function () {
return "function" == typeof n && "function" == typeof Symbol && "symbol" == typeof n("foo") && "symbol" == typeof Symbol("bar") && o();
};
},
5682: e => {
"use strict";
e.exports = function () {
if ("function" != typeof Symbol || "function" != typeof Object.getOwnPropertySymbols) return !1;
if ("symbol" == typeof Symbol.iterator) return !0;
var e = {},
t = Symbol("test"),
r = Object(t);
if ("string" == typeof t) return !1;
if ("[object Symbol]" !== Object.prototype.toString.call(t)) return !1;
if ("[object Symbol]" !== Object.prototype.toString.call(r)) return !1;
for (t in e[t] = 42, e) return !1;
if ("function" == typeof Object.keys && 0 !== Object.keys(e).length) return !1;
if ("function" == typeof Object.getOwnPropertyNames && 0 !== Object.getOwnPropertyNames(e).length) return !1;
var n = Object.getOwnPropertySymbols(e);
if (1 !== n.length || n[0] !== t) return !1;
if (!Object.prototype.propertyIsEnumerable.call(e, t)) return !1;
if ("function" == typeof Object.getOwnPropertyDescriptor) {
var o = Object.getOwnPropertyDescriptor(e, t);
if (42 !== o.value || !0 !== o.enumerable) return !1;
}
return !0;
};
},
9284: (e, t, r) => {
"use strict";
var n = r(1930);
e.exports = n.call(Function.call, Object.prototype.hasOwnProperty);
},
7267: (e, t, r) => {
var n;
!function () {
"use strict";
var t = "object" == typeof window ? window : {};
!t.HI_BASE32_NO_NODE_JS && "object" == typeof process && process.versions && process.versions.node && (t = r.g);
var o = !t.HI_BASE32_NO_COMMON_JS && e.exports,
s = r.amdO,
i = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),
a = {
A: 0,
B: 1,
C: 2,
D: 3,
E: 4,
F: 5,
G: 6,
H: 7,
I: 8,
J: 9,
K: 10,
L: 11,
M: 12,
N: 13,
O: 14,
P: 15,
Q: 16,
R: 17,
S: 18,
T: 19,
U: 20,
V: 21,
W: 22,
X: 23,
Y: 24,
Z: 25,
2: 26,
3: 27,
4: 28,
5: 29,
6: 30,
7: 31
},
c = [0, 0, 0, 0, 0, 0, 0, 0],
u = function (e, t) {
t.length > 10 && (t = "..." + t.substr(-10));
var r = new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading " + e + " bytes: " + t + " <-");
throw r.position = e, r;
},
l = function (e) {
if ("" === e) return [];
if (!/^[A-Z2-7=]+$/.test(e)) throw new Error("Invalid base32 characters");
for (var t, r, n, o, s, i, c, u, l = [], h = 0, p = (e = e.replace(/=/g, "")).length, f = 0, d = p >> 3 << 3; f < d;) t = a[e.charAt(f++)], r = a[e.charAt(f++)], n = a[e.charAt(f++)], o = a[e.charAt(f++)], s = a[e.charAt(f++)], i = a[e.charAt(f++)], c = a[e.charAt(f++)], u = a[e.charAt(f++)], l[h++] = 255 & (t << 3 | r >>> 2), l[h++] = 255 & (r << 6 | n << 1 | o >>> 4), l[h++] = 255 & (o << 4 | s >>> 1), l[h++] = 255 & (s << 7 | i << 2 | c >>> 3), l[h++] = 255 & (c << 5 | u);
var g = p - d;
return 2 === g ? (t = a[e.charAt(f++)], r = a[e.charAt(f++)], l[h++] = 255 & (t << 3 | r >>> 2)) : 4 === g ? (t = a[e.charAt(f++)], r = a[e.charAt(f++)], n = a[e.charAt(f++)], o = a[e.charAt(f++)], l[h++] = 255 & (t << 3 | r >>> 2), l[h++] = 255 & (r << 6 | n << 1 | o >>> 4)) : 5 === g ? (t = a[e.charAt(f++)], r = a[e.charAt(f++)], n = a[e.charAt(f++)], o = a[e.charAt(f++)], s = a[e.charAt(f++)], l[h++] = 255 & (t << 3 | r >>> 2), l[h++] = 255 & (r << 6 | n << 1 | o >>> 4), l[h++] = 255 & (o << 4 | s >>> 1)) : 7 === g && (t = a[e.charAt(f++)], r = a[e.charAt(f++)], n = a[e.charAt(f++)], o = a[e.charAt(f++)], s = a[e.charAt(f++)], i = a[e.charAt(f++)], c = a[e.charAt(f++)], l[h++] = 255 & (t << 3 | r >>> 2), l[h++] = 255 & (r << 6 | n << 1 | o >>> 4), l[h++] = 255 & (o << 4 | s >>> 1), l[h++] = 255 & (s << 7 | i << 2 | c >>> 3)), l;
},
h = function (e, t) {
if (!t) return function (e) {
for (var t, r, n = "", o = e.length, s = 0, i = 0; s < o;) if ((t = e[s++]) <= 127) n += String.fromCharCode(t);else {
t > 191 && t <= 223 ? (r = 31 & t, i = 1) : t <= 239 ? (r = 15 & t, i = 2) : t <= 247 ? (r = 7 & t, i = 3) : u(s, n);
for (var a = 0; a < i; ++a) ((t = e[s++]) < 128 || t > 191) && u(s, n), r <<= 6, r += 63 & t;
r >= 55296 && r <= 57343 && u(s, n), r > 1114111 && u(s, n), r <= 65535 ? n += String.fromCharCode(r) : (r -= 65536, n += String.fromCharCode(55296 + (r >> 10)), n += String.fromCharCode(56320 + (1023 & r)));
}
return n;
}(l(e));
if ("" === e) return "";
if (!/^[A-Z2-7=]+$/.test(e)) throw new Error("Invalid base32 characters");
var r,
n,
o,
s,
i,
c,
h,
p,
f = "",
d = e.indexOf("=");
-1 === d && (d = e.length);
for (var g = 0, y = d >> 3 << 3; g < y;) r = a[e.charAt(g++)], n = a[e.charAt(g++)], o = a[e.charAt(g++)], s = a[e.charAt(g++)], i = a[e.charAt(g++)], c = a[e.charAt(g++)], h = a[e.charAt(g++)], p = a[e.charAt(g++)], f += String.fromCharCode(255 & (r << 3 | n >>> 2)) + String.fromCharCode(255 & (n << 6 | o << 1 | s >>> 4)) + String.fromCharCode(255 & (s << 4 | i >>> 1)) + String.fromCharCode(255 & (i << 7 | c << 2 | h >>> 3)) + String.fromCharCode(255 & (h << 5 | p));
var m = d - y;
return 2 === m ? (r = a[e.charAt(g++)], n = a[e.charAt(g++)], f += String.fromCharCode(255 & (r << 3 | n >>> 2))) : 4 === m ? (r = a[e.charAt(g++)], n = a[e.charAt(g++)], o = a[e.charAt(g++)], s = a[e.charAt(g++)], f += String.fromCharCode(255 & (r << 3 | n >>> 2)) + String.fromCharCode(255 & (n << 6 | o << 1 | s >>> 4))) : 5 === m ? (r = a[e.charAt(g++)], n = a[e.charAt(g++)], o = a[e.charAt(g++)], s = a[e.charAt(g++)], i = a[e.charAt(g++)], f += String.fromCharCode(255 & (r << 3 | n >>> 2)) + String.fromCharCode(255 & (n << 6 | o << 1 | s >>> 4)) + String.fromCharCode(255 & (s << 4 | i >>> 1))) : 7 === m && (r = a[e.charAt(g++)], n = a[e.charAt(g++)], o = a[e.charAt(g++)], s = a[e.charAt(g++)], i = a[e.charAt(g++)], c = a[e.charAt(g++)], h = a[e.charAt(g++)], f += String.fromCharCode(255 & (r << 3 | n >>> 2)) + String.fromCharCode(255 & (n << 6 | o << 1 | s >>> 4)) + String.fromCharCode(255 & (s << 4 | i >>> 1)) + String.fromCharCode(255 & (i << 7 | c << 2 | h >>> 3))), f;
},
p = {
encode: function (e, t) {
var r = "string" != typeof e;
return r && e.constructor === ArrayBuffer && (e = new Uint8Array(e)), r ? function (e) {
for (var t, r, n, o, s, a = "", c = e.length, u = 0, l = 5 * parseInt(c / 5); u < l;) t = e[u++], r = e[u++], n = e[u++], o = e[u++], s = e[u++], a += i[t >>> 3] + i[31 & (t << 2 | r >>> 6)] + i[r >>> 1 & 31] + i[31 & (r << 4 | n >>> 4)] + i[31 & (n << 1 | o >>> 7)] + i[o >>> 2 & 31] + i[31 & (o << 3 | s >>> 5)] + i[31 & s];
var h = c - l;
return 1 === h ? (t = e[u], a += i[t >>> 3] + i[t << 2 & 31] + "======") : 2 === h ? (t = e[u++], r = e[u], a += i[t >>> 3] + i[31 & (t << 2 | r >>> 6)] + i[r >>> 1 & 31] + i[r << 4 & 31] + "====") : 3 === h ? (t = e[u++], r = e[u++], n = e[u], a += i[t >>> 3] + i[31 & (t << 2 | r >>> 6)] + i[r >>> 1 & 31] + i[31 & (r << 4 | n >>> 4)] + i[n << 1 & 31] + "===") : 4 === h && (t = e[u++], r = e[u++], n = e[u++], o = e[u], a += i[t >>> 3] + i[31 & (t << 2 | r >>> 6)] + i[r >>> 1 & 31] + i[31 & (r << 4 | n >>> 4)] + i[31 & (n << 1 | o >>> 7)] + i[o >>> 2 & 31] + i[o << 3 & 31] + "="), a;
}(e) : t ? function (e) {
for (var t, r, n, o, s, a = "", c = e.length, u = 0, l = 5 * parseInt(c / 5); u < l;) t = e.charCodeAt(u++), r = e.charCodeAt(u++), n = e.charCodeAt(u++), o = e.charCodeAt(u++), s = e.charCodeAt(u++), a += i[t >>> 3] + i[31 & (t << 2 | r >>> 6)] + i[r >>> 1 & 31] + i[31 & (r << 4 | n >>> 4)] + i[31 & (n << 1 | o >>> 7)] + i[o >>> 2 & 31] + i[31 & (o << 3 | s >>> 5)] + i[31 & s];
var h = c - l;
return 1 === h ? (t = e.charCodeAt(u), a += i[t >>> 3] + i[t << 2 & 31] + "======") : 2 === h ? (t = e.charCodeAt(u++), r = e.charCodeAt(u), a += i[t >>> 3] + i[31 & (t << 2 | r >>> 6)] + i[r >>> 1 & 31] + i[r << 4 & 31] + "====") : 3 === h ? (t = e.charCodeAt(u++), r = e.charCodeAt(u++), n = e.charCodeAt(u), a += i[t >>> 3] + i[31 & (t << 2 | r >>> 6)] + i[r >>> 1 & 31] + i[31 & (r << 4 | n >>> 4)] + i[n << 1 & 31] + "===") : 4 === h && (t = e.charCodeAt(u++), r = e.charCodeAt(u++), n = e.charCodeAt(u++), o = e.charCodeAt(u), a += i[t >>> 3] + i[31 & (t << 2 | r >>> 6)] + i[r >>> 1 & 31] + i[31 & (r << 4 | n >>> 4)] + i[31 & (n << 1 | o >>> 7)] + i[o >>> 2 & 31] + i[o << 3 & 31] + "="), a;
}(e) : function (e) {
var t,
r,
n,
o,
s,
a,
u,
l = !1,
h = "",
p = 0,
f = 0,
d = e.length;
if ("" === e) return h;
do {
for (c[0] = c[5], c[1] = c[6], c[2] = c[7], u = f; p < d && u < 5; ++p) (a = e.charCodeAt(p)) < 128 ? c[u++] = a : a < 2048 ? (c[u++] = 192 | a >> 6, c[u++] = 128 | 63 & a) : a < 55296 || a >= 57344 ? (c[u++] = 224 | a >> 12, c[u++] = 128 | a >> 6 & 63, c[u++] = 128 | 63 & a) : (a = 65536 + ((1023 & a) << 10 | 1023 & e.charCodeAt(++p)), c[u++] = 240 | a >> 18, c[u++] = 128 | a >> 12 & 63, c[u++] = 128 | a >> 6 & 63, c[u++] = 128 | 63 & a);
f = u - 5, p === d && ++p, p > d && u < 6 && (l = !0), t = c[0], u > 4 ? (r = c[1], n = c[2], o = c[3], s = c[4], h += i[t >>> 3] + i[31 & (t << 2 | r >>> 6)] + i[r >>> 1 & 31] + i[31 & (r << 4 | n >>> 4)] + i[31 & (n << 1 | o >>> 7)] + i[o >>> 2 & 31] + i[31 & (o << 3 | s >>> 5)] + i[31 & s]) : 1 === u ? h += i[t >>> 3] + i[t << 2 & 31] + "======" : 2 === u ? (r = c[1], h += i[t >>> 3] + i[31 & (t << 2 | r >>> 6)] + i[r >>> 1 & 31] + i[r << 4 & 31] + "====") : 3 === u ? (r = c[1], n = c[2], h += i[t >>> 3] + i[31 & (t << 2 | r >>> 6)] + i[r >>> 1 & 31] + i[31 & (r << 4 | n >>> 4)] + i[n << 1 & 31] + "===") : (r = c[1], n = c[2], o = c[3], h += i[t >>> 3] + i[31 & (t << 2 | r >>> 6)] + i[r >>> 1 & 31] + i[31 & (r << 4 | n >>> 4)] + i[31 & (n << 1 | o >>> 7)] + i[o >>> 2 & 31] + i[o << 3 & 31] + "=");
} while (!l);
return h;
}(e);
},
decode: h
};
h.asBytes = l, o ? e.exports = p : (t.base32 = p, s && (void 0 === (n = function () {
return p;
}.call(p, r, p, e)) || (e.exports = n)));
}();
},
4525: (e, t) => {
t.read = function (e, t, r, n, o) {
var s,
i,
a = 8 * o - n - 1,
c = (1 << a) - 1,
u = c >> 1,
l = -7,
h = r ? o - 1 : 0,
p = r ? -1 : 1,
f = e[t + h];
for (h += p, s = f & (1 << -l) - 1, f >>= -l, l += a; l > 0; s = 256 * s + e[t + h], h += p, l -= 8);
for (i = s & (1 << -l) - 1, s >>= -l, l += n; l > 0; i = 256 * i + e[t + h], h += p, l -= 8);
if (0 === s) s = 1 - u;else {
if (s === c) return i ? NaN : 1 / 0 * (f ? -1 : 1);
i += Math.pow(2, n), s -= u;
}
return (f ? -1 : 1) * i * Math.pow(2, s - n);
}, t.write = function (e, t, r, n, o, s) {
var i,
a,
c,
u = 8 * s - o - 1,
l = (1 << u) - 1,
h = l >> 1,
p = 23 === o ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
f = n ? 0 : s - 1,
d = n ? 1 : -1,
g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (a = isNaN(t) ? 1 : 0, i = l) : (i = Math.floor(Math.log(t) / Math.LN2), t * (c = Math.pow(2, -i)) < 1 && (i--, c *= 2), (t += i + h >= 1 ? p / c : p * Math.pow(2, 1 - h)) * c >= 2 && (i++, c /= 2), i + h >= l ? (a = 0, i = l) : i + h >= 1 ? (a = (t * c - 1) * Math.pow(2, o), i += h) : (a = t * Math.pow(2, h - 1) * Math.pow(2, o), i = 0)); o >= 8; e[r + f] = 255 & a, f += d, a /= 256, o -= 8);
for (i = i << o | a, u += o; u > 0; e[r + f] = 255 & i, f += d, i /= 256, u -= 8);
e[r + f - d] |= 128 * g;
};
},
3477: (module, exports, __webpack_require__) => {
var __WEBPACK_AMD_DEFINE_RESULT__;
(function () {
"use strict";
var ERROR = "input is invalid type",
WINDOW = "object" == typeof window,
root = WINDOW ? window : {};
root.JS_SHA256_NO_WINDOW && (WINDOW = !1);
var WEB_WORKER = !WINDOW && "object" == typeof self,
NODE_JS = !root.JS_SHA256_NO_NODE_JS && "object" == typeof process && process.versions && process.versions.node;
NODE_JS ? root = __webpack_require__.g : WEB_WORKER && (root = self);
var COMMON_JS = !root.JS_SHA256_NO_COMMON_JS && module.exports,
AMD = __webpack_require__.amdO,
ARRAY_BUFFER = !root.JS_SHA256_NO_ARRAY_BUFFER && "undefined" != typeof ArrayBuffer,
HEX_CHARS = "0123456789abcdef".split(""),
EXTRA = [-2147483648, 8388608, 32768, 128],
SHIFT = [24, 16, 8, 0],
K = [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298],
OUTPUT_TYPES = ["hex", "array", "digest", "arrayBuffer"],
blocks = [];
!root.JS_SHA256_NO_NODE_JS && Array.isArray || (Array.isArray = function (e) {
return "[object Array]" === Object.prototype.toString.call(e);
}), !ARRAY_BUFFER || !root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW && ArrayBuffer.isView || (ArrayBuffer.isView = function (e) {
return "object" == typeof e && e.buffer && e.buffer.constructor === ArrayBuffer;
});
var createOutputMethod = function (e, t) {
return function (r) {
return new Sha256(t, !0).update(r)[e]();
};
},
createMethod = function (e) {
var t = createOutputMethod("hex", e);
NODE_JS && (t = nodeWrap(t, e)), t.create = function () {
return new Sha256(e);
}, t.update = function (e) {
return t.create().update(e);
};
for (var r = 0; r < OUTPUT_TYPES.length; ++r) {
var n = OUTPUT_TYPES[r];
t[n] = createOutputMethod(n, e);
}
return t;
},
nodeWrap = function (method, is224) {
var crypto = eval("require('crypto')"),
Buffer = eval("require('buffer').Buffer"),
algorithm = is224 ? "sha224" : "sha256",
nodeMethod = function (e) {
if ("string" == typeof e) return crypto.createHash(algorithm).update(e, "utf8").digest("hex");
if (null == e) throw new Error(ERROR);
return e.constructor === ArrayBuffer && (e = new Uint8Array(e)), Array.isArray(e) || ArrayBuffer.isView(e) || e.constructor === Buffer ? crypto.createHash(algorithm).update(new Buffer(e)).digest("hex") : method(e);
};
return nodeMethod;
},
createHmacOutputMethod = function (e, t) {
return function (r, n) {
return new HmacSha256(r, t, !0).update(n)[e]();
};
},
createHmacMethod = function (e) {
var t = createHmacOutputMethod("hex", e);
t.create = function (t) {
return new HmacSha256(t, e);
}, t.update = function (e, r) {
return t.create(e).update(r);
};
for (var r = 0; r < OUTPUT_TYPES.length; ++r) {
var n = OUTPUT_TYPES[r];
t[n] = createHmacOutputMethod(n, e);
}
return t;
};
function Sha256(e, t) {
t ? (blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0, this.blocks = blocks) : this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], e ? (this.h0 = 3238371032, this.h1 = 914150663, this.h2 = 812702999, this.h3 = 4144912697, this.h4 = 4290775857, this.h5 = 1750603025, this.h6 = 1694076839, this.h7 = 3204075428) : (this.h0 = 1779033703, this.h1 = 3144134277, this.h2 = 1013904242, this.h3 = 2773480762, this.h4 = 1359893119, this.h5 = 2600822924, this.h6 = 528734635, this.h7 = 1541459225), this.block = this.start = this.bytes = this.hBytes = 0, this.finalized = this.hashed = !1, this.first = !0, this.is224 = e;
}
function HmacSha256(e, t, r) {
var n,
o = typeof e;
if ("string" === o) {
var s,
i = [],
a = e.length,
c = 0;
for (n = 0; n < a; ++n) (s = e.charCodeAt(n)) < 128 ? i[c++] = s : s < 2048 ? (i[c++] = 192 | s >> 6, i[c++] = 128 | 63 & s) : s < 55296 || s >= 57344 ? (i[c++] = 224 | s >> 12, i[c++] = 128 | s >> 6 & 63, i[c++] = 128 | 63 & s) : (s = 65536 + ((1023 & s) << 10 | 1023 & e.charCodeAt(++n)), i[c++] = 240 | s >> 18, i[c++] = 128 | s >> 12 & 63, i[c++] = 128 | s >> 6 & 63, i[c++] = 128 | 63 & s);
e = i;
} else {
if ("object" !== o) throw new Error(ERROR);
if (null === e) throw new Error(ERROR);
if (ARRAY_BUFFER && e.constructor === ArrayBuffer) e = new Uint8Array(e);else if (!(Array.isArray(e) || ARRAY_BUFFER && ArrayBuffer.isView(e))) throw new Error(ERROR);
}
e.length > 64 && (e = new Sha256(t, !0).update(e).array());
var u = [],
l = [];
for (n = 0; n < 64; ++n) {
var h = e[n] || 0;
u[n] = 92 ^ h, l[n] = 54 ^ h;
}
Sha256.call(this, t, r), this.update(l), this.oKeyPad = u, this.inner = !0, this.sharedMemory = r;
}
Sha256.prototype.update = function (e) {
if (!this.finalized) {
var t,
r = typeof e;
if ("string" !== r) {
if ("object" !== r) throw new Error(ERROR);
if (null === e) throw new Error(ERROR);
if (ARRAY_BUFFER && e.constructor === ArrayBuffer) e = new Uint8Array(e);else if (!(Array.isArray(e) || ARRAY_BUFFER && ArrayBuffer.isView(e))) throw new Error(ERROR);
t = !0;
}
for (var n, o, s = 0, i = e.length, a = this.blocks; s < i;) {
if (this.hashed && (this.hashed = !1, a[0] = this.block, a[16] = a[1] = a[2] = a[3] = a[4] = a[5] = a[6] = a[7] = a[8] = a[9] = a[10] = a[11] = a[12] = a[13] = a[14] = a[15] = 0), t) for (o = this.start; s < i && o < 64; ++s) a[o >> 2] |= e[s] << SHIFT[3 & o++];else for (o = this.start; s < i && o < 64; ++s) (n = e.charCodeAt(s)) < 128 ? a[o >> 2] |= n << SHIFT[3 & o++] : n < 2048 ? (a[o >> 2] |= (192 | n >> 6) << SHIFT[3 & o++], a[o >> 2] |= (128 | 63 & n) << SHIFT[3 & o++]) : n < 55296 || n >= 57344 ? (a[o >> 2] |= (224 | n >> 12) << SHIFT[3 & o++], a[o >> 2] |= (128 | n >> 6 & 63) << SHIFT[3 & o++], a[o >> 2] |= (128 | 63 & n) << SHIFT[3 & o++]) : (n = 65536 + ((1023 & n) << 10 | 1023 & e.charCodeAt(++s)), a[o >> 2] |= (240 | n >> 18) << SHIFT[3 & o++], a[o >> 2] |= (128 | n >> 12 & 63) << SHIFT[3 & o++], a[o >> 2] |= (128 | n >> 6 & 63) << SHIFT[3 & o++], a[o >> 2] |= (128 | 63 & n) << SHIFT[3 & o++]);
this.lastByteIndex = o, this.bytes += o - this.start, o >= 64 ? (this.block = a[16], this.start = o - 64, this.hash(), this.hashed = !0) : this.start = o;
}
return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296), this;
}
}, Sha256.prototype.finalize = function () {
if (!this.finalized) {
this.finalized = !0;
var e = this.blocks,
t = this.lastByteIndex;
e[16] = this.block, e[t >> 2] |= EXTRA[3 & t], this.block = e[16], t >= 56 && (this.hashed || this.hash(), e[0] = this.block, e[16] = e[1] = e[2] = e[3] = e[4] = e[5] = e[6] = e[7] = e[8] = e[9] = e[10] = e[11] = e[12] = e[13] = e[14] = e[15] = 0), e[14] = this.hBytes << 3 | this.bytes >>> 29, e[15] = this.bytes << 3, this.hash();
}
}, Sha256.prototype.hash = function () {
var e,
t,
r,
n,
o,
s,
i,
a,
c,
u = this.h0,
l = this.h1,
h = this.h2,
p = this.h3,
f = this.h4,
d = this.h5,
g = this.h6,
y = this.h7,
m = this.blocks;
for (e = 16; e < 64; ++e) t = ((o = m[e - 15]) >>> 7 | o << 25) ^ (o >>> 18 | o << 14) ^ o >>> 3, r = ((o = m[e - 2]) >>> 17 | o << 15) ^ (o >>> 19 | o << 13) ^ o >>> 10, m[e] = m[e - 16] + t + m[e - 7] + r << 0;
for (c = l & h, e = 0; e < 64; e += 4) this.first ? (this.is224 ? (s = 300032, y = (o = m[0] - 1413257819) - 150054599 << 0, p = o + 24177077 << 0) : (s = 704751109, y = (o = m[0] - 210244248) - 1521486534 << 0, p = o + 143694565 << 0), this.first = !1) : (t = (u >>> 2 | u << 30) ^ (u >>> 13 | u << 19) ^ (u >>> 22 | u << 10), n = (s = u & l) ^ u & h ^ c, y = p + (o = y + (r = (f >>> 6 | f << 26) ^ (f >>> 11 | f << 21) ^ (f >>> 25 | f << 7)) + (f & d ^ ~f & g) + K[e] + m[e]) << 0, p = o + (t + n) << 0), t = (p >>> 2 | p << 30) ^ (p >>> 13 | p << 19) ^ (p >>> 22 | p << 10), n = (i = p & u) ^ p & l ^ s, g = h + (o = g + (r = (y >>> 6 | y << 26) ^ (y >>> 11 | y << 21) ^ (y >>> 25 | y << 7)) + (y & f ^ ~y & d) + K[e + 1] + m[e + 1]) << 0, t = ((h = o + (t + n) << 0) >>> 2 | h << 30) ^ (h >>> 13 | h << 19) ^ (h >>> 22 | h << 10), n = (a = h & p) ^ h & u ^ i, d = l + (o = d + (r = (g >>> 6 | g << 26) ^ (g >>> 11 | g << 21) ^ (g >>> 25 | g << 7)) + (g & y ^ ~g & f) + K[e + 2] + m[e + 2]) << 0, t = ((l = o + (t + n) << 0) >>> 2 | l << 30) ^ (l >>> 13 | l << 19) ^ (l >>> 22 | l << 10), n = (c = l & h) ^ l & p ^ a, f = u + (o = f + (r = (d >>> 6 | d << 26) ^ (d >>> 11 | d << 21) ^ (d >>> 25 | d << 7)) + (d & g ^ ~d & y) + K[e + 3] + m[e + 3]) << 0, u = o + (t + n) << 0;
this.h0 = this.h0 + u << 0, this.h1 = this.h1 + l << 0, this.h2 = this.h2 + h << 0, this.h3 = this.h3 + p << 0, this.h4 = this.h4 + f << 0, this.h5 = this.h5 + d << 0, this.h6 = this.h6 + g << 0, this.h7 = this.h7 + y << 0;
}, Sha256.prototype.hex = function () {
this.finalize();
var e = this.h0,
t = this.h1,
r = this.h2,
n = this.h3,
o = this.h4,
s = this.h5,
i = this.h6,
a = this.h7,
c = HEX_CHARS[e >> 28 & 15] + HEX_CHARS[e >> 24 & 15] + HEX_CHARS[e >> 20 & 15] + HEX_CHARS[e >> 16 & 15] + HEX_CHARS[e >> 12 & 15] + HEX_CHARS[e >> 8 & 15] + HEX_CHARS[e >> 4 & 15] + HEX_CHARS[15 & e] + HEX_CHARS[t >> 28 & 15] + HEX_CHARS[t >> 24 & 15] + HEX_CHARS[t >> 20 & 15] + HEX_CHARS[t >> 16 & 15] + HEX_CHARS[t >> 12 & 15] + HEX_CHARS[t >> 8 & 15] + HEX_CHARS[t >> 4 & 15] + HEX_CHARS[15 & t] + HEX_CHARS[r >> 28 & 15] + HEX_CHARS[r >> 24 & 15] + HEX_CHARS[r >> 20 & 15] + HEX_CHARS[r >> 16 & 15] + HEX_CHARS[r >> 12 & 15] + HEX_CHARS[r >> 8 & 15] + HEX_CHARS[r >> 4 & 15] + HEX_CHARS[15 & r] + HEX_CHARS[n >> 28 & 15] + HEX_CHARS[n >> 24 & 15] + HEX_CHARS[n >> 20 & 15] + HEX_CHARS[n >> 16 & 15] + HEX_CHARS[n >> 12 & 15] + HEX_CHARS[n >> 8 & 15] + HEX_CHARS[n >> 4 & 15] + HEX_CHARS[15 & n] + HEX_CHARS[o >> 28 & 15] + HEX_CHARS[o >> 24 & 15] + HEX_CHARS[o >> 20 & 15] + HEX_CHARS[o >> 16 & 15] + HEX_CHARS[o >> 12 & 15] + HEX_CHARS[o >> 8 & 15] + HEX_CHARS[o >> 4 & 15] + HEX_CHARS[15 & o] + HEX_CHARS[s >> 28 & 15] + HEX_CHARS[s >> 24 & 15] + HEX_CHARS[s >> 20 & 15] + HEX_CHARS[s >> 16 & 15] + HEX_CHARS[s >> 12 & 15] + HEX_CHARS[s >> 8 & 15] + HEX_CHARS[s >> 4 & 15] + HEX_CHARS[15 & s] + HEX_CHARS[i >> 28 & 15] + HEX_CHARS[i >> 24 & 15] + HEX_CHARS[i >> 20 & 15] + HEX_CHARS[i >> 16 & 15] + HEX_CHARS[i >> 12 & 15] + HEX_CHARS[i >> 8 & 15] + HEX_CHARS[i >> 4 & 15] + HEX_CHARS[15 & i];
return this.is224 || (c += HEX_CHARS[a >> 28 & 15] + HEX_CHARS[a >> 24 & 15] + HEX_CHARS[a >> 20 & 15] + HEX_CHARS[a >> 16 & 15] + HEX_CHARS[a >> 12 & 15] + HEX_CHARS[a >> 8 & 15] + HEX_CHARS[a >> 4 & 15] + HEX_CHARS[15 & a]), c;
}, Sha256.prototype.toString = Sha256.prototype.hex, Sha256.prototype.digest = function () {
this.finalize();
var e = this.h0,
t = this.h1,
r = this.h2,
n = this.h3,
o = this.h4,
s = this.h5,
i = this.h6,
a = this.h7,
c = [e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, 255 & e, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, 255 & t, r >> 24 & 255, r >> 16 & 255, r >> 8 & 255, 255 & r, n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, 255 & n, o >> 24 & 255, o >> 16 & 255, o >> 8 & 255, 255 & o, s >> 24 & 255, s >> 16 & 255, s >> 8 & 255, 255 & s, i >> 24 & 255, i >> 16 & 255, i >> 8 & 255, 255 & i];
return this.is224 || c.push(a >> 24 & 255, a >> 16 & 255, a >> 8 & 255, 255 & a), c;
}, Sha256.prototype.array = Sha256.prototype.digest, Sha256.prototype.arrayBuffer = function () {
this.finalize();
var e = new ArrayBuffer(this.is224 ? 28 : 32),
t = new DataView(e);
return t.setUint32(0, this.h0), t.setUint32(4, this.h1), t.setUint32(8, this.h2), t.setUint32(12, this.h3), t.setUint32(16, this.h4), t.setUint32(20, this.h5), t.setUint32(24, this.h6), this.is224 || t.setUint32(28, this.h7), e;
}, HmacSha256.prototype = new Sha256(), HmacSha256.prototype.finalize = function () {
if (Sha256.prototype.finalize.call(this), this.inner) {
this.inner = !1;
var e = this.array();
Sha256.call(this, this.is224, this.sharedMemory), this.update(this.oKeyPad), this.update(e), Sha256.prototype.finalize.call(this);
}
};
var exports = createMethod();
exports.sha256 = exports, exports.sha224 = createMethod(!0), exports.sha256.hmac = createHmacMethod(), exports.sha224.hmac = createHmacMethod(!0), COMMON_JS ? module.exports = exports : (root.sha256 = exports.sha256, root.sha224 = exports.sha224, AMD && (__WEBPACK_AMD_DEFINE_RESULT__ = function () {
return exports;
}.call(exports, __webpack_require__, exports, module), void 0 === __WEBPACK_AMD_DEFINE_RESULT__ || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)));
})();
},
583: (e, t, r) => {
var n;
!function () {
"use strict";
var o = "input is invalid type",
s = "object" == typeof window,
i = s ? window : {};
i.JS_SHA3_NO_WINDOW && (s = !1);
var a = !s && "object" == typeof self;
!i.JS_SHA3_NO_NODE_JS && "object" == typeof process && process.versions && process.versions.node ? i = r.g : a && (i = self);
var c = !i.JS_SHA3_NO_COMMON_JS && e.exports,
u = r.amdO,
l = !i.JS_SHA3_NO_ARRAY_BUFFER && "undefined" != typeof ArrayBuffer,
h = "0123456789abcdef".split(""),
p = [4, 1024, 262144, 67108864],
f = [0, 8, 16, 24],
d = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648],
g = [224, 256, 384, 512],
y = [128, 256],
m = ["hex", "buffer", "arrayBuffer", "array", "digest"],
b = {
128: 168,
256: 136
};
!i.JS_SHA3_NO_NODE_JS && Array.isArray || (Array.isArray = function (e) {
return "[object Array]" === Object.prototype.toString.call(e);
}), !l || !i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW && ArrayBuffer.isView || (ArrayBuffer.isView = function (e) {
return "object" == typeof e && e.buffer && e.buffer.constructor === ArrayBuffer;
});
for (var w = function (e, t, r) {
return function (n) {
return new D(e, t, e).update(n)[r]();
};
}, A = function (e, t, r) {
return function (n, o) {
return new D(e, t, o).update(n)[r]();
};
}, v = function (e, t, r) {
return function (t, n, o, s) {
return _["cshake" + e].update(t, n, o, s)[r]();
};
}, x = function (e, t, r) {
return function (t, n, o, s) {
return _["kmac" + e].update(t, n, o, s)[r]();
};
}, S = function (e, t, r, n) {
for (var o = 0; o < m.length; ++o) {
var s = m[o];
e[s] = t(r, n, s);
}
return e;
}, E = function (e, t) {
var r = w(e, t, "hex");
return r.create = function () {
return new D(e, t, e);
}, r.update = function (e) {
return r.create().update(e);
}, S(r, w, e, t);
}, T = [{
name: "keccak",
padding: [1, 256, 65536, 16777216],
bits: g,
createMethod: E
}, {
name: "sha3",
padding: [6, 1536, 393216, 100663296],
bits: g,
createMethod: E
}, {
name: "shake",
padding: [31, 7936, 2031616, 520093696],
bits: y,
createMethod: function (e, t) {
var r = A(e, t, "hex");
return r.create = function (r) {
return new D(e, t, r);
}, r.update = function (e, t) {
return r.create(t).update(e);
}, S(r, A, e, t);
}
}, {
name: "cshake",
padding: p,
bits: y,
createMethod: function (e, t) {
var r = b[e],
n = v(e, 0, "hex");
return n.create = function (n, o, s) {
return o || s ? new D(e, t, n).bytepad([o, s], r) : _["shake" + e].create(n);
}, n.update = function (e, t, r, o) {
return n.create(t, r, o).update(e);
}, S(n, v, e, t);
}
}, {
name: "kmac",
padding: p,
bits: y,
createMethod: function (e, t) {
var r = b[e],
n = x(e, 0, "hex");
return n.create = function (n, o, s) {
return new N(e, t, o).bytepad(["KMAC", s], r).bytepad([n], r);
}, n.update = function (e, t, r, o) {
return n.create(e, r, o).update(t);
}, S(n, x, e, t);
}
}], _ = {}, B = [], k = 0; k < T.length; ++k) for (var I = T[k], U = I.bits, C = 0; C < U.length; ++C) {
var R = I.name + "_" + U[C];
if (B.push(R), _[R] = I.createMethod(U[C], I.padding), "sha3" !== I.name) {
var O = I.name + U[C];
B.push(O), _[O] = _[R];
}
}
function D(e, t, r) {
this.blocks = [], this.s = [], this.padding = t, this.outputBits = r, this.reset = !0, this.finalized = !1, this.block = 0, this.start = 0, this.blockCount = 1600 - (e << 1) >> 5, this.byteCount = this.blockCount << 2, this.outputBlocks = r >> 5, this.extraBytes = (31 & r) >> 3;
for (var n = 0; n < 50; ++n) this.s[n] = 0;
}
function N(e, t, r) {
D.call(this, e, t, r);
}
D.prototype.update = function (e) {
if (this.finalized) throw new Error("finalize already called");
var t,
r = typeof e;
if ("string" !== r) {
if ("object" !== r) throw new Error(o);
if (null === e) throw new Error(o);
if (l && e.constructor === ArrayBuffer) e = new Uint8Array(e);else if (!(Array.isArray(e) || l && ArrayBuffer.isView(e))) throw new Error(o);
t = !0;
}
for (var n, s, i = this.blocks, a = this.byteCount, c = e.length, u = this.blockCount, h = 0, p = this.s; h < c;) {
if (this.reset) for (this.reset = !1, i[0] = this.block, n = 1; n < u + 1; ++n) i[n] = 0;
if (t) for (n = this.start; h < c && n < a; ++h) i[n >> 2] |= e[h] << f[3 & n++];else for (n = this.start; h < c && n < a; ++h) (s = e.charCodeAt(h)) < 128 ? i[n >> 2] |= s << f[3 & n++] : s < 2048 ? (i[n >> 2] |= (192 | s >> 6) << f[3 & n++], i[n >> 2] |= (128 | 63 & s) << f[3 & n++]) : s < 55296 || s >= 57344 ? (i[n >> 2] |= (224 | s >> 12) << f[3 & n++], i[n >> 2] |= (128 | s >> 6 & 63) << f[3 & n++], i[n >> 2] |= (128 | 63 & s) << f[3 & n++]) : (s = 65536 + ((1023 & s) << 10 | 1023 & e.charCodeAt(++h)), i[n >> 2] |= (240 | s >> 18) << f[3 & n++], i[n >> 2] |= (128 | s >> 12 & 63) << f[3 & n++], i[n >> 2] |= (128 | s >> 6 & 63) << f[3 & n++], i[n >> 2] |= (128 | 63 & s) << f[3 & n++]);
if (this.lastByteIndex = n, n >= a) {
for (this.start = n - a, this.block = i[u], n = 0; n < u; ++n) p[n] ^= i[n];
P(p), this.reset = !0;
} else this.start = n;
}
return this;
}, D.prototype.encode = function (e, t) {
var r = 255 & e,
n = 1,
o = [r];
for (r = 255 & (e >>= 8); r > 0;) o.unshift(r), r = 255 & (e >>= 8), ++n;
return t ? o.push(n) : o.unshift(n), this.update(o), o.length;
}, D.prototype.encodeString = function (e) {
var t,
r = typeof e;
if ("string" !== r) {
if ("object" !== r) throw new Error(o);
if (null === e) throw new Error(o);
if (l && e.constructor === ArrayBuffer) e = new Uint8Array(e);else if (!(Array.isArray(e) || l && ArrayBuffer.isView(e))) throw new Error(o);
t = !0;
}
var n = 0,
s = e.length;
if (t) n = s;else for (var i = 0; i < e.length; ++i) {
var a = e.charCodeAt(i);
a < 128 ? n += 1 : a < 2048 ? n += 2 : a < 55296 || a >= 57344 ? n += 3 : (a = 65536 + ((1023 & a) << 10 | 1023 & e.charCodeAt(++i)), n += 4);
}
return n += this.encode(8 * n), this.update(e), n;
}, D.prototype.bytepad = function (e, t) {
for (var r = this.encode(t), n = 0; n < e.length; ++n) r += this.encodeString(e[n]);
var o = t - r % t,
s = [];
return s.length = o, this.update(s), this;
}, D.prototype.finalize = function () {
if (!this.finalized) {
this.finalized = !0;
var e = this.blocks,
t = this.lastByteIndex,
r = this.blockCount,
n = this.s;
if (e[t >> 2] |= this.padding[3 & t], this.lastByteIndex === this.byteCount) for (e[0] = e[r], t = 1; t < r + 1; ++t) e[t] = 0;
for (e[r - 1] |= 2147483648, t = 0; t < r; ++t) n[t] ^= e[t];
P(n);
}
}, D.prototype.toString = D.prototype.hex = function () {
this.finalize();
for (var e, t = this.blockCount, r = this.s, n = this.outputBlocks, o = this.extraBytes, s = 0, i = 0, a = ""; i < n;) {
for (s = 0; s < t && i < n; ++s, ++i) e = r[s], a += h[e >> 4 & 15] + h[15 & e] + h[e >> 12 & 15] + h[e >> 8 & 15] + h[e >> 20 & 15] + h[e >> 16 & 15] + h[e >> 28 & 15] + h[e >> 24 & 15];
i % t == 0 && (P(r), s = 0);
}
return o && (e = r[s], a += h[e >> 4 & 15] + h[15 & e], o > 1 && (a += h[e >> 12 & 15] + h[e >> 8 & 15]), o > 2 && (a += h[e >> 20 & 15] + h[e >> 16 & 15])), a;
}, D.prototype.arrayBuffer = function () {
this.finalize();
var e,
t = this.blockCount,
r = this.s,
n = this.outputBlocks,
o = this.extraBytes,
s = 0,
i = 0,
a = this.outputBits >> 3;
e = o ? new ArrayBuffer(n + 1 << 2) : new ArrayBuffer(a);
for (var c = new Uint32Array(e); i < n;) {
for (s = 0; s < t && i < n; ++s, ++i) c[i] = r[s];
i % t == 0 && P(r);
}
return o && (c[s] = r[s], e = e.slice(0, a)), e;
}, D.prototype.buffer = D.prototype.arrayBuffer, D.prototype.digest = D.prototype.array = function () {
this.finalize();
for (var e, t, r = this.blockCount, n = this.s, o = this.outputBlocks, s = this.extraBytes, i = 0, a = 0, c = []; a < o;) {
for (i = 0; i < r && a < o; ++i, ++a) e = a << 2, t = n[i], c[e] = 255 & t, c[e + 1] = t >> 8 & 255, c[e + 2] = t >> 16 & 255, c[e + 3] = t >> 24 & 255;
a % r == 0 && P(n);
}
return s && (e = a << 2, t = n[i], c[e] = 255 & t, s > 1 && (c[e + 1] = t >> 8 & 255), s > 2 && (c[e + 2] = t >> 16 & 255)), c;
}, N.prototype = new D(), N.prototype.finalize = function () {
return this.encode(this.outputBits, !0), D.prototype.finalize.call(this);
};
var P = function (e) {
var t, r, n, o, s, i, a, c, u, l, h, p, f, g, y, m, b, w, A, v, x, S, E, T, _, B, k, I, U, C, R, O, D, N, P, L, F, j, z, M, H, G, K, q, $, V, W, X, Y, J, Q, Z, ee, te, re, ne, oe, se, ie, ae, ce, ue, le;
for (n = 0; n < 48; n += 2) o = e[0] ^ e[10] ^ e[20] ^ e[30] ^ e[40], s = e[1] ^ e[11] ^ e[21] ^ e[31] ^ e[41], i = e[2] ^ e[12] ^ e[22] ^ e[32] ^ e[42], a = e[3] ^ e[13] ^ e[23] ^ e[33] ^ e[43], c = e[4] ^ e[14] ^ e[24] ^ e[34] ^ e[44], u = e[5] ^ e[15] ^ e[25] ^ e[35] ^ e[45], l = e[6] ^ e[16] ^ e[26] ^ e[36] ^ e[46], h = e[7] ^ e[17] ^ e[27] ^ e[37] ^ e[47], t = (p = e[8] ^ e[18] ^ e[28] ^ e[38] ^ e[48]) ^ (i << 1 | a >>> 31), r = (f = e[9] ^ e[19] ^ e[29] ^ e[39] ^ e[49]) ^ (a << 1 | i >>> 31), e[0] ^= t, e[1] ^= r, e[10] ^= t, e[11] ^= r, e[20] ^= t, e[21] ^= r, e[30] ^= t, e[31] ^= r, e[40] ^= t, e[41] ^= r, t = o ^ (c << 1 | u >>> 31), r = s ^ (u << 1 | c >>> 31), e[2] ^= t, e[3] ^= r, e[12] ^= t, e[13] ^= r, e[22] ^= t, e[23] ^= r, e[32] ^= t, e[33] ^= r, e[42] ^= t, e[43] ^= r, t = i ^ (l << 1 | h >>> 31), r = a ^ (h << 1 | l >>> 31), e[4] ^= t, e[5] ^= r, e[14] ^= t, e[15] ^= r, e[24] ^= t, e[25] ^= r, e[34] ^= t, e[35] ^= r, e[44] ^= t, e[45] ^= r, t = c ^ (p << 1 | f >>> 31), r = u ^ (f << 1 | p >>> 31), e[6] ^= t, e[7] ^= r, e[16] ^= t, e[17] ^= r, e[26] ^= t, e[27] ^= r, e[36] ^= t, e[37] ^= r, e[46] ^= t, e[47] ^= r, t = l ^ (o << 1 | s >>> 31), r = h ^ (s << 1 | o >>> 31), e[8] ^= t, e[9] ^= r, e[18] ^= t, e[19] ^= r, e[28] ^= t, e[29] ^= r, e[38] ^= t, e[39] ^= r, e[48] ^= t, e[49] ^= r, g = e[0], y = e[1], V = e[11] << 4 | e[10] >>> 28, W = e[10] << 4 | e[11] >>> 28, I = e[20] << 3 | e[21] >>> 29, U = e[21] << 3 | e[20] >>> 29, ae = e[31] << 9 | e[30] >>> 23, ce = e[30] << 9 | e[31] >>> 23, G = e[40] << 18 | e[41] >>> 14, K = e[41] << 18 | e[40] >>> 14, N = e[2] << 1 | e[3] >>> 31, P = e[3] << 1 | e[2] >>> 31, m = e[13] << 12 | e[12] >>> 20, b = e[12] << 12 | e[13] >>> 20, X = e[22] << 10 | e[23] >>> 22, Y = e[23] << 10 | e[22] >>> 22, C = e[33] << 13 | e[32] >>> 19, R = e[32] << 13 | e[33] >>> 19, ue = e[42] << 2 | e[43] >>> 30, le = e[43] << 2 | e[42] >>> 30, te = e[5] << 30 | e[4] >>> 2, re = e[4] << 30 | e[5] >>> 2, L = e[14] << 6 | e[15] >>> 26, F = e[15] << 6 | e[14] >>> 26, w = e[25] << 11 | e[24] >>> 21, A = e[24] << 11 | e[25] >>> 21, J = e[34] << 15 | e[35] >>> 17, Q = e[35] << 15 | e[34] >>> 17, O = e[45] << 29 | e[44] >>> 3, D = e[44] << 29 | e[45] >>> 3, T = e[6] << 28 | e[7] >>> 4, _ = e[7] << 28 | e[6] >>> 4, ne = e[17] << 23 | e[16] >>> 9, oe = e[16] << 23 | e[17] >>> 9, j = e[26] << 25 | e[27] >>> 7, z = e[27] << 25 | e[26] >>> 7, v = e[36] << 21 | e[37] >>> 11, x = e[37] << 21 | e[36] >>> 11, Z = e[47] << 24 | e[46] >>> 8, ee = e[46] << 24 | e[47] >>> 8, q = e[8] << 27 | e[9] >>> 5, $ = e[9] << 27 | e[8] >>> 5, B = e[18] << 20 | e[19] >>> 12, k = e[19] << 20 | e[18] >>> 12, se = e[29] << 7 | e[28] >>> 25, ie = e[28] << 7 | e[29] >>> 25, M = e[38] << 8 | e[39] >>> 24, H = e[39] << 8 | e[38] >>> 24, S = e[48] << 14 | e[49] >>> 18, E = e[49] << 14 | e[48] >>> 18, e[0] = g ^ ~m & w, e[1] = y ^ ~b & A, e[10] = T ^ ~B & I, e[11] = _ ^ ~k & U, e[20] = N ^ ~L & j, e[21] = P ^ ~F & z, e[30] = q ^ ~V & X, e[31] = $ ^ ~W & Y, e[40] = te ^ ~ne & se, e[41] = re ^ ~oe & ie, e[2] = m ^ ~w & v, e[3] = b ^ ~A & x, e[12] = B ^ ~I & C, e[13] = k ^ ~U & R, e[22] = L ^ ~j & M, e[23] = F ^ ~z & H, e[32] = V ^ ~X & J, e[33] = W ^ ~Y & Q, e[42] = ne ^ ~se & ae, e[43] = oe ^ ~ie & ce, e[4] = w ^ ~v & S, e[5] = A ^ ~x & E, e[14] = I ^ ~C & O, e[15] = U ^ ~R & D, e[24] = j ^ ~M & G, e[25] = z ^ ~H & K, e[34] = X ^ ~J & Z, e[35] = Y ^ ~Q & ee, e[44] = se ^ ~ae & ue, e[45] = ie ^ ~ce & le, e[6] = v ^ ~S & g, e[7] = x ^ ~E & y, e[16] = C ^ ~O & T, e[17] = R ^ ~D & _, e[26] = M ^ ~G & N, e[27] = H ^ ~K & P, e[36] = J ^ ~Z & q, e[37] = Q ^ ~ee & $, e[46] = ae ^ ~ue & te, e[47] = ce ^ ~le & re, e[8] = S ^ ~g & m, e[9] = E ^ ~y & b, e[18] = O ^ ~T & B, e[19] = D ^ ~_ & k, e[28] = G ^ ~N & L, e[29] = K ^ ~P & F, e[38] = Z ^ ~q & V, e[39] = ee ^ ~$ & W, e[48] = ue ^ ~te & ne, e[49] = le ^ ~re & oe, e[0] ^= d[n], e[1] ^= d[n + 1];
};
if (c) e.exports = _;else {
for (k = 0; k < B.length; ++k) i[B[k]] = _[B[k]];
u && (void 0 === (n = function () {
return _;
}.call(t, r, t, e)) || (e.exports = n));
}
}();
},
9757: (e, t, r) => {
var n;
!function () {
"use strict";
var t = "input is invalid type",
o = "object" == typeof window,
s = o ? window : {};
s.JS_SHA512_NO_WINDOW && (o = !1);
var i = !o && "object" == typeof self;
!s.JS_SHA512_NO_NODE_JS && "object" == typeof process && process.versions && process.versions.node ? s = r.g : i && (s = self);
var a = !s.JS_SHA512_NO_COMMON_JS && e.exports,
c = r.amdO,
u = !s.JS_SHA512_NO_ARRAY_BUFFER && "undefined" != typeof ArrayBuffer,
l = "0123456789abcdef".split(""),
h = [-2147483648, 8388608, 32768, 128],
p = [24, 16, 8, 0],
f = [1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591],
d = ["hex", "array", "digest", "arrayBuffer"],
g = [];
!s.JS_SHA512_NO_NODE_JS && Array.isArray || (Array.isArray = function (e) {
return "[object Array]" === Object.prototype.toString.call(e);
}), !u || !s.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW && ArrayBuffer.isView || (ArrayBuffer.isView = function (e) {
return "object" == typeof e && e.buffer && e.buffer.constructor === ArrayBuffer;
});
var y = function (e, t) {
return function (r) {
return new A(t, !0).update(r)[e]();
};
},
m = function (e) {
var t = y("hex", e);
t.create = function () {
return new A(e);
}, t.update = function (e) {
return t.create().update(e);
};
for (var r = 0; r < d.length; ++r) {
var n = d[r];
t[n] = y(n, e);
}
return t;
},
b = function (e, t) {
return function (r, n) {
return new v(r, t, !0).update(n)[e]();
};
},
w = function (e) {
var t = b("hex", e);
t.create = function (t) {
return new v(t, e);
}, t.update = function (e, r) {
return t.create(e).update(r);
};
for (var r = 0; r < d.length; ++r) {
var n = d[r];
t[n] = b(n, e);
}
return t;
};
function A(e, t) {
t ? (g[0] = g[1] = g[2] = g[3] = g[4] = g[5] = g[6] = g[7] = g[8] = g[9] = g[10] = g[11] = g[12] = g[13] = g[14] = g[15] = g[16] = g[17] = g[18] = g[19] = g[20] = g[21] = g[22] = g[23] = g[24] = g[25] = g[26] = g[27] = g[28] = g[29] = g[30] = g[31] = g[32] = 0, this.blocks = g) : this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 384 == e ? (this.h0h = 3418070365, this.h0l = 3238371032, this.h1h = 1654270250, this.h1l = 914150663, this.h2h = 2438529370, this.h2l = 812702999, this.h3h = 355462360, this.h3l = 4144912697, this.h4h = 1731405415, this.h4l = 4290775857, this.h5h = 2394180231, this.h5l = 1750603025, this.h6h = 3675008525, this.h6l = 1694076839, this.h7h = 1203062813, this.h7l = 3204075428) : 256 == e ? (this.h0h = 573645204, this.h0l = 4230739756, this.h1h = 2673172387, this.h1l = 3360449730, this.h2h = 596883563, this.h2l = 1867755857, this.h3h = 2520282905, this.h3l = 1497426621, this.h4h = 2519219938, this.h4l = 2827943907, this.h5h = 3193839141, this.h5l = 1401305490, this.h6h = 721525244, this.h6l = 746961066, this.h7h = 246885852, this.h7l = 2177182882) : 224 == e ? (this.h0h = 2352822216, this.h0l = 424955298, this.h1h = 1944164710, this.h1l = 2312950998, this.h2h = 502970286, this.h2l = 855612546, this.h3h = 1738396948, this.h3l = 1479516111, this.h4h = 258812777, this.h4l = 2077511080, this.h5h = 2011393907, this.h5l = 79989058, this.h6h = 1067287976, this.h6l = 1780299464, this.h7h = 286451373, this.h7l = 2446758561) : (this.h0h = 1779033703, this.h0l = 4089235720, this.h1h = 3144134277, this.h1l = 2227873595, this.h2h = 1013904242, this.h2l = 4271175723, this.h3h = 2773480762, this.h3l = 1595750129, this.h4h = 1359893119, this.h4l = 2917565137, this.h5h = 2600822924, this.h5l = 725511199, this.h6h = 528734635, this.h6l = 4215389547, this.h7h = 1541459225, this.h7l = 327033209), this.bits = e, this.block = this.start = this.bytes = this.hBytes = 0, this.finalized = this.hashed = !1;
}
function v(e, r, n) {
var o,
s = typeof e;
if ("string" !== s) {
if ("object" !== s) throw new Error(t);
if (null === e) throw new Error(t);
if (u && e.constructor === ArrayBuffer) e = new Uint8Array(e);else if (!(Array.isArray(e) || u && ArrayBuffer.isView(e))) throw new Error(t);
o = !0;
}
var i = e.length;
if (!o) {
for (var a, c = [], l = (i = e.length, 0), h = 0; h < i; ++h) (a = e.charCodeAt(h)) < 128 ? c[l++] = a : a < 2048 ? (c[l++] = 192 | a >> 6, c[l++] = 128 | 63 & a) : a < 55296 || a >= 57344 ? (c[l++] = 224 | a >> 12, c[l++] = 128 | a >> 6 & 63, c[l++] = 128 | 63 & a) : (a = 65536 + ((1023 & a) << 10 | 1023 & e.charCodeAt(++h)), c[l++] = 240 | a >> 18, c[l++] = 128 | a >> 12 & 63, c[l++] = 128 | a >> 6 & 63, c[l++] = 128 | 63 & a);
e = c;
}
e.length > 128 && (e = new A(r, !0).update(e).array());
var p = [],
f = [];
for (h = 0; h < 128; ++h) {
var d = e[h] || 0;
p[h] = 92 ^ d, f[h] = 54 ^ d;
}
A.call(this, r, n), this.update(f), this.oKeyPad = p, this.inner = !0, this.sharedMemory = n;
}
A.prototype.update = function (e) {
if (this.finalized) throw new Error("finalize already called");
var r,
n = typeof e;
if ("string" !== n) {
if ("object" !== n) throw new Error(t);
if (null === e) throw new Error(t);
if (u && e.constructor === ArrayBuffer) e = new Uint8Array(e);else if (!(Array.isArray(e) || u && ArrayBuffer.isView(e))) throw new Error(t);
r = !0;
}
for (var o, s, i = 0, a = e.length, c = this.blocks; i < a;) {
if (this.hashed && (this.hashed = !1, c[0] = this.block, c[1] = c[2] = c[3] = c[4] = c[5] = c[6] = c[7] = c[8] = c[9] = c[10] = c[11] = c[12] = c[13] = c[14] = c[15] = c[16] = c[17] = c[18] = c[19] = c[20] = c[21] = c[22] = c[23] = c[24] = c[25] = c[26] = c[27] = c[28] = c[29] = c[30] = c[31] = c[32] = 0), r) for (s = this.start; i < a && s < 128; ++i) c[s >> 2] |= e[i] << p[3 & s++];else for (s = this.start; i < a && s < 128; ++i) (o = e.charCodeAt(i)) < 128 ? c[s >> 2] |= o << p[3 & s++] : o < 2048 ? (c[s >> 2] |= (192 | o >> 6) << p[3 & s++], c[s >> 2] |= (128 | 63 & o) << p[3 & s++]) : o < 55296 || o >= 57344 ? (c[s >> 2] |= (224 | o >> 12) << p[3 & s++], c[s >> 2] |= (128 | o >> 6 & 63) << p[3 & s++], c[s >> 2] |= (128 | 63 & o) << p[3 & s++]) : (o = 65536 + ((1023 & o) << 10 | 1023 & e.charCodeAt(++i)), c[s >> 2] |= (240 | o >> 18) << p[3 & s++], c[s >> 2] |= (128 | o >> 12 & 63) << p[3 & s++], c[s >> 2] |= (128 | o >> 6 & 63) << p[3 & s++], c[s >> 2] |= (128 | 63 & o) << p[3 & s++]);
this.lastByteIndex = s, this.bytes += s - this.start, s >= 128 ? (this.block = c[32], this.start = s - 128, this.hash(), this.hashed = !0) : this.start = s;
}
return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296), this;
}, A.prototype.finalize = function () {
if (!this.finalized) {
this.finalized = !0;
var e = this.blocks,
t = this.lastByteIndex;
e[32] = this.block, e[t >> 2] |= h[3 & t], this.block = e[32], t >= 112 && (this.hashed || this.hash(), e[0] = this.block, e[1] = e[2] = e[3] = e[4] = e[5] = e[6] = e[7] = e[8] = e[9] = e[10] = e[11] = e[12] = e[13] = e[14] = e[15] = e[16] = e[17] = e[18] = e[19] = e[20] = e[21] = e[22] = e[23] = e[24] = e[25] = e[26] = e[27] = e[28] = e[29] = e[30] = e[31] = e[32] = 0), e[30] = this.hBytes << 3 | this.bytes >>> 29, e[31] = this.bytes << 3, this.hash();
}
}, A.prototype.hash = function () {
var e,
t,
r,
n,
o,
s,
i,
a,
c,
u,
l,
h,
p,
d,
g,
y,
m,
b,
w,
A,
v,
x,
S,
E,
T,
_ = this.h0h,
B = this.h0l,
k = this.h1h,
I = this.h1l,
U = this.h2h,
C = this.h2l,
R = this.h3h,
O = this.h3l,
D = this.h4h,
N = this.h4l,
P = this.h5h,
L = this.h5l,
F = this.h6h,
j = this.h6l,
z = this.h7h,
M = this.h7l,
H = this.blocks;
for (e = 32; e < 160; e += 2) t = ((A = H[e - 30]) >>> 1 | (v = H[e - 29]) << 31) ^ (A >>> 8 | v << 24) ^ A >>> 7, r = (v >>> 1 | A << 31) ^ (v >>> 8 | A << 24) ^ (v >>> 7 | A << 25), n = ((A = H[e - 4]) >>> 19 | (v = H[e - 3]) << 13) ^ (v >>> 29 | A << 3) ^ A >>> 6, o = (v >>> 19 | A << 13) ^ (A >>> 29 | v << 3) ^ (v >>> 6 | A << 26), A = H[e - 32], v = H[e - 31], c = ((x = H[e - 14]) >>> 16) + (A >>> 16) + (t >>> 16) + (n >>> 16) + ((a = (65535 & x) + (65535 & A) + (65535 & t) + (65535 & n) + ((i = ((S = H[e - 13]) >>> 16) + (v >>> 16) + (r >>> 16) + (o >>> 16) + ((s = (65535 & S) + (65535 & v) + (65535 & r) + (65535 & o)) >>> 16)) >>> 16)) >>> 16), H[e] = c << 16 | 65535 & a, H[e + 1] = i << 16 | 65535 & s;
var G = _,
K = B,
q = k,
$ = I,
V = U,
W = C,
X = R,
Y = O,
J = D,
Q = N,
Z = P,
ee = L,
te = F,
re = j,
ne = z,
oe = M;
for (y = q & V, m = $ & W, e = 0; e < 160; e += 8) t = (G >>> 28 | K << 4) ^ (K >>> 2 | G << 30) ^ (K >>> 7 | G << 25), r = (K >>> 28 | G << 4) ^ (G >>> 2 | K << 30) ^ (G >>> 7 | K << 25), n = (J >>> 14 | Q << 18) ^ (J >>> 18 | Q << 14) ^ (Q >>> 9 | J << 23), o = (Q >>> 14 | J << 18) ^ (Q >>> 18 | J << 14) ^ (J >>> 9 | Q << 23), b = (u = G & q) ^ G & V ^ y, w = (l = K & $) ^ K & W ^ m, E = J & Z ^ ~J & te, T = Q & ee ^ ~Q & re, A = H[e], v = H[e + 1], A = (c = ((x = f[e]) >>> 16) + (A >>> 16) + (E >>> 16) + (n >>> 16) + (ne >>> 16) + ((a = (65535 & x) + (65535 & A) + (65535 & E) + (65535 & n) + (65535 & ne) + ((i = ((S = f[e + 1]) >>> 16) + (v >>> 16) + (T >>> 16) + (o >>> 16) + (oe >>> 16) + ((s = (65535 & S) + (65535 & v) + (65535 & T) + (65535 & o) + (65535 & oe)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a, v = i << 16 | 65535 & s, x = (c = (b >>> 16) + (t >>> 16) + ((a = (65535 & b) + (65535 & t) + ((i = (w >>> 16) + (r >>> 16) + ((s = (65535 & w) + (65535 & r)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a, S = i << 16 | 65535 & s, ne = (c = (X >>> 16) + (A >>> 16) + ((a = (65535 & X) + (65535 & A) + ((i = (Y >>> 16) + (v >>> 16) + ((s = (65535 & Y) + (65535 & v)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a, oe = i << 16 | 65535 & s, t = ((X = (c = (x >>> 16) + (A >>> 16) + ((a = (65535 & x) + (65535 & A) + ((i = (S >>> 16) + (v >>> 16) + ((s = (65535 & S) + (65535 & v)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a) >>> 28 | (Y = i << 16 | 65535 & s) << 4) ^ (Y >>> 2 | X << 30) ^ (Y >>> 7 | X << 25), r = (Y >>> 28 | X << 4) ^ (X >>> 2 | Y << 30) ^ (X >>> 7 | Y << 25), n = (ne >>> 14 | oe << 18) ^ (ne >>> 18 | oe << 14) ^ (oe >>> 9 | ne << 23), o = (oe >>> 14 | ne << 18) ^ (oe >>> 18 | ne << 14) ^ (ne >>> 9 | oe << 23), b = (h = X & G) ^ X & q ^ u, w = (p = Y & K) ^ Y & $ ^ l, E = ne & J ^ ~ne & Z, T = oe & Q ^ ~oe & ee, A = H[e + 2], v = H[e + 3], A = (c = ((x = f[e + 2]) >>> 16) + (A >>> 16) + (E >>> 16) + (n >>> 16) + (te >>> 16) + ((a = (65535 & x) + (65535 & A) + (65535 & E) + (65535 & n) + (65535 & te) + ((i = ((S = f[e + 3]) >>> 16) + (v >>> 16) + (T >>> 16) + (o >>> 16) + (re >>> 16) + ((s = (65535 & S) + (65535 & v) + (65535 & T) + (65535 & o) + (65535 & re)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a, v = i << 16 | 65535 & s, x = (c = (b >>> 16) + (t >>> 16) + ((a = (65535 & b) + (65535 & t) + ((i = (w >>> 16) + (r >>> 16) + ((s = (65535 & w) + (65535 & r)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a, S = i << 16 | 65535 & s, te = (c = (V >>> 16) + (A >>> 16) + ((a = (65535 & V) + (65535 & A) + ((i = (W >>> 16) + (v >>> 16) + ((s = (65535 & W) + (65535 & v)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a, re = i << 16 | 65535 & s, t = ((V = (c = (x >>> 16) + (A >>> 16) + ((a = (65535 & x) + (65535 & A) + ((i = (S >>> 16) + (v >>> 16) + ((s = (65535 & S) + (65535 & v)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a) >>> 28 | (W = i << 16 | 65535 & s) << 4) ^ (W >>> 2 | V << 30) ^ (W >>> 7 | V << 25), r = (W >>> 28 | V << 4) ^ (V >>> 2 | W << 30) ^ (V >>> 7 | W << 25), n = (te >>> 14 | re << 18) ^ (te >>> 18 | re << 14) ^ (re >>> 9 | te << 23), o = (re >>> 14 | te << 18) ^ (re >>> 18 | te << 14) ^ (te >>> 9 | re << 23), b = (d = V & X) ^ V & G ^ h, w = (g = W & Y) ^ W & K ^ p, E = te & ne ^ ~te & J, T = re & oe ^ ~re & Q, A = H[e + 4], v = H[e + 5], A = (c = ((x = f[e + 4]) >>> 16) + (A >>> 16) + (E >>> 16) + (n >>> 16) + (Z >>> 16) + ((a = (65535 & x) + (65535 & A) + (65535 & E) + (65535 & n) + (65535 & Z) + ((i = ((S = f[e + 5]) >>> 16) + (v >>> 16) + (T >>> 16) + (o >>> 16) + (ee >>> 16) + ((s = (65535 & S) + (65535 & v) + (65535 & T) + (65535 & o) + (65535 & ee)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a, v = i << 16 | 65535 & s, x = (c = (b >>> 16) + (t >>> 16) + ((a = (65535 & b) + (65535 & t) + ((i = (w >>> 16) + (r >>> 16) + ((s = (65535 & w) + (65535 & r)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a, S = i << 16 | 65535 & s, Z = (c = (q >>> 16) + (A >>> 16) + ((a = (65535 & q) + (65535 & A) + ((i = ($ >>> 16) + (v >>> 16) + ((s = (65535 & $) + (65535 & v)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a, ee = i << 16 | 65535 & s, t = ((q = (c = (x >>> 16) + (A >>> 16) + ((a = (65535 & x) + (65535 & A) + ((i = (S >>> 16) + (v >>> 16) + ((s = (65535 & S) + (65535 & v)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a) >>> 28 | ($ = i << 16 | 65535 & s) << 4) ^ ($ >>> 2 | q << 30) ^ ($ >>> 7 | q << 25), r = ($ >>> 28 | q << 4) ^ (q >>> 2 | $ << 30) ^ (q >>> 7 | $ << 25), n = (Z >>> 14 | ee << 18) ^ (Z >>> 18 | ee << 14) ^ (ee >>> 9 | Z << 23), o = (ee >>> 14 | Z << 18) ^ (ee >>> 18 | Z << 14) ^ (Z >>> 9 | ee << 23), b = (y = q & V) ^ q & X ^ d, w = (m = $ & W) ^ $ & Y ^ g, E = Z & te ^ ~Z & ne, T = ee & re ^ ~ee & oe, A = H[e + 6], v = H[e + 7], A = (c = ((x = f[e + 6]) >>> 16) + (A >>> 16) + (E >>> 16) + (n >>> 16) + (J >>> 16) + ((a = (65535 & x) + (65535 & A) + (65535 & E) + (65535 & n) + (65535 & J) + ((i = ((S = f[e + 7]) >>> 16) + (v >>> 16) + (T >>> 16) + (o >>> 16) + (Q >>> 16) + ((s = (65535 & S) + (65535 & v) + (65535 & T) + (65535 & o) + (65535 & Q)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a, v = i << 16 | 65535 & s, x = (c = (b >>> 16) + (t >>> 16) + ((a = (65535 & b) + (65535 & t) + ((i = (w >>> 16) + (r >>> 16) + ((s = (65535 & w) + (65535 & r)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a, S = i << 16 | 65535 & s, J = (c = (G >>> 16) + (A >>> 16) + ((a = (65535 & G) + (65535 & A) + ((i = (K >>> 16) + (v >>> 16) + ((s = (65535 & K) + (65535 & v)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a, Q = i << 16 | 65535 & s, G = (c = (x >>> 16) + (A >>> 16) + ((a = (65535 & x) + (65535 & A) + ((i = (S >>> 16) + (v >>> 16) + ((s = (65535 & S) + (65535 & v)) >>> 16)) >>> 16)) >>> 16)) << 16 | 65535 & a, K = i << 16 | 65535 & s;
c = (_ >>> 16) + (G >>> 16) + ((a = (65535 & _) + (65535 & G) + ((i = (B >>> 16) + (K >>> 16) + ((s = (65535 & B) + (65535 & K)) >>> 16)) >>> 16)) >>> 16), this.h0h = c << 16 | 65535 & a, this.h0l = i << 16 | 65535 & s, c = (k >>> 16) + (q >>> 16) + ((a = (65535 & k) + (65535 & q) + ((i = (I >>> 16) + ($ >>> 16) + ((s = (65535 & I) + (65535 & $)) >>> 16)) >>> 16)) >>> 16), this.h1h = c << 16 | 65535 & a, this.h1l = i << 16 | 65535 & s, c = (U >>> 16) + (V >>> 16) + ((a = (65535 & U) + (65535 & V) + ((i = (C >>> 16) + (W >>> 16) + ((s = (65535 & C) + (65535 & W)) >>> 16)) >>> 16)) >>> 16), this.h2h = c << 16 | 65535 & a, this.h2l = i << 16 | 65535 & s, c = (R >>> 16) + (X >>> 16) + ((a = (65535 & R) + (65535 & X) + ((i = (O >>> 16) + (Y >>> 16) + ((s = (65535 & O) + (65535 & Y)) >>> 16)) >>> 16)) >>> 16), this.h3h = c << 16 | 65535 & a, this.h3l = i << 16 | 65535 & s, c = (D >>> 16) + (J >>> 16) + ((a = (65535 & D) + (65535 & J) + ((i = (N >>> 16) + (Q >>> 16) + ((s = (65535 & N) + (65535 & Q)) >>> 16)) >>> 16)) >>> 16), this.h4h = c << 16 | 65535 & a, this.h4l = i << 16 | 65535 & s, c = (P >>> 16) + (Z >>> 16) + ((a = (65535 & P) + (65535 & Z) + ((i = (L >>> 16) + (ee >>> 16) + ((s = (65535 & L) + (65535 & ee)) >>> 16)) >>> 16)) >>> 16), this.h5h = c << 16 | 65535 & a, this.h5l = i << 16 | 65535 & s, c = (F >>> 16) + (te >>> 16) + ((a = (65535 & F) + (65535 & te) + ((i = (j >>> 16) + (re >>> 16) + ((s = (65535 & j) + (65535 & re)) >>> 16)) >>> 16)) >>> 16), this.h6h = c << 16 | 65535 & a, this.h6l = i << 16 | 65535 & s, c = (z >>> 16) + (ne >>> 16) + ((a = (65535 & z) + (65535 & ne) + ((i = (M >>> 16) + (oe >>> 16) + ((s = (65535 & M) + (65535 & oe)) >>> 16)) >>> 16)) >>> 16), this.h7h = c << 16 | 65535 & a, this.h7l = i << 16 | 65535 & s;
}, A.prototype.hex = function () {
this.finalize();
var e = this.h0h,
t = this.h0l,
r = this.h1h,
n = this.h1l,
o = this.h2h,
s = this.h2l,
i = this.h3h,
a = this.h3l,
c = this.h4h,
u = this.h4l,
h = this.h5h,
p = this.h5l,
f = this.h6h,
d = this.h6l,
g = this.h7h,
y = this.h7l,
m = this.bits,
b = l[e >> 28 & 15] + l[e >> 24 & 15] + l[e >> 20 & 15] + l[e >> 16 & 15] + l[e >> 12 & 15] + l[e >> 8 & 15] + l[e >> 4 & 15] + l[15 & e] + l[t >> 28 & 15] + l[t >> 24 & 15] + l[t >> 20 & 15] + l[t >> 16 & 15] + l[t >> 12 & 15] + l[t >> 8 & 15] + l[t >> 4 & 15] + l[15 & t] + l[r >> 28 & 15] + l[r >> 24 & 15] + l[r >> 20 & 15] + l[r >> 16 & 15] + l[r >> 12 & 15] + l[r >> 8 & 15] + l[r >> 4 & 15] + l[15 & r] + l[n >> 28 & 15] + l[n >> 24 & 15] + l[n >> 20 & 15] + l[n >> 16 & 15] + l[n >> 12 & 15] + l[n >> 8 & 15] + l[n >> 4 & 15] + l[15 & n] + l[o >> 28 & 15] + l[o >> 24 & 15] + l[o >> 20 & 15] + l[o >> 16 & 15] + l[o >> 12 & 15] + l[o >> 8 & 15] + l[o >> 4 & 15] + l[15 & o] + l[s >> 28 & 15] + l[s >> 24 & 15] + l[s >> 20 & 15] + l[s >> 16 & 15] + l[s >> 12 & 15] + l[s >> 8 & 15] + l[s >> 4 & 15] + l[15 & s] + l[i >> 28 & 15] + l[i >> 24 & 15] + l[i >> 20 & 15] + l[i >> 16 & 15] + l[i >> 12 & 15] + l[i >> 8 & 15] + l[i >> 4 & 15] + l[15 & i];
return m >= 256 && (b += l[a >> 28 & 15] + l[a >> 24 & 15] + l[a >> 20 & 15] + l[a >> 16 & 15] + l[a >> 12 & 15] + l[a >> 8 & 15] + l[a >> 4 & 15] + l[15 & a]), m >= 384 && (b += l[c >> 28 & 15] + l[c >> 24 & 15] + l[c >> 20 & 15] + l[c >> 16 & 15] + l[c >> 12 & 15] + l[c >> 8 & 15] + l[c >> 4 & 15] + l[15 & c] + l[u >> 28 & 15] + l[u >> 24 & 15] + l[u >> 20 & 15] + l[u >> 16 & 15] + l[u >> 12 & 15] + l[u >> 8 & 15] + l[u >> 4 & 15] + l[15 & u] + l[h >> 28 & 15] + l[h >> 24 & 15] + l[h >> 20 & 15] + l[h >> 16 & 15] + l[h >> 12 & 15] + l[h >> 8 & 15] + l[h >> 4 & 15] + l[15 & h] + l[p >> 28 & 15] + l[p >> 24 & 15] + l[p >> 20 & 15] + l[p >> 16 & 15] + l[p >> 12 & 15] + l[p >> 8 & 15] + l[p >> 4 & 15] + l[15 & p]), 512 == m && (b += l[f >> 28 & 15] + l[f >> 24 & 15] + l[f >> 20 & 15] + l[f >> 16 & 15] + l[f >> 12 & 15] + l[f >> 8 & 15] + l[f >> 4 & 15] + l[15 & f] + l[d >> 28 & 15] + l[d >> 24 & 15] + l[d >> 20 & 15] + l[d >> 16 & 15] + l[d >> 12 & 15] + l[d >> 8 & 15] + l[d >> 4 & 15] + l[15 & d] + l[g >> 28 & 15] + l[g >> 24 & 15] + l[g >> 20 & 15] + l[g >> 16 & 15] + l[g >> 12 & 15] + l[g >> 8 & 15] + l[g >> 4 & 15] + l[15 & g] + l[y >> 28 & 15] + l[y >> 24 & 15] + l[y >> 20 & 15] + l[y >> 16 & 15] + l[y >> 12 & 15] + l[y >> 8 & 15] + l[y >> 4 & 15] + l[15 & y]), b;
}, A.prototype.toString = A.prototype.hex, A.prototype.digest = function () {
this.finalize();
var e = this.h0h,
t = this.h0l,
r = this.h1h,
n = this.h1l,
o = this.h2h,
s = this.h2l,
i = this.h3h,
a = this.h3l,
c = this.h4h,
u = this.h4l,
l = this.h5h,
h = this.h5l,
p = this.h6h,
f = this.h6l,
d = this.h7h,
g = this.h7l,
y = this.bits,
m = [e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, 255 & e, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, 255 & t, r >> 24 & 255, r >> 16 & 255, r >> 8 & 255, 255 & r, n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, 255 & n, o >> 24 & 255, o >> 16 & 255, o >> 8 & 255, 255 & o, s >> 24 & 255, s >> 16 & 255, s >> 8 & 255, 255 & s, i >> 24 & 255, i >> 16 & 255, i >> 8 & 255, 255 & i];
return y >= 256 && m.push(a >> 24 & 255, a >> 16 & 255, a >> 8 & 255, 255 & a), y >= 384 && m.push(c >> 24 & 255, c >> 16 & 255, c >> 8 & 255, 255 & c, u >> 24 & 255, u >> 16 & 255, u >> 8 & 255, 255 & u, l >> 24 & 255, l >> 16 & 255, l >> 8 & 255, 255 & l, h >> 24 & 255, h >> 16 & 255, h >> 8 & 255, 255 & h), 512 == y && m.push(p >> 24 & 255, p >> 16 & 255, p >> 8 & 255, 255 & p, f >> 24 & 255, f >> 16 & 255, f >> 8 & 255, 255 & f, d >> 24 & 255, d >> 16 & 255, d >> 8 & 255, 255 & d, g >> 24 & 255, g >> 16 & 255, g >> 8 & 255, 255 & g), m;
}, A.prototype.array = A.prototype.digest, A.prototype.arrayBuffer = function () {
this.finalize();
var e = this.bits,
t = new ArrayBuffer(e / 8),
r = new DataView(t);
return r.setUint32(0, this.h0h), r.setUint32(4, this.h0l), r.setUint32(8, this.h1h), r.setUint32(12, this.h1l), r.setUint32(16, this.h2h), r.setUint32(20, this.h2l), r.setUint32(24, this.h3h), e >= 256 && r.setUint32(28, this.h3l), e >= 384 && (r.setUint32(32, this.h4h), r.setUint32(36, this.h4l), r.setUint32(40, this.h5h), r.setUint32(44, this.h5l)), 512 == e && (r.setUint32(48, this.h6h), r.setUint32(52, this.h6l), r.setUint32(56, this.h7h), r.setUint32(60, this.h7l)), t;
}, A.prototype.clone = function () {
var e = new A(this.bits, !1);
return this.copyTo(e), e;
}, A.prototype.copyTo = function (e) {
var t = 0,
r = ["h0h", "h0l", "h1h", "h1l", "h2h", "h2l", "h3h", "h3l", "h4h", "h4l", "h5h", "h5l", "h6h", "h6l", "h7h", "h7l", "start", "bytes", "hBytes", "finalized", "hashed", "lastByteIndex"];
for (t = 0; t < r.length; ++t) e[r[t]] = this[r[t]];
for (t = 0; t < this.blocks.length; ++t) e.blocks[t] = this.blocks[t];
}, v.prototype = new A(), v.prototype.finalize = function () {
if (A.prototype.finalize.call(this), this.inner) {
this.inner = !1;
var e = this.array();
A.call(this, this.bits, this.sharedMemory), this.update(this.oKeyPad), this.update(e), A.prototype.finalize.call(this);
}
}, v.prototype.clone = function () {
var e = new v([], this.bits, !1);
this.copyTo(e), e.inner = this.inner;
for (var t = 0; t < this.oKeyPad.length; ++t) e.oKeyPad[t] = this.oKeyPad[t];
return e;
};
var x = m(512);
x.sha512 = x, x.sha384 = m(384), x.sha512_256 = m(256), x.sha512_224 = m(224), x.sha512.hmac = w(512), x.sha384.hmac = w(384), x.sha512_256.hmac = w(256), x.sha512_224.hmac = w(224), a ? e.exports = x : (s.sha512 = x.sha512, s.sha384 = x.sha384, s.sha512_256 = x.sha512_256, s.sha512_224 = x.sha512_224, c && (void 0 === (n = function () {
return x;
}.call(x, r, x, e)) || (e.exports = n)));
}();
},
4360: (e, t, r) => {
var n = r(592).stringify,
o = r(9385);
e.exports = function (e) {
return {
parse: o(e),
stringify: n
};
}, e.exports.parse = o(), e.exports.stringify = n;
},
9385: (e, t, r) => {
var n = null;
const o = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,
s = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;
e.exports = function (e) {
"use strict";
var t = {
strict: !1,
storeAsString: !1,
alwaysParseAsBig: !1,
useNativeBigInt: !1,
protoAction: "error",
constructorAction: "error"
};
if (null != e) {
if (!0 === e.strict && (t.strict = !0), !0 === e.storeAsString && (t.storeAsString = !0), t.alwaysParseAsBig = !0 === e.alwaysParseAsBig && e.alwaysParseAsBig, t.useNativeBigInt = !0 === e.useNativeBigInt && e.useNativeBigInt, void 0 !== e.constructorAction) {
if ("error" !== e.constructorAction && "ignore" !== e.constructorAction && "preserve" !== e.constructorAction) throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);
t.constructorAction = e.constructorAction;
}
if (void 0 !== e.protoAction) {
if ("error" !== e.protoAction && "ignore" !== e.protoAction && "preserve" !== e.protoAction) throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`);
t.protoAction = e.protoAction;
}
}
var i,
a,
c,
u,
l = {
'"': '"',
"\\": "\\",
"/": "/",
b: "\b",
f: "\f",
n: "\n",
r: "\r",
t: "\t"
},
h = function (e) {
throw {
name: "SyntaxError",
message: e,
at: i,
text: c
};
},
p = function (e) {
return e && e !== a && h("Expected '" + e + "' instead of '" + a + "'"), a = c.charAt(i), i += 1, a;
},
f = function () {
var e,
o = "";
for ("-" === a && (o = "-", p("-")); a >= "0" && a <= "9";) o += a, p();
if ("." === a) for (o += "."; p() && a >= "0" && a <= "9";) o += a;
if ("e" === a || "E" === a) for (o += a, p(), "-" !== a && "+" !== a || (o += a, p()); a >= "0" && a <= "9";) o += a, p();
if (e = +o, isFinite(e)) return null == n && (n = r(5117)), o.length > 15 ? t.storeAsString ? o : t.useNativeBigInt ? BigInt(o) : new n(o) : t.alwaysParseAsBig ? t.useNativeBigInt ? BigInt(e) : new n(e) : e;
h("Bad number");
},
d = function () {
var e,
t,
r,
n = "";
if ('"' === a) for (var o = i; p();) {
if ('"' === a) return i - 1 > o && (n += c.substring(o, i - 1)), p(), n;
if ("\\" === a) {
if (i - 1 > o && (n += c.substring(o, i - 1)), p(), "u" === a) {
for (r = 0, t = 0; t < 4 && (e = parseInt(p(), 16), isFinite(e)); t += 1) r = 16 * r + e;
n += String.fromCharCode(r);
} else {
if ("string" != typeof l[a]) break;
n += l[a];
}
o = i;
}
}
h("Bad string");
},
g = function () {
for (; a && a <= " ";) p();
};
return u = function () {
switch (g(), a) {
case "{":
return function () {
var e,
r = Object.create(null);
if ("{" === a) {
if (p("{"), g(), "}" === a) return p("}"), r;
for (; a;) {
if (e = d(), g(), p(":"), !0 === t.strict && Object.hasOwnProperty.call(r, e) && h('Duplicate key "' + e + '"'), !0 === o.test(e) ? "error" === t.protoAction ? h("Object contains forbidden prototype property") : "ignore" === t.protoAction ? u() : r[e] = u() : !0 === s.test(e) ? "error" === t.constructorAction ? h("Object contains forbidden constructor property") : "ignore" === t.constructorAction ? u() : r[e] = u() : r[e] = u(), g(), "}" === a) return p("}"), r;
p(","), g();
}
}
h("Bad object");
}();
case "[":
return function () {
var e = [];
if ("[" === a) {
if (p("["), g(), "]" === a) return p("]"), e;
for (; a;) {
if (e.push(u()), g(), "]" === a) return p("]"), e;
p(","), g();
}
}
h("Bad array");
}();
case '"':
return d();
case "-":
return f();
default:
return a >= "0" && a <= "9" ? f() : function () {
switch (a) {
case "t":
return p("t"), p("r"), p("u"), p("e"), !0;
case "f":
return p("f"), p("a"), p("l"), p("s"), p("e"), !1;
case "n":
return p("n"), p("u"), p("l"), p("l"), null;
}
h("Unexpected '" + a + "'");
}();
}
}, function (e, t) {
var r;
return c = e + "", i = 0, a = " ", r = u(), g(), a && h("Syntax error"), "function" == typeof t ? function e(r, n) {
var o,
s = r[n];
return s && "object" == typeof s && Object.keys(s).forEach(function (t) {
void 0 !== (o = e(s, t)) ? s[t] = o : delete s[t];
}), t.call(r, n, s);
}({
"": r
}, "") : r;
};
};
},
592: (e, t, r) => {
var n = r(5117),
o = e.exports;
!function () {
"use strict";
var e,
t,
r,
s = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
i = {
"\b": "\\b",
"\t": "\\t",
"\n": "\\n",
"\f": "\\f",
"\r": "\\r",
'"': '\\"',
"\\": "\\\\"
};
function a(e) {
return s.lastIndex = 0, s.test(e) ? '"' + e.replace(s, function (e) {
var t = i[e];
return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4);
}) + '"' : '"' + e + '"';
}
function c(o, s) {
var i,
u,
l,
h,
p,
f = e,
d = s[o],
g = null != d && (d instanceof n || n.isBigNumber(d));
switch (d && "object" == typeof d && "function" == typeof d.toJSON && (d = d.toJSON(o)), "function" == typeof r && (d = r.call(s, o, d)), typeof d) {
case "string":
return g ? d : a(d);
case "number":
return isFinite(d) ? String(d) : "null";
case "boolean":
case "null":
case "bigint":
return String(d);
case "object":
if (!d) return "null";
if (e += t, p = [], "[object Array]" === Object.prototype.toString.apply(d)) {
for (h = d.length, i = 0; i < h; i += 1) p[i] = c(i, d) || "null";
return l = 0 === p.length ? "[]" : e ? "[\n" + e + p.join(",\n" + e) + "\n" + f + "]" : "[" + p.join(",") + "]", e = f, l;
}
if (r && "object" == typeof r) for (h = r.length, i = 0; i < h; i += 1) "string" == typeof r[i] && (l = c(u = r[i], d)) && p.push(a(u) + (e ? ": " : ":") + l);else Object.keys(d).forEach(function (t) {
var r = c(t, d);
r && p.push(a(t) + (e ? ": " : ":") + r);
});
return l = 0 === p.length ? "{}" : e ? "{\n" + e + p.join(",\n" + e) + "\n" + f + "}" : "{" + p.join(",") + "}", e = f, l;
}
}
"function" != typeof o.stringify && (o.stringify = function (n, o, s) {
var i;
if (e = "", t = "", "number" == typeof s) for (i = 0; i < s; i += 1) t += " ";else "string" == typeof s && (t = s);
if (r = o, o && "function" != typeof o && ("object" != typeof o || "number" != typeof o.length)) throw new Error("JSON.stringify");
return c("", {
"": n
});
});
}();
},
3126: (e, t, r) => {
var n = "function" == typeof Map && Map.prototype,
o = Object.getOwnPropertyDescriptor && n ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null,
s = n && o && "function" == typeof o.get ? o.get : null,
i = n && Map.prototype.forEach,
a = "function" == typeof Set && Set.prototype,
c = Object.getOwnPropertyDescriptor && a ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null,
u = a && c && "function" == typeof c.get ? c.get : null,
l = a && Set.prototype.forEach,
h = "function" == typeof WeakMap && WeakMap.prototype ? WeakMap.prototype.has : null,
p = "function" == typeof WeakSet && WeakSet.prototype ? WeakSet.prototype.has : null,
f = "function" == typeof WeakRef && WeakRef.prototype ? WeakRef.prototype.deref : null,
d = Boolean.prototype.valueOf,
g = Object.prototype.toString,
y = Function.prototype.toString,
m = String.prototype.match,
b = "function" == typeof BigInt ? BigInt.prototype.valueOf : null,
w = Object.getOwnPropertySymbols,
A = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? Symbol.prototype.toString : null,
v = "function" == typeof Symbol && "object" == typeof Symbol.iterator,
x = Object.prototype.propertyIsEnumerable,
S = ("function" == typeof Reflect ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function (e) {
return e.__proto__;
} : null),
E = r(4654).custom,
T = E && U(E) ? E : null,
_ = "function" == typeof Symbol && void 0 !== Symbol.toStringTag ? Symbol.toStringTag : null;
function B(e, t, r) {
var n = "double" === (r.quoteStyle || t) ? '"' : "'";
return n + e + n;
}
function k(e) {
return String(e).replace(/"/g, "&quot;");
}
function I(e) {
return !("[object Array]" !== O(e) || _ && "object" == typeof e && _ in e);
}
function U(e) {
if (v) return e && "object" == typeof e && e instanceof Symbol;
if ("symbol" == typeof e) return !0;
if (!e || "object" != typeof e || !A) return !1;
try {
return A.call(e), !0;
} catch (e) {}
return !1;
}
e.exports = function e(t, r, n, o) {
var a = r || {};
if (R(a, "quoteStyle") && "single" !== a.quoteStyle && "double" !== a.quoteStyle) throw new TypeError('option "quoteStyle" must be "single" or "double"');
if (R(a, "maxStringLength") && ("number" == typeof a.maxStringLength ? a.maxStringLength < 0 && a.maxStringLength !== 1 / 0 : null !== a.maxStringLength)) throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
var c = !R(a, "customInspect") || a.customInspect;
if ("boolean" != typeof c) throw new TypeError('option "customInspect", if provided, must be `true` or `false`');
if (R(a, "indent") && null !== a.indent && "\t" !== a.indent && !(parseInt(a.indent, 10) === a.indent && a.indent > 0)) throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');
if (void 0 === t) return "undefined";
if (null === t) return "null";
if ("boolean" == typeof t) return t ? "true" : "false";
if ("string" == typeof t) return N(t, a);
if ("number" == typeof t) return 0 === t ? 1 / 0 / t > 0 ? "0" : "-0" : String(t);
if ("bigint" == typeof t) return String(t) + "n";
var g = void 0 === a.depth ? 5 : a.depth;
if (void 0 === n && (n = 0), n >= g && g > 0 && "object" == typeof t) return I(t) ? "[Array]" : "[Object]";
var w,
x = function (e, t) {
var r;
if ("\t" === e.indent) r = "\t";else {
if (!("number" == typeof e.indent && e.indent > 0)) return null;
r = Array(e.indent + 1).join(" ");
}
return {
base: r,
prev: Array(t + 1).join(r)
};
}(a, n);
if (void 0 === o) o = [];else if (D(o, t) >= 0) return "[Circular]";
function E(t, r, s) {
if (r && (o = o.slice()).push(r), s) {
var i = {
depth: a.depth
};
return R(a, "quoteStyle") && (i.quoteStyle = a.quoteStyle), e(t, i, n + 1, o);
}
return e(t, a, n + 1, o);
}
if ("function" == typeof t) {
var C = function (e) {
if (e.name) return e.name;
var t = m.call(y.call(e), /^function\s*([\w$]+)/);
return t ? t[1] : null;
}(t),
P = M(t, E);
return "[Function" + (C ? ": " + C : " (anonymous)") + "]" + (P.length > 0 ? " { " + P.join(", ") + " }" : "");
}
if (U(t)) {
var H = v ? String(t).replace(/^(Symbol\(.*\))_[^)]*$/, "$1") : A.call(t);
return "object" != typeof t || v ? H : L(H);
}
if ((w = t) && "object" == typeof w && ("undefined" != typeof HTMLElement && w instanceof HTMLElement || "string" == typeof w.nodeName && "function" == typeof w.getAttribute)) {
for (var G = "<" + String(t.nodeName).toLowerCase(), K = t.attributes || [], q = 0; q < K.length; q++) G += " " + K[q].name + "=" + B(k(K[q].value), "double", a);
return G += ">", t.childNodes && t.childNodes.length && (G += "..."), G + "</" + String(t.nodeName).toLowerCase() + ">";
}
if (I(t)) {
if (0 === t.length) return "[]";
var $ = M(t, E);
return x && !function (e) {
for (var t = 0; t < e.length; t++) if (D(e[t], "\n") >= 0) return !1;
return !0;
}($) ? "[" + z($, x) + "]" : "[ " + $.join(", ") + " ]";
}
if (function (e) {
return !("[object Error]" !== O(e) || _ && "object" == typeof e && _ in e);
}(t)) {
var V = M(t, E);
return 0 === V.length ? "[" + String(t) + "]" : "{ [" + String(t) + "] " + V.join(", ") + " }";
}
if ("object" == typeof t && c) {
if (T && "function" == typeof t[T]) return t[T]();
if ("function" == typeof t.inspect) return t.inspect();
}
if (function (e) {
if (!s || !e || "object" != typeof e) return !1;
try {
s.call(e);
try {
u.call(e);
} catch (e) {
return !0;
}
return e instanceof Map;
} catch (e) {}
return !1;
}(t)) {
var W = [];
return i.call(t, function (e, r) {
W.push(E(r, t, !0) + " => " + E(e, t));
}), j("Map", s.call(t), W, x);
}
if (function (e) {
if (!u || !e || "object" != typeof e) return !1;
try {
u.call(e);
try {
s.call(e);
} catch (e) {
return !0;
}
return e instanceof Set;
} catch (e) {}
return !1;
}(t)) {
var X = [];
return l.call(t, function (e) {
X.push(E(e, t));
}), j("Set", u.call(t), X, x);
}
if (function (e) {
if (!h || !e || "object" != typeof e) return !1;
try {
h.call(e, h);
try {
p.call(e, p);
} catch (e) {
return !0;
}
return e instanceof WeakMap;
} catch (e) {}
return !1;
}(t)) return F("WeakMap");
if (function (e) {
if (!p || !e || "object" != typeof e) return !1;
try {
p.call(e, p);
try {
h.call(e, h);
} catch (e) {
return !0;
}
return e instanceof WeakSet;
} catch (e) {}
return !1;
}(t)) return F("WeakSet");
if (function (e) {
if (!f || !e || "object" != typeof e) return !1;
try {
return f.call(e), !0;
} catch (e) {}
return !1;
}(t)) return F("WeakRef");
if (function (e) {
return !("[object Number]" !== O(e) || _ && "object" == typeof e && _ in e);
}(t)) return L(E(Number(t)));
if (function (e) {
if (!e || "object" != typeof e || !b) return !1;
try {
return b.call(e), !0;
} catch (e) {}
return !1;
}(t)) return L(E(b.call(t)));
if (function (e) {
return !("[object Boolean]" !== O(e) || _ && "object" == typeof e && _ in e);
}(t)) return L(d.call(t));
if (function (e) {
return !("[object String]" !== O(e) || _ && "object" == typeof e && _ in e);
}(t)) return L(E(String(t)));
if (!function (e) {
return !("[object Date]" !== O(e) || _ && "object" == typeof e && _ in e);
}(t) && !function (e) {
return !("[object RegExp]" !== O(e) || _ && "object" == typeof e && _ in e);
}(t)) {
var Y = M(t, E),
J = S ? S(t) === Object.prototype : t instanceof Object || t.constructor === Object,
Q = t instanceof Object ? "" : "null prototype",
Z = !J && _ && Object(t) === t && _ in t ? O(t).slice(8, -1) : Q ? "Object" : "",
ee = (J || "function" != typeof t.constructor ? "" : t.constructor.name ? t.constructor.name + " " : "") + (Z || Q ? "[" + [].concat(Z || [], Q || []).join(": ") + "] " : "");
return 0 === Y.length ? ee + "{}" : x ? ee + "{" + z(Y, x) + "}" : ee + "{ " + Y.join(", ") + " }";
}
return String(t);
};
var C = Object.prototype.hasOwnProperty || function (e) {
return e in this;
};
function R(e, t) {
return C.call(e, t);
}
function O(e) {
return g.call(e);
}
function D(e, t) {
if (e.indexOf) return e.indexOf(t);
for (var r = 0, n = e.length; r < n; r++) if (e[r] === t) return r;
return -1;
}
function N(e, t) {
if (e.length > t.maxStringLength) {
var r = e.length - t.maxStringLength,
n = "... " + r + " more character" + (r > 1 ? "s" : "");
return N(e.slice(0, t.maxStringLength), t) + n;
}
return B(e.replace(/(['\\])/g, "\\$1").replace(/[\x00-\x1f]/g, P), "single", t);
}
function P(e) {
var t = e.charCodeAt(0),
r = {
8: "b",
9: "t",
10: "n",
12: "f",
13: "r"
}[t];
return r ? "\\" + r : "\\x" + (t < 16 ? "0" : "") + t.toString(16).toUpperCase();
}
function L(e) {
return "Object(" + e + ")";
}
function F(e) {
return e + " { ? }";
}
function j(e, t, r, n) {
return e + " (" + t + ") {" + (n ? z(r, n) : r.join(", ")) + "}";
}
function z(e, t) {
if (0 === e.length) return "";
var r = "\n" + t.prev + t.base;
return r + e.join("," + r) + "\n" + t.prev;
}
function M(e, t) {
var r = I(e),
n = [];
if (r) {
n.length = e.length;
for (var o = 0; o < e.length; o++) n[o] = R(e, o) ? t(e[o], e) : "";
}
var s,
i = "function" == typeof w ? w(e) : [];
if (v) {
s = {};
for (var a = 0; a < i.length; a++) s["$" + i[a]] = i[a];
}
for (var c in e) R(e, c) && (r && String(Number(c)) === c && c < e.length || v && s["$" + c] instanceof Symbol || (/[^\w$]/.test(c) ? n.push(t(c, e) + ": " + t(e[c], e)) : n.push(c + ": " + t(e[c], e))));
if ("function" == typeof w) for (var u = 0; u < i.length; u++) x.call(e, i[u]) && n.push("[" + t(i[u]) + "]: " + t(e[i[u]], e));
return n;
}
},
9368: e => {
"use strict";
function t(e) {
if ("string" != typeof e) throw new TypeError("Path must be a string. Received " + JSON.stringify(e));
}
function r(e, t) {
for (var r, n = "", o = 0, s = -1, i = 0, a = 0; a <= e.length; ++a) {
if (a < e.length) r = e.charCodeAt(a);else {
if (47 === r) break;
r = 47;
}
if (47 === r) {
if (s === a - 1 || 1 === i) ;else if (s !== a - 1 && 2 === i) {
if (n.length < 2 || 2 !== o || 46 !== n.charCodeAt(n.length - 1) || 46 !== n.charCodeAt(n.length - 2)) if (n.length > 2) {
var c = n.lastIndexOf("/");
if (c !== n.length - 1) {
-1 === c ? (n = "", o = 0) : o = (n = n.slice(0, c)).length - 1 - n.lastIndexOf("/"), s = a, i = 0;
continue;
}
} else if (2 === n.length || 1 === n.length) {
n = "", o = 0, s = a, i = 0;
continue;
}
t && (n.length > 0 ? n += "/.." : n = "..", o = 2);
} else n.length > 0 ? n += "/" + e.slice(s + 1, a) : n = e.slice(s + 1, a), o = a - s - 1;
s = a, i = 0;
} else 46 === r && -1 !== i ? ++i : i = -1;
}
return n;
}
var n = {
resolve: function () {
for (var e, n = "", o = !1, s = arguments.length - 1; s >= -1 && !o; s--) {
var i;
s >= 0 ? i = arguments[s] : (void 0 === e && (e = process.cwd()), i = e), t(i), 0 !== i.length && (n = i + "/" + n, o = 47 === i.charCodeAt(0));
}
return n = r(n, !o), o ? n.length > 0 ? "/" + n : "/" : n.length > 0 ? n : ".";
},
normalize: function (e) {
if (t(e), 0 === e.length) return ".";
var n = 47 === e.charCodeAt(0),
o = 47 === e.charCodeAt(e.length - 1);
return 0 !== (e = r(e, !n)).length || n || (e = "."), e.length > 0 && o && (e += "/"), n ? "/" + e : e;
},
isAbsolute: function (e) {
return t(e), e.length > 0 && 47 === e.charCodeAt(0);
},
join: function () {
if (0 === arguments.length) return ".";
for (var e, r = 0; r < arguments.length; ++r) {
var o = arguments[r];
t(o), o.length > 0 && (void 0 === e ? e = o : e += "/" + o);
}
return void 0 === e ? "." : n.normalize(e);
},
relative: function (e, r) {
if (t(e), t(r), e === r) return "";
if ((e = n.resolve(e)) === (r = n.resolve(r))) return "";
for (var o = 1; o < e.length && 47 === e.charCodeAt(o); ++o);
for (var s = e.length, i = s - o, a = 1; a < r.length && 47 === r.charCodeAt(a); ++a);
for (var c = r.length - a, u = i < c ? i : c, l = -1, h = 0; h <= u; ++h) {
if (h === u) {
if (c > u) {
if (47 === r.charCodeAt(a + h)) return r.slice(a + h + 1);
if (0 === h) return r.slice(a + h);
} else i > u && (47 === e.charCodeAt(o + h) ? l = h : 0 === h && (l = 0));
break;
}
var p = e.charCodeAt(o + h);
if (p !== r.charCodeAt(a + h)) break;
47 === p && (l = h);
}
var f = "";
for (h = o + l + 1; h <= s; ++h) h !== s && 47 !== e.charCodeAt(h) || (0 === f.length ? f += ".." : f += "/..");
return f.length > 0 ? f + r.slice(a + l) : (a += l, 47 === r.charCodeAt(a) && ++a, r.slice(a));
},
_makeLong: function (e) {
return e;
},
dirname: function (e) {
if (t(e), 0 === e.length) return ".";
for (var r = e.charCodeAt(0), n = 47 === r, o = -1, s = !0, i = e.length - 1; i >= 1; --i) if (47 === (r = e.charCodeAt(i))) {
if (!s) {
o = i;
break;
}
} else s = !1;
return -1 === o ? n ? "/" : "." : n && 1 === o ? "//" : e.slice(0, o);
},
basename: function (e, r) {
if (void 0 !== r && "string" != typeof r) throw new TypeError('"ext" argument must be a string');
t(e);
var n,
o = 0,
s = -1,
i = !0;
if (void 0 !== r && r.length > 0 && r.length <= e.length) {
if (r.length === e.length && r === e) return "";
var a = r.length - 1,
c = -1;
for (n = e.length - 1; n >= 0; --n) {
var u = e.charCodeAt(n);
if (47 === u) {
if (!i) {
o = n + 1;
break;
}
} else -1 === c && (i = !1, c = n + 1), a >= 0 && (u === r.charCodeAt(a) ? -1 == --a && (s = n) : (a = -1, s = c));
}
return o === s ? s = c : -1 === s && (s = e.length), e.slice(o, s);
}
for (n = e.length - 1; n >= 0; --n) if (47 === e.charCodeAt(n)) {
if (!i) {
o = n + 1;
break;
}
} else -1 === s && (i = !1, s = n + 1);
return -1 === s ? "" : e.slice(o, s);
},
extname: function (e) {
t(e);
for (var r = -1, n = 0, o = -1, s = !0, i = 0, a = e.length - 1; a >= 0; --a) {
var c = e.charCodeAt(a);
if (47 !== c) -1 === o && (s = !1, o = a + 1), 46 === c ? -1 === r ? r = a : 1 !== i && (i = 1) : -1 !== r && (i = -1);else if (!s) {
n = a + 1;
break;
}
}
return -1 === r || -1 === o || 0 === i || 1 === i && r === o - 1 && r === n + 1 ? "" : e.slice(r, o);
},
format: function (e) {
if (null === e || "object" != typeof e) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof e);
return function (e, t) {
var r = t.dir || t.root,
n = t.base || (t.name || "") + (t.ext || "");
return r ? r === t.root ? r + n : r + "/" + n : n;
}(0, e);
},
parse: function (e) {
t(e);
var r = {
root: "",
dir: "",
base: "",
ext: "",
name: ""
};
if (0 === e.length) return r;
var n,
o = e.charCodeAt(0),
s = 47 === o;
s ? (r.root = "/", n = 1) : n = 0;
for (var i = -1, a = 0, c = -1, u = !0, l = e.length - 1, h = 0; l >= n; --l) if (47 !== (o = e.charCodeAt(l))) -1 === c && (u = !1, c = l + 1), 46 === o ? -1 === i ? i = l : 1 !== h && (h = 1) : -1 !== i && (h = -1);else if (!u) {
a = l + 1;
break;
}
return -1 === i || -1 === c || 0 === h || 1 === h && i === c - 1 && i === a + 1 ? -1 !== c && (r.base = r.name = 0 === a && s ? e.slice(1, c) : e.slice(a, c)) : (0 === a && s ? (r.name = e.slice(1, i), r.base = e.slice(1, c)) : (r.name = e.slice(a, i), r.base = e.slice(a, c)), r.ext = e.slice(i, c)), a > 0 ? r.dir = e.slice(0, a - 1) : s && (r.dir = "/"), r;
},
sep: "/",
delimiter: ":",
win32: null,
posix: null
};
n.posix = n, e.exports = n;
},
9370: (e, t) => {
"use strict";
var r = Object.prototype.hasOwnProperty;
function n(e) {
try {
return decodeURIComponent(e.replace(/\+/g, " "));
} catch (e) {
return null;
}
}
function o(e) {
try {
return encodeURIComponent(e);
} catch (e) {
return null;
}
}
t.stringify = function (e, t) {
t = t || "";
var n,
s,
i = [];
for (s in "string" != typeof t && (t = "?"), e) if (r.call(e, s)) {
if ((n = e[s]) || null != n && !isNaN(n) || (n = ""), s = o(s), n = o(n), null === s || null === n) continue;
i.push(s + "=" + n);
}
return i.length ? t + i.join("&") : "";
}, t.parse = function (e) {
for (var t, r = /([^=?#&]+)=?([^&]*)/g, o = {}; t = r.exec(e);) {
var s = n(t[1]),
i = n(t[2]);
null === s || null === i || s in o || (o[s] = i);
}
return o;
};
},
1926: e => {
"use strict";
e.exports = function (e, t) {
if (t = t.split(":")[0], !(e = +e)) return !1;
switch (t) {
case "http":
case "ws":
return 80 !== e;
case "https":
case "wss":
return 443 !== e;
case "ftp":
return 21 !== e;
case "gopher":
return 70 !== e;
case "file":
return !1;
}
return 0 !== e;
};
},
3680: (e, t, r) => {
"use strict";
var n = r(1801),
o = r(7615),
s = r(3126),
i = n("%TypeError%"),
a = n("%WeakMap%", !0),
c = n("%Map%", !0),
u = o("WeakMap.prototype.get", !0),
l = o("WeakMap.prototype.set", !0),
h = o("WeakMap.prototype.has", !0),
p = o("Map.prototype.get", !0),
f = o("Map.prototype.set", !0),
d = o("Map.prototype.has", !0),
g = function (e, t) {
for (var r, n = e; null !== (r = n.next); n = r) if (r.key === t) return n.next = r.next, r.next = e.next, e.next = r, r;
};
e.exports = function () {
var e,
t,
r,
n = {
assert: function (e) {
if (!n.has(e)) throw new i("Side channel does not contain " + s(e));
},
get: function (n) {
if (a && n && ("object" == typeof n || "function" == typeof n)) {
if (e) return u(e, n);
} else if (c) {
if (t) return p(t, n);
} else if (r) return function (e, t) {
var r = g(e, t);
return r && r.value;
}(r, n);
},
has: function (n) {
if (a && n && ("object" == typeof n || "function" == typeof n)) {
if (e) return h(e, n);
} else if (c) {
if (t) return d(t, n);
} else if (r) return function (e, t) {
return !!g(e, t);
}(r, n);
return !1;
},
set: function (n, o) {
a && n && ("object" == typeof n || "function" == typeof n) ? (e || (e = new a()), l(e, n, o)) : c ? (t || (t = new c()), f(t, n, o)) : (r || (r = {
key: {},
next: null
}), function (e, t, r) {
var n = g(e, t);
n ? n.value = r : e.next = {
key: t,
next: e.next,
value: r
};
}(r, n, o));
}
};
return n;
};
},
2858: e => {
"use strict";
function t(e, t) {
(null == t || t > e.length) && (t = e.length);
for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
return n;
}
function r() {
this._defaults = [];
}
["use", "on", "once", "set", "query", "type", "accept", "auth", "withCredentials", "sortQuery", "retry", "ok", "redirects", "timeout", "buffer", "serialize", "parse", "ca", "key", "pfx", "cert", "disableTLSCerts"].forEach(function (e) {
r.prototype[e] = function () {
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++) r[n] = arguments[n];
return this._defaults.push({
fn: e,
args: r
}), this;
};
}), r.prototype._setDefaults = function (e) {
this._defaults.forEach(function (r) {
var n;
e[r.fn].apply(e, function (e) {
if (Array.isArray(e)) return t(e);
}(n = r.args) || function (e) {
if ("undefined" != typeof Symbol && Symbol.iterator in Object(e)) return Array.from(e);
}(n) || function (e, r) {
if (e) {
if ("string" == typeof e) return t(e, r);
var n = Object.prototype.toString.call(e).slice(8, -1);
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? t(e, r) : void 0;
}
}(n) || 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.");
}());
});
}, e.exports = r;
},
5391: (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;
"undefined" != typeof window ? o = window : "undefined" == typeof self ? (console.warn("Using browser-only version of superagent in non-browser environment"), o = void 0) : o = self;
var s = r(1069),
i = r(5799),
a = r(3065),
c = r(4287),
u = r(1960),
l = r(969),
h = r(2858);
function p() {}
e.exports = function (e, r) {
return "function" == typeof r ? new t.Request("GET", e).end(r) : 1 === arguments.length ? new t.Request("GET", e) : new t.Request(e, r);
};
var f = t = e.exports;
t.Request = A, f.getXHR = function () {
if (o.XMLHttpRequest && (!o.location || "file:" !== o.location.protocol || !o.ActiveXObject)) return new XMLHttpRequest();
try {
return new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
try {
return new ActiveXObject("Msxml2.XMLHTTP.6.0");
} catch (e) {}
try {
return new ActiveXObject("Msxml2.XMLHTTP.3.0");
} catch (e) {}
try {
return new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {}
throw new Error("Browser-only version of superagent could not find XHR");
};
var d = "".trim ? function (e) {
return e.trim();
} : function (e) {
return e.replace(/(^\s*|\s*$)/g, "");
};
function g(e) {
if (!u(e)) return e;
var t = [];
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && y(t, r, e[r]);
return t.join("&");
}
function y(e, t, r) {
if (void 0 !== r) if (null !== r) {
if (Array.isArray(r)) r.forEach(function (r) {
y(e, t, r);
});else if (u(r)) for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && y(e, "".concat(t, "[").concat(n, "]"), r[n]);else e.push(encodeURI(t) + "=" + encodeURIComponent(r));
} else e.push(encodeURI(t));
}
function m(e) {
for (var t, r, n = {}, o = e.split("&"), s = 0, i = o.length; s < i; ++s) -1 === (r = (t = o[s]).indexOf("=")) ? n[decodeURIComponent(t)] = "" : n[decodeURIComponent(t.slice(0, r))] = decodeURIComponent(t.slice(r + 1));
return n;
}
function b(e) {
return /[/+]json($|[^-\w])/i.test(e);
}
function w(e) {
this.req = e, this.xhr = this.req.xhr, this.text = "HEAD" !== this.req.method && ("" === this.xhr.responseType || "text" === this.xhr.responseType) || void 0 === this.xhr.responseType ? this.xhr.responseText : null, this.statusText = this.req.xhr.statusText;
var t = this.xhr.status;
1223 === t && (t = 204), this._setStatusProperties(t), this.headers = function (e) {
for (var t, r, n, o, s = e.split(/\r?\n/), i = {}, a = 0, c = s.length; a < c; ++a) -1 !== (t = (r = s[a]).indexOf(":")) && (n = r.slice(0, t).toLowerCase(), o = d(r.slice(t + 1)), i[n] = o);
return i;
}(this.xhr.getAllResponseHeaders()), this.header = this.headers, this.header["content-type"] = this.xhr.getResponseHeader("content-type"), this._setHeaderProperties(this.header), null === this.text && e._responseType ? this.body = this.xhr.response : this.body = "HEAD" === this.req.method ? null : this._parseBody(this.text ? this.text : this.xhr.response);
}
function A(e, t) {
var r = this;
this._query = this._query || [], this.method = e, this.url = t, this.header = {}, this._header = {}, this.on("end", function () {
var e,
t = null,
n = null;
try {
n = new w(r);
} catch (e) {
return (t = new Error("Parser is unable to parse the response")).parse = !0, t.original = e, r.xhr ? (t.rawResponse = void 0 === r.xhr.responseType ? r.xhr.responseText : r.xhr.response, t.status = r.xhr.status ? r.xhr.status : null, t.statusCode = t.status) : (t.rawResponse = null, t.status = null), r.callback(t);
}
r.emit("response", n);
try {
r._isResponseOK(n) || (e = new Error(n.statusText || n.text || "Unsuccessful HTTP response"));
} catch (t) {
e = t;
}
e ? (e.original = t, e.response = n, e.status = n.status, r.callback(e, n)) : r.callback(null, n);
});
}
function v(e, t, r) {
var n = f("DELETE", e);
return "function" == typeof t && (r = t, t = null), t && n.send(t), r && n.end(r), n;
}
f.serializeObject = g, f.parseString = m, f.types = {
html: "text/html",
json: "application/json",
xml: "text/xml",
urlencoded: "application/x-www-form-urlencoded",
form: "application/x-www-form-urlencoded",
"form-data": "application/x-www-form-urlencoded"
}, f.serialize = {
"application/x-www-form-urlencoded": a.stringify,
"application/json": i
}, f.parse = {
"application/x-www-form-urlencoded": m,
"application/json": JSON.parse
}, l(w.prototype), w.prototype._parseBody = function (e) {
var t = f.parse[this.type];
return this.req._parser ? this.req._parser(this, e) : (!t && b(this.type) && (t = f.parse["application/json"]), t && e && (e.length > 0 || e instanceof Object) ? t(e) : null);
}, w.prototype.toError = function () {
var e = this.req,
t = e.method,
r = e.url,
n = "cannot ".concat(t, " ").concat(r, " (").concat(this.status, ")"),
o = new Error(n);
return o.status = this.status, o.method = t, o.url = r, o;
}, f.Response = w, s(A.prototype), c(A.prototype), A.prototype.type = function (e) {
return this.set("Content-Type", f.types[e] || e), this;
}, A.prototype.accept = function (e) {
return this.set("Accept", f.types[e] || e), this;
}, A.prototype.auth = function (e, t, r) {
1 === arguments.length && (t = ""), "object" === n(t) && null !== t && (r = t, t = ""), r || (r = {
type: "function" == typeof btoa ? "basic" : "auto"
});
var o = function (e) {
if ("function" == typeof btoa) return btoa(e);
throw new Error("Cannot use basic auth, btoa is not a function");
};
return this._auth(e, t, r, o);
}, A.prototype.query = function (e) {
return "string" != typeof e && (e = g(e)), e && this._query.push(e), this;
}, A.prototype.attach = function (e, t, r) {
if (t) {
if (this._data) throw new Error("superagent can't mix .send() and .attach()");
this._getFormData().append(e, t, r || t.name);
}
return this;
}, A.prototype._getFormData = function () {
return this._formData || (this._formData = new o.FormData()), this._formData;
}, A.prototype.callback = function (e, t) {
if (this._shouldRetry(e, t)) return this._retry();
var r = this._callback;
this.clearTimeout(), e && (this._maxRetries && (e.retries = this._retries - 1), this.emit("error", e)), r(e, t);
}, A.prototype.crossDomainError = function () {
var e = new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");
e.crossDomain = !0, e.status = this.status, e.method = this.method, e.url = this.url, this.callback(e);
}, A.prototype.agent = function () {
return console.warn("This is not supported in browser version of superagent"), this;
}, A.prototype.ca = A.prototype.agent, A.prototype.buffer = A.prototype.ca, A.prototype.write = function () {
throw new Error("Streaming is not supported in browser version of superagent");
}, A.prototype.pipe = A.prototype.write, A.prototype._isHost = function (e) {
return e && "object" === n(e) && !Array.isArray(e) && "[object Object]" !== Object.prototype.toString.call(e);
}, A.prototype.end = function (e) {
this._endCalled && console.warn("Warning: .end() was called twice. This is not supported in superagent"), this._endCalled = !0, this._callback = e || p, this._finalizeQueryString(), this._end();
}, A.prototype._setUploadTimeout = function () {
var e = this;
this._uploadTimeout && !this._uploadTimeoutTimer && (this._uploadTimeoutTimer = setTimeout(function () {
e._timeoutError("Upload timeout of ", e._uploadTimeout, "ETIMEDOUT");
}, this._uploadTimeout));
}, A.prototype._end = function () {
if (this._aborted) return this.callback(new Error("The request has been aborted even before .end() was called"));
var e = this;
this.xhr = f.getXHR();
var t = this.xhr,
r = this._formData || this._data;
this._setTimeouts(), t.onreadystatechange = function () {
var r = t.readyState;
if (r >= 2 && e._responseTimeoutTimer && clearTimeout(e._responseTimeoutTimer), 4 === r) {
var n;
try {
n = t.status;
} catch (e) {
n = 0;
}
if (!n) {
if (e.timedout || e._aborted) return;
return e.crossDomainError();
}
e.emit("end");
}
};
var n = function (t, r) {
r.total > 0 && (r.percent = r.loaded / r.total * 100, 100 === r.percent && clearTimeout(e._uploadTimeoutTimer)), r.direction = t, e.emit("progress", r);
};
if (this.hasListeners("progress")) try {
t.addEventListener("progress", n.bind(null, "download")), t.upload && t.upload.addEventListener("progress", n.bind(null, "upload"));
} catch (e) {}
t.upload && this._setUploadTimeout();
try {
this.username && this.password ? t.open(this.method, this.url, !0, this.username, this.password) : t.open(this.method, this.url, !0);
} catch (e) {
return this.callback(e);
}
if (this._withCredentials && (t.withCredentials = !0), !this._formData && "GET" !== this.method && "HEAD" !== this.method && "string" != typeof r && !this._isHost(r)) {
var o = this._header["content-type"],
s = this._serializer || f.serialize[o ? o.split(";")[0] : ""];
!s && b(o) && (s = f.serialize["application/json"]), s && (r = s(r));
}
for (var i in this.header) null !== this.header[i] && Object.prototype.hasOwnProperty.call(this.header, i) && t.setRequestHeader(i, this.header[i]);
this._responseType && (t.responseType = this._responseType), this.emit("request", this), t.send(void 0 === r ? null : r);
}, f.agent = function () {
return new h();
}, ["GET", "POST", "OPTIONS", "PATCH", "PUT", "DELETE"].forEach(function (e) {
h.prototype[e.toLowerCase()] = function (t, r) {
var n = new f.Request(e, t);
return this._setDefaults(n), r && n.end(r), n;
};
}), h.prototype.del = h.prototype.delete, f.get = function (e, t, r) {
var n = f("GET", e);
return "function" == typeof t && (r = t, t = null), t && n.query(t), r && n.end(r), n;
}, f.head = function (e, t, r) {
var n = f("HEAD", e);
return "function" == typeof t && (r = t, t = null), t && n.query(t), r && n.end(r), n;
}, f.options = function (e, t, r) {
var n = f("OPTIONS", e);
return "function" == typeof t && (r = t, t = null), t && n.send(t), r && n.end(r), n;
}, f.del = v, f.delete = v, f.patch = function (e, t, r) {
var n = f("PATCH", e);
return "function" == typeof t && (r = t, t = null), t && n.send(t), r && n.end(r), n;
}, f.post = function (e, t, r) {
var n = f("POST", e);
return "function" == typeof t && (r = t, t = null), t && n.send(t), r && n.end(r), n;
}, f.put = function (e, t, r) {
var n = f("PUT", e);
return "function" == typeof t && (r = t, t = null), t && n.send(t), r && n.end(r), n;
};
},
1960: e => {
"use strict";
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);
}
e.exports = function (e) {
return null !== e && "object" === t(e);
};
},
4287: (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 = r(1960);
function s(e) {
if (e) return function (e) {
for (var t in s.prototype) Object.prototype.hasOwnProperty.call(s.prototype, t) && (e[t] = s.prototype[t]);
return e;
}(e);
}
e.exports = s, s.prototype.clearTimeout = function () {
return clearTimeout(this._timer), clearTimeout(this._responseTimeoutTimer), clearTimeout(this._uploadTimeoutTimer), delete this._timer, delete this._responseTimeoutTimer, delete this._uploadTimeoutTimer, this;
}, s.prototype.parse = function (e) {
return this._parser = e, this;
}, s.prototype.responseType = function (e) {
return this._responseType = e, this;
}, s.prototype.serialize = function (e) {
return this._serializer = e, this;
}, s.prototype.timeout = function (e) {
if (!e || "object" !== n(e)) return this._timeout = e, this._responseTimeout = 0, this._uploadTimeout = 0, this;
for (var t in e) if (Object.prototype.hasOwnProperty.call(e, t)) switch (t) {
case "deadline":
this._timeout = e.deadline;
break;
case "response":
this._responseTimeout = e.response;
break;
case "upload":
this._uploadTimeout = e.upload;
break;
default:
console.warn("Unknown timeout option", t);
}
return this;
}, s.prototype.retry = function (e, t) {
return 0 !== arguments.length && !0 !== e || (e = 1), e <= 0 && (e = 0), this._maxRetries = e, this._retries = 0, this._retryCallback = t, this;
};
var i = new Set(["ETIMEDOUT", "ECONNRESET", "EADDRINUSE", "ECONNREFUSED", "EPIPE", "ENOTFOUND", "ENETUNREACH", "EAI_AGAIN"]),
a = new Set([408, 413, 429, 500, 502, 503, 504, 521, 522, 524]);
s.prototype._shouldRetry = function (e, t) {
if (!this._maxRetries || this._retries++ >= this._maxRetries) return !1;
if (this._retryCallback) try {
var r = this._retryCallback(e, t);
if (!0 === r) return !0;
if (!1 === r) return !1;
} catch (e) {
console.error(e);
}
if (t && t.status && a.has(t.status)) return !0;
if (e) {
if (e.code && i.has(e.code)) return !0;
if (e.timeout && "ECONNABORTED" === e.code) return !0;
if (e.crossDomain) return !0;
}
return !1;
}, s.prototype._retry = function () {
return this.clearTimeout(), this.req && (this.req = null, this.req = this.request()), this._aborted = !1, this.timedout = !1, this.timedoutError = null, this._end();
}, s.prototype.then = function (e, t) {
var r = this;
if (!this._fullfilledPromise) {
var n = this;
this._endCalled && console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"), this._fullfilledPromise = new Promise(function (e, t) {
n.on("abort", function () {
if (!(r._maxRetries && r._maxRetries > r._retries)) if (r.timedout && r.timedoutError) t(r.timedoutError);else {
var e = new Error("Aborted");
e.code = "ABORTED", e.status = r.status, e.method = r.method, e.url = r.url, t(e);
}
}), n.end(function (r, n) {
r ? t(r) : e(n);
});
});
}
return this._fullfilledPromise.then(e, t);
}, s.prototype.catch = function (e) {
return this.then(void 0, e);
}, s.prototype.use = function (e) {
return e(this), this;
}, s.prototype.ok = function (e) {
if ("function" != typeof e) throw new Error("Callback required");
return this._okCallback = e, this;
}, s.prototype._isResponseOK = function (e) {
return !!e && (this._okCallback ? this._okCallback(e) : e.status >= 200 && e.status < 300);
}, s.prototype.get = function (e) {
return this._header[e.toLowerCase()];
}, s.prototype.getHeader = s.prototype.get, s.prototype.set = function (e, t) {
if (o(e)) {
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && this.set(r, e[r]);
return this;
}
return this._header[e.toLowerCase()] = t, this.header[e] = t, this;
}, s.prototype.unset = function (e) {
return delete this._header[e.toLowerCase()], delete this.header[e], this;
}, s.prototype.field = function (e, t) {
if (null == e) throw new Error(".field(name, val) name can not be empty");
if (this._data) throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");
if (o(e)) {
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && this.field(r, e[r]);
return this;
}
if (Array.isArray(t)) {
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && this.field(e, t[n]);
return this;
}
if (null == t) throw new Error(".field(name, val) val can not be empty");
return "boolean" == typeof t && (t = String(t)), this._getFormData().append(e, t), this;
}, s.prototype.abort = function () {
return this._aborted || (this._aborted = !0, this.xhr && this.xhr.abort(), this.req && this.req.abort(), this.clearTimeout(), this.emit("abort")), this;
}, s.prototype._auth = function (e, t, r, n) {
switch (r.type) {
case "basic":
this.set("Authorization", "Basic ".concat(n("".concat(e, ":").concat(t))));
break;
case "auto":
this.username = e, this.password = t;
break;
case "bearer":
this.set("Authorization", "Bearer ".concat(e));
}
return this;
}, s.prototype.withCredentials = function (e) {
return void 0 === e && (e = !0), this._withCredentials = e, this;
}, s.prototype.redirects = function (e) {
return this._maxRedirects = e, this;
}, s.prototype.maxResponseSize = function (e) {
if ("number" != typeof e) throw new TypeError("Invalid argument");
return this._maxResponseSize = e, this;
}, s.prototype.toJSON = function () {
return {
method: this.method,
url: this.url,
data: this._data,
headers: this._header
};
}, s.prototype.send = function (e) {
var t = o(e),
r = this._header["content-type"];
if (this._formData) throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");
if (t && !this._data) Array.isArray(e) ? this._data = [] : this._isHost(e) || (this._data = {});else if (e && this._data && this._isHost(this._data)) throw new Error("Can't merge these send calls");
if (t && o(this._data)) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (this._data[n] = e[n]);else "string" == typeof e ? (r || this.type("form"), (r = this._header["content-type"]) && (r = r.toLowerCase().trim()), this._data = "application/x-www-form-urlencoded" === r ? this._data ? "".concat(this._data, "&").concat(e) : e : (this._data || "") + e) : this._data = e;
return !t || this._isHost(e) || r || this.type("json"), this;
}, s.prototype.sortQuery = function (e) {
return this._sort = void 0 === e || e, this;
}, s.prototype._finalizeQueryString = function () {
var e = this._query.join("&");
if (e && (this.url += (this.url.includes("?") ? "&" : "?") + e), this._query.length = 0, this._sort) {
var t = this.url.indexOf("?");
if (t >= 0) {
var r = this.url.slice(t + 1).split("&");
"function" == typeof this._sort ? r.sort(this._sort) : r.sort(), this.url = this.url.slice(0, t) + "?" + r.join("&");
}
}
}, s.prototype._appendQueryString = function () {
console.warn("Unsupported");
}, s.prototype._timeoutError = function (e, t, r) {
if (!this._aborted) {
var n = new Error("".concat(e + t, "ms exceeded"));
n.timeout = t, n.code = "ECONNABORTED", n.errno = r, this.timedout = !0, this.timedoutError = n, this.abort(), this.callback(n);
}
}, s.prototype._setTimeouts = function () {
var e = this;
this._timeout && !this._timer && (this._timer = setTimeout(function () {
e._timeoutError("Timeout of ", e._timeout, "ETIME");
}, this._timeout)), this._responseTimeout && !this._responseTimeoutTimer && (this._responseTimeoutTimer = setTimeout(function () {
e._timeoutError("Response timeout of ", e._responseTimeout, "ETIMEDOUT");
}, this._responseTimeout));
};
},
969: (e, t, r) => {
"use strict";
var n = r(3094);
function o(e) {
if (e) return function (e) {
for (var t in o.prototype) Object.prototype.hasOwnProperty.call(o.prototype, t) && (e[t] = o.prototype[t]);
return e;
}(e);
}
e.exports = o, o.prototype.get = function (e) {
return this.header[e.toLowerCase()];
}, o.prototype._setHeaderProperties = function (e) {
var t = e["content-type"] || "";
this.type = n.type(t);
var r = n.params(t);
for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (this[o] = r[o]);
this.links = {};
try {
e.link && (this.links = n.parseLinks(e.link));
} catch (e) {}
}, o.prototype._setStatusProperties = function (e) {
var t = e / 100 | 0;
this.statusCode = e, this.status = this.statusCode, this.statusType = t, this.info = 1 === t, this.ok = 2 === t, this.redirect = 3 === t, this.clientError = 4 === t, this.serverError = 5 === t, this.error = (4 === t || 5 === t) && this.toError(), this.created = 201 === e, this.accepted = 202 === e, this.noContent = 204 === e, this.badRequest = 400 === e, this.unauthorized = 401 === e, this.notAcceptable = 406 === e, this.forbidden = 403 === e, this.notFound = 404 === e, this.unprocessableEntity = 422 === e;
};
},
3094: (e, t) => {
"use strict";
function r(e, t) {
var r;
if ("undefined" == typeof Symbol || null == e[Symbol.iterator]) {
if (Array.isArray(e) || (r = function (e, t) {
if (e) {
if ("string" == typeof e) return n(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) ? n(e, t) : void 0;
}
}(e)) || t && e && "number" == typeof e.length) {
r && (e = r);
var o = 0,
s = function () {};
return {
s,
n: function () {
return o >= e.length ? {
done: !0
} : {
done: !1,
value: e[o++]
};
},
e: function (e) {
throw e;
},
f: s
};
}
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 = e[Symbol.iterator]();
},
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 n(e, t) {
(null == t || t > e.length) && (t = e.length);
for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
return n;
}
t.type = function (e) {
return e.split(/ *; */).shift();
}, t.params = function (e) {
var t,
n = {},
o = r(e.split(/ *; */));
try {
for (o.s(); !(t = o.n()).done;) {
var s = t.value.split(/ *= */),
i = s.shift(),
a = s.shift();
i && a && (n[i] = a);
}
} catch (e) {
o.e(e);
} finally {
o.f();
}
return n;
}, t.parseLinks = function (e) {
var t,
n = {},
o = r(e.split(/ *, */));
try {
for (o.s(); !(t = o.n()).done;) {
var s = t.value.split(/ *; */),
i = s[0].slice(1, -1);
n[s[1].split(/ *= */)[1].slice(1, -1)] = i;
}
} catch (e) {
o.e(e);
} finally {
o.f();
}
return n;
}, t.cleanHeader = function (e, t) {
return delete e["content-type"], delete e["content-length"], delete e["transfer-encoding"], delete e.host, t && (delete e.authorization, delete e.cookie), e;
};
},
5335: e => {
"use strict";
var t = String.prototype.replace,
r = /%20/g,
n = "RFC3986";
e.exports = {
default: n,
formatters: {
RFC1738: function (e) {
return t.call(e, r, "+");
},
RFC3986: function (e) {
return String(e);
}
},
RFC1738: "RFC1738",
RFC3986: n
};
},
3065: (e, t, r) => {
"use strict";
var n = r(4246),
o = r(1688),
s = r(5335);
e.exports = {
formats: s,
parse: o,
stringify: n
};
},
1688: (e, t, r) => {
"use strict";
var n = r(4562),
o = Object.prototype.hasOwnProperty,
s = Array.isArray,
i = {
allowDots: !1,
allowPrototypes: !1,
allowSparse: !1,
arrayLimit: 20,
charset: "utf-8",
charsetSentinel: !1,
comma: !1,
decoder: n.decode,
delimiter: "&",
depth: 5,
ignoreQueryPrefix: !1,
interpretNumericEntities: !1,
parameterLimit: 1e3,
parseArrays: !0,
plainObjects: !1,
strictNullHandling: !1
},
a = function (e) {
return e.replace(/&#(\d+);/g, function (e, t) {
return String.fromCharCode(parseInt(t, 10));
});
},
c = function (e, t) {
return e && "string" == typeof e && t.comma && e.indexOf(",") > -1 ? e.split(",") : e;
},
u = function (e, t, r, n) {
if (e) {
var s = r.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e,
i = /(\[[^[\]]*])/g,
a = r.depth > 0 && /(\[[^[\]]*])/.exec(s),
u = a ? s.slice(0, a.index) : s,
l = [];
if (u) {
if (!r.plainObjects && o.call(Object.prototype, u) && !r.allowPrototypes) return;
l.push(u);
}
for (var h = 0; r.depth > 0 && null !== (a = i.exec(s)) && h < r.depth;) {
if (h += 1, !r.plainObjects && o.call(Object.prototype, a[1].slice(1, -1)) && !r.allowPrototypes) return;
l.push(a[1]);
}
return a && l.push("[" + s.slice(a.index) + "]"), function (e, t, r, n) {
for (var o = n ? t : c(t, r), s = e.length - 1; s >= 0; --s) {
var i,
a = e[s];
if ("[]" === a && r.parseArrays) i = [].concat(o);else {
i = r.plainObjects ? Object.create(null) : {};
var u = "[" === a.charAt(0) && "]" === a.charAt(a.length - 1) ? a.slice(1, -1) : a,
l = parseInt(u, 10);
r.parseArrays || "" !== u ? !isNaN(l) && a !== u && String(l) === u && l >= 0 && r.parseArrays && l <= r.arrayLimit ? (i = [])[l] = o : i[u] = o : i = {
0: o
};
}
o = i;
}
return o;
}(l, t, r, n);
}
};
e.exports = function (e, t) {
var r = function (e) {
if (!e) return i;
if (null !== e.decoder && void 0 !== e.decoder && "function" != typeof e.decoder) throw new TypeError("Decoder has to be a function.");
if (void 0 !== e.charset && "utf-8" !== e.charset && "iso-8859-1" !== e.charset) throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
var t = void 0 === e.charset ? i.charset : e.charset;
return {
allowDots: void 0 === e.allowDots ? i.allowDots : !!e.allowDots,
allowPrototypes: "boolean" == typeof e.allowPrototypes ? e.allowPrototypes : i.allowPrototypes,
allowSparse: "boolean" == typeof e.allowSparse ? e.allowSparse : i.allowSparse,
arrayLimit: "number" == typeof e.arrayLimit ? e.arrayLimit : i.arrayLimit,
charset: t,
charsetSentinel: "boolean" == typeof e.charsetSentinel ? e.charsetSentinel : i.charsetSentinel,
comma: "boolean" == typeof e.comma ? e.comma : i.comma,
decoder: "function" == typeof e.decoder ? e.decoder : i.decoder,
delimiter: "string" == typeof e.delimiter || n.isRegExp(e.delimiter) ? e.delimiter : i.delimiter,
depth: "number" == typeof e.depth || !1 === e.depth ? +e.depth : i.depth,
ignoreQueryPrefix: !0 === e.ignoreQueryPrefix,
interpretNumericEntities: "boolean" == typeof e.interpretNumericEntities ? e.interpretNumericEntities : i.interpretNumericEntities,
parameterLimit: "number" == typeof e.parameterLimit ? e.parameterLimit : i.parameterLimit,
parseArrays: !1 !== e.parseArrays,
plainObjects: "boolean" == typeof e.plainObjects ? e.plainObjects : i.plainObjects,
strictNullHandling: "boolean" == typeof e.strictNullHandling ? e.strictNullHandling : i.strictNullHandling
};
}(t);
if ("" === e || null == e) return r.plainObjects ? Object.create(null) : {};
for (var l = "string" == typeof e ? function (e, t) {
var r,
u = {},
l = t.ignoreQueryPrefix ? e.replace(/^\?/, "") : e,
h = t.parameterLimit === 1 / 0 ? void 0 : t.parameterLimit,
p = l.split(t.delimiter, h),
f = -1,
d = t.charset;
if (t.charsetSentinel) for (r = 0; r < p.length; ++r) 0 === p[r].indexOf("utf8=") && ("utf8=%E2%9C%93" === p[r] ? d = "utf-8" : "utf8=%26%2310003%3B" === p[r] && (d = "iso-8859-1"), f = r, r = p.length);
for (r = 0; r < p.length; ++r) if (r !== f) {
var g,
y,
m = p[r],
b = m.indexOf("]="),
w = -1 === b ? m.indexOf("=") : b + 1;
-1 === w ? (g = t.decoder(m, i.decoder, d, "key"), y = t.strictNullHandling ? null : "") : (g = t.decoder(m.slice(0, w), i.decoder, d, "key"), y = n.maybeMap(c(m.slice(w + 1), t), function (e) {
return t.decoder(e, i.decoder, d, "value");
})), y && t.interpretNumericEntities && "iso-8859-1" === d && (y = a(y)), m.indexOf("[]=") > -1 && (y = s(y) ? [y] : y), o.call(u, g) ? u[g] = n.combine(u[g], y) : u[g] = y;
}
return u;
}(e, r) : e, h = r.plainObjects ? Object.create(null) : {}, p = Object.keys(l), f = 0; f < p.length; ++f) {
var d = p[f],
g = u(d, l[d], r, "string" == typeof e);
h = n.merge(h, g, r);
}
return !0 === r.allowSparse ? h : n.compact(h);
};
},
4246: (e, t, r) => {
"use strict";
var n = r(3680),
o = r(4562),
s = r(5335),
i = Object.prototype.hasOwnProperty,
a = {
brackets: function (e) {
return e + "[]";
},
comma: "comma",
indices: function (e, t) {
return e + "[" + t + "]";
},
repeat: function (e) {
return e;
}
},
c = Array.isArray,
u = Array.prototype.push,
l = function (e, t) {
u.apply(e, c(t) ? t : [t]);
},
h = Date.prototype.toISOString,
p = s.default,
f = {
addQueryPrefix: !1,
allowDots: !1,
charset: "utf-8",
charsetSentinel: !1,
delimiter: "&",
encode: !0,
encoder: o.encode,
encodeValuesOnly: !1,
format: p,
formatter: s.formatters[p],
indices: !1,
serializeDate: function (e) {
return h.call(e);
},
skipNulls: !1,
strictNullHandling: !1
},
d = function e(t, r, s, i, a, u, h, p, d, g, y, m, b, w, A) {
var v,
x = t;
if (A.has(t)) throw new RangeError("Cyclic object value");
if ("function" == typeof h ? x = h(r, x) : x instanceof Date ? x = g(x) : "comma" === s && c(x) && (x = o.maybeMap(x, function (e) {
return e instanceof Date ? g(e) : e;
})), null === x) {
if (i) return u && !b ? u(r, f.encoder, w, "key", y) : r;
x = "";
}
if ("string" == typeof (v = x) || "number" == typeof v || "boolean" == typeof v || "symbol" == typeof v || "bigint" == typeof v || o.isBuffer(x)) return u ? [m(b ? r : u(r, f.encoder, w, "key", y)) + "=" + m(u(x, f.encoder, w, "value", y))] : [m(r) + "=" + m(String(x))];
var S,
E = [];
if (void 0 === x) return E;
if ("comma" === s && c(x)) S = [{
value: x.length > 0 ? x.join(",") || null : void 0
}];else if (c(h)) S = h;else {
var T = Object.keys(x);
S = p ? T.sort(p) : T;
}
for (var _ = 0; _ < S.length; ++_) {
var B = S[_],
k = "object" == typeof B && void 0 !== B.value ? B.value : x[B];
if (!a || null !== k) {
var I = c(x) ? "function" == typeof s ? s(r, B) : r : r + (d ? "." + B : "[" + B + "]");
A.set(t, !0);
var U = n();
l(E, e(k, I, s, i, a, u, h, p, d, g, y, m, b, w, U));
}
}
return E;
};
e.exports = function (e, t) {
var r,
o = e,
u = function (e) {
if (!e) return f;
if (null !== e.encoder && void 0 !== e.encoder && "function" != typeof e.encoder) throw new TypeError("Encoder has to be a function.");
var t = e.charset || f.charset;
if (void 0 !== e.charset && "utf-8" !== e.charset && "iso-8859-1" !== e.charset) throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
var r = s.default;
if (void 0 !== e.format) {
if (!i.call(s.formatters, e.format)) throw new TypeError("Unknown format option provided.");
r = e.format;
}
var n = s.formatters[r],
o = f.filter;
return ("function" == typeof e.filter || c(e.filter)) && (o = e.filter), {
addQueryPrefix: "boolean" == typeof e.addQueryPrefix ? e.addQueryPrefix : f.addQueryPrefix,
allowDots: void 0 === e.allowDots ? f.allowDots : !!e.allowDots,
charset: t,
charsetSentinel: "boolean" == typeof e.charsetSentinel ? e.charsetSentinel : f.charsetSentinel,
delimiter: void 0 === e.delimiter ? f.delimiter : e.delimiter,
encode: "boolean" == typeof e.encode ? e.encode : f.encode,
encoder: "function" == typeof e.encoder ? e.encoder : f.encoder,
encodeValuesOnly: "boolean" == typeof e.encodeValuesOnly ? e.encodeValuesOnly : f.encodeValuesOnly,
filter: o,
format: r,
formatter: n,
serializeDate: "function" == typeof e.serializeDate ? e.serializeDate : f.serializeDate,
skipNulls: "boolean" == typeof e.skipNulls ? e.skipNulls : f.skipNulls,
sort: "function" == typeof e.sort ? e.sort : null,
strictNullHandling: "boolean" == typeof e.strictNullHandling ? e.strictNullHandling : f.strictNullHandling
};
}(t);
"function" == typeof u.filter ? o = (0, u.filter)("", o) : c(u.filter) && (r = u.filter);
var h,
p = [];
if ("object" != typeof o || null === o) return "";
h = t && t.arrayFormat in a ? t.arrayFormat : t && "indices" in t ? t.indices ? "indices" : "repeat" : "indices";
var g = a[h];
r || (r = Object.keys(o)), u.sort && r.sort(u.sort);
for (var y = n(), m = 0; m < r.length; ++m) {
var b = r[m];
u.skipNulls && null === o[b] || l(p, d(o[b], b, g, u.strictNullHandling, u.skipNulls, u.encode ? u.encoder : null, u.filter, u.sort, u.allowDots, u.serializeDate, u.format, u.formatter, u.encodeValuesOnly, u.charset, y));
}
var w = p.join(u.delimiter),
A = !0 === u.addQueryPrefix ? "?" : "";
return u.charsetSentinel && ("iso-8859-1" === u.charset ? A += "utf8=%26%2310003%3B&" : A += "utf8=%E2%9C%93&"), w.length > 0 ? A + w : "";
};
},
4562: (e, t, r) => {
"use strict";
var n = r(5335),
o = Object.prototype.hasOwnProperty,
s = Array.isArray,
i = function () {
for (var e = [], t = 0; t < 256; ++t) e.push("%" + ((t < 16 ? "0" : "") + t.toString(16)).toUpperCase());
return e;
}(),
a = function (e, t) {
for (var r = t && t.plainObjects ? Object.create(null) : {}, n = 0; n < e.length; ++n) void 0 !== e[n] && (r[n] = e[n]);
return r;
};
e.exports = {
arrayToObject: a,
assign: function (e, t) {
return Object.keys(t).reduce(function (e, r) {
return e[r] = t[r], e;
}, e);
},
combine: function (e, t) {
return [].concat(e, t);
},
compact: function (e) {
for (var t = [{
obj: {
o: e
},
prop: "o"
}], r = [], n = 0; n < t.length; ++n) for (var o = t[n], i = o.obj[o.prop], a = Object.keys(i), c = 0; c < a.length; ++c) {
var u = a[c],
l = i[u];
"object" == typeof l && null !== l && -1 === r.indexOf(l) && (t.push({
obj: i,
prop: u
}), r.push(l));
}
return function (e) {
for (; e.length > 1;) {
var t = e.pop(),
r = t.obj[t.prop];
if (s(r)) {
for (var n = [], o = 0; o < r.length; ++o) void 0 !== r[o] && n.push(r[o]);
t.obj[t.prop] = n;
}
}
}(t), e;
},
decode: function (e, t, r) {
var n = e.replace(/\+/g, " ");
if ("iso-8859-1" === r) return n.replace(/%[0-9a-f]{2}/gi, unescape);
try {
return decodeURIComponent(n);
} catch (e) {
return n;
}
},
encode: function (e, t, r, o, s) {
if (0 === e.length) return e;
var a = e;
if ("symbol" == typeof e ? a = Symbol.prototype.toString.call(e) : "string" != typeof e && (a = String(e)), "iso-8859-1" === r) return escape(a).replace(/%u[0-9a-f]{4}/gi, function (e) {
return "%26%23" + parseInt(e.slice(2), 16) + "%3B";
});
for (var c = "", u = 0; u < a.length; ++u) {
var l = a.charCodeAt(u);
45 === l || 46 === l || 95 === l || 126 === l || l >= 48 && l <= 57 || l >= 65 && l <= 90 || l >= 97 && l <= 122 || s === n.RFC1738 && (40 === l || 41 === l) ? c += a.charAt(u) : l < 128 ? c += i[l] : l < 2048 ? c += i[192 | l >> 6] + i[128 | 63 & l] : l < 55296 || l >= 57344 ? c += i[224 | l >> 12] + i[128 | l >> 6 & 63] + i[128 | 63 & l] : (u += 1, l = 65536 + ((1023 & l) << 10 | 1023 & a.charCodeAt(u)), c += i[240 | l >> 18] + i[128 | l >> 12 & 63] + i[128 | l >> 6 & 63] + i[128 | 63 & l]);
}
return c;
},
isBuffer: function (e) {
return !(!e || "object" != typeof e || !(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e)));
},
isRegExp: function (e) {
return "[object RegExp]" === Object.prototype.toString.call(e);
},
maybeMap: function (e, t) {
if (s(e)) {
for (var r = [], n = 0; n < e.length; n += 1) r.push(t(e[n]));
return r;
}
return t(e);
},
merge: function e(t, r, n) {
if (!r) return t;
if ("object" != typeof r) {
if (s(t)) t.push(r);else {
if (!t || "object" != typeof t) return [t, r];
(n && (n.plainObjects || n.allowPrototypes) || !o.call(Object.prototype, r)) && (t[r] = !0);
}
return t;
}
if (!t || "object" != typeof t) return [t].concat(r);
var i = t;
return s(t) && !s(r) && (i = a(t, n)), s(t) && s(r) ? (r.forEach(function (r, s) {
if (o.call(t, s)) {
var i = t[s];
i && "object" == typeof i && r && "object" == typeof r ? t[s] = e(i, r, n) : t.push(r);
} else t[s] = r;
}), t) : Object.keys(r).reduce(function (t, s) {
var i = r[s];
return o.call(t, s) ? t[s] = e(t[s], i, n) : t[s] = i, t;
}, i);
}
};
},
7765: function (e, t) {
!function (e) {
"use strict";
var t = function (e) {
var t,
r = new Float64Array(16);
if (e) for (t = 0; t < e.length; t++) r[t] = e[t];
return r;
},
r = function () {
throw new Error("no PRNG");
},
n = new Uint8Array(16),
o = new Uint8Array(32);
o[0] = 9;
var s = t(),
i = t([1]),
a = t([56129, 1]),
c = t([30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995]),
u = t([61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222]),
l = t([54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553]),
h = t([26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214]),
p = t([41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139]);
function f(e, t, r, n) {
e[t] = r >> 24 & 255, e[t + 1] = r >> 16 & 255, e[t + 2] = r >> 8 & 255, e[t + 3] = 255 & r, e[t + 4] = n >> 24 & 255, e[t + 5] = n >> 16 & 255, e[t + 6] = n >> 8 & 255, e[t + 7] = 255 & n;
}
function d(e, t, r, n, o) {
var s,
i = 0;
for (s = 0; s < o; s++) i |= e[t + s] ^ r[n + s];
return (1 & i - 1 >>> 8) - 1;
}
function g(e, t, r, n) {
return d(e, t, r, n, 16);
}
function y(e, t, r, n) {
return d(e, t, r, n, 32);
}
function m(e, t, r, n) {
!function (e, t, r, n) {
for (var o, s = 255 & n[0] | (255 & n[1]) << 8 | (255 & n[2]) << 16 | (255 & n[3]) << 24, i = 255 & r[0] | (255 & r[1]) << 8 | (255 & r[2]) << 16 | (255 & r[3]) << 24, a = 255 & r[4] | (255 & r[5]) << 8 | (255 & r[6]) << 16 | (255 & r[7]) << 24, c = 255 & r[8] | (255 & r[9]) << 8 | (255 & r[10]) << 16 | (255 & r[11]) << 24, u = 255 & r[12] | (255 & r[13]) << 8 | (255 & r[14]) << 16 | (255 & r[15]) << 24, l = 255 & n[4] | (255 & n[5]) << 8 | (255 & n[6]) << 16 | (255 & n[7]) << 24, h = 255 & t[0] | (255 & t[1]) << 8 | (255 & t[2]) << 16 | (255 & t[3]) << 24, p = 255 & t[4] | (255 & t[5]) << 8 | (255 & t[6]) << 16 | (255 & t[7]) << 24, f = 255 & t[8] | (255 & t[9]) << 8 | (255 & t[10]) << 16 | (255 & t[11]) << 24, d = 255 & t[12] | (255 & t[13]) << 8 | (255 & t[14]) << 16 | (255 & t[15]) << 24, g = 255 & n[8] | (255 & n[9]) << 8 | (255 & n[10]) << 16 | (255 & n[11]) << 24, y = 255 & r[16] | (255 & r[17]) << 8 | (255 & r[18]) << 16 | (255 & r[19]) << 24, m = 255 & r[20] | (255 & r[21]) << 8 | (255 & r[22]) << 16 | (255 & r[23]) << 24, b = 255 & r[24] | (255 & r[25]) << 8 | (255 & r[26]) << 16 | (255 & r[27]) << 24, w = 255 & r[28] | (255 & r[29]) << 8 | (255 & r[30]) << 16 | (255 & r[31]) << 24, A = 255 & n[12] | (255 & n[13]) << 8 | (255 & n[14]) << 16 | (255 & n[15]) << 24, v = s, x = i, S = a, E = c, T = u, _ = l, B = h, k = p, I = f, U = d, C = g, R = y, O = m, D = b, N = w, P = A, L = 0; L < 20; L += 2) v ^= (o = (O ^= (o = (I ^= (o = (T ^= (o = v + O | 0) << 7 | o >>> 25) + v | 0) << 9 | o >>> 23) + T | 0) << 13 | o >>> 19) + I | 0) << 18 | o >>> 14, _ ^= (o = (x ^= (o = (D ^= (o = (U ^= (o = _ + x | 0) << 7 | o >>> 25) + _ | 0) << 9 | o >>> 23) + U | 0) << 13 | o >>> 19) + D | 0) << 18 | o >>> 14, C ^= (o = (B ^= (o = (S ^= (o = (N ^= (o = C + B | 0) << 7 | o >>> 25) + C | 0) << 9 | o >>> 23) + N | 0) << 13 | o >>> 19) + S | 0) << 18 | o >>> 14, P ^= (o = (R ^= (o = (k ^= (o = (E ^= (o = P + R | 0) << 7 | o >>> 25) + P | 0) << 9 | o >>> 23) + E | 0) << 13 | o >>> 19) + k | 0) << 18 | o >>> 14, v ^= (o = (E ^= (o = (S ^= (o = (x ^= (o = v + E | 0) << 7 | o >>> 25) + v | 0) << 9 | o >>> 23) + x | 0) << 13 | o >>> 19) + S | 0) << 18 | o >>> 14, _ ^= (o = (T ^= (o = (k ^= (o = (B ^= (o = _ + T | 0) << 7 | o >>> 25) + _ | 0) << 9 | o >>> 23) + B | 0) << 13 | o >>> 19) + k | 0) << 18 | o >>> 14, C ^= (o = (U ^= (o = (I ^= (o = (R ^= (o = C + U | 0) << 7 | o >>> 25) + C | 0) << 9 | o >>> 23) + R | 0) << 13 | o >>> 19) + I | 0) << 18 | o >>> 14, P ^= (o = (N ^= (o = (D ^= (o = (O ^= (o = P + N | 0) << 7 | o >>> 25) + P | 0) << 9 | o >>> 23) + O | 0) << 13 | o >>> 19) + D | 0) << 18 | o >>> 14;
v = v + s | 0, x = x + i | 0, S = S + a | 0, E = E + c | 0, T = T + u | 0, _ = _ + l | 0, B = B + h | 0, k = k + p | 0, I = I + f | 0, U = U + d | 0, C = C + g | 0, R = R + y | 0, O = O + m | 0, D = D + b | 0, N = N + w | 0, P = P + A | 0, e[0] = v >>> 0 & 255, e[1] = v >>> 8 & 255, e[2] = v >>> 16 & 255, e[3] = v >>> 24 & 255, e[4] = x >>> 0 & 255, e[5] = x >>> 8 & 255, e[6] = x >>> 16 & 255, e[7] = x >>> 24 & 255, e[8] = S >>> 0 & 255, e[9] = S >>> 8 & 255, e[10] = S >>> 16 & 255, e[11] = S >>> 24 & 255, e[12] = E >>> 0 & 255, e[13] = E >>> 8 & 255, e[14] = E >>> 16 & 255, e[15] = E >>> 24 & 255, e[16] = T >>> 0 & 255, e[17] = T >>> 8 & 255, e[18] = T >>> 16 & 255, e[19] = T >>> 24 & 255, e[20] = _ >>> 0 & 255, e[21] = _ >>> 8 & 255, e[22] = _ >>> 16 & 255, e[23] = _ >>> 24 & 255, e[24] = B >>> 0 & 255, e[25] = B >>> 8 & 255, e[26] = B >>> 16 & 255, e[27] = B >>> 24 & 255, e[28] = k >>> 0 & 255, e[29] = k >>> 8 & 255, e[30] = k >>> 16 & 255, e[31] = k >>> 24 & 255, e[32] = I >>> 0 & 255, e[33] = I >>> 8 & 255, e[34] = I >>> 16 & 255, e[35] = I >>> 24 & 255, e[36] = U >>> 0 & 255, e[37] = U >>> 8 & 255, e[38] = U >>> 16 & 255, e[39] = U >>> 24 & 255, e[40] = C >>> 0 & 255, e[41] = C >>> 8 & 255, e[42] = C >>> 16 & 255, e[43] = C >>> 24 & 255, e[44] = R >>> 0 & 255, e[45] = R >>> 8 & 255, e[46] = R >>> 16 & 255, e[47] = R >>> 24 & 255, e[48] = O >>> 0 & 255, e[49] = O >>> 8 & 255, e[50] = O >>> 16 & 255, e[51] = O >>> 24 & 255, e[52] = D >>> 0 & 255, e[53] = D >>> 8 & 255, e[54] = D >>> 16 & 255, e[55] = D >>> 24 & 255, e[56] = N >>> 0 & 255, e[57] = N >>> 8 & 255, e[58] = N >>> 16 & 255, e[59] = N >>> 24 & 255, e[60] = P >>> 0 & 255, e[61] = P >>> 8 & 255, e[62] = P >>> 16 & 255, e[63] = P >>> 24 & 255;
}(e, t, r, n);
}
function b(e, t, r, n) {
!function (e, t, r, n) {
for (var o, s = 255 & n[0] | (255 & n[1]) << 8 | (255 & n[2]) << 16 | (255 & n[3]) << 24, i = 255 & r[0] | (255 & r[1]) << 8 | (255 & r[2]) << 16 | (255 & r[3]) << 24, a = 255 & r[4] | (255 & r[5]) << 8 | (255 & r[6]) << 16 | (255 & r[7]) << 24, c = 255 & r[8] | (255 & r[9]) << 8 | (255 & r[10]) << 16 | (255 & r[11]) << 24, u = 255 & r[12] | (255 & r[13]) << 8 | (255 & r[14]) << 16 | (255 & r[15]) << 24, l = 255 & n[4] | (255 & n[5]) << 8 | (255 & n[6]) << 16 | (255 & n[7]) << 24, h = 255 & t[0] | (255 & t[1]) << 8 | (255 & t[2]) << 16 | (255 & t[3]) << 24, p = 255 & t[4] | (255 & t[5]) << 8 | (255 & t[6]) << 16 | (255 & t[7]) << 24, f = 255 & t[8] | (255 & t[9]) << 8 | (255 & t[10]) << 16 | (255 & t[11]) << 24, d = 255 & t[12] | (255 & t[13]) << 8 | (255 & t[14]) << 16 | (255 & t[15]) << 24, g = 255 & n[8] | (255 & n[9]) << 8 | (255 & n[10]) << 16 | (255 & n[11]) << 24, y = 255 & r[16] | (255 & r[17]) << 8 | (255 & r[18]) << 16 | (255 & r[19]) << 24, m = 255 & r[20] | (255 & r[21]) << 8 | (255 & r[22]) << 16 | (255 & r[23]) << 24, b = 255 & r[24] | (255 & r[25]) << 8 | (255 & r[26]) << 16 | (255 & r[27]) << 24, w = 255 & r[28] | (255 & r[29]) << 8 | (255 & r[30]) << 16 | (255 & r[31]) << 24, A = 255 & n[12] | (255 & n[13]) << 8 | (255 & n[14]) << 16 | (255 & n[15]) << 24, v = 0; v < 20; v += 2) s ^= (o = (m ^= (o = (f ^= (o = (u ^= (o = s + m | 0) << 7 | o >>> 25) + s | 0) << 9 | o >>> 23) + u | 0) << 13 | o >>> 19) + f | 0) << 18 | o >>> 14, l ^= (o = (i ^= (o = (b ^= (o = (d ^= (o = l + i | 0) << 7 | o >>> 25) + l | 0) << 9 | o >>> 23) + d | 0) << 13 | o >>> 19) + b | 0) << 18 | o >>> 14, g ^= (o = (h ^= (o = (a ^= (o = (w ^= (o = g + h | 0) << 7 | o >>> 25) + g | 0) << 9 | o >>> 23) + w | 0) << 13 | o >>> 19) + a | 0) << 18 | o >>> 14, A ^= (o = (y ^= (o = (p ^= (o = (c ^= (o = A + y | 0) << 7 | o >>> 25) + A | 0) << 9 | o >>> 23) + c | 0) << 13 | o >>> 19) + p | 0) << 18 | o >>> 14, s ^= (o = (c ^= (o = (a ^= (o = (i ^= (o = s + c | 0) << 7 | o >>> 25) + s | 0) << 9 | o >>> 23) + i | 0) << 13 | o >>> 19) + a | 0) << 18 | o >>> 14, l ^= (o = (u ^= (o = (p ^= (o = (h ^= (o = l + u | 0) << 7 | o >>> 25) + l | 0) << 9 | o >>> 23) + h | 0) << 13 | o >>> 19) + p | 0) << 18 | o >>> 14, g ^= (o = (d ^= (o = (f ^= (o = (y ^= (o = g + d | 0) << 7 | o >>> 25) + g | 0) << 9 | o >>> 23) + y | 0) << 13 | o >>> 19) + f | 0) << 18 | o >>> 14, A ^= (o = (w ^= (o = (b ^= (o = (m ^= (o = A + w | 0) << 7 | o >>> 25) + A | 0) << 9 | o >>> 23) + m | 0) << 13 | o >>> 19) + b | 0) << 18 | o >>> 14;
e[0] = s >>> 0 & 255, e[1] = s >>> 8 & 255, e[2] = s >>> 16 & 255, e[3] = s >>> 24 & 255, e[4] = l >>> 0 & 255, e[5] = l >>> 8 & 255, e[6] = l >>> 16 & 255, e[7] = l >>> 24 & 255, e[8] = g >>> 0 & 255, e[9] = g >>> 8 & 255, e[10] = g >>> 16 & 255, e[11] = g >>> 24 & 255, e[12] = A >>> 0 & 255, e[13] = A >>> 8 & 255, e[14] = A >>> 16 & 255, e[15] = A >>> 24 & 255, e[16] = h >>> 0 & 255, e[17] = h >>> 8 & 255, e[18] = h >>> 16 & 255, e[19] = h >>> 24 & 255, e[20] = p >>> 0 & 255, e[21] = p >>> 8 & 255, e[22] = p >>> 16 & 255, e[23] = p >>> 24 & 255, e[24] = f >>> 0 & 255, e[25] = f >>> 8 & 255, e[26] = f >>> 16 & 255, e[27] = f >>> 24 & 255, e[28] = d >>> 0 & 255, e[29] = d >>> 8 & 255, e[30] = d >>> 16 & 255, e[31] = d >>> 24 & 255;
}(e, t, r, n);
}
var w = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);
function A(e, t, r, n, o, s, i) {
var a,
c,
u = new Uint8Array(16),
l = new Uint8Array(64);
for (c = 0; c < 16; c++) u[c] = 0;
for (c = 0; c < 8; c++) u[c] = s[c];
for (; o >= 64;) {
for (m(l, u, i, w), c = 0; c < 64; c++) e[t + c] = r[n + c] ^ l[c];
for (a = 1, c = 8; c < 16; c++) a = a + (255 & u[c]) | 0, u[c] = 255 & a, a >>>= 8;
o -= 64, t += 64, n += 64;
}
if (o > 0) for (m(l, u, i, w), c = 0; c < o; c++) e[t + c] = r[n + c] ^ l[c];
return 0;
}
function v(e, t, r, n, o) {
var s,
i,
a = new Uint8Array(16),
c = new Uint8Array(64);
for (i = 0; i < 16; i++) a[i] = 0;
for (i = 0; i < 8; i++) a[i] = n[i];
for (; r >= 64;) {
for (m(c, a, o, w), i = 0; i < 64; i++) e[t + i] = c[i];
for (s = 1, i = 8; i < 16; i++) s = s + (255 & a[i]) | 0, a[i] = 255 & s, s >>>= 8;
r -= 64, t += 64;
}
if (r > 0) for (m(c, a, o, w), i = 0; i < r; i++) e[t + i] = c[i];
return 0;
}
function x(e, t, r, n, o) {
var s = new Uint8Array(32);
b(s, n, o, w);
for (var i = new Uint8Array(8), a = 0; a < 8; a++) i[a] = n[a + 16];
return v(e, t, r, i, s);
}
function S(e, t, r, n, o, s, i) {
var a = new Uint8Array(32);
b(a, s, i, w);
for (var c = new Uint8Array(8), u = 0; u < 8; u++) c[u] = s[u + 16];
return A(e, t, r, n, o, c, a);
}
var E = function (e) {
var t, r, n, o, s, i, a, c;
this.buffer = new Uint8Array(16), this.r = new Uint16Array(10), this.h = new Uint16Array(10), this.pad = new Uint16Array(8), this.leftover = 0, this.fin = 0, t = 255 & e[0] | (255 & e[1]) << 8, this.r[0] = 8191 & t, r = 255 & e[2] | (255 & e[3]) << 8, this.r[1] = 8191 & (t >>> 13 | r << 3), n = 255 & e[4] | (255 & e[5]) << 8, this.r[2] = 7939 & (r >>> 10 | n << 6), o = 255 & e[6] | (255 & e[7]) << 8, this.r[3] = 8191 & (n >>> 7 | o << 9), s = 255 & e[8] | (255 & e[9]) << 8, this.r[4] = 255 & (o >>> 4 | s << 12), this.r[5] = s >>> 1 & 8190, i = 255 & e[10] | (255 & e[11]) << 8, this.r[6] = 8191 & (s >>> 14 | i << 2), a = 255 & e[12] | (255 & e[13]) << 8, this.r[7] = 8065 & (i >>> 11 | a << 5), c = 255 & e[14] | (255 & e[15]) << 8, this.r[8] = 8191 & (a >>> 8 | c << 8), this.r[9] = c >>> 5 & 127, this.pad[0] = 255 & e[16] | (255 & e[17]) << 8, this.pad[1] = 255 & e[18] | (255 & e[19]) << 8, this.pad[2] = 255 & e[20] | (255 & e[21]) << 8, this.pad[3] = 255 & e[22] | (255 & e[23]) << 8, this.pad[4] = 255 & e[24] | (255 & e[25]) << 8, this.pad[5] = 255 & e[26] | (255 & e[27]) << 8, this.pad[6] = 255 & e[28] | (255 & e[29]) << 8, this.pad[7] = 255 & e[30] | (255 & e[31]) << 8;
};
function T(e, t, r, n, o, s) {
var i = new E(s);
return i.update(r, n, o), i.finish(e, t), 0;
}
function _(e, t, r, n, o, s) {
var i = new Uint8Array(16);
return T(i, 0, r, n, o, s), g(e, t, i, 0);
}
function B(e, t, r, n, o) {
var s;
if (r < 32) return -1;
for (S(e, 0, t, 0, r, n, o), T(e, 16, e, 32, r - 32, e), s = 0; s < 16; s++) e[s] = 0;
return 0;
}
function k(e, t, r, n, o) {
var s,
i = new Uint8Array(32);
if (r < 32) return -1;
if (x(i, 0, 32, n, o), 0 !== _(t, 16, t, 32, r - 32, i)) return -1;
for (S(e, 0, t, 0, r, n, o), s = 0; s < 32; s++) e[s] = 0;
return 0;
}
function I(e, t) {
var r;
for (r = 0; r < 16; r++) e[r] = 0 | t[r];
}
function U(e) {
var t,
r,
n = 1;
for (t = 0; t < 16; t++) r = e[t] + n + 65535, n = Math.floor(r / 65536), e[t] = r - 65536 * n;
e[0] += n - 1 + 37 * (n - 1);
}
function C(e, t, r) {
for (var n, o = ~(r - 1), s = 0; s < 16; s++) n = o & (e[s] ^ t[s]), e[s] ^= n, t[s] ^= n;
}
function R(e, r) {
var n,
o,
s,
i = t(),
a = t();
for (n = 0; n < 16; n++) a[n] = r[n];
for (U(a), U(a), U(a), o = 0; o < 2; o++) {
for (i[0] = a[0] - 65517, n = 1; n < 15; n++) i[n] = a[n] - 65535 - (i[n - 1] >> 16 & 1), i[n - 1] &= 65535;
i[15] = a[15] - 32767 - (i[14] >> 16 & 1), s = i[15] >> 16 & 1, i[14] &= 65535, C(a, i, 1 - s);
}
for (n = 0; n < 16; n++) e[2 * n] = 255 & a[n], e[2 * n + 1] = a[n] >> 8;
}
function O(e, t) {
var r = new Uint8Array(32),
n = new Uint8Array(32);
return R(r, e), R(n, t), y(r, 0, n, 0);
}
function D(e) {
var t = new Uint8Array(32);
return R(t, e), 1 & t[0];
}
function N(e, t) {
var r;
for (r = 0; r < 16; r++) e[r] = t[2 * r] + (t[2 * r + 1] << 8);
e[15] &= 32767;
}
function P(e, t, r) {
for (var n = 0; n < 16; n++) e[n] = t[n] + r[n];
}
function L(e, t, r) {
for (var n = 0; n < 16; n++) e[n] = t[n] - r[n];
}
function F(e, t, r) {
var n,
o,
s = 0,
i = 0,
a = 0,
c = 0,
u = 0,
l = 0,
h = 0,
p = 0,
f = 0,
d = 0,
g = 0,
y = 0,
m = 0,
b = 0,
w = 0,
A = 0,
v = 0,
x = 0,
S = 0,
E = 0,
T = 0,
_ = 0,
B = 0,
k = 0,
I = 0,
U = 0,
C = 0,
R = 0,
O = 0,
D = 0,
N = 0,
P = r[0],
L = r[1],
F = r[2],
j = r[3],
z = r[4],
M = r[5],
H = r[6],
G = r[7],
K = r[8],
q = r[9],
$ = r[10],
V = r[11],
W = r[12],
X = r[13],
Y = r[14],
J = r[15];
s += (n = t[0]) * P, i += n * L, a += n * F, c += n * j, u += n * z, l += n * M, h += n * H, p += n * G, f += n * K, d += n * q, g += n * $, y += n * V, m += n * W, b += n * X, w += n * Y, A += n * J, i += (n = t[1]) * P, a += n * L, c += n * F, u += n * j, l += n * z, h += n * M, p += n * H, f += n * G, d += n * K, g += n * q, y += n * $, m += n * V, b += n * W, w += n * X, A += n * Y, v += n * J, a += (n = t[2]) * P, c += n * L, u += n * F, l += n * j, h += n * z, p += n * M, f += n * H, d += n * G, g += n * K, y += n * q, m += n * $, b += n * V, w += n * W, A += n * X, v += n * Y, x += n * J, c += (n = t[3]) * P, u += n * L, l += n * F, h += n * j, p += n * z, f += n * M, d += n * H, g += n * G, y += n * K, m += n * q, b += n * $, w += n * V, A += n * W, v += n * X, x += n * Y, S += n * J, u += (n = t[4]) * P, l += n * L, h += n * F, p += n * j, f += n * z, d += n * M, g += n * H, y += n * G, m += n * K, b += n * q, w += n * $, A += n * V, v += n * W, x += n * X, S += n * Y, E += n * J, l += (n = t[5]) * P, h += n * L, p += n * F, f += n * j, d += n * z, g += n * M, y += n * H, m += n * G, b += n * K, w += n * q, A += n * $, v += n * V, x += n * W, S += n * X, E += n * Y, T += n * J, h += (n = t[6]) * P, p += n * L, f += n * F, d += n * j, g += n * z, y += n * M, m += n * H, b += n * G, w += n * K, A += n * q, v += n * $, x += n * V, S += n * W, E += n * X, T += n * Y, _ += n * J, p += (n = t[7]) * P, f += n * L, d += n * F, g += n * j, y += n * z, m += n * M, b += n * H, w += n * G, A += n * K, v += n * q, x += n * $, S += n * V, E += n * W, T += n * X, _ += n * Y, B += n * J, f += (n = t[8]) * P, d += n * L, g += n * F, y += n * j, m += n * z, b += n * M, w += n * H, A += n * G, v += n * K, x += n * q, S += n * $, E += n * V, T += n * W, _ += n * X, B += n * Y, k += n * J, d += (n = t[9]) * P, g += n * L, y += n * F, m += n * j, b += n * z, w += n * M, A += n * H, v += n * G, x += n * K, S += n * q, E += n * $, T += n * V, _ += n * W, B += n * X, k += n * Y, I += n * J, g += (n = t[10]) * P, y += n * L, m += n * F, b += n * j, w += n * z, A += n * M, v += n * H, x += n * G, S += n * K, E += n * q, T += n * $, _ += n * V, B += n * W, k += n * X, I += n * Y, U += n * J, y += (n = t[11]) * P, m += n * L, b += n * F, w += n * j, A += n * z, v += n * M, x += n * H, S += n * G, E += n * K, T += n * q, _ += n * $, B += n * V, k += n * W, I += n * X, U += n * Y, C += n * J, m += (n = t[12]) * P, b += n * L, w += n * F, A += n * j, v += n * z, x += n * M, S += n * H, E += n * G, T += n * K, _ += n * q, B += n * $, k += n * V, I += n * W, U += n * X, C += n * Y, R += n * J, b += (n = t[13]) * P, w += n * L, A += n * F, v += n * j, x += n * z, S += n * M, E += n * H, T += n * G, _ += n * K, B += n * q, k += n * $, I += n * V, U += n * W, C += n * X, R += n * Y, O += n * J, w += (n = t[14]) * P, A += n * L, v += n * F, x += n * j, S += n * z, E += n * M, T += n * H, _ += n * G, B += n * K, k += n * q, I += n * $, U += n * V, C += n * W, R += n * X, O += n * Y, D += n * J, A += (n = t[15]) * P, i += 38 * (x += n * F), a += 38 * (S += n * j), c += 38 * (E += n * z), u += 38 * (T += n * M), l += 38 * (_ += n * H), h += 38 * (B += n * G), p += 38 * (k += n * K), f += 38 * (I += n * q), d += 38 * (U += n * $), g += 38 * (C += n * V), y += 38 * (R += n * W), m += 38 * (O += n * X), b += 38 * (D += n * Y), w += 38 * (N += n * J), s = (n = (s += 38 * (v += n * L)) + (o = 1) + 65535) - 65536 * (o = Math.floor(n / 65536)), i = (n = i + o + 65535) - 65536 * (o = Math.floor(n / 65536)), a = (n = a + o + 65535) - 65536 * (o = Math.floor(n / 65536)), c = (n = c + o + 65535) - 65536 * (o = Math.floor(n / 65536)), u = (n = u + o + 65535) - 65536 * (o = Math.floor(n / 65536)), l = (n = l + o + 65535) - 65536 * (o = Math.floor(n / 65536)), h = (n = h + o + 65535) - 65536 * (o = Math.floor(n / 65536)), p = (n = p + o + 65535) - 65536 * (o = Math.floor(n / 65536)), f = (n = f + o + 65535) - 65536 * (o = Math.floor(n / 65536)), d = (n = d + o + 65535) - 65536 * (o = Math.floor(n / 65536)), g = (n = g + o + 65535) - 65536 * (o = Math.floor(n / 65536)), y = (n = y + o + 65535) - 65536 * (o = Math.floor(n / 65536)), m = (n = m + o + 65535) - 65536 * (o = Math.floor(n / 65536)), b = (n = b + o + 65535) - 65536 * (o = Math.floor(n / 65536)), w = (n = w + o + 65535) - 65536 * (o = Math.floor(n / 65536)), A = (n = A + o + 65535) - 65536 * (o = Math.floor(n / 65536)), s = (n = (s += o - 1 + 37 * (o - 1)) + (o = 1) + 65535) - 65536 * (o = Math.floor(n / 65536)), i = (n = i + o + 65535) - 65536 * (o = Math.floor(n / 65536)), a = (n = a + o + 65535) - 65536 * (o = Math.floor(n / 65536)), c = (n = c + o + 65535) - 65536 * (o = Math.floor(n / 65536)), u = (n = u + o + 65535) - 65536 * (o = Math.floor(n / 65536)), l = (n = l + o + 65535) - 65536 * (o = Math.floor(n / 65536)), h = (n = h + o + 65535) - 65536 * (o = Math.floor(n / 65536)), p = (n = p + o + 65535) - 65536 * (o = Math.floor(n / 65536)), f = (n = f + o + 65535) - 65536 * (o = Math.floor(n / 65536)), d = (n = d + o + 65535) - 65536 * (o = Math.floor(n / 65536)), g = (n = g + o + 65535) - 65536 * (o = Math.floor(n / 65536)), y = (n = y + o + 65535) - 65536 * (o = Math.floor(n / 65536)), m = (n = m + o + 65535) - 65536 * (o = Math.floor(n / 65536)), b = (n = b + o + 65535) - 65536 * (o = Math.floor(n / 65536)), w = (n = w + o + 65535) - 65536 * (o = Math.floor(n / 65536)), A = (n = A + o + 65535) - 65536 * (o = Math.floor(n / 65536)), s += o - 1 + 37 * (o - 1), e[0] = s, e[1] = i, e[2] = a, e[3] = c, e[4] = u, e[5] = l, e[6] = h, e[7] = p, e[8] = f, e[9] = d, e[10] = g, e[11] = y, e[12] = m, e[13] = b, e[14] = w, e[15] = A;
}
function j(e, t) {
F(e, t, t);
}
function z(e, r) {
var n,
o = t();
for (n = 0; n < 16; n++) o[n] = r[n];
for (n = 253; n >= 0; n--) j(o, o), 2 !== n && 4 !== n && F(o, o, r);
for (n = 0; n < 16; n++) e[n] = o[n];
}
function M(e, r) {
var n,
o = t();
for (n = 0; n < 16; n++) o[n] = r[n];
for (n = 250; n >= 0; n--) j(o, o), 1 !== n && F(o, o, r);
for (n = 0; n < 16; n++) e[n] = o[n];
}
function H(e, r, n) {
var o,
s,
i = new Uint8Array(32),
c = new Float64Array(80),
u = t(),
l = t(),
h = t(),
p = t(),
f = t(),
d = t();
for (s = 0; s < 31; s++) i[s] = r[s];
for (i[31] = 127 & r[31] | 64, i[0] &= 248, N(c, n), s = 0; s < 16; s++) l[s] = c[s], p[s] = u[s] = h[s] = 0;
for (u[0] = p[0] = 1, s = 254; s >= 0; --s) C(u, l, o = i[s >>> 3] >>> (7 & s) & 1), C(h, p, o), P(f, u, h), L(u, u, h), P(h, l, p), L(l, l, p), j(p, f), j(d, u), F(u, h, u), F(h, l, f), P(f, u, h), L(u, u, h), j(l, u), L(h, p, d), F(u, h, a), P(u, u, p), F(h, h, u), F(u, p, d), F(p, l, c), j(l, f), C(u, l, o), C(h, p, o);
for (s = 0; s < 16; s++) c[s + 16] = u[s], c[s + 32] = h[s], c[s + 48] = l[s], c[s + 64] = p[s];
var g = c.subarray(32),
y = c.subarray(16);
return z(g, g), F(y, y, g), R(e, y), 0;
}
function G(e, t) {
return H(e, t, o);
}
function K(e, t) {
return r(t, 32), G(e, t);
}
function q(e, t, r) {
var o = new Uint8Array(32);
return H(o, r, t), b(e, n, o, w);
}
E.prototype.blocks = function (e, t, r) {
for (var n, o, s, i, a, c, u, l, h, p, f, d, g, y, m, b, w, A, v, x = this.fin ? 0 : 2048, S = this.h[0], E = this.h[1], T = this.h[2], _ = this.h[3], B = this.h[4], k = this.h[5], I = this.h[6], U = this.h[7], C = this.h[8], R = this.h[9], O = this.r[0], D = this.r[1], N = this.r[2], P = this.r[3], L = this.r[4], F = this.r[5], j = this.r[6], z = this.r[7], M = this.r[8], H = this.r[9]; r >= 16;) p = h = 0, p += (S += 8191 & (n = 255 & e[t + 0] | (255 & e[t + 1]) << 8)) * O, p += (E += 8191 & (n >>> 13 | (o = 255 & e[t + 2] | (255 & e[t + 3]) << 8) << 3)) * (5 * H), p += (T += 8191 & (o >>> 10 | (s = 255 & e[t + 4] | (255 & e[t + 5]) << 8) << 6)) * (5 * M), p += (_ += 8191 & (s >>> 7 | (i = 255 & e[t + 6] | (255 & e[t + 7]) << 8) << 9)) * (5 * z), h = (p += (B += 8191 & (i >>> 4 | (a = 255 & e[t + 8] | (255 & e[t + 9]) << 8) << 12)) * (5 * j)) >>> 13, p &= 8191, p += (k += a >>> 1 & 8191) * (5 * F), p += (I += 8191 & (a >>> 14 | (c = 255 & e[t + 10] | (255 & e[t + 11]) << 8) << 2)) * (5 * L), p += (U += 8191 & (c >>> 11 | (u = 255 & e[t + 12] | (255 & e[t + 13]) << 8) << 5)) * (5 * P), p += (C += 8191 & (u >>> 8 | (l = 255 & e[t + 14] | (255 & e[t + 15]) << 8) << 8)) * (5 * N), f = h += (p += (R += l >>> 5 | x) * (5 * D)) >>> 13, f += S * D, f += E * O, f += T * (5 * H), f += _ * (5 * M), h = (f += B * (5 * z)) >>> 13, f &= 8191, f += k * (5 * j), f += I * (5 * F), f += U * (5 * L), f += C * (5 * P), h += (f += R * (5 * N)) >>> 13, f &= 8191, d = h, d += S * N, d += E * D, d += T * O, d += _ * (5 * H), h = (d += B * (5 * M)) >>> 13, d &= 8191, d += k * (5 * z), d += I * (5 * j), d += U * (5 * F), d += C * (5 * L), g = h += (d += R * (5 * P)) >>> 13, g += S * P, g += E * N, g += T * D, g += _ * O, h = (g += B * (5 * H)) >>> 13, g &= 8191, g += k * (5 * M), g += I * (5 * z), g += U * (5 * j), g += C * (5 * F), y = h += (g += R * (5 * L)) >>> 13, y += S * L, y += E * P, y += T * N, y += _ * D, h = (y += B * O) >>> 13, y &= 8191, y += k * (5 * H), y += I * (5 * M), y += U * (5 * z), y += C * (5 * j), m = h += (y += R * (5 * F)) >>> 13, m += S * F, m += E * L, m += T * P, m += _ * N, h = (m += B * D) >>> 13, m &= 8191, m += k * O, m += I * (5 * H), m += U * (5 * M), m += C * (5 * z), b = h += (m += R * (5 * j)) >>> 13, b += S * j, b += E * F, b += T * L, b += _ * P, h = (b += B * N) >>> 13, b &= 8191, b += k * D, b += I * O, b += U * (5 * H), b += C * (5 * M), w = h += (b += R * (5 * z)) >>> 13, w += S * z, w += E * j, w += T * F, w += _ * L, h = (w += B * P) >>> 13, w &= 8191, w += k * N, w += I * D, w += U * O, w += C * (5 * H), A = h += (w += R * (5 * M)) >>> 13, A += S * M, A += E * z, A += T * j, A += _ * F, h = (A += B * L) >>> 13, A &= 8191, A += k * P, A += I * N, A += U * D, A += C * O, v = h += (A += R * (5 * H)) >>> 13, v += S * H, v += E * M, v += T * z, v += _ * j, h = (v += B * F) >>> 13, v &= 8191, v += k * L, v += I * P, v += U * N, v += C * D, S = p = 8191 & (h = (h = ((h += (v += R * O) >>> 13) << 2) + h | 0) + (p &= 8191) | 0), E = f += h >>>= 13, T = d &= 8191, _ = g &= 8191, B = y &= 8191, k = m &= 8191, I = b &= 8191, U = w &= 8191, C = A &= 8191, R = v &= 8191, t += 16, r -= 16;
this.h[0] = S, this.h[1] = E, this.h[2] = T, this.h[3] = _, this.h[4] = B, this.h[5] = k, this.h[6] = I, this.h[7] = U, this.h[8] = C, this.h[9] = R;
}, E.prototype.finish = function (e, t) {
var r,
n,
o,
s,
i = new Uint16Array(10);
if (this.leftover) {
for (s = this.leftover, this.buffer[s++] = 1; s < 16; s++) this.buffer[s] = 0;
this.fin = 1, this.blocks(this.buffer, 0, 16);
}
for (r = this.h[1] >>> 13, this.h[1] &= 8191, s = 2; s < 10; s++) this.h[s] += r, r = this.h[s] >>> 13, this.h[s] &= 8191;
for (this.h[0] += 5 * r, r = this.h[0] >>> 13, this.h[0] &= 8191, this.h[1] += r, r = this.h[1] >>> 13, this.h[1] &= 8191, this.h[2] += r, i[0] = this.h[0] + 5, r = i[0] >>> 13, i[0] &= 8191, s = 1; s < 10; s++) i[s] = this.h[s] + r, r = i[s] >>> 13, i[s] &= 8191;
for (i[9] -= 8192, n = (1 ^ r) - 1, s = 0; s < 10; s++) i[s] &= n;
for (n = ~n, s = 0; s < 10; s++) this.h[s] = this.h[s] & n | i[s];
for (this.h[0] = 65535 & (this.h[0] | this.h[1] << 13), this.h[1] = 65535 & (this.h[1] >>> 3 | this.h[2] << 10), this.h[2] = 65535 & (this.h[2] >>> 6 | this.h[3] << 7), this.h[3] = 65535 & (this.h[3] >>> 9 | this.h[4] << 4), this.h[4] = 65535 & (this.h[4] >>> 12 | this.h[5] << 1 | this.h[6] << 14), this.h[5] = 65535 & (this.h[6] >>> 2 | this.h[7] << 11), this.h[6] = 65535 & (this.h[7] >>> 5 | this.h[8] << 8), this.h[7] = 65535 & (this.h[8] >>> 8 | this.h[9] << 5), o = this.h[0] + this.pad[0], this.h[0] = 65535 & o, s = 1; s < 8; s++) o = (this.h[s] + this.pad[s] | 0) + (o >>> 16) | 0, this.h[s] = 65535 & o;
e[t + 0] = this.h[0] >>> 0 & 255, e[t + 1] = this.h[0] >>> 8 & 255, e[t + 2] = this.h[1] >>> 0 & 255, e[t + 3] = this.h[1] >>> 8 & 255, e[t + 4] = this.h[2] >>> 0 & 255, e[t + 5] = this.h[2] >>> 8 & 255, e[t + 6] = this.h[3] >>> 0 & 255, e[t + 7] = this.h[3] >>> 8 & 255, e[t + 8] = this.h[4] >>> 0 & 255, e[t + 9] = this.h[4] >>> 8 & 255, e[t + 10] = this.h[5] >>> 0 & 255, e[t + 11] = this.h[5] >>> 8 & 255, e[t + 12] = this.h[6] >>> 0 & 255, e[t + 13] = this.h[6] >>> 8 & 255, e[t + 14] = this.h[7] >>> 0 & 255, e[t + 15] = this.h[7] >>> 8 & 255;
}, E.prototype.update = function (e, t, r) {
var n, o;
if (this.leftover) {
for ((o = 16 - this.leftover) > r && (o = r), n = 0; n < o; n++) this.buffer[this.leftover + n] = e[t + n];
if (r -= o, t += o, this.leftover += o, this.leftover < 16) return;
this.blocks(this.buffer, 0, 16), this.leftover = 0;
}
if (r >= 16 && (o = r - r % 16, this.blocks(e, t, o), t += o, r -= o), r) {
for (n = 0; n < r; n++) this.buffer[this.leftover + n] = e[t + n];
this.leftover += r;
}
};
var $ = B,
V = k,
W = [1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591];
function X(e, t, r, n) {
for (var o, s, i, a, c, u, l, h, p, f, d, g, y, m, b, w, A, v, x, S, E, T, _, B, k, I, U = new Int32Array(16), C = new Int32Array(16), R = e[0], O = e[1], D = e[2], N = e[3], P = e[4], L = e[5], F = e[6], j = e[7], z = t[0], M = t[1], H = t[2], G = t[3], K = t[4], q = t[5], $ = t[6], V = t[7], X = 0; n >= 128;) {
for (x = 0; x < 16; x++) S = 8 * x + X, U[x] = r[S + 0] << 24 | r[S + 1] << 16 | r[S + 2] << 8 | r[S + 3], C[x] = r[S + 4] << 24 | r[S + 5] << 16 | r[S + 6] << 8 | r[S + 7];
for (x = 0; x < 80; x++) if (o = R, s = O, i = D, a = N, c = P, u = L, l = F, p = z, f = M, d = H, g = G, y = K, m = q, b = $, _ = 65535 & (T = V), B = T >>> 16, k = 65535 & (E = j), I = E >>> 16, _ += 65535 & (T = (K >>> 14 | P << 18) ^ (K >>> 18 | P << 14) ^ (P >>> 9 | K << 23)), B += T >>> 16, k += 65535 & (E = (P >>> 14 | K << 18) ^ (P >>> 18 | K << 14) ^ (K >>> 9 | P << 23)), I += E >>> 16, _ += 65535 & (T = K & q ^ ~K & $), B += T >>> 16, k += 65535 & (E = P & L ^ ~P & F), I += E >>> 16, _ += 65535 & (T = W[2 * x + 1]), B += T >>> 16, k += 65535 & (E = W[2 * x]), I += E >>> 16, E = U[x % 16], B += (T = C[x % 16]) >>> 16, k += 65535 & E, I += E >>> 16, k += (B += (_ += 65535 & T) >>> 16) >>> 16, _ = 65535 & (T = v = 65535 & _ | B << 16), B = T >>> 16, k = 65535 & (E = A = 65535 & k | (I += k >>> 16) << 16), I = E >>> 16, _ += 65535 & (T = (z >>> 28 | R << 4) ^ (R >>> 2 | z << 30) ^ (R >>> 7 | z << 25)), B += T >>> 16, k += 65535 & (E = (R >>> 28 | z << 4) ^ (z >>> 2 | R << 30) ^ (z >>> 7 | R << 25)), I += E >>> 16, B += (T = z & M ^ z & H ^ M & H) >>> 16, k += 65535 & (E = R & O ^ R & D ^ O & D), I += E >>> 16, h = 65535 & (k += (B += (_ += 65535 & T) >>> 16) >>> 16) | (I += k >>> 16) << 16, w = 65535 & _ | B << 16, _ = 65535 & (T = g), B = T >>> 16, k = 65535 & (E = a), I = E >>> 16, B += (T = v) >>> 16, k += 65535 & (E = A), I += E >>> 16, O = o, D = s, N = i, P = a = 65535 & (k += (B += (_ += 65535 & T) >>> 16) >>> 16) | (I += k >>> 16) << 16, L = c, F = u, j = l, R = h, M = p, H = f, G = d, K = g = 65535 & _ | B << 16, q = y, $ = m, V = b, z = w, x % 16 == 15) for (S = 0; S < 16; S++) E = U[S], _ = 65535 & (T = C[S]), B = T >>> 16, k = 65535 & E, I = E >>> 16, E = U[(S + 9) % 16], _ += 65535 & (T = C[(S + 9) % 16]), B += T >>> 16, k += 65535 & E, I += E >>> 16, A = U[(S + 1) % 16], _ += 65535 & (T = ((v = C[(S + 1) % 16]) >>> 1 | A << 31) ^ (v >>> 8 | A << 24) ^ (v >>> 7 | A << 25)), B += T >>> 16, k += 65535 & (E = (A >>> 1 | v << 31) ^ (A >>> 8 | v << 24) ^ A >>> 7), I += E >>> 16, A = U[(S + 14) % 16], B += (T = ((v = C[(S + 14) % 16]) >>> 19 | A << 13) ^ (A >>> 29 | v << 3) ^ (v >>> 6 | A << 26)) >>> 16, k += 65535 & (E = (A >>> 19 | v << 13) ^ (v >>> 29 | A << 3) ^ A >>> 6), I += E >>> 16, I += (k += (B += (_ += 65535 & T) >>> 16) >>> 16) >>> 16, U[S] = 65535 & k | I << 16, C[S] = 65535 & _ | B << 16;
_ = 65535 & (T = z), B = T >>> 16, k = 65535 & (E = R), I = E >>> 16, E = e[0], B += (T = t[0]) >>> 16, k += 65535 & E, I += E >>> 16, I += (k += (B += (_ += 65535 & T) >>> 16) >>> 16) >>> 16, e[0] = R = 65535 & k | I << 16, t[0] = z = 65535 & _ | B << 16, _ = 65535 & (T = M), B = T >>> 16, k = 65535 & (E = O), I = E >>> 16, E = e[1], B += (T = t[1]) >>> 16, k += 65535 & E, I += E >>> 16, I += (k += (B += (_ += 65535 & T) >>> 16) >>> 16) >>> 16, e[1] = O = 65535 & k | I << 16, t[1] = M = 65535 & _ | B << 16, _ = 65535 & (T = H), B = T >>> 16, k = 65535 & (E = D), I = E >>> 16, E = e[2], B += (T = t[2]) >>> 16, k += 65535 & E, I += E >>> 16, I += (k += (B += (_ += 65535 & T) >>> 16) >>> 16) >>> 16, e[2] = D = 65535 & k | I << 16, t[2] = H = 65535 & _ | B << 16, _ = 65535 & (T = G), B = T >>> 16, k = 65535 & (E = N), I = E >>> 16, E = e[3], B += (T = t[3]) >>> 16, k += 65535 & E, I += E >>> 16, I += (k += (B += (_ += 65535 & T) >>> 16) >>> 16) >>> 16, e[3] = N = 65535 & k | I << 16, t[3] = G = 65535 & _ | B << 16, _ = 65535 & (T = K), B = T >>> 16, k = 65535 & (E = P), I = E >>> 16, E = e[4], B += (T = t[4]) >>> 16, k += 65535 & E, I += E >>> 16, I += (k += (B += (_ += 65535 & T) >>> 16) >>> 16) >>> 16, e[4] = P = 65535 & k | I << 16, t[4] = K = 65535 & _ | B << 16, _ = 65535 & (T = q), B = T >>> 16, k = 65535 & (E = L), I = E >>> 16, E = e[5], B += (T = t[5]) >>> 16, k += 65535 & E, I += E >>> 16, I += (k += (B += (_ += 65535 & T) >>> 16) >>> 16) >>> 16, e[5] = L = 65535 & k | I << 16, t[5] = q = 65535 & _ | B << 16, _ = 65535 & (T = $), B = T >>> 16, k = 65535 & (E = F), I = E >>> 16, E = e[6], B += (T = t[6]) >>> 16, k += 65535 & E, I += E >>> 16, I += (k += (B += (_ += 65535 & T) >>> 16) >>> 16) >>> 16, e[6] = F = 65535 & k | I << 16, t[6] = $ = 65535 & _ | B << 16, _ = 65535 & (T = V), B = T >>> 16, k = 65535 & (E = j), I = E >>> 16, E = e[7], B += (T = t[7]) >>> 16, k += 65535 & E, I += E >>> 16, I += (k += (B += (_ += 65535 & T) >>> 16) >>> 16) >>> 16, e[7] = j = 65535 & k | I << 16, t[7] = V = 65535 & _ | B << 16, X += 128, n -= 128;
}
return n;
}
function Y(e, t, r) {
var n,
o = new Int32Array(8),
s = new Int32Array(8),
i = new Uint8Array(256),
a = r;
for (o[0] = 1779033703, o[1] = 3144134277, o[2] = 1013904242, o[3] = 2773480762, o[4] = 1359893119, o[5] = 2600822924, o[6] = 528734635, o[7] = 1541459225, s[0] = 4089235720, s[1] = 2227873595, s[2] = 4271175723, s[3] = 1595750129, s[4] = 2917565137, s[5] = 725511199, s[6] = 4215389547, s[7] = 327033209, X(o, s, t, r), r %= 128, n = 0; n < r; n++) i[n] = t[a - r + n];
for (i[r] = 128, i[(r = 256 - 128 * (r < 112 ? 1 : 0)) - 9] = 0, f(i, r - 8, a / 536870912 | 0, a << 3), X(o, s, i, r), n = 0; n < 8; n++) f(e, 8 * n, o[n], s[n]);
return 0;
}
function J(e, r) {
var n = t(),
o = t(),
s = t(),
i = t(),
a = t(),
c = t(),
l = t(),
h = t(),
p = t();
L(n, e[1], e[0]), L(p, r[1], r[0]), F(n, n, p), P(o, e[0], e[1]), P(p, r[0], r[1]), F(o, o, p), F(s, e[3], r[3]), F(s, s, u), F(i, e[2], r[2]), P(i, i, i), L(a, o, n), L(c, i, s), P(l, i, s), P(h, o, n), F(e[0], a, c), F(e[1], h, l), F(e[2], l, c), F(e[3], a, h);
}
function Q(e, t, r) {
var n;
for (n = 0; n < 4; n++) C(e[n], t[n], r);
}
function Z(e, r) {
var n = t(),
o = t(),
s = t();
z(s, r[2]), F(n, r[0], s), F(o, r[1], s), R(e, o), e[31] ^= D(n) << 7;
}
function ee(e, t, r) {
var n, o;
for (I(e[0], s), I(e[1], i), I(e[2], i), I(e[3], s), o = 255; o >= 0; --o) Q(e, t, n = r[o / 8 | 0] >> (7 & o) & 1), J(t, e), J(e, e), Q(e, t, n);
}
function te(e, r) {
var n = [t(), t(), t(), t()];
I(n[0], l), I(n[1], h), I(n[2], i), F(n[3], l, h), ee(e, n, r);
}
function re(e, n, o) {
var s,
i = new Uint8Array(64),
a = [t(), t(), t(), t()];
for (o || r(n, 32), Y(i, n, 32), i[0] &= 248, i[31] &= 127, i[31] |= 64, te(a, i), Z(e, a), s = 0; s < 32; s++) n[s + 32] = e[s];
return 0;
}
var ne = new Float64Array([237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16]);
function oe(e, t) {
var r, n, o, s;
for (n = 63; n >= 32; --n) {
for (r = 0, o = n - 32, s = n - 12; o < s; ++o) t[o] += r - 16 * t[n] * ne[o - (n - 32)], r = Math.floor((t[o] + 128) / 256), t[o] -= 256 * r;
t[o] += r, t[n] = 0;
}
for (r = 0, o = 0; o < 32; o++) t[o] += r - (t[31] >> 4) * ne[o], r = t[o] >> 8, t[o] &= 255;
for (o = 0; o < 32; o++) t[o] -= r * ne[o];
for (n = 0; n < 32; n++) t[n + 1] += t[n] >> 8, e[n] = 255 & t[n];
}
function se(e) {
var t,
r = new Float64Array(64);
for (t = 0; t < 64; t++) r[t] = e[t];
for (t = 0; t < 64; t++) e[t] = 0;
oe(e, r);
}
function ie(e, r, n, o) {
var s,
i,
a = new Uint8Array(64),
c = new Uint8Array(64),
u = new Uint8Array(64),
l = new Float64Array(64),
h = [t(), t(), t(), t()];
Y(a, o, 32), a[0] &= 248, a[31] &= 127, a[31] |= 64;
var p = n + 64;
for (s = 0; s < n; s++) e[64 + s] = r[s];
for (s = 0; s < 32; s++) e[32 + s] = a[32 + s];
for (Y(u, e.subarray(32), n + 32), se(u), te(h, u), Z(e, h), s = 32; s < 64; s++) e[s] = o[s];
for (Y(c, e, n + 64), se(c), s = 0; s < 64; s++) l[s] = 0;
for (s = 0; s < 32; s++) l[s] = u[s];
for (s = 0; s < 32; s++) for (i = 0; i < 32; i++) l[s + i] += c[s] * a[i];
return oe(e.subarray(32), l), p;
}
function ae(e, r, n, o) {
var a,
u = new Uint8Array(32),
l = new Uint8Array(64),
h = [t(), t(), t(), t()],
f = [t(), t(), t(), t()];
if (n < 64) return -1;
if (function (e, r) {
var n = t(),
o = t(),
a = t(),
u = t(),
l = t(),
h = t(),
f = t();
return I(e[2], i), N(e[1], r), j(a, e[1]), F(u, a, c), L(a, a, e[2]), P(u, e[2], u), j(l, u), j(h, l), F(f, h, l), F(n, f, a), F(n, n, u), M(n, n), F(n, n, a), F(n, n, u), F(n, n, u), F(e[0], n, u), j(o, e[0]), F(o, o, u), O(o, a) && F(e[0], e[0], p), j(o, e[0]), F(o, o, u), O(o, a) ? -1 : (D(e[0]) === r[31] >> 7 && L(e[0], s, e[0]), F(e[3], e[0], e[1]), 0);
}(f, o)) return -1;
for (a = 0; a < n; a++) e[a] = r[a];
for (a = 0; a < 32; a++) e[a + 32] = o[a];
if (Y(l, e, n), se(l), ee(h, f, l), te(f, r.subarray(32)), J(h, f), Z(u, h), n -= 64, y(r, 0, u, 0)) {
for (a = 0; a < n; a++) e[a] = 0;
return -1;
}
for (a = 0; a < n; a++) e[a] = r[a + 64];
return n;
}
var ce = 64,
ue = 32,
le = 64;
function he(e, t) {
if (32 !== e.length) throw new Error("bad key size");
if (24 !== t.length) throw new Error("bad nonce size");
}
function pe() {
for (var e = 0; e < arguments.length; e++) if (!(arguments[e] instanceof Uint8Array)) throw new TypeError("unexpected type, use Uint8Array");
}
function fe(e) {
for (var t = 0; t < e.length; t++) e[t] = 0;
}
e.lowlevel = {
crypto_core_hsalsa20: b,
crypto_stream_xor: S,
crypto_stream: x,
crypto_stream_salsa20_xor: A,
crypto_stream_salsa20: v,
crypto_onetimeauth: T,
crypto_onetimeauth_verify: _,
crypto_verify_16: g,
crypto_verify_32: y,
crypto_secretbox: B,
crypto_secretbox_open: k,
crypto_scalarmult: H,
crypto_scalarmult_base: G,
crypto_box_beforenm: q,
crypto_box_afternm: $,
crypto_box: function (e, t, r, n, o, s) {
var i = new Uint8Array(32);
return q(i, o, s), $(e, t, r, n, i);
},
crypto_box_open: function (e, t, r, n, o, s) {
var i = new Uint8Array(32);
return q(i, o, s), V(e, t, r, n, i);
},
crypto_box_keypair: K,
crypto_hash: Y,
crypto_sign: ie,
crypto_sign_keypair: re,
crypto_sign_open: ae,
crypto_secretbox_KEYBYTES: 32,
crypto_secretbox_NONCEBYTES: 24,
crypto_secretbox_ZEROBYTES: 32,
crypto_secretbox_BOXZEROBYTES: 16,
crypto_scalarmult_BYTES: 32,
crypto_scalarmult_SCALARBYTES: 32,
crypto_box_PUBLICKEYBYTES: 32,
crypto_box_SECRETKEYBYTES: 32,
crypto_box_BEFORENMBYTES: 32,
crypto_box_NONCEBYTES: 24,
crypto_box_ZEROBYTES: 32,
crypto_box_BOXZEROBYTES: 16,
crypto_sign_BYTES: ce,
crypto_sign_PUBLICKEYBYTES: ue,
crypto_sign_SECRETKEYBYTES: le,
crypto_sign_SEEDBYTES: 32,
crypto_hash_BYTES: 64,
gf: t,
D: c,
L: ne,
pack25519: R,
unpack25519: N,
M: F,
A: P,
S: j,
Z: L,
pow2523: M,
add: J,
set25519: I,
modL: oe,
scalarmult: ee,
scalarbase: te
}, e.randomBytes = function (e) {
var t = new Uint8Array(e);
return r(t, e), t;
}, e.secretbox = function (e, t, r) {
pe(e, t, r), he(r, t);
for (var n = new Uint8Array(32 + e.length), o = new Uint8Array(n.length), s = 0; s < e.length; s++) n[s + 32] = e[s];
return B(o, n, n.length, t, r), o.subarray(16);
}, e.secretbox.open = function (e, t, r) {
pe(e, t, r), he(r, t);
for (var n = new Uint8Array(16 + e.length), o = new Uint8Array(n.length), s = 0; s < e.length; s++) n[s + 16] = e[s];
return n.length < 32 || 0 !== k(o, n, n.length, t, r) ? null : o.subarray(32);
}, e.secretbox.keyLength = 32, e.secretbox.nonceLength = 24, e.secretbox.overheadLength = 16, e.scalarMult = function (e, t) {
if (pe(e, t), 32 !== e.length) throw new Error("bad n size");
if (32 !== t.length) throw new Error("bad p size");
var r = new Uint8Array(32);
return H(r, e, t), r;
}, e.scalarMult.base = function (e) {
if (pe(e), 32 !== e.length) throw new Error("bad n size");
var t = new Uint8Array(32);
return G(t, e), t;
}, e.scalarMult.scalarLength = 32, e.scalarMult.groupElementLength = 32, e.box = function (t, r, n, o) {
var s = e.box.before(n, o);
return e.secretbox(t, r, s);
}, e.box.before = function (e, t) {
pe(e, t), function (e, t) {
if (32 !== e.length) throw new Error("bad public key size");
if (32 !== t.length) throw new Error("bad secret key size");
}(e, t);
var r = new Uint8Array(32);
return q(r, e, t), r;
}, e.box.after = e.secretbox, e.box.open = function (t, r, n, o) {
var s = e.box.before(n, o);
return e.secretbox.open(t, r, s);
}, e.box.open.after = e.secretbox.open, e.box.keyPair = function () {
var e = new Uint8Array(32),
t = new Uint8Array(32);
return K(e, t), {
publicKey: e,
secretKey: t
};
}, e.box.keyPair.fromSecretKey = function (e) {
if (pe(e), 32 !== e.length) throw new Error("bad secret key size");
var t = new Uint8Array(32);
return G(t, e), {
publicKey: t,
secretKey: new Uint8Array(e)
};
}, e.box.publicKeyLength = 32, e.box.secretKeyLength = 32, e.box.sharedKeyLength = 32, e.box.nonceLength = 24, e.box.overheadLength = e.secretbox.overheadLength, e.sign = function (e, t) {
if (pe(e, t), t.length !== le) throw new Error("bad secret key size");
var r = new Uint8Array(ce + e.length);
return ie(r, e, e.length, t), r;
}, e.sign.open = function (e, t) {
if (pe(e, t), t.length !== ue) throw new Error("bad public key size");
var r = new Uint8Array(e.length),
n = ae(r, e, e.length, t);
if (n < 0) return null;
for (var o = new Uint8Array(n), s = 0; s < o.length; s++) o[s] = r[s];
return o;
}, e.sign.detached = function (t, r) {
for (var n = e.sign(t, r), o = new Uint8Array(ce), s = 0; s < o.length; s++) o[s] = n[s];
return o;
}, e.sign.detached.verify = function (e, t, r) {
if (pe(e, t, r), t.length !== ce) throw new Error("bad signature size");
if (r.length !== ue) throw new Error("bad public key size");
var n,
o = new Uint8Array(ce + e.length),
s = new Uint8Array(ce + e.length);
for (n = 0; n < ce; n++) o[n] = t[n];
for (n = 0; n < e.length; n++) o[n + ce] = e[n];
return ae(s, o, o.length, r) >= 0;
}, e.sign.keyPair = function () {
var e = new Uint8Array(ue),
t = new Uint8Array(le);
return re(e, t), {
publicKey: e,
secretKey: t
};
}, e.sign.keyPair.fromSecretKey = function (e) {
if (pe(e), e.length !== le) throw new Error("bad secret key size");
for (var t = new Uint8Array(ue), r = 0; r < t.length; r++) t[r] = e[32 + r];
return {
publicKey: t,
secretKey: new Uint8Array(e)
};
}, e.sign.keyPair.fromSeed = function (e) {
if (pe(e), 32 !== e.length) throw new Error("bad seed size");
for (var t = new Uint8Array(ue), r = new Uint8Array(le), n = 0; n < 32; n++) r[n] = e[n];
return re(t, r, !0), {
publicKey: t,
secretKey: r
};
}, e.sign.publicKeyLength = ue, e.sign.secretKeyLength = le, e.sign.seedLength = 32, e.sign.signatureLength = ce, e.hash = function (e) {
pe(e);
var t = new Uint8Array(64);
return Y(t, e, e.length), t;
}, e.hash.hashLength = 64, e.verify = function (e, t) {
return pe(e, t), 0 !== e.length && 0 !== t.length && e.length === t.length && 0 === d(e, 0, t, 0, e.length);
}, e.setPRNG = function (e) {
r = e;
}, function () {
var t = "undefined" != typeof self ? self.crypto || self.msCrypto : null;
t && t.getRandomValues ? e.setPRNG(function (e, r) {
var n,
o = new Uint8Array(r);
for (n = 0; n < r; n += 65536) t.getRandomValues(o.subarray(n, n + Math.min(r - n, 65536)));
for (n = 0; n < r; n++) e[n] = o[n];
fe(o);
}) : "undefined" != typeof require && (t = require("crypto")) && t.randomBytes && e.setPRNG(function (e, r) {
var n,
o = t.randomBytes(r);
for (n = 0; n < r; n++) e[n] = o[n];
fe(o);
});
}();
}(void 0 !== e && e.exports ? e.exports : self.nacl = self.nacl || {});
},
1042: (e, t, r) => {
"use strict";
var n = r(1926),
o = r(9370),
s = /^[A-Za-z][A-Za-z0-9+-.]*:[\\/]+/,
i = /^([a-z][a-z0-9.+-]*:)?([\\/]{1,})?([\S\s]*)/i,
a = new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");
function c(e) {
return (e || "").toString().replace(a, "");
}
var u = [["#", "hash"], ["?", "query"], function (e) {
return e.replace("\\", "/");
}, ["/", "pathname"], ["@", "auth", 1], [NaN, "host", void 0, 1, 1], [/:(\d+)$/, "port", void 0, 1], [NaN, "hostname", void 0, 1, 1]],
l = {
hash: 1,
query: 1
};
function h(e) {
var t,
n = ("undefined" != typeof window ? window : void 0 !== r.g ? r.g : "undefined" != typeof self ? self : {}).location || {},
o = {},
i = typeof (e = e || n);
if ("blob:" === e.protocol) o = new f(unescape(e.pathname), {});else if ("string" === i) for (t in o = new f(e, {}), l) delete o[t];else if ("object" === i) {
for (t in e) t in l || (o[t] = e[t]);
void 0 === o.slashes && (o.slashes = s.test(e.href));
}
return o;
}
function p(e) {
e = c(e);
var t = i.exec(e);
return {
protocol: t[1] ? t[1].toLowerCase() : "",
slashes: !!(t[2] && t[2].length >= 2),
rest: t[2] && 1 === t[2].length ? "/" + t[3] : t[3]
};
}
function f(e, t, r) {
if (e = c(e), !(this instanceof f)) return new f(e, t, r);
var s,
i,
a,
l,
d,
g,
y = u.slice(),
m = typeof t,
b = this,
w = 0;
for ("object" !== m && "string" !== m && (r = t, t = null), r && "function" != typeof r && (r = o.parse), t = h(t), s = !(i = p(e || "")).protocol && !i.slashes, b.slashes = i.slashes || s && t.slashes, b.protocol = i.protocol || t.protocol || "", e = i.rest, i.slashes || (y[3] = [/(.*)/, "pathname"]); w < y.length; w++) "function" != typeof (l = y[w]) ? (a = l[0], g = l[1], a != a ? b[g] = e : "string" == typeof a ? ~(d = e.indexOf(a)) && ("number" == typeof l[2] ? (b[g] = e.slice(0, d), e = e.slice(d + l[2])) : (b[g] = e.slice(d), e = e.slice(0, d))) : (d = a.exec(e)) && (b[g] = d[1], e = e.slice(0, d.index)), b[g] = b[g] || s && l[3] && t[g] || "", l[4] && (b[g] = b[g].toLowerCase())) : e = l(e);
r && (b.query = r(b.query)), s && t.slashes && "/" !== b.pathname.charAt(0) && ("" !== b.pathname || "" !== t.pathname) && (b.pathname = function (e, t) {
if ("" === e) return t;
for (var r = (t || "/").split("/").slice(0, -1).concat(e.split("/")), n = r.length, o = r[n - 1], s = !1, i = 0; n--;) "." === r[n] ? r.splice(n, 1) : ".." === r[n] ? (r.splice(n, 1), i++) : i && (0 === n && (s = !0), r.splice(n, 1), i--);
return s && r.unshift(""), "." !== o && ".." !== o || r.push(""), r.join("/");
}(b.pathname, t.pathname)), "/" !== b.pathname.charAt(0) && b.hostname && (b.pathname = "/" + b.pathname), n(b.port, b.protocol) || (b.host = b.hostname, b.port = ""), b.username = b.password = "", b.auth && (l = b.auth.split(":"), b.username = l[0] || "", b.password = l[1] || ""), b.origin = b.protocol && b.host && "file:" !== b.protocol ? b.protocol + "//" + b.host : "null", b.href = b.toString();
}
f.prototype = {
set: function (e, t, r) {
var s = this;
switch (e) {
case "query":
"string" == typeof t && t.length && (t = (r || o.parse)(t)), s[e] = t;
break;
case "port":
s[e] = t, n(t, s.protocol) ? t && (s.host = s.hostname + ":" + t) : (s.host = s.hostname, s[e] = "");
break;
case "hostname":
s[e] = t, s.port && (t += ":" + s.port), s.host = t;
break;
case "host":
s[e] = t, /:\d+$/.test(t) ? (t = t.split(":"), s.port = t.pop(), s.hostname = t.join(":")) : (s.hostname = t, s.port = "");
break;
case "protocol":
s.protocol = t.toLowerCase(), s.slashes = !r;
break;
case "pathname":
case "hash":
if (t) {
var i = "pathname" === e ? "/" : "#";
s[e] = t.charAt(0) !== i ? i + t : t;
} else s[e] = t;
break;
default:
s[e] = t;
}
for (var a = 0; a < u.length; a++) {
var c = u[a];
c[4] && (s[c[1]] = s[c[1]].toLowerCase());
}
return s.origin = s.protocol && s.host && "file:" !== s.protocol ? s.protocol + "//" + s.host : "null", s.href = s.toString(), s;
},
toString: function (e) {
e && "function" == typeof e || (e = o.stringify);
var t,
r = this,
n = r.protocol;
n && ":" !== n.charAt(n.length - 1) && (n += ":");
var s = n + (r.slashes ? "//" : "");
return r.username && (s += r.username, r.password && (s += ":" + r.password), s += "@"), s += r.host + r.pathname, (t = "object" == typeof r.query ? e(r.query) : r.query) && (s += "?" !== t.charAt(0) ? "?" + t : t), r.hash && (s += r.hash), s;
}
}, f.extractProtocol = p, f.location = h, f.trimLeft = c, f.qs = o, e.exports = f;
},
5922: (e, t, r) => {
var n = r(2486).Buffer;
const {
default: o
} = r(1113),
{
setSendTransactionHeaders: s
} = r(5180);
e.exports = {
Algod: function (e = "", t = "http://r2.algorand.network", r = 4180, i = {}) {
let a = e;
"string" == typeof a && (a = {
"X-Algo-API-Token": a
});
const c = new o(a, t, r, i);
function u(e) {
return void 0 !== e.noteb64 && null !== e.noteb64 && (e.note = n.from(e.noteb64, "base64")), e;
}
this.status = async (e = {}) => (await c.get("/v1/status", {}, e)).body, this.healthCheck = async (e = {}) => {
const t = await c.get("/health", {}, e);
if (!t.ok) throw new Error(`Health response: ${t.status}`);
return {};
}, this.statusAfterBlock = async (e, t = {}) => {
if (!Number.isInteger(e)) throw Error("roundNumber should be an integer");
return (await c.get(`/v1/status/wait-for-block-after/${e}`, {}, t)).body;
}, this.pendingTransactions = async (e, t = {}) => {
if (!Number.isInteger(e)) throw Error("maxTxns should be an integer");
const r = await c.get("/v1/transactions/pending", {
max: e
}, t);
if (200 === r.statusCode && void 0 !== r.body.truncatedTxns.transactions) for (let e = 0; e < r.body.truncatedTxns.transactions.length; e++) r.body.truncatedTxns.transactions[e] = u(r.body.truncatedTxns.transactions[e]);
return r.body;
}, this.versions = async (e = {}) => (await c.get("/versions", {}, e)).body, this.ledgerSupply = async (e = {}) => (await c.get("/v1/ledger/supply", {}, e)).body, this.transactionByAddress = async (e, t = null, r = null, n = null, o = {}) => {
if (null !== t && !Number.isInteger(t)) throw Error("first round should be an integer");
if (null !== r && !Number.isInteger(r)) throw Error("last round should be an integer");
const s = await c.get(`/v1/account/${e}/transactions`, {
firstRound: t,
lastRound: r,
max: n
}, o);
if (200 === s.statusCode && void 0 !== s.body.transactions) for (let e = 0; e < s.body.transactions.length; e++) s.body.transactions[e] = u(s.body.transactions[e]);
return s.body;
}, this.transactionByAddressAndDate = async (e, t, r, n = null, o = {}) => {
const s = await c.get(`/v1/account/${e}/transactions`, {
fromDate: t,
toDate: r,
max: n
}, o);
if (200 === s.statusCode && void 0 !== s.body.transactions) for (let e = 0; e < s.body.transactions.length; e++) s.body.transactions[e] = u(s.body.transactions[e]);
return s.body;
}, this.transactionById = async (e, t = {}) => {
const r = await c.get(`/v1/transaction/${e}`, {}, t);
return 200 === r.statusCode && (r.body = u(r.body)), r.body;
}, this.transactionInformation = async (e, t, r = {}) => {
const n = await c.get(`/v1/account/${e}/transaction/${t}`, {}, r);
return 200 === n.statusCode && (n.body = u(n.body)), n.body;
}, this.pendingTransactionInformation = async (e, t = {}) => {
const r = await c.get(`/v1/transactions/pending/${e}`, {}, t);
return 200 === r.statusCode && (r.body = u(r.body)), r.body;
}, this.accountInformation = async (e, t = {}) => (await c.get(`/v1/account/${e}`, {}, t)).body, this.assetInformation = async (e, t = {}) => (await c.get(`/v1/asset/${e}`, {}, t)).body, this.suggestedFee = async (e = {}) => (await c.get("/v1/transactions/fee", {}, e)).body, this.sendRawTransaction = async (e, t = {}) => {
const r = s(t);
return (await c.post("/v1/transactions", n.from(e), r)).body;
}, this.sendRawTransactions = async (e, t = {}) => {
const r = s(t),
o = Array.prototype.concat(...e.map(e => Array.from(e)));
return (await c.post("/v1/transactions", n.from(o), r)).body;
}, this.getTransactionParams = async (e = {}) => (await c.get("/v1/transactions/params", {}, e)).body, this.suggestParams = async (e = {}) => {
const t = await this.getTransactionParams(e);
return {
flatFee: !1,
fee: t.fee,
firstRound: t.lastRound,
lastRound: t.lastRound + 1e3,
genesisID: t.genesisID,
genesisHash: t.genesishashb64
};
}, this.block = async (e, t = {}) => {
if (!Number.isInteger(e)) throw Error("roundNumber should be an integer");
const r = await c.get(`/v1/block/${e}`, {}, t);
if (200 === r.statusCode && void 0 !== r.body.txns.transactions) for (let e = 0; e < r.body.txns.transactions.length; e++) r.body.txns.transactions[e] = u(r.body.txns.transactions[e]);
return r.body;
};
}
};
},
1834: (e, t, r) => {
var n = r(2486).Buffer;
const o = r(7116),
s = r(3033),
i = r(1063),
a = r(5583),
c = r(8800),
u = r(9404),
l = r(2514),
h = r(9417);
e.exports = {
DynamicFee: class {
constructor(e, t, r, s, i, a) {
if (!Number.isSafeInteger(t) || t < 0) throw Error("amount must be a positive number and smaller than 2^53-1");
if (!Number.isSafeInteger(r) || r < 0) throw Error("firstValid must be a positive number and smaller than 2^53-1");
if (!Number.isSafeInteger(s) || s < 0) throw Error("lastValid must be a positive number and smaller than 2^53-1");
if (void 0 === i && (i = o.ALGORAND_ZERO_ADDRESS_STRING), void 0 === a) {
const e = u.randomBytes(32);
a = n.from(e).toString("base64");
}
const h = n.from("ASAFAgEHBgUmAyD+vKC7FEpaTqe0OKRoGsgObKEFvLYH/FZTJclWlfaiEyDmmpYeby1feshmB5JlUr6YI17TM2PKiJGLuck4qRW2+SB/g7Flf/H8U7ktwYFIodZd/C1LH6PWdyhK3dIAEm2QaTIEIhIzABAjEhAzAAcxABIQMwAIMQESEDEWIxIQMRAjEhAxBygSEDEJKRIQMQgkEhAxAiUSEDEEIQQSEDEGKhIQ", "base64"),
p = [t, r, s, e, i, a],
f = [l.valTypes.INT, l.valTypes.INT, l.valTypes.INT, l.valTypes.ADDRESS, l.valTypes.ADDRESS, l.valTypes.BASE64],
d = l.inject(h, [5, 6, 7, 11, 44, 76], p, f);
this.programBytes = d;
const g = new c.LogicSig(d, void 0);
this.address = g.address();
}
getProgram() {
return this.programBytes;
}
getAddress() {
return this.address;
}
},
getDynamicFeeTransactions: function (e, t, r, n) {
if (!t.verify(o.decodeAddress(e.from).publicKey)) throw new Error("invalid signature");
e.fee = n, e.fee < h.ALGORAND_MIN_TX_FEE && (e.fee = h.ALGORAND_MIN_TX_FEE);
const a = u.keyPairFromSecretKey(r),
c = o.encodeAddress(a.publicKey),
{
lease: l
} = e;
delete e.lease;
const p = new h.Transaction(e);
p.addLease(l, n);
const f = {
from: c,
to: e.from,
fee: n,
amount: p.fee,
firstRound: e.firstRound,
lastRound: e.lastRound,
genesisHash: e.genesisHash,
type: "pay"
},
d = new h.Transaction(f);
d.addLease(l, n);
const g = i.assignGroupID([d, p], void 0),
y = g[0],
m = g[1],
b = {
lsig: t.get_obj_for_encoding(),
txn: m.get_obj_for_encoding()
},
w = y.signTxn(r),
A = s.encode(b),
v = new Uint8Array(w.length + A.length);
return v.set(w), v.set(A, w.length), v;
},
signDynamicFee: function (e, t, r) {
const n = a.readProgram(e, void 0),
s = n[0],
i = n[1],
l = u.keyPairFromSecretKey(t),
h = {
from: o.encodeAddress(l.publicKey),
to: o.encodeAddress(i[0]),
fee: 0,
amount: s[2],
closeRemainderTo: o.encodeAddress(i[1]),
firstRound: s[3],
lastRound: s[4],
genesisHash: r,
type: "pay",
lease: new Uint8Array(i[2])
},
p = new c.LogicSig(e, void 0);
return p.sign(t), {
txn: h,
lsig: p
};
}
};
},
1786: (e, t, r) => {
var n = r(2486).Buffer;
const o = r(3477),
{
keccak256: s
} = r(583),
i = r(5583),
a = r(8800),
c = r(2514),
u = r(9417);
e.exports = {
HTLC: class {
constructor(e, t, r, o, s, i) {
if (!Number.isSafeInteger(s) || s < 0) throw Error("expiryRound must be a positive number and smaller than 2^53-1");
if (!Number.isSafeInteger(i) || i < 0) throw Error("maxFee must be a positive number and smaller than 2^53-1");
let u = "";
if ("sha256" === r) u = "ASAECAEACSYDIOaalh5vLV96yGYHkmVSvpgjXtMzY8qIkYu5yTipFbb5IH+DsWV/8fxTuS3BgUih1l38LUsfo9Z3KErd0gASbZBpIP68oLsUSlpOp7Q4pGgayA5soQW8tgf8VlMlyVaV9qITMQEiDjEQIxIQMQcyAxIQMQgkEhAxCSgSLQEpEhAxCSoSMQIlDRAREA==";else {
if ("keccak256" !== r) throw Error("hash function unrecognized");
u = "ASAECAEACSYDIOaalh5vLV96yGYHkmVSvpgjXtMzY8qIkYu5yTipFbb5IH+DsWV/8fxTuS3BgUih1l38LUsfo9Z3KErd0gASbZBpIP68oLsUSlpOp7Q4pGgayA5soQW8tgf8VlMlyVaV9qITMQEiDjEQIxIQMQcyAxIQMQgkEhAxCSgSLQIpEhAxCSoSMQIlDRAREA==";
}
if (32 !== n.from(o, "base64").length) throw Error("hash image must be 32 bytes");
const l = n.from(u, "base64"),
h = [i, s, t, o, e],
p = [c.valTypes.INT, c.valTypes.INT, c.valTypes.ADDRESS, c.valTypes.BASE64, c.valTypes.ADDRESS],
f = c.inject(l, [3, 6, 10, 42, 76], h, p);
this.programBytes = f;
const d = new a.LogicSig(f, void 0);
this.address = d.address();
}
getProgram() {
return this.programBytes;
}
getAddress() {
return this.address;
}
},
signTransactionWithHTLCUnlock: function (e, t, r) {
const c = n.from(r, "base64"),
l = i.readProgram(e, void 0),
h = l[0],
p = l[1][1],
f = e[e.length - 15];
if (1 === f) {
const e = o.create();
if (e.update(c), !n.from(e.hex(), "hex").equals(p)) throw new Error("sha256 hash of preimage did not match stored contract hash");
} else {
if (2 !== f) throw new Error("hash function in contract unrecognized");
{
const e = s.create();
if (e.update(c), !n.from(e.hex(), "hex").equals(p)) throw new Error("keccak256 hash of preimage did not match stored contract hash");
}
}
const d = [c],
g = new a.LogicSig(e, d);
delete t.to;
const y = h[0],
m = new u.Transaction(t);
if (m.fee > y) throw new Error(`final fee of payment transaction${m.fee.toString()}greater than transaction max fee${y.toString()}`);
return a.signLogicSigTransaction(t, g);
}
};
},
8886: (e, t, r) => {
const n = r(1834),
o = r(1786),
s = r(4748),
i = r(3758),
a = r(2200);
e.exports = {
DynamicFee: n.DynamicFee,
getDynamicFeeTransactions: n.getDynamicFeeTransactions,
signDynamicFee: n.signDynamicFee,
HTLC: o.HTLC,
signTransactionWithHTLCUnlock: o.signTransactionWithHTLCUnlock,
LimitOrder: s.LimitOrder,
getSwapAssetsTransaction: s.getSwapAssetsTransaction,
Split: i.Split,
getSplitFundsTransaction: i.getSplitFundsTransaction,
PeriodicPayment: a.PeriodicPayment,
getPeriodicPaymentWithdrawalTransaction: a.getPeriodicPaymentWithdrawalTransaction
};
},
4748: (e, t, r) => {
var n = r(2486).Buffer;
const o = r(7116),
s = r(1988),
i = r(1063),
a = r(5583),
c = r(8800),
u = r(9404),
l = r(2514),
h = r(413);
e.exports = {
LimitOrder: class {
constructor(e, t, r, o, s, i, a) {
if (!Number.isSafeInteger(t) || t < 0) throw Error("assetid must be a positive number and smaller than 2^53-1");
if (!Number.isSafeInteger(r) || r < 0) throw Error("ratn must be a positive number and smaller than 2^53-1");
if (!Number.isSafeInteger(o) || o < 0) throw Error("ratd must be a positive number and smaller than 2^53-1");
if (!Number.isSafeInteger(s) || s < 0) throw Error("expiryRound must be a positive number and smaller than 2^53-1");
if (!Number.isSafeInteger(i) || i < 0) throw Error("minTrade must be a positive number and smaller than 2^53-1");
if (!Number.isSafeInteger(a) || a < 0) throw Error("maxFee must be a positive number and smaller than 2^53-1");
const u = n.from("ASAKAAEFAgYEBwgJCiYBIP68oLsUSlpOp7Q4pGgayA5soQW8tgf8VlMlyVaV9qITMRYiEjEQIxIQMQEkDhAyBCMSQABVMgQlEjEIIQQNEDEJMgMSEDMBECEFEhAzAREhBhIQMwEUKBIQMwETMgMSEDMBEiEHHTUCNQExCCEIHTUENQM0ATQDDUAAJDQBNAMSNAI0BA8QQAAWADEJKBIxAiEJDRAxBzIDEhAxCCISEBA=", "base64"),
h = [a, i, t, o, r, s, e],
p = [l.valTypes.INT, l.valTypes.INT, l.valTypes.INT, l.valTypes.INT, l.valTypes.INT, l.valTypes.INT, l.valTypes.ADDRESS],
f = l.inject(u, [5, 7, 9, 10, 11, 12, 16], h, p);
this.programBytes = f;
const d = new c.LogicSig(f, void 0);
this.address = d.address(), this.owner = e, this.assetid = t;
}
getProgram() {
return this.programBytes;
}
getAddress() {
return this.address;
}
},
getSwapAssetsTransaction: function (e, t, r, n, l, p, f, d) {
const g = u.keyPairFromSecretKey(n),
y = o.encodeAddress(g.publicKey),
m = a.readProgram(e, void 0),
b = m[0],
w = m[1];
let A;
const v = b[6],
x = o.encodeAddress(w[0]),
S = c.makeLogicSig(e, void 0),
E = S.address(),
T = [s.makePaymentTxn(E, y, l, r, A, p, f, void 0, d, void 0), s.makeAssetTransferTxn(y, x, A, void 0, l, t, p, f, void 0, d, void 0, v)],
_ = i.assignGroupID(T),
B = b[7],
k = b[8];
if (t * B < r * k) throw new Error(`bad payment ratio, ${t.toString()}*${B.toString()} !>= ${r.toString()}*${k.toString()}`);
const I = b[4];
if (r < I) throw new Error(`payment amount ${r.toString()} less than minimum trade ${I.toString()}`);
const U = b[2];
if (_[0].fee > U) throw new Error(`final fee of payment transaction ${_[0].fee.toString()} greater than transaction max fee ${U.toString()}`);
if (_[1].fee > U) throw new Error(`final fee of asset transaction ${_[1].fee.toString()} greater than transaction max fee ${U.toString()}`);
const C = c.signLogicSigTransactionObject(_[0], S),
R = _[1].signTxn(n);
return h.concatArrays(C.blob, R);
}
};
},
2200: (e, t, r) => {
var n = r(2486).Buffer;
const o = r(7116),
s = r(1988),
i = r(5583),
a = r(8800),
c = r(9404),
u = r(2514);
e.exports = {
PeriodicPayment: class {
constructor(e, t, r, o, s, i, u) {
if (this.receiver = e, !Number.isSafeInteger(t) || t < 0) throw Error("amount must be a positive number and smaller than 2^53-1");
if (this.amount = t, !Number.isSafeInteger(r) || r < 0) throw Error("withdrawalWindow must be a positive number and smaller than 2^53-1");
if (this.withdrawalWindow = r, !Number.isSafeInteger(o) || o < 0) throw Error("period must be a positive number and smaller than 2^53-1");
if (this.period = o, !Number.isSafeInteger(s) || s < 0) throw Error("expiryRound must be a positive number and smaller than 2^53-1");
if (this.expiryRound = s, !Number.isSafeInteger(i) || i < 0) throw Error("maxFee must be a positive number and smaller than 2^53-1");
if (this.maxFee = i, void 0 === u) {
const e = c.randomBytes(32);
this.lease = n.from(e).toString("base64");
} else this.lease = u;
this.programBytes = this.getProgram();
const l = new a.LogicSig(this.programBytes, void 0);
this.address = l.address();
}
getProgram() {
const e = n.from("ASAHAQYFAAQDByYCIAECAwQFBgcIAQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIIJKvkYTkEzwJf2arzJOxERsSogG9nQzKPkpIoc4TzPTFMRAiEjEBIw4QMQIkGCUSEDEEIQQxAggSEDEGKBIQMQkyAxIxBykSEDEIIQUSEDEJKRIxBzIDEhAxAiEGDRAxCCUSEBEQ", "base64"),
t = [this.maxFee, this.period, this.withdrawalWindow, this.amount, this.expiryRound, this.lease, this.receiver],
r = [u.valTypes.INT, u.valTypes.INT, u.valTypes.INT, u.valTypes.INT, u.valTypes.INT, u.valTypes.BASE64, u.valTypes.ADDRESS];
return u.inject(e, [4, 5, 7, 8, 9, 12, 46], t, r);
}
getAddress() {
return this.address;
}
},
getPeriodicPaymentWithdrawalTransaction: function (e, t, r, n) {
const c = i.readProgram(e, void 0),
u = c[0],
l = c[1],
h = u[2],
p = u[4],
f = u[5];
if (r % h != 0) throw new Error(`firstValid round ${r.toString()} was not a multiple of contract period ${h.toString()}`);
const d = l[1],
g = o.encodeAddress(d),
y = l[0],
m = new Uint8Array(y),
b = r + p,
w = g;
let A, v;
const x = a.makeLogicSig(e, void 0),
S = x.address(),
E = {
from: S,
to: w,
fee: t,
amount: f,
closeRemainderTo: A,
firstRound: r,
lastRound: b,
note: v,
genesisHash: n,
genesisID: "",
type: "pay",
lease: m
},
T = s.makePaymentTxn(S, w, t, f, A, r, b, v, n, "");
if (T.fee > u[1]) throw new Error(`final fee of payment transaction${T.fee.toString()}greater than transaction max fee${u[1].toString()}`);
return a.signLogicSigTransaction(E, x);
}
};
},
3758: (e, t, r) => {
var n = r(2486).Buffer;
const o = r(7116),
s = r(1988),
i = r(1063),
a = r(8800),
c = r(5583),
u = r(2514),
l = r(413);
e.exports = {
Split: class {
constructor(e, t, r, o, s, i, c, l) {
if (!Number.isSafeInteger(s) || s < 0) throw Error("rat2 must be a positive number and smaller than 2^53-1");
if (!Number.isSafeInteger(o) || o < 0) throw Error("rat1 must be a positive number and smaller than 2^53-1");
if (!Number.isSafeInteger(i) || i < 0) throw Error("expiryRound must be a positive number and smaller than 2^53-1");
if (!Number.isSafeInteger(c) || c < 0) throw Error("minPay must be a positive number and smaller than 2^53-1");
if (!Number.isSafeInteger(l) || l < 0) throw Error("maxFee must be a positive number and smaller than 2^53-1");
const h = n.from("ASAIAQUCAAYHCAkmAyCztwQn0+DycN+vsk+vJWcsoz/b7NDS6i33HOkvTpf+YiC3qUpIgHGWE8/1LPh9SGCalSN7IaITeeWSXbfsS5wsXyC4kBQ38Z8zcwWVAym4S8vpFB/c0XC6R4mnPi9EBADsPDEQIhIxASMMEDIEJBJAABkxCSgSMQcyAxIQMQglEhAxAiEEDRAiQAAuMwAAMwEAEjEJMgMSEDMABykSEDMBByoSEDMACCEFCzMBCCEGCxIQMwAIIQcPEBA=", "base64"),
p = [l, i, s, o, c, e, t, r],
f = [u.valTypes.INT, u.valTypes.INT, u.valTypes.INT, u.valTypes.INT, u.valTypes.INT, u.valTypes.ADDRESS, u.valTypes.ADDRESS, u.valTypes.ADDRESS],
d = u.inject(h, [4, 7, 8, 9, 10, 14, 47, 80], p, f);
this.programBytes = d;
const g = a.makeLogicSig(d, void 0);
this.address = g.address();
}
getProgram() {
return this.programBytes;
}
getAddress() {
return this.address;
}
},
getSplitFundsTransaction: function (e, t, r, n, u, h) {
const p = c.readProgram(e, void 0),
f = p[0],
d = p[1];
let g = f[6],
y = f[5],
m = 0;
const b = (e, t) => {
if ("number" != typeof e || "number" != typeof t) throw new Error("gcd operates only on positive integers");
return t ? b(t, e % t) : e;
},
w = b(g, y);
g = Math.floor(g / w), y = Math.floor(y / w);
const A = y / g;
m = Math.round(t / (1 + A));
const v = t - m;
if (y * m != g * v) throw Error("could not split funds in a way that satisfied the contract ratio");
const x = a.makeLogicSig(e, void 0).address(),
S = o.encodeAddress(d[1]),
E = o.encodeAddress(d[2]),
T = [s.makePaymentTxn(x, S, u, m, void 0, r, n, void 0, h), s.makePaymentTxn(x, E, u, v, void 0, r, n, void 0, h)],
_ = i.assignGroupID(T).map(e => a.signLogicSigTransactionObject(e, a).blob);
return l.concatArrays(_[0], _[1]);
}
};
},
2514: (e, t, r) => {
var n = r(2486).Buffer;
const o = r(7116);
function s(e, t) {
let r = 0;
for (; t > 128;) e.push(255 & t | 128), t >>= 7, r += 1;
return e.push(255 & t), r + 1;
}
const i = {
INT: 1,
ADDRESS: 2,
BASE64: 3
};
e.exports = {
inject: function (e, t, r, a) {
if (t.length !== r.length || t.length !== a.length) throw new Error("Lengths do not match");
let c = e;
function u(e, t, r, o) {
const s = e.slice(0, r),
i = e.slice(r + o, e.length),
a = [s, n.from(t), i];
return n.concat(a);
}
for (let e = 0; e < t.length; e++) {
let l = 0,
h = r[e];
switch (a[e]) {
case i.INT:
const r = [];
l = s(r, h), c = u(c, r, t[e], 1);
break;
case i.ADDRESS:
h = o.decodeAddress(h), c = u(c, h.publicKey, t[e], 32);
break;
case i.BASE64:
const a = [];
h = n.from(h, "base64"), s(a, h.length), h = n.concat([n.from(a), h]), c = u(c, h, t[e], 33);
break;
default:
throw new Error("unrecognized value type");
}
if (0 !== l) for (let e = 0; e < t.length; e++) t[e] += l - 1;
}
return c;
},
valTypes: i
};
},
3410: (e, t, r) => {
"use strict";
r.d(t, {
JQ: () => w,
_4: () => E,
X3: () => S,
R0: () => A,
jD: () => v,
Yh: () => N,
bL: () => P,
Ls: () => D,
UV: () => I,
Ax: () => x,
A9: () => k,
w1: () => T,
NK: () => y,
RY: () => b,
Pu: () => m,
Vk: () => l,
nh: () => f,
kG: () => u,
qH: () => p,
JH: () => h,
vJ: () => R,
o5: () => O,
AE: () => C
});
var n = r(7116),
o = r(2486).Buffer;
function s(e, t) {
let r = e.toString(16);
r.length !== 2 * t && (r = r.padStart(2 * t, "0"));
const n = new Uint8Array(r.length / 2);
for (let e = 0, t = 0; e < r.length / 2; e++, t += 2) n[e] = parseInt(r.slice(t, t + 2), 16);
return n;
}
function i(e) {
let t = BigInt(0);
const r = o.from(e);
for (let n = 0; n < e.length; n++) t = BigInt(Number(r.readUIntBE(n, 1))) + t * BigInt(256);
return t;
}
var a = r(413),
c = r(2486).Buffer;
const u = 65535,
l = 32,
h = 1,
p = 1,
f = 2,
d = /^([a-z\d[\](),]+)\[([1-9][\d]*)]$/,
g = /^ufixed([1-9][\d]*)x([1-9][\d]*)$/;
class y {
static from(e) {
if (e.endsWith("[]")) {
const t = y.from(e.slice(0, e.length - 2));
return new E(t);
}
if (e.endsWith("]")) {
const t = e.match(d);
if (3 !== t.length) throw new Error(`malformed static array string: ${e}`);
const r = t[2],
n = parseInt(r, 10);
if (n > u) throw new Error(`array length exceeds limit ${u}`);
const o = y.from(t[1]);
return new S(o, n);
}
if (e.startsWith("uint")) {
const t = e => [...e].every(e => "0123456789".includes(e)),
r = e.slice(4, e.length);
if (!t(r)) throw new Error(`malformed uint string: ${r}`);
const n = parseInt(r, 10);
if (n > u) throw new Error(`malformed uint string: ${n}`);
return new m(n);
}
if ("byte" === e) return new v();
if (e.startsWith("ufixed")) {
const t = e.match(g);
if (3 !== t.length) throw new Error(`malformed ufixed type: ${e}`);
const r = parseInt(t[1], 10),
n = parseInt(t[2], 10);
return new b(r, n);
}
if ("bool" === e) return new A();
if ("address" === e) return new w();
if ("string" === e) return new x();
if (e.length >= 2 && "(" === e[0] && ")" === e[e.length - 1]) {
const t = T.parseTupleContent(e.slice(1, e.length - 1)),
r = [];
for (let e = 0; e < t.length; e++) {
const n = y.from(t[e]);
r.push(n);
}
return new T(r);
}
throw new Error(`cannot convert a string ${e} to an ABI type`);
}
}
class m extends y {
constructor(e) {
if (super(), e % 8 != 0 || e < 8 || e > 512) throw new Error(`unsupported uint type bitSize: ${e}`);
this.bitSize = e;
}
toString() {
return `uint${this.bitSize}`;
}
equals(e) {
return e instanceof m && this.bitSize === e.bitSize;
}
isDynamic() {
return !1;
}
byteLen() {
return this.bitSize / 8;
}
encode(e) {
if ("bigint" != typeof e && "number" != typeof e) throw new Error(`Cannot encode value as uint${this.bitSize}: ${e}`);
if (e >= BigInt(2 ** this.bitSize) || e < BigInt(0)) throw new Error(`${e} is not a non-negative int or too big to fit in size uint${this.bitSize}`);
if ("number" == typeof e && !Number.isSafeInteger(e)) throw new Error(`${e} should be converted into a BigInt before it is encoded`);
return s(e, this.bitSize / 8);
}
decode(e) {
if (e.length !== this.bitSize / 8) throw new Error(`byte string must correspond to a uint${this.bitSize}`);
return i(e);
}
}
class b extends y {
constructor(e, t) {
if (super(), e % 8 != 0 || e < 8 || e > 512) throw new Error(`unsupported ufixed type bitSize: ${e}`);
if (t > 160 || t < 1) throw new Error(`unsupported ufixed type precision: ${t}`);
this.bitSize = e, this.precision = t;
}
toString() {
return `ufixed${this.bitSize}x${this.precision}`;
}
equals(e) {
return e instanceof b && this.bitSize === e.bitSize && this.precision === e.precision;
}
isDynamic() {
return !1;
}
byteLen() {
return this.bitSize / 8;
}
encode(e) {
if ("bigint" != typeof e && "number" != typeof e) throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);
if (e >= BigInt(2 ** this.bitSize) || e < BigInt(0)) throw new Error(`${e} is not a non-negative int or too big to fit in size ${this.toString()}`);
if ("number" == typeof e && !Number.isSafeInteger(e)) throw new Error(`${e} should be converted into a BigInt before it is encoded`);
return s(e, this.bitSize / 8);
}
decode(e) {
if (e.length !== this.bitSize / 8) throw new Error(`byte string must correspond to a ${this.toString()}`);
return i(e);
}
}
class w extends y {
toString() {
return "address";
}
equals(e) {
return e instanceof w;
}
isDynamic() {
return !1;
}
byteLen() {
return l;
}
encode(e) {
if ("string" != typeof e && !(e instanceof Uint8Array)) throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);
if ("string" == typeof e) return (0, n.decodeAddress)(e).publicKey;
if (32 !== e.byteLength) throw new Error("byte string must be 32 bytes long for an address");
return e;
}
decode(e) {
if (32 !== e.byteLength) throw new Error("byte string must be 32 bytes long for an address");
return (0, n.encodeAddress)(e);
}
}
class A extends y {
toString() {
return "bool";
}
equals(e) {
return e instanceof A;
}
isDynamic() {
return !1;
}
byteLen() {
return p;
}
encode(e) {
if ("boolean" != typeof e) throw new Error(`Cannot encode value as bool: ${e}`);
return e ? new Uint8Array([128]) : new Uint8Array([0]);
}
decode(e) {
if (1 !== e.byteLength) throw new Error("bool string must be 1 byte long");
const t = e[0];
if (128 === t) return !0;
if (0 === t) return !1;
throw new Error("boolean could not be decoded from the byte string");
}
}
class v extends y {
toString() {
return "byte";
}
equals(e) {
return e instanceof v;
}
isDynamic() {
return !1;
}
byteLen() {
return h;
}
encode(e) {
if ("number" != typeof e && "bigint" != typeof e) throw new Error(`Cannot encode value as byte: ${e}`);
if ("bigint" == typeof e && (e = Number(e)), e < 0 || e > 255) throw new Error(`${e} cannot be encoded into a byte`);
return new Uint8Array([e]);
}
decode(e) {
if (1 !== e.byteLength) throw new Error("byte string must be 1 byte long");
return e[0];
}
}
class x extends y {
toString() {
return "string";
}
equals(e) {
return e instanceof x;
}
isDynamic() {
return !0;
}
byteLen() {
throw new Error(`${this.toString()} is a dynamic type`);
}
encode(e) {
if ("string" != typeof e && !(e instanceof Uint8Array)) throw new Error(`Cannot encode value as string: ${e}`);
const t = c.from(e),
r = s(e.length, f),
n = new Uint8Array(e.length + f);
return n.set(r), n.set(t, f), n;
}
decode(e) {
if (e.length < f) throw new Error(`byte string is too short to be decoded. Actual length is ${e.length}, but expected at least ${f}`);
const t = c.from(e).readUIntBE(0, f),
r = e.slice(f, e.length);
if (t !== r.length) throw new Error(`string length bytes do not match the actual length of string. Expected ${t}, got ${r.length}`);
return c.from(r).toString("utf-8");
}
}
class S extends y {
constructor(e, t) {
if (super(), t < 1) throw new Error(`static array must have a length greater than 0: ${t}`);
this.childType = e, this.staticLength = t;
}
toString() {
return `${this.childType.toString()}[${this.staticLength}]`;
}
equals(e) {
return e instanceof S && this.staticLength === e.staticLength && this.childType.equals(e.childType);
}
isDynamic() {
return this.childType.isDynamic();
}
byteLen() {
return this.childType.constructor === A ? Math.ceil(this.staticLength / 8) : this.staticLength * this.childType.byteLen();
}
encode(e) {
if (!(Array.isArray(e) || e instanceof Uint8Array)) throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);
if (e.length !== this.staticLength) throw new Error(`Value array does not match static array length. Expected ${this.staticLength}, got ${e.length}`);
return this.toABITupleType().encode(e);
}
decode(e) {
return this.toABITupleType().decode(e);
}
toABITupleType() {
return new T(Array(this.staticLength).fill(this.childType));
}
}
class E extends y {
constructor(e) {
super(), this.childType = e;
}
toString() {
return `${this.childType.toString()}[]`;
}
equals(e) {
return e instanceof E && this.childType.equals(e.childType);
}
isDynamic() {
return !0;
}
byteLen() {
throw new Error(`${this.toString()} is a dynamic type`);
}
encode(e) {
if (!(Array.isArray(e) || e instanceof Uint8Array)) throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);
const t = this.toABITupleType(e.length),
r = t.encode(e),
n = s(t.childTypes.length, f);
return (0, a.concatArrays)(n, r);
}
decode(e) {
const t = c.from(e).readUIntBE(0, f);
return this.toABITupleType(t).decode(e.slice(f, e.length));
}
toABITupleType(e) {
return new T(Array(e).fill(this.childType));
}
}
class T extends y {
constructor(e) {
if (super(), e.length >= u) throw new Error("tuple type child type number larger than maximum uint16 error");
this.childTypes = e;
}
toString() {
const e = [];
for (let t = 0; t < this.childTypes.length; t++) e[t] = this.childTypes[t].toString();
return `(${e.join(",")})`;
}
equals(e) {
return e instanceof T && this.childTypes.length === e.childTypes.length && this.childTypes.every((t, r) => t.equals(e.childTypes[r]));
}
isDynamic() {
return this.childTypes.some(e => e.isDynamic());
}
byteLen() {
let e = 0;
for (let t = 0; t < this.childTypes.length; t++) if (this.childTypes[t].constructor === A) {
const r = B(this.childTypes, t, 1),
n = r + 1;
t += r, e += Math.trunc((n + 7) / 8);
} else e += this.childTypes[t].byteLen();
return e;
}
encode(e) {
if (!(Array.isArray(e) || e instanceof Uint8Array)) throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);
const t = Array.from(e);
if (e.length > u) throw new Error("length of tuple array should not exceed a uint16");
const r = this.childTypes,
n = [],
o = [],
i = new Map();
let c = 0;
for (; c < r.length;) {
const e = r[c];
if (e.isDynamic()) i.set(n.length, !0), n.push(new Uint8Array([0, 0])), o.push(e.encode(t[c]));else {
if (e.constructor === A) {
const e = B(r, c, -1);
let o = B(r, c, 1);
if (e % 8 != 0) throw new Error("expected before index should have number of bool mod 8 equal 0");
o = Math.min(7, o);
const i = _(t.slice(c, c + o + 1));
n.push(s(i, 1)), c += o;
} else {
const r = e.encode(t[c]);
n.push(r);
}
i.set(c, !1), o.push(new Uint8Array());
}
c += 1;
}
let l = 0;
for (const e of n) l += e.length;
let h = 0;
for (let e = 0; e < n.length; e++) {
if (i.get(e)) {
const t = l + h;
if (t > u) throw new Error(`byte length of ${t} should not exceed a uint16`);
n[e] = s(t, f);
}
h += o[e].length;
}
return (0, a.concatArrays)(...n, ...o);
}
decode(e) {
const t = this.childTypes,
r = [],
n = [];
let o = 0,
s = 0;
const i = c.from(e);
for (; o < t.length;) {
const a = t[o];
if (a.isDynamic()) {
if (e.slice(s, e.length).length < f) throw new Error("dynamic type in tuple is too short to be decoded");
const t = i.readUIntBE(s, f);
if (r.length > 0 && (r[r.length - 1].right = t, t < r[r.length - 1].left)) throw new Error("dynamic index segment miscalculation: left is greater than right index");
const o = {
left: t,
right: -1
};
r.push(o), n.push(null), s += f;
} else if (a.constructor === A) {
const t = B(this.childTypes, o, -1);
let r = B(this.childTypes, o, 1);
if (t % 8 != 0) throw new Error("expected before bool number mod 8 === 0");
r = Math.min(7, r);
for (let t = 0; t <= r; t++) {
const r = 128 >> t;
(e[s] & r) > 0 ? n.push(new Uint8Array([128])) : n.push(new Uint8Array([0]));
}
o += r, s += 1;
} else {
const t = a.byteLen();
n.push(e.slice(s, s + t)), s += t;
}
if (o !== t.length - 1 && s >= e.length) throw new Error("input byte not enough to decode");
o += 1;
}
if (r.length > 0 && (r[r.length - 1].right = e.length, s = e.length), s < e.length) throw new Error("input byte not fully consumed");
for (let e = 0; e < r.length; e++) {
const t = r[e];
if (t.left > t.right) throw new Error("dynamic segment should display a [l, r] space with l <= r");
if (e !== r.length - 1 && t.right !== r[e + 1].left) throw new Error("dynamic segment should be consecutive");
}
let a = 0;
for (let o = 0; o < t.length; o++) t[o].isDynamic() && (n[o] = e.slice(r[a].left, r[a].right), a += 1);
const u = [];
for (let e = 0; e < t.length; e++) {
const r = t[e].decode(n[e]);
u.push(r);
}
return u;
}
static parseTupleContent(e) {
if (0 === e.length) return [];
if (e.endsWith(",") || e.startsWith(",")) throw new Error("tuple string should not start with comma");
if (e.includes(",,")) throw new Error("tuple string should not have consecutive commas");
const t = [];
let r = 0,
n = "";
for (const o of e) n += o, "(" === o ? r += 1 : ")" === o ? r -= 1 : "," === o && 0 === r && (t.push(n.slice(0, n.length - 1)), n = "");
if (0 !== n.length && t.push(n), 0 !== r) throw new Error("tuple string has mismatched parentheses");
return t;
}
}
function _(e) {
let t = 0;
if (e.length > 8) throw new Error("value list passed in should be no greater than length 8");
for (let r = 0; r < e.length; r++) {
const n = e[r];
if ("boolean" != typeof n) throw new Error("non-boolean values cannot be compressed into a byte");
n && (t |= 1 << 7 - r);
}
return t;
}
function B(e, t, r) {
let n = 0;
for (;;) {
const o = t + r * n;
if (e[o].constructor !== A) {
n -= 1;
break;
}
if (o !== e.length - 1 && 1 === r) n += 1;else {
if (!(o > 0 && -1 === r)) break;
n += 1;
}
}
return n;
}
var k,
I,
U = r(9404);
function C(e) {
return e === k.any || e === k.pay || e === k.keyreg || e === k.acfg || e === k.axfer || e === k.afrz || e === k.appl;
}
function R(e, t) {
return e === k.any || t.type && t.type.toString() === e.toString();
}
function O(e) {
return e === I.account || e === I.application || e === I.asset;
}
!function (e) {
e.any = "txn", e.pay = "pay", e.keyreg = "keyreg", e.acfg = "acfg", e.axfer = "axfer", e.afrz = "afrz", e.appl = "appl";
}(k || (k = {})), function (e) {
e.account = "account", e.application = "application", e.asset = "asset";
}(I || (I = {}));
class D {
constructor(e) {
if ("string" != typeof e.name || "object" != typeof e.returns || !Array.isArray(e.args)) throw new Error("Invalid ABIMethod parameters");
this.name = e.name, this.description = e.desc, this.args = e.args.map(({
type: e,
name: t,
desc: r
}) => C(e) || O(e) ? {
type: e,
name: t,
description: r
} : {
type: y.from(e),
name: t,
description: r
}), this.returns = {
type: "void" === e.returns.type ? e.returns.type : y.from(e.returns.type),
description: e.returns.desc
};
}
getSignature() {
const e = this.args.map(e => e.type.toString()).join(","),
t = this.returns.type.toString();
return `${this.name}(${e})${t}`;
}
getSelector() {
const e = (0, U.genericHash)(this.getSignature());
return new Uint8Array(e.slice(0, 4));
}
txnCount() {
let e = 1;
for (const t of this.args) "string" == typeof t.type && C(t.type) && (e += 1);
return e;
}
toJSON() {
return {
name: this.name,
desc: this.description,
args: this.args.map(({
type: e,
name: t,
description: r
}) => ({
type: e.toString(),
name: t,
desc: r
})),
returns: {
type: this.returns.type.toString(),
desc: this.returns.description
}
};
}
static fromSignature(e) {
const {
name: t,
args: r,
returns: n
} = function (e) {
const t = e.indexOf("(");
if (-1 === t) throw new Error(`Invalid method signature: ${e}`);
let r = -1,
n = 0;
for (let o = t; o < e.length; o++) {
const t = e[o];
if ("(" === t) n += 1;else if (")" === t) {
if (0 === n) break;
if (n -= 1, 0 === n) {
r = o;
break;
}
}
}
if (-1 === r) throw new Error(`Invalid method signature: ${e}`);
return {
name: e.slice(0, t),
args: T.parseTupleContent(e.slice(t + 1, r)),
returns: e.slice(r + 1)
};
}(e);
return new D({
name: t,
args: r.map(e => ({
type: e
})),
returns: {
type: n
}
});
}
}
class N {
constructor(e) {
if ("string" != typeof e.name || !Array.isArray(e.methods) || e.networks && "object" != typeof e.networks) throw new Error("Invalid ABIContract parameters");
this.name = e.name, this.description = e.desc, this.networks = e.networks ? { ...e.networks
} : {}, this.methods = e.methods.map(e => new D(e));
}
toJSON() {
return {
name: this.name,
desc: this.description,
networks: this.networks,
methods: this.methods.map(e => e.toJSON())
};
}
}
class P {
constructor(e) {
if ("string" != typeof e.name || !Array.isArray(e.methods)) throw new Error("Invalid ABIInterface parameters");
this.name = e.name, this.description = e.desc, this.methods = e.methods.map(e => new D(e));
}
toJSON() {
return {
name: this.name,
desc: this.description,
methods: this.methods.map(e => e.toJSON())
};
}
}
},
7988: (e, t, r) => {
"use strict";
r.d(t, {
Z: () => s
});
var n = r(9404),
o = r(7116);
function s() {
const e = n.keyPair();
return {
addr: o.encodeAddress(e.publicKey),
sk: e.secretKey
};
}
},
2691: (e, t, r) => {
"use strict";
r.d(t, {
Z: () => c
});
var n = r(7116),
o = r(3033),
s = r(9404),
i = r(413),
a = r(2486).Buffer;
class c {
constructor({
bidderKey: e,
bidAmount: t,
bidID: r,
auctionKey: o,
auctionID: s,
maxPrice: i
}) {
this.name = "Bid", this.tag = a.from([97, 66]);
const c = n.decodeAddress(e),
u = n.decodeAddress(o);
if (!Number.isSafeInteger(t) || t < 0) throw Error("Bid amount must be positive and 2^53-1");
if (!Number.isSafeInteger(r) || r < 0) throw Error("BidID must be positive and 2^53-1");
if (!Number.isSafeInteger(s) || s < 0) throw Error("auctionID must be positive");
Object.assign(this, {
bidderKey: c,
bidAmount: t,
bidID: r,
auctionKey: u,
auctionID: s,
maxPrice: i
});
}
get_obj_for_encoding() {
return {
bidder: a.from(this.bidderKey.publicKey),
cur: this.bidAmount,
price: this.maxPrice,
id: this.bidID,
auc: a.from(this.auctionKey.publicKey),
aid: this.auctionID
};
}
signBid(e) {
const t = o.encode(this.get_obj_for_encoding()),
r = a.from(i.concatArrays(this.tag, t)),
n = s.sign(r, e),
c = {
t: "b",
b: {
sig: a.from(n),
bid: this.get_obj_for_encoding()
}
};
return new Uint8Array(o.encode(c));
}
}
},
1113: (e, t, r) => {
"use strict";
r.r(t), r.d(t, {
default: () => f
});
var n = r(413),
o = r(1042),
s = r.n(o),
i = r(9368),
a = r.n(i),
c = r(5391),
u = r(2486).Buffer;
class l {
constructor(e, t, r, n = {}) {
this.defaultHeaders = n;
const o = new (s())(t, {});
if (void 0 !== r && o.set("port", r.toString()), 0 === o.protocol.length) throw new Error("Invalid base server URL, protocol must be defined.");
this.baseURL = o, this.tokenHeader = e;
}
addressWithPath(e) {
return new (s())(a().posix.join(this.baseURL.pathname, e), this.baseURL).toString();
}
static superagentToHTTPClientResponse(e) {
return e.body instanceof ArrayBuffer && (e.body = new Uint8Array(e.body)), e;
}
static formatSuperagentError(e) {
if (e.response) try {
const t = JSON.parse(u.from(e.response.body).toString());
e.message = `Network request error. Received status ${e.response.status}: ${t.message}`;
} catch (e) {}
return e;
}
async get(e, t, r = {}) {
const n = c.get(this.addressWithPath(e)).set(this.tokenHeader).set(this.defaultHeaders).set(r).responseType("arraybuffer").query(t);
try {
const e = await n;
return l.superagentToHTTPClientResponse(e);
} catch (e) {
throw l.formatSuperagentError(e);
}
}
async post(e, t, r, n = {}) {
const o = c.post(this.addressWithPath(e)).set(this.tokenHeader).set(this.defaultHeaders).set(n).query(r).serialize(e => e).responseType("arraybuffer").send(u.from(t));
try {
const e = await o;
return l.superagentToHTTPClientResponse(e);
} catch (e) {
throw l.formatSuperagentError(e);
}
}
async delete(e, t, r, n = {}) {
const o = c.delete(this.addressWithPath(e)).set(this.tokenHeader).set(this.defaultHeaders).set(n).query(r).serialize(e => e).responseType("arraybuffer").send(u.from(t));
try {
const e = await o;
return l.superagentToHTTPClientResponse(e);
} catch (e) {
throw l.formatSuperagentError(e);
}
}
}
var h = r(2486).Buffer;
function p(e) {
return Object.keys(e).reduce((t, r) => (t[r.toLowerCase()] = e[r], t), {});
}
class f {
constructor(e, t, r, n = {}) {
this.bc = void 0 !== t ? new l(e, t, r, n) : e;
}
static parseJSON(e, t, r = {}) {
try {
return 0 !== Object.keys(r).length ? e && JSON.parse(e) : e && n.parseJSON(e, r);
} catch (r) {
const n = r;
throw n.rawResponse = e || null, n.statusCode = t, n;
}
}
static serializeData(e, t) {
if (!e) return new Uint8Array(0);
if ("application/json" === t["content-type"]) return new Uint8Array(h.from(JSON.stringify(e)));
if ("string" == typeof e) return new Uint8Array(h.from(e));
if (e instanceof Uint8Array) return e;
throw new Error("provided data is neither a string nor a Uint8Array and content-type is not application/json");
}
static prepareResponse(e, t = {}) {
let r,
{
body: n
} = e;
return function (e) {
let t = p(e.headers)["content-type"];
return t && (t = t.split(";")[0]), /[/+]json($|[^-\w])/i.test(t);
}(e) ? (r = n && new TextDecoder().decode(n) || "", n = f.parseJSON(r, e.status, t)) : function (e) {
const t = p(e.headers)["content-type"] || "text/plain";
return /^\w*text\//i.test(t);
}(e) && (r = n && new TextDecoder().decode(n) || ""), { ...e,
body: n,
text: r,
ok: 2 === Math.trunc(e.status / 100)
};
}
static prepareResponseError(e) {
return e.response && (e.response = f.prepareResponse(e.response), e.status = e.response.status), e;
}
async get(e, t, r = {}, n = {}) {
const o = { ...r,
accept: function (e) {
if (void 0 === e || !Object.prototype.hasOwnProperty.call(e, "format")) return "application/json";
switch (e.format) {
case "msgpack":
return "application/msgpack";
case "json":
default:
return "application/json";
}
}(t)
};
try {
const r = await this.bc.get(e, function (e) {
for (const t in e) Object.prototype.hasOwnProperty.call(e, t) && (e[t] && 0 !== e[t].length || delete e[t]);
return e;
}(t), o);
return f.prepareResponse(r, n);
} catch (e) {
throw f.prepareResponseError(e);
}
}
async post(e, t, r = {}) {
const n = {
"content-type": "application/json",
...p(r)
};
try {
const r = await this.bc.post(e, f.serializeData(t, n), void 0, n);
return f.prepareResponse(r);
} catch (e) {
throw f.prepareResponseError(e);
}
}
async delete(e, t, r = {}) {
const n = {
"content-type": "application/json",
...p(r)
},
o = await this.bc.delete(e, f.serializeData(t, n), void 0, n);
return f.prepareResponse(o);
}
}
},
6477: (e, t, r) => {
"use strict";
r.d(t, {
Z: () => i
});
var n = r(3480),
o = r(9417),
s = r(2486).Buffer;
class i extends n.Z {
constructor(e, t = "http://127.0.0.1", r = 7833, n = {}) {
super("X-KMD-API-Token", e, t, r, n);
}
async versions() {
return (await this.c.get("/versions")).body;
}
async listWallets() {
return (await this.c.get("/v1/wallets")).body;
}
async createWallet(e, t, r = "", n = "sqlite") {
const o = {
wallet_name: e,
wallet_driver_name: n,
wallet_password: t,
master_derivation_key: s.from(r).toString("base64")
};
return (await this.c.post("/v1/wallet", o)).body;
}
async initWalletHandle(e, t) {
const r = {
wallet_id: e,
wallet_password: t
};
return (await this.c.post("/v1/wallet/init", r)).body;
}
async releaseWalletHandle(e) {
const t = {
wallet_handle_token: e
};
return (await this.c.post("/v1/wallet/release", t)).body;
}
async renewWalletHandle(e) {
const t = {
wallet_handle_token: e
};
return (await this.c.post("/v1/wallet/renew", t)).body;
}
async renameWallet(e, t, r) {
const n = {
wallet_id: e,
wallet_password: t,
wallet_name: r
};
return (await this.c.post("/v1/wallet/rename", n)).body;
}
async getWallet(e) {
const t = {
wallet_handle_token: e
};
return (await this.c.post("/v1/wallet/info", t)).body;
}
async exportMasterDerivationKey(e, t) {
const r = {
wallet_handle_token: e,
wallet_password: t
},
n = await this.c.post("/v1/master-key/export", r);
return {
master_derivation_key: s.from(n.body.master_derivation_key, "base64")
};
}
async importKey(e, t) {
const r = {
wallet_handle_token: e,
private_key: s.from(t).toString("base64")
};
return (await this.c.post("/v1/key/import", r)).body;
}
async exportKey(e, t, r) {
const n = {
wallet_handle_token: e,
address: r,
wallet_password: t
},
o = await this.c.post("/v1/key/export", n);
return {
private_key: s.from(o.body.private_key, "base64")
};
}
async generateKey(e) {
const t = {
wallet_handle_token: e,
display_mnemonic: !1
};
return (await this.c.post("/v1/key", t)).body;
}
async deleteKey(e, t, r) {
const n = {
wallet_handle_token: e,
address: r,
wallet_password: t
};
return (await this.c.delete("/v1/key", n)).body;
}
async listKeys(e) {
const t = {
wallet_handle_token: e
};
return (await this.c.post("/v1/key/list", t)).body;
}
async signTransaction(e, t, r) {
const n = o.instantiateTxnIfNeeded(r),
i = {
wallet_handle_token: e,
wallet_password: t,
transaction: s.from(n.toByte()).toString("base64")
},
a = await this.c.post("/v1/transaction/sign", i);
return 200 === a.status ? s.from(a.body.signed_transaction, "base64") : a.body;
}
async signTransactionWithSpecificPublicKey(e, t, r, n) {
const i = o.instantiateTxnIfNeeded(r),
a = {
wallet_handle_token: e,
wallet_password: t,
transaction: s.from(i.toByte()).toString("base64"),
public_key: s.from(n).toString("base64")
},
c = await this.c.post("/v1/transaction/sign", a);
return 200 === c.status ? s.from(c.body.signed_transaction, "base64") : c.body;
}
async listMultisig(e) {
const t = {
wallet_handle_token: e
};
return (await this.c.post("/v1/multisig/list", t)).body;
}
async importMultisig(e, t, r, n) {
const o = {
wallet_handle_token: e,
multisig_version: t,
threshold: r,
pks: n
};
return (await this.c.post("/v1/multisig/import", o)).body;
}
async exportMultisig(e, t) {
const r = {
wallet_handle_token: e,
address: t
};
return (await this.c.post("/v1/multisig/export", r)).body;
}
async signMultisigTransaction(e, t, r, n, i) {
const a = o.instantiateTxnIfNeeded(r),
c = {
wallet_handle_token: e,
transaction: s.from(a.toByte()).toString("base64"),
public_key: s.from(n).toString("base64"),
partial_multisig: i,
wallet_password: t
};
return (await this.c.post("/v1/multisig/sign", c)).body;
}
async deleteMultisig(e, t, r) {
const n = {
wallet_handle_token: e,
address: r,
wallet_password: t
};
return (await this.c.delete("/v1/multisig", n)).body;
}
}
},
5427: (e, t, r) => {
"use strict";
r.d(t, {
Z: () => B
});
var n = r(3480),
o = r(8680);
class s extends o.Z {
constructor(e, t, r) {
super(e, t), this.account = r, this.account = r;
}
path() {
return `/v2/accounts/${this.account}`;
}
}
var i = r(3033);
class a extends o.Z {
constructor(e, t) {
if (super(e), !Number.isInteger(t)) throw Error("roundNumber should be an integer");
this.round = t, this.query = {
format: "msgpack"
};
}
path() {
return `/v2/blocks/${this.round}`;
}
prepare(e) {
if (e && e.byteLength > 0) return i.decode(e);
}
}
var c = r(2486).Buffer;
function u(e = {}) {
let t = e;
return Object.keys(t).every(e => "content-type" !== e.toLowerCase()) && (t = { ...e
}, t["Content-Type"] = "text/plain"), t;
}
class l extends o.Z {
constructor(e, t) {
super(e), this.source = t, this.source = t;
}
path() {
return "/v2/teal/compile";
}
async do(e = {}) {
const t = u(e);
return (await this.c.post(this.path(), c.from(this.source), t)).body;
}
}
var h = r(2486).Buffer;
class p extends o.Z {
constructor(e, t) {
super(e), this.blob = i.encode(t.get_obj_for_encoding(!0));
}
path() {
return "/v2/teal/dryrun";
}
async do(e = {}) {
const t = u(e);
return (await this.c.post(this.path(), h.from(this.blob), t)).body;
}
}
class f extends o.Z {
constructor(e, t, r) {
super(e, t), this.index = r, this.index = r;
}
path() {
return `/v2/assets/${this.index}`;
}
}
class d extends o.Z {
constructor(e, t, r) {
super(e, t), this.index = r, this.index = r;
}
path() {
return `/v2/applications/${this.index}`;
}
}
class g extends o.Z {
path() {
return "/health";
}
async do(e = {}) {
const t = await this.c.get(this.path(), {}, e);
if (!t.ok) throw new Error(`Health response: ${t.status}`);
return {};
}
}
class y extends o.Z {
constructor(e, t) {
super(e), this.txid = t, this.txid = t, this.query.format = "msgpack";
}
prepare(e) {
if (e && e.byteLength > 0) return i.decode(e);
}
path() {
return `/v2/transactions/pending/${this.txid}`;
}
max(e) {
return this.query.max = e, this;
}
}
class m extends o.Z {
constructor(e) {
super(e), this.query.format = "msgpack";
}
path() {
return "/v2/transactions/pending";
}
prepare(e) {
if (e && e.byteLength > 0) return i.decode(e);
}
max(e) {
return this.query.max = e, this;
}
}
class b extends o.Z {
constructor(e, t) {
super(e), this.address = t, this.address = t, this.query.format = "msgpack";
}
prepare(e) {
if (e && e.byteLength > 0) return i.decode(e);
}
path() {
return `/v2/accounts/${this.address}/transactions/pending`;
}
max(e) {
return this.query.max = e, this;
}
}
var w = r(5180);
class A extends o.Z {
path() {
return "/v2/status";
}
}
class v extends o.Z {
constructor(e, t, r) {
if (super(e, t), this.round = r, !Number.isInteger(r)) throw Error("round should be an integer");
this.round = r;
}
path() {
return `/v2/status/wait-for-block-after/${this.round}`;
}
}
class x extends o.Z {
path() {
return "/v2/transactions/params";
}
prepare(e) {
return {
flatFee: !1,
fee: e.fee,
firstRound: e["last-round"],
lastRound: e["last-round"] + 1e3,
genesisID: e["genesis-id"],
genesisHash: e["genesis-hash"]
};
}
}
class S extends o.Z {
path() {
return "/v2/ledger/supply";
}
}
class E extends o.Z {
path() {
return "/versions";
}
}
class T extends o.Z {
path() {
return "/genesis";
}
}
class _ extends o.Z {
constructor(e, t, r, n) {
super(e, t), this.round = r, this.txID = n, this.round = r, this.txID = n;
}
path() {
return `/v2/blocks/${this.round}/transactions/${this.txID}/proof`;
}
}
class B extends n.Z {
constructor(e, t = "http://r2.algorand.network", r = 4180, n = {}) {
super("X-Algo-API-Token", e, t, r, n);
}
healthCheck() {
return new g(this.c);
}
versionsCheck() {
return new E(this.c);
}
sendRawTransaction(e) {
return new w.default(this.c, e);
}
accountInformation(e) {
return new s(this.c, this.intDecoding, e);
}
block(e) {
return new a(this.c, e);
}
pendingTransactionInformation(e) {
return new y(this.c, e);
}
pendingTransactionsInformation() {
return new m(this.c);
}
pendingTransactionByAddress(e) {
return new b(this.c, e);
}
status() {
return new A(this.c, this.intDecoding);
}
statusAfterBlock(e) {
return new v(this.c, this.intDecoding, e);
}
getTransactionParams() {
return new x(this.c);
}
supply() {
return new S(this.c, this.intDecoding);
}
compile(e) {
return new l(this.c, e);
}
dryrun(e) {
return new p(this.c, e);
}
getAssetByID(e) {
return new f(this.c, this.intDecoding, e);
}
getApplicationByID(e) {
return new d(this.c, this.intDecoding, e);
}
genesis() {
return new T(this.c, this.intDecoding);
}
getProof(e, t) {
return new _(this.c, this.intDecoding, e, t);
}
}
},
227: (e, t, r) => {
"use strict";
r.r(t), r.d(t, {
Account: () => a,
AccountParticipation: () => c,
AccountStateDelta: () => u,
Application: () => l,
ApplicationLocalState: () => h,
ApplicationParams: () => p,
ApplicationStateSchema: () => f,
Asset: () => d,
AssetHolding: () => g,
AssetParams: () => y,
BlockResponse: () => m,
BuildVersion: () => b,
CatchpointAbortResponse: () => w,
CatchpointStartResponse: () => A,
CompileResponse: () => v,
DryrunRequest: () => x,
DryrunResponse: () => S,
DryrunSource: () => E,
DryrunState: () => T,
DryrunTxnResult: () => _,
ErrorResponse: () => B,
EvalDelta: () => k,
EvalDeltaKeyValue: () => I,
NodeStatusResponse: () => U,
PendingTransactionResponse: () => C,
PendingTransactionsResponse: () => R,
PostTransactionsResponse: () => O,
ProofResponse: () => D,
SupplyResponse: () => N,
TealKeyValue: () => P,
TealValue: () => L,
TransactionParametersResponse: () => F,
Version: () => j
});
var n = r(2486).Buffer;
function o(e, t) {
let r;
if (e instanceof Uint8Array) r = t ? e : n.from(e).toString("base64");else if ("function" == typeof e.get_obj_for_encoding) r = e.get_obj_for_encoding(t);else if (Array.isArray(e)) {
r = [];
for (const n of e) r.push(o(n, t));
} else if ("object" == typeof e) {
const n = {};
for (const r of Object.keys(e)) n[r] = o(e[r], t);
r = n;
} else {
if (!function (e) {
return void 0 === e || null == e || "object" != typeof e && "function" != typeof e;
}(e)) throw new Error(`Unsupported value: ${String(e)}`);
r = e;
}
return r;
}
class s {
get_obj_for_encoding(e = !1) {
const t = {};
for (const r of Object.keys(this.attribute_map)) {
const n = this.attribute_map[r],
s = this[r];
void 0 !== s && (t[n] = null === s ? null : o(s, e));
}
return t;
}
}
var i = r(2486).Buffer;
class a extends s {
constructor({
address: e,
amount: t,
amountWithoutPendingRewards: r,
pendingRewards: n,
rewards: o,
round: s,
status: i,
appsLocalState: a,
appsTotalExtraPages: c,
appsTotalSchema: u,
assets: l,
authAddr: h,
createdApps: p,
createdAssets: f,
participation: d,
rewardBase: g,
sigType: y
}) {
super(), this.address = e, this.amount = t, this.amountWithoutPendingRewards = r, this.pendingRewards = n, this.rewards = o, this.round = s, this.status = i, this.appsLocalState = a, this.appsTotalExtraPages = c, this.appsTotalSchema = u, this.assets = l, this.authAddr = h, this.createdApps = p, this.createdAssets = f, this.participation = d, this.rewardBase = g, this.sigType = y, this.attribute_map = {
address: "address",
amount: "amount",
amountWithoutPendingRewards: "amount-without-pending-rewards",
pendingRewards: "pending-rewards",
rewards: "rewards",
round: "round",
status: "status",
appsLocalState: "apps-local-state",
appsTotalExtraPages: "apps-total-extra-pages",
appsTotalSchema: "apps-total-schema",
assets: "assets",
authAddr: "auth-addr",
createdApps: "created-apps",
createdAssets: "created-assets",
participation: "participation",
rewardBase: "reward-base",
sigType: "sig-type"
};
}
}
class c extends s {
constructor({
selectionParticipationKey: e,
voteFirstValid: t,
voteKeyDilution: r,
voteLastValid: n,
voteParticipationKey: o
}) {
super(), this.selectionParticipationKey = "string" == typeof e ? new Uint8Array(i.from(e, "base64")) : e, this.voteFirstValid = t, this.voteKeyDilution = r, this.voteLastValid = n, this.voteParticipationKey = "string" == typeof o ? new Uint8Array(i.from(o, "base64")) : o, this.attribute_map = {
selectionParticipationKey: "selection-participation-key",
voteFirstValid: "vote-first-valid",
voteKeyDilution: "vote-key-dilution",
voteLastValid: "vote-last-valid",
voteParticipationKey: "vote-participation-key"
};
}
}
class u extends s {
constructor(e, t) {
super(), this.address = e, this.delta = t, this.attribute_map = {
address: "address",
delta: "delta"
};
}
}
class l extends s {
constructor(e, t) {
super(), this.id = e, this.params = t, this.attribute_map = {
id: "id",
params: "params"
};
}
}
class h extends s {
constructor(e, t, r) {
super(), this.id = e, this.schema = t, this.keyValue = r, this.attribute_map = {
id: "id",
schema: "schema",
keyValue: "key-value"
};
}
}
class p extends s {
constructor({
approvalProgram: e,
clearStateProgram: t,
creator: r,
extraProgramPages: n,
globalState: o,
globalStateSchema: s,
localStateSchema: a
}) {
super(), this.approvalProgram = "string" == typeof e ? new Uint8Array(i.from(e, "base64")) : e, this.clearStateProgram = "string" == typeof t ? new Uint8Array(i.from(t, "base64")) : t, this.creator = r, this.extraProgramPages = n, this.globalState = o, this.globalStateSchema = s, this.localStateSchema = a, this.attribute_map = {
approvalProgram: "approval-program",
clearStateProgram: "clear-state-program",
creator: "creator",
extraProgramPages: "extra-program-pages",
globalState: "global-state",
globalStateSchema: "global-state-schema",
localStateSchema: "local-state-schema"
};
}
}
class f extends s {
constructor(e, t) {
super(), this.numUint = e, this.numByteSlice = t, this.attribute_map = {
numUint: "num-uint",
numByteSlice: "num-byte-slice"
};
}
}
class d extends s {
constructor(e, t) {
super(), this.index = e, this.params = t, this.attribute_map = {
index: "index",
params: "params"
};
}
}
class g extends s {
constructor(e, t, r, n) {
super(), this.amount = e, this.assetId = t, this.creator = r, this.isFrozen = n, this.attribute_map = {
amount: "amount",
assetId: "asset-id",
creator: "creator",
isFrozen: "is-frozen"
};
}
}
class y extends s {
constructor({
creator: e,
decimals: t,
total: r,
clawback: n,
defaultFrozen: o,
freeze: s,
manager: a,
metadataHash: c,
name: u,
nameB64: l,
reserve: h,
unitName: p,
unitNameB64: f,
url: d,
urlB64: g
}) {
super(), this.creator = e, this.decimals = t, this.total = r, this.clawback = n, this.defaultFrozen = o, this.freeze = s, this.manager = a, this.metadataHash = "string" == typeof c ? new Uint8Array(i.from(c, "base64")) : c, this.name = u, this.nameB64 = "string" == typeof l ? new Uint8Array(i.from(l, "base64")) : l, this.reserve = h, this.unitName = p, this.unitNameB64 = "string" == typeof f ? new Uint8Array(i.from(f, "base64")) : f, this.url = d, this.urlB64 = "string" == typeof g ? new Uint8Array(i.from(g, "base64")) : g, this.attribute_map = {
creator: "creator",
decimals: "decimals",
total: "total",
clawback: "clawback",
defaultFrozen: "default-frozen",
freeze: "freeze",
manager: "manager",
metadataHash: "metadata-hash",
name: "name",
nameB64: "name-b64",
reserve: "reserve",
unitName: "unit-name",
unitNameB64: "unit-name-b64",
url: "url",
urlB64: "url-b64"
};
}
}
class m extends s {
constructor(e, t) {
super(), this.block = e, this.cert = t, this.attribute_map = {
block: "block",
cert: "cert"
};
}
}
class b extends s {
constructor({
branch: e,
buildNumber: t,
channel: r,
commitHash: n,
major: o,
minor: s
}) {
super(), this.branch = e, this.buildNumber = t, this.channel = r, this.commitHash = n, this.major = o, this.minor = s, this.attribute_map = {
branch: "branch",
buildNumber: "build_number",
channel: "channel",
commitHash: "commit_hash",
major: "major",
minor: "minor"
};
}
}
class w extends s {
constructor(e) {
super(), this.catchupMessage = e, this.attribute_map = {
catchupMessage: "catchup-message"
};
}
}
class A extends s {
constructor(e) {
super(), this.catchupMessage = e, this.attribute_map = {
catchupMessage: "catchup-message"
};
}
}
class v extends s {
constructor(e, t) {
super(), this.hash = e, this.result = t, this.attribute_map = {
hash: "hash",
result: "result"
};
}
}
class x extends s {
constructor({
accounts: e,
apps: t,
latestTimestamp: r,
protocolVersion: n,
round: o,
sources: s,
txns: i
}) {
super(), this.accounts = e, this.apps = t, this.latestTimestamp = r, this.protocolVersion = n, this.round = o, this.sources = s, this.txns = i, this.attribute_map = {
accounts: "accounts",
apps: "apps",
latestTimestamp: "latest-timestamp",
protocolVersion: "protocol-version",
round: "round",
sources: "sources",
txns: "txns"
};
}
}
class S extends s {
constructor(e, t, r) {
super(), this.error = e, this.protocolVersion = t, this.txns = r, this.attribute_map = {
error: "error",
protocolVersion: "protocol-version",
txns: "txns"
};
}
}
class E extends s {
constructor(e, t, r, n) {
super(), this.fieldName = e, this.source = t, this.txnIndex = r, this.appIndex = n, this.attribute_map = {
fieldName: "field-name",
source: "source",
txnIndex: "txn-index",
appIndex: "app-index"
};
}
}
class T extends s {
constructor({
line: e,
pc: t,
stack: r,
error: n,
scratch: o
}) {
super(), this.line = e, this.pc = t, this.stack = r, this.error = n, this.scratch = o, this.attribute_map = {
line: "line",
pc: "pc",
stack: "stack",
error: "error",
scratch: "scratch"
};
}
}
class _ extends s {
constructor({
disassembly: e,
appCallMessages: t,
appCallTrace: r,
cost: n,
globalDelta: o,
localDeltas: s,
logicSigMessages: i,
logicSigTrace: a,
logs: c
}) {
super(), this.disassembly = e, this.appCallMessages = t, this.appCallTrace = r, this.cost = n, this.globalDelta = o, this.localDeltas = s, this.logicSigMessages = i, this.logicSigTrace = a, this.logs = c, this.attribute_map = {
disassembly: "disassembly",
appCallMessages: "app-call-messages",
appCallTrace: "app-call-trace",
cost: "cost",
globalDelta: "global-delta",
localDeltas: "local-deltas",
logicSigMessages: "logic-sig-messages",
logicSigTrace: "logic-sig-trace",
logs: "logs"
};
}
}
class B extends s {
constructor(e, t) {
super(), this.message = e, this.data = t, this.attribute_map = {
message: "message",
data: "data"
};
}
}
class k extends s {
constructor(e, t, r) {
super(), this.action = e, this.bytes = t, this.uint = r, this.attribute_map = {
action: "action",
bytes: "bytes",
uint: "uint"
};
}
}
class I extends s {
constructor(e, t) {
super(), this.key = e, this.value = t, this.attribute_map = {
key: "key",
value: "value"
};
}
}
class U extends s {
constructor({
catchupTime: e,
lastRound: t,
lastVersion: r,
nextVersion: n,
nextVersionRound: o,
nextVersionSupported: s,
stoppedAtUnsupportedRound: i,
timeSinceLastRound: a,
catchpoint: c,
catchpointAcquiredBlocks: u,
catchpointProcessedAccounts: l,
catchpointTotalAccounts: h,
catchpointTotalBlocks: p,
catchpointVerifiedAccounts: f,
lastCatchpoint: d
}) {
super(), this.catchupTime = e, this.lastRound = t, this.lastVersion = r, this.nextVersion = n, this.nextVersionRound = o, this.nextVersionSupported = s, this.stoppedAtUnsupportedRound = i, this.timeSinceLastRound = a, this.catchpoint = c, this.catchpointAcquiredBlocks = u, this.catchpointProcessedAccounts = l, this.catchpointTotalAccounts = h, this.catchpointTotalBlocks = p, this.catchpointVerifiedAccounts = f, this.lastCatchpoint = d, this.attribute_map = {
catchupTime: "catchup-time",
lastRound: "last-round",
lastVersion: "last-version",
nextVersion: "next-version",
nextVersionRound: "next-version-round",
nextVersionSupported: "next-version-supported",
stoppedAtUnsupportedRound: "stopped-at-unsupported-round",
timeSinceLastRound: "time-since-last-round",
catchpoint: "catchpoint",
catchpointAcquiredBlocks: "catchpoint-acquired-blocks",
catchpointProcessedAccounts: "catchpoint-processed-accounts",
catchpointTotalAccounts: "catchpoint-total-accounts",
catchpointTotalBlocks: "catchpoint-total-blocks",
catchpointVerifiedAccounts: "catchpoint-verified-accounts",
lastCatchpoint: "last-catchpoint"
};
}
}
class C extends s {
constructor({
poolError: e,
txn: t,
applicationIndex: r,
assetClosingAmount: n,
assetIndex: o,
closeRewards: s,
closingAmount: i,
confirmedRound: a,
globalStateDelta: c,
innerTxns: u,
localStateDelta: l,
logs: h,
receiverRewards: p,
senderRewards: f
}) {
super(), this.poolError = e, this.txn = t, this.applicationIndex = r, this.assetClosingAmount = n, this.assetIndex = o, this.closeRewards = s, this.closingAmount = i, this.confirmedRound = a, this.globalStateDelta = c, this.innerTxns = u, this.localStateDelta = l, this.logs = h, this.receiverRewards = p, this.senderRewards = f, this.attribute_map = {
poolError: "pool-error",
txn: "txn",
applicationIndex: "application-index",
assetClosingAmount: "asset-closing-amount",
assetIndex: "asset-index",
closeRewards: "close-rewards",
closingAmount: "closing-amount",
confirmedRound: "confirmed-round",
globalStateDelta: "global-state-delta",
innerTxns: "inner-txns",
localStateDelta: "local-state-delta",
logs: "logs",
receiverRewards: "receiver-rewards",
senderRewards: "sender-rewards"
};
}
}
class R extends s {
constructor(e, t) {
super(), this.topTransactions = e, this.totalTransactions = t, this.attribute_map = {
topTransactions: "top-transactions",
totalTransactions: "total-transactions"
};
}
}
class O extends s {
constructor(e) {
super(), this.txid = e, this.attribute_map = {
txid: "txId"
};
}
}
class D extends s {
constructor(e, t, r) {
super(), this.idx = e, this.proof = "string" == typeof t ? new Uint8Array(i.from(t, "base64")) : t, this.stibhash = "string" == typeof r ? new Uint8Array(i.from(r, "base64")) : r, this.attribute_map = {
idx: "idx",
proof: "proof",
stibhash: "stibhash"
};
}
}
class N extends s {
constructor(e, t, r) {
super(), this.currentRound = e, this.onlineMoney = t, this.totalMoney = r, this.attribute_map = {
currentRound: "current_round",
onlineMoney: "online-money",
totalMoney: "total-money"
};
}
}
class P extends s {
constructor(e, t) {
super(), this.key = e, this.value = t, this.attribute_map = {
key: "key",
value: "value"
};
}
}
class L extends s {
constructor(e, t, r) {
super(), this.type = e, this.bytes = t, this.uint = r, this.attribute_map = {
type: "type",
bytes: "bytes",
uint: "uint"
};
}
}
class F extends s {
constructor({
consensusVersion: e,
fee: t,
genesisHash: r,
genesisId: n,
lastRound: o,
minFee: s
}) {
super(), this.consensusVersion = e, this.fee = t, this.genesisHash = "string" == typeof r ? new Uint8Array(i.from(r, "base64")) : r, this.genesisId = n, this.lastRound = o, this.minFee = s, this.attribute_map = {
consensusVersion: "consensus-version",
fee: "fee",
genesisHash: "genesis-hash",
genesisId: "genesis-id",
lastRound: "last-round",
minFee: "min-fee"
};
}
}
class j extends s {
constructor(e, t, r, n) {
super(), this.build = e, this.genesisHashB64 = "string" == typeof t ? new Uint8Array(i.from(t, "base64")) : t, this.genesisId = r, this.versions = n, this.attribute_map = {
build: "build",
genesisHashB64: "genesis_hash_b64",
genesisId: "genesis_id",
versions: "versions"
};
}
}
},
5180: (e, t, r) => {
"use strict";
r.r(t), r.d(t, {
setSendTransactionHeaders: () => i,
default: () => c
});
var n = r(8680),
o = r(413),
s = r(2486).Buffer;
function i(e = {}) {
let t = e;
return Object.keys(t).every(e => "content-type" !== e.toLowerCase()) && (t = { ...e
}, t["Content-Type"] = "application/x-binary"), t;
}
function a(e) {
return e && void 0 !== e.byteLength;
}
class c extends n.Z {
constructor(e, t) {
super(e);
let r = t;
if (Array.isArray(t)) {
if (!t.every(a)) throw new TypeError("Array elements must be byte arrays");
r = (0, o.concatArrays)(...t);
} else if (!a(r)) throw new TypeError("Argument must be byte array");
this.txnBytesToPost = r;
}
path() {
return "/v2/transactions";
}
async do(e = {}) {
const t = i(e);
return (await this.c.post(this.path(), s.from(this.txnBytesToPost), t)).body;
}
}
},
8104: (e, t, r) => {
"use strict";
r.d(t, {
Z: () => v
});
var n = r(3480),
o = r(8680);
class s extends o.Z {
path() {
return "/health";
}
}
class i extends o.Z {
constructor(e, t, r) {
super(e, t), this.index = r, this.index = r;
}
path() {
return `/v2/assets/${this.index}/balances`;
}
limit(e) {
return this.query.limit = e, this;
}
round(e) {
return this.query.round = e, this;
}
currencyGreaterThan(e) {
return this.query["currency-greater-than"] = e, this;
}
currencyLessThan(e) {
return this.query["currency-less-than"] = e, this;
}
nextToken(e) {
return this.query.next = e, this;
}
includeAll(e = !0) {
return this.query["include-all"] = e, this;
}
}
var a = r(2486).Buffer;
function c(e) {
return "string" == typeof e ? e : a.from(e).toString("base64");
}
class u extends o.Z {
constructor(e, t, r) {
super(e, t), this.account = r, this.account = r;
}
path() {
return `/v2/accounts/${this.account}/transactions`;
}
notePrefix(e) {
return this.query["note-prefix"] = c(e), this;
}
txType(e) {
return this.query["tx-type"] = e, this;
}
sigType(e) {
return this.query["sig-type"] = e, this;
}
txid(e) {
return this.query.txid = e, this;
}
round(e) {
return this.query.round = e, this;
}
minRound(e) {
return this.query["min-round"] = e, this;
}
maxRound(e) {
return this.query["max-round"] = e, this;
}
assetID(e) {
return this.query["asset-id"] = e, this;
}
limit(e) {
return this.query.limit = e, this;
}
beforeTime(e) {
return this.query["before-time"] = e, this;
}
afterTime(e) {
return this.query["after-time"] = e, this;
}
currencyGreaterThan(e) {
return this.query["currency-greater-than"] = e, this;
}
currencyLessThan(e) {
return this.query["currency-less-than"] = e, this;
}
nextToken(e) {
return this.query.next = e, this;
}
rekeyTo(e) {
return this.query["rekey-to"] = e, this;
}
}
class l extends o.Z {
constructor(e, t, r) {
super(e, t), this.index = r, this.index = r;
}
path() {
return `/v2/assets/${this.index}/transactions`;
}
notePrefix(e) {
return this.query["note-prefix"] = c(e), this;
}
txType(e) {
return this.query["tx-type"] = e, this;
}
sigType(e) {
return this.query["sig-type"] = e, this;
}
txid(e) {
return this.query.txid = e, this;
}
round(e) {
return this.query.round = e, this;
}
minRound(e) {
return this.query["min-round"] = e, this;
}
maxRound(e) {
return this.query["max-round"] = e, this;
}
assetID(e) {
return this.query["asset-id"] = e, this;
}
limit(e) {
return this.query.limit = e, this;
}
beforeTime(e) {
return this.query["before-time"] = e, this;
}
afterTime(e) {
return this.query["after-time"] = e, this;
}
currencyGreaterThan(e) {
return this.query["currency-greater-than"] = e, this;
}
currencyLessThan(e) {
return this.query["currency-less-than"] = e, this;
}
addressRole(e) {
return this.query["address-role"] = e, this;
}
address(e) {
return this.query.address = e, this;
}
excludeCloseTo(e) {
return this.query["exclude-close-to"] = e, this;
}
nextToken(e) {
return this.query.next = e, this;
}
rekeyTo(e) {
return this.query["rekey-to"] = e, this;
}
}
class h extends o.Z {
constructor(e, t, r) {
super(e, t), this.round = r, this.round = r;
}
path() {
return `/v2/blocks/${this.round}`;
}
}
class p extends o.Z {
constructor(e, t, r) {
super(e, t), this.txID = r, this.txID = r;
}
path() {
return `/v2/transactions/${this.txID}`;
}
}
class f extends o.Z {
constructor(e, t, r) {
super(e, t), this.account = r, this.account = r;
}
path() {
return `/v2/accounts/${this.account}`;
}
round(e) {
return this.query.round = e, this;
}
includeAll(e = !0) {
return this.query["include-all"] = e, this;
}
}
class d extends o.Z {
constructor(e, t, r) {
super(e, t), this.index = r, this.index = r;
}
path() {
return `/v2/assets/${this.index}`;
}
includeAll(e = !0) {
return this.query["include-all"] = e, this;
}
}
class g extends o.Z {
constructor(e, t, r) {
super(e, t), this.index = r, this.index = r;
}
path() {
return `/v2/applications/${this.index}`;
}
includeAll(e = !0) {
return this.query["include-all"] = e, this;
}
}
class y extends o.Z {
constructor(e, t, r) {
super(e, t), this.appID = r, this.appID = r;
}
path() {
return `/v2/applications/${this.appID}/logs`;
}
limit(e) {
return this.query.limit = e, this;
}
minRound(e) {
return this.query["min-round"] = e, this;
}
maxRound(e) {
return this.query["max-round"] = e, this;
}
nextToken(e) {
return this.query.next = e, this;
}
sender(e) {
return this.query["sender-address"] = e, this;
}
txid(e) {
return this.query.txid = e, this;
}
}
class m extends o.Z {
path() {
return "/v2/accounts";
}
currencyGreaterThan(e) {
return this.query["currency-greater-than"] = e, this;
}
currencyLessThan(e) {
return this.query["currency-less-than"] = e, this;
}
limit(e) {
return this.query.limit = e, this;
}
assetID(e) {
return this.query["asset-id"] = e, this;
}
nextToken(e) {
return this.query.next = e, this;
}
round(e) {
return this.query.round = e, this;
}
authAddr(e) {
return this.query["auth-addr"] = e, this;
}
applicationID(e) {
return this.query["application-id"] = e, this;
}
includeAll(e = !0) {
return this.query["include-all"] = e, this;
}
}
class b extends o.Z {
path() {
return "/v2/transactions";
}
notePrefix(e) {
return this.query["note-prefix"] = c(e), this;
}
txType(e) {
return this.query["tx-type"] = e, this;
}
sigType(e) {
return this.query["sig-type"] = e, this;
}
txid(e) {
return this.query.txid = e, this;
}
round(e) {
return this.query.round = e, this;
}
minRound(e) {
return this.query["min-round"] = e, this;
}
maxRound(e) {
return this.query["max-round"] = e, this;
}
assetID(e) {
return this.query["asset-id"] = e, this;
}
limit(e) {
return this.query.limit = e, this;
}
beforeTime(e) {
return this.query["before-time"] = e, this;
}
afterTime(e) {
return this.query["after-time"] = e, this;
}
currencyGreaterThan(e) {
return this.query["currency-greater-than"] = e, this;
}
currencyLessThan(e) {
return this.query["currency-less-than"] = e, this;
}
addressRole(e) {
return this.query["address-role"] = e, this;
}
address(e) {
return this.query.address = e, this;
}
excludeCloseTo(e) {
return this.query["exclude-close-to"] = e, this;
}
nextToken(e) {
return this.query.next = e, this;
}
rekeyTo(e) {
return this.query["rekey-to"] = e, this;
}
applicationID(e) {
return this.query["application-id"] = e, this;
}
}
class w extends o.Z {
path() {
return "/v2/assets";
}
limit(e) {
return this.query.limit = e, this;
}
creator(e) {
return this.query.creator = e, this;
}
name(e) {
return this.query.name = e, this;
}
unit(e) {
return this.query.unit = e, this;
}
index(e) {
return this.query["asset-id"] = e, this;
}
nextToken(e) {
return this.query.next = e, this;
}
includeAll(e = !0) {
return this.query["include-all"] = e, this;
}
}
class A extends o.Z {
path() {
return "/v2/applications";
}
index(e) {
return this.query["application-id"] = e, this;
}
nextToken(e) {
return this.query.next = e, this;
}
limit(e) {
return this.query.limit = e, this;
}
includeAll(e = !0) {
return this.query["include-all"] = e, this;
}
}
class v extends n.Z {
constructor(e, t = "http://127.0.0.1", r = 8080, n = {}) {
super("X-Indexer-API-Token", e, t, r, n);
}
makeHealthCheck() {
return new s(this.c, this.intDecoding);
}
lookupAssetBalances(e) {
return new i(this.c, this.intDecoding, e);
}
lookupAssetTransactions(e) {
return new l(this.c, this.intDecoding, e);
}
lookupAccountTransactions(e) {
return new u(this.c, this.intDecoding, e);
}
lookupBlock(e) {
return new h(this.c, this.intDecoding, e);
}
lookupTransactionByID(e) {
return new p(this.c, this.intDecoding, e);
}
lookupAccountByID(e) {
return new f(this.c, this.intDecoding, e);
}
lookupAssetByID(e) {
return new d(this.c, this.intDecoding, e);
}
lookupApplications(e) {
return new g(this.c, this.intDecoding, e);
}
lookupApplicationLogs(e) {
return new y(this.c, this.intDecoding, e);
}
searchAccounts() {
return new m(this.c, this.intDecoding);
}
searchForTransactions() {
return new b(this.c, this.intDecoding);
}
searchForAssets() {
return new w(this.c, this.intDecoding);
}
searchForApplications() {
return new A(this.c, this.intDecoding);
}
}
},
8680: (e, t, r) => {
"use strict";
r.d(t, {
Z: () => o
});
var n = r(7197);
class o {
constructor(e, t) {
this.c = e, this.query = {}, this.intDecoding = t || n.Z.DEFAULT;
}
prepare(e) {
return e;
}
async do(e = {}) {
const t = {};
"default" !== this.intDecoding && (t.intDecoding = this.intDecoding);
const r = await this.c.get(this.path(), this.query, e, t);
return this.prepare(r.body);
}
setIntDecoding(e) {
if ("default" !== e && "safe" !== e && "mixed" !== e && "bigint" !== e) throw new Error(`Invalid method for int decoding: ${e}`);
return this.intDecoding = e, this;
}
}
},
3480: (e, t, r) => {
"use strict";
r.d(t, {
Z: () => s
});
var n = r(1113),
o = r(7197);
class s {
constructor(e, t, r, s, i = {}) {
if ("function" == typeof t.get) this.c = new n.default(t);else {
let o;
o = "string" == typeof t ? function (e = "", t) {
const r = {};
return r[t] = e, r;
}(t, e) : t, this.c = new n.default(o, r, s, i);
}
this.intDecoding = o.Z.DEFAULT;
}
setIntEncoding(e) {
this.intDecoding = e;
}
getIntEncoding() {
return this.intDecoding;
}
}
},
3458: (e, t, r) => {
"use strict";
r.d(t, {
b: () => p,
A: () => d
});
var n = r(3410),
o = r(9417),
s = r(1988),
i = r(1063),
a = r(5062),
c = r(834),
u = r(1624),
l = r(2486).Buffer;
const h = l.from([21, 31, 124, 117]);
var p;
function f(e, t, r) {
if (null != r && e === r) return 0;
const n = null == r ? 0 : 1;
for (let r = 0; r < t.length; r++) if (e === t[r]) return r + n;
return t.push(e), t.length - 1 + n;
}
!function (e) {
e[e.BUILDING = 0] = "BUILDING", e[e.BUILT = 1] = "BUILT", e[e.SIGNED = 2] = "SIGNED", e[e.SUBMITTED = 3] = "SUBMITTED", e[e.COMMITTED = 4] = "COMMITTED";
}(p || (p = {}));
class d {
constructor() {
this.status = p.BUILDING, this.transactions = [], this.methodCalls = new Map(), this.signedTxns = [], this.txIDs = [];
}
getStatus() {
return this.status;
}
count() {
return this.transactions.length;
}
clone() {
const e = new d();
return e.transactions = this.transactions.map(({
txn: e,
signer: t
}) => ({
txn: o.Transaction.from_obj_for_encoding({ ...e.get_obj_for_encoding(),
grp: void 0
}),
signer: t
})), e.methodCalls = new Map(this.methodCalls), e;
}
addTransaction(e) {
if (this.status !== p.BUILDING) throw new Error("Cannot add transactions when composer status is not BUILDING");
if (this.transactions.length === d.MAX_GROUP_SIZE) throw new Error(`Adding an additional transaction exceeds the maximum atomic group size of ${d.MAX_GROUP_SIZE}`);
if (e.txn.group && e.txn.group.some(e => 0 !== e)) throw new Error("Cannot add a transaction with nonzero group ID");
this.transactions.push(e);
}
addMethodCall({
appID: e,
method: t,
methodArgs: r,
sender: o,
suggestedParams: i,
onComplete: a,
approvalProgram: l,
clearProgram: h,
numGlobalInts: g,
numGlobalByteSlices: y,
numLocalInts: m,
numLocalByteSlices: b,
extraPages: w,
note: A,
lease: v,
rekeyTo: x,
signer: S
}) {
if (this.status !== p.BUILDING) throw new Error("Cannot add transactions when composer status is not BUILDING");
if (this.transactions.length + t.txnCount() > d.MAX_GROUP_SIZE) throw new Error(`Adding additional transactions exceeds the maximum atomic group size of ${d.MAX_GROUP_SIZE}`);
if (0 === e) {
if (null == l || null == h || null == g || null == y || null == m || null == b) throw new Error("One of the following required parameters for application creation is missing: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices");
} else if (a === u.h.UpdateApplicationOC) {
if (null == l || null == h) throw new Error("One of the following required parameters for OnApplicationComplete.UpdateApplicationOC is missing: approvalProgram, clearProgram");
if (null != g || null != y || null != m || null != b || null != w) throw new Error("One of the following application creation parameters were set on a non-creation call: numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages");
} else if (null != l || null != h || null != g || null != y || null != m || null != b || null != w) throw new Error("One of the following application creation parameters were set on a non-creation call: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages");
if (null == r && (r = []), r.length !== t.args.length) throw new Error(`Incorrect number of method arguments. Expected ${t.args.length}, got ${r.length}`);
let E = [],
T = [];
const _ = [],
B = [],
k = [],
I = new Map();
for (let e = 0; e < r.length; e++) {
let o = t.args[e].type;
const s = r[e];
if ((0, n.AE)(o)) {
if (!(0, c.Xw)(s) || !(0, n.vJ)(o, s.txn)) throw new Error(`Expected ${o} transaction for argument at index ${e}`);
if (s.txn.group && s.txn.group.some(e => 0 !== e)) throw new Error("Cannot add a transaction with nonzero group ID");
_.push(s);
} else {
if ((0, c.Xw)(s)) throw new Error(`Expected non-transaction value for argument at index ${e}`);
if ((0, n.o5)(o) && (I.set(B.length, E.length), B.push(o), k.push(s), o = new n.Pu(8)), "string" == typeof o) throw new Error(`Unknown ABI type: ${o}`);
E.push(o), T.push(s);
}
}
const U = [],
C = [],
R = [],
O = [];
for (let t = 0; t < B.length; t++) {
const r = B[t],
s = k[t];
let i = 0;
switch (r) {
case n.UV.account:
{
const e = new n.JQ();
i = f(e.decode(e.encode(s)), C, o);
break;
}
case n.UV.application:
{
const t = new n.Pu(64),
r = t.decode(t.encode(s));
if (r > Number.MAX_SAFE_INTEGER) throw new Error(`Expected safe integer for application value, got ${r}`);
i = f(Number(r), R, e);
break;
}
case n.UV.asset:
{
const e = new n.Pu(64),
t = e.decode(e.encode(s));
if (t > Number.MAX_SAFE_INTEGER) throw new Error(`Expected safe integer for asset value, got ${t}`);
i = f(Number(t), O);
break;
}
default:
throw new Error(`Unknown reference type: ${r}`);
}
U.push(i);
}
for (let e = 0; e < U.length; e++) T[I.get(e)] = U[e];
if (E.length > 15) {
const e = E.slice(14),
t = T.slice(14);
E = E.slice(0, 14), T = T.slice(0, 14), E.push(new n.w1(e)), T.push(t);
}
const D = [t.getSelector()];
for (let e = 0; e < E.length; e++) D.push(E[e].encode(T[e]));
const N = {
txn: (0, s.makeApplicationCallTxnFromObject)({
from: o,
appIndex: e,
appArgs: D,
accounts: C,
foreignApps: R,
foreignAssets: O,
onComplete: null == a ? u.h.NoOpOC : a,
approvalProgram: l,
clearProgram: h,
numGlobalInts: g,
numGlobalByteSlices: y,
numLocalInts: m,
numLocalByteSlices: b,
extraPages: w,
lease: v,
note: A,
rekeyTo: x,
suggestedParams: i
}),
signer: S
};
this.transactions.push(..._, N), this.methodCalls.set(this.transactions.length - 1, t);
}
buildGroup() {
if (this.status === p.BUILDING) {
if (0 === this.transactions.length) throw new Error("Cannot build a group with 0 transactions");
this.transactions.length > 1 && (0, i.assignGroupID)(this.transactions.map(e => e.txn)), this.status = p.BUILT;
}
return this.transactions;
}
async gatherSignatures() {
if (this.status >= p.SIGNED) return this.signedTxns;
const e = this.buildGroup(),
t = e.map(e => e.txn),
r = new Map();
for (let t = 0; t < e.length; t++) {
const {
signer: n
} = e[t];
r.has(n) || r.set(n, []), r.get(n).push(t);
}
const n = Array.from(r),
s = await Promise.all(n.map(([e, r]) => e(t, r))),
i = e.map(() => null);
for (let e = 0; e < n.length; e++) {
const t = n[e][1],
r = s[e];
for (let e = 0; e < t.length; e++) i[t[e]] = r[e];
}
if (!i.every(e => null != e)) throw new Error(`Missing signatures. Got ${i}`);
const a = i.map((e, t) => {
try {
return (0, o.decodeSignedTransaction)(e).txn.txID();
} catch (e) {
throw new Error(`Cannot decode signed transaction at index ${t}. ${e}`);
}
});
return this.signedTxns = i, this.txIDs = a, this.status = p.SIGNED, i;
}
async submit(e) {
if (this.status > p.SUBMITTED) throw new Error("Transaction group cannot be resubmitted");
const t = await this.gatherSignatures();
return await e.sendRawTransaction(t).do(), this.status = p.SUBMITTED, this.txIDs;
}
async execute(e, t) {
if (this.status === p.COMMITTED) throw new Error("Transaction group has already been executed successfully");
const r = await this.submit(e);
this.status = p.SUBMITTED;
const n = this.transactions.findIndex((e, t) => this.methodCalls.has(t)),
o = -1 === n ? 0 : n,
s = await (0, a.K)(e, r[o], t);
this.status = p.COMMITTED;
const i = s["confirmed-round"],
c = [];
for (const [t, o] of this.methodCalls) {
const i = r[t],
a = {
txID: i,
rawReturnValue: new Uint8Array()
};
try {
if ("void" !== o.returns.type) {
const r = (t === n ? s : await e.pendingTransactionInformation(i).do()).logs || [];
if (0 === r.length) throw new Error("App call transaction did not log a return value");
const c = l.from(r[r.length - 1], "base64");
if (c.byteLength < 4 || !c.slice(0, 4).equals(h)) throw new Error("App call transaction did not log a return value");
a.rawReturnValue = new Uint8Array(c.slice(4)), a.returnValue = o.returns.type.decode(a.rawReturnValue);
}
} catch (e) {
a.decodeError = e;
}
c.push(a);
}
return {
confirmedRound: i,
txIDs: r,
methodResults: c
};
}
}
d.MAX_GROUP_SIZE = 16;
},
9070: (e, t, r) => {
"use strict";
r.d(t, {
rD: () => o,
_: () => s,
HN: () => i
});
const n = 1e6,
o = "Microalgos should be positive and less than 2^53 - 1.";
function s(e) {
if (e < 0 || !Number.isSafeInteger(e)) throw new Error(o);
return e / n;
}
function i(e) {
const t = e * n;
return Math.round(t);
}
},
4383: (e, t, r) => {
"use strict";
r.d(t, {
P: () => c
});
var n = r(227),
o = r(1824),
s = r(7116),
i = r(2486).Buffer;
function a(e) {
return e.params["approval-program"] = i.from(e.params["approval-program"].toString(), "base64"), e.params["clear-state-program"] = i.from(e.params["clear-state-program"].toString(), "base64"), e;
}
async function c({
client: e,
txns: t,
protocolVersion: r,
latestTimestamp: i,
round: c,
sources: u
}) {
const l = [],
h = [],
p = [],
f = [],
d = [];
for (const e of t) e.txn.type === o.i.appl && (d.push((0, s.encodeAddress)(e.txn.from.publicKey)), e.txn.appAccounts && d.push(...e.txn.appAccounts.map(e => (0, s.encodeAddress)(e.publicKey))), e.txn.appForeignApps && p.push(...e.txn.appForeignApps), e.txn.appForeignAssets && f.push(...e.txn.appForeignAssets), 0 === e.txn.appIndex ? l.push(new n.Application(1380011588, new n.ApplicationParams({
creator: (0, s.encodeAddress)(e.txn.from.publicKey),
approvalProgram: e.txn.appApprovalProgram,
clearStateProgram: e.txn.appClearProgram,
localStateSchema: new n.ApplicationStateSchema(e.txn.appLocalInts, e.txn.appLocalByteSlices),
globalStateSchema: new n.ApplicationStateSchema(e.txn.appGlobalInts, e.txn.appGlobalByteSlices)
}))) : (p.push(e.txn.appIndex), d.push((0, s.getApplicationAddress)(e.txn.appIndex))));
const g = [];
for (const t of [...new Set(f)]) g.push(e.getAssetByID(t).do().then(e => {
d.push(e.params.creator);
}));
await Promise.all(g);
const y = [];
for (const t of [...new Set(p)]) y.push(e.getApplicationByID(t).do().then(e => {
const t = a(e);
l.push(t);
}));
const m = [];
for (const t of [...new Set(d)]) m.push(e.accountInformation(t).do().then(e => {
"created-apps" in e && (e["created-apps"] = e["created-apps"].map(e => a(e))), h.push(e);
}));
return await Promise.all([...y, ...m]), new n.DryrunRequest({
txns: t.map(e => ({ ...e,
txn: e.txn.get_obj_for_encoding()
})),
accounts: h,
apps: l,
latestTimestamp: i,
round: c,
protocolVersion: r,
sources: u
});
}
},
7116: (e, t, r) => {
"use strict";
r.r(t), r.d(t, {
ALGORAND_ZERO_ADDRESS_STRING: () => u,
MALFORMED_ADDRESS_ERROR_MSG: () => p,
CHECKSUM_ADDRESS_ERROR_MSG: () => f,
INVALID_MSIG_VERSION_ERROR_MSG: () => d,
INVALID_MSIG_THRESHOLD_ERROR_MSG: () => g,
INVALID_MSIG_PK_ERROR_MSG: () => y,
UNEXPECTED_PK_LEN_ERROR_MSG: () => m,
decodeAddress: () => b,
isValidAddress: () => w,
encodeAddress: () => A,
fromMultisigPreImg: () => v,
fromMultisigPreImgAddrs: () => x,
getApplicationAddress: () => S
});
var n = r(7267),
o = r.n(n),
s = r(9404),
i = r(413),
a = r(6963),
c = r(2486).Buffer;
const u = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ",
l = new Uint8Array([77, 117, 108, 116, 105, 115, 105, 103, 65, 100, 100, 114]),
h = c.from("appID"),
p = "address seems to be malformed",
f = "wrong checksum for address",
d = "invalid multisig version",
g = "bad multisig threshold",
y = "bad multisig public key - wrong length",
m = "nacl public key length is not 32 bytes";
function b(e) {
if ("string" != typeof e || 58 !== e.length) throw new Error(p);
const t = o().decode.asBytes(e.toString());
if (36 !== t.length) throw new Error(p);
const r = new Uint8Array(t.slice(0, 32)),
n = new Uint8Array(t.slice(s.PUBLIC_KEY_LENGTH, 36)),
a = s.genericHash(r).slice(s.HASH_BYTES_LENGTH - 4, s.HASH_BYTES_LENGTH);
if (!i.arrayEqual(a, n)) throw new Error(f);
return {
publicKey: r,
checksum: n
};
}
function w(e) {
try {
b(e);
} catch (e) {
return !1;
}
return !0;
}
function A(e) {
const t = s.genericHash(e).slice(s.PUBLIC_KEY_LENGTH - 4, s.PUBLIC_KEY_LENGTH);
return o().encode(i.concatArrays(e, t)).toString().slice(0, 58);
}
function v({
version: e,
threshold: t,
pks: r
}) {
if (1 !== e || e > 255 || e < 0) throw new Error(d);
if (0 === t || 0 === r.length || t > r.length || t > 255) throw new Error(g);
if (32 !== s.PUBLIC_KEY_LENGTH) throw new Error(m);
const n = new Uint8Array(l.length + 2 + 32 * r.length);
n.set(l, 0), n.set([e], l.length), n.set([t], l.length + 1);
for (let e = 0; e < r.length; e++) {
if (32 !== r[e].length) throw new Error(y);
n.set(r[e], l.length + 2 + 32 * e);
}
return new Uint8Array(s.genericHash(n));
}
function x({
version: e,
threshold: t,
addrs: r
}) {
return A(v({
version: e,
threshold: t,
pks: r.map(e => b(e).publicKey)
}));
}
function S(e) {
const t = i.concatArrays(h, (0, a.T)(e)),
r = s.genericHash(t);
return A(new Uint8Array(r));
}
},
3033: (e, t, r) => {
"use strict";
r.r(t), r.d(t, {
ERROR_CONTAINS_EMPTY_STRING: () => o,
encode: () => s,
decode: () => i
});
var n = r(5406);
const o = "The object contains empty or 0 values. First empty or 0 value encountered during encoding: ";
function s(e) {
const t = function (e) {
for (const t in e) if (Object.prototype.hasOwnProperty.call(e, t) && (!e[t] || 0 === e[t].length)) return {
containsEmpty: !0,
firstEmptyKey: t
};
return {
containsEmpty: !1,
firstEmptyKey: void 0
};
}(e);
if (t.containsEmpty) throw new Error(o + t.firstEmptyKey);
return n.encode(e, {
sortKeys: !0
});
}
function i(e) {
return n.decode(e);
}
},
6963: (e, t, r) => {
"use strict";
r.d(t, {
T: () => o,
u: () => s
});
var n = r(2486).Buffer;
function o(e) {
if ("bigint" != typeof e && !Number.isInteger(e) || e < 0 || e > BigInt("0xffffffffffffffff")) throw new Error("Input is not a 64-bit unsigned integer");
const t = n.allocUnsafe(8);
return t.writeBigUInt64BE(BigInt(e)), new Uint8Array(t);
}
function s(e, t = "safe") {
if ("safe" !== t && "mixed" !== t && "bigint" !== t) throw new Error(`Unknown decodingMode option: ${t}`);
if (0 === e.byteLength || e.byteLength > 8) throw new Error(`Data has unacceptable length. Expected length is between 1 and 8, got ${e.byteLength}`);
const r = n.allocUnsafe(8 - e.byteLength);
r.fill(0);
const o = n.concat([r, n.from(e)]).readBigUInt64BE(),
s = o > Number.MAX_SAFE_INTEGER;
if ("safe" === t) {
if (s) throw new Error(`Integer exceeds maximum safe integer: ${o.toString()}. Try decoding with "mixed" or "safe" decodingMode.`);
return Number(o);
}
return "mixed" !== t || s ? o : Number(o);
}
},
1063: (e, t, r) => {
"use strict";
r.r(t), r.d(t, {
TxGroup: () => u,
computeGroupID: () => l,
assignGroupID: () => h,
default: () => p
});
var n = r(9417),
o = r(9404),
s = r(3033),
i = r(7116),
a = r(413),
c = r(2486).Buffer;
class u {
constructor(e) {
if (this.name = "Transaction group", this.tag = c.from("TG"), e.length > 16) {
const t = `${e.length.toString()} transactions grouped together but max group size is ${16..toString()}`;
throw Error(t);
}
this.txGroupHashes = e;
}
get_obj_for_encoding() {
return {
txlist: this.txGroupHashes
};
}
static from_obj_for_encoding(e) {
const t = Object.create(this.prototype);
t.name = "Transaction group", t.tag = c.from("TG"), t.txGroupHashes = [];
for (const r of e.txlist) t.txGroupHashes.push(c.from(r));
return t;
}
toByte() {
return s.encode(this.get_obj_for_encoding());
}
}
function l(e) {
const t = [];
for (const r of e) {
const e = n.instantiateTxnIfNeeded(r);
t.push(e.rawTxID());
}
const r = new u(t),
s = r.toByte(),
i = c.from(a.concatArrays(r.tag, s)),
l = o.genericHash(i);
return c.from(l);
}
function h(e, t) {
const r = l(e),
o = [];
for (const s of e) {
const e = n.instantiateTxnIfNeeded(s);
t && i.encodeAddress(e.from.publicKey) !== t || (e.group = r, o.push(e));
}
return o;
}
const p = u;
},
5583: (e, t, r) => {
"use strict";
r.r(t), r.d(t, {
checkByteConstBlock: () => f,
checkIntConstBlock: () => p,
checkProgram: () => h,
checkPushByteOp: () => g,
checkPushIntOp: () => d,
langspecEvalMaxVersion: () => y,
langspecLogicSigVersion: () => m,
parseUvarint: () => s,
readProgram: () => l
});
const n = JSON.parse('{"z_":5,"BV":5,"AP":[{"Opcode":0,"Name":"err","Cost":1,"Size":1,"Doc":"Error. Fail immediately. This is primarily a fencepost against accidental zero bytes getting compiled into programs.","Groups":["Flow Control"]},{"Opcode":1,"Name":"sha256","Args":"B","Returns":"B","Cost":35,"Size":1,"Doc":"SHA256 hash of value X, yields [32]byte","Groups":["Arithmetic"]},{"Opcode":2,"Name":"keccak256","Args":"B","Returns":"B","Cost":130,"Size":1,"Doc":"Keccak256 hash of value X, yields [32]byte","Groups":["Arithmetic"]},{"Opcode":3,"Name":"sha512_256","Args":"B","Returns":"B","Cost":45,"Size":1,"Doc":"SHA512_256 hash of value X, yields [32]byte","Groups":["Arithmetic"]},{"Opcode":4,"Name":"ed25519verify","Args":"BBB","Returns":"U","Cost":1900,"Size":1,"Doc":"for (data A, signature B, pubkey C) verify the signature of (\\"ProgData\\" || program_hash || data) against the pubkey => {0 or 1}","DocExtra":"The 32 byte public key is the last element on the stack, preceded by the 64 byte signature at the second-to-last element on the stack, preceded by the data which was signed at the third-to-last element on the stack.","Groups":["Arithmetic"]},{"Opcode":5,"Name":"ecdsa_verify","Args":"BBBBB","Returns":"U","Cost":1700,"Size":2,"Doc":"for (data A, signature B, C and pubkey D, E) verify the signature of the data against the pubkey => {0 or 1}","DocExtra":"The 32 byte Y-component of a public key is the last element on the stack, preceded by X-component of a pubkey, preceded by S and R components of a signature, preceded by the data that is fifth element on the stack. All values are big-endian encoded. The signed data must be 32 bytes long, and signatures in lower-S form are only accepted.","ImmediateNote":"{uint8 curve index}","Groups":["Arithmetic"]},{"Opcode":6,"Name":"ecdsa_pk_decompress","Args":"B","Returns":"BB","Cost":650,"Size":2,"Doc":"decompress pubkey A into components X, Y => [*... stack*, X, Y]","DocExtra":"The 33 byte public key in a compressed form to be decompressed into X and Y (top) components. All values are big-endian encoded.","ImmediateNote":"{uint8 curve index}","Groups":["Arithmetic"]},{"Opcode":7,"Name":"ecdsa_pk_recover","Args":"BUBB","Returns":"BB","Cost":2000,"Size":2,"Doc":"for (data A, recovery id B, signature C, D) recover a public key => [*... stack*, X, Y]","DocExtra":"S (top) and R elements of a signature, recovery id and data (bottom) are expected on the stack and used to deriver a public key. All values are big-endian encoded. The signed data must be 32 bytes long.","ImmediateNote":"{uint8 curve index}","Groups":["Arithmetic"]},{"Opcode":8,"Name":"+","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A plus B. Fail on overflow.","DocExtra":"Overflow is an error condition which halts execution and fails the transaction. Full precision is available from `addw`.","Groups":["Arithmetic"]},{"Opcode":9,"Name":"-","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A minus B. Fail if B > A.","Groups":["Arithmetic"]},{"Opcode":10,"Name":"/","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A divided by B (truncated division). Fail if B == 0.","DocExtra":"`divmodw` is available to divide the two-element values produced by `mulw` and `addw`.","Groups":["Arithmetic"]},{"Opcode":11,"Name":"*","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A times B. Fail on overflow.","DocExtra":"Overflow is an error condition which halts execution and fails the transaction. Full precision is available from `mulw`.","Groups":["Arithmetic"]},{"Opcode":12,"Name":"<","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A less than B => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":13,"Name":">","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A greater than B => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":14,"Name":"<=","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A less than or equal to B => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":15,"Name":">=","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A greater than or equal to B => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":16,"Name":"&&","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A is not zero and B is not zero => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":17,"Name":"||","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A is not zero or B is not zero => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":18,"Name":"==","Args":"..","Returns":"U","Cost":1,"Size":1,"Doc":"A is equal to B => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":19,"Name":"!=","Args":"..","Returns":"U","Cost":1,"Size":1,"Doc":"A is not equal to B => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":20,"Name":"!","Args":"U","Returns":"U","Cost":1,"Size":1,"Doc":"X == 0 yields 1; else 0","Groups":["Arithmetic"]},{"Opcode":21,"Name":"len","Args":"B","Returns":"U","Cost":1,"Size":1,"Doc":"yields length of byte value X","Groups":["Arithmetic"]},{"Opcode":22,"Name":"itob","Args":"U","Returns":"B","Cost":1,"Size":1,"Doc":"converts uint64 X to big endian bytes","Groups":["Arithmetic"]},{"Opcode":23,"Name":"btoi","Args":"B","Returns":"U","Cost":1,"Size":1,"Doc":"converts bytes X as big endian to uint64","DocExtra":"`btoi` fails if the input is longer than 8 bytes.","Groups":["Arithmetic"]},{"Opcode":24,"Name":"%","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A modulo B. Fail if B == 0.","Groups":["Arithmetic"]},{"Opcode":25,"Name":"|","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A bitwise-or B","Groups":["Arithmetic"]},{"Opcode":26,"Name":"&","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A bitwise-and B","Groups":["Arithmetic"]},{"Opcode":27,"Name":"^","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A bitwise-xor B","Groups":["Arithmetic"]},{"Opcode":28,"Name":"~","Args":"U","Returns":"U","Cost":1,"Size":1,"Doc":"bitwise invert value X","Groups":["Arithmetic"]},{"Opcode":29,"Name":"mulw","Args":"UU","Returns":"UU","Cost":1,"Size":1,"Doc":"A times B out to 128-bit long result as low (top) and high uint64 values on the stack","Groups":["Arithmetic"]},{"Opcode":30,"Name":"addw","Args":"UU","Returns":"UU","Cost":1,"Size":1,"Doc":"A plus B out to 128-bit long result as sum (top) and carry-bit uint64 values on the stack","Groups":["Arithmetic"]},{"Opcode":31,"Name":"divmodw","Args":"UUUU","Returns":"UUUU","Cost":20,"Size":1,"Doc":"Pop four uint64 values. The deepest two are interpreted as a uint128 dividend (deepest value is high word), the top two are interpreted as a uint128 divisor. Four uint64 values are pushed to the stack. The deepest two are the quotient (deeper value is the high uint64). The top two are the remainder, low bits on top.","Groups":["Arithmetic"]},{"Opcode":32,"Name":"intcblock","Cost":1,"Size":0,"Doc":"prepare block of uint64 constants for use by intc","DocExtra":"`intcblock` loads following program bytes into an array of integer constants in the evaluator. These integer constants can be referred to by `intc` and `intc_*` which will push the value onto the stack. Subsequent calls to `intcblock` reset and replace the integer constants available to the script.","ImmediateNote":"{varuint length} [{varuint value}, ...]","Groups":["Loading Values"]},{"Opcode":33,"Name":"intc","Returns":"U","Cost":1,"Size":2,"Doc":"push Ith constant from intcblock to stack","ImmediateNote":"{uint8 int constant index}","Groups":["Loading Values"]},{"Opcode":34,"Name":"intc_0","Returns":"U","Cost":1,"Size":1,"Doc":"push constant 0 from intcblock to stack","Groups":["Loading Values"]},{"Opcode":35,"Name":"intc_1","Returns":"U","Cost":1,"Size":1,"Doc":"push constant 1 from intcblock to stack","Groups":["Loading Values"]},{"Opcode":36,"Name":"intc_2","Returns":"U","Cost":1,"Size":1,"Doc":"push constant 2 from intcblock to stack","Groups":["Loading Values"]},{"Opcode":37,"Name":"intc_3","Returns":"U","Cost":1,"Size":1,"Doc":"push constant 3 from intcblock to stack","Groups":["Loading Values"]},{"Opcode":38,"Name":"bytecblock","Cost":1,"Size":0,"Doc":"prepare block of byte-array constants for use by bytec","DocExtra":"`bytecblock` loads the following program bytes into an array of byte-array constants in the evaluator. These constants can be referred to by `bytec` and `bytec_*` which will push the value onto the stack. Subsequent calls to `bytecblock` reset and replace the bytes constants available to the script.","ImmediateNote":"{varuint length} [({varuint value length} bytes), ...]","Groups":["Loading Values"]},{"Opcode":39,"Name":"bytec","Returns":"B","Cost":1,"Size":2,"Doc":"push Ith constant from bytecblock to stack","ImmediateNote":"{uint8 byte constant index}","Groups":["Loading Values"]},{"Opcode":40,"Name":"bytec_0","Returns":"B","Cost":1,"Size":1,"Doc":"push constant 0 from bytecblock to stack","Groups":["Loading Values"]},{"Opcode":41,"Name":"bytec_1","Returns":"B","Cost":1,"Size":1,"Doc":"push constant 1 from bytecblock to stack","Groups":["Loading Values"]},{"Opcode":42,"Name":"bytec_2","Returns":"B","Cost":1,"Size":1,"Doc":"push constant 2 from bytecblock to stack","Groups":["Loading Values"]},{"Opcode":43,"Name":"bytec_3","Returns":"B","Cost":1,"Size":1,"Doc":"push constant 3 from bytecblock to stack","Groups":["Loading Values"]},{"Opcode":44,"Name":"arg","Returns":"B","Cost":1,"Size":2,"Doc":"push Nth LogicSig argument to stack","ImmediateNote":"{uint8 arg index N}","Groups":["Loading Values"]},{"Opcode":45,"Name":"arg_0","Returns":"B","Cost":1,"Size":1,"Doc":"push LogicSig argument 0 to stack","Groups":["Loading Values"]},{"Opcode":46,"Name":"arg_1","Returns":"B","Cost":1,"Size":1,"Doc":"push LogicSig argument 1 to stack","Groups":["Loading Values"]},{"Opcode":47,"Name":"arg_2","Returns":"B","Cost":1,"Size":1,"Doc":"push LogicSig argument 2 to stack","Groups":["Loading Values"]},{"Opcode":48,"Name":"arg_3","Returns":"B","Cost":1,"Size":1,"Doc":"push LogicSig argument 3 to stack","Groups":["Loading Values"]},{"Opcode":49,"Name":"txn","Returns":".","Cost":1,"Size":2,"ArgEnum":["Sender","Fee","FirstValid","FirstValidTime","LastValid","Note","Lease","Receiver","Amount","CloseRemainderTo","VotePK","SelectionPK","VoteFirst","VoteLast","VoteKeyDilution","Type","TypeEnum","XferAsset","AssetAmount","AssetSender","AssetReceiver","AssetCloseTo","GroupIndex","TxID","ApplicationID","OnCompletion","ApplicationArgs","NumAppArgs","Accounts","NumAccounts","ApprovalProgram","ClearStateProgram","RekeyTo","ConfigAsset","ConfigAssetTotal","ConfigAssetDecimals","ConfigAssetDefaultFrozen","ConfigAssetUnitName","ConfigAssetName","ConfigAssetURL","ConfigAssetMetadataHash","ConfigAssetManager","ConfigAssetReserve","ConfigAssetFreeze","ConfigAssetClawback","FreezeAsset","FreezeAssetAccount","FreezeAssetFrozen","Assets","NumAssets","Applications","NumApplications","GlobalNumUint","GlobalNumByteSlice","LocalNumUint","LocalNumByteSlice","ExtraProgramPages","Nonparticipation","Logs","NumLogs","CreatedAssetID","CreatedApplicationID"],"ArgEnumTypes":"BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUUUBUUU","Doc":"push field F of current transaction to stack","DocExtra":"FirstValidTime causes the program to fail. The field is reserved for future use.","ImmediateNote":"{uint8 transaction field index}","Groups":["Loading Values"]},{"Opcode":50,"Name":"global","Returns":".","Cost":1,"Size":2,"ArgEnum":["MinTxnFee","MinBalance","MaxTxnLife","ZeroAddress","GroupSize","LogicSigVersion","Round","LatestTimestamp","CurrentApplicationID","CreatorAddress","CurrentApplicationAddress","GroupID"],"ArgEnumTypes":"UUUBUUUUUBBB","Doc":"push value from globals to stack","ImmediateNote":"{uint8 global field index}","Groups":["Loading Values"]},{"Opcode":51,"Name":"gtxn","Returns":".","Cost":1,"Size":3,"ArgEnum":["Sender","Fee","FirstValid","FirstValidTime","LastValid","Note","Lease","Receiver","Amount","CloseRemainderTo","VotePK","SelectionPK","VoteFirst","VoteLast","VoteKeyDilution","Type","TypeEnum","XferAsset","AssetAmount","AssetSender","AssetReceiver","AssetCloseTo","GroupIndex","TxID","ApplicationID","OnCompletion","ApplicationArgs","NumAppArgs","Accounts","NumAccounts","ApprovalProgram","ClearStateProgram","RekeyTo","ConfigAsset","ConfigAssetTotal","ConfigAssetDecimals","ConfigAssetDefaultFrozen","ConfigAssetUnitName","ConfigAssetName","ConfigAssetURL","ConfigAssetMetadataHash","ConfigAssetManager","ConfigAssetReserve","ConfigAssetFreeze","ConfigAssetClawback","FreezeAsset","FreezeAssetAccount","FreezeAssetFrozen","Assets","NumAssets","Applications","NumApplications","GlobalNumUint","GlobalNumByteSlice","LocalNumUint","LocalNumByteSlice","ExtraProgramPages","Nonparticipation","Logs","NumLogs","CreatedAssetID","CreatedApplicationID"],"ArgEnumTypes":"BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUUUBUUU","Doc":"push field F of the Tth transaction in the current group","DocExtra":"for notes on transaction fields available, see `txn`. If this transaction is _i_ in the group, `gtxn i field` is equivalent to `txn field`.","ImmediateNote":"{uint8 transaction group index} {uint8 transaction field index}","Groups":["Loading Values"]},{"Opcode":52,"Name":"load","Returns":".","Cost":1,"Size":2,"Doc":"copy a value from scratch space to the stack. All scratch spaces are 0 at program start.","ImmediateNote":"{uint8 position in scratch space to load from}","Groups":["Loading Values"]},{"Opcode":53,"Name":"store","Args":".","Cost":1,"Size":2,"Doc":"pop value X. store X to the Ith scratch space","ImmediateNote":"{uint8 position in scratch space to store to}","Groups":["Loading Values"]},{"Opcode":54,"Name":"txna","Returns":".","Cost":1,"Size":3,"ArgEnum":["ApplicationArgs","Accounts","Assets","Applications","Logs"],"ArgEnumTypes":"BBUUB","Doc":"push Ith value of the array field F of the current transaction","ImmediateNote":"{uint8 transaction field index} {uint8 transaction field array index}","Groups":["Loading Values"]},{"Opcode":55,"Name":"gtxna","Returns":".","Cost":1,"Size":4,"ArgEnum":["ApplicationArgs","Accounts","Assets","Applications","Logs"],"ArgEnumTypes":"BBUUB","Doc":"push Ith value of the array field F from the Tth transaction in the current group","ImmediateNote":"{uint8 transaction group index} {uint8 transaction field index} {uint8 transaction field array index}","Groups":["Loading Values"]},{"Opcode":56,"Name":"gtxns","Args":"U","Returns":".","Cost":1,"Size":2,"ArgEnum":["Sender","Fee","FirstValid","FirstValidTime","LastValid","Note","Lease","Receiver","Amount","CloseRemainderTo","VotePK","SelectionPK","VoteFirst","VoteLast","VoteKeyDilution","Type","TypeEnum","XferAsset","AssetAmount","AssetSender","AssetReceiver","AssetCloseTo","GroupIndex","TxID","ApplicationID","OnCompletion","ApplicationArgs","NumAppArgs","Accounts","NumAccounts","ApprovalProgram","ClearStateProgram","RekeyTo","ConfigAsset","ConfigAssetTotal","ConfigAssetDecimals","ConfigAssetDefaultFrozen","ConfigAssetUnitName","ConfigAssetName","ConfigAssetURL","ConfigAssetMetadataHash","ConfigAssetManager","ConfigAssetReserve","ConfigAssetFreeze","ConfigAssetClawback","FreezeAsset","FreezeAssetAccount","FreezeAssetFrozen","Assets","NumAssets","Applications","NumApplications","GlobalNumUint","GlobalNumByteSlice","LocalNumUint","LocalNumByteSlice","ExtraProgramPages","Nonparticipation","Logs","NumLogs","CreatedAssetID","CreatedApplicationID"],"ArgEnumTypes":"BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUUUBUUU","Doc":"push field F of the Xth transaction in the current group","DocExtra":"for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction.","ImmediateNote":"{uint8 transaction field index}","Groups":["Loading Values"]},{"Opcode":57,"Name":"gtxnsa","Args":"U","Returns":".","Cost":1,"Size":3,"ArgEnum":["ApplicationArgs","Accounts","Assets","Applications","Logs"],"ArgEnumTypes":"BBUUB","Doc":"push Ith value of the array field F from the Xth transaction in the current group","ImmediateNote":"{uint8 transaction field index} {uint8 transaction field array index}","Groups":["Loading Values"]},{"Opcode":58,"Name":"gload","Returns":".","Cost":1,"Size":3,"Doc":"push Ith scratch space index of the Tth transaction in the current group","DocExtra":"`gload` fails unless the requested transaction is an ApplicationCall and T < GroupIndex.","ImmediateNote":"{uint8 transaction group index} {uint8 position in scratch space to load from}","Groups":["Loading Values"]},{"Opcode":59,"Name":"gloads","Args":"U","Returns":".","Cost":1,"Size":2,"Doc":"push Ith scratch space index of the Xth transaction in the current group","DocExtra":"`gloads` fails unless the requested transaction is an ApplicationCall and X < GroupIndex.","ImmediateNote":"{uint8 position in scratch space to load from}","Groups":["Loading Values"]},{"Opcode":60,"Name":"gaid","Returns":"U","Cost":1,"Size":2,"Doc":"push the ID of the asset or application created in the Tth transaction of the current group","DocExtra":"`gaid` fails unless the requested transaction created an asset or application and T < GroupIndex.","ImmediateNote":"{uint8 transaction group index}","Groups":["Loading Values"]},{"Opcode":61,"Name":"gaids","Args":"U","Returns":"U","Cost":1,"Size":1,"Doc":"push the ID of the asset or application created in the Xth transaction of the current group","DocExtra":"`gaids` fails unless the requested transaction created an asset or application and X < GroupIndex.","Groups":["Loading Values"]},{"Opcode":62,"Name":"loads","Args":"U","Returns":".","Cost":1,"Size":1,"Doc":"copy a value from the Xth scratch space to the stack. All scratch spaces are 0 at program start.","Groups":["Loading Values"]},{"Opcode":63,"Name":"stores","Args":"U.","Cost":1,"Size":1,"Doc":"pop indexes A and B. store B to the Ath scratch space","Groups":["Loading Values"]},{"Opcode":64,"Name":"bnz","Args":"U","Cost":1,"Size":3,"Doc":"branch to TARGET if value X is not zero","DocExtra":"The `bnz` instruction opcode 0x40 is followed by two immediate data bytes which are a high byte first and low byte second which together form a 16 bit offset which the instruction may branch to. For a bnz instruction at `pc`, if the last element of the stack is not zero then branch to instruction at `pc + 3 + N`, else proceed to next instruction at `pc + 3`. Branch targets must be aligned instructions. (e.g. Branching to the second byte of a 2 byte op will be rejected.) Starting at v4, the offset is treated as a signed 16 bit integer allowing for backward branches and looping. In prior version (v1 to v3), branch offsets are limited to forward branches only, 0-0x7fff.\\n\\nAt v2 it became allowed to branch to the end of the program exactly after the last instruction: bnz to byte N (with 0-indexing) was illegal for a TEAL program with N bytes before v2, and is legal after it. This change eliminates the need for a last instruction of no-op as a branch target at the end. (Branching beyond the end--in other words, to a byte larger than N--is still illegal and will cause the program to fail.)","ImmediateNote":"{int16 branch offset, big endian}","Groups":["Flow Control"]},{"Opcode":65,"Name":"bz","Args":"U","Cost":1,"Size":3,"Doc":"branch to TARGET if value X is zero","DocExtra":"See `bnz` for details on how branches work. `bz` inverts the behavior of `bnz`.","ImmediateNote":"{int16 branch offset, big endian}","Groups":["Flow Control"]},{"Opcode":66,"Name":"b","Cost":1,"Size":3,"Doc":"branch unconditionally to TARGET","DocExtra":"See `bnz` for details on how branches work. `b` always jumps to the offset.","ImmediateNote":"{int16 branch offset, big endian}","Groups":["Flow Control"]},{"Opcode":67,"Name":"return","Args":"U","Cost":1,"Size":1,"Doc":"use last value on stack as success value; end","Groups":["Flow Control"]},{"Opcode":68,"Name":"assert","Args":"U","Cost":1,"Size":1,"Doc":"immediately fail unless value X is a non-zero number","Groups":["Flow Control"]},{"Opcode":72,"Name":"pop","Args":".","Cost":1,"Size":1,"Doc":"discard value X from stack","Groups":["Flow Control"]},{"Opcode":73,"Name":"dup","Args":".","Returns":"..","Cost":1,"Size":1,"Doc":"duplicate last value on stack","Groups":["Flow Control"]},{"Opcode":74,"Name":"dup2","Args":"..","Returns":"....","Cost":1,"Size":1,"Doc":"duplicate two last values on stack: A, B -> A, B, A, B","Groups":["Flow Control"]},{"Opcode":75,"Name":"dig","Args":".","Returns":"..","Cost":1,"Size":2,"Doc":"push the Nth value from the top of the stack. dig 0 is equivalent to dup","ImmediateNote":"{uint8 depth}","Groups":["Flow Control"]},{"Opcode":76,"Name":"swap","Args":"..","Returns":"..","Cost":1,"Size":1,"Doc":"swaps two last values on stack: A, B -> B, A","Groups":["Flow Control"]},{"Opcode":77,"Name":"select","Args":"..U","Returns":".","Cost":1,"Size":1,"Doc":"selects one of two values based on top-of-stack: A, B, C -> (if C != 0 then B else A)","Groups":["Flow Control"]},{"Opcode":78,"Name":"cover","Args":".","Returns":".","Cost":1,"Size":2,"Doc":"remove top of stack, and place it deeper in the stack such that N elements are above it. Fails if stack depth <= N.","ImmediateNote":"{uint8 depth}","Groups":["Flow Control"]},{"Opcode":79,"Name":"uncover","Args":".","Returns":".","Cost":1,"Size":2,"Doc":"remove the value at depth N in the stack and shift above items down so the Nth deep value is on top of the stack. Fails if stack depth <= N.","ImmediateNote":"{uint8 depth}","Groups":["Flow Control"]},{"Opcode":80,"Name":"concat","Args":"BB","Returns":"B","Cost":1,"Size":1,"Doc":"pop two byte-arrays A and B and join them, push the result","DocExtra":"`concat` fails if the result would be greater than 4096 bytes.","Groups":["Arithmetic"]},{"Opcode":81,"Name":"substring","Args":"B","Returns":"B","Cost":1,"Size":3,"Doc":"pop a byte-array A. For immediate values in 0..255 S and E: extract a range of bytes from A starting at S up to but not including E, push the substring result. If E < S, or either is larger than the array length, the program fails","ImmediateNote":"{uint8 start position} {uint8 end position}","Groups":["Byte Array Slicing"]},{"Opcode":82,"Name":"substring3","Args":"BUU","Returns":"B","Cost":1,"Size":1,"Doc":"pop a byte-array A and two integers B and C. Extract a range of bytes from A starting at B up to but not including C, push the substring result. If C < B, or either is larger than the array length, the program fails","Groups":["Byte Array Slicing"]},{"Opcode":83,"Name":"getbit","Args":".U","Returns":"U","Cost":1,"Size":1,"Doc":"pop a target A (integer or byte-array), and index B. Push the Bth bit of A.","DocExtra":"see explanation of bit ordering in setbit","Groups":["Arithmetic"]},{"Opcode":84,"Name":"setbit","Args":".UU","Returns":".","Cost":1,"Size":1,"Doc":"pop a target A, index B, and bit C. Set the Bth bit of A to C, and push the result","DocExtra":"When A is a uint64, index 0 is the least significant bit. Setting bit 3 to 1 on the integer 0 yields 8, or 2^3. When A is a byte array, index 0 is the leftmost bit of the leftmost byte. Setting bits 0 through 11 to 1 in a 4-byte-array of 0s yields the byte array 0xfff00000. Setting bit 3 to 1 on the 1-byte-array 0x00 yields the byte array 0x10.","Groups":["Arithmetic"]},{"Opcode":85,"Name":"getbyte","Args":"BU","Returns":"U","Cost":1,"Size":1,"Doc":"pop a byte-array A and integer B. Extract the Bth byte of A and push it as an integer","Groups":["Arithmetic"]},{"Opcode":86,"Name":"setbyte","Args":"BUU","Returns":"B","Cost":1,"Size":1,"Doc":"pop a byte-array A, integer B, and small integer C (between 0..255). Set the Bth byte of A to C, and push the result","Groups":["Arithmetic"]},{"Opcode":87,"Name":"extract","Args":"B","Returns":"B","Cost":1,"Size":3,"Doc":"pop a byte-array A. For immediate values in 0..255 S and L: extract a range of bytes from A starting at S up to but not including S+L, push the substring result. If L is 0, then extract to the end of the string. If S or S+L is larger than the array length, the program fails","ImmediateNote":"{uint8 start position} {uint8 length}","Groups":["Byte Array Slicing"]},{"Opcode":88,"Name":"extract3","Args":"BUU","Returns":"B","Cost":1,"Size":1,"Doc":"pop a byte-array A and two integers B and C. Extract a range of bytes from A starting at B up to but not including B+C, push the substring result. If B+C is larger than the array length, the program fails","Groups":["Byte Array Slicing"]},{"Opcode":89,"Name":"extract_uint16","Args":"BU","Returns":"U","Cost":1,"Size":1,"Doc":"pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+2, convert bytes as big endian and push the uint64 result. If B+2 is larger than the array length, the program fails","Groups":["Byte Array Slicing"]},{"Opcode":90,"Name":"extract_uint32","Args":"BU","Returns":"U","Cost":1,"Size":1,"Doc":"pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+4, convert bytes as big endian and push the uint64 result. If B+4 is larger than the array length, the program fails","Groups":["Byte Array Slicing"]},{"Opcode":91,"Name":"extract_uint64","Args":"BU","Returns":"U","Cost":1,"Size":1,"Doc":"pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+8, convert bytes as big endian and push the uint64 result. If B+8 is larger than the array length, the program fails","Groups":["Byte Array Slicing"]},{"Opcode":96,"Name":"balance","Args":".","Returns":"U","Cost":1,"Size":1,"Doc":"get balance for account A, in microalgos. The balance is observed after the effects of previous transactions in the group, and after the fee for the current transaction is deducted.","DocExtra":"params: Before v4, Txn.Accounts offset. Since v4, Txn.Accounts offset or an account address that appears in Txn.Accounts or is Txn.Sender). Return: value.","Groups":["State Access"]},{"Opcode":97,"Name":"app_opted_in","Args":".U","Returns":"U","Cost":1,"Size":1,"Doc":"check if account A opted in for the application B => {0 or 1}","DocExtra":"params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), application id (or, since v4, a Txn.ForeignApps offset). Return: 1 if opted in and 0 otherwise.","Groups":["State Access"]},{"Opcode":98,"Name":"app_local_get","Args":".B","Returns":".","Cost":1,"Size":1,"Doc":"read from account A from local state of the current application key B => value","DocExtra":"params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), state key. Return: value. The value is zero (of type uint64) if the key does not exist.","Groups":["State Access"]},{"Opcode":99,"Name":"app_local_get_ex","Args":".UB","Returns":".U","Cost":1,"Size":1,"Doc":"read from account A from local state of the application B key C => [*... stack*, value, 0 or 1]","DocExtra":"params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), application id (or, since v4, a Txn.ForeignApps offset), state key. Return: did_exist flag (top of the stack, 1 if the application existed and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.","Groups":["State Access"]},{"Opcode":100,"Name":"app_global_get","Args":"B","Returns":".","Cost":1,"Size":1,"Doc":"read key A from global state of a current application => value","DocExtra":"params: state key. Return: value. The value is zero (of type uint64) if the key does not exist.","Groups":["State Access"]},{"Opcode":101,"Name":"app_global_get_ex","Args":"UB","Returns":".U","Cost":1,"Size":1,"Doc":"read from application A global state key B => [*... stack*, value, 0 or 1]","DocExtra":"params: Txn.ForeignApps offset (or, since v4, an application id that appears in Txn.ForeignApps or is the CurrentApplicationID), state key. Return: did_exist flag (top of the stack, 1 if the application existed and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.","Groups":["State Access"]},{"Opcode":102,"Name":"app_local_put","Args":".B.","Cost":1,"Size":1,"Doc":"write to account specified by A to local state of a current application key B with value C","DocExtra":"params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), state key, value.","Groups":["State Access"]},{"Opcode":103,"Name":"app_global_put","Args":"B.","Cost":1,"Size":1,"Doc":"write key A and value B to global state of the current application","Groups":["State Access"]},{"Opcode":104,"Name":"app_local_del","Args":".B","Cost":1,"Size":1,"Doc":"delete from account A local state key B of the current application","DocExtra":"params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), state key.\\n\\nDeleting a key which is already absent has no effect on the application local state. (In particular, it does _not_ cause the program to fail.)","Groups":["State Access"]},{"Opcode":105,"Name":"app_global_del","Args":"B","Cost":1,"Size":1,"Doc":"delete key A from a global state of the current application","DocExtra":"params: state key.\\n\\nDeleting a key which is already absent has no effect on the application global state. (In particular, it does _not_ cause the program to fail.)","Groups":["State Access"]},{"Opcode":112,"Name":"asset_holding_get","Args":".U","Returns":".U","Cost":1,"Size":2,"ArgEnum":["AssetBalance","AssetFrozen"],"ArgEnumTypes":"UU","Doc":"read from account A and asset B holding field X (imm arg) => {0 or 1 (top), value}","DocExtra":"params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), asset id (or, since v4, a Txn.ForeignAssets offset). Return: did_exist flag (1 if the asset existed and 0 otherwise), value.","ImmediateNote":"{uint8 asset holding field index}","Groups":["State Access"]},{"Opcode":113,"Name":"asset_params_get","Args":"U","Returns":".U","Cost":1,"Size":2,"ArgEnum":["AssetTotal","AssetDecimals","AssetDefaultFrozen","AssetUnitName","AssetName","AssetURL","AssetMetadataHash","AssetManager","AssetReserve","AssetFreeze","AssetClawback","AssetCreator"],"ArgEnumTypes":"UUUBBBBBBBBB","Doc":"read from asset A params field X (imm arg) => {0 or 1 (top), value}","DocExtra":"params: Before v4, Txn.ForeignAssets offset. Since v4, Txn.ForeignAssets offset or an asset id that appears in Txn.ForeignAssets. Return: did_exist flag (1 if the asset existed and 0 otherwise), value.","ImmediateNote":"{uint8 asset params field index}","Groups":["State Access"]},{"Opcode":114,"Name":"app_params_get","Args":"U","Returns":".U","Cost":1,"Size":2,"ArgEnum":["AppApprovalProgram","AppClearStateProgram","AppGlobalNumUint","AppGlobalNumByteSlice","AppLocalNumUint","AppLocalNumByteSlice","AppExtraProgramPages","AppCreator","AppAddress"],"ArgEnumTypes":"BBUUUUUBB","Doc":"read from app A params field X (imm arg) => {0 or 1 (top), value}","DocExtra":"params: Txn.ForeignApps offset or an app id that appears in Txn.ForeignApps. Return: did_exist flag (1 if the application existed and 0 otherwise), value.","ImmediateNote":"{uint8 app params field index}","Groups":["State Access"]},{"Opcode":120,"Name":"min_balance","Args":".","Returns":"U","Cost":1,"Size":1,"Doc":"get minimum required balance for account A, in microalgos. Required balance is affected by [ASA](https://developer.algorand.org/docs/features/asa/#assets-overview) and [App](https://developer.algorand.org/docs/features/asc1/stateful/#minimum-balance-requirement-for-a-smart-contract) usage. When creating or opting into an app, the minimum balance grows before the app code runs, therefore the increase is visible there. When deleting or closing out, the minimum balance decreases after the app executes.","DocExtra":"params: Before v4, Txn.Accounts offset. Since v4, Txn.Accounts offset or an account address that appears in Txn.Accounts or is Txn.Sender). Return: value.","Groups":["State Access"]},{"Opcode":128,"Name":"pushbytes","Returns":"B","Cost":1,"Size":0,"Doc":"push the following program bytes to the stack","DocExtra":"pushbytes args are not added to the bytecblock during assembly processes","ImmediateNote":"{varuint length} {bytes}","Groups":["Loading Values"]},{"Opcode":129,"Name":"pushint","Returns":"U","Cost":1,"Size":0,"Doc":"push immediate UINT to the stack as an integer","DocExtra":"pushint args are not added to the intcblock during assembly processes","ImmediateNote":"{varuint int}","Groups":["Loading Values"]},{"Opcode":136,"Name":"callsub","Cost":1,"Size":3,"Doc":"branch unconditionally to TARGET, saving the next instruction on the call stack","DocExtra":"The call stack is separate from the data stack. Only `callsub` and `retsub` manipulate it.","ImmediateNote":"{int16 branch offset, big endian}","Groups":["Flow Control"]},{"Opcode":137,"Name":"retsub","Cost":1,"Size":1,"Doc":"pop the top instruction from the call stack and branch to it","DocExtra":"The call stack is separate from the data stack. Only `callsub` and `retsub` manipulate it.","Groups":["Flow Control"]},{"Opcode":144,"Name":"shl","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A times 2^B, modulo 2^64","Groups":["Arithmetic"]},{"Opcode":145,"Name":"shr","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A divided by 2^B","Groups":["Arithmetic"]},{"Opcode":146,"Name":"sqrt","Args":"U","Returns":"U","Cost":4,"Size":1,"Doc":"The largest integer B such that B^2 <= X","Groups":["Arithmetic"]},{"Opcode":147,"Name":"bitlen","Args":".","Returns":"U","Cost":1,"Size":1,"Doc":"The highest set bit in X. If X is a byte-array, it is interpreted as a big-endian unsigned integer. bitlen of 0 is 0, bitlen of 8 is 4","DocExtra":"bitlen interprets arrays as big-endian integers, unlike setbit/getbit","Groups":["Arithmetic"]},{"Opcode":148,"Name":"exp","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A raised to the Bth power. Fail if A == B == 0 and on overflow","Groups":["Arithmetic"]},{"Opcode":149,"Name":"expw","Args":"UU","Returns":"UU","Cost":10,"Size":1,"Doc":"A raised to the Bth power as a 128-bit long result as low (top) and high uint64 values on the stack. Fail if A == B == 0 or if the results exceeds 2^128-1","Groups":["Arithmetic"]},{"Opcode":160,"Name":"b+","Args":"BB","Returns":"B","Cost":10,"Size":1,"Doc":"A plus B, where A and B are byte-arrays interpreted as big-endian unsigned integers","Groups":["Byte Array Arithmetic"]},{"Opcode":161,"Name":"b-","Args":"BB","Returns":"B","Cost":10,"Size":1,"Doc":"A minus B, where A and B are byte-arrays interpreted as big-endian unsigned integers. Fail on underflow.","Groups":["Byte Array Arithmetic"]},{"Opcode":162,"Name":"b/","Args":"BB","Returns":"B","Cost":20,"Size":1,"Doc":"A divided by B (truncated division), where A and B are byte-arrays interpreted as big-endian unsigned integers. Fail if B is zero.","Groups":["Byte Array Arithmetic"]},{"Opcode":163,"Name":"b*","Args":"BB","Returns":"B","Cost":20,"Size":1,"Doc":"A times B, where A and B are byte-arrays interpreted as big-endian unsigned integers.","Groups":["Byte Array Arithmetic"]},{"Opcode":164,"Name":"b<","Args":"BB","Returns":"U","Cost":1,"Size":1,"Doc":"A is less than B, where A and B are byte-arrays interpreted as big-endian unsigned integers => { 0 or 1}","Groups":["Byte Array Arithmetic"]},{"Opcode":165,"Name":"b>","Args":"BB","Returns":"U","Cost":1,"Size":1,"Doc":"A is greater than B, where A and B are byte-arrays interpreted as big-endian unsigned integers => { 0 or 1}","Groups":["Byte Array Arithmetic"]},{"Opcode":166,"Name":"b<=","Args":"BB","Returns":"U","Cost":1,"Size":1,"Doc":"A is less than or equal to B, where A and B are byte-arrays interpreted as big-endian unsigned integers => { 0 or 1}","Groups":["Byte Array Arithmetic"]},{"Opcode":167,"Name":"b>=","Args":"BB","Returns":"U","Cost":1,"Size":1,"Doc":"A is greater than or equal to B, where A and B are byte-arrays interpreted as big-endian unsigned integers => { 0 or 1}","Groups":["Byte Array Arithmetic"]},{"Opcode":168,"Name":"b==","Args":"BB","Returns":"U","Cost":1,"Size":1,"Doc":"A is equals to B, where A and B are byte-arrays interpreted as big-endian unsigned integers => { 0 or 1}","Groups":["Byte Array Arithmetic"]},{"Opcode":169,"Name":"b!=","Args":"BB","Returns":"U","Cost":1,"Size":1,"Doc":"A is not equal to B, where A and B are byte-arrays interpreted as big-endian unsigned integers => { 0 or 1}","Groups":["Byte Array Arithmetic"]},{"Opcode":170,"Name":"b%","Args":"BB","Returns":"B","Cost":20,"Size":1,"Doc":"A modulo B, where A and B are byte-arrays interpreted as big-endian unsigned integers. Fail if B is zero.","Groups":["Byte Array Arithmetic"]},{"Opcode":171,"Name":"b|","Args":"BB","Returns":"B","Cost":6,"Size":1,"Doc":"A bitwise-or B, where A and B are byte-arrays, zero-left extended to the greater of their lengths","Groups":["Byte Array Logic"]},{"Opcode":172,"Name":"b&","Args":"BB","Returns":"B","Cost":6,"Size":1,"Doc":"A bitwise-and B, where A and B are byte-arrays, zero-left extended to the greater of their lengths","Groups":["Byte Array Logic"]},{"Opcode":173,"Name":"b^","Args":"BB","Returns":"B","Cost":6,"Size":1,"Doc":"A bitwise-xor B, where A and B are byte-arrays, zero-left extended to the greater of their lengths","Groups":["Byte Array Logic"]},{"Opcode":174,"Name":"b~","Args":"B","Returns":"B","Cost":4,"Size":1,"Doc":"X with all bits inverted","Groups":["Byte Array Logic"]},{"Opcode":175,"Name":"bzero","Args":"U","Returns":"B","Cost":1,"Size":1,"Doc":"push a byte-array of length X, containing all zero bytes","Groups":["Loading Values"]},{"Opcode":176,"Name":"log","Args":"B","Cost":1,"Size":1,"Doc":"write bytes to log state of the current application","DocExtra":"`log` fails if called more than MaxLogCalls times in a program, or if the sum of logged bytes exceeds 1024 bytes.","Groups":["State Access"]},{"Opcode":177,"Name":"itxn_begin","Cost":1,"Size":1,"Doc":"Begin preparation of a new inner transaction","DocExtra":"`itxn_begin` initializes Sender to the application address; Fee to the minimum allowable, taking into account MinTxnFee and credit from overpaying in earlier transactions; FirstValid/LastValid to the values in the top-level transaction, and all other fields to zero values.","Groups":["Inner Transactions"]},{"Opcode":178,"Name":"itxn_field","Args":".","Cost":1,"Size":2,"Doc":"Set field F of the current inner transaction to X","DocExtra":"`itxn_field` fails if X is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if X is an account or asset that does not appear in `txn.Accounts` or `txn.ForeignAssets` of the top-level transaction. (Setting addresses in asset creation are exempted from this requirement.)","ImmediateNote":"{uint8 transaction field index}","Groups":["Inner Transactions"]},{"Opcode":179,"Name":"itxn_submit","Cost":1,"Size":1,"Doc":"Execute the current inner transaction. Fail if 16 inner transactions have already been executed, or if the transaction itself fails.","Groups":["Inner Transactions"]},{"Opcode":180,"Name":"itxn","Returns":".","Cost":1,"Size":2,"Doc":"push field F of the last inner transaction to stack","ImmediateNote":"{uint8 transaction field index}","Groups":["Inner Transactions"]},{"Opcode":181,"Name":"itxna","Returns":".","Cost":1,"Size":3,"Doc":"push Ith value of the array field F of the last inner transaction to stack","ImmediateNote":"{uint8 transaction field index} {uint8 transaction field array index}","Groups":["Inner Transactions"]},{"Opcode":192,"Name":"txnas","Args":"U","Returns":".","Cost":1,"Size":2,"ArgEnum":["ApplicationArgs","Accounts","Assets","Applications","Logs"],"ArgEnumTypes":"BBUUB","Doc":"push Xth value of the array field F of the current transaction","ImmediateNote":"{uint8 transaction field index}","Groups":["Loading Values"]},{"Opcode":193,"Name":"gtxnas","Args":"U","Returns":".","Cost":1,"Size":3,"ArgEnum":["ApplicationArgs","Accounts","Assets","Applications","Logs"],"ArgEnumTypes":"BBUUB","Doc":"push Xth value of the array field F from the Tth transaction in the current group","ImmediateNote":"{uint8 transaction group index} {uint8 transaction field index}","Groups":["Loading Values"]},{"Opcode":194,"Name":"gtxnsas","Args":"UU","Returns":".","Cost":1,"Size":2,"ArgEnum":["ApplicationArgs","Accounts","Assets","Applications","Logs"],"ArgEnumTypes":"BBUUB","Doc":"pop an index A and an index B. push Bth value of the array field F from the Ath transaction in the current group","ImmediateNote":"{uint8 transaction field index}","Groups":["Loading Values"]},{"Opcode":195,"Name":"args","Args":"U","Returns":"B","Cost":1,"Size":1,"Doc":"push Xth LogicSig argument to stack","Groups":["Loading Values"]}]}');
let o;
function s(e) {
let t = 0,
r = 0;
for (let n = 0; n < e.length; n++) {
const o = e[n];
if (o < 128) return n > 9 || 9 === n && o > 1 ? [0, -(n + 1)] : [t | o << r, n + 1];
t += (127 & o) << r, r += 7;
}
return [0, 0];
}
function i(e, t) {
let r = 1;
const n = s(e.slice(t + r)),
o = n[0];
let i = n[1];
if (i <= 0) throw new Error(`could not decode int const block size at pc=${t + r}`);
const a = [];
r += i;
for (let n = 0; n < o; n++) {
if (t + r >= e.length) throw new Error("intcblock ran past end of program");
let o;
if ([o, i] = s(e.slice(t + r)), i <= 0) throw new Error(`could not decode int const[${n}] block size at pc=${t + r}`);
a.push(o), r += i;
}
return [r, a];
}
function a(e, t) {
let r = 1;
const n = s(e.slice(t + r)),
o = n[0];
let i = n[1];
if (i <= 0) throw new Error(`could not decode []byte const block size at pc=${t + r}`);
const a = [];
r += i;
for (let n = 0; n < o; n++) {
if (t + r >= e.length) throw new Error("bytecblock ran past end of program");
let o;
if ([o, i] = s(e.slice(t + r)), i <= 0) throw new Error(`could not decode []byte] const[${n}] block size at pc=${t + r}`);
if (r += i, t + r + o > e.length) throw new Error("bytecblock ran past end of program");
const c = e.slice(t + r, t + r + o);
a.push(c), r += o;
}
return [r, a];
}
function c(e, t) {
let r = 1;
const [n, o] = s(e.slice(t + r));
if (o <= 0) throw new Error(`could not decode push int const at pc=${t + r}`);
return r += o, [r, n];
}
function u(e, t) {
let r = 1;
const [n, o] = s(e.slice(t + r));
if (o <= 0) throw new Error(`could not decode push []byte const size at pc=${t + r}`);
if (r += o, t + r + n > e.length) throw new Error("pushbytes ran past end of program");
const i = e.slice(t + r, t + r + n);
return r += n, [r, i];
}
function l(e, t) {
if (!e) throw new Error("empty program");
if (void 0 === t && (t = []), !Array.isArray(t)) throw new Error("invalid arguments");
const [r, l] = s(e);
if (l <= 0) throw new Error("version parsing error");
if (r > n.z_) throw new Error("unsupported version");
let h = 0,
{
length: p
} = e;
for (const e of t) p += e.length;
if (p > 1e3) throw new Error("program too long");
if (!o) {
o = {};
for (const e of n.AP) o[e.Opcode] = e;
}
let f = l,
d = [],
g = [];
for (; f < e.length;) {
const t = o[e[f]];
if (void 0 === t) throw new Error("invalid instruction");
h += t.Cost;
let r = t.Size;
if (0 === r) switch (t.Opcode) {
case 32:
{
let t;
[r, t] = i(e, f), d = d.concat(t);
break;
}
case 38:
{
let t;
[r, t] = a(e, f), g = g.concat(t);
break;
}
case 129:
{
let t;
[r, t] = c(e, f), d.push(t);
break;
}
case 128:
{
let t;
[r, t] = u(e, f), g.push(t);
break;
}
default:
throw new Error("invalid instruction");
}
f += r;
}
if (r < 4 && h > 2e4) throw new Error("program too costly for Teal version < 4. consider using v4.");
return [d, g, !0];
}
function h(e, t) {
const [,, r] = l(e, t);
return r;
}
function p(e, t) {
const [r] = i(e, t);
return r;
}
function f(e, t) {
const [r] = a(e, t);
return r;
}
function d(e, t) {
const [r] = c(e, t);
return r;
}
function g(e, t) {
const [r] = u(e, t);
return r;
}
const y = n.z_,
m = n.BV;
},
8800: (e, t, r) => {
"use strict";
r.r(t), r.d(t, {
LogicSig: () => h,
LogicSigAccount: () => p,
makeLogicSig: () => f,
signLogicSigTransactionObject: () => d,
signLogicSigTransaction: () => g,
logicSigFromByte: () => y,
tealSign: () => b,
tealSignFromProgram: () => w
});
var n = r(9404),
o = r(7116),
s = r(3033),
i = r(5583),
a = r(4158),
c = r(413),
u = r(9417),
l = r(2486).Buffer;
class h {
constructor(e, t) {
if (this.tag = l.from("Program"), t && (!Array.isArray(t) || !t.every(e => e.constructor === Uint8Array || l.isBuffer(e)))) throw new TypeError("Invalid arguments");
let r;
if (null != t && (r = t.map(e => new Uint8Array(e))), !i.checkProgram(e, r)) throw new Error("Invalid program");
this.logic = e, this.args = r, this.sig = void 0, this.msig = void 0;
}
get_obj_for_encoding() {
const e = {
l: this.logic
};
return this.args && (e.arg = this.args), this.sig ? e.sig = this.sig : this.msig && (e.msig = this.msig), e;
}
static from_obj_for_encoding(e) {
const t = new h(e.l, e.arg);
return t.sig = e.sig, t.msig = e.msig, t;
}
verify(e) {
if (this.sig && this.msig) return !1;
try {
i.checkProgram(this.logic, this.args);
} catch (e) {
return !1;
}
const t = c.concatArrays(this.tag, this.logic);
if (!this.sig && !this.msig) {
const r = n.genericHash(t);
return c.arrayEqual(r, e);
}
return this.sig ? n.verify(t, this.sig, e) : (0, a.F2)(t, this.msig, e);
}
address() {
const e = c.concatArrays(this.tag, this.logic),
t = n.genericHash(e);
return o.encodeAddress(new Uint8Array(t));
}
sign(e, t) {
if (null == t) this.sig = this.signProgram(e);else {
const r = t.addrs.map(e => ({
pk: o.decodeAddress(e).publicKey
}));
this.msig = {
v: t.version,
thr: t.threshold,
subsig: r
};
const [n, s] = this.singleSignMultisig(e, this.msig);
this.msig.subsig[s].s = n;
}
}
appendToMultisig(e) {
if (void 0 === this.msig) throw new Error("no multisig present");
const [t, r] = this.singleSignMultisig(e, this.msig);
this.msig.subsig[r].s = t;
}
signProgram(e) {
const t = c.concatArrays(this.tag, this.logic);
return n.sign(t, e);
}
singleSignMultisig(e, t) {
let r = -1;
const o = n.keyPairFromSecretKey(e).publicKey;
for (let e = 0; e < t.subsig.length; e++) {
const {
pk: n
} = t.subsig[e];
if (c.arrayEqual(n, o)) {
r = e;
break;
}
}
if (-1 === r) throw new Error("invalid secret key");
return [this.signProgram(e), r];
}
toByte() {
return s.encode(this.get_obj_for_encoding());
}
static fromByte(e) {
const t = s.decode(e);
return h.from_obj_for_encoding(t);
}
}
class p {
constructor(e, t) {
this.lsig = new h(e, t), this.sigkey = void 0;
}
get_obj_for_encoding() {
const e = {
lsig: this.lsig.get_obj_for_encoding()
};
return this.sigkey && (e.sigkey = this.sigkey), e;
}
static from_obj_for_encoding(e) {
const t = new p(e.lsig.l, e.lsig.arg);
return t.lsig = h.from_obj_for_encoding(e.lsig), t.sigkey = e.sigkey, t;
}
toByte() {
return s.encode(this.get_obj_for_encoding());
}
static fromByte(e) {
const t = s.decode(e);
return p.from_obj_for_encoding(t);
}
isDelegated() {
return !(!this.lsig.sig && !this.lsig.msig);
}
verify() {
const e = this.address();
return this.lsig.verify(o.decodeAddress(e).publicKey);
}
address() {
if (this.lsig.sig && this.lsig.msig) throw new Error("LogicSig has too many signatures. At most one of sig or msig may be present");
if (this.lsig.sig) {
if (!this.sigkey) throw new Error("Signing key for delegated account is missing");
return o.encodeAddress(this.sigkey);
}
if (this.lsig.msig) {
const e = {
version: this.lsig.msig.v,
threshold: this.lsig.msig.thr,
pks: this.lsig.msig.subsig.map(e => e.pk)
};
return o.encodeAddress(o.fromMultisigPreImg(e));
}
return this.lsig.address();
}
signMultisig(e, t) {
this.lsig.sign(t, e);
}
appendToMultisig(e) {
this.lsig.appendToMultisig(e);
}
sign(e) {
this.lsig.sign(e), this.sigkey = n.keyPairFromSecretKey(e).publicKey;
}
}
function f(e, t) {
return new h(e, t);
}
function d(e, t) {
let r, i;
if (t instanceof p) r = t.lsig, i = o.decodeAddress(t.address()).publicKey;else if (r = t, r.sig) i = e.from.publicKey;else if (r.msig) {
const e = {
version: r.msig.v,
threshold: r.msig.thr,
pks: r.msig.subsig.map(e => e.pk)
};
i = o.fromMultisigPreImg(e);
} else i = o.decodeAddress(r.address()).publicKey;
return function (e, t, r) {
if (!t.verify(r)) throw new Error("Logic signature verification failed. Ensure the program and signature are valid.");
const o = {
lsig: t.get_obj_for_encoding(),
txn: e.get_obj_for_encoding()
};
return n.bytesEqual(r, e.from.publicKey) || (o.sgnr = l.from(r)), {
txID: e.txID().toString(),
blob: s.encode(o)
};
}(e, r, i);
}
function g(e, t) {
return d(u.instantiateTxnIfNeeded(e), t);
}
function y(e) {
return h.fromByte(e);
}
const m = l.from("ProgData");
function b(e, t, r) {
const s = c.concatArrays(o.decodeAddress(r).publicKey, t),
i = l.from(c.concatArrays(m, s));
return n.sign(i, e);
}
function w(e, t, r) {
return b(e, t, new h(r).address());
}
},
6608: (e, t, r) => {
"use strict";
r.r(t), r.d(t, {
MULTISIG_BAD_SENDER_ERROR_MSG: () => D,
signTransaction: () => N,
signBid: () => P,
signBytes: () => L,
verifyBytes: () => F,
encodeObj: () => j,
decodeObj: () => z,
ERROR_MULTISIG_BAD_SENDER: () => M,
ERROR_INVALID_MICROALGOS: () => H,
Algodv2: () => d.Z,
Kmd: () => g.Z,
IntDecoding: () => y.Z,
Indexer: () => m.Z,
waitForConfirmation: () => b.K,
isValidAddress: () => o.isValidAddress,
encodeAddress: () => o.encodeAddress,
decodeAddress: () => o.decodeAddress,
getApplicationAddress: () => o.getApplicationAddress,
encodeUint64: () => w.T,
decodeUint64: () => w.u,
generateAccount: () => A.Z,
modelsv2: () => v,
mnemonicToMasterDerivationKey: () => x.OF,
masterDerivationKeyToMnemonic: () => x.vC,
secretKeyToMnemonic: () => x.QX,
mnemonicToSecretKey: () => x.Ch,
seedFromMnemonic: () => x.mE,
mnemonicFromSeed: () => x.w3,
microalgosToAlgos: () => l._,
algosToMicroalgos: () => l.HN,
INVALID_MICROALGOS_ERROR_MSG: () => l.rD,
computeGroupID: () => S.computeGroupID,
assignGroupID: () => S.assignGroupID,
LogicSigAccount: () => E.LogicSigAccount,
makeLogicSig: () => E.makeLogicSig,
signLogicSigTransaction: () => E.signLogicSigTransaction,
signLogicSigTransactionObject: () => E.signLogicSigTransactionObject,
logicSigFromByte: () => E.logicSigFromByte,
tealSign: () => E.tealSign,
tealSignFromProgram: () => E.tealSignFromProgram,
signMultisigTransaction: () => T.PU,
mergeMultisigTransactions: () => T.J6,
appendSignMultisigTransaction: () => T.PO,
multisigAddress: () => T.vH,
LogicTemplates: () => G,
createDryrun: () => _.P,
OnApplicationComplete: () => B.OnApplicationComplete,
makeApplicationCallTxnFromObject: () => B.makeApplicationCallTxnFromObject,
makeApplicationClearStateTxn: () => B.makeApplicationClearStateTxn,
makeApplicationClearStateTxnFromObject: () => B.makeApplicationClearStateTxnFromObject,
makeApplicationCloseOutTxn: () => B.makeApplicationCloseOutTxn,
makeApplicationCloseOutTxnFromObject: () => B.makeApplicationCloseOutTxnFromObject,
makeApplicationCreateTxn: () => B.makeApplicationCreateTxn,
makeApplicationCreateTxnFromObject: () => B.makeApplicationCreateTxnFromObject,
makeApplicationDeleteTxn: () => B.makeApplicationDeleteTxn,
makeApplicationDeleteTxnFromObject: () => B.makeApplicationDeleteTxnFromObject,
makeApplicationNoOpTxn: () => B.makeApplicationNoOpTxn,
makeApplicationNoOpTxnFromObject: () => B.makeApplicationNoOpTxnFromObject,
makeApplicationOptInTxn: () => B.makeApplicationOptInTxn,
makeApplicationOptInTxnFromObject: () => B.makeApplicationOptInTxnFromObject,
makeApplicationUpdateTxn: () => B.makeApplicationUpdateTxn,
makeApplicationUpdateTxnFromObject: () => B.makeApplicationUpdateTxnFromObject,
makeAssetConfigTxn: () => B.makeAssetConfigTxn,
makeAssetConfigTxnWithSuggestedParams: () => B.makeAssetConfigTxnWithSuggestedParams,
makeAssetConfigTxnWithSuggestedParamsFromObject: () => B.makeAssetConfigTxnWithSuggestedParamsFromObject,
makeAssetCreateTxn: () => B.makeAssetCreateTxn,
makeAssetCreateTxnWithSuggestedParams: () => B.makeAssetCreateTxnWithSuggestedParams,
makeAssetCreateTxnWithSuggestedParamsFromObject: () => B.makeAssetCreateTxnWithSuggestedParamsFromObject,
makeAssetDestroyTxn: () => B.makeAssetDestroyTxn,
makeAssetDestroyTxnWithSuggestedParams: () => B.makeAssetDestroyTxnWithSuggestedParams,
makeAssetDestroyTxnWithSuggestedParamsFromObject: () => B.makeAssetDestroyTxnWithSuggestedParamsFromObject,
makeAssetFreezeTxn: () => B.makeAssetFreezeTxn,
makeAssetFreezeTxnWithSuggestedParams: () => B.makeAssetFreezeTxnWithSuggestedParams,
makeAssetFreezeTxnWithSuggestedParamsFromObject: () => B.makeAssetFreezeTxnWithSuggestedParamsFromObject,
makeAssetTransferTxn: () => B.makeAssetTransferTxn,
makeAssetTransferTxnWithSuggestedParams: () => B.makeAssetTransferTxnWithSuggestedParams,
makeAssetTransferTxnWithSuggestedParamsFromObject: () => B.makeAssetTransferTxnWithSuggestedParamsFromObject,
makeKeyRegistrationTxn: () => B.makeKeyRegistrationTxn,
makeKeyRegistrationTxnWithSuggestedParams: () => B.makeKeyRegistrationTxnWithSuggestedParams,
makeKeyRegistrationTxnWithSuggestedParamsFromObject: () => B.makeKeyRegistrationTxnWithSuggestedParamsFromObject,
makePaymentTxn: () => B.makePaymentTxn,
makePaymentTxnWithSuggestedParams: () => B.makePaymentTxnWithSuggestedParams,
makePaymentTxnWithSuggestedParamsFromObject: () => B.makePaymentTxnWithSuggestedParamsFromObject,
ALGORAND_MIN_TX_FEE: () => i.ALGORAND_MIN_TX_FEE,
Transaction: () => i.Transaction,
decodeSignedTransaction: () => i.decodeSignedTransaction,
decodeUnsignedTransaction: () => i.decodeUnsignedTransaction,
encodeUnsignedTransaction: () => i.encodeUnsignedTransaction,
instantiateTxnIfNeeded: () => i.instantiateTxnIfNeeded,
isTransactionWithSigner: () => k.Xw,
makeBasicAccountTransactionSigner: () => k.x7,
makeLogicSigAccountTransactionSigner: () => k.i1,
makeMultiSigAccountTransactionSigner: () => k.Vj,
AtomicTransactionComposer: () => I.A,
AtomicTransactionComposerStatus: () => I.b,
TransactionType: () => U.i,
ABIAddressType: () => C.JQ,
ABIArrayDynamicType: () => C._4,
ABIArrayStaticType: () => C.X3,
ABIBoolType: () => C.R0,
ABIByteType: () => C.jD,
ABIContract: () => C.Yh,
ABIInterface: () => C.bL,
ABIMethod: () => C.Ls,
ABIReferenceType: () => C.UV,
ABIStringType: () => C.Ax,
ABITransactionType: () => C.A9,
ABITupleType: () => C.w1,
ABIType: () => C.NK,
ABIUfixedType: () => C.RY,
ABIUintType: () => C.Pu,
ADDR_BYTE_SIZE: () => C.Vk,
LENGTH_ENCODE_BYTE_SIZE: () => C.nh,
MAX_LEN: () => C.kG,
SINGLE_BOOL_SIZE: () => C.qH,
SINGLE_BYTE_SIZE: () => C.JH,
abiCheckTransactionType: () => C.vJ,
abiTypeIsReference: () => C.o5,
abiTypeIsTransaction: () => C.AE
});
var n = r(9404),
o = r(7116),
s = r(3033),
i = r(9417),
a = r(8886),
c = r.n(a),
u = r(2691),
l = r(9070),
h = r(413),
p = r(5922),
f = {};
for (const e in p) ["default", "MULTISIG_BAD_SENDER_ERROR_MSG", "signTransaction", "signBid", "signBytes", "verifyBytes", "encodeObj", "decodeObj", "ERROR_MULTISIG_BAD_SENDER", "ERROR_INVALID_MICROALGOS", "Algodv2", "Kmd", "IntDecoding", "Indexer", "waitForConfirmation", "isValidAddress", "encodeAddress", "decodeAddress", "getApplicationAddress", "encodeUint64", "decodeUint64", "generateAccount", "modelsv2", "mnemonicToMasterDerivationKey", "masterDerivationKeyToMnemonic", "secretKeyToMnemonic", "mnemonicToSecretKey", "seedFromMnemonic", "mnemonicFromSeed", "microalgosToAlgos", "algosToMicroalgos", "INVALID_MICROALGOS_ERROR_MSG", "computeGroupID", "assignGroupID", "LogicSigAccount", "makeLogicSig", "signLogicSigTransaction", "signLogicSigTransactionObject", "logicSigFromByte", "tealSign", "tealSignFromProgram", "signMultisigTransaction", "mergeMultisigTransactions", "appendSignMultisigTransaction", "multisigAddress", "LogicTemplates"].indexOf(e) < 0 && (f[e] = () => p[e]);
r.d(t, f);
var d = r(5427),
g = r(6477),
y = r(7197),
m = r(8104),
b = r(5062),
w = r(6963),
A = r(7988),
v = r(227),
x = r(3510),
S = r(1063),
E = r(8800),
T = r(4158),
_ = r(4383),
B = r(1988),
k = r(834),
I = r(3458),
U = r(2380),
C = r(3410),
R = r(2486).Buffer;
const O = R.from([77, 88]),
D = "The transaction sender address and multisig preimage do not match.";
function N(e, t) {
if (void 0 === e.from) {
const r = n.keyPairFromSecretKey(t);
e.from = o.encodeAddress(r.publicKey);
}
const r = i.instantiateTxnIfNeeded(e);
return {
txID: r.txID().toString(),
blob: r.signTxn(t)
};
}
function P(e, t) {
return new u.Z(e).signBid(t);
}
function L(e, t) {
const r = R.from(h.concatArrays(O, e));
return n.sign(r, t);
}
function F(e, t, r) {
const s = R.from(h.concatArrays(O, e)),
i = o.decodeAddress(r).publicKey;
return n.verify(s, t, i);
}
function j(e) {
return new Uint8Array(s.encode(e));
}
function z(e) {
return s.decode(e);
}
const M = new Error(D),
H = new Error(l.rD),
G = c();
},
1988: (e, t, r) => {
"use strict";
r.r(t), r.d(t, {
makePaymentTxnWithSuggestedParams: () => i,
makePaymentTxn: () => a,
makePaymentTxnWithSuggestedParamsFromObject: () => c,
makeKeyRegistrationTxnWithSuggestedParams: () => u,
makeKeyRegistrationTxn: () => l,
makeKeyRegistrationTxnWithSuggestedParamsFromObject: () => h,
makeAssetCreateTxnWithSuggestedParams: () => p,
makeAssetCreateTxn: () => f,
makeAssetCreateTxnWithSuggestedParamsFromObject: () => d,
makeAssetConfigTxnWithSuggestedParams: () => g,
makeAssetConfigTxn: () => y,
makeAssetConfigTxnWithSuggestedParamsFromObject: () => m,
makeAssetDestroyTxnWithSuggestedParams: () => b,
makeAssetDestroyTxn: () => w,
makeAssetDestroyTxnWithSuggestedParamsFromObject: () => A,
makeAssetFreezeTxnWithSuggestedParams: () => v,
makeAssetFreezeTxn: () => x,
makeAssetFreezeTxnWithSuggestedParamsFromObject: () => S,
makeAssetTransferTxnWithSuggestedParams: () => E,
makeAssetTransferTxn: () => T,
makeAssetTransferTxnWithSuggestedParamsFromObject: () => _,
makeApplicationCreateTxn: () => B,
makeApplicationCreateTxnFromObject: () => k,
makeApplicationUpdateTxn: () => I,
makeApplicationUpdateTxnFromObject: () => U,
makeApplicationDeleteTxn: () => C,
makeApplicationDeleteTxnFromObject: () => R,
makeApplicationOptInTxn: () => O,
makeApplicationOptInTxnFromObject: () => D,
makeApplicationCloseOutTxn: () => N,
makeApplicationCloseOutTxnFromObject: () => P,
makeApplicationClearStateTxn: () => L,
makeApplicationClearStateTxnFromObject: () => F,
makeApplicationNoOpTxn: () => j,
makeApplicationNoOpTxnFromObject: () => z,
OnApplicationComplete: () => o.h,
makeApplicationCallTxnFromObject: () => M
});
var n = r(9417),
o = r(1624),
s = r(1824);
function i(e, t, r, o, i, a, c) {
const u = {
from: e,
to: t,
amount: r,
closeRemainderTo: o,
note: i,
suggestedParams: a,
type: s.i.pay,
reKeyTo: c
};
return new n.Transaction(u);
}
function a(e, t, r, n, o, s, a, c, u, l, h) {
return i(e, t, n, o, c, {
genesisHash: u,
genesisID: l,
firstRound: s,
lastRound: a,
fee: r
}, h);
}
function c(e) {
return i(e.from, e.to, e.amount, e.closeRemainderTo, e.note, e.suggestedParams, e.rekeyTo);
}
function u(e, t, r, o, i, a, c, u, l, h = !1) {
const p = {
from: e,
note: t,
voteKey: r,
selectionKey: o,
voteFirst: i,
voteLast: a,
voteKeyDilution: c,
suggestedParams: u,
type: s.i.keyreg,
reKeyTo: l,
nonParticipation: h
};
return new n.Transaction(p);
}
function l(e, t, r, n, o, s, i, a, c, l, h, p, f, d = !1) {
return u(e, o, a, c, l, h, p, {
genesisHash: s,
genesisID: i,
firstRound: r,
lastRound: n,
fee: t
}, f, d);
}
function h(e) {
return u(e.from, e.note, e.voteKey, e.selectionKey, e.voteFirst, e.voteLast, e.voteKeyDilution, e.suggestedParams, e.rekeyTo, e.nonParticipation);
}
function p(e, t, r, o, i, a, c, u, l, h, p, f, d, g, y) {
const m = {
from: e,
note: t,
suggestedParams: g,
assetTotal: r,
assetDecimals: o,
assetDefaultFrozen: i,
assetUnitName: h,
assetName: p,
assetURL: f,
assetMetadataHash: d,
assetManager: a,
assetReserve: c,
assetFreeze: u,
assetClawback: l,
type: s.i.acfg,
reKeyTo: y
};
return new n.Transaction(m);
}
function f(e, t, r, n, o, s, i, a, c, u, l, h, f, d, g, y, m, b, w) {
return p(e, o, a, c, u, l, h, f, d, g, y, m, b, {
genesisHash: s,
genesisID: i,
firstRound: r,
lastRound: n,
fee: t
}, w);
}
function d(e) {
return p(e.from, e.note, e.total, e.decimals, e.defaultFrozen, e.manager, e.reserve, e.freeze, e.clawback, e.unitName, e.assetName, e.assetURL, e.assetMetadataHash, e.suggestedParams, e.rekeyTo);
}
function g(e, t, r, o, i, a, c, u, l = !0, h) {
if (l && (void 0 === o || void 0 === i || void 0 === a || void 0 === c)) throw Error("strict empty address checking was turned on, but at least one empty address was provided");
const p = {
from: e,
suggestedParams: u,
assetIndex: r,
assetManager: o,
assetReserve: i,
assetFreeze: a,
assetClawback: c,
type: s.i.acfg,
note: t,
reKeyTo: h
};
return new n.Transaction(p);
}
function y(e, t, r, n, o, s, i, a, c, u, l, h, p = !0, f) {
return g(e, o, a, c, u, l, h, {
genesisHash: s,
genesisID: i,
firstRound: r,
lastRound: n,
fee: t
}, p, f);
}
function m(e) {
return g(e.from, e.note, e.assetIndex, e.manager, e.reserve, e.freeze, e.clawback, e.suggestedParams, e.strictEmptyAddressChecking, e.rekeyTo);
}
function b(e, t, r, o, i) {
const a = {
from: e,
suggestedParams: o,
assetIndex: r,
type: s.i.acfg,
note: t,
reKeyTo: i
};
return new n.Transaction(a);
}
function w(e, t, r, n, o, s, i, a, c) {
return b(e, o, a, {
genesisHash: s,
genesisID: i,
firstRound: r,
lastRound: n,
fee: t
}, c);
}
function A(e) {
return b(e.from, e.note, e.assetIndex, e.suggestedParams, e.rekeyTo);
}
function v(e, t, r, o, i, a, c) {
const u = {
from: e,
type: s.i.afrz,
freezeAccount: o,
assetIndex: r,
freezeState: i,
note: t,
suggestedParams: a,
reKeyTo: c
};
return new n.Transaction(u);
}
function x(e, t, r, n, o, s, i, a, c, u, l) {
return v(e, o, a, c, u, {
genesisHash: s,
genesisID: i,
firstRound: r,
lastRound: n,
fee: t
}, l);
}
function S(e) {
return v(e.from, e.note, e.assetIndex, e.freezeTarget, e.freezeState, e.suggestedParams, e.rekeyTo);
}
function E(e, t, r, o, i, a, c, u, l) {
const h = {
type: s.i.axfer,
from: e,
to: t,
amount: i,
suggestedParams: u,
assetIndex: c,
note: a,
assetRevocationTarget: o,
closeRemainderTo: r,
reKeyTo: l
};
return new n.Transaction(h);
}
function T(e, t, r, n, o, s, i, a, c, u, l, h, p) {
return E(e, t, r, n, s, c, h, {
genesisHash: u,
genesisID: l,
firstRound: i,
lastRound: a,
fee: o
}, p);
}
function _(e) {
return E(e.from, e.to, e.closeRemainderTo, e.revocationTarget, e.amount, e.note, e.assetIndex, e.suggestedParams, e.rekeyTo);
}
function B(e, t, r, o, i, a, c, u, l, h, p, f, d, g, y, m, b) {
const w = {
type: s.i.appl,
from: e,
suggestedParams: t,
appIndex: 0,
appOnComplete: r,
appLocalInts: a,
appLocalByteSlices: c,
appGlobalInts: u,
appGlobalByteSlices: l,
appApprovalProgram: o,
appClearProgram: i,
appArgs: h,
appAccounts: p,
appForeignApps: f,
appForeignAssets: d,
note: g,
lease: y,
reKeyTo: m,
extraPages: b
};
return new n.Transaction(w);
}
function k(e) {
return B(e.from, e.suggestedParams, e.onComplete, e.approvalProgram, e.clearProgram, e.numLocalInts, e.numLocalByteSlices, e.numGlobalInts, e.numGlobalByteSlices, e.appArgs, e.accounts, e.foreignApps, e.foreignAssets, e.note, e.lease, e.rekeyTo, e.extraPages);
}
function I(e, t, r, i, a, c, u, l, h, p, f, d) {
const g = {
type: s.i.appl,
from: e,
suggestedParams: t,
appIndex: r,
appApprovalProgram: i,
appOnComplete: o.h.UpdateApplicationOC,
appClearProgram: a,
appArgs: c,
appAccounts: u,
appForeignApps: l,
appForeignAssets: h,
note: p,
lease: f,
reKeyTo: d
};
return new n.Transaction(g);
}
function U(e) {
return I(e.from, e.suggestedParams, e.appIndex, e.approvalProgram, e.clearProgram, e.appArgs, e.accounts, e.foreignApps, e.foreignAssets, e.note, e.lease, e.rekeyTo);
}
function C(e, t, r, i, a, c, u, l, h, p) {
const f = {
type: s.i.appl,
from: e,
suggestedParams: t,
appIndex: r,
appOnComplete: o.h.DeleteApplicationOC,
appArgs: i,
appAccounts: a,
appForeignApps: c,
appForeignAssets: u,
note: l,
lease: h,
reKeyTo: p
};
return new n.Transaction(f);
}
function R(e) {
return C(e.from, e.suggestedParams, e.appIndex, e.appArgs, e.accounts, e.foreignApps, e.foreignAssets, e.note, e.lease, e.rekeyTo);
}
function O(e, t, r, i, a, c, u, l, h, p) {
const f = {
type: s.i.appl,
from: e,
suggestedParams: t,
appIndex: r,
appOnComplete: o.h.OptInOC,
appArgs: i,
appAccounts: a,
appForeignApps: c,
appForeignAssets: u,
note: l,
lease: h,
reKeyTo: p
};
return new n.Transaction(f);
}
function D(e) {
return O(e.from, e.suggestedParams, e.appIndex, e.appArgs, e.accounts, e.foreignApps, e.foreignAssets, e.note, e.lease, e.rekeyTo);
}
function N(e, t, r, i, a, c, u, l, h, p) {
const f = {
type: s.i.appl,
from: e,
suggestedParams: t,
appIndex: r,
appOnComplete: o.h.CloseOutOC,
appArgs: i,
appAccounts: a,
appForeignApps: c,
appForeignAssets: u,
note: l,
lease: h,
reKeyTo: p
};
return new n.Transaction(f);
}
function P(e) {
return N(e.from, e.suggestedParams, e.appIndex, e.appArgs, e.accounts, e.foreignApps, e.foreignAssets, e.note, e.lease, e.rekeyTo);
}
function L(e, t, r, i, a, c, u, l, h, p) {
const f = {
type: s.i.appl,
from: e,
suggestedParams: t,
appIndex: r,
appOnComplete: o.h.ClearStateOC,
appArgs: i,
appAccounts: a,
appForeignApps: c,
appForeignAssets: u,
note: l,
lease: h,
reKeyTo: p
};
return new n.Transaction(f);
}
function F(e) {
return L(e.from, e.suggestedParams, e.appIndex, e.appArgs, e.accounts, e.foreignApps, e.foreignAssets, e.note, e.lease, e.rekeyTo);
}
function j(e, t, r, i, a, c, u, l, h, p) {
const f = {
type: s.i.appl,
from: e,
suggestedParams: t,
appIndex: r,
appOnComplete: o.h.NoOpOC,
appArgs: i,
appAccounts: a,
appForeignApps: c,
appForeignAssets: u,
note: l,
lease: h,
reKeyTo: p
};
return new n.Transaction(f);
}
function z(e) {
return j(e.from, e.suggestedParams, e.appIndex, e.appArgs, e.accounts, e.foreignApps, e.foreignAssets, e.note, e.lease, e.rekeyTo);
}
function M(e) {
const t = {
type: s.i.appl,
from: e.from,
suggestedParams: e.suggestedParams,
appIndex: e.appIndex,
appOnComplete: e.onComplete,
appLocalInts: e.numLocalInts,
appLocalByteSlices: e.numLocalByteSlices,
appGlobalInts: e.numGlobalInts,
appGlobalByteSlices: e.numGlobalByteSlices,
appApprovalProgram: e.approvalProgram,
appClearProgram: e.clearProgram,
appArgs: e.appArgs,
appAccounts: e.accounts,
appForeignApps: e.foreignApps,
appForeignAssets: e.foreignAssets,
note: e.note,
lease: e.lease,
reKeyTo: e.rekeyTo,
extraPages: e.extraPages
};
return new n.Transaction(t);
}
},
3510: (e, t, r) => {
"use strict";
r.d(t, {
vC: () => g,
w3: () => l,
OF: () => d,
Ch: () => p,
QX: () => f,
mE: () => h
});
const n = ["abandon", "ability", "able", "about", "above", "absent", "absorb", "abstract", "absurd", "abuse", "access", "accident", "account", "accuse", "achieve", "acid", "acoustic", "acquire", "across", "act", "action", "actor", "actress", "actual", "adapt", "add", "addict", "address", "adjust", "admit", "adult", "advance", "advice", "aerobic", "affair", "afford", "afraid", "again", "age", "agent", "agree", "ahead", "aim", "air", "airport", "aisle", "alarm", "album", "alcohol", "alert", "alien", "all", "alley", "allow", "almost", "alone", "alpha", "already", "also", "alter", "always", "amateur", "amazing", "among", "amount", "amused", "analyst", "anchor", "ancient", "anger", "angle", "angry", "animal", "ankle", "announce", "annual", "another", "answer", "antenna", "antique", "anxiety", "any", "apart", "apology", "appear", "apple", "approve", "april", "arch", "arctic", "area", "arena", "argue", "arm", "armed", "armor", "army", "around", "arrange", "arrest", "arrive", "arrow", "art", "artefact", "artist", "artwork", "ask", "aspect", "assault", "asset", "assist", "assume", "asthma", "athlete", "atom", "attack", "attend", "attitude", "attract", "auction", "audit", "august", "aunt", "author", "auto", "autumn", "average", "avocado", "avoid", "awake", "aware", "away", "awesome", "awful", "awkward", "axis", "baby", "bachelor", "bacon", "badge", "bag", "balance", "balcony", "ball", "bamboo", "banana", "banner", "bar", "barely", "bargain", "barrel", "base", "basic", "basket", "battle", "beach", "bean", "beauty", "because", "become", "beef", "before", "begin", "behave", "behind", "believe", "below", "belt", "bench", "benefit", "best", "betray", "better", "between", "beyond", "bicycle", "bid", "bike", "bind", "biology", "bird", "birth", "bitter", "black", "blade", "blame", "blanket", "blast", "bleak", "bless", "blind", "blood", "blossom", "blouse", "blue", "blur", "blush", "board", "boat", "body", "boil", "bomb", "bone", "bonus", "book", "boost", "border", "boring", "borrow", "boss", "bottom", "bounce", "box", "boy", "bracket", "brain", "brand", "brass", "brave", "bread", "breeze", "brick", "bridge", "brief", "bright", "bring", "brisk", "broccoli", "broken", "bronze", "broom", "brother", "brown", "brush", "bubble", "buddy", "budget", "buffalo", "build", "bulb", "bulk", "bullet", "bundle", "bunker", "burden", "burger", "burst", "bus", "business", "busy", "butter", "buyer", "buzz", "cabbage", "cabin", "cable", "cactus", "cage", "cake", "call", "calm", "camera", "camp", "can", "canal", "cancel", "candy", "cannon", "canoe", "canvas", "canyon", "capable", "capital", "captain", "car", "carbon", "card", "cargo", "carpet", "carry", "cart", "case", "cash", "casino", "castle", "casual", "cat", "catalog", "catch", "category", "cattle", "caught", "cause", "caution", "cave", "ceiling", "celery", "cement", "census", "century", "cereal", "certain", "chair", "chalk", "champion", "change", "chaos", "chapter", "charge", "chase", "chat", "cheap", "check", "cheese", "chef", "cherry", "chest", "chicken", "chief", "child", "chimney", "choice", "choose", "chronic", "chuckle", "chunk", "churn", "cigar", "cinnamon", "circle", "citizen", "city", "civil", "claim", "clap", "clarify", "claw", "clay", "clean", "clerk", "clever", "click", "client", "cliff", "climb", "clinic", "clip", "clock", "clog", "close", "cloth", "cloud", "clown", "club", "clump", "cluster", "clutch", "coach", "coast", "coconut", "code", "coffee", "coil", "coin", "collect", "color", "column", "combine", "come", "comfort", "comic", "common", "company", "concert", "conduct", "confirm", "congress", "connect", "consider", "control", "convince", "cook", "cool", "copper", "copy", "coral", "core", "corn", "correct", "cost", "cotton", "couch", "country", "couple", "course", "cousin", "cover", "coyote", "crack", "cradle", "craft", "cram", "crane", "crash", "crater", "crawl", "crazy", "cream", "credit", "creek", "crew", "cricket", "crime", "crisp", "critic", "crop", "cross", "crouch", "crowd", "crucial", "cruel", "cruise", "crumble", "crunch", "crush", "cry", "crystal", "cube", "culture", "cup", "cupboard", "curious", "current", "curtain", "curve", "cushion", "custom", "cute", "cycle", "dad", "damage", "damp", "dance", "danger", "daring", "dash", "daughter", "dawn", "day", "deal", "debate", "debris", "decade", "december", "decide", "decline", "decorate", "decrease", "deer", "defense", "define", "defy", "degree", "delay", "deliver", "demand", "demise", "denial", "dentist", "deny", "depart", "depend", "deposit", "depth", "deputy", "derive", "describe", "desert", "design", "desk", "despair", "destroy", "detail", "detect", "develop", "device", "devote", "diagram", "dial", "diamond", "diary", "dice", "diesel", "diet", "differ", "digital", "dignity", "dilemma", "dinner", "dinosaur", "direct", "dirt", "disagree", "discover", "disease", "dish", "dismiss", "disorder", "display", "distance", "divert", "divide", "divorce", "dizzy", "doctor", "document", "dog", "doll", "dolphin", "domain", "donate", "donkey", "donor", "door", "dose", "double", "dove", "draft", "dragon", "drama", "drastic", "draw", "dream", "dress", "drift", "drill", "drink", "drip", "drive", "drop", "drum", "dry", "duck", "dumb", "dune", "during", "dust", "dutch", "duty", "dwarf", "dynamic", "eager", "eagle", "early", "earn", "earth", "easily", "east", "easy", "echo", "ecology", "economy", "edge", "edit", "educate", "effort", "egg", "eight", "either", "elbow", "elder", "electric", "elegant", "element", "elephant", "elevator", "elite", "else", "embark", "embody", "embrace", "emerge", "emotion", "employ", "empower", "empty", "enable", "enact", "end", "endless", "endorse", "enemy", "energy", "enforce", "engage", "engine", "enhance", "enjoy", "enlist", "enough", "enrich", "enroll", "ensure", "enter", "entire", "entry", "envelope", "episode", "equal", "equip", "era", "erase", "erode", "erosion", "error", "erupt", "escape", "essay", "essence", "estate", "eternal", "ethics", "evidence", "evil", "evoke", "evolve", "exact", "example", "excess", "exchange", "excite", "exclude", "excuse", "execute", "exercise", "exhaust", "exhibit", "exile", "exist", "exit", "exotic", "expand", "expect", "expire", "explain", "expose", "express", "extend", "extra", "eye", "eyebrow", "fabric", "face", "faculty", "fade", "faint", "faith", "fall", "false", "fame", "family", "famous", "fan", "fancy", "fantasy", "farm", "fashion", "fat", "fatal", "father", "fatigue", "fault", "favorite", "feature", "february", "federal", "fee", "feed", "feel", "female", "fence", "festival", "fetch", "fever", "few", "fiber", "fiction", "field", "figure", "file", "film", "filter", "final", "find", "fine", "finger", "finish", "fire", "firm", "first", "fiscal", "fish", "fit", "fitness", "fix", "flag", "flame", "flash", "flat", "flavor", "flee", "flight", "flip", "float", "flock", "floor", "flower", "fluid", "flush", "fly", "foam", "focus", "fog", "foil", "fold", "follow", "food", "foot", "force", "forest", "forget", "fork", "fortune", "forum", "forward", "fossil", "foster", "found", "fox", "fragile", "frame", "frequent", "fresh", "friend", "fringe", "frog", "front", "frost", "frown", "frozen", "fruit", "fuel", "fun", "funny", "furnace", "fury", "future", "gadget", "gain", "galaxy", "gallery", "game", "gap", "garage", "garbage", "garden", "garlic", "garment", "gas", "gasp", "gate", "gather", "gauge", "gaze", "general", "genius", "genre", "gentle", "genuine", "gesture", "ghost", "giant", "gift", "giggle", "ginger", "giraffe", "girl", "give", "glad", "glance", "glare", "glass", "glide", "glimpse", "globe", "gloom", "glory", "glove", "glow", "glue", "goat", "goddess", "gold", "good", "goose", "gorilla", "gospel", "gossip", "govern", "gown", "grab", "grace", "grain", "grant", "grape", "grass", "gravity", "great", "green", "grid", "grief", "grit", "grocery", "group", "grow", "grunt", "guard", "guess", "guide", "guilt", "guitar", "gun", "gym", "habit", "hair", "half", "hammer", "hamster", "hand", "happy", "harbor", "hard", "harsh", "harvest", "hat", "have", "hawk", "hazard", "head", "health", "heart", "heavy", "hedgehog", "height", "hello", "helmet", "help", "hen", "hero", "hidden", "high", "hill", "hint", "hip", "hire", "history", "hobby", "hockey", "hold", "hole", "holiday", "hollow", "home", "honey", "hood", "hope", "horn", "horror", "horse", "hospital", "host", "hotel", "hour", "hover", "hub", "huge", "human", "humble", "humor", "hundred", "hungry", "hunt", "hurdle", "hurry", "hurt", "husband", "hybrid", "ice", "icon", "idea", "identify", "idle", "ignore", "ill", "illegal", "illness", "image", "imitate", "immense", "immune", "impact", "impose", "improve", "impulse", "inch", "include", "income", "increase", "index", "indicate", "indoor", "industry", "infant", "inflict", "inform", "inhale", "inherit", "initial", "inject", "injury", "inmate", "inner", "innocent", "input", "inquiry", "insane", "insect", "inside", "inspire", "install", "intact", "interest", "into", "invest", "invite", "involve", "iron", "island", "isolate", "issue", "item", "ivory", "jacket", "jaguar", "jar", "jazz", "jealous", "jeans", "jelly", "jewel", "job", "join", "joke", "journey", "joy", "judge", "juice", "jump", "jungle", "junior", "junk", "just", "kangaroo", "keen", "keep", "ketchup", "key", "kick", "kid", "kidney", "kind", "kingdom", "kiss", "kit", "kitchen", "kite", "kitten", "kiwi", "knee", "knife", "knock", "know", "lab", "label", "labor", "ladder", "lady", "lake", "lamp", "language", "laptop", "large", "later", "latin", "laugh", "laundry", "lava", "law", "lawn", "lawsuit", "layer", "lazy", "leader", "leaf", "learn", "leave", "lecture", "left", "leg", "legal", "legend", "leisure", "lemon", "lend", "length", "lens", "leopard", "lesson", "letter", "level", "liar", "liberty", "library", "license", "life", "lift", "light", "like", "limb", "limit", "link", "lion", "liquid", "list", "little", "live", "lizard", "load", "loan", "lobster", "local", "lock", "logic", "lonely", "long", "loop", "lottery", "loud", "lounge", "love", "loyal", "lucky", "luggage", "lumber", "lunar", "lunch", "luxury", "lyrics", "machine", "mad", "magic", "magnet", "maid", "mail", "main", "major", "make", "mammal", "man", "manage", "mandate", "mango", "mansion", "manual", "maple", "marble", "march", "margin", "marine", "market", "marriage", "mask", "mass", "master", "match", "material", "math", "matrix", "matter", "maximum", "maze", "meadow", "mean", "measure", "meat", "mechanic", "medal", "media", "melody", "melt", "member", "memory", "mention", "menu", "mercy", "merge", "merit", "merry", "mesh", "message", "metal", "method", "middle", "midnight", "milk", "million", "mimic", "mind", "minimum", "minor", "minute", "miracle", "mirror", "misery", "miss", "mistake", "mix", "mixed", "mixture", "mobile", "model", "modify", "mom", "moment", "monitor", "monkey", "monster", "month", "moon", "moral", "more", "morning", "mosquito", "mother", "motion", "motor", "mountain", "mouse", "move", "movie", "much", "muffin", "mule", "multiply", "muscle", "museum", "mushroom", "music", "must", "mutual", "myself", "mystery", "myth", "naive", "name", "napkin", "narrow", "nasty", "nation", "nature", "near", "neck", "need", "negative", "neglect", "neither", "nephew", "nerve", "nest", "net", "network", "neutral", "never", "news", "next", "nice", "night", "noble", "noise", "nominee", "noodle", "normal", "north", "nose", "notable", "note", "nothing", "notice", "novel", "now", "nuclear", "number", "nurse", "nut", "oak", "obey", "object", "oblige", "obscure", "observe", "obtain", "obvious", "occur", "ocean", "october", "odor", "off", "offer", "office", "often", "oil", "okay", "old", "olive", "olympic", "omit", "once", "one", "onion", "online", "only", "open", "opera", "opinion", "oppose", "option", "orange", "orbit", "orchard", "order", "ordinary", "organ", "orient", "original", "orphan", "ostrich", "other", "outdoor", "outer", "output", "outside", "oval", "oven", "over", "own", "owner", "oxygen", "oyster", "ozone", "pact", "paddle", "page", "pair", "palace", "palm", "panda", "panel", "panic", "panther", "paper", "parade", "parent", "park", "parrot", "party", "pass", "patch", "path", "patient", "patrol", "pattern", "pause", "pave", "payment", "peace", "peanut", "pear", "peasant", "pelican", "pen", "penalty", "pencil", "people", "pepper", "perfect", "permit", "person", "pet", "phone", "photo", "phrase", "physical", "piano", "picnic", "picture", "piece", "pig", "pigeon", "pill", "pilot", "pink", "pioneer", "pipe", "pistol", "pitch", "pizza", "place", "planet", "plastic", "plate", "play", "please", "pledge", "pluck", "plug", "plunge", "poem", "poet", "point", "polar", "pole", "police", "pond", "pony", "pool", "popular", "portion", "position", "possible", "post", "potato", "pottery", "poverty", "powder", "power", "practice", "praise", "predict", "prefer", "prepare", "present", "pretty", "prevent", "price", "pride", "primary", "print", "priority", "prison", "private", "prize", "problem", "process", "produce", "profit", "program", "project", "promote", "proof", "property", "prosper", "protect", "proud", "provide", "public", "pudding", "pull", "pulp", "pulse", "pumpkin", "punch", "pupil", "puppy", "purchase", "purity", "purpose", "purse", "push", "put", "puzzle", "pyramid", "quality", "quantum", "quarter", "question", "quick", "quit", "quiz", "quote", "rabbit", "raccoon", "race", "rack", "radar", "radio", "rail", "rain", "raise", "rally", "ramp", "ranch", "random", "range", "rapid", "rare", "rate", "rather", "raven", "raw", "razor", "ready", "real", "reason", "rebel", "rebuild", "recall", "receive", "recipe", "record", "recycle", "reduce", "reflect", "reform", "refuse", "region", "regret", "regular", "reject", "relax", "release", "relief", "rely", "remain", "remember", "remind", "remove", "render", "renew", "rent", "reopen", "repair", "repeat", "replace", "report", "require", "rescue", "resemble", "resist", "resource", "response", "result", "retire", "retreat", "return", "reunion", "reveal", "review", "reward", "rhythm", "rib", "ribbon", "rice", "rich", "ride", "ridge", "rifle", "right", "rigid", "ring", "riot", "ripple", "risk", "ritual", "rival", "river", "road", "roast", "robot", "robust", "rocket", "romance", "roof", "rookie", "room", "rose", "rotate", "rough", "round", "route", "royal", "rubber", "rude", "rug", "rule", "run", "runway", "rural", "sad", "saddle", "sadness", "safe", "sail", "salad", "salmon", "salon", "salt", "salute", "same", "sample", "sand", "satisfy", "satoshi", "sauce", "sausage", "save", "say", "scale", "scan", "scare", "scatter", "scene", "scheme", "school", "science", "scissors", "scorpion", "scout", "scrap", "screen", "script", "scrub", "sea", "search", "season", "seat", "second", "secret", "section", "security", "seed", "seek", "segment", "select", "sell", "seminar", "senior", "sense", "sentence", "series", "service", "session", "settle", "setup", "seven", "shadow", "shaft", "shallow", "share", "shed", "shell", "sheriff", "shield", "shift", "shine", "ship", "shiver", "shock", "shoe", "shoot", "shop", "short", "shoulder", "shove", "shrimp", "shrug", "shuffle", "shy", "sibling", "sick", "side", "siege", "sight", "sign", "silent", "silk", "silly", "silver", "similar", "simple", "since", "sing", "siren", "sister", "situate", "six", "size", "skate", "sketch", "ski", "skill", "skin", "skirt", "skull", "slab", "slam", "sleep", "slender", "slice", "slide", "slight", "slim", "slogan", "slot", "slow", "slush", "small", "smart", "smile", "smoke", "smooth", "snack", "snake", "snap", "sniff", "snow", "soap", "soccer", "social", "sock", "soda", "soft", "solar", "soldier", "solid", "solution", "solve", "someone", "song", "soon", "sorry", "sort", "soul", "sound", "soup", "source", "south", "space", "spare", "spatial", "spawn", "speak", "special", "speed", "spell", "spend", "sphere", "spice", "spider", "spike", "spin", "spirit", "split", "spoil", "sponsor", "spoon", "sport", "spot", "spray", "spread", "spring", "spy", "square", "squeeze", "squirrel", "stable", "stadium", "staff", "stage", "stairs", "stamp", "stand", "start", "state", "stay", "steak", "steel", "stem", "step", "stereo", "stick", "still", "sting", "stock", "stomach", "stone", "stool", "story", "stove", "strategy", "street", "strike", "strong", "struggle", "student", "stuff", "stumble", "style", "subject", "submit", "subway", "success", "such", "sudden", "suffer", "sugar", "suggest", "suit", "summer", "sun", "sunny", "sunset", "super", "supply", "supreme", "sure", "surface", "surge", "surprise", "surround", "survey", "suspect", "sustain", "swallow", "swamp", "swap", "swarm", "swear", "sweet", "swift", "swim", "swing", "switch", "sword", "symbol", "symptom", "syrup", "system", "table", "tackle", "tag", "tail", "talent", "talk", "tank", "tape", "target", "task", "taste", "tattoo", "taxi", "teach", "team", "tell", "ten", "tenant", "tennis", "tent", "term", "test", "text", "thank", "that", "theme", "then", "theory", "there", "they", "thing", "this", "thought", "three", "thrive", "throw", "thumb", "thunder", "ticket", "tide", "tiger", "tilt", "timber", "time", "tiny", "tip", "tired", "tissue", "title", "toast", "tobacco", "today", "toddler", "toe", "together", "toilet", "token", "tomato", "tomorrow", "tone", "tongue", "tonight", "tool", "tooth", "top", "topic", "topple", "torch", "tornado", "tortoise", "toss", "total", "tourist", "toward", "tower", "town", "toy", "track", "trade", "traffic", "tragic", "train", "transfer", "trap", "trash", "travel", "tray", "treat", "tree", "trend", "trial", "tribe", "trick", "trigger", "trim", "trip", "trophy", "trouble", "truck", "true", "truly", "trumpet", "trust", "truth", "try", "tube", "tuition", "tumble", "tuna", "tunnel", "turkey", "turn", "turtle", "twelve", "twenty", "twice", "twin", "twist", "two", "type", "typical", "ugly", "umbrella", "unable", "unaware", "uncle", "uncover", "under", "undo", "unfair", "unfold", "unhappy", "uniform", "unique", "unit", "universe", "unknown", "unlock", "until", "unusual", "unveil", "update", "upgrade", "uphold", "upon", "upper", "upset", "urban", "urge", "usage", "use", "used", "useful", "useless", "usual", "utility", "vacant", "vacuum", "vague", "valid", "valley", "valve", "van", "vanish", "vapor", "various", "vast", "vault", "vehicle", "velvet", "vendor", "venture", "venue", "verb", "verify", "version", "very", "vessel", "veteran", "viable", "vibrant", "vicious", "victory", "video", "view", "village", "vintage", "violin", "virtual", "virus", "visa", "visit", "visual", "vital", "vivid", "vocal", "voice", "void", "volcano", "volume", "vote", "voyage", "wage", "wagon", "wait", "walk", "wall", "walnut", "want", "warfare", "warm", "warrior", "wash", "wasp", "waste", "water", "wave", "way", "wealth", "weapon", "wear", "weasel", "weather", "web", "wedding", "weekend", "weird", "welcome", "west", "wet", "whale", "what", "wheat", "wheel", "when", "where", "whip", "whisper", "wide", "width", "wife", "wild", "will", "win", "window", "wine", "wing", "wink", "winner", "winter", "wire", "wisdom", "wise", "wish", "witness", "wolf", "woman", "wonder", "wood", "wool", "word", "work", "world", "worry", "worth", "wrap", "wreck", "wrestle", "wrist", "write", "wrong", "yard", "year", "yellow", "you", "young", "youth", "zebra", "zero", "zone", "zoo"];
var o = r(9404),
s = r(7116);
const i = "failed to decode mnemonic";
function a(e) {
const t = [];
let r = 0,
n = 0;
return e.forEach(function (e) {
r |= e << n, n += 8, n >= 11 && (t.push(2047 & r), r >>= 11, n -= 11);
}), n && t.push(r), t;
}
function c(e) {
return e.map(e => n[e]);
}
function u(e) {
return c(a(o.genericHash(e)))[0];
}
function l(e) {
if (e.length !== o.SEED_BTYES_LENGTH) throw new RangeError(`Seed length must be ${o.SEED_BTYES_LENGTH}`);
const t = c(a(e)),
r = u(e);
return `${t.join(" ")} ${r}`;
}
function h(e) {
const t = e.split(" "),
r = t.slice(0, 24);
for (const e of r) if (-1 === n.indexOf(e)) throw new Error("the mnemonic contains a word that is not in the wordlist");
const o = t[t.length - 1];
let s = function (e) {
const t = [];
let r = 0,
n = 0;
return e.forEach(function (e) {
for (r |= e << n, n += 11; n >= 8;) t.push(255 & r), r >>= 8, n -= 8;
}), n && t.push(r), new Uint8Array(t);
}(r.map(e => n.indexOf(e)));
if (33 !== s.length) throw new Error(i);
if (0 !== s[s.length - 1]) throw new Error(i);
if (s = s.slice(0, s.length - 1), u(s) === o) return s;
throw new Error(i);
}
function p(e) {
const t = h(e),
r = o.keyPairFromSeed(t);
return {
addr: s.encodeAddress(r.publicKey),
sk: r.secretKey
};
}
function f(e) {
return l(e.slice(0, o.SEED_BTYES_LENGTH));
}
function d(e) {
return h(e);
}
function g(e) {
return l(e);
}
},
4158: (e, t, r) => {
"use strict";
r.d(t, {
J6: () => p,
F2: () => f,
PU: () => d,
PO: () => g,
vH: () => y
});
var n = r(9404),
o = r(7116),
s = r(3033),
i = r(9417),
a = r(413),
c = r(2486).Buffer;
const u = "Cannot merge txs. Multisig preimages differ",
l = "Cannot mutate a multisig field as it would invalidate all existing signatures.";
class h extends i.Transaction {
addLease() {
throw new Error(l);
}
addRekey() {
throw new Error(l);
}
signTxn(e) {
throw new Error("Cannot sign a multisig transaction using `signTxn`. Use `partialSignTxn` instead.");
}
partialSignTxn({
version: e,
threshold: t,
pks: r
}, i) {
const a = n.keyPairFromSecretKey(i).publicKey;
return function (e, {
rawSig: t,
myPk: r
}, {
version: i,
threshold: a,
pks: u
}) {
let l = !1;
const h = u.map(e => n.bytesEqual(e, r) ? (l = !0, {
pk: c.from(e),
s: t
}) : {
pk: c.from(e)
});
if (!1 === l) throw new Error("Key does not exist");
const p = {
msig: {
v: i,
thr: a,
subsig: h
},
txn: e
},
f = o.fromMultisigPreImg({
version: i,
threshold: a,
pks: u
});
return o.encodeAddress(e.snd) !== o.encodeAddress(f) && (p.sgnr = c.from(f)), new Uint8Array(s.encode(p));
}(this.get_obj_for_encoding(), {
rawSig: this.rawSignTxn(i),
myPk: a
}, {
version: e,
threshold: t,
pks: r
});
}
static from_obj_for_encoding(e) {
return super.from_obj_for_encoding(e);
}
}
function p(e) {
if (e.length < 2) throw new Error("Not enough multisig transactions to merge. Need at least two");
const t = s.decode(e[0]),
r = h.from_obj_for_encoding(t.txn).txID(),
n = t.sgnr ? o.encodeAddress(t.sgnr) : void 0,
i = {
version: t.msig.v,
threshold: t.msig.thr,
pks: t.msig.subsig.map(e => e.pk)
},
a = o.encodeAddress(o.fromMultisigPreImg(i));
let l = t.msig.subsig;
for (let i = 0; i < e.length; i++) {
const p = s.decode(e[i]);
if (h.from_obj_for_encoding(p.txn).txID() !== r) throw new Error("Cannot merge txs. txIDs differ");
if (n !== (p.sgnr ? o.encodeAddress(p.sgnr) : void 0)) throw new Error("Cannot merge txs. Auth addrs differ");
if (p.msig.subsig.length !== t.msig.subsig.length) throw new Error(u);
const f = {
version: p.msig.v,
threshold: p.msig.thr,
pks: p.msig.subsig.map(e => e.pk)
};
if (a !== o.encodeAddress(o.fromMultisigPreImg(f))) throw new Error(u);
l = p.msig.subsig.map((e, r) => {
const n = t.msig.subsig[r];
if (n.s) {
if (e.s && 0 !== c.compare(c.from(e.s), c.from(n.s))) throw new Error("Cannot merge txs. subsigs are mismatched.");
return {
pk: n.pk,
s: n.s
};
}
return e.s ? {
pk: n.pk,
s: e.s
} : n;
});
}
const p = {
msig: {
v: t.msig.v,
thr: t.msig.thr,
subsig: l
},
txn: t.txn
};
return void 0 !== n && (p.sgnr = c.from(o.decodeAddress(n).publicKey)), new Uint8Array(s.encode(p));
}
function f(e, t, r) {
const s = t.v,
i = t.thr,
c = t.subsig,
u = c.map(e => e.pk);
if (t.subsig.length < i) return !1;
let l;
try {
l = o.fromMultisigPreImg({
version: s,
threshold: i,
pks: u
});
} catch (e) {
return !1;
}
if (!a.arrayEqual(l, r)) return !1;
let h = 0;
for (const e of c) void 0 !== e.s && (h += 1);
if (h < i) return !1;
let p = 0;
for (const t of c) void 0 !== t.s && n.verify(e, t.s, t.pk) && (p += 1);
return !(p < i);
}
function d(e, {
version: t,
threshold: r,
addrs: n
}, s) {
const a = o.fromMultisigPreImgAddrs({
version: t,
threshold: r,
addrs: n
});
Object.prototype.hasOwnProperty.call(e, "from") || (e.from = a);
const c = n.map(e => o.decodeAddress(e).publicKey);
let u, l;
return e instanceof i.Transaction ? (u = e, l = h.prototype.partialSignTxn.call(u, {
version: t,
threshold: r,
pks: c
}, s)) : (u = new h(e), l = u.partialSignTxn({
version: t,
threshold: r,
pks: c
}, s)), {
txID: u.txID().toString(),
blob: l
};
}
function g(e, {
version: t,
threshold: r,
addrs: n
}, i) {
const a = n.map(e => o.decodeAddress(e).publicKey),
c = s.decode(e),
u = h.from_obj_for_encoding(c.txn),
l = u.partialSignTxn({
version: t,
threshold: r,
pks: a
}, i);
return {
txID: u.txID().toString(),
blob: p([e, l])
};
}
function y({
version: e,
threshold: t,
addrs: r
}) {
return o.fromMultisigPreImgAddrs({
version: e,
threshold: t,
addrs: r
});
}
},
9404: (e, t, r) => {
"use strict";
r.r(t), r.d(t, {
genericHash: () => a,
randomBytes: () => c,
keyPairFromSeed: () => u,
keyPair: () => l,
keyPairFromSecretKey: () => h,
sign: () => p,
bytesEqual: () => f,
verify: () => d,
PUBLIC_KEY_LENGTH: () => g,
SECRET_KEY_LENGTH: () => y,
HASH_BYTES_LENGTH: () => m,
SEED_BTYES_LENGTH: () => b
});
var n = r(7765),
o = r.n(n),
s = r(9757),
i = r.n(s);
function a(e) {
return i().sha512_256.array(e);
}
function c(e) {
return o().randomBytes(e);
}
function u(e) {
return o().sign.keyPair.fromSeed(e);
}
function l() {
return u(c(o().box.secretKeyLength));
}
function h(e) {
return o().sign.keyPair.fromSecretKey(e);
}
function p(e, t) {
return o().sign.detached(e, t);
}
function f(e, t) {
return o().verify(e, t);
}
function d(e, t, r) {
return o().sign.detached.verify(e, t, r);
}
const g = o().sign.publicKeyLength,
y = o().sign.secretKeyLength,
m = 32,
b = 32;
},
834: (e, t, r) => {
"use strict";
r.d(t, {
x7: () => s,
i1: () => i,
Vj: () => a,
Xw: () => c
});
var n = r(8800),
o = r(4158);
function s(e) {
return (t, r) => {
const n = [];
for (const o of r) n.push(t[o].signTxn(e.sk));
return Promise.resolve(n);
};
}
function i(e) {
return (t, r) => {
const o = [];
for (const s of r) {
const {
blob: r
} = (0, n.signLogicSigTransactionObject)(t[s], e);
o.push(r);
}
return Promise.resolve(o);
};
}
function a(e, t) {
return (r, n) => {
const s = [];
for (const i of n) {
const n = r[i],
a = [];
for (const r of t) {
const {
blob: t
} = (0, o.PU)(n, e, r);
a.push(t);
}
s.push((0, o.J6)(a));
}
return Promise.resolve(s);
};
}
function c(e) {
return "object" == typeof e && 2 === Object.keys(e).length && "object" == typeof e.txn && "function" == typeof e.signer;
}
},
9417: (e, t, r) => {
"use strict";
r.r(t), r.d(t, {
ALGORAND_MIN_TX_FEE: () => h,
Transaction: () => p,
encodeUnsignedTransaction: () => f,
decodeUnsignedTransaction: () => d,
decodeSignedTransaction: () => g,
instantiateTxnIfNeeded: () => y,
default: () => m
});
var n = r(7267),
o = r.n(n),
s = r(7116),
i = r(3033),
a = r(9404),
c = r(413),
u = r(1624),
l = r(2486).Buffer;
const h = 1e3;
class p {
constructor({ ...e
}) {
this.name = "Transaction", this.tag = l.from("TX");
const t = {
type: u.i.pay,
flatFee: !1,
nonParticipation: !1
};
if (void 0 === e.type && (e.type = t.type), void 0 === e.flatFee && (e.flatFee = t.flatFee), e.type === u.i.keyreg && void 0 !== e.voteKey && void 0 === e.nonParticipation && (e.nonParticipation = t.nonParticipation), void 0 !== e.suggestedParams) {
const t = e;
t.genesisHash = t.suggestedParams.genesisHash, t.fee = t.suggestedParams.fee, void 0 !== t.suggestedParams.flatFee && (t.flatFee = t.suggestedParams.flatFee), t.firstRound = t.suggestedParams.firstRound, t.lastRound = t.suggestedParams.lastRound, t.genesisID = t.suggestedParams.genesisID;
}
const r = e;
if (r.from = s.decodeAddress(r.from), void 0 !== r.to && (r.to = s.decodeAddress(r.to)), void 0 !== r.closeRemainderTo && (r.closeRemainderTo = s.decodeAddress(r.closeRemainderTo)), void 0 !== r.assetManager && (r.assetManager = s.decodeAddress(r.assetManager)), void 0 !== r.assetReserve && (r.assetReserve = s.decodeAddress(r.assetReserve)), void 0 !== r.assetFreeze && (r.assetFreeze = s.decodeAddress(r.assetFreeze)), void 0 !== r.assetClawback && (r.assetClawback = s.decodeAddress(r.assetClawback)), void 0 !== r.assetRevocationTarget && (r.assetRevocationTarget = s.decodeAddress(r.assetRevocationTarget)), void 0 !== r.freezeAccount && (r.freezeAccount = s.decodeAddress(r.freezeAccount)), void 0 !== r.reKeyTo && (r.reKeyTo = s.decodeAddress(r.reKeyTo)), void 0 === r.genesisHash) throw Error("genesis hash must be specified and in a base64 string.");
if (r.genesisHash = l.from(r.genesisHash, "base64"), void 0 !== r.amount && (!(Number.isSafeInteger(r.amount) || "bigint" == typeof r.amount && r.amount <= BigInt("0xffffffffffffffff")) || r.amount < 0)) throw Error("Amount must be a positive number and smaller than 2^64-1");
if (!Number.isSafeInteger(r.fee) || r.fee < 0) throw Error("fee must be a positive number and smaller than 2^53-1");
if (!Number.isSafeInteger(r.firstRound) || r.firstRound < 0) throw Error("firstRound must be a positive number");
if (!Number.isSafeInteger(r.lastRound) || r.lastRound < 0) throw Error("lastRound must be a positive number");
if (void 0 !== r.extraPages && (!Number.isInteger(r.extraPages) || r.extraPages < 0 || r.extraPages > 3)) throw Error("extraPages must be an Integer between and including 0 to 3");
if (void 0 !== r.assetTotal && (!(Number.isSafeInteger(r.assetTotal) || "bigint" == typeof r.assetTotal && r.assetTotal <= BigInt("0xffffffffffffffff")) || r.assetTotal < 0)) throw Error("Total asset issuance must be a positive number and smaller than 2^64-1");
if (void 0 !== r.assetDecimals && (!Number.isSafeInteger(r.assetDecimals) || r.assetDecimals < 0 || r.assetDecimals > 19)) throw Error(`assetDecimals must be a positive number and smaller than ${19..toString()}`);
if (void 0 !== r.assetIndex && (!Number.isSafeInteger(r.assetIndex) || r.assetIndex < 0)) throw Error("Asset index must be a positive number and smaller than 2^53-1");
if (void 0 !== r.appIndex && (!Number.isSafeInteger(r.appIndex) || r.appIndex < 0)) throw Error("Application index must be a positive number and smaller than 2^53-1");
if (void 0 !== r.appLocalInts && (!Number.isSafeInteger(r.appLocalInts) || r.appLocalInts < 0)) throw Error("Application local ints count must be a positive number and smaller than 2^53-1");
if (void 0 !== r.appLocalByteSlices && (!Number.isSafeInteger(r.appLocalByteSlices) || r.appLocalByteSlices < 0)) throw Error("Application local byte slices count must be a positive number and smaller than 2^53-1");
if (void 0 !== r.appGlobalInts && (!Number.isSafeInteger(r.appGlobalInts) || r.appGlobalInts < 0)) throw Error("Application global ints count must be a positive number and smaller than 2^53-1");
if (void 0 !== r.appGlobalByteSlices && (!Number.isSafeInteger(r.appGlobalByteSlices) || r.appGlobalByteSlices < 0)) throw Error("Application global byte slices count must be a positive number and smaller than 2^53-1");
if (void 0 !== r.appApprovalProgram && r.appApprovalProgram.constructor !== Uint8Array) throw Error("appApprovalProgram must be a Uint8Array.");
if (void 0 !== r.appClearProgram && r.appClearProgram.constructor !== Uint8Array) throw Error("appClearProgram must be a Uint8Array.");
if (void 0 !== r.appArgs) {
if (!Array.isArray(r.appArgs)) throw Error("appArgs must be an Array of Uint8Array.");
r.appArgs = r.appArgs.slice(), r.appArgs.forEach(e => {
if (e.constructor !== Uint8Array) throw Error("each element of AppArgs must be a Uint8Array.");
});
} else r.appArgs = [];
if (void 0 !== r.appAccounts) {
if (!Array.isArray(r.appAccounts)) throw Error("appAccounts must be an Array of addresses.");
r.appAccounts = r.appAccounts.map(e => s.decodeAddress(e));
}
if (void 0 !== r.appForeignApps) {
if (!Array.isArray(r.appForeignApps)) throw Error("appForeignApps must be an Array of integers.");
r.appForeignApps = r.appForeignApps.slice(), r.appForeignApps.forEach(e => {
if (!Number.isSafeInteger(e) || e < 0) throw Error("each foreign application index must be a positive number and smaller than 2^53-1");
});
}
if (void 0 !== r.appForeignAssets) {
if (!Array.isArray(r.appForeignAssets)) throw Error("appForeignAssets must be an Array of integers.");
r.appForeignAssets = r.appForeignAssets.slice(), r.appForeignAssets.forEach(e => {
if (!Number.isSafeInteger(e) || e < 0) throw Error("each foreign asset index must be a positive number and smaller than 2^53-1");
});
}
if (void 0 !== r.assetMetadataHash && 0 !== r.assetMetadataHash.length) {
if ("string" == typeof r.assetMetadataHash && (r.assetMetadataHash = new Uint8Array(l.from(r.assetMetadataHash))), r.assetMetadataHash.constructor !== Uint8Array || 32 !== r.assetMetadataHash.byteLength) throw Error("assetMetadataHash must be a 32 byte Uint8Array or string.");
r.assetMetadataHash.every(e => 0 === e) && (r.assetMetadataHash = void 0);
} else r.assetMetadataHash = void 0;
if (void 0 !== r.note) {
if (r.note.constructor !== Uint8Array) throw Error("note must be a Uint8Array.");
} else r.note = new Uint8Array(0);
if (void 0 !== r.lease) {
if (r.lease.constructor !== Uint8Array) throw Error("lease must be a Uint8Array.");
if (32 !== r.lease.length) throw Error(`lease must be of length ${32..toString()}.`);
r.lease.every(e => 0 === e) && (r.lease = new Uint8Array(0));
} else r.lease = new Uint8Array(0);
if (void 0 !== r.voteKey && (r.voteKey = l.from(r.voteKey, "base64")), void 0 !== r.selectionKey && (r.selectionKey = l.from(r.selectionKey, "base64")), r.nonParticipation && (r.voteKey || r.selectionKey || r.voteFirst || r.voteLast || r.voteKeyDilution)) throw new Error("nonParticipation is true but participation params are present.");
if (!r.nonParticipation && (r.voteKey || r.selectionKey || r.voteFirst || r.voteLast || r.voteKeyDilution) && !(r.voteKey && r.selectionKey && r.voteFirst && r.voteLast && r.voteKeyDilution)) throw new Error("online key registration missing at least one of the following fields: voteKey, selectionKey, voteFirst, voteLast, voteKeyDilution");
delete r.suggestedParams, Object.assign(this, c.removeUndefinedProperties(r)), r.flatFee || (this.fee *= this.estimateSize(), this.fee < h && (this.fee = h)), this.group = void 0;
}
get_obj_for_encoding() {
if ("pay" === this.type) {
const e = {
amt: this.amount,
fee: this.fee,
fv: this.firstRound,
lv: this.lastRound,
note: l.from(this.note),
snd: l.from(this.from.publicKey),
type: "pay",
gen: this.genesisID,
gh: this.genesisHash,
lx: l.from(this.lease),
grp: this.group
};
return void 0 !== this.closeRemainderTo && s.encodeAddress(this.closeRemainderTo.publicKey) !== s.ALGORAND_ZERO_ADDRESS_STRING && (e.close = l.from(this.closeRemainderTo.publicKey)), void 0 !== this.reKeyTo && (e.rekey = l.from(this.reKeyTo.publicKey)), void 0 !== this.to && (e.rcv = l.from(this.to.publicKey)), e.note.length || delete e.note, e.amt || delete e.amt, e.fee || delete e.fee, e.fv || delete e.fv, e.gen || delete e.gen, void 0 === e.grp && delete e.grp, e.lx.length || delete e.lx, e.rekey || delete e.rekey, e;
}
if ("keyreg" === this.type) {
const e = {
fee: this.fee,
fv: this.firstRound,
lv: this.lastRound,
note: l.from(this.note),
snd: l.from(this.from.publicKey),
type: this.type,
gen: this.genesisID,
gh: this.genesisHash,
lx: l.from(this.lease),
grp: this.group,
votekey: this.voteKey,
selkey: this.selectionKey,
votefst: this.voteFirst,
votelst: this.voteLast,
votekd: this.voteKeyDilution
};
return e.note.length || delete e.note, e.lx.length || delete e.lx, e.fee || delete e.fee, e.fv || delete e.fv, e.gen || delete e.gen, void 0 === e.grp && delete e.grp, void 0 !== this.reKeyTo && (e.rekey = l.from(this.reKeyTo.publicKey)), this.nonParticipation && (e.nonpart = !0), e.selkey || delete e.selkey, e.votekey || delete e.votekey, e.votefst || delete e.votefst, e.votelst || delete e.votelst, e.votekd || delete e.votekd, e;
}
if ("acfg" === this.type) {
const e = {
fee: this.fee,
fv: this.firstRound,
lv: this.lastRound,
note: l.from(this.note),
snd: l.from(this.from.publicKey),
type: this.type,
gen: this.genesisID,
gh: this.genesisHash,
lx: l.from(this.lease),
grp: this.group,
caid: this.assetIndex,
apar: {
t: this.assetTotal,
df: this.assetDefaultFrozen,
dc: this.assetDecimals
}
};
return void 0 !== this.assetManager && (e.apar.m = l.from(this.assetManager.publicKey)), void 0 !== this.assetReserve && (e.apar.r = l.from(this.assetReserve.publicKey)), void 0 !== this.assetFreeze && (e.apar.f = l.from(this.assetFreeze.publicKey)), void 0 !== this.assetClawback && (e.apar.c = l.from(this.assetClawback.publicKey)), void 0 !== this.assetName && (e.apar.an = this.assetName), void 0 !== this.assetUnitName && (e.apar.un = this.assetUnitName), void 0 !== this.assetURL && (e.apar.au = this.assetURL), void 0 !== this.assetMetadataHash && (e.apar.am = l.from(this.assetMetadataHash)), e.note.length || delete e.note, e.lx.length || delete e.lx, e.amt || delete e.amt, e.fee || delete e.fee, e.fv || delete e.fv, e.gen || delete e.gen, void 0 !== this.reKeyTo && (e.rekey = l.from(this.reKeyTo.publicKey)), e.caid || delete e.caid, e.apar.t || e.apar.un || e.apar.an || e.apar.df || e.apar.m || e.apar.r || e.apar.f || e.apar.c || e.apar.au || e.apar.am || e.apar.dc ? (e.apar.t || delete e.apar.t, e.apar.dc || delete e.apar.dc, e.apar.un || delete e.apar.un, e.apar.an || delete e.apar.an, e.apar.df || delete e.apar.df, e.apar.m || delete e.apar.m, e.apar.r || delete e.apar.r, e.apar.f || delete e.apar.f, e.apar.c || delete e.apar.c, e.apar.au || delete e.apar.au, e.apar.am || delete e.apar.am) : delete e.apar, void 0 === e.grp && delete e.grp, e;
}
if ("axfer" === this.type) {
const e = {
aamt: this.amount,
fee: this.fee,
fv: this.firstRound,
lv: this.lastRound,
note: l.from(this.note),
snd: l.from(this.from.publicKey),
arcv: l.from(this.to.publicKey),
type: this.type,
gen: this.genesisID,
gh: this.genesisHash,
lx: l.from(this.lease),
grp: this.group,
xaid: this.assetIndex
};
return void 0 !== this.closeRemainderTo && (e.aclose = l.from(this.closeRemainderTo.publicKey)), void 0 !== this.assetRevocationTarget && (e.asnd = l.from(this.assetRevocationTarget.publicKey)), e.note.length || delete e.note, e.lx.length || delete e.lx, e.aamt || delete e.aamt, e.amt || delete e.amt, e.fee || delete e.fee, e.fv || delete e.fv, e.gen || delete e.gen, void 0 === e.grp && delete e.grp, e.aclose || delete e.aclose, e.asnd || delete e.asnd, e.rekey || delete e.rekey, void 0 !== this.reKeyTo && (e.rekey = l.from(this.reKeyTo.publicKey)), e;
}
if ("afrz" === this.type) {
const e = {
fee: this.fee,
fv: this.firstRound,
lv: this.lastRound,
note: l.from(this.note),
snd: l.from(this.from.publicKey),
type: this.type,
gen: this.genesisID,
gh: this.genesisHash,
lx: l.from(this.lease),
grp: this.group,
faid: this.assetIndex,
afrz: this.freezeState
};
return void 0 !== this.freezeAccount && (e.fadd = l.from(this.freezeAccount.publicKey)), e.note.length || delete e.note, e.lx.length || delete e.lx, e.amt || delete e.amt, e.fee || delete e.fee, e.fv || delete e.fv, e.gen || delete e.gen, e.afrz || delete e.afrz, void 0 === e.grp && delete e.grp, void 0 !== this.reKeyTo && (e.rekey = l.from(this.reKeyTo.publicKey)), e;
}
if ("appl" === this.type) {
const e = {
fee: this.fee,
fv: this.firstRound,
lv: this.lastRound,
note: l.from(this.note),
snd: l.from(this.from.publicKey),
type: this.type,
gen: this.genesisID,
gh: this.genesisHash,
lx: l.from(this.lease),
grp: this.group,
apid: this.appIndex,
apan: this.appOnComplete,
apls: {
nui: this.appLocalInts,
nbs: this.appLocalByteSlices
},
apgs: {
nui: this.appGlobalInts,
nbs: this.appGlobalByteSlices
},
apfa: this.appForeignApps,
apas: this.appForeignAssets,
apep: this.extraPages
};
return void 0 !== this.reKeyTo && (e.rekey = l.from(this.reKeyTo.publicKey)), void 0 !== this.appApprovalProgram && (e.apap = l.from(this.appApprovalProgram)), void 0 !== this.appClearProgram && (e.apsu = l.from(this.appClearProgram)), void 0 !== this.appArgs && (e.apaa = this.appArgs.map(e => l.from(e))), void 0 !== this.appAccounts && (e.apat = this.appAccounts.map(e => l.from(e.publicKey))), e.note.length || delete e.note, e.lx.length || delete e.lx, e.amt || delete e.amt, e.fee || delete e.fee, e.fv || delete e.fv, e.gen || delete e.gen, e.apid || delete e.apid, e.apls.nui || delete e.apls.nui, e.apls.nbs || delete e.apls.nbs, e.apls.nui || e.apls.nbs || delete e.apls, e.apgs.nui || delete e.apgs.nui, e.apgs.nbs || delete e.apgs.nbs, e.apaa && e.apaa.length || delete e.apaa, e.apgs.nui || e.apgs.nbs || delete e.apgs, e.apap || delete e.apap, e.apsu || delete e.apsu, e.apan || delete e.apan, e.apfa && e.apfa.length || delete e.apfa, e.apas && e.apas.length || delete e.apas, e.apat && e.apat.length || delete e.apat, e.apep || delete e.apep, void 0 === e.grp && delete e.grp, e;
}
}
static from_obj_for_encoding(e) {
const t = Object.create(this.prototype);
return t.name = "Transaction", t.tag = l.from("TX"), t.genesisID = e.gen, t.genesisHash = l.from(e.gh), t.type = e.type, t.fee = e.fee, t.firstRound = e.fv, t.lastRound = e.lv, t.note = new Uint8Array(e.note), t.lease = new Uint8Array(e.lx), t.from = s.decodeAddress(s.encodeAddress(new Uint8Array(e.snd))), void 0 !== e.grp && (t.group = l.from(e.grp)), void 0 !== e.rekey && (t.reKeyTo = s.decodeAddress(s.encodeAddress(new Uint8Array(e.rekey)))), "pay" === e.type ? (t.amount = e.amt, t.to = s.decodeAddress(s.encodeAddress(new Uint8Array(e.rcv))), void 0 !== e.close && (t.closeRemainderTo = s.decodeAddress(s.encodeAddress(e.close)))) : "keyreg" === e.type ? (void 0 !== e.votekey && (t.voteKey = l.from(e.votekey)), void 0 !== e.selkey && (t.selectionKey = l.from(e.selkey)), void 0 !== e.votekd && (t.voteKeyDilution = e.votekd), void 0 !== e.votefst && (t.voteFirst = e.votefst), void 0 !== e.votelst && (t.voteLast = e.votelst), void 0 !== e.nonpart && (t.nonParticipation = e.nonpart)) : "acfg" === e.type ? (void 0 !== e.caid && (t.assetIndex = e.caid), void 0 !== e.apar && (t.assetTotal = e.apar.t, t.assetDefaultFrozen = e.apar.df, void 0 !== e.apar.dc && (t.assetDecimals = e.apar.dc), void 0 !== e.apar.m && (t.assetManager = s.decodeAddress(s.encodeAddress(new Uint8Array(e.apar.m)))), void 0 !== e.apar.r && (t.assetReserve = s.decodeAddress(s.encodeAddress(new Uint8Array(e.apar.r)))), void 0 !== e.apar.f && (t.assetFreeze = s.decodeAddress(s.encodeAddress(new Uint8Array(e.apar.f)))), void 0 !== e.apar.c && (t.assetClawback = s.decodeAddress(s.encodeAddress(new Uint8Array(e.apar.c)))), void 0 !== e.apar.un && (t.assetUnitName = e.apar.un), void 0 !== e.apar.an && (t.assetName = e.apar.an), void 0 !== e.apar.au && (t.assetURL = e.apar.au), void 0 !== e.apar.am && (t.assetMetadataHash = e.apar.am))) : "axfer" === e.type ? (void 0 !== e.xaid && (t.assetIndex = e.xaid), void 0 !== e.aamt && (t.amount = e.aamt), void 0 !== e.aclose && (t.closeRemainderTo = s.decodeAddress(s.encodeAddress(new Uint8Array(e.aclose)))), void 0 !== e.asnd && (t.assetRevocationTarget = s.decodeAddress(s.encodeAddress(new Uint8Array(e.asnd)))), t.to = s.decodeAddress(s.encodeAddress(new Uint8Array(e.arcv)))) : "afrz" === e.type ? (void 0 !== e.afrz && (t.freezeState = e.afrz), void 0 !== e.faid && (t.assetIndex = e.faid), t.freezeAccount = s.decodeAddress(s.encodeAddress(new Uint8Array(e.fadd)))) : "appl" === e.type && (void 0 !== e.apid && (t.appIndex = e.apid), void 0 !== e.apan && (t.appOnComplete = e.apan), void 0 !== e.apls && (void 0 !== e.apls.nui && (t.appLocalInts = e.apls.nui), void 0 !== e.apls.nbs && (t.appLocalByteSlices = e.apls.nbs)), void 0 !== e.apgs && (void 0 !== e.apgs.nui && (t.appGlobalInts = e.apgs.nui), void 0 !== e.apgs.nbs && (t.appGlobalByteSlices = e.apgs.nbs)), void 0 !== e.apep && (t.extraPages = e.apep), void 0 !== e.apap && (t.appApprovalProgram = new Uint8Array(e.apap)), void 0 !== e.apsu && (t.appClearProgram = new Uint8Array(e.apsu)), void 0 !== e.apaa && (t.appArgs = e.apaa.map(e => new Uint8Array(e))), void 0 !== e.apat && (t.appAccounts = e.apat.map(e => s.decodeAddress(s.encodeAddress(new Uint8Array(e))))), void 0 !== e.apfa && (t.appForeignApps = e.apfa), void 0 !== e.apas && (t.appForeignAssets = e.apas)), t;
}
estimateSize() {
return this.toByte().length + 75;
}
bytesToSign() {
const e = this.toByte();
return l.from(c.concatArrays(this.tag, e));
}
toByte() {
return i.encode(this.get_obj_for_encoding());
}
rawSignTxn(e) {
const t = this.bytesToSign(),
r = a.sign(t, e);
return l.from(r);
}
signTxn(e) {
const t = {
sig: this.rawSignTxn(e),
txn: this.get_obj_for_encoding()
},
r = a.keyPairFromSecretKey(e).publicKey;
return s.encodeAddress(r) !== s.encodeAddress(this.from.publicKey) && (t.sgnr = l.from(r)), new Uint8Array(i.encode(t));
}
rawTxID() {
const e = this.toByte(),
t = l.from(c.concatArrays(this.tag, e));
return l.from(a.genericHash(t));
}
txID() {
const e = this.rawTxID();
return o().encode(e).slice(0, 52);
}
addLease(e, t = 0) {
let r;
if (void 0 !== e) {
if (e.constructor !== Uint8Array) throw Error("lease must be a Uint8Array.");
if (32 !== e.length) throw Error(`lease must be of length ${32..toString()}.`);
r = new Uint8Array(e);
} else r = new Uint8Array(0);
this.lease = r, 0 !== t && (this.fee += 37 * t);
}
addRekey(e, t = 0) {
void 0 !== e && (this.reKeyTo = s.decodeAddress(e)), 0 !== t && (this.fee += 37 * t);
}
_getDictForDisplay() {
const e = { ...this
};
return e.tag = e.tag.toString(), e.from = s.encodeAddress(e.from.publicKey), void 0 !== e.to && (e.to = s.encodeAddress(e.to.publicKey)), void 0 !== e.freezeAccount && (e.freezeAccount = s.encodeAddress(e.freezeAccount.publicKey)), void 0 !== e.closeRemainderTo && (e.closeRemainderTo = s.encodeAddress(e.closeRemainderTo.publicKey)), void 0 !== e.assetManager && (e.assetManager = s.encodeAddress(e.assetManager.publicKey)), void 0 !== e.assetReserve && (e.assetReserve = s.encodeAddress(e.assetReserve.publicKey)), void 0 !== e.assetFreeze && (e.assetFreeze = s.encodeAddress(e.assetFreeze.publicKey)), void 0 !== e.assetClawback && (e.assetClawback = s.encodeAddress(e.assetClawback.publicKey)), void 0 !== e.assetRevocationTarget && (e.assetRevocationTarget = s.encodeAddress(e.assetRevocationTarget.publicKey)), void 0 !== e.reKeyTo && (e.reKeyTo = s.encodeAddress(e.reKeyTo.publicKey)), e.genesisHash = e.genesisHash.toString("base64"), e;
}
prettyPrint() {
console.log(this._getDictForDisplay());
}
toString() {
return JSON.stringify(this._getDictForDisplay());
}
}
function f(e) {
const t = e.get_obj_for_encoding();
return i.encode(t);
}
function d(e) {
const t = i.decode(e);
return p.from_obj_for_encoding(t);
}
function g(e) {
const t = i.decode(e);
return { ...t,
txn: p.from_obj_for_encoding(t.txn)
};
}
function y(e) {
return e instanceof p ? e : new p(e);
}
const m = p;
},
2380: (e, t, r) => {
"use strict";
r.d(t, {
i: () => n.i
});
var n = r(1824);
},
7197: (e, t, r) => {
"use strict";
var n;
r.d(t, {
Z: () => o
}), function (e) {
e.DEFAULT = "default", e.SAFE = "safe", e.MIXED = "mixed", e.BIGINT = "bigint";
}(n || (n = {}));
const o = n;
},
1624: (e, t, r) => {
"use strict";
var n, o;
r.d(t, {
i: () => n,
h: () => o
}), function (e) {
e.pay = "pay", e.keyreg = "keyreg", e.acfg = "acfg", e.axfer = "axfer", e.afrz = "afrz", e.appl = "appl";
}(n || (n = {})), function (e) {
e[e.NoOpOC = 0] = "NoOpOC", e[e.OptInOC = 1] = "OptInOC", e[e.CloseOutOC = 2] = "CloseOutOC", e[e.ClearStateOC = 3] = "ClearStateOC", e[e.UpdateApplicationOC = 4] = "UpdateApplicationOC", e[e.DeleteApplicationOC = 5] = "DeleteApplicationOC";
}(o || (o = {}));
},
1824: (e, t, r) => {
"use strict";
r.d(t, {
i: () => n.i
});
var n = r(1624);
},
413: (e, t, r) => {
"use strict";
r.r(t), r.d(t, {
parseJSON: () => a,
arrayEqual: () => c,
concatArrays: () => u,
removeUndefinedProperties: () => l,
isNode: () => h
});
var n = r(4360),
o = r.n(n),
s = r(7197);
const i = o()({
useNativeBigInt: !0,
strict: !0
});
function a(e, t) {
const r = t && t.intDecoding ? t.intDecoding : s.Z.DEFAULT;
return i.parse(e, (e, t) => {
if (null != t && "object" == typeof t && null == Object.getPrototypeOf(t) && Object.setPrototypeOf(t, Object.prototype), "bigint" == typeof t) {
if ("bigint" === r || "mixed" === r && t > Number.MAX_SAFE_INTEGER) return t;
if ("default" === r || "mixed" === r) return Number(t);
throw new Error(`Integer exceeds maximum safe integer: ${t.toString()}. Try parsing with a different intDecoding option.`);
}
return "number" == typeof t && "bigint" === r && Number.isInteger(t) ? BigInt(t) : t;
});
}
function c(e, t) {
return e.length === t.length && Array.from(e).every((e, r) => e === t[r]);
}
function u(...e) {
const t = e.reduce((e, t) => e + t.length, 0),
r = new Uint8Array(t);
let n = 0;
for (let t = 0; t < e.length; t++) r.set(e[t], n), n += e[t].length;
return r;
}
function l(e) {
const t = { ...e
};
return Object.keys(t).forEach(e => {
void 0 === t[e] && delete t[e];
}), t;
}
function h() {
return "object" == typeof process && "object" == typeof process.versions && void 0 !== process.versions.node;
}
},
5062: (e, t, r) => {
"use strict";
async function n(e, t, r) {
const n = await e.status().do();
if (void 0 === n) throw new Error("Unable to get node status");
const o = n["last-round"] + 1;
let s = o;
for (; s < o + r;) {
let r = !1;
try {
const n = await e.pendingTransactionInformation(t).do();
if (n["confirmed-round"]) return n;
if (n["pool-error"]) throw r = !0, new Error(`Transaction Rejected: ${n["pool-error"]}`);
} catch (e) {
if (r) throw e;
}
await e.statusAfterBlock(s).do(), s += 1;
}
throw new Error(`Transaction not confirmed after ${r} rounds`);
}
r.d(t, {
K: () => n
});
},
4654: () => {}
},
__webpack_module_cache__ = {};
function __webpack_require__(e) {
var t = __webpack_module_cache__[e];
if (void 0 !== t) return t.exports;
var r = __webpack_module_cache__[e] = {
exports: {}
};
return __webpack_modules__[e].call(r.exports, r, r.exports, __webpack_require__), r.exports;
}
__webpack_require__.amdO = {}, __webpack_require__.n = e => {
var t = e && e.__esModule ? () => e.default : () => e;
return __webpack_require__.d(t, {
a: t
}), t;
}, __webpack_require__.d = (e, t) => {
for (var r in t) __webpack_require__.o(t, r) && !__webpack_require__.o(e, r) && Object.defineProperty(e, r, {
enumerable: !0,
get: t[r]
});
}, __webpack_require__.g = function () {
if ("object" == typeof globalThis) return globalThis;
try {
return this || new Function("return this")();
} catch (e) {
if ("object" == typeof window) return window;
}
}(), __webpack_require__.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t), __webpack_require__.r = e => {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
value: "Module"
}), Object.defineProperty(e, "__esModule", {
value: !0
});
};
var __webpack_exports__ = {};
return (() => {
"use strict";
__webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
default: () => r
});
var e = __webpack_require__(6608),
t = {};
for (const r in e) "default" !== r && (t[r] = () => e[r]);
__webpack_require__.d(__webpack_exports__, t);
const r = e;
})(), __webpack_exports__;
})();
});
}).call(this)}).call(this,require('_process'))
},{"_process":223,"crypto":143}],35:[function(require,module,exports){
},{}],36:[function(require,module,exports){
"use strict";
var deselectCurrent = require("toggle-selection");
var clipboardToIE11Formatting = {
"text/plain": "Text",
"text/html": "Url",
"default": "Text"
}
var defaultMessage = "Copy to clipboard: #{key}, Enter";
function format(message) {
var copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
return message.replace(/#{\s*key\s*}/g, copyKey);
}
function copy(text, options) {
var debug,
message,
reselectPrevious,
range,
selection,
mark,
success = false;
if (!options) {
options = {};
}
debug = options.debug || false;
try {
reselectPrevious = deselectCurrent();
range = document.createRange();
selection = document.getSelection();
mark = document.createElement("span");
mark.textContent = text;
// reset user styles for span element
mark.style.all = "unset";
// prevents scrolling to the end of the page
mark.style.position = "fixed";
mark.style.top = 0;
mark.style.clip = "rect(0, 0, 0, 0)";
// used to preserve spaces and line breaks
mark.style.whiteSpace = "pre";
// do not inherit user-select (it may be `none`)
mark.style.webkitUserSelect = "text";
mark.style.MozUserSelect = "text";
mark.style.msUserSelect = "text";
mark.style.userSelect = "text";
mark.addEventListener("copy", function(e) {
e.stopPropagation();
if (options.format) {
e.preventDefault();
if (typeof e.clipboardData === "undefined") { // IE 11
debug && console.warn("unable to use e.clipboardData");
debug && console.warn("trying IE specific stuff");
window.clipboardData.clearData();
var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"]
window.clipboardData.setData(format, text);
} else { // all other browsers
e.clipboardData.clearData();
e.clipboardData.setData(options.format, text);
}
}
if (options.onCopy) {
e.preventDefault();
options.onCopy(e.clipboardData);
}
});
document.body.appendChild(mark);
range.selectNodeContents(mark);
selection.addRange(range);
var successful = document.execCommand("copy");
if (!successful) {
throw new Error("copy command was unsuccessful");
}
success = true;
} catch (err) {
debug && console.error("unable to copy using execCommand: ", err);
debug && console.warn("trying IE specific stuff");
try {
window.clipboardData.setData(options.format || "text", text);
options.onCopy && options.onCopy(window.clipboardData);
success = true;
} catch (err) {
debug && console.error("unable to copy using clipboardData: ", err);
debug && console.error("falling back to prompt");
message = format("message" in options ? options.message : defaultMessage);
window.prompt(message, text);
}
} finally {
if (selection) {
if (typeof selection.removeRange == "function") {
selection.removeRange(range);
} else {
selection.removeAllRanges();
}
}
if (mark) {
document.body.removeChild(mark);
}
reselectPrevious();
}
return success;
}
module.exports = copy;
},{"toggle-selection":71}],37:[function(require,module,exports){
(function (process){(function (){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SearchBotDeviceInfo = exports.ReactNativeInfo = exports.NodeInfo = exports.BrowserInfo = exports.BotInfo = void 0;
exports.browserName = browserName;
exports.detect = detect;
exports.detectOS = detectOS;
exports.getNodeVersion = getNodeVersion;
exports.parseUserAgent = parseUserAgent;
var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
return r;
};
var BrowserInfo =
/** @class */
function () {
function BrowserInfo(name, version, os) {
this.name = name;
this.version = version;
this.os = os;
this.type = 'browser';
}
return BrowserInfo;
}();
exports.BrowserInfo = BrowserInfo;
var NodeInfo =
/** @class */
function () {
function NodeInfo(version) {
this.version = version;
this.type = 'node';
this.name = 'node';
this.os = process.platform;
}
return NodeInfo;
}();
exports.NodeInfo = NodeInfo;
var SearchBotDeviceInfo =
/** @class */
function () {
function SearchBotDeviceInfo(name, version, os, bot) {
this.name = name;
this.version = version;
this.os = os;
this.bot = bot;
this.type = 'bot-device';
}
return SearchBotDeviceInfo;
}();
exports.SearchBotDeviceInfo = SearchBotDeviceInfo;
var BotInfo =
/** @class */
function () {
function BotInfo() {
this.type = 'bot';
this.bot = true; // NOTE: deprecated test name instead
this.name = 'bot';
this.version = null;
this.os = null;
}
return BotInfo;
}();
exports.BotInfo = BotInfo;
var ReactNativeInfo =
/** @class */
function () {
function ReactNativeInfo() {
this.type = 'react-native';
this.name = 'react-native';
this.version = null;
this.os = null;
}
return ReactNativeInfo;
}();
exports.ReactNativeInfo = ReactNativeInfo;
// tslint:disable-next-line:max-line-length
var SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/;
var SEARCHBOT_OS_REGEX = /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/;
var REQUIRED_VERSION_PARTS = 3;
var userAgentRules = [['aol', /AOLShield\/([0-9\._]+)/], ['edge', /Edge\/([0-9\._]+)/], ['edge-ios', /EdgiOS\/([0-9\._]+)/], ['yandexbrowser', /YaBrowser\/([0-9\._]+)/], ['kakaotalk', /KAKAOTALK\s([0-9\.]+)/], ['samsung', /SamsungBrowser\/([0-9\.]+)/], ['silk', /\bSilk\/([0-9._-]+)\b/], ['miui', /MiuiBrowser\/([0-9\.]+)$/], ['beaker', /BeakerBrowser\/([0-9\.]+)/], ['edge-chromium', /EdgA?\/([0-9\.]+)/], ['chromium-webview', /(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/], ['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/], ['phantomjs', /PhantomJS\/([0-9\.]+)(:?\s|$)/], ['crios', /CriOS\/([0-9\.]+)(:?\s|$)/], ['firefox', /Firefox\/([0-9\.]+)(?:\s|$)/], ['fxios', /FxiOS\/([0-9\.]+)/], ['opera-mini', /Opera Mini.*Version\/([0-9\.]+)/], ['opera', /Opera\/([0-9\.]+)(?:\s|$)/], ['opera', /OPR\/([0-9\.]+)(:?\s|$)/], ['ie', /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/], ['ie', /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], ['ie', /MSIE\s(7\.0)/], ['bb10', /BB10;\sTouch.*Version\/([0-9\.]+)/], ['android', /Android\s([0-9\.]+)/], ['ios', /Version\/([0-9\._]+).*Mobile.*Safari.*/], ['safari', /Version\/([0-9\._]+).*Safari/], ['facebook', /FBAV\/([0-9\.]+)/], ['instagram', /Instagram\s([0-9\.]+)/], ['ios-webview', /AppleWebKit\/([0-9\.]+).*Mobile/], ['ios-webview', /AppleWebKit\/([0-9\.]+).*Gecko\)$/], ['searchbot', SEARCHBOX_UA_REGEX]];
var operatingSystemRules = [['iOS', /iP(hone|od|ad)/], ['Android OS', /Android/], ['BlackBerry OS', /BlackBerry|BB10/], ['Windows Mobile', /IEMobile/], ['Amazon OS', /Kindle/], ['Windows 3.11', /Win16/], ['Windows 95', /(Windows 95)|(Win95)|(Windows_95)/], ['Windows 98', /(Windows 98)|(Win98)/], ['Windows 2000', /(Windows NT 5.0)|(Windows 2000)/], ['Windows XP', /(Windows NT 5.1)|(Windows XP)/], ['Windows Server 2003', /(Windows NT 5.2)/], ['Windows Vista', /(Windows NT 6.0)/], ['Windows 7', /(Windows NT 6.1)/], ['Windows 8', /(Windows NT 6.2)/], ['Windows 8.1', /(Windows NT 6.3)/], ['Windows 10', /(Windows NT 10.0)/], ['Windows ME', /Windows ME/], ['Open BSD', /OpenBSD/], ['Sun OS', /SunOS/], ['Chrome OS', /CrOS/], ['Linux', /(Linux)|(X11)/], ['Mac OS', /(Mac_PowerPC)|(Macintosh)/], ['QNX', /QNX/], ['BeOS', /BeOS/], ['OS/2', /OS\/2/]];
function detect(userAgent) {
if (!!userAgent) {
return parseUserAgent(userAgent);
}
if (typeof document === 'undefined' && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
return new ReactNativeInfo();
}
if (typeof navigator !== 'undefined') {
return parseUserAgent(navigator.userAgent);
}
return getNodeVersion();
}
function matchUserAgent(ua) {
// opted for using reduce here rather than Array#first with a regex.test call
// this is primarily because using the reduce we only perform the regex
// execution once rather than once for the test and for the exec again below
// probably something that needs to be benchmarked though
return ua !== '' && userAgentRules.reduce(function (matched, _a) {
var browser = _a[0],
regex = _a[1];
if (matched) {
return matched;
}
var uaMatch = regex.exec(ua);
return !!uaMatch && [browser, uaMatch];
}, false);
}
function browserName(ua) {
var data = matchUserAgent(ua);
return data ? data[0] : null;
}
function parseUserAgent(ua) {
var matchedRule = matchUserAgent(ua);
if (!matchedRule) {
return null;
}
var name = matchedRule[0],
match = matchedRule[1];
if (name === 'searchbot') {
return new BotInfo();
}
var versionParts = match[1] && match[1].split(/[._]/).slice(0, 3);
if (versionParts) {
if (versionParts.length < REQUIRED_VERSION_PARTS) {
versionParts = __spreadArrays(versionParts, createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length));
}
} else {
versionParts = [];
}
var version = versionParts.join('.');
var os = detectOS(ua);
var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua);
if (searchBotMatch && searchBotMatch[1]) {
return new SearchBotDeviceInfo(name, version, os, searchBotMatch[1]);
}
return new BrowserInfo(name, version, os);
}
function detectOS(ua) {
for (var ii = 0, count = operatingSystemRules.length; ii < count; ii++) {
var _a = operatingSystemRules[ii],
os = _a[0],
regex = _a[1];
var match = regex.exec(ua);
if (match) {
return os;
}
}
return null;
}
function getNodeVersion() {
var isNode = typeof process !== 'undefined' && process.version;
return isNode ? new NodeInfo(process.version.slice(1)) : null;
}
function createVersionParts(count) {
var output = [];
for (var ii = 0; ii < count; ii++) {
output.push('0');
}
return output;
}
}).call(this)}).call(this,require('_process'))
},{"_process":223}],38:[function(require,module,exports){
'use strict';
/******************************************************************************
* Created 2008-08-19.
*
* Dijkstra path-finding functions. Adapted from the Dijkstar Python project.
*
* Copyright (C) 2008
* Wyatt Baldwin <self@wyattbaldwin.com>
* All rights reserved
*
* Licensed under the MIT license.
*
* http://www.opensource.org/licenses/mit-license.php
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*****************************************************************************/
var dijkstra = {
single_source_shortest_paths: function(graph, s, d) {
// Predecessor map for each node that has been encountered.
// node ID => predecessor node ID
var predecessors = {};
// Costs of shortest paths from s to all nodes encountered.
// node ID => cost
var costs = {};
costs[s] = 0;
// Costs of shortest paths from s to all nodes encountered; differs from
// `costs` in that it provides easy access to the node that currently has
// the known shortest path from s.
// XXX: Do we actually need both `costs` and `open`?
var open = dijkstra.PriorityQueue.make();
open.push(s, 0);
var closest,
u, v,
cost_of_s_to_u,
adjacent_nodes,
cost_of_e,
cost_of_s_to_u_plus_cost_of_e,
cost_of_s_to_v,
first_visit;
while (!open.empty()) {
// In the nodes remaining in graph that have a known cost from s,
// find the node, u, that currently has the shortest path from s.
closest = open.pop();
u = closest.value;
cost_of_s_to_u = closest.cost;
// Get nodes adjacent to u...
adjacent_nodes = graph[u] || {};
// ...and explore the edges that connect u to those nodes, updating
// the cost of the shortest paths to any or all of those nodes as
// necessary. v is the node across the current edge from u.
for (v in adjacent_nodes) {
if (adjacent_nodes.hasOwnProperty(v)) {
// Get the cost of the edge running from u to v.
cost_of_e = adjacent_nodes[v];
// Cost of s to u plus the cost of u to v across e--this is *a*
// cost from s to v that may or may not be less than the current
// known cost to v.
cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;
// If we haven't visited v yet OR if the current known cost from s to
// v is greater than the new cost we just found (cost of s to u plus
// cost of u to v across e), update v's cost in the cost list and
// update v's predecessor in the predecessor list (it's now u).
cost_of_s_to_v = costs[v];
first_visit = (typeof costs[v] === 'undefined');
if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {
costs[v] = cost_of_s_to_u_plus_cost_of_e;
open.push(v, cost_of_s_to_u_plus_cost_of_e);
predecessors[v] = u;
}
}
}
}
if (typeof d !== 'undefined' && typeof costs[d] === 'undefined') {
var msg = ['Could not find a path from ', s, ' to ', d, '.'].join('');
throw new Error(msg);
}
return predecessors;
},
extract_shortest_path_from_predecessor_list: function(predecessors, d) {
var nodes = [];
var u = d;
var predecessor;
while (u) {
nodes.push(u);
predecessor = predecessors[u];
u = predecessors[u];
}
nodes.reverse();
return nodes;
},
find_path: function(graph, s, d) {
var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);
return dijkstra.extract_shortest_path_from_predecessor_list(
predecessors, d);
},
/**
* A very naive priority queue implementation.
*/
PriorityQueue: {
make: function (opts) {
var T = dijkstra.PriorityQueue,
t = {},
key;
opts = opts || {};
for (key in T) {
if (T.hasOwnProperty(key)) {
t[key] = T[key];
}
}
t.queue = [];
t.sorter = opts.sorter || T.default_sorter;
return t;
},
default_sorter: function (a, b) {
return a.cost - b.cost;
},
/**
* Add a new item to the queue and ensure the highest priority element
* is at the front of the queue.
*/
push: function (value, cost) {
var item = {value: value, cost: cost};
this.queue.push(item);
this.queue.sort(this.sorter);
},
/**
* Return the highest priority element in the queue.
*/
pop: function () {
return this.queue.shift();
},
empty: function () {
return this.queue.length === 0;
}
}
};
// node.js module exports
if (typeof module !== 'undefined') {
module.exports = dijkstra;
}
},{}],39:[function(require,module,exports){
var toString = {}.toString;
module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
},{}],40:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {
version: true,
Children: true,
render: true,
hydrate: true,
unmountComponentAtNode: true,
createPortal: true,
createFactory: true,
cloneElement: true,
isValidElement: true,
findDOMNode: true,
PureComponent: true,
memo: true,
forwardRef: true,
unstable_batchedUpdates: true,
Suspense: true,
SuspenseList: true,
lazy: true,
createElement: true,
createContext: true,
createRef: true,
Fragment: true,
Component: true
};
exports.Children = void 0;
Object.defineProperty(exports, "Component", {
enumerable: true,
get: function () {
return _preact.Component;
}
});
Object.defineProperty(exports, "Fragment", {
enumerable: true,
get: function () {
return _preact.Fragment;
}
});
exports.PureComponent = void 0;
exports.Suspense = U;
exports.SuspenseList = O;
exports.cloneElement = K;
Object.defineProperty(exports, "createContext", {
enumerable: true,
get: function () {
return _preact.createContext;
}
});
Object.defineProperty(exports, "createElement", {
enumerable: true,
get: function () {
return _preact.createElement;
}
});
exports.createFactory = G;
exports.createPortal = z;
Object.defineProperty(exports, "createRef", {
enumerable: true,
get: function () {
return _preact.createRef;
}
});
exports.default = void 0;
exports.findDOMNode = X;
exports.forwardRef = S;
exports.hydrate = V;
exports.isValidElement = J;
exports.lazy = L;
exports.memo = _;
exports.render = T;
exports.unmountComponentAtNode = Q;
exports.version = exports.unstable_batchedUpdates = void 0;
var _hooks = require("preact/hooks");
Object.keys(_hooks).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _hooks[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _hooks[key];
}
});
});
var _preact = require("preact");
function E(n, t) {
for (var e in t) n[e] = t[e];
return n;
}
function w(n, t) {
for (var e in n) if ("__source" !== e && !(e in t)) return !0;
for (var r in t) if ("__source" !== r && n[r] !== t[r]) return !0;
return !1;
}
var C = function (n) {
var t, e;
function r(t) {
var e;
return (e = n.call(this, t) || this).isPureReactComponent = !0, e;
}
return e = n, (t = r).prototype = Object.create(e.prototype), t.prototype.constructor = t, t.__proto__ = e, r.prototype.shouldComponentUpdate = function (n, t) {
return w(this.props, n) || w(this.state, t);
}, r;
}(_preact.Component);
exports.PureComponent = C;
function _(n, t) {
function e(n) {
var e = this.props.ref,
r = e == n.ref;
return !r && e && (e.call ? e(null) : e.current = null), t ? !t(this.props, n) || !r : w(this.props, n);
}
function r(t) {
return this.shouldComponentUpdate = e, (0, _preact.createElement)(n, E({}, t));
}
return r.prototype.isReactComponent = !0, r.displayName = "Memo(" + (n.displayName || n.name) + ")", r.t = !0, r;
}
var A = _preact.options.__b;
function S(n) {
function t(t) {
var e = E({}, t);
return delete e.ref, n(e, t.ref);
}
return t.prototype.isReactComponent = t.t = !0, t.displayName = "ForwardRef(" + (n.displayName || n.name) + ")", t;
}
_preact.options.__b = function (n) {
n.type && n.type.t && n.ref && (n.props.ref = n.ref, n.ref = null), A && A(n);
};
var k = function (n, t) {
return n ? (0, _preact.toChildArray)(n).reduce(function (n, e, r) {
return n.concat(t(e, r));
}, []) : null;
},
R = {
map: k,
forEach: k,
count: function (n) {
return n ? (0, _preact.toChildArray)(n).length : 0;
},
only: function (n) {
if (1 !== (n = (0, _preact.toChildArray)(n)).length) throw new Error("Children.only() expects only one child.");
return n[0];
},
toArray: _preact.toChildArray
},
F = _preact.options.__e;
exports.Children = R;
function N(n) {
return n && ((n = E({}, n)).__c = null, n.__k = n.__k && n.__k.map(N)), n;
}
function U() {
this.__u = 0, this.o = null, this.__b = null;
}
function M(n) {
var t = n.__.__c;
return t && t.u && t.u(n);
}
function L(n) {
var t, e, r;
function o(o) {
if (t || (t = n()).then(function (n) {
e = n.default || n;
}, function (n) {
r = n;
}), r) throw r;
if (!e) throw t;
return (0, _preact.createElement)(e, o);
}
return o.displayName = "Lazy", o.t = !0, o;
}
function O() {
this.i = null, this.l = null;
}
_preact.options.__e = function (n, t, e) {
if (n.then) for (var r, o = t; o = o.__;) if ((r = o.__c) && r.__c) return r.__c(n, t.__c);
F(n, t, e);
}, (U.prototype = new _preact.Component()).__c = function (n, t) {
var e = this;
null == e.o && (e.o = []), e.o.push(t);
var r = M(e.__v),
o = !1,
u = function () {
o || (o = !0, r ? r(i) : i());
};
t.__c = t.componentWillUnmount, t.componentWillUnmount = function () {
u(), t.__c && t.__c();
};
var i = function () {
var n;
if (! --e.__u) for (e.__v.__k[0] = e.state.u, e.setState({
u: e.__b = null
}); n = e.o.pop();) n.forceUpdate();
};
e.__u++ || e.setState({
u: e.__b = e.__v.__k[0]
}), n.then(u, u);
}, U.prototype.render = function (n, t) {
return this.__b && (this.__v.__k[0] = N(this.__b), this.__b = null), [(0, _preact.createElement)(_preact.Component, null, t.u ? null : n.children), t.u && n.fallback];
};
var P = function (n, t, e) {
if (++e[1] === e[0] && n.l.delete(t), n.props.revealOrder && ("t" !== n.props.revealOrder[0] || !n.l.size)) for (e = n.i; e;) {
for (; e.length > 3;) e.pop()();
if (e[1] < e[0]) break;
n.i = e = e[2];
}
};
(O.prototype = new _preact.Component()).u = function (n) {
var t = this,
e = M(t.__v),
r = t.l.get(n);
return r[0]++, function (o) {
var u = function () {
t.props.revealOrder ? (r.push(o), P(t, n, r)) : o();
};
e ? e(u) : u();
};
}, O.prototype.render = function (n) {
this.i = null, this.l = new Map();
var t = (0, _preact.toChildArray)(n.children);
n.revealOrder && "b" === n.revealOrder[0] && t.reverse();
for (var e = t.length; e--;) this.l.set(t[e], this.i = [1, 0, this.i]);
return n.children;
}, O.prototype.componentDidUpdate = O.prototype.componentDidMount = function () {
var n = this;
n.l.forEach(function (t, e) {
P(n, e, t);
});
};
var W = function () {
function n() {}
var t = n.prototype;
return t.getChildContext = function () {
return this.props.context;
}, t.render = function (n) {
return n.children;
}, n;
}();
function j(n) {
var t = this,
e = n.container,
r = (0, _preact.createElement)(W, {
context: t.context
}, n.vnode);
return t.s && t.s !== e && (t.v.parentNode && t.s.removeChild(t.v), (0, _preact._unmount)(t.h), t.p = !1), n.vnode ? t.p ? (e.__k = t.__k, (0, _preact.render)(r, e), t.__k = e.__k) : (t.v = document.createTextNode(""), (0, _preact.hydrate)("", e), e.appendChild(t.v), t.p = !0, t.s = e, (0, _preact.render)(r, e, t.v), t.__k = t.v.__k) : t.p && (t.v.parentNode && t.s.removeChild(t.v), (0, _preact._unmount)(t.h)), t.h = r, t.componentWillUnmount = function () {
t.v.parentNode && t.s.removeChild(t.v), (0, _preact._unmount)(t.h);
}, null;
}
function z(n, t) {
return (0, _preact.createElement)(j, {
vnode: n,
container: t
});
}
var D = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;
_preact.Component.prototype.isReactComponent = {};
var H = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103;
function T(n, t, e) {
if (null == t.__k) for (; t.firstChild;) t.removeChild(t.firstChild);
return (0, _preact.render)(n, t), "function" == typeof e && e(), n ? n.__c : null;
}
function V(n, t, e) {
return (0, _preact.hydrate)(n, t), "function" == typeof e && e(), n ? n.__c : null;
}
var Z = _preact.options.event;
function I(n, t) {
n["UNSAFE_" + t] && !n[t] && Object.defineProperty(n, t, {
configurable: !1,
get: function () {
return this["UNSAFE_" + t];
},
set: function (n) {
this["UNSAFE_" + t] = n;
}
});
}
_preact.options.event = function (n) {
Z && (n = Z(n)), n.persist = function () {};
var t = !1,
e = !1,
r = n.stopPropagation;
n.stopPropagation = function () {
r.call(n), t = !0;
};
var o = n.preventDefault;
return n.preventDefault = function () {
o.call(n), e = !0;
}, n.isPropagationStopped = function () {
return t;
}, n.isDefaultPrevented = function () {
return e;
}, n.nativeEvent = n;
};
var $ = {
configurable: !0,
get: function () {
return this.class;
}
},
q = _preact.options.vnode;
_preact.options.vnode = function (n) {
n.$$typeof = H;
var t = n.type,
e = n.props;
if (t) {
if (e.class != e.className && ($.enumerable = "className" in e, null != e.className && (e.class = e.className), Object.defineProperty(e, "className", $)), "function" != typeof t) {
var r, o, u;
for (u in e.defaultValue && void 0 !== e.value && (e.value || 0 === e.value || (e.value = e.defaultValue), delete e.defaultValue), Array.isArray(e.value) && e.multiple && "select" === t && ((0, _preact.toChildArray)(e.children).forEach(function (n) {
-1 != e.value.indexOf(n.props.value) && (n.props.selected = !0);
}), delete e.value), e) if (r = D.test(u)) break;
if (r) for (u in o = n.props = {}, e) o[D.test(u) ? u.replace(/[A-Z0-9]/, "-$&").toLowerCase() : u] = e[u];
}
!function (t) {
var e = n.type,
r = n.props;
if (r && "string" == typeof e) {
var o = {};
for (var u in r) /^on(Ani|Tra|Tou)/.test(u) && (r[u.toLowerCase()] = r[u], delete r[u]), o[u.toLowerCase()] = u;
if (o.ondoubleclick && (r.ondblclick = r[o.ondoubleclick], delete r[o.ondoubleclick]), o.onbeforeinput && (r.onbeforeinput = r[o.onbeforeinput], delete r[o.onbeforeinput]), o.onchange && ("textarea" === e || "input" === e.toLowerCase() && !/^fil|che|ra/i.test(r.type))) {
var i = o.oninput || "oninput";
r[i] || (r[i] = r[o.onchange], delete r[o.onchange]);
}
}
}(), "function" == typeof t && !t.m && t.prototype && (I(t.prototype, "componentWillMount"), I(t.prototype, "componentWillReceiveProps"), I(t.prototype, "componentWillUpdate"), t.m = !0);
}
q && q(n);
};
var B = "16.8.0";
exports.version = B;
function G(n) {
return _preact.createElement.bind(null, n);
}
function J(n) {
return !!n && n.$$typeof === H;
}
function K(n) {
return J(n) ? _preact.cloneElement.apply(null, arguments) : n;
}
function Q(n) {
return !!n.__k && ((0, _preact.render)(null, n), !0);
}
function X(n) {
return n && (n.base || 1 === n.nodeType && n) || null;
}
var Y = function (n, t) {
return n(t);
};
exports.unstable_batchedUpdates = Y;
var _default = {
useState: _hooks.useState,
useReducer: _hooks.useReducer,
useEffect: _hooks.useEffect,
useLayoutEffect: _hooks.useLayoutEffect,
useRef: _hooks.useRef,
useImperativeHandle: _hooks.useImperativeHandle,
useMemo: _hooks.useMemo,
useCallback: _hooks.useCallback,
useContext: _hooks.useContext,
useDebugValue: _hooks.useDebugValue,
version: "16.8.0",
Children: R,
render: T,
hydrate: T,
unmountComponentAtNode: Q,
createPortal: z,
createElement: _preact.createElement,
createContext: _preact.createContext,
createFactory: G,
cloneElement: K,
createRef: _preact.createRef,
Fragment: _preact.Fragment,
isValidElement: J,
findDOMNode: X,
Component: _preact.Component,
PureComponent: C,
memo: _,
forwardRef: S,
unstable_batchedUpdates: Y,
Suspense: U,
SuspenseList: O,
lazy: L
};
exports.default = _default;
},{"preact":41,"preact/hooks":42}],41:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Component = m;
exports.Fragment = d;
exports._unmount = D;
exports.cloneElement = L;
exports.createContext = M;
exports.h = exports.createElement = h;
exports.createRef = y;
exports.hydrate = I;
exports.options = exports.isValidElement = void 0;
exports.render = H;
exports.toChildArray = x;
var n,
l,
u,
i,
t,
r,
o,
f,
e = {},
c = [],
s = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;
exports.isValidElement = l;
exports.options = n;
function a(n, l) {
for (var u in l) n[u] = l[u];
return n;
}
function v(n) {
var l = n.parentNode;
l && l.removeChild(n);
}
function h(n, l, u) {
var i,
t = arguments,
r = {};
for (i in l) "key" !== i && "ref" !== i && (r[i] = l[i]);
if (arguments.length > 3) for (u = [u], i = 3; i < arguments.length; i++) u.push(t[i]);
if (null != u && (r.children = u), "function" == typeof n && null != n.defaultProps) for (i in n.defaultProps) void 0 === r[i] && (r[i] = n.defaultProps[i]);
return p(n, r, l && l.key, l && l.ref, null);
}
function p(l, u, i, t, r) {
var o = {
type: l,
props: u,
key: i,
ref: t,
__k: null,
__: null,
__b: 0,
__e: null,
__d: void 0,
__c: null,
constructor: void 0,
__v: r
};
return null == r && (o.__v = o), n.vnode && n.vnode(o), o;
}
function y() {
return {};
}
function d(n) {
return n.children;
}
function m(n, l) {
this.props = n, this.context = l;
}
function w(n, l) {
if (null == l) return n.__ ? w(n.__, n.__.__k.indexOf(n) + 1) : null;
for (var u; l < n.__k.length; l++) if (null != (u = n.__k[l]) && null != u.__e) return u.__e;
return "function" == typeof n.type ? w(n) : null;
}
function k(n) {
var l, u;
if (null != (n = n.__) && null != n.__c) {
for (n.__e = n.__c.base = null, l = 0; l < n.__k.length; l++) if (null != (u = n.__k[l]) && null != u.__e) {
n.__e = n.__c.base = u.__e;
break;
}
return k(n);
}
}
function g(l) {
(!l.__d && (l.__d = !0) && u.push(l) && !i++ || r !== n.debounceRendering) && ((r = n.debounceRendering) || t)(_);
}
function _() {
for (var n; i = u.length;) n = u.sort(function (n, l) {
return n.__v.__b - l.__v.__b;
}), u = [], n.some(function (n) {
var l, u, i, t, r, o, f;
n.__d && (o = (r = (l = n).__v).__e, (f = l.__P) && (u = [], (i = a({}, r)).__v = i, t = A(f, r, i, l.__n, void 0 !== f.ownerSVGElement, null, u, null == o ? w(r) : o), T(u, r), t != o && k(r)));
});
}
function b(n, l, u, i, t, r, o, f, s) {
var a,
h,
p,
y,
d,
m,
k,
g = u && u.__k || c,
_ = g.length;
if (f == e && (f = null != r ? r[0] : _ ? w(u, 0) : null), a = 0, l.__k = x(l.__k, function (u) {
if (null != u) {
if (u.__ = l, u.__b = l.__b + 1, null === (p = g[a]) || p && u.key == p.key && u.type === p.type) g[a] = void 0;else for (h = 0; h < _; h++) {
if ((p = g[h]) && u.key == p.key && u.type === p.type) {
g[h] = void 0;
break;
}
p = null;
}
if (y = A(n, u, p = p || e, i, t, r, o, f, s), (h = u.ref) && p.ref != h && (k || (k = []), p.ref && k.push(p.ref, null, u), k.push(h, u.__c || y, u)), null != y) {
var c;
if (null == m && (m = y), void 0 !== u.__d) c = u.__d, u.__d = void 0;else if (r == p || y != f || null == y.parentNode) {
n: if (null == f || f.parentNode !== n) n.appendChild(y), c = null;else {
for (d = f, h = 0; (d = d.nextSibling) && h < _; h += 2) if (d == y) break n;
n.insertBefore(y, f), c = f;
}
"option" == l.type && (n.value = "");
}
f = void 0 !== c ? c : y.nextSibling, "function" == typeof l.type && (l.__d = f);
} else f && p.__e == f && f.parentNode != n && (f = w(p));
}
return a++, u;
}), l.__e = m, null != r && "function" != typeof l.type) for (a = r.length; a--;) null != r[a] && v(r[a]);
for (a = _; a--;) null != g[a] && D(g[a], g[a]);
if (k) for (a = 0; a < k.length; a++) j(k[a], k[++a], k[++a]);
}
function x(n, l, u) {
if (null == u && (u = []), null == n || "boolean" == typeof n) l && u.push(l(null));else if (Array.isArray(n)) for (var i = 0; i < n.length; i++) x(n[i], l, u);else u.push(l ? l("string" == typeof n || "number" == typeof n ? p(null, n, null, null, n) : null != n.__e || null != n.__c ? p(n.type, n.props, n.key, null, n.__v) : n) : n);
return u;
}
function P(n, l, u, i, t) {
var r;
for (r in u) "children" === r || "key" === r || r in l || N(n, r, null, u[r], i);
for (r in l) t && "function" != typeof l[r] || "children" === r || "key" === r || "value" === r || "checked" === r || u[r] === l[r] || N(n, r, l[r], u[r], i);
}
function C(n, l, u) {
"-" === l[0] ? n.setProperty(l, u) : n[l] = "number" == typeof u && !1 === s.test(l) ? u + "px" : null == u ? "" : u;
}
function N(n, l, u, i, t) {
var r, o, f, e, c;
if (t ? "className" === l && (l = "class") : "class" === l && (l = "className"), "style" === l) {
if (r = n.style, "string" == typeof u) r.cssText = u;else {
if ("string" == typeof i && (r.cssText = "", i = null), i) for (e in i) u && e in u || C(r, e, "");
if (u) for (c in u) i && u[c] === i[c] || C(r, c, u[c]);
}
} else "o" === l[0] && "n" === l[1] ? (o = l !== (l = l.replace(/Capture$/, "")), f = l.toLowerCase(), l = (f in n ? f : l).slice(2), u ? (i || n.addEventListener(l, z, o), (n.l || (n.l = {}))[l] = u) : n.removeEventListener(l, z, o)) : "list" !== l && "tagName" !== l && "form" !== l && "type" !== l && "size" !== l && !t && l in n ? n[l] = null == u ? "" : u : "function" != typeof u && "dangerouslySetInnerHTML" !== l && (l !== (l = l.replace(/^xlink:?/, "")) ? null == u || !1 === u ? n.removeAttributeNS("http://www.w3.org/1999/xlink", l.toLowerCase()) : n.setAttributeNS("http://www.w3.org/1999/xlink", l.toLowerCase(), u) : null == u || !1 === u && !/^ar/.test(l) ? n.removeAttribute(l) : n.setAttribute(l, u));
}
function z(l) {
this.l[l.type](n.event ? n.event(l) : l);
}
function A(l, u, i, t, r, o, f, e, c) {
var s,
v,
h,
p,
y,
w,
k,
g,
_,
x,
P = u.type;
if (void 0 !== u.constructor) return null;
(s = n.__b) && s(u);
try {
n: if ("function" == typeof P) {
if (g = u.props, _ = (s = P.contextType) && t[s.__c], x = s ? _ ? _.props.value : s.__ : t, i.__c ? k = (v = u.__c = i.__c).__ = v.__E : ("prototype" in P && P.prototype.render ? u.__c = v = new P(g, x) : (u.__c = v = new m(g, x), v.constructor = P, v.render = E), _ && _.sub(v), v.props = g, v.state || (v.state = {}), v.context = x, v.__n = t, h = v.__d = !0, v.__h = []), null == v.__s && (v.__s = v.state), null != P.getDerivedStateFromProps && (v.__s == v.state && (v.__s = a({}, v.__s)), a(v.__s, P.getDerivedStateFromProps(g, v.__s))), p = v.props, y = v.state, h) null == P.getDerivedStateFromProps && null != v.componentWillMount && v.componentWillMount(), null != v.componentDidMount && v.__h.push(v.componentDidMount);else {
if (null == P.getDerivedStateFromProps && g !== p && null != v.componentWillReceiveProps && v.componentWillReceiveProps(g, x), !v.__e && null != v.shouldComponentUpdate && !1 === v.shouldComponentUpdate(g, v.__s, x) || u.__v === i.__v && !v.__) {
for (v.props = g, v.state = v.__s, u.__v !== i.__v && (v.__d = !1), v.__v = u, u.__e = i.__e, u.__k = i.__k, v.__h.length && f.push(v), s = 0; s < u.__k.length; s++) u.__k[s] && (u.__k[s].__ = u);
break n;
}
null != v.componentWillUpdate && v.componentWillUpdate(g, v.__s, x), null != v.componentDidUpdate && v.__h.push(function () {
v.componentDidUpdate(p, y, w);
});
}
v.context = x, v.props = g, v.state = v.__s, (s = n.__r) && s(u), v.__d = !1, v.__v = u, v.__P = l, s = v.render(v.props, v.state, v.context), u.__k = null != s && s.type == d && null == s.key ? s.props.children : Array.isArray(s) ? s : [s], null != v.getChildContext && (t = a(a({}, t), v.getChildContext())), h || null == v.getSnapshotBeforeUpdate || (w = v.getSnapshotBeforeUpdate(p, y)), b(l, u, i, t, r, o, f, e, c), v.base = u.__e, v.__h.length && f.push(v), k && (v.__E = v.__ = null), v.__e = !1;
} else null == o && u.__v === i.__v ? (u.__k = i.__k, u.__e = i.__e) : u.__e = $(i.__e, u, i, t, r, o, f, c);
(s = n.diffed) && s(u);
} catch (l) {
u.__v = null, n.__e(l, u, i);
}
return u.__e;
}
function T(l, u) {
n.__c && n.__c(u, l), l.some(function (u) {
try {
l = u.__h, u.__h = [], l.some(function (n) {
n.call(u);
});
} catch (l) {
n.__e(l, u.__v);
}
});
}
function $(n, l, u, i, t, r, o, f) {
var s,
a,
v,
h,
p,
y = u.props,
d = l.props;
if (t = "svg" === l.type || t, null != r) for (s = 0; s < r.length; s++) if (null != (a = r[s]) && ((null === l.type ? 3 === a.nodeType : a.localName === l.type) || n == a)) {
n = a, r[s] = null;
break;
}
if (null == n) {
if (null === l.type) return document.createTextNode(d);
n = t ? document.createElementNS("http://www.w3.org/2000/svg", l.type) : document.createElement(l.type, d.is && {
is: d.is
}), r = null, f = !1;
}
if (null === l.type) y !== d && n.data != d && (n.data = d);else {
if (null != r && (r = c.slice.call(n.childNodes)), v = (y = u.props || e).dangerouslySetInnerHTML, h = d.dangerouslySetInnerHTML, !f) {
if (y === e) for (y = {}, p = 0; p < n.attributes.length; p++) y[n.attributes[p].name] = n.attributes[p].value;
(h || v) && (h && v && h.__html == v.__html || (n.innerHTML = h && h.__html || ""));
}
P(n, d, y, t, f), h ? l.__k = [] : (l.__k = l.props.children, b(n, l, u, i, "foreignObject" !== l.type && t, r, o, e, f)), f || ("value" in d && void 0 !== (s = d.value) && s !== n.value && N(n, "value", s, y.value, !1), "checked" in d && void 0 !== (s = d.checked) && s !== n.checked && N(n, "checked", s, y.checked, !1));
}
return n;
}
function j(l, u, i) {
try {
"function" == typeof l ? l(u) : l.current = u;
} catch (l) {
n.__e(l, i);
}
}
function D(l, u, i) {
var t, r, o;
if (n.unmount && n.unmount(l), (t = l.ref) && (t.current && t.current !== l.__e || j(t, null, u)), i || "function" == typeof l.type || (i = null != (r = l.__e)), l.__e = l.__d = void 0, null != (t = l.__c)) {
if (t.componentWillUnmount) try {
t.componentWillUnmount();
} catch (l) {
n.__e(l, u);
}
t.base = t.__P = null;
}
if (t = l.__k) for (o = 0; o < t.length; o++) t[o] && D(t[o], u, i);
null != r && v(r);
}
function E(n, l, u) {
return this.constructor(n, u);
}
function H(l, u, i) {
var t, r, f;
n.__ && n.__(l, u), r = (t = i === o) ? null : i && i.__k || u.__k, l = h(d, null, [l]), f = [], A(u, (t ? u : i || u).__k = l, r || e, e, void 0 !== u.ownerSVGElement, i && !t ? [i] : r ? null : c.slice.call(u.childNodes), f, i || e, t), T(f, l);
}
function I(n, l) {
H(n, l, o);
}
function L(n, l) {
var u, i;
for (i in l =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment