From a7da9c2df45b6bb1d7e1587d6e032d128064434d Mon Sep 17 00:00:00 2001 From: tockn Date: Tue, 16 Jan 2024 19:31:49 +0900 Subject: [PATCH] feat: support push event --- dist/post/index.js | 34 ++++++++++++++++++++++++++++------ dist/post/index.js.map | 2 +- src/post.ts | 41 +++++++++++++++++++++++++++++++---------- 3 files changed, 60 insertions(+), 17 deletions(-) diff --git a/dist/post/index.js b/dist/post/index.js index 26a9c79f..203197d9 100644 --- a/dist/post/index.js +++ b/dist/post/index.js @@ -31041,6 +31041,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getPrNumbers = void 0; const core = __importStar(__webpack_require__(2186)); const github = __importStar(__webpack_require__(5438)); const action_1 = __webpack_require__(1231); @@ -31098,7 +31099,6 @@ function getCurrentJob() { }); } function reportAll(currentJob, content) { - var _a; return __awaiter(this, void 0, void 0, function* () { logger.info(`Reporting all content ...`); logger.debug(`Workflow - Job: ${workflow} - ${job}`); @@ -31119,18 +31119,40 @@ function reportAll(currentJob, content) { yield core.summary.write(); } const commentOnPR = core.getInput('comment_on_pr'); - if (pull_request && 'true' === commentOnPR) { - if (logger.isDebugEnabled()) { - logger.debug(`Found Pull Request: ${JSON.stringify(pull_request)}`); + if ('true' === commentOnPR) { + const prNumbers = yield getPrNumbers(); + if (prNumbers) { + if (logger.isDebugEnabled()) { + logger.debug(`Found Pull Request: ${JSON.stringify(prNumbers)}`); + } + for (let prNumber of prNumbers) { + yield octokit.rest.issues.createComment(Object.assign(Object.assign({}, github.context.repo), { issue_number: prNumber, body: postContent })); + } + } + else { + logger.debug(`Couldn't find Pull Request`); } - yield octokit.rest.issues.createComment(Object.assign(Object.assign({}, github.context.repo), { issue_number: Number((_a = github.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.number), body: postContent })); } else { - logger.debug(`Couldn't find Pull Request`); + logger.debug(`commentOnPR is false`); } logger.info(`Reporting all content completed`); }); } +function getPrNumbers() { + return __awaiter(this, void 0, void 0, function* () { + if (pull_request) { + return [pull_request.number]; + } + const { data: pullRequests } = yield octokit.repos.listPullRequestsAssociatedWithCommit({ + owner: repo.owner, + repo: repo.repo, + commit_sha: sha, + }); + return pullRequests.filter((pr) => pr.state === "open").map((pr) => pr.number).slice(0, 10); + }); +} +exports.getPrNumbers = getPrNumbers; function run() { return __awaiter(this, void 0, void 0, function* () { try { diff --git a/dist/post/index.js.map b/dist/post/index.js.map index 7ccff8ae..b1d44ed9 100644 --- a/dist/post/index.js.map +++ b/dist/post/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../webpack://workflow-telemetry-action/./node_modules/@actions/core/lib/command.js","../webpack://workflow-telemetry-action/./node_modules/@actions/core/lib/core.js","../webpack://workflow-telemetry-action/./node_modules/@actions/core/lib/file-command.js","../webpack://workflow-telemetry-action/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://workflow-telemetry-action/./node_modules/@actions/core/lib/path-utils.js","../webpack://workflow-telemetry-action/./node_modules/@actions/core/lib/summary.js","../webpack://workflow-telemetry-action/./node_modules/@actions/core/lib/utils.js","../webpack://workflow-telemetry-action/./node_modules/@actions/github/lib/context.js","../webpack://workflow-telemetry-action/./node_modules/@actions/github/lib/github.js","../webpack://workflow-telemetry-action/./node_modules/@actions/github/lib/internal/utils.js","../webpack://workflow-telemetry-action/./node_modules/@actions/github/lib/utils.js","../webpack://workflow-telemetry-action/./node_modules/@actions/http-client/lib/auth.js","../webpack://workflow-telemetry-action/./node_modules/@actions/http-client/lib/index.js","../webpack://workflow-telemetry-action/./node_modules/@actions/http-client/lib/proxy.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/auth-token/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/core/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/endpoint/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/graphql/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/request-error/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/request/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/auth-action/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/auth-action/node_modules/@octokit/auth-token/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/auth-token/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/core/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/endpoint/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/graphql/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/request-error/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/request/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/agent-base/dist/src/index.js","../webpack://workflow-telemetry-action/./node_modules/agent-base/dist/src/promisify.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/index.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/lib/abort.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/lib/async.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/lib/defer.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/lib/iterate.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/lib/state.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/lib/terminator.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/parallel.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/serial.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/serialOrdered.js","../webpack://workflow-telemetry-action/./node_modules/before-after-hook/index.js","../webpack://workflow-telemetry-action/./node_modules/before-after-hook/lib/add.js","../webpack://workflow-telemetry-action/./node_modules/before-after-hook/lib/register.js","../webpack://workflow-telemetry-action/./node_modules/before-after-hook/lib/remove.js","../webpack://workflow-telemetry-action/./node_modules/combined-stream/lib/combined_stream.js","../webpack://workflow-telemetry-action/./node_modules/debug/src/browser.js","../webpack://workflow-telemetry-action/./node_modules/debug/src/common.js","../webpack://workflow-telemetry-action/./node_modules/debug/src/index.js","../webpack://workflow-telemetry-action/./node_modules/debug/src/node.js","../webpack://workflow-telemetry-action/./node_modules/delayed-stream/lib/delayed_stream.js","../webpack://workflow-telemetry-action/./node_modules/deprecation/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/follow-redirects/debug.js","../webpack://workflow-telemetry-action/./node_modules/follow-redirects/index.js","../webpack://workflow-telemetry-action/./node_modules/form-data/lib/form_data.js","../webpack://workflow-telemetry-action/./node_modules/form-data/lib/populate.js","../webpack://workflow-telemetry-action/./node_modules/https-proxy-agent/dist/agent.js","../webpack://workflow-telemetry-action/./node_modules/https-proxy-agent/dist/index.js","../webpack://workflow-telemetry-action/./node_modules/https-proxy-agent/dist/parse-proxy-response.js","../webpack://workflow-telemetry-action/./node_modules/is-plain-object/dist/is-plain-object.js","../webpack://workflow-telemetry-action/./node_modules/mime-db/index.js","../webpack://workflow-telemetry-action/./node_modules/mime-types/index.js","../webpack://workflow-telemetry-action/./node_modules/ms/index.js","../webpack://workflow-telemetry-action/./node_modules/node-fetch/lib/index.js","../webpack://workflow-telemetry-action/./node_modules/once/once.js","../webpack://workflow-telemetry-action/./node_modules/proxy-from-env/index.js","../webpack://workflow-telemetry-action/./node_modules/sprintf-js/src/sprintf.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/audio.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/battery.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/bluetooth.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/cpu.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/docker.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/dockerSocket.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/filesystem.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/graphics.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/index.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/internet.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/memory.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/network.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/osinfo.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/printer.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/processes.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/system.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/usb.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/users.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/util.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/virtualbox.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/wifi.js","../webpack://workflow-telemetry-action/./node_modules/tr46/index.js","../webpack://workflow-telemetry-action/./node_modules/tunnel/index.js","../webpack://workflow-telemetry-action/./node_modules/tunnel/lib/tunnel.js","../webpack://workflow-telemetry-action/./node_modules/universal-user-agent/dist-node/index.js","../webpack://workflow-telemetry-action/external \"crypto\"","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/rng.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/regex.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/validate.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/stringify.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/v1.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/parse.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/v35.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/md5.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/v3.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/v4.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/sha1.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/v5.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/nil.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/version.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/index.js","../webpack://workflow-telemetry-action/./node_modules/webidl-conversions/lib/index.js","../webpack://workflow-telemetry-action/./node_modules/whatwg-url/lib/URL-impl.js","../webpack://workflow-telemetry-action/./node_modules/whatwg-url/lib/URL.js","../webpack://workflow-telemetry-action/./node_modules/whatwg-url/lib/public-api.js","../webpack://workflow-telemetry-action/./node_modules/whatwg-url/lib/url-state-machine.js","../webpack://workflow-telemetry-action/./node_modules/whatwg-url/lib/utils.js","../webpack://workflow-telemetry-action/./node_modules/wrappy/wrappy.js","../webpack://workflow-telemetry-action/./src/logger.ts","../webpack://workflow-telemetry-action/./src/post.ts","../webpack://workflow-telemetry-action/./src/procTraceParser.ts","../webpack://workflow-telemetry-action/./src/processTracer.ts","../webpack://workflow-telemetry-action/./src/statCollector.ts","../webpack://workflow-telemetry-action/./src/stepTracer.ts","../webpack://workflow-telemetry-action/./node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack://workflow-telemetry-action/./node_modules/axios/dist/node/axios.cjs","../webpack://workflow-telemetry-action/external \"assert\"","../webpack://workflow-telemetry-action/external \"child_process\"","../webpack://workflow-telemetry-action/external \"events\"","../webpack://workflow-telemetry-action/external \"fs\"","../webpack://workflow-telemetry-action/external \"http\"","../webpack://workflow-telemetry-action/external \"https\"","../webpack://workflow-telemetry-action/external \"net\"","../webpack://workflow-telemetry-action/external \"os\"","../webpack://workflow-telemetry-action/external \"path\"","../webpack://workflow-telemetry-action/external \"punycode\"","../webpack://workflow-telemetry-action/external \"readline\"","../webpack://workflow-telemetry-action/external \"stream\"","../webpack://workflow-telemetry-action/external \"tls\"","../webpack://workflow-telemetry-action/external \"tty\"","../webpack://workflow-telemetry-action/external \"url\"","../webpack://workflow-telemetry-action/external \"util\"","../webpack://workflow-telemetry-action/external \"zlib\"","../webpack://workflow-telemetry-action/webpack/bootstrap","../webpack://workflow-telemetry-action/webpack/runtime/compat get default export","../webpack://workflow-telemetry-action/webpack/runtime/define property getters","../webpack://workflow-telemetry-action/webpack/runtime/hasOwnProperty shorthand","../webpack://workflow-telemetry-action/webpack/runtime/make namespace object","../webpack://workflow-telemetry-action/webpack/runtime/compat","../webpack://workflow-telemetry-action/webpack/startup"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));\n }\n command_1.issueCommand('set-env', { name }, convertedVal);\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueFileCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));\n }\n command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.prepareKeyValueMessage = exports.issueFileCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst uuid_1 = require(\"uuid\");\nconst utils_1 = require(\"./utils\");\nfunction issueFileCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueFileCommand = issueFileCommand;\nfunction prepareKeyValueMessage(key, value) {\n const delimiter = `ghadelimiter_${uuid_1.v4()}`;\n const convertedValue = utils_1.toCommandValue(value);\n // These should realistically never happen, but just in case someone finds a\n // way to exploit uuid generation let's not allow keys or values that contain\n // the delimiter.\n if (key.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedValue.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\nexports.prepareKeyValueMessage = prepareKeyValueMessage;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Context = void 0;\nconst fs_1 = require(\"fs\");\nconst os_1 = require(\"os\");\nclass Context {\n /**\n * Hydrate the context from the environment\n */\n constructor() {\n var _a, _b, _c;\n this.payload = {};\n if (process.env.GITHUB_EVENT_PATH) {\n if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {\n this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));\n }\n else {\n const path = process.env.GITHUB_EVENT_PATH;\n process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);\n }\n }\n this.eventName = process.env.GITHUB_EVENT_NAME;\n this.sha = process.env.GITHUB_SHA;\n this.ref = process.env.GITHUB_REF;\n this.workflow = process.env.GITHUB_WORKFLOW;\n this.action = process.env.GITHUB_ACTION;\n this.actor = process.env.GITHUB_ACTOR;\n this.job = process.env.GITHUB_JOB;\n this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);\n this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);\n this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;\n this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;\n this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;\n }\n get issue() {\n const payload = this.payload;\n return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });\n }\n get repo() {\n if (process.env.GITHUB_REPOSITORY) {\n const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');\n return { owner, repo };\n }\n if (this.payload.repository) {\n return {\n owner: this.payload.repository.owner.login,\n repo: this.payload.repository.name\n };\n }\n throw new Error(\"context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'\");\n }\n}\nexports.Context = Context;\n//# sourceMappingURL=context.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokit = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst utils_1 = require(\"./utils\");\nexports.context = new Context.Context();\n/**\n * Returns a hydrated octokit ready to use for GitHub Actions\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokit(token, options, ...additionalPlugins) {\n const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);\n return new GitHubWithPlugins(utils_1.getOctokitOptions(token, options));\n}\nexports.getOctokit = getOctokit;\n//# sourceMappingURL=github.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0;\nconst httpClient = __importStar(require(\"@actions/http-client\"));\nfunction getAuthString(token, options) {\n if (!token && !options.auth) {\n throw new Error('Parameter token or opts.auth is required');\n }\n else if (token && options.auth) {\n throw new Error('Parameters token and opts.auth may not both be specified');\n }\n return typeof options.auth === 'string' ? options.auth : `token ${token}`;\n}\nexports.getAuthString = getAuthString;\nfunction getProxyAgent(destinationUrl) {\n const hc = new httpClient.HttpClient();\n return hc.getAgent(destinationUrl);\n}\nexports.getProxyAgent = getProxyAgent;\nfunction getApiBaseUrl() {\n return process.env['GITHUB_API_URL'] || 'https://api.github.com';\n}\nexports.getApiBaseUrl = getApiBaseUrl;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst Utils = __importStar(require(\"./internal/utils\"));\n// octokit + plugins\nconst core_1 = require(\"@octokit/core\");\nconst plugin_rest_endpoint_methods_1 = require(\"@octokit/plugin-rest-endpoint-methods\");\nconst plugin_paginate_rest_1 = require(\"@octokit/plugin-paginate-rest\");\nexports.context = new Context.Context();\nconst baseUrl = Utils.getApiBaseUrl();\nexports.defaults = {\n baseUrl,\n request: {\n agent: Utils.getProxyAgent(baseUrl)\n }\n};\nexports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);\n/**\n * Convience function to correctly format Octokit Options to pass into the constructor.\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}\nexports.getOctokitOptions = getOctokitOptions;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","\"use strict\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nconst pm = __importStar(require(\"./proxy\"));\nconst tunnel = __importStar(require(\"tunnel\"));\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nexports.HttpClient = HttpClient;\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkBypass = exports.getProxyUrl = void 0;\nfunction getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n return new URL(proxyVar);\n }\n else {\n return undefined;\n }\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperReqHosts.some(x => x === upperNoProxyItem)) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\n//# sourceMappingURL=proxy.js.map","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar core = require('@octokit/core');\nvar authAction = require('@octokit/auth-action');\nvar pluginPaginateRest = require('@octokit/plugin-paginate-rest');\nvar pluginRestEndpointMethods = require('@octokit/plugin-rest-endpoint-methods');\n\nconst VERSION = \"4.0.10\";\n\nconst HttpsProxyAgent = require(\"https-proxy-agent\");\n\nconst DEFAULTS = {\n authStrategy: authAction.createActionAuth,\n baseUrl: getApiBaseUrl(),\n userAgent: `octokit-action.js/${VERSION}`\n};\n\nfunction getProxyAgent() {\n const httpProxy = process.env[\"HTTP_PROXY\"] || process.env[\"http_proxy\"];\n\n if (httpProxy) {\n return new HttpsProxyAgent(httpProxy);\n }\n\n const httpsProxy = process.env[\"HTTPS_PROXY\"] || process.env[\"https_proxy\"];\n\n if (httpsProxy) {\n return new HttpsProxyAgent(httpsProxy);\n }\n\n return undefined;\n}\n\nconst Octokit = core.Octokit.plugin(pluginPaginateRest.paginateRest, pluginRestEndpointMethods.legacyRestEndpointMethods).defaults(function buildDefaults(options) {\n return { ...DEFAULTS,\n ...options,\n request: {\n agent: getProxyAgent(),\n ...options.request\n }\n };\n});\n\nfunction getApiBaseUrl() {\n /* istanbul ignore next */\n return process.env[\"GITHUB_API_URL\"] || \"https://api.github.com\";\n}\n\nexports.Octokit = Octokit;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst REGEX_IS_INSTALLATION_LEGACY = /^v1\\./;\nconst REGEX_IS_INSTALLATION = /^ghs_/;\nconst REGEX_IS_USER_TO_SERVER = /^ghu_/;\nasync function auth(token) {\n const isApp = token.split(/\\./).length === 3;\n const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);\n const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);\n const tokenType = isApp ? \"app\" : isInstallation ? \"installation\" : isUserToServer ? \"user-to-server\" : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n\n/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nfunction withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}\n\nasync function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n\nconst createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n\nexports.createTokenAuth = createTokenAuth;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar universalUserAgent = require('universal-user-agent');\nvar beforeAfterHook = require('before-after-hook');\nvar request = require('@octokit/request');\nvar graphql = require('@octokit/graphql');\nvar authToken = require('@octokit/auth-token');\n\nconst VERSION = \"4.1.0\";\n\nclass Octokit {\n constructor(options = {}) {\n const hook = new beforeAfterHook.Collection();\n const requestDefaults = {\n baseUrl: request.request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n // @ts-ignore internal usage only, no need to type\n hook: hook.bind(null, \"request\")\n }),\n mediaType: {\n previews: [],\n format: \"\"\n }\n }; // prepend default user agent with `options.userAgent` if set\n\n requestDefaults.headers[\"user-agent\"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(\" \");\n\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n\n this.request = request.request.defaults(requestDefaults);\n this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults);\n this.log = Object.assign({\n debug: () => {},\n info: () => {},\n warn: console.warn.bind(console),\n error: console.error.bind(console)\n }, options.log);\n this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance\n // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.\n // (2) If only `options.auth` is set, use the default token authentication strategy.\n // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.\n // TODO: type `options.auth` based on `options.authStrategy`.\n\n if (!options.authStrategy) {\n if (!options.auth) {\n // (1)\n this.auth = async () => ({\n type: \"unauthenticated\"\n });\n } else {\n // (2)\n const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n } else {\n const {\n authStrategy,\n ...otherOptions\n } = options;\n const auth = authStrategy(Object.assign({\n request: this.request,\n log: this.log,\n // we pass the current octokit instance as well as its constructor options\n // to allow for authentication strategies that return a new octokit instance\n // that shares the same internal state as the current one. The original\n // requirement for this was the \"event-octokit\" authentication strategy\n // of https://github.com/probot/octokit-auth-probot.\n octokit: this,\n octokitOptions: otherOptions\n }, options.auth)); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n } // apply plugins\n // https://stackoverflow.com/a/16345172\n\n\n const classConstructor = this.constructor;\n classConstructor.plugins.forEach(plugin => {\n Object.assign(this, plugin(this, options));\n });\n }\n\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n\n super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`\n } : null));\n }\n\n };\n return OctokitWithDefaults;\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n\n\n static plugin(...newPlugins) {\n var _a;\n\n const currentPlugins = this.plugins;\n const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a);\n return NewOctokit;\n }\n\n}\nOctokit.VERSION = VERSION;\nOctokit.plugins = [];\n\nexports.Octokit = Octokit;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar isPlainObject = require('is-plain-object');\nvar universalUserAgent = require('universal-user-agent');\n\nfunction lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n\nfunction mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach(key => {\n if (isPlainObject.isPlainObject(options[key])) {\n if (!(key in defaults)) Object.assign(result, {\n [key]: options[key]\n });else result[key] = mergeDeep(defaults[key], options[key]);\n } else {\n Object.assign(result, {\n [key]: options[key]\n });\n }\n });\n return result;\n}\n\nfunction removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n\n return obj;\n}\n\nfunction merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? {\n method,\n url\n } : {\n url: method\n }, options);\n } else {\n options = Object.assign({}, route);\n } // lowercase header names before merging with defaults to avoid duplicates\n\n\n options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging\n\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten\n\n if (defaults && defaults.mediaType.previews.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);\n }\n\n mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, \"\"));\n return mergedOptions;\n}\n\nfunction addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n\n if (names.length === 0) {\n return url;\n }\n\n return url + separator + names.map(name => {\n if (name === \"q\") {\n return \"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\");\n }\n\n return `${name}=${encodeURIComponent(parameters[name])}`;\n }).join(\"&\");\n}\n\nconst urlVariableRegex = /\\{[^}]+\\}/g;\n\nfunction removeNonChars(variableName) {\n return variableName.replace(/^\\W+|\\W+$/g, \"\").split(/,/);\n}\n\nfunction extractUrlVariableNames(url) {\n const matches = url.match(urlVariableRegex);\n\n if (!matches) {\n return [];\n }\n\n return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);\n}\n\nfunction omit(object, keysToOmit) {\n return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {\n obj[key] = object[key];\n return obj;\n }, {});\n}\n\n// Based on https://github.com/bramstein/url-template, licensed under BSD\n// TODO: create separate package.\n//\n// Copyright (c) 2012-2014, Bram Stein\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// 3. The name of the author may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/* istanbul ignore file */\nfunction encodeReserved(str) {\n return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n\n return part;\n }).join(\"\");\n}\n\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\n\nfunction encodeValue(operator, value, key) {\n value = operator === \"+\" || operator === \"#\" ? encodeReserved(value) : encodeUnreserved(value);\n\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n } else {\n return value;\n }\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\n\nfunction getValues(context, operator, key, modifier) {\n var value = context[key],\n result = [];\n\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n value = value.toString();\n\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n } else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n } else {\n const tmp = [];\n\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n tmp.push(encodeValue(operator, value));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n } else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n } else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n } else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n } else if (value === \"\") {\n result.push(\"\");\n }\n }\n\n return result;\n}\n\nfunction parseUrl(template) {\n return {\n expand: expand.bind(null, template)\n };\n}\n\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n\n if (operator && operator !== \"+\") {\n var separator = \",\";\n\n if (operator === \"?\") {\n separator = \"&\";\n } else if (operator !== \"#\") {\n separator = operator;\n }\n\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n } else {\n return values.join(\",\");\n }\n } else {\n return encodeReserved(literal);\n }\n });\n}\n\nfunction parse(options) {\n // https://fetch.spec.whatwg.org/#methods\n let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible\n\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"mediaType\"]); // extract variable names from URL to calculate remaining variables later\n\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n\n const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw\n headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(\",\");\n }\n\n if (options.mediaType.previews.length) {\n const previewsFromAcceptHeader = headers.accept.match(/[\\w-]+(?=-preview)/g) || [];\n headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {\n const format = options.mediaType.format ? `.${options.mediaType.format}` : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n }).join(\",\");\n }\n } // for GET/HEAD requests, set URL query parameters from remaining parameters\n // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters\n\n\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n } else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n } else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n }\n }\n } // default content-type for JSON if body is set\n\n\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.\n // fetch does not allow to set `content-length` header, but we can set body to an empty string\n\n\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n } // Only return body/request keys if present\n\n\n return Object.assign({\n method,\n url,\n headers\n }, typeof body !== \"undefined\" ? {\n body\n } : null, options.request ? {\n request: options.request\n } : null);\n}\n\nfunction endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n\nfunction withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse\n });\n}\n\nconst VERSION = \"7.0.3\";\n\nconst userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.\n// So we use RequestParameters and add method as additional required property.\n\nconst DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent\n },\n mediaType: {\n format: \"\",\n previews: []\n }\n};\n\nconst endpoint = withDefaults(null, DEFAULTS);\n\nexports.endpoint = endpoint;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar request = require('@octokit/request');\nvar universalUserAgent = require('universal-user-agent');\n\nconst VERSION = \"5.0.3\";\n\nfunction _buildMessageForResponseErrors(data) {\n return `Request failed due to following response errors:\\n` + data.errors.map(e => ` - ${e.message}`).join(\"\\n\");\n}\n\nclass GraphqlResponseError extends Error {\n constructor(request, headers, response) {\n super(_buildMessageForResponseErrors(response));\n this.request = request;\n this.headers = headers;\n this.response = response;\n this.name = \"GraphqlResponseError\"; // Expose the errors and response data in their shorthand properties.\n\n this.errors = response.errors;\n this.data = response.data; // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n\n}\n\nconst NON_VARIABLE_OPTIONS = [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"query\", \"mediaType\"];\nconst FORBIDDEN_VARIABLE_OPTIONS = [\"query\", \"method\", \"url\"];\nconst GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nfunction graphql(request, query, options) {\n if (options) {\n if (typeof query === \"string\" && \"query\" in options) {\n return Promise.reject(new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`));\n }\n\n for (const key in options) {\n if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;\n return Promise.reject(new Error(`[@octokit/graphql] \"${key}\" cannot be used as variable name`));\n }\n }\n\n const parsedOptions = typeof query === \"string\" ? Object.assign({\n query\n }, options) : query;\n const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n\n if (!result.variables) {\n result.variables = {};\n }\n\n result.variables[key] = parsedOptions[key];\n return result;\n }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix\n // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451\n\n const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;\n\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n\n return request(requestOptions).then(response => {\n if (response.data.errors) {\n const headers = {};\n\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n\n throw new GraphqlResponseError(requestOptions, headers, response.data);\n }\n\n return response.data.data;\n });\n}\n\nfunction withDefaults(request, newDefaults) {\n const newRequest = request.defaults(newDefaults);\n\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: newRequest.endpoint\n });\n}\n\nconst graphql$1 = withDefaults(request.request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n },\n method: \"POST\",\n url: \"/graphql\"\n});\nfunction withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\"\n });\n}\n\nexports.GraphqlResponseError = GraphqlResponseError;\nexports.graphql = graphql$1;\nexports.withCustomRequest = withCustomRequest;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst VERSION = \"5.0.1\";\n\n/**\n * Some “list” response that can be paginated have a different response structure\n *\n * They have a `total_count` key in the response (search also has `incomplete_results`,\n * /installation/repositories also has `repository_selection`), as well as a key with\n * the list of the items which name varies from endpoint to endpoint.\n *\n * Octokit normalizes these responses so that paginated results are always returned following\n * the same structure. One challenge is that if the list response has only one page, no Link\n * header is provided, so this header alone is not sufficient to check wether a response is\n * paginated or not.\n *\n * We check if a \"total_count\" key is present in the response data, but also make sure that\n * a \"url\" property is not, as the \"Get the combined status for a specific ref\" endpoint would\n * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref\n */\nfunction normalizePaginatedListResponse(response) {\n // endpoints can respond with 204 if repository is empty\n if (!response.data) {\n return {\n ...response,\n data: []\n };\n }\n const responseNeedsNormalization = \"total_count\" in response.data && !(\"url\" in response.data);\n if (!responseNeedsNormalization) return response;\n // keep the additional properties intact as there is currently no other way\n // to retrieve the same information.\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n response.data.total_count = totalCount;\n return response;\n}\n\nfunction iterator(octokit, route, parameters) {\n const options = typeof route === \"function\" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n async next() {\n if (!url) return {\n done: true\n };\n try {\n const response = await requestMethod({\n method,\n url,\n headers\n });\n const normalizedResponse = normalizePaginatedListResponse(response);\n // `response.headers.link` format:\n // '; rel=\"next\", ; rel=\"last\"'\n // sets `url` to undefined if \"next\" URL is not present or `link` header is not set\n url = ((normalizedResponse.headers.link || \"\").match(/<([^>]+)>;\\s*rel=\"next\"/) || [])[1];\n return {\n value: normalizedResponse\n };\n } catch (error) {\n if (error.status !== 409) throw error;\n url = \"\";\n return {\n value: {\n status: 200,\n headers: {},\n data: []\n }\n };\n }\n }\n })\n };\n}\n\nfunction paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = undefined;\n }\n return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);\n}\nfunction gather(octokit, results, iterator, mapFn) {\n return iterator.next().then(result => {\n if (result.done) {\n return results;\n }\n let earlyExit = false;\n function done() {\n earlyExit = true;\n }\n results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);\n if (earlyExit) {\n return results;\n }\n return gather(octokit, results, iterator, mapFn);\n });\n}\n\nconst composePaginateRest = Object.assign(paginate, {\n iterator\n});\n\nconst paginatingEndpoints = [\"GET /app/hook/deliveries\", \"GET /app/installations\", \"GET /enterprises/{enterprise}/actions/permissions/organizations\", \"GET /enterprises/{enterprise}/actions/runner-groups\", \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\", \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\", \"GET /enterprises/{enterprise}/actions/runners\", \"GET /enterprises/{enterprise}/code-scanning/alerts\", \"GET /enterprises/{enterprise}/secret-scanning/alerts\", \"GET /enterprises/{enterprise}/settings/billing/advanced-security\", \"GET /events\", \"GET /gists\", \"GET /gists/public\", \"GET /gists/starred\", \"GET /gists/{gist_id}/comments\", \"GET /gists/{gist_id}/commits\", \"GET /gists/{gist_id}/forks\", \"GET /installation/repositories\", \"GET /issues\", \"GET /licenses\", \"GET /marketplace_listing/plans\", \"GET /marketplace_listing/plans/{plan_id}/accounts\", \"GET /marketplace_listing/stubbed/plans\", \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\", \"GET /networks/{owner}/{repo}/events\", \"GET /notifications\", \"GET /organizations\", \"GET /organizations/{org}/codespaces/secrets\", \"GET /organizations/{org}/codespaces/secrets/{secret_name}/repositories\", \"GET /orgs/{org}/actions/cache/usage-by-repository\", \"GET /orgs/{org}/actions/permissions/repositories\", \"GET /orgs/{org}/actions/runner-groups\", \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\", \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners\", \"GET /orgs/{org}/actions/runners\", \"GET /orgs/{org}/actions/secrets\", \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\", \"GET /orgs/{org}/blocks\", \"GET /orgs/{org}/code-scanning/alerts\", \"GET /orgs/{org}/codespaces\", \"GET /orgs/{org}/dependabot/secrets\", \"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories\", \"GET /orgs/{org}/events\", \"GET /orgs/{org}/failed_invitations\", \"GET /orgs/{org}/hooks\", \"GET /orgs/{org}/hooks/{hook_id}/deliveries\", \"GET /orgs/{org}/installations\", \"GET /orgs/{org}/invitations\", \"GET /orgs/{org}/invitations/{invitation_id}/teams\", \"GET /orgs/{org}/issues\", \"GET /orgs/{org}/members\", \"GET /orgs/{org}/migrations\", \"GET /orgs/{org}/migrations/{migration_id}/repositories\", \"GET /orgs/{org}/outside_collaborators\", \"GET /orgs/{org}/packages\", \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\", \"GET /orgs/{org}/projects\", \"GET /orgs/{org}/public_members\", \"GET /orgs/{org}/repos\", \"GET /orgs/{org}/secret-scanning/alerts\", \"GET /orgs/{org}/settings/billing/advanced-security\", \"GET /orgs/{org}/teams\", \"GET /orgs/{org}/teams/{team_slug}/discussions\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\", \"GET /orgs/{org}/teams/{team_slug}/invitations\", \"GET /orgs/{org}/teams/{team_slug}/members\", \"GET /orgs/{org}/teams/{team_slug}/projects\", \"GET /orgs/{org}/teams/{team_slug}/repos\", \"GET /orgs/{org}/teams/{team_slug}/teams\", \"GET /projects/columns/{column_id}/cards\", \"GET /projects/{project_id}/collaborators\", \"GET /projects/{project_id}/columns\", \"GET /repos/{owner}/{repo}/actions/artifacts\", \"GET /repos/{owner}/{repo}/actions/caches\", \"GET /repos/{owner}/{repo}/actions/runners\", \"GET /repos/{owner}/{repo}/actions/runs\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\", \"GET /repos/{owner}/{repo}/actions/secrets\", \"GET /repos/{owner}/{repo}/actions/workflows\", \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\", \"GET /repos/{owner}/{repo}/assignees\", \"GET /repos/{owner}/{repo}/branches\", \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\", \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\", \"GET /repos/{owner}/{repo}/code-scanning/alerts\", \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\", \"GET /repos/{owner}/{repo}/code-scanning/analyses\", \"GET /repos/{owner}/{repo}/codespaces\", \"GET /repos/{owner}/{repo}/codespaces/devcontainers\", \"GET /repos/{owner}/{repo}/codespaces/secrets\", \"GET /repos/{owner}/{repo}/collaborators\", \"GET /repos/{owner}/{repo}/comments\", \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/commits\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\", \"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\", \"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\", \"GET /repos/{owner}/{repo}/commits/{ref}/status\", \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\", \"GET /repos/{owner}/{repo}/contributors\", \"GET /repos/{owner}/{repo}/dependabot/alerts\", \"GET /repos/{owner}/{repo}/dependabot/secrets\", \"GET /repos/{owner}/{repo}/deployments\", \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\", \"GET /repos/{owner}/{repo}/environments\", \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\", \"GET /repos/{owner}/{repo}/events\", \"GET /repos/{owner}/{repo}/forks\", \"GET /repos/{owner}/{repo}/hooks\", \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\", \"GET /repos/{owner}/{repo}/invitations\", \"GET /repos/{owner}/{repo}/issues\", \"GET /repos/{owner}/{repo}/issues/comments\", \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/issues/events\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/events\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\", \"GET /repos/{owner}/{repo}/keys\", \"GET /repos/{owner}/{repo}/labels\", \"GET /repos/{owner}/{repo}/milestones\", \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\", \"GET /repos/{owner}/{repo}/notifications\", \"GET /repos/{owner}/{repo}/pages/builds\", \"GET /repos/{owner}/{repo}/projects\", \"GET /repos/{owner}/{repo}/pulls\", \"GET /repos/{owner}/{repo}/pulls/comments\", \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\", \"GET /repos/{owner}/{repo}/releases\", \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\", \"GET /repos/{owner}/{repo}/releases/{release_id}/reactions\", \"GET /repos/{owner}/{repo}/secret-scanning/alerts\", \"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations\", \"GET /repos/{owner}/{repo}/stargazers\", \"GET /repos/{owner}/{repo}/subscribers\", \"GET /repos/{owner}/{repo}/tags\", \"GET /repos/{owner}/{repo}/teams\", \"GET /repos/{owner}/{repo}/topics\", \"GET /repositories\", \"GET /repositories/{repository_id}/environments/{environment_name}/secrets\", \"GET /search/code\", \"GET /search/commits\", \"GET /search/issues\", \"GET /search/labels\", \"GET /search/repositories\", \"GET /search/topics\", \"GET /search/users\", \"GET /teams/{team_id}/discussions\", \"GET /teams/{team_id}/discussions/{discussion_number}/comments\", \"GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\", \"GET /teams/{team_id}/discussions/{discussion_number}/reactions\", \"GET /teams/{team_id}/invitations\", \"GET /teams/{team_id}/members\", \"GET /teams/{team_id}/projects\", \"GET /teams/{team_id}/repos\", \"GET /teams/{team_id}/teams\", \"GET /user/blocks\", \"GET /user/codespaces\", \"GET /user/codespaces/secrets\", \"GET /user/emails\", \"GET /user/followers\", \"GET /user/following\", \"GET /user/gpg_keys\", \"GET /user/installations\", \"GET /user/installations/{installation_id}/repositories\", \"GET /user/issues\", \"GET /user/keys\", \"GET /user/marketplace_purchases\", \"GET /user/marketplace_purchases/stubbed\", \"GET /user/memberships/orgs\", \"GET /user/migrations\", \"GET /user/migrations/{migration_id}/repositories\", \"GET /user/orgs\", \"GET /user/packages\", \"GET /user/packages/{package_type}/{package_name}/versions\", \"GET /user/public_emails\", \"GET /user/repos\", \"GET /user/repository_invitations\", \"GET /user/ssh_signing_keys\", \"GET /user/starred\", \"GET /user/subscriptions\", \"GET /user/teams\", \"GET /users\", \"GET /users/{username}/events\", \"GET /users/{username}/events/orgs/{org}\", \"GET /users/{username}/events/public\", \"GET /users/{username}/followers\", \"GET /users/{username}/following\", \"GET /users/{username}/gists\", \"GET /users/{username}/gpg_keys\", \"GET /users/{username}/keys\", \"GET /users/{username}/orgs\", \"GET /users/{username}/packages\", \"GET /users/{username}/projects\", \"GET /users/{username}/received_events\", \"GET /users/{username}/received_events/public\", \"GET /users/{username}/repos\", \"GET /users/{username}/ssh_signing_keys\", \"GET /users/{username}/starred\", \"GET /users/{username}/subscriptions\"];\n\nfunction isPaginatingEndpoint(arg) {\n if (typeof arg === \"string\") {\n return paginatingEndpoints.includes(arg);\n } else {\n return false;\n }\n}\n\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\nfunction paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit)\n })\n };\n}\npaginateRest.VERSION = VERSION;\n\nexports.composePaginateRest = composePaginateRest;\nexports.isPaginatingEndpoint = isPaginatingEndpoint;\nexports.paginateRest = paginateRest;\nexports.paginatingEndpoints = paginatingEndpoints;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst Endpoints = {\n actions: {\n addCustomLabelsToSelfHostedRunnerForOrg: [\"POST /orgs/{org}/actions/runners/{runner_id}/labels\"],\n addCustomLabelsToSelfHostedRunnerForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n addSelectedRepoToOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n approveWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve\"],\n cancelWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\"],\n createOrUpdateEnvironmentSecret: [\"PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n createRegistrationTokenForOrg: [\"POST /orgs/{org}/actions/runners/registration-token\"],\n createRegistrationTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/registration-token\"],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/remove-token\"],\n createWorkflowDispatch: [\"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\"],\n deleteActionsCacheById: [\"DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}\"],\n deleteActionsCacheByKey: [\"DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}\"],\n deleteArtifact: [\"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n deleteEnvironmentSecret: [\"DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n deleteSelfHostedRunnerFromOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}\"],\n deleteSelfHostedRunnerFromRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n disableSelectedRepositoryGithubActionsOrganization: [\"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n disableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\"],\n downloadArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\"],\n downloadJobLogsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\"],\n downloadWorkflowRunAttemptLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs\"],\n downloadWorkflowRunLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n enableSelectedRepositoryGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n enableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\"],\n getActionsCacheList: [\"GET /repos/{owner}/{repo}/actions/caches\"],\n getActionsCacheUsage: [\"GET /repos/{owner}/{repo}/actions/cache/usage\"],\n getActionsCacheUsageByRepoForOrg: [\"GET /orgs/{org}/actions/cache/usage-by-repository\"],\n getActionsCacheUsageForEnterprise: [\"GET /enterprises/{enterprise}/actions/cache/usage\"],\n getActionsCacheUsageForOrg: [\"GET /orgs/{org}/actions/cache/usage\"],\n getAllowedActionsOrganization: [\"GET /orgs/{org}/actions/permissions/selected-actions\"],\n getAllowedActionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getEnvironmentPublicKey: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key\"],\n getEnvironmentSecret: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n getGithubActionsDefaultWorkflowPermissionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/workflow\"],\n getGithubActionsDefaultWorkflowPermissionsOrganization: [\"GET /orgs/{org}/actions/permissions/workflow\"],\n getGithubActionsDefaultWorkflowPermissionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/workflow\"],\n getGithubActionsPermissionsOrganization: [\"GET /orgs/{org}/actions/permissions\"],\n getGithubActionsPermissionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions\"],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getPendingDeploymentsForRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"],\n getRepoPermissions: [\"GET /repos/{owner}/{repo}/actions/permissions\", {}, {\n renamed: [\"actions\", \"getGithubActionsPermissionsRepository\"]\n }],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getReviewsForRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals\"],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowAccessToRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/access\"],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunAttempt: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}\"],\n getWorkflowRunUsage: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\"],\n getWorkflowUsage: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\"],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listEnvironmentSecrets: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets\"],\n listJobsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\"],\n listJobsForWorkflowRunAttempt: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\"],\n listLabelsForSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}/labels\"],\n listLabelsForSelfHostedRunnerForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/downloads\"],\n listSelectedReposForOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n listSelectedRepositoriesEnabledGithubActionsOrganization: [\"GET /orgs/{org}/actions/permissions/repositories\"],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\"],\n listWorkflowRuns: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\"],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n reRunJobForWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun\"],\n reRunWorkflow: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun\"],\n reRunWorkflowFailedJobs: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs\"],\n removeAllCustomLabelsFromSelfHostedRunnerForOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}/labels\"],\n removeAllCustomLabelsFromSelfHostedRunnerForRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n removeCustomLabelFromSelfHostedRunnerForOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}\"],\n removeCustomLabelFromSelfHostedRunnerForRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n reviewPendingDeploymentsForRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"],\n setAllowedActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/selected-actions\"],\n setAllowedActionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n setCustomLabelsForSelfHostedRunnerForOrg: [\"PUT /orgs/{org}/actions/runners/{runner_id}/labels\"],\n setCustomLabelsForSelfHostedRunnerForRepo: [\"PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n setGithubActionsDefaultWorkflowPermissionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/workflow\"],\n setGithubActionsDefaultWorkflowPermissionsOrganization: [\"PUT /orgs/{org}/actions/permissions/workflow\"],\n setGithubActionsDefaultWorkflowPermissionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/workflow\"],\n setGithubActionsPermissionsOrganization: [\"PUT /orgs/{org}/actions/permissions\"],\n setGithubActionsPermissionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions\"],\n setSelectedReposForOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n setSelectedRepositoriesEnabledGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories\"],\n setWorkflowAccessToRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/access\"]\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\"DELETE /notifications/threads/{thread_id}/subscription\"],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\"GET /notifications/threads/{thread_id}/subscription\"],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\"GET /users/{username}/events/orgs/{org}\"],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\"GET /users/{username}/received_events/public\"],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/notifications\"],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\"PUT /notifications/threads/{thread_id}/subscription\"],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"]\n },\n apps: {\n addRepoToInstallation: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\", {}, {\n renamed: [\"apps\", \"addRepoToInstallationForAuthenticatedUser\"]\n }],\n addRepoToInstallationForAuthenticatedUser: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\"],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\"POST /app/installations/{installation_id}/access_tokens\"],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\"GET /marketplace_listing/accounts/{account_id}\"],\n getSubscriptionPlanForAccountStubbed: [\"GET /marketplace_listing/stubbed/accounts/{account_id}\"],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n getWebhookConfigForApp: [\"GET /app/hook/config\"],\n getWebhookDelivery: [\"GET /app/hook/deliveries/{delivery_id}\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\"],\n listInstallationReposForAuthenticatedUser: [\"GET /user/installations/{installation_id}/repositories\"],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\"GET /user/marketplace_purchases/stubbed\"],\n listWebhookDeliveries: [\"GET /app/hook/deliveries\"],\n redeliverWebhookDelivery: [\"POST /app/hook/deliveries/{delivery_id}/attempts\"],\n removeRepoFromInstallation: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\", {}, {\n renamed: [\"apps\", \"removeRepoFromInstallationForAuthenticatedUser\"]\n }],\n removeRepoFromInstallationForAuthenticatedUser: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\"],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n scopeToken: [\"POST /applications/{client_id}/token/scoped\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\"DELETE /app/installations/{installation_id}/suspended\"],\n updateWebhookConfigForApp: [\"PATCH /app/hook/config\"]\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\"GET /users/{username}/settings/billing/actions\"],\n getGithubAdvancedSecurityBillingGhe: [\"GET /enterprises/{enterprise}/settings/billing/advanced-security\"],\n getGithubAdvancedSecurityBillingOrg: [\"GET /orgs/{org}/settings/billing/advanced-security\"],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\"GET /users/{username}/settings/billing/packages\"],\n getSharedStorageBillingOrg: [\"GET /orgs/{org}/settings/billing/shared-storage\"],\n getSharedStorageBillingUser: [\"GET /users/{username}/settings/billing/shared-storage\"]\n },\n checks: {\n create: [\"POST /repos/{owner}/{repo}/check-runs\"],\n createSuite: [\"POST /repos/{owner}/{repo}/check-suites\"],\n get: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n getSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\"],\n listAnnotations: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\"],\n listForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\"],\n listForSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\"],\n listSuitesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\"],\n rerequestRun: [\"POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest\"],\n rerequestSuite: [\"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\"],\n setSuitesPreferences: [\"PATCH /repos/{owner}/{repo}/check-suites/preferences\"],\n update: [\"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\"]\n },\n codeScanning: {\n deleteAnalysis: [\"DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}\"],\n getAlert: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\", {}, {\n renamedParameters: {\n alert_id: \"alert_number\"\n }\n }],\n getAnalysis: [\"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\"],\n getCodeqlDatabase: [\"GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}\"],\n getSarif: [\"GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}\"],\n listAlertInstances: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\"],\n listAlertsForEnterprise: [\"GET /enterprises/{enterprise}/code-scanning/alerts\"],\n listAlertsForOrg: [\"GET /orgs/{org}/code-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listAlertsInstances: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\", {}, {\n renamed: [\"codeScanning\", \"listAlertInstances\"]\n }],\n listCodeqlDatabases: [\"GET /repos/{owner}/{repo}/code-scanning/codeql/databases\"],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\"],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"]\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\"GET /codes_of_conduct\"],\n getConductCode: [\"GET /codes_of_conduct/{key}\"]\n },\n codespaces: {\n addRepositoryForSecretForAuthenticatedUser: [\"PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\"],\n addSelectedRepoToOrgSecret: [\"PUT /organizations/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}\"],\n codespaceMachinesForAuthenticatedUser: [\"GET /user/codespaces/{codespace_name}/machines\"],\n createForAuthenticatedUser: [\"POST /user/codespaces\"],\n createOrUpdateOrgSecret: [\"PUT /organizations/{org}/codespaces/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"],\n createOrUpdateSecretForAuthenticatedUser: [\"PUT /user/codespaces/secrets/{secret_name}\"],\n createWithPrForAuthenticatedUser: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces\"],\n createWithRepoForAuthenticatedUser: [\"POST /repos/{owner}/{repo}/codespaces\"],\n deleteForAuthenticatedUser: [\"DELETE /user/codespaces/{codespace_name}\"],\n deleteFromOrganization: [\"DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}\"],\n deleteOrgSecret: [\"DELETE /organizations/{org}/codespaces/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"],\n deleteSecretForAuthenticatedUser: [\"DELETE /user/codespaces/secrets/{secret_name}\"],\n exportForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/exports\"],\n getExportDetailsForAuthenticatedUser: [\"GET /user/codespaces/{codespace_name}/exports/{export_id}\"],\n getForAuthenticatedUser: [\"GET /user/codespaces/{codespace_name}\"],\n getOrgPublicKey: [\"GET /organizations/{org}/codespaces/secrets/public-key\"],\n getOrgSecret: [\"GET /organizations/{org}/codespaces/secrets/{secret_name}\"],\n getPublicKeyForAuthenticatedUser: [\"GET /user/codespaces/secrets/public-key\"],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/codespaces/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"],\n getSecretForAuthenticatedUser: [\"GET /user/codespaces/secrets/{secret_name}\"],\n listDevcontainersInRepositoryForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/codespaces/devcontainers\"],\n listForAuthenticatedUser: [\"GET /user/codespaces\"],\n listInOrganization: [\"GET /orgs/{org}/codespaces\", {}, {\n renamedParameters: {\n org_id: \"org\"\n }\n }],\n listInRepositoryForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/codespaces\"],\n listOrgSecrets: [\"GET /organizations/{org}/codespaces/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/codespaces/secrets\"],\n listRepositoriesForSecretForAuthenticatedUser: [\"GET /user/codespaces/secrets/{secret_name}/repositories\"],\n listSecretsForAuthenticatedUser: [\"GET /user/codespaces/secrets\"],\n listSelectedReposForOrgSecret: [\"GET /organizations/{org}/codespaces/secrets/{secret_name}/repositories\"],\n preFlightWithRepoForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/codespaces/new\"],\n removeRepositoryForSecretForAuthenticatedUser: [\"DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /organizations/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}\"],\n repoMachinesForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/codespaces/machines\"],\n setRepositoriesForSecretForAuthenticatedUser: [\"PUT /user/codespaces/secrets/{secret_name}/repositories\"],\n setSelectedReposForOrgSecret: [\"PUT /organizations/{org}/codespaces/secrets/{secret_name}/repositories\"],\n startForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/start\"],\n stopForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/stop\"],\n stopInOrganization: [\"POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop\"],\n updateForAuthenticatedUser: [\"PATCH /user/codespaces/{codespace_name}\"]\n },\n dependabot: {\n addSelectedRepoToOrgSecret: [\"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\"],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/dependabot/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"],\n deleteOrgSecret: [\"DELETE /orgs/{org}/dependabot/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"],\n getAlert: [\"GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/dependabot/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/dependabot/secrets/{secret_name}\"],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/dependabot/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/dependabot/alerts\"],\n listOrgSecrets: [\"GET /orgs/{org}/dependabot/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/dependabot/secrets\"],\n listSelectedReposForOrgSecret: [\"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\"],\n setSelectedReposForOrgSecret: [\"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}\"]\n },\n dependencyGraph: {\n createRepositorySnapshot: [\"POST /repos/{owner}/{repo}/dependency-graph/snapshots\"],\n diffRange: [\"GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}\"]\n },\n emojis: {\n get: [\"GET /emojis\"]\n },\n enterpriseAdmin: {\n addCustomLabelsToSelfHostedRunnerForEnterprise: [\"POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n disableSelectedOrganizationGithubActionsEnterprise: [\"DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n enableSelectedOrganizationGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n getAllowedActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n getGithubActionsPermissionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions\"],\n getServerStatistics: [\"GET /enterprise-installation/{enterprise_or_org}/server-statistics\"],\n listLabelsForSelfHostedRunnerForEnterprise: [\"GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n listSelectedOrganizationsEnabledGithubActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/organizations\"],\n removeAllCustomLabelsFromSelfHostedRunnerForEnterprise: [\"DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n removeCustomLabelFromSelfHostedRunnerForEnterprise: [\"DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name}\"],\n setAllowedActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n setCustomLabelsForSelfHostedRunnerForEnterprise: [\"PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n setGithubActionsPermissionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions\"],\n setSelectedOrganizationsEnabledGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations\"]\n },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"]\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"]\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"]\n },\n interactions: {\n getRestrictionsForAuthenticatedUser: [\"GET /user/interaction-limits\"],\n getRestrictionsForOrg: [\"GET /orgs/{org}/interaction-limits\"],\n getRestrictionsForRepo: [\"GET /repos/{owner}/{repo}/interaction-limits\"],\n getRestrictionsForYourPublicRepos: [\"GET /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"getRestrictionsForAuthenticatedUser\"]\n }],\n removeRestrictionsForAuthenticatedUser: [\"DELETE /user/interaction-limits\"],\n removeRestrictionsForOrg: [\"DELETE /orgs/{org}/interaction-limits\"],\n removeRestrictionsForRepo: [\"DELETE /repos/{owner}/{repo}/interaction-limits\"],\n removeRestrictionsForYourPublicRepos: [\"DELETE /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"removeRestrictionsForAuthenticatedUser\"]\n }],\n setRestrictionsForAuthenticatedUser: [\"PUT /user/interaction-limits\"],\n setRestrictionsForOrg: [\"PUT /orgs/{org}/interaction-limits\"],\n setRestrictionsForRepo: [\"PUT /repos/{owner}/{repo}/interaction-limits\"],\n setRestrictionsForYourPublicRepos: [\"PUT /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"setRestrictionsForAuthenticatedUser\"]\n }]\n },\n issues: {\n addAssignees: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\"],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\"],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n removeAssignees: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n removeLabel: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\"],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\"]\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"]\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\"POST /markdown/raw\", {\n headers: {\n \"content-type\": \"text/plain; charset=utf-8\"\n }\n }]\n },\n meta: {\n get: [\"GET /meta\"],\n getOctocat: [\"GET /octocat\"],\n getZen: [\"GET /zen\"],\n root: [\"GET /\"]\n },\n migrations: {\n cancelImport: [\"DELETE /repos/{owner}/{repo}/import\"],\n deleteArchiveForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/archive\"],\n deleteArchiveForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/archive\"],\n downloadArchiveForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/archive\"],\n getArchiveForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/archive\"],\n getCommitAuthors: [\"GET /repos/{owner}/{repo}/import/authors\"],\n getImportStatus: [\"GET /repos/{owner}/{repo}/import\"],\n getLargeFiles: [\"GET /repos/{owner}/{repo}/import/large_files\"],\n getStatusForAuthenticatedUser: [\"GET /user/migrations/{migration_id}\"],\n getStatusForOrg: [\"GET /orgs/{org}/migrations/{migration_id}\"],\n listForAuthenticatedUser: [\"GET /user/migrations\"],\n listForOrg: [\"GET /orgs/{org}/migrations\"],\n listReposForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/repositories\"],\n listReposForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/repositories\"],\n listReposForUser: [\"GET /user/migrations/{migration_id}/repositories\", {}, {\n renamed: [\"migrations\", \"listReposForAuthenticatedUser\"]\n }],\n mapCommitAuthor: [\"PATCH /repos/{owner}/{repo}/import/authors/{author_id}\"],\n setLfsPreference: [\"PATCH /repos/{owner}/{repo}/import/lfs\"],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n startImport: [\"PUT /repos/{owner}/{repo}/import\"],\n unlockRepoForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\"],\n unlockRepoForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\"],\n updateImport: [\"PATCH /repos/{owner}/{repo}/import\"]\n },\n orgs: {\n addSecurityManagerTeam: [\"PUT /orgs/{org}/security-managers/teams/{team_slug}\"],\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n cancelInvitation: [\"DELETE /orgs/{org}/invitations/{invitation_id}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\"PUT /orgs/{org}/outside_collaborators/{username}\"],\n createCustomRole: [\"POST /orgs/{org}/custom_roles\"],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n deleteCustomRole: [\"DELETE /orgs/{org}/custom_roles/{role_id}\"],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n enableOrDisableSecurityProductOnAllOrgRepos: [\"POST /orgs/{org}/{security_product}/{enablement}\"],\n get: [\"GET /orgs/{org}\"],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n getWebhookConfigForOrg: [\"GET /orgs/{org}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}\"],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listCustomRoles: [\"GET /organizations/{organization_id}/custom_roles\"],\n listFailedInvitations: [\"GET /orgs/{org}/failed_invitations\"],\n listFineGrainedPermissions: [\"GET /orgs/{org}/fine_grained_permissions\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listSecurityManagerTeams: [\"GET /orgs/{org}/security-managers\"],\n listWebhookDeliveries: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\"DELETE /orgs/{org}/outside_collaborators/{username}\"],\n removePublicMembershipForAuthenticatedUser: [\"DELETE /orgs/{org}/public_members/{username}\"],\n removeSecurityManagerTeam: [\"DELETE /orgs/{org}/security-managers/teams/{team_slug}\"],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\"PUT /orgs/{org}/public_members/{username}\"],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateCustomRole: [\"PATCH /orgs/{org}/custom_roles/{role_id}\"],\n updateMembershipForAuthenticatedUser: [\"PATCH /user/memberships/orgs/{org}\"],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n updateWebhookConfigForOrg: [\"PATCH /orgs/{org}/hooks/{hook_id}/config\"]\n },\n packages: {\n deletePackageForAuthenticatedUser: [\"DELETE /user/packages/{package_type}/{package_name}\"],\n deletePackageForOrg: [\"DELETE /orgs/{org}/packages/{package_type}/{package_name}\"],\n deletePackageForUser: [\"DELETE /users/{username}/packages/{package_type}/{package_name}\"],\n deletePackageVersionForAuthenticatedUser: [\"DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n deletePackageVersionForOrg: [\"DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n deletePackageVersionForUser: [\"DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getAllPackageVersionsForAPackageOwnedByAnOrg: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\", {}, {\n renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByOrg\"]\n }],\n getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions\", {}, {\n renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByAuthenticatedUser\"]\n }],\n getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions\"],\n getAllPackageVersionsForPackageOwnedByOrg: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\"],\n getAllPackageVersionsForPackageOwnedByUser: [\"GET /users/{username}/packages/{package_type}/{package_name}/versions\"],\n getPackageForAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}\"],\n getPackageForOrganization: [\"GET /orgs/{org}/packages/{package_type}/{package_name}\"],\n getPackageForUser: [\"GET /users/{username}/packages/{package_type}/{package_name}\"],\n getPackageVersionForAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getPackageVersionForOrganization: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getPackageVersionForUser: [\"GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n listPackagesForAuthenticatedUser: [\"GET /user/packages\"],\n listPackagesForOrganization: [\"GET /orgs/{org}/packages\"],\n listPackagesForUser: [\"GET /users/{username}/packages\"],\n restorePackageForAuthenticatedUser: [\"POST /user/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageForOrg: [\"POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageForUser: [\"POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageVersionForAuthenticatedUser: [\"POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"],\n restorePackageVersionForOrg: [\"POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"],\n restorePackageVersionForUser: [\"POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"]\n },\n projects: {\n addCollaborator: [\"PUT /projects/{project_id}/collaborators/{username}\"],\n createCard: [\"POST /projects/columns/{column_id}/cards\"],\n createColumn: [\"POST /projects/{project_id}/columns\"],\n createForAuthenticatedUser: [\"POST /user/projects\"],\n createForOrg: [\"POST /orgs/{org}/projects\"],\n createForRepo: [\"POST /repos/{owner}/{repo}/projects\"],\n delete: [\"DELETE /projects/{project_id}\"],\n deleteCard: [\"DELETE /projects/columns/cards/{card_id}\"],\n deleteColumn: [\"DELETE /projects/columns/{column_id}\"],\n get: [\"GET /projects/{project_id}\"],\n getCard: [\"GET /projects/columns/cards/{card_id}\"],\n getColumn: [\"GET /projects/columns/{column_id}\"],\n getPermissionForUser: [\"GET /projects/{project_id}/collaborators/{username}/permission\"],\n listCards: [\"GET /projects/columns/{column_id}/cards\"],\n listCollaborators: [\"GET /projects/{project_id}/collaborators\"],\n listColumns: [\"GET /projects/{project_id}/columns\"],\n listForOrg: [\"GET /orgs/{org}/projects\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/projects\"],\n listForUser: [\"GET /users/{username}/projects\"],\n moveCard: [\"POST /projects/columns/cards/{card_id}/moves\"],\n moveColumn: [\"POST /projects/columns/{column_id}/moves\"],\n removeCollaborator: [\"DELETE /projects/{project_id}/collaborators/{username}\"],\n update: [\"PATCH /projects/{project_id}\"],\n updateCard: [\"PATCH /projects/columns/cards/{card_id}\"],\n updateColumn: [\"PATCH /projects/columns/{column_id}\"]\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\"],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n deletePendingReview: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n deleteReviewComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n dismissReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\"],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\"],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n listReviewComments: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n requestReviewers: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n submitReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\"],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\"],\n updateReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n updateReviewComment: [\"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\"]\n },\n rateLimit: {\n get: [\"GET /rate_limit\"]\n },\n reactions: {\n createForCommitComment: [\"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\"],\n createForIssue: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n createForIssueComment: [\"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"],\n createForPullRequestReviewComment: [\"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"],\n createForRelease: [\"POST /repos/{owner}/{repo}/releases/{release_id}/reactions\"],\n createForTeamDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"],\n createForTeamDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"],\n deleteForCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForIssue: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\"],\n deleteForIssueComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForPullRequestComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}\"],\n deleteForTeamDiscussion: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\"],\n deleteForTeamDiscussionComment: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\"],\n listForCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\"],\n listForIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n listForIssueComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"],\n listForPullRequestReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"],\n listForRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}/reactions\"],\n listForTeamDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"],\n listForTeamDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"]\n },\n repos: {\n acceptInvitation: [\"PATCH /user/repository_invitations/{invitation_id}\", {}, {\n renamed: [\"repos\", \"acceptInvitationForAuthenticatedUser\"]\n }],\n acceptInvitationForAuthenticatedUser: [\"PATCH /user/repository_invitations/{invitation_id}\"],\n addAppAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n addTeamAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n addUserAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkVulnerabilityAlerts: [\"GET /repos/{owner}/{repo}/vulnerability-alerts\"],\n codeownersErrors: [\"GET /repos/{owner}/{repo}/codeowners/errors\"],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n compareCommitsWithBasehead: [\"GET /repos/{owner}/{repo}/compare/{basehead}\"],\n createAutolink: [\"POST /repos/{owner}/{repo}/autolinks\"],\n createCommitComment: [\"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n createCommitSignatureProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentBranchPolicy: [\"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\"],\n createDeploymentStatus: [\"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateEnvironment: [\"PUT /repos/{owner}/{repo}/environments/{environment_name}\"],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createPagesDeployment: [\"POST /repos/{owner}/{repo}/pages/deployment\"],\n createPagesSite: [\"POST /repos/{owner}/{repo}/pages\"],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createTagProtection: [\"POST /repos/{owner}/{repo}/tags/protection\"],\n createUsingTemplate: [\"POST /repos/{template_owner}/{template_repo}/generate\"],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n declineInvitation: [\"DELETE /user/repository_invitations/{invitation_id}\", {}, {\n renamed: [\"repos\", \"declineInvitationForAuthenticatedUser\"]\n }],\n declineInvitationForAuthenticatedUser: [\"DELETE /user/repository_invitations/{invitation_id}\"],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n deleteAdminBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n deleteAnEnvironment: [\"DELETE /repos/{owner}/{repo}/environments/{environment_name}\"],\n deleteAutolink: [\"DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n deleteBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\"],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n deleteDeploymentBranchPolicy: [\"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\"],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n deletePagesSite: [\"DELETE /repos/{owner}/{repo}/pages\"],\n deletePullRequestReviewProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n deleteTagProtection: [\"DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}\"],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\"DELETE /repos/{owner}/{repo}/automated-security-fixes\"],\n disableLfsForRepo: [\"DELETE /repos/{owner}/{repo}/lfs\"],\n disableVulnerabilityAlerts: [\"DELETE /repos/{owner}/{repo}/vulnerability-alerts\"],\n downloadArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\", {}, {\n renamed: [\"repos\", \"downloadZipballArchive\"]\n }],\n downloadTarballArchive: [\"GET /repos/{owner}/{repo}/tarball/{ref}\"],\n downloadZipballArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\"],\n enableAutomatedSecurityFixes: [\"PUT /repos/{owner}/{repo}/automated-security-fixes\"],\n enableLfsForRepo: [\"PUT /repos/{owner}/{repo}/lfs\"],\n enableVulnerabilityAlerts: [\"PUT /repos/{owner}/{repo}/vulnerability-alerts\"],\n generateReleaseNotes: [\"POST /repos/{owner}/{repo}/releases/generate-notes\"],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n getAdminBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n getAllEnvironments: [\"GET /repos/{owner}/{repo}/environments\"],\n getAllStatusCheckContexts: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\"],\n getAllTopics: [\"GET /repos/{owner}/{repo}/topics\"],\n getAppsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\"],\n getAutolink: [\"GET /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection\"],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\"GET /repos/{owner}/{repo}/collaborators/{username}/permission\"],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n getCommunityProfileMetrics: [\"GET /repos/{owner}/{repo}/community/profile\"],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentBranchPolicy: [\"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\"],\n getDeploymentStatus: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\"],\n getEnvironment: [\"GET /repos/{owner}/{repo}/environments/{environment_name}\"],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getPagesHealthCheck: [\"GET /repos/{owner}/{repo}/pages/health\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getReadmeInDirectory: [\"GET /repos/{owner}/{repo}/readme/{dir}\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getStatusChecksProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n getTeamsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\"],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\"],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n getWebhookConfigForRepo: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}\"],\n listAutolinks: [\"GET /repos/{owner}/{repo}/autolinks\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\"],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/statuses\"],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentBranchPolicies: [\"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\"],\n listDeploymentStatuses: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\"],\n listReleaseAssets: [\"GET /repos/{owner}/{repo}/releases/{release_id}/assets\"],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTagProtection: [\"GET /repos/{owner}/{repo}/tags/protection\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhookDeliveries: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n mergeUpstream: [\"POST /repos/{owner}/{repo}/merge-upstream\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"],\n removeAppAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n removeCollaborator: [\"DELETE /repos/{owner}/{repo}/collaborators/{username}\"],\n removeStatusCheckContexts: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n removeStatusCheckProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n removeTeamAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n removeUserAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n renameBranch: [\"POST /repos/{owner}/{repo}/branches/{branch}/rename\"],\n replaceAllTopics: [\"PUT /repos/{owner}/{repo}/topics\"],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n setAppAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n setStatusCheckContexts: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n setTeamAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n setUserAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection\"],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateDeploymentBranchPolicy: [\"PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\"],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n updatePullRequestReviewProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n updateStatusCheckPotection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\", {}, {\n renamed: [\"repos\", \"updateStatusCheckProtection\"]\n }],\n updateStatusCheckProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n updateWebhookConfigForRepo: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n uploadReleaseAsset: [\"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\", {\n baseUrl: \"https://uploads.github.com\"\n }]\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\"],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\"],\n users: [\"GET /search/users\"]\n },\n secretScanning: {\n getAlert: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"],\n listAlertsForEnterprise: [\"GET /enterprises/{enterprise}/secret-scanning/alerts\"],\n listAlertsForOrg: [\"GET /orgs/{org}/secret-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts\"],\n listLocationsForAlert: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"]\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n addOrUpdateProjectPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n addOrUpdateRepoPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n checkPermissionsForProjectInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n checkPermissionsForRepoInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n deleteDiscussionInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n getDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n getMembershipForUserInOrg: [\"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/invitations\"],\n listProjectsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects\"],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n removeProjectInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n removeRepoInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n updateDiscussionCommentInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n updateDiscussionInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"]\n },\n users: {\n addEmailForAuthenticated: [\"POST /user/emails\", {}, {\n renamed: [\"users\", \"addEmailForAuthenticatedUser\"]\n }],\n addEmailForAuthenticatedUser: [\"POST /user/emails\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\"POST /user/gpg_keys\", {}, {\n renamed: [\"users\", \"createGpgKeyForAuthenticatedUser\"]\n }],\n createGpgKeyForAuthenticatedUser: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\"POST /user/keys\", {}, {\n renamed: [\"users\", \"createPublicSshKeyForAuthenticatedUser\"]\n }],\n createPublicSshKeyForAuthenticatedUser: [\"POST /user/keys\"],\n createSshSigningKeyForAuthenticatedUser: [\"POST /user/ssh_signing_keys\"],\n deleteEmailForAuthenticated: [\"DELETE /user/emails\", {}, {\n renamed: [\"users\", \"deleteEmailForAuthenticatedUser\"]\n }],\n deleteEmailForAuthenticatedUser: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\"DELETE /user/gpg_keys/{gpg_key_id}\", {}, {\n renamed: [\"users\", \"deleteGpgKeyForAuthenticatedUser\"]\n }],\n deleteGpgKeyForAuthenticatedUser: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\"DELETE /user/keys/{key_id}\", {}, {\n renamed: [\"users\", \"deletePublicSshKeyForAuthenticatedUser\"]\n }],\n deletePublicSshKeyForAuthenticatedUser: [\"DELETE /user/keys/{key_id}\"],\n deleteSshSigningKeyForAuthenticatedUser: [\"DELETE /user/ssh_signing_keys/{ssh_signing_key_id}\"],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\"GET /user/gpg_keys/{gpg_key_id}\", {}, {\n renamed: [\"users\", \"getGpgKeyForAuthenticatedUser\"]\n }],\n getGpgKeyForAuthenticatedUser: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\"GET /user/keys/{key_id}\", {}, {\n renamed: [\"users\", \"getPublicSshKeyForAuthenticatedUser\"]\n }],\n getPublicSshKeyForAuthenticatedUser: [\"GET /user/keys/{key_id}\"],\n getSshSigningKeyForAuthenticatedUser: [\"GET /user/ssh_signing_keys/{ssh_signing_key_id}\"],\n list: [\"GET /users\"],\n listBlockedByAuthenticated: [\"GET /user/blocks\", {}, {\n renamed: [\"users\", \"listBlockedByAuthenticatedUser\"]\n }],\n listBlockedByAuthenticatedUser: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\"GET /user/emails\", {}, {\n renamed: [\"users\", \"listEmailsForAuthenticatedUser\"]\n }],\n listEmailsForAuthenticatedUser: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\"GET /user/following\", {}, {\n renamed: [\"users\", \"listFollowedByAuthenticatedUser\"]\n }],\n listFollowedByAuthenticatedUser: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\"GET /user/gpg_keys\", {}, {\n renamed: [\"users\", \"listGpgKeysForAuthenticatedUser\"]\n }],\n listGpgKeysForAuthenticatedUser: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\"GET /user/public_emails\", {}, {\n renamed: [\"users\", \"listPublicEmailsForAuthenticatedUser\"]\n }],\n listPublicEmailsForAuthenticatedUser: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\"GET /user/keys\", {}, {\n renamed: [\"users\", \"listPublicSshKeysForAuthenticatedUser\"]\n }],\n listPublicSshKeysForAuthenticatedUser: [\"GET /user/keys\"],\n listSshSigningKeysForAuthenticatedUser: [\"GET /user/ssh_signing_keys\"],\n listSshSigningKeysForUser: [\"GET /users/{username}/ssh_signing_keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\"PATCH /user/email/visibility\", {}, {\n renamed: [\"users\", \"setPrimaryEmailVisibilityForAuthenticatedUser\"]\n }],\n setPrimaryEmailVisibilityForAuthenticatedUser: [\"PATCH /user/email/visibility\"],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"]\n }\n};\n\nconst VERSION = \"6.7.0\";\n\nfunction endpointsToMethods(octokit, endpointsMap) {\n const newMethods = {};\n for (const [scope, endpoints] of Object.entries(endpointsMap)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign({\n method,\n url\n }, defaults);\n if (!newMethods[scope]) {\n newMethods[scope] = {};\n }\n const scopeMethods = newMethods[scope];\n if (decorations) {\n scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations);\n continue;\n }\n scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);\n }\n }\n return newMethods;\n}\nfunction decorate(octokit, scope, methodName, defaults, decorations) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n /* istanbul ignore next */\n function withDecorations(...args) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n let options = requestWithDefaults.endpoint.merge(...args);\n // There are currently no other decorations than `.mapToData`\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: undefined\n });\n return requestWithDefaults(options);\n }\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`);\n }\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n if (decorations.renamedParameters) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n const options = requestWithDefaults.endpoint.merge(...args);\n for (const [name, alias] of Object.entries(decorations.renamedParameters)) {\n if (name in options) {\n octokit.log.warn(`\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`);\n if (!(alias in options)) {\n options[alias] = options[name];\n }\n delete options[name];\n }\n }\n return requestWithDefaults(options);\n }\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n return requestWithDefaults(...args);\n }\n return Object.assign(withDecorations, requestWithDefaults);\n}\n\nfunction restEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, Endpoints);\n return {\n rest: api\n };\n}\nrestEndpointMethods.VERSION = VERSION;\nfunction legacyRestEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, Endpoints);\n return {\n ...api,\n rest: api\n };\n}\nlegacyRestEndpointMethods.VERSION = VERSION;\n\nexports.legacyRestEndpointMethods = legacyRestEndpointMethods;\nexports.restEndpointMethods = restEndpointMethods;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar deprecation = require('deprecation');\nvar once = _interopDefault(require('once'));\n\nconst logOnceCode = once(deprecation => console.warn(deprecation));\nconst logOnceHeaders = once(deprecation => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\n\nclass RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"HttpError\";\n this.status = statusCode;\n let headers;\n\n if (\"headers\" in options && typeof options.headers !== \"undefined\") {\n headers = options.headers;\n }\n\n if (\"response\" in options) {\n this.response = options.response;\n headers = options.response.headers;\n } // redact request credentials without mutating original request options\n\n\n const requestCopy = Object.assign({}, options.request);\n\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\")\n });\n }\n\n requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\") // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy; // deprecations\n\n Object.defineProperty(this, \"code\", {\n get() {\n logOnceCode(new deprecation.Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n }\n\n });\n Object.defineProperty(this, \"headers\", {\n get() {\n logOnceHeaders(new deprecation.Deprecation(\"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.\"));\n return headers || {};\n }\n\n });\n }\n\n}\n\nexports.RequestError = RequestError;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar endpoint = require('@octokit/endpoint');\nvar universalUserAgent = require('universal-user-agent');\nvar isPlainObject = require('is-plain-object');\nvar nodeFetch = _interopDefault(require('node-fetch'));\nvar requestError = require('@octokit/request-error');\n\nconst VERSION = \"6.2.2\";\n\nfunction getBufferResponse(response) {\n return response.arrayBuffer();\n}\n\nfunction fetchWrapper(requestOptions) {\n const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;\n\n if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n\n let headers = {};\n let status;\n let url;\n const fetch = requestOptions.request && requestOptions.request.fetch || globalThis.fetch ||\n /* istanbul ignore next */\n nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect\n }, // `requestOptions.request.agent` type is incompatible\n // see https://github.com/octokit/types.ts/pull/264\n requestOptions.request)).then(async response => {\n url = response.url;\n status = response.status;\n\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n\n if (\"deprecation\" in headers) {\n const matches = headers.link && headers.link.match(/<([^>]+)>; rel=\"deprecation\"/);\n const deprecationLink = matches && matches.pop();\n log.warn(`[@octokit/request] \"${requestOptions.method} ${requestOptions.url}\" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : \"\"}`);\n }\n\n if (status === 204 || status === 205) {\n return;\n } // GitHub API returns 200 for HEAD requests\n\n\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n\n throw new requestError.RequestError(response.statusText, status, {\n response: {\n url,\n status,\n headers,\n data: undefined\n },\n request: requestOptions\n });\n }\n\n if (status === 304) {\n throw new requestError.RequestError(\"Not modified\", status, {\n response: {\n url,\n status,\n headers,\n data: await getResponseData(response)\n },\n request: requestOptions\n });\n }\n\n if (status >= 400) {\n const data = await getResponseData(response);\n const error = new requestError.RequestError(toErrorMessage(data), status, {\n response: {\n url,\n status,\n headers,\n data\n },\n request: requestOptions\n });\n throw error;\n }\n\n return getResponseData(response);\n }).then(data => {\n return {\n status,\n url,\n headers,\n data\n };\n }).catch(error => {\n if (error instanceof requestError.RequestError) throw error;else if (error.name === \"AbortError\") throw error;\n throw new requestError.RequestError(error.message, 500, {\n request: requestOptions\n });\n });\n}\n\nasync function getResponseData(response) {\n const contentType = response.headers.get(\"content-type\");\n\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n\n return getBufferResponse(response);\n}\n\nfunction toErrorMessage(data) {\n if (typeof data === \"string\") return data; // istanbul ignore else - just in case\n\n if (\"message\" in data) {\n if (Array.isArray(data.errors)) {\n return `${data.message}: ${data.errors.map(JSON.stringify).join(\", \")}`;\n }\n\n return data.message;\n } // istanbul ignore next - just in case\n\n\n return `Unknown error: ${JSON.stringify(data)}`;\n}\n\nfunction withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n}\n\nconst request = withDefaults(endpoint.endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n }\n});\n\nexports.request = request;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar authToken = require('@octokit/auth-token');\n\nconst createActionAuth = function createActionAuth() {\n if (!process.env.GITHUB_ACTION) {\n throw new Error(\"[@octokit/auth-action] `GITHUB_ACTION` environment variable is not set. @octokit/auth-action is meant to be used in GitHub Actions only.\");\n }\n\n const definitions = [process.env.GITHUB_TOKEN, process.env.INPUT_GITHUB_TOKEN, process.env.INPUT_TOKEN].filter(Boolean);\n\n if (definitions.length === 0) {\n throw new Error(\"[@octokit/auth-action] `GITHUB_TOKEN` variable is not set. It must be set on either `env:` or `with:`. See https://github.com/octokit/auth-action.js#createactionauth\");\n }\n\n if (definitions.length > 1) {\n throw new Error(\"[@octokit/auth-action] The token variable is specified more than once. Use either `with.token`, `with.GITHUB_TOKEN`, or `env.GITHUB_TOKEN`. See https://github.com/octokit/auth-action.js#createactionauth\");\n }\n\n const token = definitions.pop();\n return authToken.createTokenAuth(token);\n};\n\nexports.createActionAuth = createActionAuth;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst REGEX_IS_INSTALLATION_LEGACY = /^v1\\./;\nconst REGEX_IS_INSTALLATION = /^ghs_/;\nconst REGEX_IS_USER_TO_SERVER = /^ghu_/;\nasync function auth(token) {\n const isApp = token.split(/\\./).length === 3;\n const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);\n const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);\n const tokenType = isApp ? \"app\" : isInstallation ? \"installation\" : isUserToServer ? \"user-to-server\" : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n\n/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nfunction withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}\n\nasync function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n\nconst createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n\nexports.createTokenAuth = createTokenAuth;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst REGEX_IS_INSTALLATION_LEGACY = /^v1\\./;\nconst REGEX_IS_INSTALLATION = /^ghs_/;\nconst REGEX_IS_USER_TO_SERVER = /^ghu_/;\nasync function auth(token) {\n const isApp = token.split(/\\./).length === 3;\n const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);\n const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);\n const tokenType = isApp ? \"app\" : isInstallation ? \"installation\" : isUserToServer ? \"user-to-server\" : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n\n/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nfunction withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}\n\nasync function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n\nconst createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n\nexports.createTokenAuth = createTokenAuth;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar universalUserAgent = require('universal-user-agent');\nvar beforeAfterHook = require('before-after-hook');\nvar request = require('@octokit/request');\nvar graphql = require('@octokit/graphql');\nvar authToken = require('@octokit/auth-token');\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nconst VERSION = \"3.6.0\";\n\nconst _excluded = [\"authStrategy\"];\nclass Octokit {\n constructor(options = {}) {\n const hook = new beforeAfterHook.Collection();\n const requestDefaults = {\n baseUrl: request.request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n // @ts-ignore internal usage only, no need to type\n hook: hook.bind(null, \"request\")\n }),\n mediaType: {\n previews: [],\n format: \"\"\n }\n }; // prepend default user agent with `options.userAgent` if set\n\n requestDefaults.headers[\"user-agent\"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(\" \");\n\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n\n this.request = request.request.defaults(requestDefaults);\n this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults);\n this.log = Object.assign({\n debug: () => {},\n info: () => {},\n warn: console.warn.bind(console),\n error: console.error.bind(console)\n }, options.log);\n this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance\n // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.\n // (2) If only `options.auth` is set, use the default token authentication strategy.\n // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.\n // TODO: type `options.auth` based on `options.authStrategy`.\n\n if (!options.authStrategy) {\n if (!options.auth) {\n // (1)\n this.auth = async () => ({\n type: \"unauthenticated\"\n });\n } else {\n // (2)\n const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n } else {\n const {\n authStrategy\n } = options,\n otherOptions = _objectWithoutProperties(options, _excluded);\n\n const auth = authStrategy(Object.assign({\n request: this.request,\n log: this.log,\n // we pass the current octokit instance as well as its constructor options\n // to allow for authentication strategies that return a new octokit instance\n // that shares the same internal state as the current one. The original\n // requirement for this was the \"event-octokit\" authentication strategy\n // of https://github.com/probot/octokit-auth-probot.\n octokit: this,\n octokitOptions: otherOptions\n }, options.auth)); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n } // apply plugins\n // https://stackoverflow.com/a/16345172\n\n\n const classConstructor = this.constructor;\n classConstructor.plugins.forEach(plugin => {\n Object.assign(this, plugin(this, options));\n });\n }\n\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n\n super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`\n } : null));\n }\n\n };\n return OctokitWithDefaults;\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n\n\n static plugin(...newPlugins) {\n var _a;\n\n const currentPlugins = this.plugins;\n const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a);\n return NewOctokit;\n }\n\n}\nOctokit.VERSION = VERSION;\nOctokit.plugins = [];\n\nexports.Octokit = Octokit;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar isPlainObject = require('is-plain-object');\nvar universalUserAgent = require('universal-user-agent');\n\nfunction lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n\nfunction mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach(key => {\n if (isPlainObject.isPlainObject(options[key])) {\n if (!(key in defaults)) Object.assign(result, {\n [key]: options[key]\n });else result[key] = mergeDeep(defaults[key], options[key]);\n } else {\n Object.assign(result, {\n [key]: options[key]\n });\n }\n });\n return result;\n}\n\nfunction removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n\n return obj;\n}\n\nfunction merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? {\n method,\n url\n } : {\n url: method\n }, options);\n } else {\n options = Object.assign({}, route);\n } // lowercase header names before merging with defaults to avoid duplicates\n\n\n options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging\n\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten\n\n if (defaults && defaults.mediaType.previews.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);\n }\n\n mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, \"\"));\n return mergedOptions;\n}\n\nfunction addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n\n if (names.length === 0) {\n return url;\n }\n\n return url + separator + names.map(name => {\n if (name === \"q\") {\n return \"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\");\n }\n\n return `${name}=${encodeURIComponent(parameters[name])}`;\n }).join(\"&\");\n}\n\nconst urlVariableRegex = /\\{[^}]+\\}/g;\n\nfunction removeNonChars(variableName) {\n return variableName.replace(/^\\W+|\\W+$/g, \"\").split(/,/);\n}\n\nfunction extractUrlVariableNames(url) {\n const matches = url.match(urlVariableRegex);\n\n if (!matches) {\n return [];\n }\n\n return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);\n}\n\nfunction omit(object, keysToOmit) {\n return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {\n obj[key] = object[key];\n return obj;\n }, {});\n}\n\n// Based on https://github.com/bramstein/url-template, licensed under BSD\n// TODO: create separate package.\n//\n// Copyright (c) 2012-2014, Bram Stein\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// 3. The name of the author may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/* istanbul ignore file */\nfunction encodeReserved(str) {\n return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n\n return part;\n }).join(\"\");\n}\n\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\n\nfunction encodeValue(operator, value, key) {\n value = operator === \"+\" || operator === \"#\" ? encodeReserved(value) : encodeUnreserved(value);\n\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n } else {\n return value;\n }\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\n\nfunction getValues(context, operator, key, modifier) {\n var value = context[key],\n result = [];\n\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n value = value.toString();\n\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n } else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n } else {\n const tmp = [];\n\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n tmp.push(encodeValue(operator, value));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n } else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n } else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n } else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n } else if (value === \"\") {\n result.push(\"\");\n }\n }\n\n return result;\n}\n\nfunction parseUrl(template) {\n return {\n expand: expand.bind(null, template)\n };\n}\n\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n\n if (operator && operator !== \"+\") {\n var separator = \",\";\n\n if (operator === \"?\") {\n separator = \"&\";\n } else if (operator !== \"#\") {\n separator = operator;\n }\n\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n } else {\n return values.join(\",\");\n }\n } else {\n return encodeReserved(literal);\n }\n });\n}\n\nfunction parse(options) {\n // https://fetch.spec.whatwg.org/#methods\n let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible\n\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"mediaType\"]); // extract variable names from URL to calculate remaining variables later\n\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n\n const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw\n headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(\",\");\n }\n\n if (options.mediaType.previews.length) {\n const previewsFromAcceptHeader = headers.accept.match(/[\\w-]+(?=-preview)/g) || [];\n headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {\n const format = options.mediaType.format ? `.${options.mediaType.format}` : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n }).join(\",\");\n }\n } // for GET/HEAD requests, set URL query parameters from remaining parameters\n // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters\n\n\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n } else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n } else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n } else {\n headers[\"content-length\"] = 0;\n }\n }\n } // default content-type for JSON if body is set\n\n\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.\n // fetch does not allow to set `content-length` header, but we can set body to an empty string\n\n\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n } // Only return body/request keys if present\n\n\n return Object.assign({\n method,\n url,\n headers\n }, typeof body !== \"undefined\" ? {\n body\n } : null, options.request ? {\n request: options.request\n } : null);\n}\n\nfunction endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n\nfunction withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse\n });\n}\n\nconst VERSION = \"6.0.12\";\n\nconst userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.\n// So we use RequestParameters and add method as additional required property.\n\nconst DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent\n },\n mediaType: {\n format: \"\",\n previews: []\n }\n};\n\nconst endpoint = withDefaults(null, DEFAULTS);\n\nexports.endpoint = endpoint;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar request = require('@octokit/request');\nvar universalUserAgent = require('universal-user-agent');\n\nconst VERSION = \"4.8.0\";\n\nfunction _buildMessageForResponseErrors(data) {\n return `Request failed due to following response errors:\\n` + data.errors.map(e => ` - ${e.message}`).join(\"\\n\");\n}\n\nclass GraphqlResponseError extends Error {\n constructor(request, headers, response) {\n super(_buildMessageForResponseErrors(response));\n this.request = request;\n this.headers = headers;\n this.response = response;\n this.name = \"GraphqlResponseError\"; // Expose the errors and response data in their shorthand properties.\n\n this.errors = response.errors;\n this.data = response.data; // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n\n}\n\nconst NON_VARIABLE_OPTIONS = [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"query\", \"mediaType\"];\nconst FORBIDDEN_VARIABLE_OPTIONS = [\"query\", \"method\", \"url\"];\nconst GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nfunction graphql(request, query, options) {\n if (options) {\n if (typeof query === \"string\" && \"query\" in options) {\n return Promise.reject(new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`));\n }\n\n for (const key in options) {\n if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;\n return Promise.reject(new Error(`[@octokit/graphql] \"${key}\" cannot be used as variable name`));\n }\n }\n\n const parsedOptions = typeof query === \"string\" ? Object.assign({\n query\n }, options) : query;\n const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n\n if (!result.variables) {\n result.variables = {};\n }\n\n result.variables[key] = parsedOptions[key];\n return result;\n }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix\n // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451\n\n const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;\n\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n\n return request(requestOptions).then(response => {\n if (response.data.errors) {\n const headers = {};\n\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n\n throw new GraphqlResponseError(requestOptions, headers, response.data);\n }\n\n return response.data.data;\n });\n}\n\nfunction withDefaults(request$1, newDefaults) {\n const newRequest = request$1.defaults(newDefaults);\n\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: request.request.endpoint\n });\n}\n\nconst graphql$1 = withDefaults(request.request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n },\n method: \"POST\",\n url: \"/graphql\"\n});\nfunction withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\"\n });\n}\n\nexports.GraphqlResponseError = GraphqlResponseError;\nexports.graphql = graphql$1;\nexports.withCustomRequest = withCustomRequest;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst VERSION = \"2.17.0\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\n/**\n * Some “list” response that can be paginated have a different response structure\n *\n * They have a `total_count` key in the response (search also has `incomplete_results`,\n * /installation/repositories also has `repository_selection`), as well as a key with\n * the list of the items which name varies from endpoint to endpoint.\n *\n * Octokit normalizes these responses so that paginated results are always returned following\n * the same structure. One challenge is that if the list response has only one page, no Link\n * header is provided, so this header alone is not sufficient to check wether a response is\n * paginated or not.\n *\n * We check if a \"total_count\" key is present in the response data, but also make sure that\n * a \"url\" property is not, as the \"Get the combined status for a specific ref\" endpoint would\n * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref\n */\nfunction normalizePaginatedListResponse(response) {\n // endpoints can respond with 204 if repository is empty\n if (!response.data) {\n return _objectSpread2(_objectSpread2({}, response), {}, {\n data: []\n });\n }\n\n const responseNeedsNormalization = \"total_count\" in response.data && !(\"url\" in response.data);\n if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way\n // to retrieve the same information.\n\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n\n response.data.total_count = totalCount;\n return response;\n}\n\nfunction iterator(octokit, route, parameters) {\n const options = typeof route === \"function\" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n async next() {\n if (!url) return {\n done: true\n };\n\n try {\n const response = await requestMethod({\n method,\n url,\n headers\n });\n const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format:\n // '; rel=\"next\", ; rel=\"last\"'\n // sets `url` to undefined if \"next\" URL is not present or `link` header is not set\n\n url = ((normalizedResponse.headers.link || \"\").match(/<([^>]+)>;\\s*rel=\"next\"/) || [])[1];\n return {\n value: normalizedResponse\n };\n } catch (error) {\n if (error.status !== 409) throw error;\n url = \"\";\n return {\n value: {\n status: 200,\n headers: {},\n data: []\n }\n };\n }\n }\n\n })\n };\n}\n\nfunction paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = undefined;\n }\n\n return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);\n}\n\nfunction gather(octokit, results, iterator, mapFn) {\n return iterator.next().then(result => {\n if (result.done) {\n return results;\n }\n\n let earlyExit = false;\n\n function done() {\n earlyExit = true;\n }\n\n results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);\n\n if (earlyExit) {\n return results;\n }\n\n return gather(octokit, results, iterator, mapFn);\n });\n}\n\nconst composePaginateRest = Object.assign(paginate, {\n iterator\n});\n\nconst paginatingEndpoints = [\"GET /app/hook/deliveries\", \"GET /app/installations\", \"GET /applications/grants\", \"GET /authorizations\", \"GET /enterprises/{enterprise}/actions/permissions/organizations\", \"GET /enterprises/{enterprise}/actions/runner-groups\", \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\", \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\", \"GET /enterprises/{enterprise}/actions/runners\", \"GET /enterprises/{enterprise}/actions/runners/downloads\", \"GET /events\", \"GET /gists\", \"GET /gists/public\", \"GET /gists/starred\", \"GET /gists/{gist_id}/comments\", \"GET /gists/{gist_id}/commits\", \"GET /gists/{gist_id}/forks\", \"GET /installation/repositories\", \"GET /issues\", \"GET /marketplace_listing/plans\", \"GET /marketplace_listing/plans/{plan_id}/accounts\", \"GET /marketplace_listing/stubbed/plans\", \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\", \"GET /networks/{owner}/{repo}/events\", \"GET /notifications\", \"GET /organizations\", \"GET /orgs/{org}/actions/permissions/repositories\", \"GET /orgs/{org}/actions/runner-groups\", \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\", \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners\", \"GET /orgs/{org}/actions/runners\", \"GET /orgs/{org}/actions/runners/downloads\", \"GET /orgs/{org}/actions/secrets\", \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\", \"GET /orgs/{org}/blocks\", \"GET /orgs/{org}/credential-authorizations\", \"GET /orgs/{org}/events\", \"GET /orgs/{org}/failed_invitations\", \"GET /orgs/{org}/hooks\", \"GET /orgs/{org}/hooks/{hook_id}/deliveries\", \"GET /orgs/{org}/installations\", \"GET /orgs/{org}/invitations\", \"GET /orgs/{org}/invitations/{invitation_id}/teams\", \"GET /orgs/{org}/issues\", \"GET /orgs/{org}/members\", \"GET /orgs/{org}/migrations\", \"GET /orgs/{org}/migrations/{migration_id}/repositories\", \"GET /orgs/{org}/outside_collaborators\", \"GET /orgs/{org}/packages\", \"GET /orgs/{org}/projects\", \"GET /orgs/{org}/public_members\", \"GET /orgs/{org}/repos\", \"GET /orgs/{org}/secret-scanning/alerts\", \"GET /orgs/{org}/team-sync/groups\", \"GET /orgs/{org}/teams\", \"GET /orgs/{org}/teams/{team_slug}/discussions\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\", \"GET /orgs/{org}/teams/{team_slug}/invitations\", \"GET /orgs/{org}/teams/{team_slug}/members\", \"GET /orgs/{org}/teams/{team_slug}/projects\", \"GET /orgs/{org}/teams/{team_slug}/repos\", \"GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings\", \"GET /orgs/{org}/teams/{team_slug}/teams\", \"GET /projects/columns/{column_id}/cards\", \"GET /projects/{project_id}/collaborators\", \"GET /projects/{project_id}/columns\", \"GET /repos/{owner}/{repo}/actions/artifacts\", \"GET /repos/{owner}/{repo}/actions/runners\", \"GET /repos/{owner}/{repo}/actions/runners/downloads\", \"GET /repos/{owner}/{repo}/actions/runs\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\", \"GET /repos/{owner}/{repo}/actions/secrets\", \"GET /repos/{owner}/{repo}/actions/workflows\", \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\", \"GET /repos/{owner}/{repo}/assignees\", \"GET /repos/{owner}/{repo}/autolinks\", \"GET /repos/{owner}/{repo}/branches\", \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\", \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\", \"GET /repos/{owner}/{repo}/code-scanning/alerts\", \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\", \"GET /repos/{owner}/{repo}/code-scanning/analyses\", \"GET /repos/{owner}/{repo}/collaborators\", \"GET /repos/{owner}/{repo}/comments\", \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/commits\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\", \"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\", \"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\", \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\", \"GET /repos/{owner}/{repo}/contributors\", \"GET /repos/{owner}/{repo}/deployments\", \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\", \"GET /repos/{owner}/{repo}/events\", \"GET /repos/{owner}/{repo}/forks\", \"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\", \"GET /repos/{owner}/{repo}/hooks\", \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\", \"GET /repos/{owner}/{repo}/invitations\", \"GET /repos/{owner}/{repo}/issues\", \"GET /repos/{owner}/{repo}/issues/comments\", \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/issues/events\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/events\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\", \"GET /repos/{owner}/{repo}/keys\", \"GET /repos/{owner}/{repo}/labels\", \"GET /repos/{owner}/{repo}/milestones\", \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\", \"GET /repos/{owner}/{repo}/notifications\", \"GET /repos/{owner}/{repo}/pages/builds\", \"GET /repos/{owner}/{repo}/projects\", \"GET /repos/{owner}/{repo}/pulls\", \"GET /repos/{owner}/{repo}/pulls/comments\", \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\", \"GET /repos/{owner}/{repo}/releases\", \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\", \"GET /repos/{owner}/{repo}/secret-scanning/alerts\", \"GET /repos/{owner}/{repo}/stargazers\", \"GET /repos/{owner}/{repo}/subscribers\", \"GET /repos/{owner}/{repo}/tags\", \"GET /repos/{owner}/{repo}/teams\", \"GET /repositories\", \"GET /repositories/{repository_id}/environments/{environment_name}/secrets\", \"GET /scim/v2/enterprises/{enterprise}/Groups\", \"GET /scim/v2/enterprises/{enterprise}/Users\", \"GET /scim/v2/organizations/{org}/Users\", \"GET /search/code\", \"GET /search/commits\", \"GET /search/issues\", \"GET /search/labels\", \"GET /search/repositories\", \"GET /search/topics\", \"GET /search/users\", \"GET /teams/{team_id}/discussions\", \"GET /teams/{team_id}/discussions/{discussion_number}/comments\", \"GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\", \"GET /teams/{team_id}/discussions/{discussion_number}/reactions\", \"GET /teams/{team_id}/invitations\", \"GET /teams/{team_id}/members\", \"GET /teams/{team_id}/projects\", \"GET /teams/{team_id}/repos\", \"GET /teams/{team_id}/team-sync/group-mappings\", \"GET /teams/{team_id}/teams\", \"GET /user/blocks\", \"GET /user/emails\", \"GET /user/followers\", \"GET /user/following\", \"GET /user/gpg_keys\", \"GET /user/installations\", \"GET /user/installations/{installation_id}/repositories\", \"GET /user/issues\", \"GET /user/keys\", \"GET /user/marketplace_purchases\", \"GET /user/marketplace_purchases/stubbed\", \"GET /user/memberships/orgs\", \"GET /user/migrations\", \"GET /user/migrations/{migration_id}/repositories\", \"GET /user/orgs\", \"GET /user/packages\", \"GET /user/public_emails\", \"GET /user/repos\", \"GET /user/repository_invitations\", \"GET /user/starred\", \"GET /user/subscriptions\", \"GET /user/teams\", \"GET /users\", \"GET /users/{username}/events\", \"GET /users/{username}/events/orgs/{org}\", \"GET /users/{username}/events/public\", \"GET /users/{username}/followers\", \"GET /users/{username}/following\", \"GET /users/{username}/gists\", \"GET /users/{username}/gpg_keys\", \"GET /users/{username}/keys\", \"GET /users/{username}/orgs\", \"GET /users/{username}/packages\", \"GET /users/{username}/projects\", \"GET /users/{username}/received_events\", \"GET /users/{username}/received_events/public\", \"GET /users/{username}/repos\", \"GET /users/{username}/starred\", \"GET /users/{username}/subscriptions\"];\n\nfunction isPaginatingEndpoint(arg) {\n if (typeof arg === \"string\") {\n return paginatingEndpoints.includes(arg);\n } else {\n return false;\n }\n}\n\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\n\nfunction paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit)\n })\n };\n}\npaginateRest.VERSION = VERSION;\n\nexports.composePaginateRest = composePaginateRest;\nexports.isPaginatingEndpoint = isPaginatingEndpoint;\nexports.paginateRest = paginateRest;\nexports.paginatingEndpoints = paginatingEndpoints;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nconst Endpoints = {\n actions: {\n addSelectedRepoToOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n approveWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve\"],\n cancelWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\"],\n createOrUpdateEnvironmentSecret: [\"PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n createRegistrationTokenForOrg: [\"POST /orgs/{org}/actions/runners/registration-token\"],\n createRegistrationTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/registration-token\"],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/remove-token\"],\n createWorkflowDispatch: [\"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\"],\n deleteArtifact: [\"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n deleteEnvironmentSecret: [\"DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n deleteSelfHostedRunnerFromOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}\"],\n deleteSelfHostedRunnerFromRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n disableSelectedRepositoryGithubActionsOrganization: [\"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n disableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\"],\n downloadArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\"],\n downloadJobLogsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\"],\n downloadWorkflowRunAttemptLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs\"],\n downloadWorkflowRunLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n enableSelectedRepositoryGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n enableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\"],\n getAllowedActionsOrganization: [\"GET /orgs/{org}/actions/permissions/selected-actions\"],\n getAllowedActionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getEnvironmentPublicKey: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key\"],\n getEnvironmentSecret: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n getGithubActionsPermissionsOrganization: [\"GET /orgs/{org}/actions/permissions\"],\n getGithubActionsPermissionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions\"],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getPendingDeploymentsForRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"],\n getRepoPermissions: [\"GET /repos/{owner}/{repo}/actions/permissions\", {}, {\n renamed: [\"actions\", \"getGithubActionsPermissionsRepository\"]\n }],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getReviewsForRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals\"],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunAttempt: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}\"],\n getWorkflowRunUsage: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\"],\n getWorkflowUsage: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\"],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listEnvironmentSecrets: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets\"],\n listJobsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\"],\n listJobsForWorkflowRunAttempt: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\"],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/downloads\"],\n listSelectedReposForOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n listSelectedRepositoriesEnabledGithubActionsOrganization: [\"GET /orgs/{org}/actions/permissions/repositories\"],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\"],\n listWorkflowRuns: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\"],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n reviewPendingDeploymentsForRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"],\n setAllowedActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/selected-actions\"],\n setAllowedActionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n setGithubActionsPermissionsOrganization: [\"PUT /orgs/{org}/actions/permissions\"],\n setGithubActionsPermissionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions\"],\n setSelectedReposForOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n setSelectedRepositoriesEnabledGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories\"]\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\"DELETE /notifications/threads/{thread_id}/subscription\"],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\"GET /notifications/threads/{thread_id}/subscription\"],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\"GET /users/{username}/events/orgs/{org}\"],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\"GET /users/{username}/received_events/public\"],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/notifications\"],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\"PUT /notifications/threads/{thread_id}/subscription\"],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"]\n },\n apps: {\n addRepoToInstallation: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\", {}, {\n renamed: [\"apps\", \"addRepoToInstallationForAuthenticatedUser\"]\n }],\n addRepoToInstallationForAuthenticatedUser: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\"],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createContentAttachment: [\"POST /content_references/{content_reference_id}/attachments\", {\n mediaType: {\n previews: [\"corsair\"]\n }\n }],\n createContentAttachmentForRepo: [\"POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments\", {\n mediaType: {\n previews: [\"corsair\"]\n }\n }],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\"POST /app/installations/{installation_id}/access_tokens\"],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\"GET /marketplace_listing/accounts/{account_id}\"],\n getSubscriptionPlanForAccountStubbed: [\"GET /marketplace_listing/stubbed/accounts/{account_id}\"],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n getWebhookConfigForApp: [\"GET /app/hook/config\"],\n getWebhookDelivery: [\"GET /app/hook/deliveries/{delivery_id}\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\"],\n listInstallationReposForAuthenticatedUser: [\"GET /user/installations/{installation_id}/repositories\"],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\"GET /user/marketplace_purchases/stubbed\"],\n listWebhookDeliveries: [\"GET /app/hook/deliveries\"],\n redeliverWebhookDelivery: [\"POST /app/hook/deliveries/{delivery_id}/attempts\"],\n removeRepoFromInstallation: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\", {}, {\n renamed: [\"apps\", \"removeRepoFromInstallationForAuthenticatedUser\"]\n }],\n removeRepoFromInstallationForAuthenticatedUser: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\"],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n scopeToken: [\"POST /applications/{client_id}/token/scoped\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\"DELETE /app/installations/{installation_id}/suspended\"],\n updateWebhookConfigForApp: [\"PATCH /app/hook/config\"]\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\"GET /users/{username}/settings/billing/actions\"],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\"GET /users/{username}/settings/billing/packages\"],\n getSharedStorageBillingOrg: [\"GET /orgs/{org}/settings/billing/shared-storage\"],\n getSharedStorageBillingUser: [\"GET /users/{username}/settings/billing/shared-storage\"]\n },\n checks: {\n create: [\"POST /repos/{owner}/{repo}/check-runs\"],\n createSuite: [\"POST /repos/{owner}/{repo}/check-suites\"],\n get: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n getSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\"],\n listAnnotations: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\"],\n listForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\"],\n listForSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\"],\n listSuitesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\"],\n rerequestRun: [\"POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest\"],\n rerequestSuite: [\"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\"],\n setSuitesPreferences: [\"PATCH /repos/{owner}/{repo}/check-suites/preferences\"],\n update: [\"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\"]\n },\n codeScanning: {\n deleteAnalysis: [\"DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}\"],\n getAlert: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\", {}, {\n renamedParameters: {\n alert_id: \"alert_number\"\n }\n }],\n getAnalysis: [\"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\"],\n getSarif: [\"GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}\"],\n listAlertInstances: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listAlertsInstances: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\", {}, {\n renamed: [\"codeScanning\", \"listAlertInstances\"]\n }],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\"],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"]\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\"GET /codes_of_conduct\"],\n getConductCode: [\"GET /codes_of_conduct/{key}\"]\n },\n emojis: {\n get: [\"GET /emojis\"]\n },\n enterpriseAdmin: {\n disableSelectedOrganizationGithubActionsEnterprise: [\"DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n enableSelectedOrganizationGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n getAllowedActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n getGithubActionsPermissionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions\"],\n listSelectedOrganizationsEnabledGithubActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/organizations\"],\n setAllowedActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n setGithubActionsPermissionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions\"],\n setSelectedOrganizationsEnabledGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations\"]\n },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"]\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"]\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"]\n },\n interactions: {\n getRestrictionsForAuthenticatedUser: [\"GET /user/interaction-limits\"],\n getRestrictionsForOrg: [\"GET /orgs/{org}/interaction-limits\"],\n getRestrictionsForRepo: [\"GET /repos/{owner}/{repo}/interaction-limits\"],\n getRestrictionsForYourPublicRepos: [\"GET /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"getRestrictionsForAuthenticatedUser\"]\n }],\n removeRestrictionsForAuthenticatedUser: [\"DELETE /user/interaction-limits\"],\n removeRestrictionsForOrg: [\"DELETE /orgs/{org}/interaction-limits\"],\n removeRestrictionsForRepo: [\"DELETE /repos/{owner}/{repo}/interaction-limits\"],\n removeRestrictionsForYourPublicRepos: [\"DELETE /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"removeRestrictionsForAuthenticatedUser\"]\n }],\n setRestrictionsForAuthenticatedUser: [\"PUT /user/interaction-limits\"],\n setRestrictionsForOrg: [\"PUT /orgs/{org}/interaction-limits\"],\n setRestrictionsForRepo: [\"PUT /repos/{owner}/{repo}/interaction-limits\"],\n setRestrictionsForYourPublicRepos: [\"PUT /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"setRestrictionsForAuthenticatedUser\"]\n }]\n },\n issues: {\n addAssignees: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\"],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\"],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n removeAssignees: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n removeLabel: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\"],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\"]\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"]\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\"POST /markdown/raw\", {\n headers: {\n \"content-type\": \"text/plain; charset=utf-8\"\n }\n }]\n },\n meta: {\n get: [\"GET /meta\"],\n getOctocat: [\"GET /octocat\"],\n getZen: [\"GET /zen\"],\n root: [\"GET /\"]\n },\n migrations: {\n cancelImport: [\"DELETE /repos/{owner}/{repo}/import\"],\n deleteArchiveForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/archive\"],\n deleteArchiveForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/archive\"],\n downloadArchiveForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/archive\"],\n getArchiveForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/archive\"],\n getCommitAuthors: [\"GET /repos/{owner}/{repo}/import/authors\"],\n getImportStatus: [\"GET /repos/{owner}/{repo}/import\"],\n getLargeFiles: [\"GET /repos/{owner}/{repo}/import/large_files\"],\n getStatusForAuthenticatedUser: [\"GET /user/migrations/{migration_id}\"],\n getStatusForOrg: [\"GET /orgs/{org}/migrations/{migration_id}\"],\n listForAuthenticatedUser: [\"GET /user/migrations\"],\n listForOrg: [\"GET /orgs/{org}/migrations\"],\n listReposForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/repositories\"],\n listReposForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/repositories\"],\n listReposForUser: [\"GET /user/migrations/{migration_id}/repositories\", {}, {\n renamed: [\"migrations\", \"listReposForAuthenticatedUser\"]\n }],\n mapCommitAuthor: [\"PATCH /repos/{owner}/{repo}/import/authors/{author_id}\"],\n setLfsPreference: [\"PATCH /repos/{owner}/{repo}/import/lfs\"],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n startImport: [\"PUT /repos/{owner}/{repo}/import\"],\n unlockRepoForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\"],\n unlockRepoForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\"],\n updateImport: [\"PATCH /repos/{owner}/{repo}/import\"]\n },\n orgs: {\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n cancelInvitation: [\"DELETE /orgs/{org}/invitations/{invitation_id}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\"PUT /orgs/{org}/outside_collaborators/{username}\"],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n get: [\"GET /orgs/{org}\"],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n getWebhookConfigForOrg: [\"GET /orgs/{org}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}\"],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listFailedInvitations: [\"GET /orgs/{org}/failed_invitations\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listWebhookDeliveries: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\"DELETE /orgs/{org}/outside_collaborators/{username}\"],\n removePublicMembershipForAuthenticatedUser: [\"DELETE /orgs/{org}/public_members/{username}\"],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\"PUT /orgs/{org}/public_members/{username}\"],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateMembershipForAuthenticatedUser: [\"PATCH /user/memberships/orgs/{org}\"],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n updateWebhookConfigForOrg: [\"PATCH /orgs/{org}/hooks/{hook_id}/config\"]\n },\n packages: {\n deletePackageForAuthenticatedUser: [\"DELETE /user/packages/{package_type}/{package_name}\"],\n deletePackageForOrg: [\"DELETE /orgs/{org}/packages/{package_type}/{package_name}\"],\n deletePackageForUser: [\"DELETE /users/{username}/packages/{package_type}/{package_name}\"],\n deletePackageVersionForAuthenticatedUser: [\"DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n deletePackageVersionForOrg: [\"DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n deletePackageVersionForUser: [\"DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getAllPackageVersionsForAPackageOwnedByAnOrg: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\", {}, {\n renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByOrg\"]\n }],\n getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions\", {}, {\n renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByAuthenticatedUser\"]\n }],\n getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions\"],\n getAllPackageVersionsForPackageOwnedByOrg: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\"],\n getAllPackageVersionsForPackageOwnedByUser: [\"GET /users/{username}/packages/{package_type}/{package_name}/versions\"],\n getPackageForAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}\"],\n getPackageForOrganization: [\"GET /orgs/{org}/packages/{package_type}/{package_name}\"],\n getPackageForUser: [\"GET /users/{username}/packages/{package_type}/{package_name}\"],\n getPackageVersionForAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getPackageVersionForOrganization: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getPackageVersionForUser: [\"GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n listPackagesForAuthenticatedUser: [\"GET /user/packages\"],\n listPackagesForOrganization: [\"GET /orgs/{org}/packages\"],\n listPackagesForUser: [\"GET /users/{username}/packages\"],\n restorePackageForAuthenticatedUser: [\"POST /user/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageForOrg: [\"POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageForUser: [\"POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageVersionForAuthenticatedUser: [\"POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"],\n restorePackageVersionForOrg: [\"POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"],\n restorePackageVersionForUser: [\"POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"]\n },\n projects: {\n addCollaborator: [\"PUT /projects/{project_id}/collaborators/{username}\"],\n createCard: [\"POST /projects/columns/{column_id}/cards\"],\n createColumn: [\"POST /projects/{project_id}/columns\"],\n createForAuthenticatedUser: [\"POST /user/projects\"],\n createForOrg: [\"POST /orgs/{org}/projects\"],\n createForRepo: [\"POST /repos/{owner}/{repo}/projects\"],\n delete: [\"DELETE /projects/{project_id}\"],\n deleteCard: [\"DELETE /projects/columns/cards/{card_id}\"],\n deleteColumn: [\"DELETE /projects/columns/{column_id}\"],\n get: [\"GET /projects/{project_id}\"],\n getCard: [\"GET /projects/columns/cards/{card_id}\"],\n getColumn: [\"GET /projects/columns/{column_id}\"],\n getPermissionForUser: [\"GET /projects/{project_id}/collaborators/{username}/permission\"],\n listCards: [\"GET /projects/columns/{column_id}/cards\"],\n listCollaborators: [\"GET /projects/{project_id}/collaborators\"],\n listColumns: [\"GET /projects/{project_id}/columns\"],\n listForOrg: [\"GET /orgs/{org}/projects\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/projects\"],\n listForUser: [\"GET /users/{username}/projects\"],\n moveCard: [\"POST /projects/columns/cards/{card_id}/moves\"],\n moveColumn: [\"POST /projects/columns/{column_id}/moves\"],\n removeCollaborator: [\"DELETE /projects/{project_id}/collaborators/{username}\"],\n update: [\"PATCH /projects/{project_id}\"],\n updateCard: [\"PATCH /projects/columns/cards/{card_id}\"],\n updateColumn: [\"PATCH /projects/columns/{column_id}\"]\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\"],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n deletePendingReview: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n deleteReviewComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n dismissReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\"],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\"],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n listReviewComments: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n requestReviewers: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n submitReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\"],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\"],\n updateReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n updateReviewComment: [\"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\"]\n },\n rateLimit: {\n get: [\"GET /rate_limit\"]\n },\n reactions: {\n createForCommitComment: [\"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\"],\n createForIssue: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n createForIssueComment: [\"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"],\n createForPullRequestReviewComment: [\"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"],\n createForRelease: [\"POST /repos/{owner}/{repo}/releases/{release_id}/reactions\"],\n createForTeamDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"],\n createForTeamDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"],\n deleteForCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForIssue: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\"],\n deleteForIssueComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForPullRequestComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForTeamDiscussion: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\"],\n deleteForTeamDiscussionComment: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\"],\n listForCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\"],\n listForIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n listForIssueComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"],\n listForPullRequestReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"],\n listForTeamDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"],\n listForTeamDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"]\n },\n repos: {\n acceptInvitation: [\"PATCH /user/repository_invitations/{invitation_id}\", {}, {\n renamed: [\"repos\", \"acceptInvitationForAuthenticatedUser\"]\n }],\n acceptInvitationForAuthenticatedUser: [\"PATCH /user/repository_invitations/{invitation_id}\"],\n addAppAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n addTeamAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n addUserAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkVulnerabilityAlerts: [\"GET /repos/{owner}/{repo}/vulnerability-alerts\"],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n compareCommitsWithBasehead: [\"GET /repos/{owner}/{repo}/compare/{basehead}\"],\n createAutolink: [\"POST /repos/{owner}/{repo}/autolinks\"],\n createCommitComment: [\"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n createCommitSignatureProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentStatus: [\"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateEnvironment: [\"PUT /repos/{owner}/{repo}/environments/{environment_name}\"],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createPagesSite: [\"POST /repos/{owner}/{repo}/pages\"],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createUsingTemplate: [\"POST /repos/{template_owner}/{template_repo}/generate\"],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n declineInvitation: [\"DELETE /user/repository_invitations/{invitation_id}\", {}, {\n renamed: [\"repos\", \"declineInvitationForAuthenticatedUser\"]\n }],\n declineInvitationForAuthenticatedUser: [\"DELETE /user/repository_invitations/{invitation_id}\"],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n deleteAdminBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n deleteAnEnvironment: [\"DELETE /repos/{owner}/{repo}/environments/{environment_name}\"],\n deleteAutolink: [\"DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n deleteBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\"],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n deletePagesSite: [\"DELETE /repos/{owner}/{repo}/pages\"],\n deletePullRequestReviewProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\"DELETE /repos/{owner}/{repo}/automated-security-fixes\"],\n disableLfsForRepo: [\"DELETE /repos/{owner}/{repo}/lfs\"],\n disableVulnerabilityAlerts: [\"DELETE /repos/{owner}/{repo}/vulnerability-alerts\"],\n downloadArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\", {}, {\n renamed: [\"repos\", \"downloadZipballArchive\"]\n }],\n downloadTarballArchive: [\"GET /repos/{owner}/{repo}/tarball/{ref}\"],\n downloadZipballArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\"],\n enableAutomatedSecurityFixes: [\"PUT /repos/{owner}/{repo}/automated-security-fixes\"],\n enableLfsForRepo: [\"PUT /repos/{owner}/{repo}/lfs\"],\n enableVulnerabilityAlerts: [\"PUT /repos/{owner}/{repo}/vulnerability-alerts\"],\n generateReleaseNotes: [\"POST /repos/{owner}/{repo}/releases/generate-notes\"],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n getAdminBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n getAllEnvironments: [\"GET /repos/{owner}/{repo}/environments\"],\n getAllStatusCheckContexts: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\"],\n getAllTopics: [\"GET /repos/{owner}/{repo}/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n getAppsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\"],\n getAutolink: [\"GET /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection\"],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\"GET /repos/{owner}/{repo}/collaborators/{username}/permission\"],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n getCommunityProfileMetrics: [\"GET /repos/{owner}/{repo}/community/profile\"],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentStatus: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\"],\n getEnvironment: [\"GET /repos/{owner}/{repo}/environments/{environment_name}\"],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getPagesHealthCheck: [\"GET /repos/{owner}/{repo}/pages/health\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getReadmeInDirectory: [\"GET /repos/{owner}/{repo}/readme/{dir}\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getStatusChecksProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n getTeamsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\"],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\"],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n getWebhookConfigForRepo: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}\"],\n listAutolinks: [\"GET /repos/{owner}/{repo}/autolinks\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\"],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/statuses\"],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentStatuses: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\"],\n listReleaseAssets: [\"GET /repos/{owner}/{repo}/releases/{release_id}/assets\"],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhookDeliveries: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n mergeUpstream: [\"POST /repos/{owner}/{repo}/merge-upstream\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"],\n removeAppAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n removeCollaborator: [\"DELETE /repos/{owner}/{repo}/collaborators/{username}\"],\n removeStatusCheckContexts: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n removeStatusCheckProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n removeTeamAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n removeUserAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n renameBranch: [\"POST /repos/{owner}/{repo}/branches/{branch}/rename\"],\n replaceAllTopics: [\"PUT /repos/{owner}/{repo}/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n setAppAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n setStatusCheckContexts: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n setTeamAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n setUserAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection\"],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n updatePullRequestReviewProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n updateStatusCheckPotection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\", {}, {\n renamed: [\"repos\", \"updateStatusCheckProtection\"]\n }],\n updateStatusCheckProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n updateWebhookConfigForRepo: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n uploadReleaseAsset: [\"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\", {\n baseUrl: \"https://uploads.github.com\"\n }]\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\"],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n users: [\"GET /search/users\"]\n },\n secretScanning: {\n getAlert: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"],\n listAlertsForOrg: [\"GET /orgs/{org}/secret-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"]\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n addOrUpdateProjectPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n addOrUpdateRepoPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n checkPermissionsForProjectInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n checkPermissionsForRepoInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n deleteDiscussionInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n getDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n getMembershipForUserInOrg: [\"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/invitations\"],\n listProjectsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects\"],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n removeProjectInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n removeRepoInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n updateDiscussionCommentInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n updateDiscussionInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"]\n },\n users: {\n addEmailForAuthenticated: [\"POST /user/emails\", {}, {\n renamed: [\"users\", \"addEmailForAuthenticatedUser\"]\n }],\n addEmailForAuthenticatedUser: [\"POST /user/emails\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\"POST /user/gpg_keys\", {}, {\n renamed: [\"users\", \"createGpgKeyForAuthenticatedUser\"]\n }],\n createGpgKeyForAuthenticatedUser: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\"POST /user/keys\", {}, {\n renamed: [\"users\", \"createPublicSshKeyForAuthenticatedUser\"]\n }],\n createPublicSshKeyForAuthenticatedUser: [\"POST /user/keys\"],\n deleteEmailForAuthenticated: [\"DELETE /user/emails\", {}, {\n renamed: [\"users\", \"deleteEmailForAuthenticatedUser\"]\n }],\n deleteEmailForAuthenticatedUser: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\"DELETE /user/gpg_keys/{gpg_key_id}\", {}, {\n renamed: [\"users\", \"deleteGpgKeyForAuthenticatedUser\"]\n }],\n deleteGpgKeyForAuthenticatedUser: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\"DELETE /user/keys/{key_id}\", {}, {\n renamed: [\"users\", \"deletePublicSshKeyForAuthenticatedUser\"]\n }],\n deletePublicSshKeyForAuthenticatedUser: [\"DELETE /user/keys/{key_id}\"],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\"GET /user/gpg_keys/{gpg_key_id}\", {}, {\n renamed: [\"users\", \"getGpgKeyForAuthenticatedUser\"]\n }],\n getGpgKeyForAuthenticatedUser: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\"GET /user/keys/{key_id}\", {}, {\n renamed: [\"users\", \"getPublicSshKeyForAuthenticatedUser\"]\n }],\n getPublicSshKeyForAuthenticatedUser: [\"GET /user/keys/{key_id}\"],\n list: [\"GET /users\"],\n listBlockedByAuthenticated: [\"GET /user/blocks\", {}, {\n renamed: [\"users\", \"listBlockedByAuthenticatedUser\"]\n }],\n listBlockedByAuthenticatedUser: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\"GET /user/emails\", {}, {\n renamed: [\"users\", \"listEmailsForAuthenticatedUser\"]\n }],\n listEmailsForAuthenticatedUser: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\"GET /user/following\", {}, {\n renamed: [\"users\", \"listFollowedByAuthenticatedUser\"]\n }],\n listFollowedByAuthenticatedUser: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\"GET /user/gpg_keys\", {}, {\n renamed: [\"users\", \"listGpgKeysForAuthenticatedUser\"]\n }],\n listGpgKeysForAuthenticatedUser: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\"GET /user/public_emails\", {}, {\n renamed: [\"users\", \"listPublicEmailsForAuthenticatedUser\"]\n }],\n listPublicEmailsForAuthenticatedUser: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\"GET /user/keys\", {}, {\n renamed: [\"users\", \"listPublicSshKeysForAuthenticatedUser\"]\n }],\n listPublicSshKeysForAuthenticatedUser: [\"GET /user/keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\"PATCH /user/email/visibility\", {}, {\n renamed: [\"users\", \"setPrimaryEmailVisibilityForAuthenticatedUser\"]\n }],\n setPrimaryEmailVisibilityForAuthenticatedUser: [\"PATCH /user/email/visibility\"],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"]\n }\n};\n\nconst VERSION = \"5.13.0\";\n\nfunction endpointsToMethods(octokit, endpointsMap) {\n const newMethods = {};\n\n for (const [scope, endpoints] of Object.entries(endpointsMap)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign({\n method,\n url\n }, defaults);\n\n if (!newMethods[scope]) {\n newMethods[scope] = {};\n }\n\n const scopeMethods = newMethods[scope];\n\n if (decorations) {\n scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations);\n continue;\n }\n\n scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);\n }\n }\n\n return newMethods;\n}\n\nfunction decorate(octokit, scope, methodName, defaults, decorations) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n /* istanbul ignore next */\n\n function withDecorations(...args) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n let options = requestWithDefaults.endpoint.merge(...args); // There are currently no other decorations than `.mapToData`\n\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: undefined\n });\n return requestWithDefaults(options);\n }\n\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`);\n }\n\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n\n if (decorations.renamedParameters) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n const options = requestWithDefaults.endpoint.merge(...args);\n\n for (const [name, alias] of Object.entries(decorations.renamedParameters)) {\n if (name in options) {\n octokit.log.warn(`\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`);\n\n if (!(alias in options)) {\n options[alias] = options[name];\n }\n\n delete options[name];\n }\n }\n\n return requestWithDefaults(options);\n } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n\n\n return requestWithDefaults(...args);\n }\n\n return Object.assign(withDecorations, requestWithDefaults);\n}\n\nfunction restEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, Endpoints);\n return {\n rest: api\n };\n}\nrestEndpointMethods.VERSION = VERSION;\nfunction legacyRestEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, Endpoints);\n return _objectSpread2(_objectSpread2({}, api), {}, {\n rest: api\n });\n}\nlegacyRestEndpointMethods.VERSION = VERSION;\n\nexports.legacyRestEndpointMethods = legacyRestEndpointMethods;\nexports.restEndpointMethods = restEndpointMethods;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar deprecation = require('deprecation');\nvar once = _interopDefault(require('once'));\n\nconst logOnceCode = once(deprecation => console.warn(deprecation));\nconst logOnceHeaders = once(deprecation => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\n\nclass RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"HttpError\";\n this.status = statusCode;\n let headers;\n\n if (\"headers\" in options && typeof options.headers !== \"undefined\") {\n headers = options.headers;\n }\n\n if (\"response\" in options) {\n this.response = options.response;\n headers = options.response.headers;\n } // redact request credentials without mutating original request options\n\n\n const requestCopy = Object.assign({}, options.request);\n\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\")\n });\n }\n\n requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\") // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy; // deprecations\n\n Object.defineProperty(this, \"code\", {\n get() {\n logOnceCode(new deprecation.Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n }\n\n });\n Object.defineProperty(this, \"headers\", {\n get() {\n logOnceHeaders(new deprecation.Deprecation(\"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.\"));\n return headers || {};\n }\n\n });\n }\n\n}\n\nexports.RequestError = RequestError;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar endpoint = require('@octokit/endpoint');\nvar universalUserAgent = require('universal-user-agent');\nvar isPlainObject = require('is-plain-object');\nvar nodeFetch = _interopDefault(require('node-fetch'));\nvar requestError = require('@octokit/request-error');\n\nconst VERSION = \"5.6.3\";\n\nfunction getBufferResponse(response) {\n return response.arrayBuffer();\n}\n\nfunction fetchWrapper(requestOptions) {\n const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;\n\n if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n\n let headers = {};\n let status;\n let url;\n const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect\n }, // `requestOptions.request.agent` type is incompatible\n // see https://github.com/octokit/types.ts/pull/264\n requestOptions.request)).then(async response => {\n url = response.url;\n status = response.status;\n\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n\n if (\"deprecation\" in headers) {\n const matches = headers.link && headers.link.match(/<([^>]+)>; rel=\"deprecation\"/);\n const deprecationLink = matches && matches.pop();\n log.warn(`[@octokit/request] \"${requestOptions.method} ${requestOptions.url}\" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : \"\"}`);\n }\n\n if (status === 204 || status === 205) {\n return;\n } // GitHub API returns 200 for HEAD requests\n\n\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n\n throw new requestError.RequestError(response.statusText, status, {\n response: {\n url,\n status,\n headers,\n data: undefined\n },\n request: requestOptions\n });\n }\n\n if (status === 304) {\n throw new requestError.RequestError(\"Not modified\", status, {\n response: {\n url,\n status,\n headers,\n data: await getResponseData(response)\n },\n request: requestOptions\n });\n }\n\n if (status >= 400) {\n const data = await getResponseData(response);\n const error = new requestError.RequestError(toErrorMessage(data), status, {\n response: {\n url,\n status,\n headers,\n data\n },\n request: requestOptions\n });\n throw error;\n }\n\n return getResponseData(response);\n }).then(data => {\n return {\n status,\n url,\n headers,\n data\n };\n }).catch(error => {\n if (error instanceof requestError.RequestError) throw error;\n throw new requestError.RequestError(error.message, 500, {\n request: requestOptions\n });\n });\n}\n\nasync function getResponseData(response) {\n const contentType = response.headers.get(\"content-type\");\n\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n\n return getBufferResponse(response);\n}\n\nfunction toErrorMessage(data) {\n if (typeof data === \"string\") return data; // istanbul ignore else - just in case\n\n if (\"message\" in data) {\n if (Array.isArray(data.errors)) {\n return `${data.message}: ${data.errors.map(JSON.stringify).join(\", \")}`;\n }\n\n return data.message;\n } // istanbul ignore next - just in case\n\n\n return `Unknown error: ${JSON.stringify(data)}`;\n}\n\nfunction withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n}\n\nconst request = withDefaults(endpoint.endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n }\n});\n\nexports.request = request;\n//# sourceMappingURL=index.js.map\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nconst events_1 = require(\"events\");\nconst debug_1 = __importDefault(require(\"debug\"));\nconst promisify_1 = __importDefault(require(\"./promisify\"));\nconst debug = debug_1.default('agent-base');\nfunction isAgent(v) {\n return Boolean(v) && typeof v.addRequest === 'function';\n}\nfunction isSecureEndpoint() {\n const { stack } = new Error();\n if (typeof stack !== 'string')\n return false;\n return stack.split('\\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1);\n}\nfunction createAgent(callback, opts) {\n return new createAgent.Agent(callback, opts);\n}\n(function (createAgent) {\n /**\n * Base `http.Agent` implementation.\n * No pooling/keep-alive is implemented by default.\n *\n * @param {Function} callback\n * @api public\n */\n class Agent extends events_1.EventEmitter {\n constructor(callback, _opts) {\n super();\n let opts = _opts;\n if (typeof callback === 'function') {\n this.callback = callback;\n }\n else if (callback) {\n opts = callback;\n }\n // Timeout for the socket to be returned from the callback\n this.timeout = null;\n if (opts && typeof opts.timeout === 'number') {\n this.timeout = opts.timeout;\n }\n // These aren't actually used by `agent-base`, but are required\n // for the TypeScript definition files in `@types/node` :/\n this.maxFreeSockets = 1;\n this.maxSockets = 1;\n this.maxTotalSockets = Infinity;\n this.sockets = {};\n this.freeSockets = {};\n this.requests = {};\n this.options = {};\n }\n get defaultPort() {\n if (typeof this.explicitDefaultPort === 'number') {\n return this.explicitDefaultPort;\n }\n return isSecureEndpoint() ? 443 : 80;\n }\n set defaultPort(v) {\n this.explicitDefaultPort = v;\n }\n get protocol() {\n if (typeof this.explicitProtocol === 'string') {\n return this.explicitProtocol;\n }\n return isSecureEndpoint() ? 'https:' : 'http:';\n }\n set protocol(v) {\n this.explicitProtocol = v;\n }\n callback(req, opts, fn) {\n throw new Error('\"agent-base\" has no default implementation, you must subclass and override `callback()`');\n }\n /**\n * Called by node-core's \"_http_client.js\" module when creating\n * a new HTTP request with this Agent instance.\n *\n * @api public\n */\n addRequest(req, _opts) {\n const opts = Object.assign({}, _opts);\n if (typeof opts.secureEndpoint !== 'boolean') {\n opts.secureEndpoint = isSecureEndpoint();\n }\n if (opts.host == null) {\n opts.host = 'localhost';\n }\n if (opts.port == null) {\n opts.port = opts.secureEndpoint ? 443 : 80;\n }\n if (opts.protocol == null) {\n opts.protocol = opts.secureEndpoint ? 'https:' : 'http:';\n }\n if (opts.host && opts.path) {\n // If both a `host` and `path` are specified then it's most\n // likely the result of a `url.parse()` call... we need to\n // remove the `path` portion so that `net.connect()` doesn't\n // attempt to open that as a unix socket file.\n delete opts.path;\n }\n delete opts.agent;\n delete opts.hostname;\n delete opts._defaultAgent;\n delete opts.defaultPort;\n delete opts.createConnection;\n // Hint to use \"Connection: close\"\n // XXX: non-documented `http` module API :(\n req._last = true;\n req.shouldKeepAlive = false;\n let timedOut = false;\n let timeoutId = null;\n const timeoutMs = opts.timeout || this.timeout;\n const onerror = (err) => {\n if (req._hadError)\n return;\n req.emit('error', err);\n // For Safety. Some additional errors might fire later on\n // and we need to make sure we don't double-fire the error event.\n req._hadError = true;\n };\n const ontimeout = () => {\n timeoutId = null;\n timedOut = true;\n const err = new Error(`A \"socket\" was not created for HTTP request before ${timeoutMs}ms`);\n err.code = 'ETIMEOUT';\n onerror(err);\n };\n const callbackError = (err) => {\n if (timedOut)\n return;\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n onerror(err);\n };\n const onsocket = (socket) => {\n if (timedOut)\n return;\n if (timeoutId != null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n if (isAgent(socket)) {\n // `socket` is actually an `http.Agent` instance, so\n // relinquish responsibility for this `req` to the Agent\n // from here on\n debug('Callback returned another Agent instance %o', socket.constructor.name);\n socket.addRequest(req, opts);\n return;\n }\n if (socket) {\n socket.once('free', () => {\n this.freeSocket(socket, opts);\n });\n req.onSocket(socket);\n return;\n }\n const err = new Error(`no Duplex stream was returned to agent-base for \\`${req.method} ${req.path}\\``);\n onerror(err);\n };\n if (typeof this.callback !== 'function') {\n onerror(new Error('`callback` is not defined'));\n return;\n }\n if (!this.promisifiedCallback) {\n if (this.callback.length >= 3) {\n debug('Converting legacy callback function to promise');\n this.promisifiedCallback = promisify_1.default(this.callback);\n }\n else {\n this.promisifiedCallback = this.callback;\n }\n }\n if (typeof timeoutMs === 'number' && timeoutMs > 0) {\n timeoutId = setTimeout(ontimeout, timeoutMs);\n }\n if ('port' in opts && typeof opts.port !== 'number') {\n opts.port = Number(opts.port);\n }\n try {\n debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`);\n Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError);\n }\n catch (err) {\n Promise.reject(err).catch(callbackError);\n }\n }\n freeSocket(socket, opts) {\n debug('Freeing socket %o %o', socket.constructor.name, opts);\n socket.destroy();\n }\n destroy() {\n debug('Destroying agent %o', this.constructor.name);\n }\n }\n createAgent.Agent = Agent;\n // So that `instanceof` works correctly\n createAgent.prototype = createAgent.Agent.prototype;\n})(createAgent || (createAgent = {}));\nmodule.exports = createAgent;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction promisify(fn) {\n return function (req, opts) {\n return new Promise((resolve, reject) => {\n fn.call(this, req, opts, (err, rtn) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(rtn);\n }\n });\n });\n };\n}\nexports.default = promisify;\n//# sourceMappingURL=promisify.js.map","module.exports =\n{\n parallel : require('./parallel.js'),\n serial : require('./serial.js'),\n serialOrdered : require('./serialOrdered.js')\n};\n","// API\nmodule.exports = abort;\n\n/**\n * Aborts leftover active jobs\n *\n * @param {object} state - current state object\n */\nfunction abort(state)\n{\n Object.keys(state.jobs).forEach(clean.bind(state));\n\n // reset leftover jobs\n state.jobs = {};\n}\n\n/**\n * Cleans up leftover job by invoking abort function for the provided job id\n *\n * @this state\n * @param {string|number} key - job id to abort\n */\nfunction clean(key)\n{\n if (typeof this.jobs[key] == 'function')\n {\n this.jobs[key]();\n }\n}\n","var defer = require('./defer.js');\n\n// API\nmodule.exports = async;\n\n/**\n * Runs provided callback asynchronously\n * even if callback itself is not\n *\n * @param {function} callback - callback to invoke\n * @returns {function} - augmented callback\n */\nfunction async(callback)\n{\n var isAsync = false;\n\n // check if async happened\n defer(function() { isAsync = true; });\n\n return function async_callback(err, result)\n {\n if (isAsync)\n {\n callback(err, result);\n }\n else\n {\n defer(function nextTick_callback()\n {\n callback(err, result);\n });\n }\n };\n}\n","module.exports = defer;\n\n/**\n * Runs provided function on next iteration of the event loop\n *\n * @param {function} fn - function to run\n */\nfunction defer(fn)\n{\n var nextTick = typeof setImmediate == 'function'\n ? setImmediate\n : (\n typeof process == 'object' && typeof process.nextTick == 'function'\n ? process.nextTick\n : null\n );\n\n if (nextTick)\n {\n nextTick(fn);\n }\n else\n {\n setTimeout(fn, 0);\n }\n}\n","var async = require('./async.js')\n , abort = require('./abort.js')\n ;\n\n// API\nmodule.exports = iterate;\n\n/**\n * Iterates over each job object\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {object} state - current job status\n * @param {function} callback - invoked when all elements processed\n */\nfunction iterate(list, iterator, state, callback)\n{\n // store current index\n var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;\n\n state.jobs[key] = runJob(iterator, key, list[key], function(error, output)\n {\n // don't repeat yourself\n // skip secondary callbacks\n if (!(key in state.jobs))\n {\n return;\n }\n\n // clean up jobs\n delete state.jobs[key];\n\n if (error)\n {\n // don't process rest of the results\n // stop still active jobs\n // and reset the list\n abort(state);\n }\n else\n {\n state.results[key] = output;\n }\n\n // return salvaged results\n callback(error, state.results);\n });\n}\n\n/**\n * Runs iterator over provided job element\n *\n * @param {function} iterator - iterator to invoke\n * @param {string|number} key - key/index of the element in the list of jobs\n * @param {mixed} item - job description\n * @param {function} callback - invoked after iterator is done with the job\n * @returns {function|mixed} - job abort function or something else\n */\nfunction runJob(iterator, key, item, callback)\n{\n var aborter;\n\n // allow shortcut if iterator expects only two arguments\n if (iterator.length == 2)\n {\n aborter = iterator(item, async(callback));\n }\n // otherwise go with full three arguments\n else\n {\n aborter = iterator(item, key, async(callback));\n }\n\n return aborter;\n}\n","// API\nmodule.exports = state;\n\n/**\n * Creates initial state object\n * for iteration over list\n *\n * @param {array|object} list - list to iterate over\n * @param {function|null} sortMethod - function to use for keys sort,\n * or `null` to keep them as is\n * @returns {object} - initial state object\n */\nfunction state(list, sortMethod)\n{\n var isNamedList = !Array.isArray(list)\n , initState =\n {\n index : 0,\n keyedList: isNamedList || sortMethod ? Object.keys(list) : null,\n jobs : {},\n results : isNamedList ? {} : [],\n size : isNamedList ? Object.keys(list).length : list.length\n }\n ;\n\n if (sortMethod)\n {\n // sort array keys based on it's values\n // sort object's keys just on own merit\n initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)\n {\n return sortMethod(list[a], list[b]);\n });\n }\n\n return initState;\n}\n","var abort = require('./abort.js')\n , async = require('./async.js')\n ;\n\n// API\nmodule.exports = terminator;\n\n/**\n * Terminates jobs in the attached state context\n *\n * @this AsyncKitState#\n * @param {function} callback - final callback to invoke after termination\n */\nfunction terminator(callback)\n{\n if (!Object.keys(this.jobs).length)\n {\n return;\n }\n\n // fast forward iteration index\n this.index = this.size;\n\n // abort jobs\n abort(this);\n\n // send back results we have so far\n async(callback)(null, this.results);\n}\n","var iterate = require('./lib/iterate.js')\n , initState = require('./lib/state.js')\n , terminator = require('./lib/terminator.js')\n ;\n\n// Public API\nmodule.exports = parallel;\n\n/**\n * Runs iterator over provided array elements in parallel\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction parallel(list, iterator, callback)\n{\n var state = initState(list);\n\n while (state.index < (state['keyedList'] || list).length)\n {\n iterate(list, iterator, state, function(error, result)\n {\n if (error)\n {\n callback(error, result);\n return;\n }\n\n // looks like it's the last one\n if (Object.keys(state.jobs).length === 0)\n {\n callback(null, state.results);\n return;\n }\n });\n\n state.index++;\n }\n\n return terminator.bind(state, callback);\n}\n","var serialOrdered = require('./serialOrdered.js');\n\n// Public API\nmodule.exports = serial;\n\n/**\n * Runs iterator over provided array elements in series\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction serial(list, iterator, callback)\n{\n return serialOrdered(list, iterator, null, callback);\n}\n","var iterate = require('./lib/iterate.js')\n , initState = require('./lib/state.js')\n , terminator = require('./lib/terminator.js')\n ;\n\n// Public API\nmodule.exports = serialOrdered;\n// sorting helpers\nmodule.exports.ascending = ascending;\nmodule.exports.descending = descending;\n\n/**\n * Runs iterator over provided sorted array elements in series\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} sortMethod - custom sort function\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction serialOrdered(list, iterator, sortMethod, callback)\n{\n var state = initState(list, sortMethod);\n\n iterate(list, iterator, state, function iteratorHandler(error, result)\n {\n if (error)\n {\n callback(error, result);\n return;\n }\n\n state.index++;\n\n // are we there yet?\n if (state.index < (state['keyedList'] || list).length)\n {\n iterate(list, iterator, state, iteratorHandler);\n return;\n }\n\n // done here\n callback(null, state.results);\n });\n\n return terminator.bind(state, callback);\n}\n\n/*\n * -- Sort methods\n */\n\n/**\n * sort helper to sort array elements in ascending order\n *\n * @param {mixed} a - an item to compare\n * @param {mixed} b - an item to compare\n * @returns {number} - comparison result\n */\nfunction ascending(a, b)\n{\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\n/**\n * sort helper to sort array elements in descending order\n *\n * @param {mixed} a - an item to compare\n * @param {mixed} b - an item to compare\n * @returns {number} - comparison result\n */\nfunction descending(a, b)\n{\n return -1 * ascending(a, b);\n}\n","var register = require('./lib/register')\nvar addHook = require('./lib/add')\nvar removeHook = require('./lib/remove')\n\n// bind with array of arguments: https://stackoverflow.com/a/21792913\nvar bind = Function.bind\nvar bindable = bind.bind(bind)\n\nfunction bindApi (hook, state, name) {\n var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])\n hook.api = { remove: removeHookRef }\n hook.remove = removeHookRef\n\n ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {\n var args = name ? [state, kind, name] : [state, kind]\n hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)\n })\n}\n\nfunction HookSingular () {\n var singularHookName = 'h'\n var singularHookState = {\n registry: {}\n }\n var singularHook = register.bind(null, singularHookState, singularHookName)\n bindApi(singularHook, singularHookState, singularHookName)\n return singularHook\n}\n\nfunction HookCollection () {\n var state = {\n registry: {}\n }\n\n var hook = register.bind(null, state)\n bindApi(hook, state)\n\n return hook\n}\n\nvar collectionHookDeprecationMessageDisplayed = false\nfunction Hook () {\n if (!collectionHookDeprecationMessageDisplayed) {\n console.warn('[before-after-hook]: \"Hook()\" repurposing warning, use \"Hook.Collection()\". Read more: https://git.io/upgrade-before-after-hook-to-1.4')\n collectionHookDeprecationMessageDisplayed = true\n }\n return HookCollection()\n}\n\nHook.Singular = HookSingular.bind()\nHook.Collection = HookCollection.bind()\n\nmodule.exports = Hook\n// expose constructors as a named property for TypeScript\nmodule.exports.Hook = Hook\nmodule.exports.Singular = Hook.Singular\nmodule.exports.Collection = Hook.Collection\n","module.exports = addHook;\n\nfunction addHook(state, kind, name, hook) {\n var orig = hook;\n if (!state.registry[name]) {\n state.registry[name] = [];\n }\n\n if (kind === \"before\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(orig.bind(null, options))\n .then(method.bind(null, options));\n };\n }\n\n if (kind === \"after\") {\n hook = function (method, options) {\n var result;\n return Promise.resolve()\n .then(method.bind(null, options))\n .then(function (result_) {\n result = result_;\n return orig(result, options);\n })\n .then(function () {\n return result;\n });\n };\n }\n\n if (kind === \"error\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(method.bind(null, options))\n .catch(function (error) {\n return orig(error, options);\n });\n };\n }\n\n state.registry[name].push({\n hook: hook,\n orig: orig,\n });\n}\n","module.exports = register;\n\nfunction register(state, name, method, options) {\n if (typeof method !== \"function\") {\n throw new Error(\"method for before hook must be a function\");\n }\n\n if (!options) {\n options = {};\n }\n\n if (Array.isArray(name)) {\n return name.reverse().reduce(function (callback, name) {\n return register.bind(null, state, name, callback, options);\n }, method)();\n }\n\n return Promise.resolve().then(function () {\n if (!state.registry[name]) {\n return method(options);\n }\n\n return state.registry[name].reduce(function (method, registered) {\n return registered.hook.bind(null, method, options);\n }, method)();\n });\n}\n","module.exports = removeHook;\n\nfunction removeHook(state, name, method) {\n if (!state.registry[name]) {\n return;\n }\n\n var index = state.registry[name]\n .map(function (registered) {\n return registered.orig;\n })\n .indexOf(method);\n\n if (index === -1) {\n return;\n }\n\n state.registry[name].splice(index, 1);\n}\n","var util = require('util');\nvar Stream = require('stream').Stream;\nvar DelayedStream = require('delayed-stream');\n\nmodule.exports = CombinedStream;\nfunction CombinedStream() {\n this.writable = false;\n this.readable = true;\n this.dataSize = 0;\n this.maxDataSize = 2 * 1024 * 1024;\n this.pauseStreams = true;\n\n this._released = false;\n this._streams = [];\n this._currentStream = null;\n this._insideLoop = false;\n this._pendingNext = false;\n}\nutil.inherits(CombinedStream, Stream);\n\nCombinedStream.create = function(options) {\n var combinedStream = new this();\n\n options = options || {};\n for (var option in options) {\n combinedStream[option] = options[option];\n }\n\n return combinedStream;\n};\n\nCombinedStream.isStreamLike = function(stream) {\n return (typeof stream !== 'function')\n && (typeof stream !== 'string')\n && (typeof stream !== 'boolean')\n && (typeof stream !== 'number')\n && (!Buffer.isBuffer(stream));\n};\n\nCombinedStream.prototype.append = function(stream) {\n var isStreamLike = CombinedStream.isStreamLike(stream);\n\n if (isStreamLike) {\n if (!(stream instanceof DelayedStream)) {\n var newStream = DelayedStream.create(stream, {\n maxDataSize: Infinity,\n pauseStream: this.pauseStreams,\n });\n stream.on('data', this._checkDataSize.bind(this));\n stream = newStream;\n }\n\n this._handleErrors(stream);\n\n if (this.pauseStreams) {\n stream.pause();\n }\n }\n\n this._streams.push(stream);\n return this;\n};\n\nCombinedStream.prototype.pipe = function(dest, options) {\n Stream.prototype.pipe.call(this, dest, options);\n this.resume();\n return dest;\n};\n\nCombinedStream.prototype._getNext = function() {\n this._currentStream = null;\n\n if (this._insideLoop) {\n this._pendingNext = true;\n return; // defer call\n }\n\n this._insideLoop = true;\n try {\n do {\n this._pendingNext = false;\n this._realGetNext();\n } while (this._pendingNext);\n } finally {\n this._insideLoop = false;\n }\n};\n\nCombinedStream.prototype._realGetNext = function() {\n var stream = this._streams.shift();\n\n\n if (typeof stream == 'undefined') {\n this.end();\n return;\n }\n\n if (typeof stream !== 'function') {\n this._pipeNext(stream);\n return;\n }\n\n var getStream = stream;\n getStream(function(stream) {\n var isStreamLike = CombinedStream.isStreamLike(stream);\n if (isStreamLike) {\n stream.on('data', this._checkDataSize.bind(this));\n this._handleErrors(stream);\n }\n\n this._pipeNext(stream);\n }.bind(this));\n};\n\nCombinedStream.prototype._pipeNext = function(stream) {\n this._currentStream = stream;\n\n var isStreamLike = CombinedStream.isStreamLike(stream);\n if (isStreamLike) {\n stream.on('end', this._getNext.bind(this));\n stream.pipe(this, {end: false});\n return;\n }\n\n var value = stream;\n this.write(value);\n this._getNext();\n};\n\nCombinedStream.prototype._handleErrors = function(stream) {\n var self = this;\n stream.on('error', function(err) {\n self._emitError(err);\n });\n};\n\nCombinedStream.prototype.write = function(data) {\n this.emit('data', data);\n};\n\nCombinedStream.prototype.pause = function() {\n if (!this.pauseStreams) {\n return;\n }\n\n if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();\n this.emit('pause');\n};\n\nCombinedStream.prototype.resume = function() {\n if (!this._released) {\n this._released = true;\n this.writable = true;\n this._getNext();\n }\n\n if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();\n this.emit('resume');\n};\n\nCombinedStream.prototype.end = function() {\n this._reset();\n this.emit('end');\n};\n\nCombinedStream.prototype.destroy = function() {\n this._reset();\n this.emit('close');\n};\n\nCombinedStream.prototype._reset = function() {\n this.writable = false;\n this._streams = [];\n this._currentStream = null;\n};\n\nCombinedStream.prototype._checkDataSize = function() {\n this._updateDataSize();\n if (this.dataSize <= this.maxDataSize) {\n return;\n }\n\n var message =\n 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';\n this._emitError(new Error(message));\n};\n\nCombinedStream.prototype._updateDataSize = function() {\n this.dataSize = 0;\n\n var self = this;\n this._streams.forEach(function(stream) {\n if (!stream.dataSize) {\n return;\n }\n\n self.dataSize += stream.dataSize;\n });\n\n if (this._currentStream && this._currentStream.dataSize) {\n this.dataSize += this._currentStream.dataSize;\n }\n};\n\nCombinedStream.prototype._emitError = function(err) {\n this._reset();\n this.emit('error', err);\n};\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.format(...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n","var Stream = require('stream').Stream;\nvar util = require('util');\n\nmodule.exports = DelayedStream;\nfunction DelayedStream() {\n this.source = null;\n this.dataSize = 0;\n this.maxDataSize = 1024 * 1024;\n this.pauseStream = true;\n\n this._maxDataSizeExceeded = false;\n this._released = false;\n this._bufferedEvents = [];\n}\nutil.inherits(DelayedStream, Stream);\n\nDelayedStream.create = function(source, options) {\n var delayedStream = new this();\n\n options = options || {};\n for (var option in options) {\n delayedStream[option] = options[option];\n }\n\n delayedStream.source = source;\n\n var realEmit = source.emit;\n source.emit = function() {\n delayedStream._handleEmit(arguments);\n return realEmit.apply(source, arguments);\n };\n\n source.on('error', function() {});\n if (delayedStream.pauseStream) {\n source.pause();\n }\n\n return delayedStream;\n};\n\nObject.defineProperty(DelayedStream.prototype, 'readable', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this.source.readable;\n }\n});\n\nDelayedStream.prototype.setEncoding = function() {\n return this.source.setEncoding.apply(this.source, arguments);\n};\n\nDelayedStream.prototype.resume = function() {\n if (!this._released) {\n this.release();\n }\n\n this.source.resume();\n};\n\nDelayedStream.prototype.pause = function() {\n this.source.pause();\n};\n\nDelayedStream.prototype.release = function() {\n this._released = true;\n\n this._bufferedEvents.forEach(function(args) {\n this.emit.apply(this, args);\n }.bind(this));\n this._bufferedEvents = [];\n};\n\nDelayedStream.prototype.pipe = function() {\n var r = Stream.prototype.pipe.apply(this, arguments);\n this.resume();\n return r;\n};\n\nDelayedStream.prototype._handleEmit = function(args) {\n if (this._released) {\n this.emit.apply(this, args);\n return;\n }\n\n if (args[0] === 'data') {\n this.dataSize += args[1].length;\n this._checkIfMaxDataSizeExceeded();\n }\n\n this._bufferedEvents.push(args);\n};\n\nDelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {\n if (this._maxDataSizeExceeded) {\n return;\n }\n\n if (this.dataSize <= this.maxDataSize) {\n return;\n }\n\n this._maxDataSizeExceeded = true;\n var message =\n 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'\n this.emit('error', new Error(message));\n};\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nclass Deprecation extends Error {\n constructor(message) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = 'Deprecation';\n }\n\n}\n\nexports.Deprecation = Deprecation;\n","var debug;\n\nmodule.exports = function () {\n if (!debug) {\n try {\n /* eslint global-require: off */\n debug = require(\"debug\")(\"follow-redirects\");\n }\n catch (error) { /* */ }\n if (typeof debug !== \"function\") {\n debug = function () { /* */ };\n }\n }\n debug.apply(null, arguments);\n};\n","var url = require(\"url\");\nvar URL = url.URL;\nvar http = require(\"http\");\nvar https = require(\"https\");\nvar Writable = require(\"stream\").Writable;\nvar assert = require(\"assert\");\nvar debug = require(\"./debug\");\n\n// Create handlers that pass events from native requests\nvar events = [\"abort\", \"aborted\", \"connect\", \"error\", \"socket\", \"timeout\"];\nvar eventHandlers = Object.create(null);\nevents.forEach(function (event) {\n eventHandlers[event] = function (arg1, arg2, arg3) {\n this._redirectable.emit(event, arg1, arg2, arg3);\n };\n});\n\n// Error types with codes\nvar RedirectionError = createErrorType(\n \"ERR_FR_REDIRECTION_FAILURE\",\n \"Redirected request failed\"\n);\nvar TooManyRedirectsError = createErrorType(\n \"ERR_FR_TOO_MANY_REDIRECTS\",\n \"Maximum number of redirects exceeded\"\n);\nvar MaxBodyLengthExceededError = createErrorType(\n \"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\",\n \"Request body larger than maxBodyLength limit\"\n);\nvar WriteAfterEndError = createErrorType(\n \"ERR_STREAM_WRITE_AFTER_END\",\n \"write after end\"\n);\n\n// An HTTP(S) request that can be redirected\nfunction RedirectableRequest(options, responseCallback) {\n // Initialize the request\n Writable.call(this);\n this._sanitizeOptions(options);\n this._options = options;\n this._ended = false;\n this._ending = false;\n this._redirectCount = 0;\n this._redirects = [];\n this._requestBodyLength = 0;\n this._requestBodyBuffers = [];\n\n // Attach a callback if passed\n if (responseCallback) {\n this.on(\"response\", responseCallback);\n }\n\n // React to responses of native requests\n var self = this;\n this._onNativeResponse = function (response) {\n self._processResponse(response);\n };\n\n // Perform the first request\n this._performRequest();\n}\nRedirectableRequest.prototype = Object.create(Writable.prototype);\n\nRedirectableRequest.prototype.abort = function () {\n abortRequest(this._currentRequest);\n this.emit(\"abort\");\n};\n\n// Writes buffered data to the current native request\nRedirectableRequest.prototype.write = function (data, encoding, callback) {\n // Writing is not allowed if end has been called\n if (this._ending) {\n throw new WriteAfterEndError();\n }\n\n // Validate input and shift parameters if necessary\n if (!(typeof data === \"string\" || typeof data === \"object\" && (\"length\" in data))) {\n throw new TypeError(\"data should be a string, Buffer or Uint8Array\");\n }\n if (typeof encoding === \"function\") {\n callback = encoding;\n encoding = null;\n }\n\n // Ignore empty buffers, since writing them doesn't invoke the callback\n // https://github.com/nodejs/node/issues/22066\n if (data.length === 0) {\n if (callback) {\n callback();\n }\n return;\n }\n // Only write when we don't exceed the maximum body length\n if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {\n this._requestBodyLength += data.length;\n this._requestBodyBuffers.push({ data: data, encoding: encoding });\n this._currentRequest.write(data, encoding, callback);\n }\n // Error when we exceed the maximum body length\n else {\n this.emit(\"error\", new MaxBodyLengthExceededError());\n this.abort();\n }\n};\n\n// Ends the current native request\nRedirectableRequest.prototype.end = function (data, encoding, callback) {\n // Shift parameters if necessary\n if (typeof data === \"function\") {\n callback = data;\n data = encoding = null;\n }\n else if (typeof encoding === \"function\") {\n callback = encoding;\n encoding = null;\n }\n\n // Write data if needed and end\n if (!data) {\n this._ended = this._ending = true;\n this._currentRequest.end(null, null, callback);\n }\n else {\n var self = this;\n var currentRequest = this._currentRequest;\n this.write(data, encoding, function () {\n self._ended = true;\n currentRequest.end(null, null, callback);\n });\n this._ending = true;\n }\n};\n\n// Sets a header value on the current native request\nRedirectableRequest.prototype.setHeader = function (name, value) {\n this._options.headers[name] = value;\n this._currentRequest.setHeader(name, value);\n};\n\n// Clears a header value on the current native request\nRedirectableRequest.prototype.removeHeader = function (name) {\n delete this._options.headers[name];\n this._currentRequest.removeHeader(name);\n};\n\n// Global timeout for all underlying requests\nRedirectableRequest.prototype.setTimeout = function (msecs, callback) {\n var self = this;\n\n // Destroys the socket on timeout\n function destroyOnTimeout(socket) {\n socket.setTimeout(msecs);\n socket.removeListener(\"timeout\", socket.destroy);\n socket.addListener(\"timeout\", socket.destroy);\n }\n\n // Sets up a timer to trigger a timeout event\n function startTimer(socket) {\n if (self._timeout) {\n clearTimeout(self._timeout);\n }\n self._timeout = setTimeout(function () {\n self.emit(\"timeout\");\n clearTimer();\n }, msecs);\n destroyOnTimeout(socket);\n }\n\n // Stops a timeout from triggering\n function clearTimer() {\n // Clear the timeout\n if (self._timeout) {\n clearTimeout(self._timeout);\n self._timeout = null;\n }\n\n // Clean up all attached listeners\n self.removeListener(\"abort\", clearTimer);\n self.removeListener(\"error\", clearTimer);\n self.removeListener(\"response\", clearTimer);\n if (callback) {\n self.removeListener(\"timeout\", callback);\n }\n if (!self.socket) {\n self._currentRequest.removeListener(\"socket\", startTimer);\n }\n }\n\n // Attach callback if passed\n if (callback) {\n this.on(\"timeout\", callback);\n }\n\n // Start the timer if or when the socket is opened\n if (this.socket) {\n startTimer(this.socket);\n }\n else {\n this._currentRequest.once(\"socket\", startTimer);\n }\n\n // Clean up on events\n this.on(\"socket\", destroyOnTimeout);\n this.on(\"abort\", clearTimer);\n this.on(\"error\", clearTimer);\n this.on(\"response\", clearTimer);\n\n return this;\n};\n\n// Proxy all other public ClientRequest methods\n[\n \"flushHeaders\", \"getHeader\",\n \"setNoDelay\", \"setSocketKeepAlive\",\n].forEach(function (method) {\n RedirectableRequest.prototype[method] = function (a, b) {\n return this._currentRequest[method](a, b);\n };\n});\n\n// Proxy all public ClientRequest properties\n[\"aborted\", \"connection\", \"socket\"].forEach(function (property) {\n Object.defineProperty(RedirectableRequest.prototype, property, {\n get: function () { return this._currentRequest[property]; },\n });\n});\n\nRedirectableRequest.prototype._sanitizeOptions = function (options) {\n // Ensure headers are always present\n if (!options.headers) {\n options.headers = {};\n }\n\n // Since http.request treats host as an alias of hostname,\n // but the url module interprets host as hostname plus port,\n // eliminate the host property to avoid confusion.\n if (options.host) {\n // Use hostname if set, because it has precedence\n if (!options.hostname) {\n options.hostname = options.host;\n }\n delete options.host;\n }\n\n // Complete the URL object when necessary\n if (!options.pathname && options.path) {\n var searchPos = options.path.indexOf(\"?\");\n if (searchPos < 0) {\n options.pathname = options.path;\n }\n else {\n options.pathname = options.path.substring(0, searchPos);\n options.search = options.path.substring(searchPos);\n }\n }\n};\n\n\n// Executes the next native request (initial or redirect)\nRedirectableRequest.prototype._performRequest = function () {\n // Load the native protocol\n var protocol = this._options.protocol;\n var nativeProtocol = this._options.nativeProtocols[protocol];\n if (!nativeProtocol) {\n this.emit(\"error\", new TypeError(\"Unsupported protocol \" + protocol));\n return;\n }\n\n // If specified, use the agent corresponding to the protocol\n // (HTTP and HTTPS use different types of agents)\n if (this._options.agents) {\n var scheme = protocol.slice(0, -1);\n this._options.agent = this._options.agents[scheme];\n }\n\n // Create the native request and set up its event handlers\n var request = this._currentRequest =\n nativeProtocol.request(this._options, this._onNativeResponse);\n request._redirectable = this;\n for (var event of events) {\n request.on(event, eventHandlers[event]);\n }\n\n // RFC7230§5.3.1: When making a request directly to an origin server, […]\n // a client MUST send only the absolute path […] as the request-target.\n this._currentUrl = /^\\//.test(this._options.path) ?\n url.format(this._options) :\n // When making a request to a proxy, […]\n // a client MUST send the target URI in absolute-form […].\n this._currentUrl = this._options.path;\n\n // End a redirected request\n // (The first request must be ended explicitly with RedirectableRequest#end)\n if (this._isRedirect) {\n // Write the request entity and end\n var i = 0;\n var self = this;\n var buffers = this._requestBodyBuffers;\n (function writeNext(error) {\n // Only write if this request has not been redirected yet\n /* istanbul ignore else */\n if (request === self._currentRequest) {\n // Report any write errors\n /* istanbul ignore if */\n if (error) {\n self.emit(\"error\", error);\n }\n // Write the next buffer if there are still left\n else if (i < buffers.length) {\n var buffer = buffers[i++];\n /* istanbul ignore else */\n if (!request.finished) {\n request.write(buffer.data, buffer.encoding, writeNext);\n }\n }\n // End the request if `end` has been called on us\n else if (self._ended) {\n request.end();\n }\n }\n }());\n }\n};\n\n// Processes a response from the current native request\nRedirectableRequest.prototype._processResponse = function (response) {\n // Store the redirected response\n var statusCode = response.statusCode;\n if (this._options.trackRedirects) {\n this._redirects.push({\n url: this._currentUrl,\n headers: response.headers,\n statusCode: statusCode,\n });\n }\n\n // RFC7231§6.4: The 3xx (Redirection) class of status code indicates\n // that further action needs to be taken by the user agent in order to\n // fulfill the request. If a Location header field is provided,\n // the user agent MAY automatically redirect its request to the URI\n // referenced by the Location field value,\n // even if the specific status code is not understood.\n\n // If the response is not a redirect; return it as-is\n var location = response.headers.location;\n if (!location || this._options.followRedirects === false ||\n statusCode < 300 || statusCode >= 400) {\n response.responseUrl = this._currentUrl;\n response.redirects = this._redirects;\n this.emit(\"response\", response);\n\n // Clean up\n this._requestBodyBuffers = [];\n return;\n }\n\n // The response is a redirect, so abort the current request\n abortRequest(this._currentRequest);\n // Discard the remainder of the response to avoid waiting for data\n response.destroy();\n\n // RFC7231§6.4: A client SHOULD detect and intervene\n // in cyclical redirections (i.e., \"infinite\" redirection loops).\n if (++this._redirectCount > this._options.maxRedirects) {\n this.emit(\"error\", new TooManyRedirectsError());\n return;\n }\n\n // Store the request headers if applicable\n var requestHeaders;\n var beforeRedirect = this._options.beforeRedirect;\n if (beforeRedirect) {\n requestHeaders = Object.assign({\n // The Host header was set by nativeProtocol.request\n Host: response.req.getHeader(\"host\"),\n }, this._options.headers);\n }\n\n // RFC7231§6.4: Automatic redirection needs to done with\n // care for methods not known to be safe, […]\n // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change\n // the request method from POST to GET for the subsequent request.\n var method = this._options.method;\n if ((statusCode === 301 || statusCode === 302) && this._options.method === \"POST\" ||\n // RFC7231§6.4.4: The 303 (See Other) status code indicates that\n // the server is redirecting the user agent to a different resource […]\n // A user agent can perform a retrieval request targeting that URI\n // (a GET or HEAD request if using HTTP) […]\n (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {\n this._options.method = \"GET\";\n // Drop a possible entity and headers related to it\n this._requestBodyBuffers = [];\n removeMatchingHeaders(/^content-/i, this._options.headers);\n }\n\n // Drop the Host header, as the redirect might lead to a different host\n var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);\n\n // If the redirect is relative, carry over the host of the last request\n var currentUrlParts = url.parse(this._currentUrl);\n var currentHost = currentHostHeader || currentUrlParts.host;\n var currentUrl = /^\\w+:/.test(location) ? this._currentUrl :\n url.format(Object.assign(currentUrlParts, { host: currentHost }));\n\n // Determine the URL of the redirection\n var redirectUrl;\n try {\n redirectUrl = url.resolve(currentUrl, location);\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError(cause));\n return;\n }\n\n // Create the redirected request\n debug(\"redirecting to\", redirectUrl);\n this._isRedirect = true;\n var redirectUrlParts = url.parse(redirectUrl);\n Object.assign(this._options, redirectUrlParts);\n\n // Drop confidential headers when redirecting to a less secure protocol\n // or to a different domain that is not a superdomain\n if (redirectUrlParts.protocol !== currentUrlParts.protocol &&\n redirectUrlParts.protocol !== \"https:\" ||\n redirectUrlParts.host !== currentHost &&\n !isSubdomain(redirectUrlParts.host, currentHost)) {\n removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);\n }\n\n // Evaluate the beforeRedirect callback\n if (typeof beforeRedirect === \"function\") {\n var responseDetails = {\n headers: response.headers,\n statusCode: statusCode,\n };\n var requestDetails = {\n url: currentUrl,\n method: method,\n headers: requestHeaders,\n };\n try {\n beforeRedirect(this._options, responseDetails, requestDetails);\n }\n catch (err) {\n this.emit(\"error\", err);\n return;\n }\n this._sanitizeOptions(this._options);\n }\n\n // Perform the redirected request\n try {\n this._performRequest();\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError(cause));\n }\n};\n\n// Wraps the key/value object of protocols with redirect functionality\nfunction wrap(protocols) {\n // Default settings\n var exports = {\n maxRedirects: 21,\n maxBodyLength: 10 * 1024 * 1024,\n };\n\n // Wrap each protocol\n var nativeProtocols = {};\n Object.keys(protocols).forEach(function (scheme) {\n var protocol = scheme + \":\";\n var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];\n var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);\n\n // Executes a request, following redirects\n function request(input, options, callback) {\n // Parse parameters\n if (typeof input === \"string\") {\n var urlStr = input;\n try {\n input = urlToOptions(new URL(urlStr));\n }\n catch (err) {\n /* istanbul ignore next */\n input = url.parse(urlStr);\n }\n }\n else if (URL && (input instanceof URL)) {\n input = urlToOptions(input);\n }\n else {\n callback = options;\n options = input;\n input = { protocol: protocol };\n }\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n\n // Set defaults\n options = Object.assign({\n maxRedirects: exports.maxRedirects,\n maxBodyLength: exports.maxBodyLength,\n }, input, options);\n options.nativeProtocols = nativeProtocols;\n\n assert.equal(options.protocol, protocol, \"protocol mismatch\");\n debug(\"options\", options);\n return new RedirectableRequest(options, callback);\n }\n\n // Executes a GET request, following redirects\n function get(input, options, callback) {\n var wrappedRequest = wrappedProtocol.request(input, options, callback);\n wrappedRequest.end();\n return wrappedRequest;\n }\n\n // Expose the properties on the wrapped protocol\n Object.defineProperties(wrappedProtocol, {\n request: { value: request, configurable: true, enumerable: true, writable: true },\n get: { value: get, configurable: true, enumerable: true, writable: true },\n });\n });\n return exports;\n}\n\n/* istanbul ignore next */\nfunction noop() { /* empty */ }\n\n// from https://github.com/nodejs/node/blob/master/lib/internal/url.js\nfunction urlToOptions(urlObject) {\n var options = {\n protocol: urlObject.protocol,\n hostname: urlObject.hostname.startsWith(\"[\") ?\n /* istanbul ignore next */\n urlObject.hostname.slice(1, -1) :\n urlObject.hostname,\n hash: urlObject.hash,\n search: urlObject.search,\n pathname: urlObject.pathname,\n path: urlObject.pathname + urlObject.search,\n href: urlObject.href,\n };\n if (urlObject.port !== \"\") {\n options.port = Number(urlObject.port);\n }\n return options;\n}\n\nfunction removeMatchingHeaders(regex, headers) {\n var lastValue;\n for (var header in headers) {\n if (regex.test(header)) {\n lastValue = headers[header];\n delete headers[header];\n }\n }\n return (lastValue === null || typeof lastValue === \"undefined\") ?\n undefined : String(lastValue).trim();\n}\n\nfunction createErrorType(code, defaultMessage) {\n function CustomError(cause) {\n Error.captureStackTrace(this, this.constructor);\n if (!cause) {\n this.message = defaultMessage;\n }\n else {\n this.message = defaultMessage + \": \" + cause.message;\n this.cause = cause;\n }\n }\n CustomError.prototype = new Error();\n CustomError.prototype.constructor = CustomError;\n CustomError.prototype.name = \"Error [\" + code + \"]\";\n CustomError.prototype.code = code;\n return CustomError;\n}\n\nfunction abortRequest(request) {\n for (var event of events) {\n request.removeListener(event, eventHandlers[event]);\n }\n request.on(\"error\", noop);\n request.abort();\n}\n\nfunction isSubdomain(subdomain, domain) {\n const dot = subdomain.length - domain.length - 1;\n return dot > 0 && subdomain[dot] === \".\" && subdomain.endsWith(domain);\n}\n\n// Exports\nmodule.exports = wrap({ http: http, https: https });\nmodule.exports.wrap = wrap;\n","var CombinedStream = require('combined-stream');\nvar util = require('util');\nvar path = require('path');\nvar http = require('http');\nvar https = require('https');\nvar parseUrl = require('url').parse;\nvar fs = require('fs');\nvar Stream = require('stream').Stream;\nvar mime = require('mime-types');\nvar asynckit = require('asynckit');\nvar populate = require('./populate.js');\n\n// Public API\nmodule.exports = FormData;\n\n// make it a Stream\nutil.inherits(FormData, CombinedStream);\n\n/**\n * Create readable \"multipart/form-data\" streams.\n * Can be used to submit forms\n * and file uploads to other web applications.\n *\n * @constructor\n * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream\n */\nfunction FormData(options) {\n if (!(this instanceof FormData)) {\n return new FormData(options);\n }\n\n this._overheadLength = 0;\n this._valueLength = 0;\n this._valuesToMeasure = [];\n\n CombinedStream.call(this);\n\n options = options || {};\n for (var option in options) {\n this[option] = options[option];\n }\n}\n\nFormData.LINE_BREAK = '\\r\\n';\nFormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';\n\nFormData.prototype.append = function(field, value, options) {\n\n options = options || {};\n\n // allow filename as single option\n if (typeof options == 'string') {\n options = {filename: options};\n }\n\n var append = CombinedStream.prototype.append.bind(this);\n\n // all that streamy business can't handle numbers\n if (typeof value == 'number') {\n value = '' + value;\n }\n\n // https://github.com/felixge/node-form-data/issues/38\n if (util.isArray(value)) {\n // Please convert your array into string\n // the way web server expects it\n this._error(new Error('Arrays are not supported.'));\n return;\n }\n\n var header = this._multiPartHeader(field, value, options);\n var footer = this._multiPartFooter();\n\n append(header);\n append(value);\n append(footer);\n\n // pass along options.knownLength\n this._trackLength(header, value, options);\n};\n\nFormData.prototype._trackLength = function(header, value, options) {\n var valueLength = 0;\n\n // used w/ getLengthSync(), when length is known.\n // e.g. for streaming directly from a remote server,\n // w/ a known file a size, and not wanting to wait for\n // incoming file to finish to get its size.\n if (options.knownLength != null) {\n valueLength += +options.knownLength;\n } else if (Buffer.isBuffer(value)) {\n valueLength = value.length;\n } else if (typeof value === 'string') {\n valueLength = Buffer.byteLength(value);\n }\n\n this._valueLength += valueLength;\n\n // @check why add CRLF? does this account for custom/multiple CRLFs?\n this._overheadLength +=\n Buffer.byteLength(header) +\n FormData.LINE_BREAK.length;\n\n // empty or either doesn't have path or not an http response or not a stream\n if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) {\n return;\n }\n\n // no need to bother with the length\n if (!options.knownLength) {\n this._valuesToMeasure.push(value);\n }\n};\n\nFormData.prototype._lengthRetriever = function(value, callback) {\n\n if (value.hasOwnProperty('fd')) {\n\n // take read range into a account\n // `end` = Infinity –> read file till the end\n //\n // TODO: Looks like there is bug in Node fs.createReadStream\n // it doesn't respect `end` options without `start` options\n // Fix it when node fixes it.\n // https://github.com/joyent/node/issues/7819\n if (value.end != undefined && value.end != Infinity && value.start != undefined) {\n\n // when end specified\n // no need to calculate range\n // inclusive, starts with 0\n callback(null, value.end + 1 - (value.start ? value.start : 0));\n\n // not that fast snoopy\n } else {\n // still need to fetch file size from fs\n fs.stat(value.path, function(err, stat) {\n\n var fileSize;\n\n if (err) {\n callback(err);\n return;\n }\n\n // update final size based on the range options\n fileSize = stat.size - (value.start ? value.start : 0);\n callback(null, fileSize);\n });\n }\n\n // or http response\n } else if (value.hasOwnProperty('httpVersion')) {\n callback(null, +value.headers['content-length']);\n\n // or request stream http://github.com/mikeal/request\n } else if (value.hasOwnProperty('httpModule')) {\n // wait till response come back\n value.on('response', function(response) {\n value.pause();\n callback(null, +response.headers['content-length']);\n });\n value.resume();\n\n // something else\n } else {\n callback('Unknown stream');\n }\n};\n\nFormData.prototype._multiPartHeader = function(field, value, options) {\n // custom header specified (as string)?\n // it becomes responsible for boundary\n // (e.g. to handle extra CRLFs on .NET servers)\n if (typeof options.header == 'string') {\n return options.header;\n }\n\n var contentDisposition = this._getContentDisposition(value, options);\n var contentType = this._getContentType(value, options);\n\n var contents = '';\n var headers = {\n // add custom disposition as third element or keep it two elements if not\n 'Content-Disposition': ['form-data', 'name=\"' + field + '\"'].concat(contentDisposition || []),\n // if no content type. allow it to be empty array\n 'Content-Type': [].concat(contentType || [])\n };\n\n // allow custom headers.\n if (typeof options.header == 'object') {\n populate(headers, options.header);\n }\n\n var header;\n for (var prop in headers) {\n if (!headers.hasOwnProperty(prop)) continue;\n header = headers[prop];\n\n // skip nullish headers.\n if (header == null) {\n continue;\n }\n\n // convert all headers to arrays.\n if (!Array.isArray(header)) {\n header = [header];\n }\n\n // add non-empty headers.\n if (header.length) {\n contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;\n }\n }\n\n return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;\n};\n\nFormData.prototype._getContentDisposition = function(value, options) {\n\n var filename\n , contentDisposition\n ;\n\n if (typeof options.filepath === 'string') {\n // custom filepath for relative paths\n filename = path.normalize(options.filepath).replace(/\\\\/g, '/');\n } else if (options.filename || value.name || value.path) {\n // custom filename take precedence\n // formidable and the browser add a name property\n // fs- and request- streams have path property\n filename = path.basename(options.filename || value.name || value.path);\n } else if (value.readable && value.hasOwnProperty('httpVersion')) {\n // or try http response\n filename = path.basename(value.client._httpMessage.path || '');\n }\n\n if (filename) {\n contentDisposition = 'filename=\"' + filename + '\"';\n }\n\n return contentDisposition;\n};\n\nFormData.prototype._getContentType = function(value, options) {\n\n // use custom content-type above all\n var contentType = options.contentType;\n\n // or try `name` from formidable, browser\n if (!contentType && value.name) {\n contentType = mime.lookup(value.name);\n }\n\n // or try `path` from fs-, request- streams\n if (!contentType && value.path) {\n contentType = mime.lookup(value.path);\n }\n\n // or if it's http-reponse\n if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {\n contentType = value.headers['content-type'];\n }\n\n // or guess it from the filepath or filename\n if (!contentType && (options.filepath || options.filename)) {\n contentType = mime.lookup(options.filepath || options.filename);\n }\n\n // fallback to the default content type if `value` is not simple value\n if (!contentType && typeof value == 'object') {\n contentType = FormData.DEFAULT_CONTENT_TYPE;\n }\n\n return contentType;\n};\n\nFormData.prototype._multiPartFooter = function() {\n return function(next) {\n var footer = FormData.LINE_BREAK;\n\n var lastPart = (this._streams.length === 0);\n if (lastPart) {\n footer += this._lastBoundary();\n }\n\n next(footer);\n }.bind(this);\n};\n\nFormData.prototype._lastBoundary = function() {\n return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;\n};\n\nFormData.prototype.getHeaders = function(userHeaders) {\n var header;\n var formHeaders = {\n 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()\n };\n\n for (header in userHeaders) {\n if (userHeaders.hasOwnProperty(header)) {\n formHeaders[header.toLowerCase()] = userHeaders[header];\n }\n }\n\n return formHeaders;\n};\n\nFormData.prototype.setBoundary = function(boundary) {\n this._boundary = boundary;\n};\n\nFormData.prototype.getBoundary = function() {\n if (!this._boundary) {\n this._generateBoundary();\n }\n\n return this._boundary;\n};\n\nFormData.prototype.getBuffer = function() {\n var dataBuffer = new Buffer.alloc( 0 );\n var boundary = this.getBoundary();\n\n // Create the form content. Add Line breaks to the end of data.\n for (var i = 0, len = this._streams.length; i < len; i++) {\n if (typeof this._streams[i] !== 'function') {\n\n // Add content to the buffer.\n if(Buffer.isBuffer(this._streams[i])) {\n dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]);\n }else {\n dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]);\n }\n\n // Add break after content.\n if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) {\n dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] );\n }\n }\n }\n\n // Add the footer and return the Buffer object.\n return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] );\n};\n\nFormData.prototype._generateBoundary = function() {\n // This generates a 50 character boundary similar to those used by Firefox.\n // They are optimized for boyer-moore parsing.\n var boundary = '--------------------------';\n for (var i = 0; i < 24; i++) {\n boundary += Math.floor(Math.random() * 10).toString(16);\n }\n\n this._boundary = boundary;\n};\n\n// Note: getLengthSync DOESN'T calculate streams length\n// As workaround one can calculate file size manually\n// and add it as knownLength option\nFormData.prototype.getLengthSync = function() {\n var knownLength = this._overheadLength + this._valueLength;\n\n // Don't get confused, there are 3 \"internal\" streams for each keyval pair\n // so it basically checks if there is any value added to the form\n if (this._streams.length) {\n knownLength += this._lastBoundary().length;\n }\n\n // https://github.com/form-data/form-data/issues/40\n if (!this.hasKnownLength()) {\n // Some async length retrievers are present\n // therefore synchronous length calculation is false.\n // Please use getLength(callback) to get proper length\n this._error(new Error('Cannot calculate proper length in synchronous way.'));\n }\n\n return knownLength;\n};\n\n// Public API to check if length of added values is known\n// https://github.com/form-data/form-data/issues/196\n// https://github.com/form-data/form-data/issues/262\nFormData.prototype.hasKnownLength = function() {\n var hasKnownLength = true;\n\n if (this._valuesToMeasure.length) {\n hasKnownLength = false;\n }\n\n return hasKnownLength;\n};\n\nFormData.prototype.getLength = function(cb) {\n var knownLength = this._overheadLength + this._valueLength;\n\n if (this._streams.length) {\n knownLength += this._lastBoundary().length;\n }\n\n if (!this._valuesToMeasure.length) {\n process.nextTick(cb.bind(this, null, knownLength));\n return;\n }\n\n asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {\n if (err) {\n cb(err);\n return;\n }\n\n values.forEach(function(length) {\n knownLength += length;\n });\n\n cb(null, knownLength);\n });\n};\n\nFormData.prototype.submit = function(params, cb) {\n var request\n , options\n , defaults = {method: 'post'}\n ;\n\n // parse provided url if it's string\n // or treat it as options object\n if (typeof params == 'string') {\n\n params = parseUrl(params);\n options = populate({\n port: params.port,\n path: params.pathname,\n host: params.hostname,\n protocol: params.protocol\n }, defaults);\n\n // use custom params\n } else {\n\n options = populate(params, defaults);\n // if no port provided use default one\n if (!options.port) {\n options.port = options.protocol == 'https:' ? 443 : 80;\n }\n }\n\n // put that good code in getHeaders to some use\n options.headers = this.getHeaders(params.headers);\n\n // https if specified, fallback to http in any other case\n if (options.protocol == 'https:') {\n request = https.request(options);\n } else {\n request = http.request(options);\n }\n\n // get content length and fire away\n this.getLength(function(err, length) {\n if (err && err !== 'Unknown stream') {\n this._error(err);\n return;\n }\n\n // add content length\n if (length) {\n request.setHeader('Content-Length', length);\n }\n\n this.pipe(request);\n if (cb) {\n var onResponse;\n\n var callback = function (error, responce) {\n request.removeListener('error', callback);\n request.removeListener('response', onResponse);\n\n return cb.call(this, error, responce);\n };\n\n onResponse = callback.bind(this, null);\n\n request.on('error', callback);\n request.on('response', onResponse);\n }\n }.bind(this));\n\n return request;\n};\n\nFormData.prototype._error = function(err) {\n if (!this.error) {\n this.error = err;\n this.pause();\n this.emit('error', err);\n }\n};\n\nFormData.prototype.toString = function () {\n return '[object FormData]';\n};\n","// populates missing values\nmodule.exports = function(dst, src) {\n\n Object.keys(src).forEach(function(prop)\n {\n dst[prop] = dst[prop] || src[prop];\n });\n\n return dst;\n};\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst net_1 = __importDefault(require(\"net\"));\nconst tls_1 = __importDefault(require(\"tls\"));\nconst url_1 = __importDefault(require(\"url\"));\nconst assert_1 = __importDefault(require(\"assert\"));\nconst debug_1 = __importDefault(require(\"debug\"));\nconst agent_base_1 = require(\"agent-base\");\nconst parse_proxy_response_1 = __importDefault(require(\"./parse-proxy-response\"));\nconst debug = debug_1.default('https-proxy-agent:agent');\n/**\n * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to\n * the specified \"HTTP(s) proxy server\" in order to proxy HTTPS requests.\n *\n * Outgoing HTTP requests are first tunneled through the proxy server using the\n * `CONNECT` HTTP request method to establish a connection to the proxy server,\n * and then the proxy server connects to the destination target and issues the\n * HTTP request from the proxy server.\n *\n * `https:` requests have their socket connection upgraded to TLS once\n * the connection to the proxy server has been established.\n *\n * @api public\n */\nclass HttpsProxyAgent extends agent_base_1.Agent {\n constructor(_opts) {\n let opts;\n if (typeof _opts === 'string') {\n opts = url_1.default.parse(_opts);\n }\n else {\n opts = _opts;\n }\n if (!opts) {\n throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!');\n }\n debug('creating new HttpsProxyAgent instance: %o', opts);\n super(opts);\n const proxy = Object.assign({}, opts);\n // If `true`, then connect to the proxy server over TLS.\n // Defaults to `false`.\n this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol);\n // Prefer `hostname` over `host`, and set the `port` if needed.\n proxy.host = proxy.hostname || proxy.host;\n if (typeof proxy.port === 'string') {\n proxy.port = parseInt(proxy.port, 10);\n }\n if (!proxy.port && proxy.host) {\n proxy.port = this.secureProxy ? 443 : 80;\n }\n // ALPN is supported by Node.js >= v5.\n // attempt to negotiate http/1.1 for proxy servers that support http/2\n if (this.secureProxy && !('ALPNProtocols' in proxy)) {\n proxy.ALPNProtocols = ['http 1.1'];\n }\n if (proxy.host && proxy.path) {\n // If both a `host` and `path` are specified then it's most likely\n // the result of a `url.parse()` call... we need to remove the\n // `path` portion so that `net.connect()` doesn't attempt to open\n // that as a Unix socket file.\n delete proxy.path;\n delete proxy.pathname;\n }\n this.proxy = proxy;\n }\n /**\n * Called when the node-core HTTP client library is creating a\n * new HTTP request.\n *\n * @api protected\n */\n callback(req, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n const { proxy, secureProxy } = this;\n // Create a socket connection to the proxy server.\n let socket;\n if (secureProxy) {\n debug('Creating `tls.Socket`: %o', proxy);\n socket = tls_1.default.connect(proxy);\n }\n else {\n debug('Creating `net.Socket`: %o', proxy);\n socket = net_1.default.connect(proxy);\n }\n const headers = Object.assign({}, proxy.headers);\n const hostname = `${opts.host}:${opts.port}`;\n let payload = `CONNECT ${hostname} HTTP/1.1\\r\\n`;\n // Inject the `Proxy-Authorization` header if necessary.\n if (proxy.auth) {\n headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`;\n }\n // The `Host` header should only include the port\n // number when it is not the default port.\n let { host, port, secureEndpoint } = opts;\n if (!isDefaultPort(port, secureEndpoint)) {\n host += `:${port}`;\n }\n headers.Host = host;\n headers.Connection = 'close';\n for (const name of Object.keys(headers)) {\n payload += `${name}: ${headers[name]}\\r\\n`;\n }\n const proxyResponsePromise = parse_proxy_response_1.default(socket);\n socket.write(`${payload}\\r\\n`);\n const { statusCode, buffered } = yield proxyResponsePromise;\n if (statusCode === 200) {\n req.once('socket', resume);\n if (opts.secureEndpoint) {\n // The proxy is connecting to a TLS server, so upgrade\n // this socket connection to a TLS connection.\n debug('Upgrading socket connection to TLS');\n const servername = opts.servername || opts.host;\n return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,\n servername }));\n }\n return socket;\n }\n // Some other status code that's not 200... need to re-play the HTTP\n // header \"data\" events onto the socket once the HTTP machinery is\n // attached so that the node core `http` can parse and handle the\n // error status code.\n // Close the original socket, and a new \"fake\" socket is returned\n // instead, so that the proxy doesn't get the HTTP request\n // written to it (which may contain `Authorization` headers or other\n // sensitive data).\n //\n // See: https://hackerone.com/reports/541502\n socket.destroy();\n const fakeSocket = new net_1.default.Socket({ writable: false });\n fakeSocket.readable = true;\n // Need to wait for the \"socket\" event to re-play the \"data\" events.\n req.once('socket', (s) => {\n debug('replaying proxy buffer for failed request');\n assert_1.default(s.listenerCount('data') > 0);\n // Replay the \"buffered\" Buffer onto the fake `socket`, since at\n // this point the HTTP module machinery has been hooked up for\n // the user.\n s.push(buffered);\n s.push(null);\n });\n return fakeSocket;\n });\n }\n}\nexports.default = HttpsProxyAgent;\nfunction resume(socket) {\n socket.resume();\n}\nfunction isDefaultPort(port, secure) {\n return Boolean((!secure && port === 80) || (secure && port === 443));\n}\nfunction isHTTPS(protocol) {\n return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false;\n}\nfunction omit(obj, ...keys) {\n const ret = {};\n let key;\n for (key in obj) {\n if (!keys.includes(key)) {\n ret[key] = obj[key];\n }\n }\n return ret;\n}\n//# sourceMappingURL=agent.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nconst agent_1 = __importDefault(require(\"./agent\"));\nfunction createHttpsProxyAgent(opts) {\n return new agent_1.default(opts);\n}\n(function (createHttpsProxyAgent) {\n createHttpsProxyAgent.HttpsProxyAgent = agent_1.default;\n createHttpsProxyAgent.prototype = agent_1.default.prototype;\n})(createHttpsProxyAgent || (createHttpsProxyAgent = {}));\nmodule.exports = createHttpsProxyAgent;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst debug_1 = __importDefault(require(\"debug\"));\nconst debug = debug_1.default('https-proxy-agent:parse-proxy-response');\nfunction parseProxyResponse(socket) {\n return new Promise((resolve, reject) => {\n // we need to buffer any HTTP traffic that happens with the proxy before we get\n // the CONNECT response, so that if the response is anything other than an \"200\"\n // response code, then we can re-play the \"data\" events on the socket once the\n // HTTP parser is hooked up...\n let buffersLength = 0;\n const buffers = [];\n function read() {\n const b = socket.read();\n if (b)\n ondata(b);\n else\n socket.once('readable', read);\n }\n function cleanup() {\n socket.removeListener('end', onend);\n socket.removeListener('error', onerror);\n socket.removeListener('close', onclose);\n socket.removeListener('readable', read);\n }\n function onclose(err) {\n debug('onclose had error %o', err);\n }\n function onend() {\n debug('onend');\n }\n function onerror(err) {\n cleanup();\n debug('onerror %o', err);\n reject(err);\n }\n function ondata(b) {\n buffers.push(b);\n buffersLength += b.length;\n const buffered = Buffer.concat(buffers, buffersLength);\n const endOfHeaders = buffered.indexOf('\\r\\n\\r\\n');\n if (endOfHeaders === -1) {\n // keep buffering\n debug('have not received end of HTTP headers yet...');\n read();\n return;\n }\n const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\\r\\n'));\n const statusCode = +firstLine.split(' ')[1];\n debug('got proxy server response: %o', firstLine);\n resolve({\n statusCode,\n buffered\n });\n }\n socket.on('error', onerror);\n socket.on('close', onclose);\n socket.on('end', onend);\n read();\n });\n}\nexports.default = parseProxyResponse;\n//# sourceMappingURL=parse-proxy-response.js.map","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/*!\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObject(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nfunction isPlainObject(o) {\n var ctor,prot;\n\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n\nexports.isPlainObject = isPlainObject;\n","/*!\n * mime-db\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n/**\n * Module exports.\n */\n\nmodule.exports = require('./db.json')\n","/*!\n * mime-types\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar db = require('mime-db')\nvar extname = require('path').extname\n\n/**\n * Module variables.\n * @private\n */\n\nvar EXTRACT_TYPE_REGEXP = /^\\s*([^;\\s]*)(?:;|\\s|$)/\nvar TEXT_TYPE_REGEXP = /^text\\//i\n\n/**\n * Module exports.\n * @public\n */\n\nexports.charset = charset\nexports.charsets = { lookup: charset }\nexports.contentType = contentType\nexports.extension = extension\nexports.extensions = Object.create(null)\nexports.lookup = lookup\nexports.types = Object.create(null)\n\n// Populate the extensions/types maps\npopulateMaps(exports.extensions, exports.types)\n\n/**\n * Get the default charset for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction charset (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n var mime = match && db[match[1].toLowerCase()]\n\n if (mime && mime.charset) {\n return mime.charset\n }\n\n // default text/* to utf-8\n if (match && TEXT_TYPE_REGEXP.test(match[1])) {\n return 'UTF-8'\n }\n\n return false\n}\n\n/**\n * Create a full Content-Type header given a MIME type or extension.\n *\n * @param {string} str\n * @return {boolean|string}\n */\n\nfunction contentType (str) {\n // TODO: should this even be in this module?\n if (!str || typeof str !== 'string') {\n return false\n }\n\n var mime = str.indexOf('/') === -1\n ? exports.lookup(str)\n : str\n\n if (!mime) {\n return false\n }\n\n // TODO: use content-type or other module\n if (mime.indexOf('charset') === -1) {\n var charset = exports.charset(mime)\n if (charset) mime += '; charset=' + charset.toLowerCase()\n }\n\n return mime\n}\n\n/**\n * Get the default extension for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction extension (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n\n // get extensions\n var exts = match && exports.extensions[match[1].toLowerCase()]\n\n if (!exts || !exts.length) {\n return false\n }\n\n return exts[0]\n}\n\n/**\n * Lookup the MIME type for a file path/extension.\n *\n * @param {string} path\n * @return {boolean|string}\n */\n\nfunction lookup (path) {\n if (!path || typeof path !== 'string') {\n return false\n }\n\n // get the extension (\"ext\" or \".ext\" or full path)\n var extension = extname('x.' + path)\n .toLowerCase()\n .substr(1)\n\n if (!extension) {\n return false\n }\n\n return exports.types[extension] || false\n}\n\n/**\n * Populate the extensions and types maps.\n * @private\n */\n\nfunction populateMaps (extensions, types) {\n // source preference (least -> most)\n var preference = ['nginx', 'apache', undefined, 'iana']\n\n Object.keys(db).forEach(function forEachMimeType (type) {\n var mime = db[type]\n var exts = mime.extensions\n\n if (!exts || !exts.length) {\n return\n }\n\n // mime -> extensions\n extensions[type] = exts\n\n // extension -> mime\n for (var i = 0; i < exts.length; i++) {\n var extension = exts[i]\n\n if (types[extension]) {\n var from = preference.indexOf(db[types[extension]].source)\n var to = preference.indexOf(mime.source)\n\n if (types[extension] !== 'application/octet-stream' &&\n (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {\n // skip the remapping\n continue\n }\n }\n\n // set the extension -> mime\n types[extension] = type\n }\n })\n}\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar Stream = _interopDefault(require('stream'));\nvar http = _interopDefault(require('http'));\nvar Url = _interopDefault(require('url'));\nvar whatwgUrl = _interopDefault(require('whatwg-url'));\nvar https = _interopDefault(require('https'));\nvar zlib = _interopDefault(require('zlib'));\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\nconst URL = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\n/**\n * Wrapper around `new URL` to handle arbitrary URLs\n *\n * @param {string} urlStr\n * @return {void}\n */\nfunction parseURL(urlStr) {\n\t/*\n \tCheck whether the URL is absolute or not\n \t\tScheme: https://tools.ietf.org/html/rfc3986#section-3.1\n \tAbsolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\n */\n\tif (/^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.exec(urlStr)) {\n\t\turlStr = new URL(urlStr).toString();\n\t}\n\n\t// Fallback to old implementation for arbitrary URLs\n\treturn parse_url(urlStr);\n}\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parseURL(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parseURL(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parseURL(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\nconst URL$1 = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\n\nconst isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {\n\tconst orig = new URL$1(original).hostname;\n\tconst dest = new URL$1(destination).hostname;\n\n\treturn orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);\n};\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tlet locationURL = null;\n\t\t\t\ttry {\n\t\t\t\t\tlocationURL = location === null ? null : new URL$1(location, request.url).toString();\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// error here can only be invalid URL in Location: header\n\t\t\t\t\t// do not throw when options.redirect == manual\n\t\t\t\t\t// let the user extract the errorneous redirect URL\n\t\t\t\t\tif (request.redirect !== 'manual') {\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (!isDomainOrSubdomain(request.url, locationURL)) {\n\t\t\t\t\t\t\tfor (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {\n\t\t\t\t\t\t\t\trequestOpts.headers.delete(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nmodule.exports = exports = fetch;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = exports;\nexports.Headers = Headers;\nexports.Request = Request;\nexports.Response = Response;\nexports.FetchError = FetchError;\n","var wrappy = require('wrappy')\nmodule.exports = wrappy(once)\nmodule.exports.strict = wrappy(onceStrict)\n\nonce.proto = once(function () {\n Object.defineProperty(Function.prototype, 'once', {\n value: function () {\n return once(this)\n },\n configurable: true\n })\n\n Object.defineProperty(Function.prototype, 'onceStrict', {\n value: function () {\n return onceStrict(this)\n },\n configurable: true\n })\n})\n\nfunction once (fn) {\n var f = function () {\n if (f.called) return f.value\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n f.called = false\n return f\n}\n\nfunction onceStrict (fn) {\n var f = function () {\n if (f.called)\n throw new Error(f.onceError)\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n var name = fn.name || 'Function wrapped with `once`'\n f.onceError = name + \" shouldn't be called more than once\"\n f.called = false\n return f\n}\n","'use strict';\n\nvar parseUrl = require('url').parse;\n\nvar DEFAULT_PORTS = {\n ftp: 21,\n gopher: 70,\n http: 80,\n https: 443,\n ws: 80,\n wss: 443,\n};\n\nvar stringEndsWith = String.prototype.endsWith || function(s) {\n return s.length <= this.length &&\n this.indexOf(s, this.length - s.length) !== -1;\n};\n\n/**\n * @param {string|object} url - The URL, or the result from url.parse.\n * @return {string} The URL of the proxy that should handle the request to the\n * given URL. If no proxy is set, this will be an empty string.\n */\nfunction getProxyForUrl(url) {\n var parsedUrl = typeof url === 'string' ? parseUrl(url) : url || {};\n var proto = parsedUrl.protocol;\n var hostname = parsedUrl.host;\n var port = parsedUrl.port;\n if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') {\n return ''; // Don't proxy URLs without a valid scheme or host.\n }\n\n proto = proto.split(':', 1)[0];\n // Stripping ports in this way instead of using parsedUrl.hostname to make\n // sure that the brackets around IPv6 addresses are kept.\n hostname = hostname.replace(/:\\d*$/, '');\n port = parseInt(port) || DEFAULT_PORTS[proto] || 0;\n if (!shouldProxy(hostname, port)) {\n return ''; // Don't proxy URLs that match NO_PROXY.\n }\n\n var proxy =\n getEnv('npm_config_' + proto + '_proxy') ||\n getEnv(proto + '_proxy') ||\n getEnv('npm_config_proxy') ||\n getEnv('all_proxy');\n if (proxy && proxy.indexOf('://') === -1) {\n // Missing scheme in proxy, default to the requested URL's scheme.\n proxy = proto + '://' + proxy;\n }\n return proxy;\n}\n\n/**\n * Determines whether a given URL should be proxied.\n *\n * @param {string} hostname - The host name of the URL.\n * @param {number} port - The effective port of the URL.\n * @returns {boolean} Whether the given URL should be proxied.\n * @private\n */\nfunction shouldProxy(hostname, port) {\n var NO_PROXY =\n (getEnv('npm_config_no_proxy') || getEnv('no_proxy')).toLowerCase();\n if (!NO_PROXY) {\n return true; // Always proxy if NO_PROXY is not set.\n }\n if (NO_PROXY === '*') {\n return false; // Never proxy if wildcard is set.\n }\n\n return NO_PROXY.split(/[,\\s]/).every(function(proxy) {\n if (!proxy) {\n return true; // Skip zero-length hosts.\n }\n var parsedProxy = proxy.match(/^(.+):(\\d+)$/);\n var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;\n var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;\n if (parsedProxyPort && parsedProxyPort !== port) {\n return true; // Skip if ports don't match.\n }\n\n if (!/^[.*]/.test(parsedProxyHostname)) {\n // No wildcards, so stop proxying if there is an exact match.\n return hostname !== parsedProxyHostname;\n }\n\n if (parsedProxyHostname.charAt(0) === '*') {\n // Remove leading wildcard.\n parsedProxyHostname = parsedProxyHostname.slice(1);\n }\n // Stop proxying if the hostname ends with the no_proxy host.\n return !stringEndsWith.call(hostname, parsedProxyHostname);\n });\n}\n\n/**\n * Get the value for an environment variable.\n *\n * @param {string} key - The name of the environment variable.\n * @return {string} The value of the environment variable.\n * @private\n */\nfunction getEnv(key) {\n return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || '';\n}\n\nexports.getProxyForUrl = getProxyForUrl;\n","/* global window, exports, define */\n\n!function() {\n 'use strict'\n\n var re = {\n not_string: /[^s]/,\n not_bool: /[^t]/,\n not_type: /[^T]/,\n not_primitive: /[^v]/,\n number: /[diefg]/,\n numeric_arg: /[bcdiefguxX]/,\n json: /[j]/,\n not_json: /[^j]/,\n text: /^[^\\x25]+/,\n modulo: /^\\x25{2}/,\n placeholder: /^\\x25(?:([1-9]\\d*)\\$|\\(([^)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijostTuvxX])/,\n key: /^([a-z_][a-z_\\d]*)/i,\n key_access: /^\\.([a-z_][a-z_\\d]*)/i,\n index_access: /^\\[(\\d+)\\]/,\n sign: /^[+-]/\n }\n\n function sprintf(key) {\n // `arguments` is not an array, but should be fine for this call\n return sprintf_format(sprintf_parse(key), arguments)\n }\n\n function vsprintf(fmt, argv) {\n return sprintf.apply(null, [fmt].concat(argv || []))\n }\n\n function sprintf_format(parse_tree, argv) {\n var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign\n for (i = 0; i < tree_length; i++) {\n if (typeof parse_tree[i] === 'string') {\n output += parse_tree[i]\n }\n else if (typeof parse_tree[i] === 'object') {\n ph = parse_tree[i] // convenience purposes only\n if (ph.keys) { // keyword argument\n arg = argv[cursor]\n for (k = 0; k < ph.keys.length; k++) {\n if (arg == undefined) {\n throw new Error(sprintf('[sprintf] Cannot access property \"%s\" of undefined value \"%s\"', ph.keys[k], ph.keys[k-1]))\n }\n arg = arg[ph.keys[k]]\n }\n }\n else if (ph.param_no) { // positional argument (explicit)\n arg = argv[ph.param_no]\n }\n else { // positional argument (implicit)\n arg = argv[cursor++]\n }\n\n if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {\n arg = arg()\n }\n\n if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) {\n throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg))\n }\n\n if (re.number.test(ph.type)) {\n is_positive = arg >= 0\n }\n\n switch (ph.type) {\n case 'b':\n arg = parseInt(arg, 10).toString(2)\n break\n case 'c':\n arg = String.fromCharCode(parseInt(arg, 10))\n break\n case 'd':\n case 'i':\n arg = parseInt(arg, 10)\n break\n case 'j':\n arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0)\n break\n case 'e':\n arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential()\n break\n case 'f':\n arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg)\n break\n case 'g':\n arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg)\n break\n case 'o':\n arg = (parseInt(arg, 10) >>> 0).toString(8)\n break\n case 's':\n arg = String(arg)\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 't':\n arg = String(!!arg)\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'T':\n arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'u':\n arg = parseInt(arg, 10) >>> 0\n break\n case 'v':\n arg = arg.valueOf()\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'x':\n arg = (parseInt(arg, 10) >>> 0).toString(16)\n break\n case 'X':\n arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()\n break\n }\n if (re.json.test(ph.type)) {\n output += arg\n }\n else {\n if (re.number.test(ph.type) && (!is_positive || ph.sign)) {\n sign = is_positive ? '+' : '-'\n arg = arg.toString().replace(re.sign, '')\n }\n else {\n sign = ''\n }\n pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' '\n pad_length = ph.width - (sign + arg).length\n pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''\n output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)\n }\n }\n }\n return output\n }\n\n var sprintf_cache = Object.create(null)\n\n function sprintf_parse(fmt) {\n if (sprintf_cache[fmt]) {\n return sprintf_cache[fmt]\n }\n\n var _fmt = fmt, match, parse_tree = [], arg_names = 0\n while (_fmt) {\n if ((match = re.text.exec(_fmt)) !== null) {\n parse_tree.push(match[0])\n }\n else if ((match = re.modulo.exec(_fmt)) !== null) {\n parse_tree.push('%')\n }\n else if ((match = re.placeholder.exec(_fmt)) !== null) {\n if (match[2]) {\n arg_names |= 1\n var field_list = [], replacement_field = match[2], field_match = []\n if ((field_match = re.key.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\n if ((field_match = re.key_access.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n }\n else if ((field_match = re.index_access.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n }\n else {\n throw new SyntaxError('[sprintf] failed to parse named argument key')\n }\n }\n }\n else {\n throw new SyntaxError('[sprintf] failed to parse named argument key')\n }\n match[2] = field_list\n }\n else {\n arg_names |= 2\n }\n if (arg_names === 3) {\n throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')\n }\n\n parse_tree.push(\n {\n placeholder: match[0],\n param_no: match[1],\n keys: match[2],\n sign: match[3],\n pad_char: match[4],\n align: match[5],\n width: match[6],\n precision: match[7],\n type: match[8]\n }\n )\n }\n else {\n throw new SyntaxError('[sprintf] unexpected placeholder')\n }\n _fmt = _fmt.substring(match[0].length)\n }\n return sprintf_cache[fmt] = parse_tree\n }\n\n /**\n * export to either browser or node.js\n */\n /* eslint-disable quote-props */\n if (typeof exports !== 'undefined') {\n exports['sprintf'] = sprintf\n exports['vsprintf'] = vsprintf\n }\n if (typeof window !== 'undefined') {\n window['sprintf'] = sprintf\n window['vsprintf'] = vsprintf\n\n if (typeof define === 'function' && define['amd']) {\n define(function() {\n return {\n 'sprintf': sprintf,\n 'vsprintf': vsprintf\n }\n })\n }\n }\n /* eslint-enable quote-props */\n}(); // eslint-disable-line\n","'use strict';\n// @ts-check\n// ==================================================================================\n// audio.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 16. audio\n// ----------------------------------------------------------------------------------\n\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst util = require('./util');\n// const fs = require('fs');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nfunction parseAudioType(str, input, output) {\n let result = '';\n\n if (str.indexOf('speak') >= 0) { result = 'Speaker'; }\n if (str.indexOf('laut') >= 0) { result = 'Speaker'; }\n if (str.indexOf('loud') >= 0) { result = 'Speaker'; }\n if (str.indexOf('head') >= 0) { result = 'Headset'; }\n if (str.indexOf('mic') >= 0) { result = 'Microphone'; }\n if (str.indexOf('mikr') >= 0) { result = 'Microphone'; }\n if (str.indexOf('phone') >= 0) { result = 'Phone'; }\n if (str.indexOf('controll') >= 0) { result = 'Controller'; }\n if (str.indexOf('line o') >= 0) { result = 'Line Out'; }\n if (str.indexOf('digital o') >= 0) { result = 'Digital Out'; }\n\n if (!result && output) {\n result = 'Speaker';\n } else if (!result && input) {\n result = 'Microphone';\n }\n return result;\n}\n\n\nfunction getLinuxAudioPci() {\n let cmd = 'lspci -v 2>/dev/null';\n let result = [];\n try {\n const parts = execSync(cmd).toString().split('\\n\\n');\n for (let i = 0; i < parts.length; i++) {\n const lines = parts[i].split('\\n');\n if (lines && lines.length && lines[0].toLowerCase().indexOf('audio') >= 0) {\n const audio = {};\n audio.slotId = lines[0].split(' ')[0];\n audio.driver = util.getValue(lines, 'Kernel driver in use', ':', true) || util.getValue(lines, 'Kernel modules', ':', true);\n result.push(audio);\n }\n }\n return result;\n } catch (e) {\n return result;\n }\n}\n\nfunction parseLinuxAudioPciMM(lines, audioPCI) {\n const result = {};\n const slotId = util.getValue(lines, 'Slot');\n\n const pciMatch = audioPCI.filter(function (item) { return item.slotId === slotId; });\n\n result.id = slotId;\n result.name = util.getValue(lines, 'SDevice');\n // result.type = util.getValue(lines, 'Class');\n result.manufacturer = util.getValue(lines, 'SVendor');\n result.revision = util.getValue(lines, 'Rev');\n result.driver = pciMatch && pciMatch.length === 1 && pciMatch[0].driver ? pciMatch[0].driver : '';\n result.default = null;\n result.channel = 'PCIe';\n result.type = parseAudioType(result.name, null, null);\n result.in = null;\n result.out = null;\n result.status = 'online';\n\n return result;\n}\n\nfunction parseDarwinChannel(str) {\n let result = '';\n\n if (str.indexOf('builtin') >= 0) { result = 'Built-In'; }\n if (str.indexOf('extern') >= 0) { result = 'Audio-Jack'; }\n if (str.indexOf('hdmi') >= 0) { result = 'HDMI'; }\n if (str.indexOf('displayport') >= 0) { result = 'Display-Port'; }\n if (str.indexOf('usb') >= 0) { result = 'USB'; }\n if (str.indexOf('pci') >= 0) { result = 'PCIe'; }\n\n return result;\n}\n\nfunction parseDarwinAudio(audioObject, id) {\n const result = {};\n const channelStr = ((audioObject.coreaudio_device_transport || '') + ' ' + (audioObject._name || '')).toLowerCase();\n\n result.id = id;\n result.name = audioObject._name;\n result.manufacturer = audioObject.coreaudio_device_manufacturer;\n result.revision = null;\n result.driver = null;\n result.default = !!(audioObject.coreaudio_default_audio_input_device || '') || !!(audioObject.coreaudio_default_audio_output_device || '');\n result.channel = parseDarwinChannel(channelStr);\n result.type = parseAudioType(result.name, !!(audioObject.coreaudio_device_input || ''), !!(audioObject.coreaudio_device_output || ''));\n result.in = !!(audioObject.coreaudio_device_input || '');\n result.out = !!(audioObject.coreaudio_device_output || '');\n result.status = 'online';\n\n return result;\n}\n\nfunction parseWindowsAudio(lines) {\n const result = {};\n const status = util.getValue(lines, 'StatusInfo', ':');\n // const description = util.getValue(lines, 'Description', ':');\n\n result.id = util.getValue(lines, 'DeviceID', ':'); // PNPDeviceID??\n result.name = util.getValue(lines, 'name', ':');\n result.manufacturer = util.getValue(lines, 'manufacturer', ':');\n result.revision = null;\n result.driver = null;\n result.default = null;\n result.channel = null;\n result.type = parseAudioType(result.name, null, null);\n result.in = null;\n result.out = null;\n result.status = status;\n\n return result;\n}\n\nfunction audio(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = [];\n if (_linux || _freebsd || _openbsd || _netbsd) {\n let cmd = 'lspci -vmm 2>/dev/null';\n exec(cmd, function (error, stdout) {\n // PCI\n if (!error) {\n const audioPCI = getLinuxAudioPci();\n const parts = stdout.toString().split('\\n\\n');\n for (let i = 0; i < parts.length; i++) {\n const lines = parts[i].split('\\n');\n if (util.getValue(lines, 'class', ':', true).toLowerCase().indexOf('audio') >= 0) {\n const audio = parseLinuxAudioPciMM(lines, audioPCI);\n result.push(audio);\n }\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_darwin) {\n let cmd = 'system_profiler SPAudioDataType -json';\n exec(cmd, function (error, stdout) {\n if (!error) {\n try {\n const outObj = JSON.parse(stdout.toString());\n if (outObj.SPAudioDataType && outObj.SPAudioDataType.length && outObj.SPAudioDataType[0] && outObj.SPAudioDataType[0]['_items'] && outObj.SPAudioDataType[0]['_items'].length) {\n for (let i = 0; i < outObj.SPAudioDataType[0]['_items'].length; i++) {\n const audio = parseDarwinAudio(outObj.SPAudioDataType[0]['_items'][i], i);\n result.push(audio);\n }\n }\n } catch (e) {\n util.noop();\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_windows) {\n util.powerShell('Get-WmiObject Win32_SoundDevice | select DeviceID,StatusInfo,Name,Manufacturer | fl').then((stdout, error) => {\n if (!error) {\n const parts = stdout.toString().split(/\\n\\s*\\n/);\n for (let i = 0; i < parts.length; i++) {\n if (util.getValue(parts[i].split('\\n'), 'name', ':')) {\n result.push(parseWindowsAudio(parts[i].split('\\n')));\n }\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_sunos) {\n resolve(null);\n }\n });\n });\n}\n\nexports.audio = audio;\n","'use strict';\n// @ts-check;\n// ==================================================================================\n// battery.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 6. Battery\n// ----------------------------------------------------------------------------------\n\nconst exec = require('child_process').exec;\nconst fs = require('fs');\nconst util = require('./util');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nfunction parseWinBatteryPart(lines, designedCapacity, fullChargeCapacity) {\n const result = {};\n let status = util.getValue(lines, 'BatteryStatus', ':').trim();\n // 1 = \"Discharging\"\n // 2 = \"On A/C\"\n // 3 = \"Fully Charged\"\n // 4 = \"Low\"\n // 5 = \"Critical\"\n // 6 = \"Charging\"\n // 7 = \"Charging High\"\n // 8 = \"Charging Low\"\n // 9 = \"Charging Critical\"\n // 10 = \"Undefined\"\n // 11 = \"Partially Charged\"\n if (status >= 0) {\n const statusValue = status ? parseInt(status) : 0;\n result.status = statusValue;\n result.hasBattery = true;\n result.maxCapacity = fullChargeCapacity || parseInt(util.getValue(lines, 'DesignCapacity', ':') || 0);\n result.designedCapacity = parseInt(util.getValue(lines, 'DesignCapacity', ':') || designedCapacity);\n result.voltage = parseInt(util.getValue(lines, 'DesignVoltage', ':') || 0) / 1000.0;\n result.capacityUnit = 'mWh';\n result.percent = parseInt(util.getValue(lines, 'EstimatedChargeRemaining', ':') || 0);\n result.currentCapacity = parseInt(result.maxCapacity * result.percent / 100);\n result.isCharging = (statusValue >= 6 && statusValue <= 9) || statusValue === 11 || (!(statusValue === 3) && !(statusValue === 1) && result.percent < 100);\n result.acConnected = result.isCharging || statusValue === 2;\n result.model = util.getValue(lines, 'DeviceID', ':');\n } else {\n result.status = -1;\n }\n\n return result;\n}\n\nmodule.exports = function (callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = {\n hasBattery: false,\n cycleCount: 0,\n isCharging: false,\n designedCapacity: 0,\n maxCapacity: 0,\n currentCapacity: 0,\n voltage: 0,\n capacityUnit: '',\n percent: 0,\n timeRemaining: null,\n acConnected: true,\n type: '',\n model: '',\n manufacturer: '',\n serial: ''\n };\n\n if (_linux) {\n let battery_path = '';\n if (fs.existsSync('/sys/class/power_supply/BAT1/uevent')) {\n battery_path = '/sys/class/power_supply/BAT1/';\n } else if (fs.existsSync('/sys/class/power_supply/BAT0/uevent')) {\n battery_path = '/sys/class/power_supply/BAT0/';\n }\n\n let acConnected = false;\n let acPath = '';\n if (fs.existsSync('/sys/class/power_supply/AC/online')) {\n acPath = '/sys/class/power_supply/AC/online';\n } else if (fs.existsSync('/sys/class/power_supply/AC0/online')) {\n acPath = '/sys/class/power_supply/AC0/online';\n }\n\n if (acPath) {\n const file = fs.readFileSync(acPath);\n acConnected = file.toString().trim() === '1';\n }\n\n if (battery_path) {\n fs.readFile(battery_path + 'uevent', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n\n result.isCharging = (util.getValue(lines, 'POWER_SUPPLY_STATUS', '=').toLowerCase() === 'charging');\n result.acConnected = acConnected || result.isCharging;\n result.voltage = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_VOLTAGE_NOW', '='), 10) / 1000000.0;\n result.capacityUnit = result.voltage ? 'mWh' : 'mAh';\n result.cycleCount = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CYCLE_COUNT', '='), 10);\n result.maxCapacity = Math.round(parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CHARGE_FULL', '=', true, true), 10) / 1000.0 * (result.voltage || 1));\n const desingedMinVoltage = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_VOLTAGE_MIN_DESIGN', '='), 10) / 1000000.0;\n result.designedCapacity = Math.round(parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CHARGE_FULL_DESIGN', '=', true, true), 10) / 1000.0 * (desingedMinVoltage || result.voltage || 1));\n result.currentCapacity = Math.round(parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CHARGE_NOW', '='), 10) / 1000.0 * (result.voltage || 1));\n if (!result.maxCapacity) {\n result.maxCapacity = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_FULL', '=', true, true), 10) / 1000.0;\n result.designedCapacity = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_FULL_DESIGN', '=', true, true), 10) / 1000.0 | result.maxCapacity;\n result.currentCapacity = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_NOW', '='), 10) / 1000.0;\n }\n const percent = util.getValue(lines, 'POWER_SUPPLY_CAPACITY', '=');\n const energy = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_NOW', '='), 10);\n const power = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_POWER_NOW', '='), 10);\n const current = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CURRENT_NOW', '='), 10);\n\n result.percent = parseInt('0' + percent, 10);\n if (result.maxCapacity && result.currentCapacity) {\n result.hasBattery = true;\n if (!percent) {\n result.percent = 100.0 * result.currentCapacity / result.maxCapacity;\n }\n }\n if (result.isCharging) {\n result.hasBattery = true;\n }\n if (energy && power) {\n result.timeRemaining = Math.floor(energy / power * 60);\n } else if (current && result.currentCapacity) {\n result.timeRemaining = Math.floor(result.currentCapacity / current * 60);\n }\n result.type = util.getValue(lines, 'POWER_SUPPLY_TECHNOLOGY', '=');\n result.model = util.getValue(lines, 'POWER_SUPPLY_MODEL_NAME', '=');\n result.manufacturer = util.getValue(lines, 'POWER_SUPPLY_MANUFACTURER', '=');\n result.serial = util.getValue(lines, 'POWER_SUPPLY_SERIAL_NUMBER', '=');\n if (callback) { callback(result); }\n resolve(result);\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n exec('sysctl -i hw.acpi.battery hw.acpi.acline', function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n const batteries = parseInt('0' + util.getValue(lines, 'hw.acpi.battery.units'), 10);\n const percent = parseInt('0' + util.getValue(lines, 'hw.acpi.battery.life'), 10);\n result.hasBattery = (batteries > 0);\n result.cycleCount = null;\n result.isCharging = util.getValue(lines, 'hw.acpi.acline') !== '1';\n result.acConnected = result.isCharging;\n result.maxCapacity = null;\n result.currentCapacity = null;\n result.capacityUnit = 'unknown';\n result.percent = batteries ? percent : null;\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n\n if (_darwin) {\n exec('ioreg -n AppleSmartBattery -r | egrep \"CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|BatterySerialNumber|TimeRemaining|Voltage\"; pmset -g batt | grep %', function (error, stdout) {\n if (stdout) {\n let lines = stdout.toString().replace(/ +/g, '').replace(/\"+/g, '').replace(/-/g, '').split('\\n');\n result.cycleCount = parseInt('0' + util.getValue(lines, 'cyclecount', '='), 10);\n result.voltage = parseInt('0' + util.getValue(lines, 'voltage', '='), 10) / 1000.0;\n result.capacityUnit = result.voltage ? 'mWh' : 'mAh';\n result.maxCapacity = Math.round(parseInt('0' + util.getValue(lines, 'applerawmaxcapacity', '='), 10) * (result.voltage || 1));\n result.currentCapacity = Math.round(parseInt('0' + util.getValue(lines, 'applerawcurrentcapacity', '='), 10) * (result.voltage || 1));\n result.designedCapacity = Math.round(parseInt('0' + util.getValue(lines, 'DesignCapacity', '='), 10) * (result.voltage || 1));\n result.manufacturer = 'Apple';\n result.serial = util.getValue(lines, 'BatterySerialNumber', '=');\n let percent = null;\n const line = util.getValue(lines, 'internal', 'Battery');\n let parts = line.split(';');\n if (parts && parts[0]) {\n let parts2 = parts[0].split('\\t');\n if (parts2 && parts2[1]) {\n percent = parseFloat(parts2[1].trim().replace(/%/g, ''));\n }\n }\n if (parts && parts[1]) {\n result.isCharging = (parts[1].trim() === 'charging');\n result.acConnected = (parts[1].trim() !== 'discharging');\n } else {\n result.isCharging = util.getValue(lines, 'ischarging', '=').toLowerCase() === 'yes';\n result.acConnected = result.isCharging;\n }\n if (result.maxCapacity && result.currentCapacity) {\n result.hasBattery = true;\n result.type = 'Li-ion';\n result.percent = percent !== null ? percent : Math.round(100.0 * result.currentCapacity / result.maxCapacity);\n if (!result.isCharging) {\n result.timeRemaining = parseInt('0' + util.getValue(lines, 'TimeRemaining', '='), 10);\n }\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n try {\n const workload = [];\n workload.push(util.powerShell('Get-WmiObject Win32_Battery | select BatteryStatus, DesignCapacity, DesignVoltage, EstimatedChargeRemaining, DeviceID | fl'));\n workload.push(util.powerShell('(Get-WmiObject -Class BatteryStaticData -Namespace ROOT/WMI).DesignedCapacity'));\n workload.push(util.powerShell('(Get-WmiObject -Class BatteryFullChargedCapacity -Namespace ROOT/WMI).FullChargedCapacity'));\n util.promiseAll(\n workload\n ).then(data => {\n if (data) {\n // let parts = data.results[0].split(/\\n\\s*\\n/);\n let parts = data.results[0].split(/\\n\\s*\\n/);\n let batteries = [];\n const hasValue = value => /\\S/.test(value);\n for (let i = 0; i < parts.length; i++) {\n if (hasValue(parts[i]) && (!batteries.length || !hasValue(parts[i - 1]))) {\n batteries.push([]);\n }\n if (hasValue(parts[i])) {\n batteries[batteries.length - 1].push(parts[i]);\n }\n }\n let designCapacities = data.results[1].split('\\r\\n').filter(e => e);\n let fullChargeCapacities = data.results[2].split('\\r\\n').filter(e => e);\n if (batteries.length) {\n let first = false;\n let additionalBatteries = [];\n for (let i = 0; i < batteries.length; i++) {\n let lines = batteries[i][0].split('\\r\\n');\n const designedCapacity = designCapacities && designCapacities.length >= (i + 1) && designCapacities[i] ? util.toInt(designCapacities[i]) : 0;\n const fullChargeCapacity = fullChargeCapacities && fullChargeCapacities.length >= (i + 1) && fullChargeCapacities[i] ? util.toInt(fullChargeCapacities[i]) : 0;\n const parsed = parseWinBatteryPart(lines, designedCapacity, fullChargeCapacity);\n if (!first && parsed.status > 0 && parsed.status !== 10) {\n result.hasBattery = parsed.hasBattery;\n result.maxCapacity = parsed.maxCapacity;\n result.designedCapacity = parsed.designedCapacity;\n result.voltage = parsed.voltage;\n result.capacityUnit = parsed.capacityUnit;\n result.percent = parsed.percent;\n result.currentCapacity = parsed.currentCapacity;\n result.isCharging = parsed.isCharging;\n result.acConnected = parsed.acConnected;\n result.model = parsed.model;\n first = true;\n } else if (parsed.status !== -1) {\n additionalBatteries.push(\n {\n hasBattery: parsed.hasBattery,\n maxCapacity: parsed.maxCapacity,\n designedCapacity: parsed.designedCapacity,\n voltage: parsed.voltage,\n capacityUnit: parsed.capacityUnit,\n percent: parsed.percent,\n currentCapacity: parsed.currentCapacity,\n isCharging: parsed.isCharging,\n timeRemaining: null,\n acConnected: parsed.acConnected,\n model: parsed.model,\n type: '',\n manufacturer: '',\n serial: ''\n }\n );\n }\n }\n if (!first && additionalBatteries.length) {\n result = additionalBatteries[0];\n additionalBatteries.shift();\n }\n if (additionalBatteries.length) {\n result.additionalBatteries = additionalBatteries;\n }\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n};\n","'use strict';\n// @ts-check\n// ==================================================================================\n// audio.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 17. bluetooth\n// ----------------------------------------------------------------------------------\n\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst path = require('path');\nconst util = require('./util');\nconst fs = require('fs');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nfunction parseBluetoothType(str) {\n let result = '';\n\n if (str.indexOf('keyboard') >= 0) { result = 'Keyboard'; }\n if (str.indexOf('mouse') >= 0) { result = 'Mouse'; }\n if (str.indexOf('speaker') >= 0) { result = 'Speaker'; }\n if (str.indexOf('headset') >= 0) { result = 'Headset'; }\n if (str.indexOf('phone') >= 0) { result = 'Phone'; }\n // to be continued ...\n\n return result;\n}\n\nfunction parseLinuxBluetoothInfo(lines, macAddr1, macAddr2) {\n const result = {};\n\n result.device = null;\n result.name = util.getValue(lines, 'name', '=');\n result.manufacturer = null;\n result.macDevice = macAddr1;\n result.macHost = macAddr2;\n result.batteryPercent = null;\n result.type = parseBluetoothType(result.name.toLowerCase());\n result.connected = false;\n\n return result;\n}\n\nfunction parseDarwinBluetoothDevices(bluetoothObject, macAddr2) {\n const result = {};\n const typeStr = ((bluetoothObject.device_minorClassOfDevice_string || bluetoothObject.device_majorClassOfDevice_string || '') + (bluetoothObject.device_name || '')).toLowerCase();\n\n result.device = bluetoothObject.device_services || '';\n result.name = bluetoothObject.device_name || '';\n result.manufacturer = bluetoothObject.device_manufacturer || '';\n result.macDevice = (bluetoothObject.device_addr || '').toLowerCase().replace(/-/g, ':');\n result.macHost = macAddr2;\n result.batteryPercent = bluetoothObject.device_batteryPercent || null;\n result.type = parseBluetoothType(typeStr);\n result.connected = bluetoothObject.device_isconnected === 'attrib_Yes' || false;\n\n return result;\n}\n\nfunction parseWindowsBluetooth(lines) {\n const result = {};\n\n result.device = null;\n result.name = util.getValue(lines, 'name', ':');\n result.manufacturer = util.getValue(lines, 'manufacturer', ':');\n result.macDevice = null;\n result.macHost = null;\n result.batteryPercent = null;\n result.type = parseBluetoothType(result.name.toLowerCase());\n result.connected = null;\n\n return result;\n}\n\nfunction bluetoothDevices(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = [];\n if (_linux) {\n // get files in /var/lib/bluetooth/ recursive\n const btFiles = util.getFilesInPath('/var/lib/bluetooth/');\n for (let i = 0; i < btFiles.length; i++) {\n const filename = path.basename(btFiles[i]);\n const pathParts = btFiles[i].split('/');\n const macAddr1 = pathParts.length >= 6 ? pathParts[pathParts.length - 2] : null;\n const macAddr2 = pathParts.length >= 7 ? pathParts[pathParts.length - 3] : null;\n if (filename === 'info') {\n const infoFile = fs.readFileSync(btFiles[i], { encoding: 'utf8' }).split('\\n');\n result.push(parseLinuxBluetoothInfo(infoFile, macAddr1, macAddr2));\n }\n }\n // determine \"connected\" with hcitool con\n try {\n const hdicon = execSync('hcitool con').toString().toLowerCase();\n for (let i = 0; i < result.length; i++) {\n if (result[i].macDevice && result[i].macDevice.length > 10 && hdicon.indexOf(result[i].macDevice.toLowerCase()) >= 0) {\n result[i].connected = true;\n }\n }\n } catch (e) {\n util.noop();\n }\n\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n if (_darwin) {\n let cmd = 'system_profiler SPBluetoothDataType -json';\n exec(cmd, function (error, stdout) {\n if (!error) {\n try {\n const outObj = JSON.parse(stdout.toString());\n if (outObj.SPBluetoothDataType && outObj.SPBluetoothDataType.length && outObj.SPBluetoothDataType[0] && outObj.SPBluetoothDataType[0]['device_title'] && outObj.SPBluetoothDataType[0]['device_title'].length) {\n // missing: host BT Adapter macAddr ()\n let macAddr2 = null;\n if (outObj.SPBluetoothDataType[0]['local_device_title'] && outObj.SPBluetoothDataType[0].local_device_title.general_address) {\n macAddr2 = outObj.SPBluetoothDataType[0].local_device_title.general_address.toLowerCase().replace(/-/g, ':');\n }\n\n for (let i = 0; i < outObj.SPBluetoothDataType[0]['device_title'].length; i++) {\n const obj = outObj.SPBluetoothDataType[0]['device_title'][i];\n const objKey = Object.keys(obj);\n if (objKey && objKey.length === 1) {\n const innerObject = obj[objKey[0]];\n innerObject.device_name = objKey[0];\n const bluetoothDevice = parseDarwinBluetoothDevices(innerObject, macAddr2);\n result.push(bluetoothDevice);\n }\n }\n }\n } catch (e) {\n util.noop();\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_windows) {\n util.powerShell('Get-WmiObject Win32_PNPEntity | select PNPClass, Name, Manufacturer | fl').then((stdout, error) => {\n if (!error) {\n const parts = stdout.toString().split(/\\n\\s*\\n/);\n for (let i = 0; i < parts.length; i++) {\n if (util.getValue(parts[i].split('\\n'), 'PNPClass', ':') === 'Bluetooth') {\n result.push(parseWindowsBluetooth(parts[i].split('\\n')));\n }\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_freebsd || _netbsd || _openbsd || _sunos) {\n resolve(null);\n }\n });\n });\n}\n\nexports.bluetoothDevices = bluetoothDevices;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// cpu.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 4. CPU\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst fs = require('fs');\nconst util = require('./util');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nlet _cpu_speed = 0;\nlet _current_cpu = {\n user: 0,\n nice: 0,\n system: 0,\n idle: 0,\n irq: 0,\n load: 0,\n tick: 0,\n ms: 0,\n currentLoad: 0,\n currentLoadUser: 0,\n currentLoadSystem: 0,\n currentLoadNice: 0,\n currentLoadIdle: 0,\n currentLoadIrq: 0,\n rawCurrentLoad: 0,\n rawCurrentLoadUser: 0,\n rawCurrentLoadSystem: 0,\n rawCurrentLoadNice: 0,\n rawCurrentLoadIdle: 0,\n rawCurrentLoadIrq: 0\n};\nlet _cpus = [];\nlet _corecount = 0;\n\nconst AMDBaseFrequencies = {\n '8346': '1.8',\n '8347': '1.9',\n '8350': '2.0',\n '8354': '2.2',\n '8356|SE': '2.4',\n '8356': '2.3',\n '8360': '2.5',\n '2372': '2.1',\n '2373': '2.1',\n '2374': '2.2',\n '2376': '2.3',\n '2377': '2.3',\n '2378': '2.4',\n '2379': '2.4',\n '2380': '2.5',\n '2381': '2.5',\n '2382': '2.6',\n '2384': '2.7',\n '2386': '2.8',\n '2387': '2.8',\n '2389': '2.9',\n '2393': '3.1',\n '8374': '2.2',\n '8376': '2.3',\n '8378': '2.4',\n '8379': '2.4',\n '8380': '2.5',\n '8381': '2.5',\n '8382': '2.6',\n '8384': '2.7',\n '8386': '2.8',\n '8387': '2.8',\n '8389': '2.9',\n '8393': '3.1',\n '2419EE': '1.8',\n '2423HE': '2.0',\n '2425HE': '2.1',\n '2427': '2.2',\n '2431': '2.4',\n '2435': '2.6',\n '2439SE': '2.8',\n '8425HE': '2.1',\n '8431': '2.4',\n '8435': '2.6',\n '8439SE': '2.8',\n '4122': '2.2',\n '4130': '2.6',\n '4162EE': '1.7',\n '4164EE': '1.8',\n '4170HE': '2.1',\n '4174HE': '2.3',\n '4176HE': '2.4',\n '4180': '2.6',\n '4184': '2.8',\n '6124HE': '1.8',\n '6128HE': '2.0',\n '6132HE': '2.2',\n '6128': '2.0',\n '6134': '2.3',\n '6136': '2.4',\n '6140': '2.6',\n '6164HE': '1.7',\n '6166HE': '1.8',\n '6168': '1.9',\n '6172': '2.1',\n '6174': '2.2',\n '6176': '2.3',\n '6176SE': '2.3',\n '6180SE': '2.5',\n '3250': '2.5',\n '3260': '2.7',\n '3280': '2.4',\n '4226': '2.7',\n '4228': '2.8',\n '4230': '2.9',\n '4234': '3.1',\n '4238': '3.3',\n '4240': '3.4',\n '4256': '1.6',\n '4274': '2.5',\n '4276': '2.6',\n '4280': '2.8',\n '4284': '3.0',\n '6204': '3.3',\n '6212': '2.6',\n '6220': '3.0',\n '6234': '2.4',\n '6238': '2.6',\n '6262HE': '1.6',\n '6272': '2.1',\n '6274': '2.2',\n '6276': '2.3',\n '6278': '2.4',\n '6282SE': '2.6',\n '6284SE': '2.7',\n '6308': '3.5',\n '6320': '2.8',\n '6328': '3.2',\n '6338P': '2.3',\n '6344': '2.6',\n '6348': '2.8',\n '6366': '1.8',\n '6370P': '2.0',\n '6376': '2.3',\n '6378': '2.4',\n '6380': '2.5',\n '6386': '2.8',\n 'FX|4100': '3.6',\n 'FX|4120': '3.9',\n 'FX|4130': '3.8',\n 'FX|4150': '3.8',\n 'FX|4170': '4.2',\n 'FX|6100': '3.3',\n 'FX|6120': '3.6',\n 'FX|6130': '3.6',\n 'FX|6200': '3.8',\n 'FX|8100': '2.8',\n 'FX|8120': '3.1',\n 'FX|8140': '3.2',\n 'FX|8150': '3.6',\n 'FX|8170': '3.9',\n 'FX|4300': '3.8',\n 'FX|4320': '4.0',\n 'FX|4350': '4.2',\n 'FX|6300': '3.5',\n 'FX|6350': '3.9',\n 'FX|8300': '3.3',\n 'FX|8310': '3.4',\n 'FX|8320': '3.5',\n 'FX|8350': '4.0',\n 'FX|8370': '4.0',\n 'FX|9370': '4.4',\n 'FX|9590': '4.7',\n 'FX|8320E': '3.2',\n 'FX|8370E': '3.3',\n\n // ZEN Desktop CPUs\n '1200': '3.1',\n 'Pro 1200': '3.1',\n '1300X': '3.5',\n 'Pro 1300': '3.5',\n '1400': '3.2',\n '1500X': '3.5',\n 'Pro 1500': '3.5',\n '1600': '3.2',\n '1600X': '3.6',\n 'Pro 1600': '3.2',\n '1700': '3.0',\n 'Pro 1700': '3.0',\n '1700X': '3.4',\n 'Pro 1700X': '3.4',\n '1800X': '3.6',\n '1900X': '3.8',\n '1920': '3.2',\n '1920X': '3.5',\n '1950X': '3.4',\n\n // ZEN Desktop APUs\n '200GE': '3.2',\n 'Pro 200GE': '3.2',\n '220GE': '3.4',\n '240GE': '3.5',\n '3000G': '3.5',\n '300GE': '3.4',\n '3050GE': '3.4',\n '2200G': '3.5',\n 'Pro 2200G': '3.5',\n '2200GE': '3.2',\n 'Pro 2200GE': '3.2',\n '2400G': '3.6',\n 'Pro 2400G': '3.6',\n '2400GE': '3.2',\n 'Pro 2400GE': '3.2',\n\n // ZEN Mobile APUs\n 'Pro 200U': '2.3',\n '300U': '2.4',\n '2200U': '2.5',\n '3200U': '2.6',\n '2300U': '2.0',\n 'Pro 2300U': '2.0',\n '2500U': '2.0',\n 'Pro 2500U': '2.2',\n '2600H': '3.2',\n '2700U': '2.0',\n 'Pro 2700U': '2.2',\n '2800H': '3.3',\n\n // ZEN Server Processors\n '7351': '2.4',\n '7351P': '2.4',\n '7401': '2.0',\n '7401P': '2.0',\n '7551P': '2.0',\n '7551': '2.0',\n '7251': '2.1',\n '7261': '2.5',\n '7281': '2.1',\n '7301': '2.2',\n '7371': '3.1',\n '7451': '2.3',\n '7501': '2.0',\n '7571': '2.2',\n '7601': '2.2',\n\n // ZEN Embedded Processors\n 'V1500B': '2.2',\n 'V1780B': '3.35',\n 'V1202B': '2.3',\n 'V1404I': '2.0',\n 'V1605B': '2.0',\n 'V1756B': '3.25',\n 'V1807B': '3.35',\n\n '3101': '2.1',\n '3151': '2.7',\n '3201': '1.5',\n '3251': '2.5',\n '3255': '2.5',\n '3301': '2.0',\n '3351': '1.9',\n '3401': '1.85',\n '3451': '2.15',\n\n // ZEN+ Desktop\n '1200|AF': '3.1',\n '2300X': '3.5',\n '2500X': '3.6',\n '2600': '3.4',\n '2600E': '3.1',\n '1600|AF': '3.2',\n '2600X': '3.6',\n '2700': '3.2',\n '2700E': '2.8',\n 'Pro 2700': '3.2',\n '2700X': '3.7',\n 'Pro 2700X': '3.6',\n '2920X': '3.5',\n '2950X': '3.5',\n '2970WX': '3.0',\n '2990WX': '3.0',\n\n // ZEN+ Desktop APU\n 'Pro 300GE': '3.4',\n 'Pro 3125GE': '3.4',\n '3150G': '3.5',\n 'Pro 3150G': '3.5',\n '3150GE': '3.3',\n 'Pro 3150GE': '3.3',\n '3200G': '3.6',\n 'Pro 3200G': '3.6',\n '3200GE': '3.3',\n 'Pro 3200GE': '3.3',\n '3350G': '3.6',\n 'Pro 3350G': '3.6',\n '3350GE': '3.3',\n 'Pro 3350GE': '3.3',\n '3400G': '3.7',\n 'Pro 3400G': '3.7',\n '3400GE': '3.3',\n 'Pro 3400GE': '3.3',\n\n // ZEN+ Mobile\n '3300U': '2.1',\n 'PRO 3300U': '2.1',\n '3450U': '2.1',\n '3500U': '2.1',\n 'PRO 3500U': '2.1',\n '3500C': '2.1',\n '3550H': '2.1',\n '3580U': '2.1',\n '3700U': '2.3',\n 'PRO 3700U': '2.3',\n '3700C': '2.3',\n '3750H': '2.3',\n '3780U': '2.3',\n\n // ZEN2 Desktop CPUS\n '3100': '3.6',\n '3300X': '3.8',\n '3500': '3.6',\n '3500X': '3.6',\n '3600': '3.6',\n 'Pro 3600': '3.6',\n '3600X': '3.8',\n '3600XT': '3.8',\n 'Pro 3700': '3.6',\n '3700X': '3.6',\n '3800X': '3.9',\n '3800XT': '3.9',\n '3900': '3.1',\n 'Pro 3900': '3.1',\n '3900X': '3.8',\n '3900XT': '3.8',\n '3950X': '3.5',\n '3960X': '3.8',\n '3970X': '3.7',\n '3990X': '2.9',\n '3945WX': '4.0',\n '3955WX': '3.9',\n '3975WX': '3.5',\n '3995WX': '2.7',\n\n // ZEN2 Desktop APUs\n '4300GE': '3.5',\n 'Pro 4300GE': '3.5',\n '4300G': '3.8',\n 'Pro 4300G': '3.8',\n '4600GE': '3.3',\n 'Pro 4650GE': '3.3',\n '4600G': '3.7',\n 'Pro 4650G': '3.7',\n '4700GE': '3.1',\n 'Pro 4750GE': '3.1',\n '4700G': '3.6',\n 'Pro 4750G': '3.6',\n '4300U': '2.7',\n '4450U': '2.5',\n 'Pro 4450U': '2.5',\n '4500U': '2.3',\n '4600U': '2.1',\n 'PRO 4650U': '2.1',\n '4680U': '2.1',\n '4600HS': '3.0',\n '4600H': '3.0',\n '4700U': '2.0',\n 'PRO 4750U': '1.7',\n '4800U': '1.8',\n '4800HS': '2.9',\n '4800H': '2.9',\n '4900HS': '3.0',\n '4900H': '3.3',\n '5300U': '2.6',\n '5500U': '2.1',\n '5700U': '1.8',\n\n // ZEN2 - EPYC\n '7232P': '3.1',\n '7302P': '3.0',\n '7402P': '2.8',\n '7502P': '2.5',\n '7702P': '2.0',\n '7252': '3.1',\n '7262': '3.2',\n '7272': '2.9',\n '7282': '2.8',\n '7302': '3.0',\n '7352': '2.3',\n '7402': '2.8',\n '7452': '2.35',\n '7502': '2.5',\n '7532': '2.4',\n '7542': '2.9',\n '7552': '2.2',\n '7642': '2.3',\n '7662': '2.0',\n '7702': '2.0',\n '7742': '2.25',\n '7H12': '2.6',\n '7F32': '3.7',\n '7F52': '3.5',\n '7F72': '3.2',\n\n // Epyc (Milan)\n\n '7763': '2.45',\n '7713': '2.0',\n '7713P': '2.0',\n '7663': '2.0',\n '7643': '2.3',\n '75F3': '2.95',\n '7543': '2.8',\n '7543P': '2.8',\n '7513': '2.6',\n '7453': '2.75',\n '74F3': '3.2',\n '7443': '2.85',\n '7443P': '2.85',\n '7413': '2.65',\n '73F3': '3.5',\n '7343': '3.2',\n '7313': '3.0',\n '7313P': '3.0',\n '72F3': '3.7',\n\n // ZEN3\n '5600X': '3.7',\n '5800X': '3.8',\n '5900X': '3.7',\n '5950X': '3.4'\n};\n\n\nconst socketTypes = {\n 1: 'Other',\n 2: 'Unknown',\n 3: 'Daughter Board',\n 4: 'ZIF Socket',\n 5: 'Replacement/Piggy Back',\n 6: 'None',\n 7: 'LIF Socket',\n 8: 'Slot 1',\n 9: 'Slot 2',\n 10: '370 Pin Socket',\n 11: 'Slot A',\n 12: 'Slot M',\n 13: '423',\n 14: 'A (Socket 462)',\n 15: '478',\n 16: '754',\n 17: '940',\n 18: '939',\n 19: 'mPGA604',\n 20: 'LGA771',\n 21: 'LGA775',\n 22: 'S1',\n 23: 'AM2',\n 24: 'F (1207)',\n 25: 'LGA1366',\n 26: 'G34',\n 27: 'AM3',\n 28: 'C32',\n 29: 'LGA1156',\n 30: 'LGA1567',\n 31: 'PGA988A',\n 32: 'BGA1288',\n 33: 'rPGA988B',\n 34: 'BGA1023',\n 35: 'BGA1224',\n 36: 'LGA1155',\n 37: 'LGA1356',\n 38: 'LGA2011',\n 39: 'FS1',\n 40: 'FS2',\n 41: 'FM1',\n 42: 'FM2',\n 43: 'LGA2011-3',\n 44: 'LGA1356-3',\n 45: 'LGA1150',\n 46: 'BGA1168',\n 47: 'BGA1234',\n 48: 'BGA1364',\n 49: 'AM4',\n 50: 'LGA1151',\n 51: 'BGA1356',\n 52: 'BGA1440',\n 53: 'BGA1515',\n 54: 'LGA3647-1',\n 55: 'SP3',\n 56: 'SP3r2',\n 57: 'LGA2066',\n 58: 'BGA1392',\n 59: 'BGA1510',\n 60: 'BGA1528',\n 61: 'LGA4189',\n 62: 'LGA1200',\n 63: 'LGA4677',\n};\n\nconst socketTypesByName = {\n 'LGA1150': 'i7-5775C i3-4340 i3-4170 G3250 i3-4160T i3-4160 E3-1231 G3258 G3240 i7-4790S i7-4790K i7-4790 i5-4690K i5-4690 i5-4590T i5-4590S i5-4590 i5-4460 i3-4360 i3-4150 G1820 G3420 G3220 i7-4771 i5-4440 i3-4330 i3-4130T i3-4130 E3-1230 i7-4770S i7-4770K i7-4770 i5-4670K i5-4670 i5-4570T i5-4570S i5-4570 i5-4430',\n 'LGA1151': 'i9-9900KS E-2288G E-2224 G5420 i9-9900T i9-9900 i7-9700T i7-9700F i7-9700E i7-9700 i5-9600 i5-9500T i5-9500F i5-9500 i5-9400T i3-9350K i3-9300 i3-9100T i3-9100F i3-9100 G4930 i9-9900KF i7-9700KF i5-9600KF i5-9400F i5-9400 i3-9350KF i9-9900K i7-9700K i5-9600K G5500 G5400 i7-8700T i7-8086K i5-8600 i5-8500T i5-8500 i5-8400T i3-8300 i3-8100T G4900 i7-8700K i7-8700 i5-8600K i5-8400 i3-8350K i3-8100 E3-1270 G4600 G4560 i7-7700T i7-7700K i7-7700 i5-7600K i5-7600 i5-7500T i5-7500 i5-7400 i3-7350K i3-7300 i3-7100T i3-7100 G3930 G3900 G4400 i7-6700T i7-6700K i7-6700 i5-6600K i5-6600 i5-6500T i5-6500 i5-6400T i5-6400 i3-6300 i3-6100T i3-6100 E3-1270 E3-1270 T4500 T4400',\n '1155': 'G440 G460 G465 G470 G530T G540T G550T G1610T G1620T G530 G540 G1610 G550 G1620 G555 G1630 i3-2100T i3-2120T i3-3220T i3-3240T i3-3250T i3-2100 i3-2105 i3-2102 i3-3210 i3-3220 i3-2125 i3-2120 i3-3225 i3-2130 i3-3245 i3-3240 i3-3250 i5-3570T i5-2500T i5-2400S i5-2405S i5-2390T i5-3330S i5-2500S i5-3335S i5-2300 i5-3450S i5-3340S i5-3470S i5-3475S i5-3470T i5-2310 i5-3550S i5-2320 i5-3330 i5-3350P i5-3450 i5-2400 i5-3340 i5-3570S i5-2380P i5-2450P i5-3470 i5-2500K i5-3550 i5-2500 i5-3570 i5-3570K i5-2550K i7-3770T i7-2600S i7-3770S i7-2600K i7-2600 i7-3770 i7-3770K i7-2700K G620T G630T G640T G2020T G645T G2100T G2030T G622 G860T G620 G632 G2120T G630 G640 G2010 G840 G2020 G850 G645 G2030 G860 G2120 G870 G2130 G2140 E3-1220L E3-1220L E3-1260L E3-1265L E3-1220 E3-1225 E3-1220 E3-1235 E3-1225 E3-1230 E3-1230 E3-1240 E3-1245 E3-1270 E3-1275 E3-1240 E3-1245 E3-1270 E3-1280 E3-1275 E3-1290 E3-1280 E3-1290'\n};\n\nfunction getSocketTypesByName(str) {\n let result = '';\n for (const key in socketTypesByName) {\n const names = socketTypesByName[key].split(' ');\n for (let i = 0; i < names.length; i++) {\n if (str.indexOf(names[i]) >= 0) {\n result = key;\n }\n }\n }\n return result;\n}\n\nfunction cpuManufacturer(str) {\n let result = str;\n str = str.toLowerCase();\n\n if (str.indexOf('intel') >= 0) { result = 'Intel'; }\n if (str.indexOf('amd') >= 0) { result = 'AMD'; }\n if (str.indexOf('qemu') >= 0) { result = 'QEMU'; }\n if (str.indexOf('hygon') >= 0) { result = 'Hygon'; }\n if (str.indexOf('centaur') >= 0) { result = 'WinChip/Via'; }\n if (str.indexOf('vmware') >= 0) { result = 'VMware'; }\n if (str.indexOf('Xen') >= 0) { result = 'Xen Hypervisor'; }\n if (str.indexOf('tcg') >= 0) { result = 'QEMU'; }\n if (str.indexOf('apple') >= 0) { result = 'Apple'; }\n\n return result;\n}\n\nfunction cpuBrandManufacturer(res) {\n res.brand = res.brand.replace(/\\(R\\)+/g, '®').replace(/\\s+/g, ' ').trim();\n res.brand = res.brand.replace(/\\(TM\\)+/g, '™').replace(/\\s+/g, ' ').trim();\n res.brand = res.brand.replace(/\\(C\\)+/g, '©').replace(/\\s+/g, ' ').trim();\n res.brand = res.brand.replace(/CPU+/g, '').replace(/\\s+/g, ' ').trim();\n res.manufacturer = cpuManufacturer(res.brand);\n\n let parts = res.brand.split(' ');\n parts.shift();\n res.brand = parts.join(' ');\n return res;\n}\n\nfunction getAMDSpeed(brand) {\n let result = '0';\n for (let key in AMDBaseFrequencies) {\n if ({}.hasOwnProperty.call(AMDBaseFrequencies, key)) {\n let parts = key.split('|');\n let found = 0;\n parts.forEach(item => {\n if (brand.indexOf(item) > -1) {\n found++;\n }\n });\n if (found === parts.length) {\n result = AMDBaseFrequencies[key];\n }\n }\n }\n return parseFloat(result);\n}\n\n// --------------------------\n// CPU - brand, speed\n\nfunction getCpu() {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n const UNKNOWN = 'unknown';\n let result = {\n manufacturer: UNKNOWN,\n brand: UNKNOWN,\n vendor: '',\n family: '',\n model: '',\n stepping: '',\n revision: '',\n voltage: '',\n speed: 0,\n speedMin: 0,\n speedMax: 0,\n governor: '',\n cores: util.cores(),\n physicalCores: util.cores(),\n processors: 1,\n socket: '',\n flags: '',\n virtualization: false,\n cache: {}\n };\n cpuFlags().then(flags => {\n result.flags = flags;\n result.virtualization = flags.indexOf('vmx') > -1 || flags.indexOf('svm') > -1;\n // if (_windows) {\n // try {\n // const systeminfo = execSync('systeminfo', util.execOptsWin).toString();\n // result.virtualization = result.virtualization || (systeminfo.indexOf('Virtualization Enabled In Firmware: Yes') !== -1) || (systeminfo.indexOf('Virtualisierung in Firmware aktiviert: Ja') !== -1) || (systeminfo.indexOf('Virtualisation activée dans le microprogramme : Qiu') !== -1);\n // } catch (e) {\n // util.noop();\n // }\n // }\n if (_darwin) {\n exec('sysctl machdep.cpu hw.cpufrequency_max hw.cpufrequency_min hw.packages hw.physicalcpu_max hw.ncpu hw.tbfrequency hw.cpufamily hw.cpusubfamily', function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n const modelline = util.getValue(lines, 'machdep.cpu.brand_string');\n const modellineParts = modelline.split('@');\n result.brand = modellineParts[0].trim();\n const speed = modellineParts[1] ? modellineParts[1].trim() : '0';\n result.speed = parseFloat(speed.replace(/GHz+/g, ''));\n let tbFrequency = util.getValue(lines, 'hw.tbfrequency') / 1000000000.0;\n tbFrequency = tbFrequency < 0.1 ? tbFrequency * 100 : tbFrequency;\n result.speed = result.speed === 0 ? tbFrequency : result.speed;\n\n _cpu_speed = result.speed;\n result = cpuBrandManufacturer(result);\n result.speedMin = util.getValue(lines, 'hw.cpufrequency_min') ? (util.getValue(lines, 'hw.cpufrequency_min') / 1000000000.0) : result.speed;\n result.speedMax = util.getValue(lines, 'hw.cpufrequency_max') ? (util.getValue(lines, 'hw.cpufrequency_max') / 1000000000.0) : result.speed;\n result.vendor = util.getValue(lines, 'machdep.cpu.vendor') || 'Apple';\n result.family = util.getValue(lines, 'machdep.cpu.family') || util.getValue(lines, 'hw.cpufamily');\n result.model = util.getValue(lines, 'machdep.cpu.model');\n result.stepping = util.getValue(lines, 'machdep.cpu.stepping') || util.getValue(lines, 'hw.cpusubfamily');\n const countProcessors = util.getValue(lines, 'hw.packages');\n const countCores = util.getValue(lines, 'hw.physicalcpu_max');\n const countThreads = util.getValue(lines, 'hw.ncpu');\n if (os.arch() === 'arm64') {\n const clusters = execSync('ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type').toString().split('\\n');\n const efficiencyCores = clusters.filter(line => line.indexOf('\"E\"') >= 0).length;\n const performanceCores = clusters.filter(line => line.indexOf('\"P\"') >= 0).length;\n result.socket = 'SOC';\n result.efficiencyCores = efficiencyCores;\n result.performanceCores = performanceCores;\n }\n if (countProcessors) {\n result.processors = parseInt(countProcessors) || 1;\n }\n if (countCores && countThreads) {\n result.cores = parseInt(countThreads) || util.cores();\n result.physicalCores = parseInt(countCores) || util.cores();\n }\n cpuCache().then(res => {\n result.cache = res;\n resolve(result);\n });\n });\n }\n if (_linux) {\n let modelline = '';\n let lines = [];\n if (os.cpus()[0] && os.cpus()[0].model) { modelline = os.cpus()[0].model; }\n exec('export LC_ALL=C; lscpu; echo -n \"Governor: \"; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null; echo; unset LC_ALL', function (error, stdout) {\n if (!error) {\n lines = stdout.toString().split('\\n');\n }\n modelline = util.getValue(lines, 'model name') || modelline;\n const modellineParts = modelline.split('@');\n result.brand = modellineParts[0].trim();\n result.speed = modellineParts[1] ? parseFloat(modellineParts[1].trim()) : 0;\n if (result.speed === 0 && (result.brand.indexOf('AMD') > -1 || result.brand.toLowerCase().indexOf('ryzen') > -1)) {\n result.speed = getAMDSpeed(result.brand);\n }\n if (result.speed === 0) {\n const current = getCpuCurrentSpeedSync();\n if (current.avg !== 0) { result.speed = current.avg; }\n }\n _cpu_speed = result.speed;\n result.speedMin = Math.round(parseFloat(util.getValue(lines, 'cpu min mhz').replace(/,/g, '.')) / 10.0) / 100;\n result.speedMax = Math.round(parseFloat(util.getValue(lines, 'cpu max mhz').replace(/,/g, '.')) / 10.0) / 100;\n\n result = cpuBrandManufacturer(result);\n result.vendor = cpuManufacturer(util.getValue(lines, 'vendor id'));\n // if (!result.vendor) { result.vendor = util.getValue(lines, 'anbieterkennung'); }\n\n result.family = util.getValue(lines, 'cpu family');\n // if (!result.family) { result.family = util.getValue(lines, 'prozessorfamilie'); }\n result.model = util.getValue(lines, 'model:');\n // if (!result.model) { result.model = util.getValue(lines, 'modell:'); }\n result.stepping = util.getValue(lines, 'stepping');\n result.revision = util.getValue(lines, 'cpu revision');\n result.cache.l1d = util.getValue(lines, 'l1d cache');\n if (result.cache.l1d) { result.cache.l1d = parseInt(result.cache.l1d) * (result.cache.l1d.indexOf('M') !== -1 ? 1024 * 1024 : (result.cache.l1d.indexOf('K') !== -1 ? 1024 : 1)); }\n result.cache.l1i = util.getValue(lines, 'l1i cache');\n if (result.cache.l1i) { result.cache.l1i = parseInt(result.cache.l1i) * (result.cache.l1i.indexOf('M') !== -1 ? 1024 * 1024 : (result.cache.l1i.indexOf('K') !== -1 ? 1024 : 1)); }\n result.cache.l2 = util.getValue(lines, 'l2 cache');\n if (result.cache.l2) { result.cache.l2 = parseInt(result.cache.l2) * (result.cache.l2.indexOf('M') !== -1 ? 1024 * 1024 : (result.cache.l2.indexOf('K') !== -1 ? 1024 : 1)); }\n result.cache.l3 = util.getValue(lines, 'l3 cache');\n if (result.cache.l3) { result.cache.l3 = parseInt(result.cache.l3) * (result.cache.l3.indexOf('M') !== -1 ? 1024 * 1024 : (result.cache.l3.indexOf('K') !== -1 ? 1024 : 1)); }\n\n const threadsPerCore = util.getValue(lines, 'thread(s) per core') || '1';\n // const coresPerSocketInt = parseInt(util.getValue(lines, 'cores(s) per socket') || '1', 10);\n const processors = util.getValue(lines, 'socket(s)') || '1';\n let threadsPerCoreInt = parseInt(threadsPerCore, 10);\n let processorsInt = parseInt(processors, 10);\n result.physicalCores = result.cores / threadsPerCoreInt;\n result.processors = processorsInt;\n result.governor = util.getValue(lines, 'governor') || '';\n\n // Test Raspberry\n if (result.vendor === 'ARM') {\n const linesRpi = fs.readFileSync('/proc/cpuinfo').toString().split('\\n');\n const rPIRevision = util.decodePiCpuinfo(linesRpi);\n if (rPIRevision.model.toLowerCase().indexOf('raspberry') >= 0) {\n result.family = result.manufacturer;\n result.manufacturer = rPIRevision.manufacturer;\n result.brand = rPIRevision.processor;\n result.revision = rPIRevision.revisionCode;\n result.socket = 'SOC';\n }\n }\n\n // socket type\n let lines2 = [];\n exec('export LC_ALL=C; dmidecode –t 4 2>/dev/null | grep \"Upgrade: Socket\"; unset LC_ALL', function (error2, stdout2) {\n lines2 = stdout2.toString().split('\\n');\n if (lines2 && lines2.length) {\n result.socket = util.getValue(lines2, 'Upgrade').replace('Socket', '').trim() || result.socket;\n }\n resolve(result);\n });\n });\n }\n if (_freebsd || _openbsd || _netbsd) {\n let modelline = '';\n let lines = [];\n if (os.cpus()[0] && os.cpus()[0].model) { modelline = os.cpus()[0].model; }\n exec('export LC_ALL=C; dmidecode -t 4; dmidecode -t 7 unset LC_ALL', function (error, stdout) {\n let cache = [];\n if (!error) {\n const data = stdout.toString().split('# dmidecode');\n const processor = data.length > 1 ? data[1] : '';\n cache = data.length > 2 ? data[2].split('Cache Information') : [];\n\n lines = processor.split('\\n');\n }\n result.brand = modelline.split('@')[0].trim();\n result.speed = modelline.split('@')[1] ? parseFloat(modelline.split('@')[1].trim()) : 0;\n if (result.speed === 0 && (result.brand.indexOf('AMD') > -1 || result.brand.toLowerCase().indexOf('ryzen') > -1)) {\n result.speed = getAMDSpeed(result.brand);\n }\n if (result.speed === 0) {\n const current = getCpuCurrentSpeedSync();\n if (current.avg !== 0) { result.speed = current.avg; }\n }\n _cpu_speed = result.speed;\n result.speedMin = result.speed;\n result.speedMax = Math.round(parseFloat(util.getValue(lines, 'max speed').replace(/Mhz/g, '')) / 10.0) / 100;\n\n result = cpuBrandManufacturer(result);\n result.vendor = cpuManufacturer(util.getValue(lines, 'manufacturer'));\n let sig = util.getValue(lines, 'signature');\n sig = sig.split(',');\n for (var i = 0; i < sig.length; i++) {\n sig[i] = sig[i].trim();\n }\n result.family = util.getValue(sig, 'Family', ' ', true);\n result.model = util.getValue(sig, 'Model', ' ', true);\n result.stepping = util.getValue(sig, 'Stepping', ' ', true);\n result.revision = '';\n const voltage = parseFloat(util.getValue(lines, 'voltage'));\n result.voltage = isNaN(voltage) ? '' : voltage.toFixed(2);\n for (let i = 0; i < cache.length; i++) {\n lines = cache[i].split('\\n');\n let cacheType = util.getValue(lines, 'Socket Designation').toLowerCase().replace(' ', '-').split('-');\n cacheType = cacheType.length ? cacheType[0] : '';\n const sizeParts = util.getValue(lines, 'Installed Size').split(' ');\n let size = parseInt(sizeParts[0], 10);\n const unit = sizeParts.length > 1 ? sizeParts[1] : 'kb';\n size = size * (unit === 'kb' ? 1024 : (unit === 'mb' ? 1024 * 1024 : (unit === 'gb' ? 1024 * 1024 * 1024 : 1)));\n if (cacheType) {\n if (cacheType === 'l1') {\n result.cache[cacheType + 'd'] = size / 2;\n result.cache[cacheType + 'i'] = size / 2;\n } else {\n result.cache[cacheType] = size;\n }\n }\n }\n // socket type\n result.socket = util.getValue(lines, 'Upgrade').replace('Socket', '').trim();\n // # threads / # cores\n const threadCount = util.getValue(lines, 'thread count').trim();\n const coreCount = util.getValue(lines, 'core count').trim();\n if (coreCount && threadCount) {\n result.cores = parseInt(threadCount, 10);\n result.physicalCores = parseInt(coreCount, 10);\n }\n resolve(result);\n });\n }\n if (_sunos) {\n resolve(result);\n }\n if (_windows) {\n try {\n const workload = [];\n workload.push(util.powerShell('Get-WmiObject Win32_processor | select Name, Revision, L2CacheSize, L3CacheSize, Manufacturer, MaxClockSpeed, Description, UpgradeMethod, Caption, NumberOfLogicalProcessors, NumberOfCores | fl'));\n workload.push(util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl'));\n // workload.push(util.powerShell('Get-ComputerInfo -property \"HyperV*\"'));\n workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));\n\n Promise.all(\n workload\n ).then(data => {\n let lines = data[0].split('\\r\\n');\n let name = util.getValue(lines, 'name', ':') || '';\n if (name.indexOf('@') >= 0) {\n result.brand = name.split('@')[0].trim();\n result.speed = name.split('@')[1] ? parseFloat(name.split('@')[1].trim()) : 0;\n _cpu_speed = result.speed;\n } else {\n result.brand = name.trim();\n result.speed = 0;\n }\n result = cpuBrandManufacturer(result);\n result.revision = util.getValue(lines, 'revision', ':');\n result.cache.l1d = 0;\n result.cache.l1i = 0;\n result.cache.l2 = util.getValue(lines, 'l2cachesize', ':');\n result.cache.l3 = util.getValue(lines, 'l3cachesize', ':');\n if (result.cache.l2) { result.cache.l2 = parseInt(result.cache.l2, 10) * 1024; }\n if (result.cache.l3) { result.cache.l3 = parseInt(result.cache.l3, 10) * 1024; }\n result.vendor = util.getValue(lines, 'manufacturer', ':');\n result.speedMax = Math.round(parseFloat(util.getValue(lines, 'maxclockspeed', ':').replace(/,/g, '.')) / 10.0) / 100;\n if (result.speed === 0 && (result.brand.indexOf('AMD') > -1 || result.brand.toLowerCase().indexOf('ryzen') > -1)) {\n result.speed = getAMDSpeed(result.brand);\n }\n if (result.speed === 0) {\n result.speed = result.speedMax;\n }\n result.speedMin = result.speed;\n\n let description = util.getValue(lines, 'description', ':').split(' ');\n for (let i = 0; i < description.length; i++) {\n if (description[i].toLowerCase().startsWith('family') && (i + 1) < description.length && description[i + 1]) {\n result.family = description[i + 1];\n }\n if (description[i].toLowerCase().startsWith('model') && (i + 1) < description.length && description[i + 1]) {\n result.model = description[i + 1];\n }\n if (description[i].toLowerCase().startsWith('stepping') && (i + 1) < description.length && description[i + 1]) {\n result.stepping = description[i + 1];\n }\n }\n // socket type\n const socketId = util.getValue(lines, 'UpgradeMethod', ':');\n if (socketTypes[socketId]) {\n result.socket = socketTypes[socketId];\n }\n const socketByName = getSocketTypesByName(name);\n if (socketByName) {\n result.socket = socketByName;\n }\n // # threads / # cores\n const countProcessors = util.countLines(lines, 'Caption');\n const countThreads = util.getValue(lines, 'NumberOfLogicalProcessors', ':');\n const countCores = util.getValue(lines, 'NumberOfCores', ':');\n if (countProcessors) {\n result.processors = parseInt(countProcessors) || 1;\n }\n if (countCores && countThreads) {\n result.cores = parseInt(countThreads) || util.cores();\n result.physicalCores = parseInt(countCores) || util.cores();\n }\n if (countProcessors > 1) {\n result.cores = result.cores * countProcessors;\n result.physicalCores = result.physicalCores * countProcessors;\n }\n const parts = data[1].split(/\\n\\s*\\n/);\n parts.forEach(function (part) {\n lines = part.split('\\r\\n');\n const cacheType = util.getValue(lines, 'CacheType');\n const level = util.getValue(lines, 'Level');\n const installedSize = util.getValue(lines, 'InstalledSize');\n // L1 Instructions\n if (level === '3' && cacheType === '3') {\n result.cache.l1i = parseInt(installedSize, 10);\n }\n // L1 Data\n if (level === '3' && cacheType === '4') {\n result.cache.l1d = parseInt(installedSize, 10);\n }\n // L1 all\n if (level === '3' && cacheType === '5' && !result.cache.l1i && !result.cache.l1d) {\n result.cache.l1i = parseInt(installedSize, 10) / 2;\n result.cache.l1d = parseInt(installedSize, 10) / 2;\n }\n });\n // lines = data[2].split('\\r\\n');\n // result.virtualization = (util.getValue(lines, 'HyperVRequirementVirtualizationFirmwareEnabled').toLowerCase() === 'true');\n // result.virtualization = (util.getValue(lines, 'HyperVisorPresent').toLowerCase() === 'true');\n const hyperv = data[2] ? data[2].toString().toLowerCase() : '';\n result.virtualization = hyperv.indexOf('true') !== -1;\n\n resolve(result);\n });\n } catch (e) {\n resolve(result);\n }\n }\n });\n });\n });\n}\n\n// --------------------------\n// CPU - Processor Data\n\nfunction cpu(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n getCpu().then(result => {\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n });\n}\n\nexports.cpu = cpu;\n\n// --------------------------\n// CPU - current speed - in GHz\n\nfunction getCpuCurrentSpeedSync() {\n\n let cpus = os.cpus();\n let minFreq = 999999999;\n let maxFreq = 0;\n let avgFreq = 0;\n let cores = [];\n\n if (cpus && cpus.length) {\n for (let i in cpus) {\n if ({}.hasOwnProperty.call(cpus, i)) {\n let freq = cpus[i].speed > 100 ? (cpus[i].speed + 1) / 1000 : cpus[i].speed / 10;\n avgFreq = avgFreq + freq;\n if (freq > maxFreq) { maxFreq = freq; }\n if (freq < minFreq) { minFreq = freq; }\n cores.push(parseFloat(freq.toFixed(2)));\n }\n }\n avgFreq = avgFreq / cpus.length;\n return {\n min: parseFloat(minFreq.toFixed(2)),\n max: parseFloat(maxFreq.toFixed(2)),\n avg: parseFloat((avgFreq).toFixed(2)),\n cores: cores\n };\n } else {\n return {\n min: 0,\n max: 0,\n avg: 0,\n cores: cores\n };\n }\n}\n\nfunction cpuCurrentSpeed(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = getCpuCurrentSpeedSync();\n if (result.avg === 0 && _cpu_speed !== 0) {\n const currCpuSpeed = parseFloat(_cpu_speed);\n result = {\n min: currCpuSpeed,\n max: currCpuSpeed,\n avg: currCpuSpeed,\n cores: []\n };\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n}\n\nexports.cpuCurrentSpeed = cpuCurrentSpeed;\n\n// --------------------------\n// CPU - temperature\n// if sensors are installed\n\nfunction cpuTemperature(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = {\n main: null,\n cores: [],\n max: null,\n socket: [],\n chipset: null\n };\n if (_linux) {\n // CPU Chipset, Socket\n try {\n const cmd = 'cat /sys/class/thermal/thermal_zone*/type 2>/dev/null; echo \"-----\"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;';\n const parts = execSync(cmd).toString().split('-----\\n');\n if (parts.length === 2) {\n const lines = parts[0].split('\\n');\n const lines2 = parts[1].split('\\n');\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i].trim();\n if (line.startsWith('acpi') && lines2[i]) {\n result.socket.push(Math.round(parseInt(lines2[i], 10) / 100) / 10);\n }\n if (line.startsWith('pch') && lines2[i]) {\n result.chipset = Math.round(parseInt(lines2[i], 10) / 100) / 10;\n }\n }\n }\n } catch (e) {\n util.noop();\n }\n\n const cmd = 'for mon in /sys/class/hwmon/hwmon*; do for label in \"$mon\"/temp*_label; do if [ -f $label ]; then value=$(echo $label | rev | cut -c 7- | rev)_input; if [ -f \"$value\" ]; then echo $(cat \"$label\")___$(cat \"$value\"); fi; fi; done; done;';\n try {\n exec(cmd, function (error, stdout) {\n stdout = stdout.toString();\n const tdiePos = stdout.toLowerCase().indexOf('tdie');\n if (tdiePos !== -1) {\n stdout = stdout.substring(tdiePos);\n }\n let lines = stdout.split('\\n');\n lines.forEach(line => {\n const parts = line.split('___');\n const label = parts[0];\n const value = parts.length > 1 && parts[1] ? parts[1] : '0';\n if (value && (label === undefined || (label && label.toLowerCase().startsWith('core')))) {\n result.cores.push(Math.round(parseInt(value, 10) / 100) / 10);\n } else if (value && label && result.main === null) {\n result.main = Math.round(parseInt(value, 10) / 100) / 10;\n }\n });\n\n if (result.cores.length > 0) {\n if (result.main === null) {\n result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);\n }\n let maxtmp = Math.max.apply(Math, result.cores);\n result.max = (maxtmp > result.main) ? maxtmp : result.main;\n }\n if (result.main !== null) {\n if (result.max === null) {\n result.max = result.main;\n }\n if (callback) { callback(result); }\n resolve(result);\n return;\n }\n exec('sensors', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n let tdieTemp = null;\n let newSectionStarts = true;\n let section = '';\n lines.forEach(function (line) {\n // determine section\n if (line.trim() === '') {\n newSectionStarts = true;\n } else if (newSectionStarts) {\n if (line.trim().toLowerCase().startsWith('acpi')) { section = 'acpi'; }\n if (line.trim().toLowerCase().startsWith('pch')) { section = 'pch'; }\n if (line.trim().toLowerCase().startsWith('core')) { section = 'core'; }\n newSectionStarts = false;\n }\n let regex = /[+-]([^°]*)/g;\n let temps = line.match(regex);\n let firstPart = line.split(':')[0].toUpperCase();\n if (section === 'acpi') {\n // socket temp\n if (firstPart.indexOf('TEMP') !== -1) {\n result.socket.push(parseFloat(temps));\n }\n } else if (section === 'pch') {\n // chipset temp\n if (firstPart.indexOf('TEMP') !== -1) {\n result.chipset = parseFloat(temps);\n }\n }\n // cpu temp\n if (firstPart.indexOf('PHYSICAL') !== -1 || firstPart.indexOf('PACKAGE') !== -1) {\n result.main = parseFloat(temps);\n }\n if (firstPart.indexOf('CORE ') !== -1) {\n result.cores.push(parseFloat(temps));\n }\n if (firstPart.indexOf('TDIE') !== -1 && tdieTemp === null) {\n tdieTemp = parseFloat(temps);\n }\n });\n if (result.cores.length > 0) {\n if (result.main === null) {\n result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);\n }\n let maxtmp = Math.max.apply(Math, result.cores);\n result.max = (maxtmp > result.main) ? maxtmp : result.main;\n } else {\n if (result.main === null && tdieTemp !== null) {\n result.main = tdieTemp;\n result.max = tdieTemp;\n }\n }\n if (result.main !== null || result.max !== null) {\n if (callback) { callback(result); }\n resolve(result);\n return;\n }\n }\n fs.stat('/sys/class/thermal/thermal_zone0/temp', function (err) {\n if (err === null) {\n fs.readFile('/sys/class/thermal/thermal_zone0/temp', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines.length > 0) {\n result.main = parseFloat(lines[0]) / 1000.0;\n result.max = result.main;\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n exec('/opt/vc/bin/vcgencmd measure_temp', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines.length > 0 && lines[0].indexOf('=')) {\n result.main = parseFloat(lines[0].split('=')[1]);\n result.max = result.main;\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n });\n });\n });\n } catch (er) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n exec('sysctl dev.cpu | grep temp', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n let sum = 0;\n lines.forEach(function (line) {\n const parts = line.split(':');\n if (parts.length > 1) {\n const temp = parseFloat(parts[1].replace(',', '.'));\n if (temp > result.max) { result.max = temp; }\n sum = sum + temp;\n result.cores.push(temp);\n }\n });\n if (result.cores.length) {\n result.main = Math.round(sum / result.cores.length * 100) / 100;\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_darwin) {\n let osxTemp = null;\n try {\n osxTemp = require('osx-temperature-sensor');\n } catch (er) {\n osxTemp = null;\n }\n if (osxTemp) {\n result = osxTemp.cpuTemperature();\n }\n\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n try {\n util.powerShell('Get-WmiObject MSAcpi_ThermalZoneTemperature -Namespace \"root/wmi\" | Select CurrentTemperature').then((stdout, error) => {\n if (!error) {\n let sum = 0;\n let lines = stdout.split('\\r\\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0);\n lines.forEach(function (line) {\n let value = (parseInt(line, 10) - 2732) / 10;\n if (!isNaN(value)) {\n sum = sum + value;\n if (value > result.max) { result.max = value; }\n result.cores.push(value);\n }\n });\n if (result.cores.length) {\n result.main = sum / result.cores.length;\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.cpuTemperature = cpuTemperature;\n\n// --------------------------\n// CPU Flags\n\nfunction cpuFlags(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = '';\n if (_windows) {\n try {\n exec('reg query \"HKEY_LOCAL_MACHINE\\\\HARDWARE\\\\DESCRIPTION\\\\System\\\\CentralProcessor\\\\0\" /v FeatureSet', util.execOptsWin, function (error, stdout) {\n if (!error) {\n let flag_hex = stdout.split('0x').pop().trim();\n let flag_bin_unpadded = parseInt(flag_hex, 16).toString(2);\n let flag_bin = '0'.repeat(32 - flag_bin_unpadded.length) + flag_bin_unpadded;\n // empty flags are the reserved fields in the CPUID feature bit list\n // as found on wikipedia:\n // https://en.wikipedia.org/wiki/CPUID\n let all_flags = [\n 'fpu', 'vme', 'de', 'pse', 'tsc', 'msr', 'pae', 'mce', 'cx8', 'apic',\n '', 'sep', 'mtrr', 'pge', 'mca', 'cmov', 'pat', 'pse-36', 'psn', 'clfsh',\n '', 'ds', 'acpi', 'mmx', 'fxsr', 'sse', 'sse2', 'ss', 'htt', 'tm', 'ia64', 'pbe'\n ];\n for (let f = 0; f < all_flags.length; f++) {\n if (flag_bin[f] === '1' && all_flags[f] !== '') {\n result += ' ' + all_flags[f];\n }\n }\n result = result.trim().toLowerCase();\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_linux) {\n try {\n\n exec('export LC_ALL=C; lscpu; unset LC_ALL', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n if (line.split(':')[0].toUpperCase().indexOf('FLAGS') !== -1) {\n result = line.split(':')[1].trim().toLowerCase();\n }\n });\n }\n if (!result) {\n fs.readFile('/proc/cpuinfo', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n result = util.getValue(lines, 'features', ':', true).toLowerCase();\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n exec('export LC_ALL=C; dmidecode -t 4 2>/dev/null; unset LC_ALL', function (error, stdout) {\n let flags = [];\n if (!error) {\n let parts = stdout.toString().split('\\tFlags:');\n const lines = parts.length > 1 ? parts[1].split('\\tVersion:')[0].split('\\n') : [];\n lines.forEach(function (line) {\n let flag = (line.indexOf('(') ? line.split('(')[0].toLowerCase() : '').trim().replace(/\\t/g, '');\n if (flag) {\n flags.push(flag);\n }\n });\n }\n result = flags.join(' ').trim().toLowerCase();\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_darwin) {\n exec('sysctl machdep.cpu.features', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines.length > 0 && lines[0].indexOf('machdep.cpu.features:') !== -1) {\n result = lines[0].split(':')[1].trim().toLowerCase();\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n}\n\nexports.cpuFlags = cpuFlags;\n\n// --------------------------\n// CPU Cache\n\nfunction cpuCache(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = {\n l1d: null,\n l1i: null,\n l2: null,\n l3: null,\n };\n if (_linux) {\n try {\n exec('export LC_ALL=C; lscpu; unset LC_ALL', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n let parts = line.split(':');\n if (parts[0].toUpperCase().indexOf('L1D CACHE') !== -1) {\n result.l1d = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : (parts[1].indexOf('K') !== -1 ? 1024 : 1));\n }\n if (parts[0].toUpperCase().indexOf('L1I CACHE') !== -1) {\n result.l1i = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : (parts[1].indexOf('K') !== -1 ? 1024 : 1));\n }\n if (parts[0].toUpperCase().indexOf('L2 CACHE') !== -1) {\n result.l2 = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : (parts[1].indexOf('K') !== -1 ? 1024 : 1));\n }\n if (parts[0].toUpperCase().indexOf('L3 CACHE') !== -1) {\n result.l3 = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : (parts[1].indexOf('K') !== -1 ? 1024 : 1));\n }\n });\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n exec('export LC_ALL=C; dmidecode -t 7 2>/dev/null; unset LC_ALL', function (error, stdout) {\n let cache = [];\n if (!error) {\n const data = stdout.toString();\n cache = data.split('Cache Information');\n cache.shift();\n }\n for (let i = 0; i < cache.length; i++) {\n const lines = cache[i].split('\\n');\n let cacheType = util.getValue(lines, 'Socket Designation').toLowerCase().replace(' ', '-').split('-');\n cacheType = cacheType.length ? cacheType[0] : '';\n const sizeParts = util.getValue(lines, 'Installed Size').split(' ');\n let size = parseInt(sizeParts[0], 10);\n const unit = sizeParts.length > 1 ? sizeParts[1] : 'kb';\n size = size * (unit === 'kb' ? 1024 : (unit === 'mb' ? 1024 * 1024 : (unit === 'gb' ? 1024 * 1024 * 1024 : 1)));\n if (cacheType) {\n if (cacheType === 'l1') {\n result.cache[cacheType + 'd'] = size / 2;\n result.cache[cacheType + 'i'] = size / 2;\n } else {\n result.cache[cacheType] = size;\n }\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_darwin) {\n exec('sysctl hw.l1icachesize hw.l1dcachesize hw.l2cachesize hw.l3cachesize', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n let parts = line.split(':');\n if (parts[0].toLowerCase().indexOf('hw.l1icachesize') !== -1) {\n result.l1d = parseInt(parts[1].trim()) * (parts[1].indexOf('K') !== -1 ? 1024 : 1);\n }\n if (parts[0].toLowerCase().indexOf('hw.l1dcachesize') !== -1) {\n result.l1i = parseInt(parts[1].trim()) * (parts[1].indexOf('K') !== -1 ? 1024 : 1);\n }\n if (parts[0].toLowerCase().indexOf('hw.l2cachesize') !== -1) {\n result.l2 = parseInt(parts[1].trim()) * (parts[1].indexOf('K') !== -1 ? 1024 : 1);\n }\n if (parts[0].toLowerCase().indexOf('hw.l3cachesize') !== -1) {\n result.l3 = parseInt(parts[1].trim()) * (parts[1].indexOf('K') !== -1 ? 1024 : 1);\n }\n });\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n try {\n util.powerShell('Get-WmiObject Win32_processor | select L2CacheSize, L3CacheSize | fl').then((stdout, error) => {\n if (!error) {\n let lines = stdout.split('\\r\\n');\n result.l1d = 0;\n result.l1i = 0;\n result.l2 = util.getValue(lines, 'l2cachesize', ':');\n result.l3 = util.getValue(lines, 'l3cachesize', ':');\n if (result.l2) { result.l2 = parseInt(result.l2, 10) * 1024; }\n if (result.l3) { result.l3 = parseInt(result.l3, 10) * 1024; }\n }\n util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl').then((stdout, error) => {\n if (!error) {\n const parts = stdout.split(/\\n\\s*\\n/);\n parts.forEach(function (part) {\n const lines = part.split('\\r\\n');\n const cacheType = util.getValue(lines, 'CacheType');\n const level = util.getValue(lines, 'Level');\n const installedSize = util.getValue(lines, 'InstalledSize');\n // L1 Instructions\n if (level === '3' && cacheType === '3') {\n result.l1i = parseInt(installedSize, 10);\n }\n // L1 Data\n if (level === '3' && cacheType === '4') {\n result.l1d = parseInt(installedSize, 10);\n }\n // L1 all\n if (level === '3' && cacheType === '5' && !result.l1i && !result.l1d) {\n result.l1i = parseInt(installedSize, 10) / 2;\n result.l1d = parseInt(installedSize, 10) / 2;\n }\n });\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.cpuCache = cpuCache;\n\n// --------------------------\n// CPU - current load - in %\n\nfunction getLoad() {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let loads = os.loadavg().map(function (x) { return x / util.cores(); });\n let avgLoad = parseFloat((Math.max.apply(Math, loads)).toFixed(2));\n let result = {};\n\n let now = Date.now() - _current_cpu.ms;\n if (now >= 200) {\n _current_cpu.ms = Date.now();\n const cpus = os.cpus();\n let totalUser = 0;\n let totalSystem = 0;\n let totalNice = 0;\n let totalIrq = 0;\n let totalIdle = 0;\n let cores = [];\n _corecount = (cpus && cpus.length) ? cpus.length : 0;\n\n for (let i = 0; i < _corecount; i++) {\n const cpu = cpus[i].times;\n totalUser += cpu.user;\n totalSystem += cpu.sys;\n totalNice += cpu.nice;\n totalIdle += cpu.idle;\n totalIrq += cpu.irq;\n let tmpTick = (_cpus && _cpus[i] && _cpus[i].totalTick ? _cpus[i].totalTick : 0);\n let tmpLoad = (_cpus && _cpus[i] && _cpus[i].totalLoad ? _cpus[i].totalLoad : 0);\n let tmpUser = (_cpus && _cpus[i] && _cpus[i].user ? _cpus[i].user : 0);\n let tmpSystem = (_cpus && _cpus[i] && _cpus[i].sys ? _cpus[i].sys : 0);\n let tmpNice = (_cpus && _cpus[i] && _cpus[i].nice ? _cpus[i].nice : 0);\n let tmpIdle = (_cpus && _cpus[i] && _cpus[i].idle ? _cpus[i].idle : 0);\n let tmpIrq = (_cpus && _cpus[i] && _cpus[i].irq ? _cpus[i].irq : 0);\n _cpus[i] = cpu;\n _cpus[i].totalTick = _cpus[i].user + _cpus[i].sys + _cpus[i].nice + _cpus[i].irq + _cpus[i].idle;\n _cpus[i].totalLoad = _cpus[i].user + _cpus[i].sys + _cpus[i].nice + _cpus[i].irq;\n _cpus[i].currentTick = _cpus[i].totalTick - tmpTick;\n _cpus[i].load = (_cpus[i].totalLoad - tmpLoad);\n _cpus[i].loadUser = (_cpus[i].user - tmpUser);\n _cpus[i].loadSystem = (_cpus[i].sys - tmpSystem);\n _cpus[i].loadNice = (_cpus[i].nice - tmpNice);\n _cpus[i].loadIdle = (_cpus[i].idle - tmpIdle);\n _cpus[i].loadIrq = (_cpus[i].irq - tmpIrq);\n cores[i] = {};\n cores[i].load = _cpus[i].load / _cpus[i].currentTick * 100;\n cores[i].loadUser = _cpus[i].loadUser / _cpus[i].currentTick * 100;\n cores[i].loadSystem = _cpus[i].loadSystem / _cpus[i].currentTick * 100;\n cores[i].loadNice = _cpus[i].loadNice / _cpus[i].currentTick * 100;\n cores[i].loadIdle = _cpus[i].loadIdle / _cpus[i].currentTick * 100;\n cores[i].loadIrq = _cpus[i].loadIrq / _cpus[i].currentTick * 100;\n cores[i].rawLoad = _cpus[i].load;\n cores[i].rawLoadUser = _cpus[i].loadUser;\n cores[i].rawLoadSystem = _cpus[i].loadSystem;\n cores[i].rawLoadNice = _cpus[i].loadNice;\n cores[i].rawLoadIdle = _cpus[i].loadIdle;\n cores[i].rawLoadIrq = _cpus[i].loadIrq;\n }\n let totalTick = totalUser + totalSystem + totalNice + totalIrq + totalIdle;\n let totalLoad = totalUser + totalSystem + totalNice + totalIrq;\n let currentTick = totalTick - _current_cpu.tick;\n result = {\n avgLoad: avgLoad,\n currentLoad: (totalLoad - _current_cpu.load) / currentTick * 100,\n currentLoadUser: (totalUser - _current_cpu.user) / currentTick * 100,\n currentLoadSystem: (totalSystem - _current_cpu.system) / currentTick * 100,\n currentLoadNice: (totalNice - _current_cpu.nice) / currentTick * 100,\n currentLoadIdle: (totalIdle - _current_cpu.idle) / currentTick * 100,\n currentLoadIrq: (totalIrq - _current_cpu.irq) / currentTick * 100,\n rawCurrentLoad: (totalLoad - _current_cpu.load),\n rawCurrentLoadUser: (totalUser - _current_cpu.user),\n rawCurrentLoadSystem: (totalSystem - _current_cpu.system),\n rawCurrentLoadNice: (totalNice - _current_cpu.nice),\n rawCurrentLoadIdle: (totalIdle - _current_cpu.idle),\n rawCurrentLoadIrq: (totalIrq - _current_cpu.irq),\n cpus: cores\n };\n _current_cpu = {\n user: totalUser,\n nice: totalNice,\n system: totalSystem,\n idle: totalIdle,\n irq: totalIrq,\n tick: totalTick,\n load: totalLoad,\n ms: _current_cpu.ms,\n currentLoad: result.currentLoad,\n currentLoadUser: result.currentLoadUser,\n currentLoadSystem: result.currentLoadSystem,\n currentLoadNice: result.currentLoadNice,\n currentLoadIdle: result.currentLoadIdle,\n currentLoadIrq: result.currentLoadIrq,\n rawCurrentLoad: result.rawCurrentLoad,\n rawCurrentLoadUser: result.rawCurrentLoadUser,\n rawCurrentLoadSystem: result.rawCurrentLoadSystem,\n rawCurrentLoadNice: result.rawCurrentLoadNice,\n rawCurrentLoadIdle: result.rawCurrentLoadIdle,\n rawCurrentLoadIrq: result.rawCurrentLoadIrq,\n };\n } else {\n let cores = [];\n for (let i = 0; i < _corecount; i++) {\n cores[i] = {};\n cores[i].load = _cpus[i].load / _cpus[i].currentTick * 100;\n cores[i].loadUser = _cpus[i].loadUser / _cpus[i].currentTick * 100;\n cores[i].loadSystem = _cpus[i].loadSystem / _cpus[i].currentTick * 100;\n cores[i].loadNice = _cpus[i].loadNice / _cpus[i].currentTick * 100;\n cores[i].loadIdle = _cpus[i].loadIdle / _cpus[i].currentTick * 100;\n cores[i].loadIrq = _cpus[i].loadIrq / _cpus[i].currentTick * 100;\n cores[i].rawLoad = _cpus[i].load;\n cores[i].rawLoadUser = _cpus[i].loadUser;\n cores[i].rawLoadSystem = _cpus[i].loadSystem;\n cores[i].rawLoadNice = _cpus[i].loadNice;\n cores[i].rawLoadIdle = _cpus[i].loadIdle;\n cores[i].rawLoadIrq = _cpus[i].loadIrq;\n }\n result = {\n avgLoad: avgLoad,\n currentLoad: _current_cpu.currentLoad,\n currentLoadUser: _current_cpu.currentLoadUser,\n currentLoadSystem: _current_cpu.currentLoadSystem,\n currentLoadNice: _current_cpu.currentLoadNice,\n currentLoadIdle: _current_cpu.currentLoadIdle,\n currentLoadIrq: _current_cpu.currentLoadIrq,\n rawCurrentLoad: _current_cpu.rawCurrentLoad,\n rawCurrentLoadUser: _current_cpu.rawCurrentLoadUser,\n rawCurrentLoadSystem: _current_cpu.rawCurrentLoadSystem,\n rawCurrentLoadNice: _current_cpu.rawCurrentLoadNice,\n rawCurrentLoadIdle: _current_cpu.rawCurrentLoadIdle,\n rawCurrentLoadIrq: _current_cpu.rawCurrentLoadIrq,\n cpus: cores\n };\n }\n resolve(result);\n });\n });\n}\n\nfunction currentLoad(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n getLoad().then(result => {\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n });\n}\n\nexports.currentLoad = currentLoad;\n\n// --------------------------\n// PS - full load\n// since bootup\n\nfunction getFullLoad() {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n const cpus = os.cpus();\n let totalUser = 0;\n let totalSystem = 0;\n let totalNice = 0;\n let totalIrq = 0;\n let totalIdle = 0;\n\n let result = 0;\n\n if (cpus && cpus.length) {\n for (let i = 0, len = cpus.length; i < len; i++) {\n const cpu = cpus[i].times;\n totalUser += cpu.user;\n totalSystem += cpu.sys;\n totalNice += cpu.nice;\n totalIrq += cpu.irq;\n totalIdle += cpu.idle;\n }\n let totalTicks = totalIdle + totalIrq + totalNice + totalSystem + totalUser;\n result = (totalTicks - totalIdle) / totalTicks * 100.0;\n\n } else {\n result = 0;\n }\n resolve(result);\n });\n });\n}\n\nfunction fullLoad(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n getFullLoad().then(result => {\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n });\n}\n\nexports.fullLoad = fullLoad;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// docker.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 13. Docker\n// ----------------------------------------------------------------------------------\n\nconst util = require('./util');\nconst DockerSocket = require('./dockerSocket');\n\nlet _platform = process.platform;\nconst _windows = (_platform === 'win32');\n\nlet _docker_container_stats = {};\nlet _docker_socket;\nlet _docker_last_read = 0;\n\n\n// --------------------------\n// get containers (parameter all: get also inactive/exited containers)\n\nfunction dockerInfo(callback) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n const result = {};\n\n _docker_socket.getInfo(data => {\n result.id = data.ID;\n result.containers = data.Containers;\n result.containersRunning = data.ContainersRunning;\n result.containersPaused = data.ContainersPaused;\n result.containersStopped = data.ContainersStopped;\n result.images = data.Images;\n result.driver = data.Driver;\n result.memoryLimit = data.MemoryLimit;\n result.swapLimit = data.SwapLimit;\n result.kernelMemory = data.KernelMemory;\n result.cpuCfsPeriod = data.CpuCfsPeriod;\n result.cpuCfsQuota = data.CpuCfsQuota;\n result.cpuShares = data.CPUShares;\n result.cpuSet = data.CPUSet;\n result.ipv4Forwarding = data.IPv4Forwarding;\n result.bridgeNfIptables = data.BridgeNfIptables;\n result.bridgeNfIp6tables = data.BridgeNfIp6tables;\n result.debug = data.Debug;\n result.nfd = data.NFd;\n result.oomKillDisable = data.OomKillDisable;\n result.ngoroutines = data.NGoroutines;\n result.systemTime = data.SystemTime;\n result.loggingDriver = data.LoggingDriver;\n result.cgroupDriver = data.CgroupDriver;\n result.nEventsListener = data.NEventsListener;\n result.kernelVersion = data.KernelVersion;\n result.operatingSystem = data.OperatingSystem;\n result.osType = data.OSType;\n result.architecture = data.Architecture;\n result.ncpu = data.NCPU;\n result.memTotal = data.MemTotal;\n result.dockerRootDir = data.DockerRootDir;\n result.httpProxy = data.HttpProxy;\n result.httpsProxy = data.HttpsProxy;\n result.noProxy = data.NoProxy;\n result.name = data.Name;\n result.labels = data.Labels;\n result.experimentalBuild = data.ExperimentalBuild;\n result.serverVersion = data.ServerVersion;\n result.clusterStore = data.ClusterStore;\n result.clusterAdvertise = data.ClusterAdvertise;\n result.defaultRuntime = data.DefaultRuntime;\n result.liveRestoreEnabled = data.LiveRestoreEnabled;\n result.isolation = data.Isolation;\n result.initBinary = data.InitBinary;\n result.productLicense = data.ProductLicense;\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n });\n}\n\nexports.dockerInfo = dockerInfo;\n\nfunction dockerImages(all, callback) {\n\n // fallback - if only callback is given\n if (util.isFunction(all) && !callback) {\n callback = all;\n all = false;\n }\n if (typeof all === 'string' && all === 'true') {\n all = true;\n }\n if (typeof all !== 'boolean' && all !== undefined) {\n all = false;\n }\n\n all = all || false;\n let result = [];\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n const workload = [];\n\n _docker_socket.listImages(all, data => {\n let dockerImages = {};\n try {\n dockerImages = data;\n if (dockerImages && Object.prototype.toString.call(dockerImages) === '[object Array]' && dockerImages.length > 0) {\n\n dockerImages.forEach(function (element) {\n\n if (element.Names && Object.prototype.toString.call(element.Names) === '[object Array]' && element.Names.length > 0) {\n element.Name = element.Names[0].replace(/^\\/|\\/$/g, '');\n }\n workload.push(dockerImagesInspect(element.Id.trim(), element));\n });\n if (workload.length) {\n Promise.all(\n workload\n ).then(data => {\n if (callback) { callback(data); }\n resolve(data);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } catch (err) {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n });\n}\n\n// --------------------------\n// container inspect (for one container)\n\nfunction dockerImagesInspect(imageID, payload) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n imageID = imageID || '';\n if (typeof imageID !== 'string') {\n return resolve();\n }\n const imageIDSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(imageID, true)).trim();\n if (imageIDSanitized) {\n\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n\n _docker_socket.inspectImage(imageIDSanitized.trim(), data => {\n try {\n resolve({\n id: payload.Id,\n container: data.Container,\n comment: data.Comment,\n os: data.Os,\n architecture: data.Architecture,\n parent: data.Parent,\n dockerVersion: data.DockerVersion,\n size: data.Size,\n sharedSize: payload.SharedSize,\n virtualSize: data.VirtualSize,\n author: data.Author,\n created: data.Created ? Math.round(new Date(data.Created).getTime() / 1000) : 0,\n containerConfig: data.ContainerConfig ? data.ContainerConfig : {},\n graphDriver: data.GraphDriver ? data.GraphDriver : {},\n repoDigests: data.RepoDigests ? data.RepoDigests : {},\n repoTags: data.RepoTags ? data.RepoTags : {},\n config: data.Config ? data.Config : {},\n rootFS: data.RootFS ? data.RootFS : {},\n });\n } catch (err) {\n resolve();\n }\n });\n } else {\n resolve();\n }\n });\n });\n}\n\nexports.dockerImages = dockerImages;\n\nfunction dockerContainers(all, callback) {\n\n function inContainers(containers, id) {\n let filtered = containers.filter(obj => {\n /**\n * @namespace\n * @property {string} Id\n */\n return (obj.Id && (obj.Id === id));\n });\n return (filtered.length > 0);\n }\n\n // fallback - if only callback is given\n if (util.isFunction(all) && !callback) {\n callback = all;\n all = false;\n }\n if (typeof all === 'string' && all === 'true') {\n all = true;\n }\n if (typeof all !== 'boolean' && all !== undefined) {\n all = false;\n }\n\n all = all || false;\n let result = [];\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n const workload = [];\n\n _docker_socket.listContainers(all, data => {\n let docker_containers = {};\n try {\n docker_containers = data;\n if (docker_containers && Object.prototype.toString.call(docker_containers) === '[object Array]' && docker_containers.length > 0) {\n // GC in _docker_container_stats\n for (let key in _docker_container_stats) {\n if ({}.hasOwnProperty.call(_docker_container_stats, key)) {\n if (!inContainers(docker_containers, key)) { delete _docker_container_stats[key]; }\n }\n }\n\n docker_containers.forEach(function (element) {\n\n if (element.Names && Object.prototype.toString.call(element.Names) === '[object Array]' && element.Names.length > 0) {\n element.Name = element.Names[0].replace(/^\\/|\\/$/g, '');\n }\n workload.push(dockerContainerInspect(element.Id.trim(), element));\n // result.push({\n // id: element.Id,\n // name: element.Name,\n // image: element.Image,\n // imageID: element.ImageID,\n // command: element.Command,\n // created: element.Created,\n // state: element.State,\n // ports: element.Ports,\n // mounts: element.Mounts,\n // // hostconfig: element.HostConfig,\n // // network: element.NetworkSettings\n // });\n });\n if (workload.length) {\n Promise.all(\n workload\n ).then(data => {\n if (callback) { callback(data); }\n resolve(data);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } catch (err) {\n // GC in _docker_container_stats\n for (let key in _docker_container_stats) {\n if ({}.hasOwnProperty.call(_docker_container_stats, key)) {\n if (!inContainers(docker_containers, key)) { delete _docker_container_stats[key]; }\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n });\n}\n\n// --------------------------\n// container inspect (for one container)\n\nfunction dockerContainerInspect(containerID, payload) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n containerID = containerID || '';\n if (typeof containerID !== 'string') {\n return resolve();\n }\n const containerIdSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerID, true)).trim();\n if (containerIdSanitized) {\n\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n\n _docker_socket.getInspect(containerIdSanitized.trim(), data => {\n try {\n resolve({\n id: payload.Id,\n name: payload.Name,\n image: payload.Image,\n imageID: payload.ImageID,\n command: payload.Command,\n created: payload.Created,\n started: data.State && data.State.StartedAt ? Math.round(new Date(data.State.StartedAt).getTime() / 1000) : 0,\n finished: data.State && data.State.FinishedAt && !data.State.FinishedAt.startsWith('0001-01-01') ? Math.round(new Date(data.State.FinishedAt).getTime() / 1000) : 0,\n createdAt: data.Created ? data.Created : '',\n startedAt: data.State && data.State.StartedAt ? data.State.StartedAt : '',\n finishedAt: data.State && data.State.FinishedAt && !data.State.FinishedAt.startsWith('0001-01-01') ? data.State.FinishedAt : '',\n state: payload.State,\n restartCount: data.RestartCount || 0,\n platform: data.Platform || '',\n driver: data.Driver || '',\n ports: payload.Ports,\n mounts: payload.Mounts,\n // hostconfig: payload.HostConfig,\n // network: payload.NetworkSettings\n });\n } catch (err) {\n resolve();\n }\n });\n } else {\n resolve();\n }\n });\n });\n}\n\nexports.dockerContainers = dockerContainers;\n\n// --------------------------\n// helper functions for calculation of docker stats\n\nfunction docker_calcCPUPercent(cpu_stats, precpu_stats) {\n /**\n * @namespace\n * @property {object} cpu_usage\n * @property {number} cpu_usage.total_usage\n * @property {number} system_cpu_usage\n * @property {object} cpu_usage\n * @property {Array} cpu_usage.percpu_usage\n */\n\n if (!_windows) {\n let cpuPercent = 0.0;\n // calculate the change for the cpu usage of the container in between readings\n let cpuDelta = cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage;\n // calculate the change for the entire system between readings\n let systemDelta = cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage;\n\n if (systemDelta > 0.0 && cpuDelta > 0.0) {\n // calculate the change for the cpu usage of the container in between readings\n cpuPercent = (cpuDelta / systemDelta) * cpu_stats.cpu_usage.percpu_usage.length * 100.0;\n }\n\n return cpuPercent;\n } else {\n let nanoSecNow = util.nanoSeconds();\n let cpuPercent = 0.0;\n if (_docker_last_read > 0) {\n let possIntervals = (nanoSecNow - _docker_last_read); // / 100 * os.cpus().length;\n let intervalsUsed = cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage;\n if (possIntervals > 0) {\n cpuPercent = 100.0 * intervalsUsed / possIntervals;\n }\n }\n _docker_last_read = nanoSecNow;\n return cpuPercent;\n }\n}\n\nfunction docker_calcNetworkIO(networks) {\n let rx;\n let wx;\n for (let key in networks) {\n // skip loop if the property is from prototype\n if (!{}.hasOwnProperty.call(networks, key)) { continue; }\n\n /**\n * @namespace\n * @property {number} rx_bytes\n * @property {number} tx_bytes\n */\n let obj = networks[key];\n rx = +obj.rx_bytes;\n wx = +obj.tx_bytes;\n }\n return {\n rx,\n wx\n };\n}\n\nfunction docker_calcBlockIO(blkio_stats) {\n let result = {\n r: 0,\n w: 0\n };\n\n /**\n * @namespace\n * @property {Array} io_service_bytes_recursive\n */\n if (blkio_stats && blkio_stats.io_service_bytes_recursive && Object.prototype.toString.call(blkio_stats.io_service_bytes_recursive) === '[object Array]' && blkio_stats.io_service_bytes_recursive.length > 0) {\n blkio_stats.io_service_bytes_recursive.forEach(function (element) {\n /**\n * @namespace\n * @property {string} op\n * @property {number} value\n */\n\n if (element.op && element.op.toLowerCase() === 'read' && element.value) {\n result.r += element.value;\n }\n if (element.op && element.op.toLowerCase() === 'write' && element.value) {\n result.w += element.value;\n }\n });\n }\n return result;\n}\n\nfunction dockerContainerStats(containerIDs, callback) {\n\n let containerArray = [];\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n // fallback - if only callback is given\n if (util.isFunction(containerIDs) && !callback) {\n callback = containerIDs;\n containerArray = ['*'];\n } else {\n containerIDs = containerIDs || '*';\n if (typeof containerIDs !== 'string') {\n if (callback) { callback([]); }\n return resolve([]);\n }\n let containerIDsSanitized = '';\n containerIDsSanitized.__proto__.toLowerCase = util.stringToLower;\n containerIDsSanitized.__proto__.replace = util.stringReplace;\n containerIDsSanitized.__proto__.trim = util.stringTrim;\n\n containerIDsSanitized = containerIDs;\n containerIDsSanitized = containerIDsSanitized.trim();\n if (containerIDsSanitized !== '*') {\n containerIDsSanitized = '';\n const s = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerIDs, true)).trim();\n for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {\n if (!(s[i] === undefined)) {\n s[i].__proto__.toLowerCase = util.stringToLower;\n const sl = s[i].toLowerCase();\n if (sl && sl[0] && !sl[1]) {\n containerIDsSanitized = containerIDsSanitized + sl[0];\n }\n }\n }\n }\n\n containerIDsSanitized = containerIDsSanitized.trim().toLowerCase().replace(/,+/g, '|');\n containerArray = containerIDsSanitized.split('|');\n }\n\n const result = [];\n\n const workload = [];\n if (containerArray.length && containerArray[0].trim() === '*') {\n containerArray = [];\n dockerContainers().then(allContainers => {\n for (let container of allContainers) {\n containerArray.push(container.id);\n }\n if (containerArray.length) {\n dockerContainerStats(containerArray.join(',')).then(result => {\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n } else {\n for (let containerID of containerArray) {\n workload.push(dockerContainerStatsSingle(containerID.trim()));\n }\n if (workload.length) {\n Promise.all(\n workload\n ).then(data => {\n if (callback) { callback(data); }\n resolve(data);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\n// --------------------------\n// container stats (for one container)\n\nfunction dockerContainerStatsSingle(containerID) {\n containerID = containerID || '';\n let result = {\n id: containerID,\n memUsage: 0,\n memLimit: 0,\n memPercent: 0,\n cpuPercent: 0,\n pids: 0,\n netIO: {\n rx: 0,\n wx: 0\n },\n blockIO: {\n r: 0,\n w: 0\n },\n restartCount: 0,\n cpuStats: {},\n precpuStats: {},\n memoryStats: {},\n networks: {},\n };\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (containerID) {\n\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n\n _docker_socket.getInspect(containerID, dataInspect => {\n try {\n _docker_socket.getStats(containerID, data => {\n try {\n let stats = data;\n\n if (!stats.message) {\n result.memUsage = (stats.memory_stats && stats.memory_stats.usage ? stats.memory_stats.usage : 0);\n result.memLimit = (stats.memory_stats && stats.memory_stats.limit ? stats.memory_stats.limit : 0);\n result.memPercent = (stats.memory_stats && stats.memory_stats.usage && stats.memory_stats.limit ? stats.memory_stats.usage / stats.memory_stats.limit * 100.0 : 0);\n result.cpuPercent = (stats.cpu_stats && stats.precpu_stats ? docker_calcCPUPercent(stats.cpu_stats, stats.precpu_stats) : 0);\n result.pids = (stats.pids_stats && stats.pids_stats.current ? stats.pids_stats.current : 0);\n result.restartCount = (dataInspect.RestartCount ? dataInspect.RestartCount : 0);\n if (stats.networks) { result.netIO = docker_calcNetworkIO(stats.networks); }\n if (stats.blkio_stats) { result.blockIO = docker_calcBlockIO(stats.blkio_stats); }\n result.cpuStats = (stats.cpu_stats ? stats.cpu_stats : {});\n result.precpuStats = (stats.precpu_stats ? stats.precpu_stats : {});\n result.memoryStats = (stats.memory_stats ? stats.memory_stats : {});\n result.networks = (stats.networks ? stats.networks : {});\n }\n } catch (err) {\n util.noop();\n }\n // }\n resolve(result);\n });\n } catch (err) {\n util.noop();\n }\n });\n } else {\n resolve(result);\n }\n });\n });\n}\n\nexports.dockerContainerStats = dockerContainerStats;\n\n// --------------------------\n// container processes (for one container)\n\nfunction dockerContainerProcesses(containerID, callback) {\n let result = [];\n return new Promise((resolve) => {\n process.nextTick(() => {\n containerID = containerID || '';\n if (typeof containerID !== 'string') {\n return resolve(result);\n }\n const containerIdSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerID, true)).trim();\n\n if (containerIdSanitized) {\n\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n\n _docker_socket.getProcesses(containerIdSanitized, data => {\n /**\n * @namespace\n * @property {Array} Titles\n * @property {Array} Processes\n **/\n try {\n if (data && data.Titles && data.Processes) {\n let titles = data.Titles.map(function (value) {\n return value.toUpperCase();\n });\n let pos_pid = titles.indexOf('PID');\n let pos_ppid = titles.indexOf('PPID');\n let pos_pgid = titles.indexOf('PGID');\n let pos_vsz = titles.indexOf('VSZ');\n let pos_time = titles.indexOf('TIME');\n let pos_elapsed = titles.indexOf('ELAPSED');\n let pos_ni = titles.indexOf('NI');\n let pos_ruser = titles.indexOf('RUSER');\n let pos_user = titles.indexOf('USER');\n let pos_rgroup = titles.indexOf('RGROUP');\n let pos_group = titles.indexOf('GROUP');\n let pos_stat = titles.indexOf('STAT');\n let pos_rss = titles.indexOf('RSS');\n let pos_command = titles.indexOf('COMMAND');\n\n data.Processes.forEach(process => {\n result.push({\n pidHost: (pos_pid >= 0 ? process[pos_pid] : ''),\n ppid: (pos_ppid >= 0 ? process[pos_ppid] : ''),\n pgid: (pos_pgid >= 0 ? process[pos_pgid] : ''),\n user: (pos_user >= 0 ? process[pos_user] : ''),\n ruser: (pos_ruser >= 0 ? process[pos_ruser] : ''),\n group: (pos_group >= 0 ? process[pos_group] : ''),\n rgroup: (pos_rgroup >= 0 ? process[pos_rgroup] : ''),\n stat: (pos_stat >= 0 ? process[pos_stat] : ''),\n time: (pos_time >= 0 ? process[pos_time] : ''),\n elapsed: (pos_elapsed >= 0 ? process[pos_elapsed] : ''),\n nice: (pos_ni >= 0 ? process[pos_ni] : ''),\n rss: (pos_rss >= 0 ? process[pos_rss] : ''),\n vsz: (pos_vsz >= 0 ? process[pos_vsz] : ''),\n command: (pos_command >= 0 ? process[pos_command] : '')\n });\n });\n }\n } catch (err) {\n util.noop();\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n}\n\nexports.dockerContainerProcesses = dockerContainerProcesses;\n\nfunction dockerVolumes(callback) {\n\n let result = [];\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n _docker_socket.listVolumes(data => {\n let dockerVolumes = {};\n try {\n dockerVolumes = data;\n if (dockerVolumes && dockerVolumes.Volumes && Object.prototype.toString.call(dockerVolumes.Volumes) === '[object Array]' && dockerVolumes.Volumes.length > 0) {\n\n dockerVolumes.Volumes.forEach(function (element) {\n\n result.push({\n name: element.Name,\n driver: element.Driver,\n labels: element.Labels,\n mountpoint: element.Mountpoint,\n options: element.Options,\n scope: element.Scope,\n created: element.CreatedAt ? Math.round(new Date(element.CreatedAt).getTime() / 1000) : 0,\n });\n });\n if (callback) { callback(result); }\n resolve(result);\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } catch (err) {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n });\n}\n\nexports.dockerVolumes = dockerVolumes;\nfunction dockerAll(callback) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n dockerContainers(true).then(result => {\n if (result && Object.prototype.toString.call(result) === '[object Array]' && result.length > 0) {\n let l = result.length;\n result.forEach(function (element) {\n dockerContainerStats(element.id).then(res => {\n // include stats in array\n element.memUsage = res[0].memUsage;\n element.memLimit = res[0].memLimit;\n element.memPercent = res[0].memPercent;\n element.cpuPercent = res[0].cpuPercent;\n element.pids = res[0].pids;\n element.netIO = res[0].netIO;\n element.blockIO = res[0].blockIO;\n element.cpuStats = res[0].cpuStats;\n element.precpuStats = res[0].precpuStats;\n element.memoryStats = res[0].memoryStats;\n element.networks = res[0].networks;\n\n dockerContainerProcesses(element.id).then(processes => {\n element.processes = processes;\n\n l -= 1;\n if (l === 0) {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n // all done??\n });\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n });\n}\n\nexports.dockerAll = dockerAll;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// dockerSockets.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 13. DockerSockets\n// ----------------------------------------------------------------------------------\n\nconst net = require('net');\nconst isWin = require('os').type() === 'Windows_NT';\nconst socketPath = isWin ? '//./pipe/docker_engine' : '/var/run/docker.sock';\n\nclass DockerSocket {\n\n getInfo(callback) {\n try {\n\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/info HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n }\n\n listImages(all, callback) {\n try {\n\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/images/json' + (all ? '?all=1' : '') + ' HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n }\n\n inspectImage(id, callback) {\n id = id || '';\n if (id) {\n try {\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/images/' + id + '/json?stream=0 HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n } else {\n callback({});\n }\n }\n\n listContainers(all, callback) {\n try {\n\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/containers/json' + (all ? '?all=1' : '') + ' HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n }\n\n getStats(id, callback) {\n id = id || '';\n if (id) {\n try {\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/containers/' + id + '/stats?stream=0 HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n } else {\n callback({});\n }\n }\n\n getInspect(id, callback) {\n id = id || '';\n if (id) {\n try {\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/containers/' + id + '/json?stream=0 HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n } else {\n callback({});\n }\n }\n\n getProcesses(id, callback) {\n id = id || '';\n if (id) {\n try {\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/containers/' + id + '/top?ps_args=-opid,ppid,pgid,vsz,time,etime,nice,ruser,user,rgroup,group,stat,rss,args HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n } else {\n callback({});\n }\n }\n\n listVolumes(callback) {\n try {\n\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/volumes HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n }\n}\n\nmodule.exports = DockerSocket;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// filesystem.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 8. File System\n// ----------------------------------------------------------------------------------\n\nconst util = require('./util');\nconst fs = require('fs');\n\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst execPromiseSave = util.promisifySave(require('child_process').exec);\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nlet _fs_speed = {};\nlet _disk_io = {};\n\n// --------------------------\n// FS - mounted file systems\n\nfunction fsSize(callback) {\n\n let macOsDisks = [];\n\n function getmacOsFsType(fs) {\n if (!fs.startsWith('/')) { return 'NFS'; }\n const parts = fs.split('/');\n const fsShort = parts[parts.length - 1];\n const macOsDisksSingle = macOsDisks.filter(item => item.indexOf(fsShort) >= 0);\n if (macOsDisksSingle.length === 1 && macOsDisksSingle[0].indexOf('APFS') >= 0) { return 'APFS'; }\n return 'HFS';\n }\n\n function parseDf(lines) {\n let data = [];\n lines.forEach(function (line) {\n if (line !== '') {\n line = line.replace(/ +/g, ' ').split(' ');\n if (line && ((line[0].startsWith('/')) || (line[6] && line[6] === '/') || (line[0].indexOf('/') > 0) || (line[0].indexOf(':') === 1))) {\n const fs = line[0];\n const fsType = ((_linux || _freebsd || _openbsd || _netbsd) ? line[1] : getmacOsFsType(line[0]));\n const size = parseInt(((_linux || _freebsd || _openbsd || _netbsd) ? line[2] : line[1])) * 1024;\n const used = parseInt(((_linux || _freebsd || _openbsd || _netbsd) ? line[3] : line[2])) * 1024;\n const available = parseInt(((_linux || _freebsd || _openbsd || _netbsd) ? line[4] : line[3])) * 1024;\n const use = parseFloat((100.0 * (used / (used + available))).toFixed(2));\n line.splice(0, (_linux || _freebsd || _openbsd || _netbsd) ? 6 : 5);\n const mount = line.join(' ');\n // const mount = line[line.length - 1];\n if (!data.find(el => (el.fs === fs && el.type === fsType))) {\n data.push({\n fs,\n type: fsType,\n size,\n used,\n available,\n use,\n mount\n });\n }\n }\n }\n });\n return data;\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let data = [];\n if (_linux || _freebsd || _openbsd || _netbsd || _darwin) {\n let cmd = '';\n if (_darwin) {\n cmd = 'df -kP';\n try {\n macOsDisks = execSync('diskutil list').toString().split('\\n').filter(line => {\n return !line.startsWith('/') && line.indexOf(':') > 0;\n });\n } catch (e) {\n macOsDisks = [];\n }\n }\n if (_linux) { cmd = 'df -lkPTx squashfs | grep -E \"^/|^.\\\\:\"'; }\n if (_freebsd || _openbsd || _netbsd) { cmd = 'df -lkPT'; }\n exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n data = parseDf(lines);\n if (callback) {\n callback(data);\n }\n resolve(data);\n } else {\n exec('df -kPT', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n data = parseDf(lines);\n }\n if (callback) {\n callback(data);\n }\n resolve(data);\n });\n }\n });\n }\n if (_sunos) {\n if (callback) { callback(data); }\n resolve(data);\n }\n if (_windows) {\n try {\n // util.wmic('logicaldisk get Caption,FileSystem,FreeSpace,Size').then((stdout) => {\n util.powerShell('Get-WmiObject Win32_logicaldisk | select Caption,FileSystem,FreeSpace,Size | fl').then((stdout, error) => {\n if (!error) {\n let devices = stdout.toString().split(/\\n\\s*\\n/);\n devices.forEach(function (device) {\n let lines = device.split('\\r\\n');\n const size = util.toInt(util.getValue(lines, 'size', ':'));\n const free = util.toInt(util.getValue(lines, 'freespace', ':'));\n const caption = util.getValue(lines, 'caption', ':');\n if (size) {\n data.push({\n fs: caption,\n type: util.getValue(lines, 'filesystem', ':'),\n size,\n used: size - free,\n available: free,\n use: parseFloat(((100.0 * (size - free)) / size).toFixed(2)),\n mount: caption\n });\n }\n });\n }\n if (callback) {\n callback(data);\n }\n resolve(data);\n });\n } catch (e) {\n if (callback) { callback(data); }\n resolve(data);\n }\n }\n });\n });\n}\n\nexports.fsSize = fsSize;\n\n// --------------------------\n// FS - open files count\n\nfunction fsOpenFiles(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n const result = {\n max: null,\n allocated: null,\n available: null\n };\n if (_freebsd || _openbsd || _netbsd || _darwin) {\n let cmd = 'sysctl -i kern.maxfiles kern.num_files kern.open_files';\n exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n result.max = parseInt(util.getValue(lines, 'kern.maxfiles', ':'), 10);\n result.allocated = parseInt(util.getValue(lines, 'kern.num_files', ':'), 10) || parseInt(util.getValue(lines, 'kern.open_files', ':'), 10);\n result.available = result.max - result.allocated;\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_linux) {\n fs.readFile('/proc/sys/fs/file-nr', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines[0]) {\n const parts = lines[0].replace(/\\s+/g, ' ').split(' ');\n if (parts.length === 3) {\n result.allocated = parseInt(parts[0], 10);\n result.available = parseInt(parts[1], 10);\n result.max = parseInt(parts[2], 10);\n if (!result.available) { result.available = result.max - result.allocated; }\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n } else {\n fs.readFile('/proc/sys/fs/file-max', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines[0]) {\n result.max = parseInt(lines[0], 10);\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n });\n }\n if (_sunos) {\n if (callback) { callback(null); }\n resolve(null);\n }\n if (_windows) {\n if (callback) { callback(null); }\n resolve(null);\n }\n });\n });\n}\n\nexports.fsOpenFiles = fsOpenFiles;\n\n// --------------------------\n// disks\n\nfunction parseBytes(s) {\n return parseInt(s.substr(s.indexOf(' (') + 2, s.indexOf(' Bytes)') - 10));\n}\n\nfunction parseDevices(lines) {\n let devices = [];\n let i = 0;\n lines.forEach(line => {\n if (line.length > 0) {\n if (line[0] === '*') {\n i++;\n } else {\n let parts = line.split(':');\n if (parts.length > 1) {\n if (!devices[i]) {\n devices[i] = {\n name: '',\n identifier: '',\n type: 'disk',\n fsType: '',\n mount: '',\n size: 0,\n physical: 'HDD',\n uuid: '',\n label: '',\n model: '',\n serial: '',\n removable: false,\n protocol: ''\n };\n }\n parts[0] = parts[0].trim().toUpperCase().replace(/ +/g, '');\n parts[1] = parts[1].trim();\n if ('DEVICEIDENTIFIER' === parts[0]) { devices[i].identifier = parts[1]; }\n if ('DEVICENODE' === parts[0]) { devices[i].name = parts[1]; }\n if ('VOLUMENAME' === parts[0]) {\n if (parts[1].indexOf('Not applicable') === -1) { devices[i].label = parts[1]; }\n }\n if ('PROTOCOL' === parts[0]) { devices[i].protocol = parts[1]; }\n if ('DISKSIZE' === parts[0]) { devices[i].size = parseBytes(parts[1]); }\n if ('FILESYSTEMPERSONALITY' === parts[0]) { devices[i].fsType = parts[1]; }\n if ('MOUNTPOINT' === parts[0]) { devices[i].mount = parts[1]; }\n if ('VOLUMEUUID' === parts[0]) { devices[i].uuid = parts[1]; }\n if ('READ-ONLYMEDIA' === parts[0] && parts[1] === 'Yes') { devices[i].physical = 'CD/DVD'; }\n if ('SOLIDSTATE' === parts[0] && parts[1] === 'Yes') { devices[i].physical = 'SSD'; }\n if ('VIRTUAL' === parts[0]) { devices[i].type = 'virtual'; }\n if ('REMOVABLEMEDIA' === parts[0]) { devices[i].removable = (parts[1] === 'Removable'); }\n if ('PARTITIONTYPE' === parts[0]) { devices[i].type = 'part'; }\n if ('DEVICE/MEDIANAME' === parts[0]) { devices[i].model = parts[1]; }\n }\n }\n }\n });\n return devices;\n}\n\nfunction parseBlk(lines) {\n let data = [];\n\n lines.filter(line => line !== '').forEach((line) => {\n try {\n line = decodeURIComponent(line.replace(/\\\\x/g, '%'));\n line = line.replace(/\\\\/g, '\\\\\\\\');\n let disk = JSON.parse(line);\n data.push({\n 'name': disk.name,\n 'type': disk.type,\n 'fsType': disk.fsType,\n 'mount': disk.mountpoint,\n 'size': parseInt(disk.size),\n 'physical': (disk.type === 'disk' ? (disk.rota === '0' ? 'SSD' : 'HDD') : (disk.type === 'rom' ? 'CD/DVD' : '')),\n 'uuid': disk.uuid,\n 'label': disk.label,\n 'model': disk.model,\n 'serial': disk.serial,\n 'removable': disk.rm === '1',\n 'protocol': disk.tran,\n 'group': disk.group,\n });\n } catch (e) {\n util.noop();\n }\n });\n data = util.unique(data);\n data = util.sortByKey(data, ['type', 'name']);\n return data;\n}\n\nfunction blkStdoutToObject(stdout) {\n return stdout.toString()\n .replace(/NAME=/g, '{\"name\":')\n .replace(/FSTYPE=/g, ',\"fsType\":')\n .replace(/TYPE=/g, ',\"type\":')\n .replace(/SIZE=/g, ',\"size\":')\n .replace(/MOUNTPOINT=/g, ',\"mountpoint\":')\n .replace(/UUID=/g, ',\"uuid\":')\n .replace(/ROTA=/g, ',\"rota\":')\n .replace(/RO=/g, ',\"ro\":')\n .replace(/RM=/g, ',\"rm\":')\n .replace(/TRAN=/g, ',\"tran\":')\n .replace(/SERIAL=/g, ',\"serial\":')\n .replace(/LABEL=/g, ',\"label\":')\n .replace(/MODEL=/g, ',\"model\":')\n .replace(/OWNER=/g, ',\"owner\":')\n .replace(/GROUP=/g, ',\"group\":')\n .replace(/\\n/g, '}\\n');\n}\n\nfunction blockDevices(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let data = [];\n if (_linux) {\n // see https://wiki.ubuntuusers.de/lsblk/\n // exec(\"lsblk -bo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,TRAN,SERIAL,LABEL,MODEL,OWNER,GROUP,MODE,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,SCHED,RQ-SIZE,RA,WSAME\", function (error, stdout) {\n exec('lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,TRAN,SERIAL,LABEL,MODEL,OWNER 2>/dev/null', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = blkStdoutToObject(stdout).split('\\n');\n data = parseBlk(lines);\n if (callback) {\n callback(data);\n }\n resolve(data);\n } else {\n exec('lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER 2>/dev/null', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = blkStdoutToObject(stdout).split('\\n');\n data = parseBlk(lines);\n }\n if (callback) {\n callback(data);\n }\n resolve(data);\n });\n }\n });\n }\n if (_darwin) {\n exec('diskutil info -all', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n // parse lines into temp array of devices\n data = parseDevices(lines);\n }\n if (callback) {\n callback(data);\n }\n resolve(data);\n });\n }\n if (_sunos) {\n if (callback) { callback(data); }\n resolve(data);\n }\n if (_windows) {\n let drivetypes = ['Unknown', 'NoRoot', 'Removable', 'Local', 'Network', 'CD/DVD', 'RAM'];\n try {\n // util.wmic('logicaldisk get Caption,Description,DeviceID,DriveType,FileSystem,FreeSpace,Name,Size,VolumeName,VolumeSerialNumber /value').then((stdout, error) => {\n // util.powerShell('Get-WmiObject Win32_logicaldisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl').then((stdout, error) => {\n util.powerShell('Get-CimInstance -ClassName Win32_LogicalDisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl').then((stdout, error) => {\n if (!error) {\n let devices = stdout.toString().split(/\\n\\s*\\n/);\n devices.forEach(function (device) {\n let lines = device.split('\\r\\n');\n let drivetype = util.getValue(lines, 'drivetype', ':');\n if (drivetype) {\n data.push({\n name: util.getValue(lines, 'name', ':'),\n identifier: util.getValue(lines, 'caption', ':'),\n type: 'disk',\n fsType: util.getValue(lines, 'filesystem', ':').toLowerCase(),\n mount: util.getValue(lines, 'caption', ':'),\n size: util.getValue(lines, 'size', ':'),\n physical: (drivetype >= 0 && drivetype <= 6) ? drivetypes[drivetype] : drivetypes[0],\n uuid: util.getValue(lines, 'volumeserialnumber', ':'),\n label: util.getValue(lines, 'volumename', ':'),\n model: '',\n serial: util.getValue(lines, 'volumeserialnumber', ':'),\n removable: drivetype === '2',\n protocol: ''\n });\n }\n });\n }\n if (callback) {\n callback(data);\n }\n resolve(data);\n });\n } catch (e) {\n if (callback) { callback(data); }\n resolve(data);\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n // will follow\n if (callback) { callback(null); }\n resolve(null);\n }\n\n });\n });\n}\n\nexports.blockDevices = blockDevices;\n\n// --------------------------\n// FS - speed\n\nfunction calcFsSpeed(rx, wx) {\n let result = {\n rx: 0,\n wx: 0,\n tx: 0,\n rx_sec: null,\n wx_sec: null,\n tx_sec: null,\n ms: 0\n };\n\n if (_fs_speed && _fs_speed.ms) {\n result.rx = rx;\n result.wx = wx;\n result.tx = result.rx + result.wx;\n result.ms = Date.now() - _fs_speed.ms;\n result.rx_sec = (result.rx - _fs_speed.bytes_read) / (result.ms / 1000);\n result.wx_sec = (result.wx - _fs_speed.bytes_write) / (result.ms / 1000);\n result.tx_sec = result.rx_sec + result.wx_sec;\n _fs_speed.rx_sec = result.rx_sec;\n _fs_speed.wx_sec = result.wx_sec;\n _fs_speed.tx_sec = result.tx_sec;\n _fs_speed.bytes_read = result.rx;\n _fs_speed.bytes_write = result.wx;\n _fs_speed.bytes_overall = result.rx + result.wx;\n _fs_speed.ms = Date.now();\n _fs_speed.last_ms = result.ms;\n } else {\n result.rx = rx;\n result.wx = wx;\n result.tx = result.rx + result.wx;\n _fs_speed.rx_sec = null;\n _fs_speed.wx_sec = null;\n _fs_speed.tx_sec = null;\n _fs_speed.bytes_read = result.rx;\n _fs_speed.bytes_write = result.wx;\n _fs_speed.bytes_overall = result.rx + result.wx;\n _fs_speed.ms = Date.now();\n _fs_speed.last_ms = 0;\n }\n return result;\n}\n\nfunction fsStats(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (_windows || _freebsd || _openbsd || _netbsd || _sunos) {\n return resolve(null);\n }\n\n let result = {\n rx: 0,\n wx: 0,\n tx: 0,\n rx_sec: null,\n wx_sec: null,\n tx_sec: null,\n ms: 0\n };\n\n let rx = 0;\n let wx = 0;\n if ((_fs_speed && !_fs_speed.ms) || (_fs_speed && _fs_speed.ms && Date.now() - _fs_speed.ms >= 500)) {\n if (_linux) {\n // exec(\"df -k | grep /dev/\", function(error, stdout) {\n exec('lsblk -r 2>/dev/null | grep /', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n let fs_filter = [];\n lines.forEach(function (line) {\n if (line !== '') {\n line = line.trim().split(' ');\n if (fs_filter.indexOf(line[0]) === -1) { fs_filter.push(line[0]); }\n }\n });\n\n let output = fs_filter.join('|');\n exec('cat /proc/diskstats | egrep \"' + output + '\"', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n line = line.trim();\n if (line !== '') {\n line = line.replace(/ +/g, ' ').split(' ');\n\n rx += parseInt(line[5]) * 512;\n wx += parseInt(line[9]) * 512;\n }\n });\n result = calcFsSpeed(rx, wx);\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n }\n if (_darwin) {\n exec('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n \"/IOBlockStorageDriver/,/Statistics/p\" | grep \"Statistics\" | tr -cd \"01234567890,\\n\"', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n line = line.trim();\n if (line !== '') {\n line = line.split(',');\n\n rx += parseInt(line[2]);\n wx += parseInt(line[9]);\n }\n });\n result = calcFsSpeed(rx, wx);\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n } else {\n result.ms = _fs_speed.last_ms;\n result.rx = _fs_speed.bytes_read;\n result.wx = _fs_speed.bytes_write;\n result.tx = _fs_speed.bytes_read + _fs_speed.bytes_write;\n result.rx_sec = _fs_speed.rx_sec;\n result.wx_sec = _fs_speed.wx_sec;\n result.tx_sec = _fs_speed.tx_sec;\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n });\n}\n\nexports.fsStats = fsStats;\n\nfunction calcDiskIO(rIO, wIO, rWaitTime, wWaitTime, tWaitTime) {\n let result = {\n rIO: 0,\n wIO: 0,\n tIO: 0,\n rIO_sec: null,\n wIO_sec: null,\n tIO_sec: null,\n rWaitTime: 0,\n wWaitTime: 0,\n tWaitTime: 0,\n rWaitPercent: null,\n wWaitPercent: null,\n tWaitPercent: null,\n ms: 0\n };\n if (_disk_io && _disk_io.ms) {\n result.rIO = rIO;\n result.wIO = wIO;\n result.tIO = rIO + wIO;\n result.ms = Date.now() - _disk_io.ms;\n result.rIO_sec = (result.rIO - _disk_io.rIO) / (result.ms / 1000);\n result.wIO_sec = (result.wIO - _disk_io.wIO) / (result.ms / 1000);\n result.tIO_sec = result.rIO_sec + result.wIO_sec;\n result.rWaitTime = rWaitTime;\n result.wWaitTime = wWaitTime;\n result.tWaitTime = tWaitTime;\n result.rWaitPercent = (result.rWaitTime - _disk_io.rWaitTime) * 100 / (result.ms);\n result.wWaitPercent = (result.wWaitTime - _disk_io.wWaitTime) * 100 / (result.ms);\n result.tWaitPercent = (result.tWaitTime - _disk_io.tWaitTime) * 100 / (result.ms);\n _disk_io.rIO = rIO;\n _disk_io.wIO = wIO;\n _disk_io.rIO_sec = result.rIO_sec;\n _disk_io.wIO_sec = result.wIO_sec;\n _disk_io.tIO_sec = result.tIO_sec;\n _disk_io.rWaitTime = rWaitTime;\n _disk_io.wWaitTime = wWaitTime;\n _disk_io.tWaitTime = tWaitTime;\n _disk_io.rWaitPercent = result.rWaitPercent;\n _disk_io.wWaitPercent = result.wWaitPercent;\n _disk_io.tWaitPercent = result.tWaitPercent;\n _disk_io.last_ms = result.ms;\n _disk_io.ms = Date.now();\n } else {\n result.rIO = rIO;\n result.wIO = wIO;\n result.tIO = rIO + wIO;\n result.rWaitTime = rWaitTime;\n result.wWaitTime = wWaitTime;\n result.tWaitTime = tWaitTime;\n _disk_io.rIO = rIO;\n _disk_io.wIO = wIO;\n _disk_io.rIO_sec = null;\n _disk_io.wIO_sec = null;\n _disk_io.tIO_sec = null;\n _disk_io.rWaitTime = rWaitTime;\n _disk_io.wWaitTime = wWaitTime;\n _disk_io.tWaitTime = tWaitTime;\n _disk_io.rWaitPercent = null;\n _disk_io.wWaitPercent = null;\n _disk_io.tWaitPercent = null;\n _disk_io.last_ms = 0;\n _disk_io.ms = Date.now();\n }\n return result;\n}\n\nfunction disksIO(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (_windows) {\n return resolve(null);\n }\n if (_sunos) {\n return resolve(null);\n }\n\n let result = {\n rIO: 0,\n wIO: 0,\n tIO: 0,\n rIO_sec: null,\n wIO_sec: null,\n tIO_sec: null,\n rWaitTime: 0,\n wWaitTime: 0,\n tWaitTime: 0,\n rWaitPercent: null,\n wWaitPercent: null,\n tWaitPercent: null,\n ms: 0\n };\n let rIO = 0;\n let wIO = 0;\n let rWaitTime = 0;\n let wWaitTime = 0;\n let tWaitTime = 0;\n\n if ((_disk_io && !_disk_io.ms) || (_disk_io && _disk_io.ms && Date.now() - _disk_io.ms >= 500)) {\n if (_linux || _freebsd || _openbsd || _netbsd) {\n // prints Block layer statistics for all mounted volumes\n // var cmd = \"for mount in `lsblk | grep / | sed -r 's/│ └─//' | cut -d ' ' -f 1`; do cat /sys/block/$mount/stat | sed -r 's/ +/;/g' | sed -r 's/^;//'; done\";\n // var cmd = \"for mount in `lsblk | grep / | sed 's/[│└─├]//g' | awk '{$1=$1};1' | cut -d ' ' -f 1 | sort -u`; do cat /sys/block/$mount/stat | sed -r 's/ +/;/g' | sed -r 's/^;//'; done\";\n let cmd = 'for mount in `lsblk 2>/dev/null | grep \" disk \" | sed \"s/[│└─├]//g\" | awk \\'{$1=$1};1\\' | cut -d \" \" -f 1 | sort -u`; do cat /sys/block/$mount/stat | sed -r \"s/ +/;/g\" | sed -r \"s/^;//\"; done';\n\n exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.split('\\n');\n lines.forEach(function (line) {\n // ignore empty lines\n if (!line) { return; }\n\n // sum r/wIO of all disks to compute all disks IO\n let stats = line.split(';');\n rIO += parseInt(stats[0]);\n wIO += parseInt(stats[4]);\n rWaitTime += parseInt(stats[3]);\n wWaitTime += parseInt(stats[7]);\n tWaitTime += parseInt(stats[10]);\n });\n result = calcDiskIO(rIO, wIO, rWaitTime, wWaitTime, tWaitTime);\n\n if (callback) {\n callback(result);\n }\n resolve(result);\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n }\n if (_darwin) {\n exec('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n \"/IOBlockStorageDriver/,/Statistics/p\" | grep \"Statistics\" | tr -cd \"01234567890,\\n\"', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n line = line.trim();\n if (line !== '') {\n line = line.split(',');\n\n rIO += parseInt(line[10]);\n wIO += parseInt(line[0]);\n }\n });\n result = calcDiskIO(rIO, wIO, rWaitTime, wWaitTime, tWaitTime);\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n } else {\n result.rIO = _disk_io.rIO;\n result.wIO = _disk_io.wIO;\n result.tIO = _disk_io.rIO + _disk_io.wIO;\n result.ms = _disk_io.last_ms;\n result.rIO_sec = _disk_io.rIO_sec;\n result.wIO_sec = _disk_io.wIO_sec;\n result.tIO_sec = _disk_io.tIO_sec;\n result.rWaitTime = _disk_io.rWaitTime;\n result.wWaitTime = _disk_io.wWaitTime;\n result.tWaitTime = _disk_io.tWaitTime;\n result.rWaitPercent = _disk_io.rWaitPercent;\n result.wWaitPercent = _disk_io.wWaitPercent;\n result.tWaitPercent = _disk_io.tWaitPercent;\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n });\n}\n\nexports.disksIO = disksIO;\n\nfunction diskLayout(callback) {\n\n function getVendorFromModel(model) {\n const diskManufacturers = [\n { pattern: 'WESTERN.*', manufacturer: 'Western Digital' },\n { pattern: '^WDC.*', manufacturer: 'Western Digital' },\n { pattern: 'WD.*', manufacturer: 'Western Digital' },\n { pattern: 'TOSHIBA.*', manufacturer: 'Toshiba' },\n { pattern: 'HITACHI.*', manufacturer: 'Hitachi' },\n { pattern: '^IC.*', manufacturer: 'Hitachi' },\n { pattern: '^HTS.*', manufacturer: 'Hitachi' },\n { pattern: 'SANDISK.*', manufacturer: 'SanDisk' },\n { pattern: 'KINGSTON.*', manufacturer: 'Kingston Technology' },\n { pattern: '^SONY.*', manufacturer: 'Sony' },\n { pattern: 'TRANSCEND.*', manufacturer: 'Transcend' },\n { pattern: 'SAMSUNG.*', manufacturer: 'Samsung' },\n { pattern: '^ST(?!I\\\\ ).*', manufacturer: 'Seagate' },\n { pattern: '^STI\\\\ .*', manufacturer: 'SimpleTech' },\n { pattern: '^D...-.*', manufacturer: 'IBM' },\n { pattern: '^IBM.*', manufacturer: 'IBM' },\n { pattern: '^FUJITSU.*', manufacturer: 'Fujitsu' },\n { pattern: '^MP.*', manufacturer: 'Fujitsu' },\n { pattern: '^MK.*', manufacturer: 'Toshiba' },\n { pattern: 'MAXTO.*', manufacturer: 'Maxtor' },\n { pattern: 'PIONEER.*', manufacturer: 'Pioneer' },\n { pattern: 'PHILIPS.*', manufacturer: 'Philips' },\n { pattern: 'QUANTUM.*', manufacturer: 'Quantum Technology' },\n { pattern: 'FIREBALL.*', manufacturer: 'Quantum Technology' },\n { pattern: '^VBOX.*', manufacturer: 'VirtualBox' },\n { pattern: 'CORSAIR.*', manufacturer: 'Corsair Components' },\n { pattern: 'CRUCIAL.*', manufacturer: 'Crucial' },\n { pattern: 'ECM.*', manufacturer: 'ECM' },\n { pattern: 'INTEL.*', manufacturer: 'INTEL' },\n { pattern: 'EVO.*', manufacturer: 'Samsung' },\n { pattern: 'APPLE.*', manufacturer: 'Apple' },\n ];\n\n let result = '';\n if (model) {\n model = model.toUpperCase();\n diskManufacturers.forEach((manufacturer) => {\n const re = RegExp(manufacturer.pattern);\n if (re.test(model)) { result = manufacturer.manufacturer; }\n });\n }\n return result;\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n const commitResult = res => {\n for (let i = 0; i < res.length; i++) {\n delete res[i].BSDName;\n }\n if (callback) {\n callback(res);\n }\n resolve(res);\n };\n\n let result = [];\n let cmd = '';\n\n if (_linux) {\n let cmdFullSmart = '';\n\n exec('export LC_ALL=C; lsblk -ablJO 2>/dev/null; unset LC_ALL', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n try {\n const out = stdout.toString().trim();\n let devices = [];\n try {\n const outJSON = JSON.parse(out);\n if (outJSON && {}.hasOwnProperty.call(outJSON, 'blockdevices')) {\n devices = outJSON.blockdevices.filter(item => { return (item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fsType === null && item.parttype === null)); });\n }\n } catch (e) {\n // fallback to older version of lsblk\n const out2 = execSync('export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL').toString();\n let lines = blkStdoutToObject(out2).split('\\n');\n const data = parseBlk(lines);\n devices = data.filter(item => { return (item.type === 'disk') && item.size > 0 && ((item.model !== null && item.model !== '') || (item.mount === '' && item.label === '' && item.fsType === '')); });\n }\n devices.forEach((device) => {\n let mediumType = '';\n const BSDName = '/dev/' + device.name;\n const logical = device.name;\n try {\n mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational 2>/dev/null').toString().split('\\n')[0];\n } catch (e) {\n util.noop();\n }\n let interfaceType = device.tran ? device.tran.toUpperCase().trim() : '';\n if (interfaceType === 'NVME') {\n mediumType = '2';\n interfaceType = 'PCIe';\n }\n result.push({\n device: BSDName,\n type: (mediumType === '0' ? 'SSD' : (mediumType === '1' ? 'HD' : (mediumType === '2' ? 'NVMe' : (device.model && device.model.indexOf('SSD') > -1 ? 'SSD' : (device.model && device.model.indexOf('NVM') > -1 ? 'NVMe' : 'HD'))))),\n name: device.model || '',\n vendor: getVendorFromModel(device.model) || (device.vendor ? device.vendor.trim() : ''),\n size: device.size || 0,\n bytesPerSector: null,\n totalCylinders: null,\n totalHeads: null,\n totalSectors: null,\n totalTracks: null,\n tracksPerCylinder: null,\n sectorsPerTrack: null,\n firmwareRevision: device.rev ? device.rev.trim() : '',\n serialNum: device.serial ? device.serial.trim() : '',\n interfaceType: interfaceType,\n smartStatus: 'unknown',\n temperature: null,\n BSDName: BSDName\n });\n cmd += `printf \"\\n${BSDName}|\"; smartctl -H ${BSDName} | grep overall;`;\n cmdFullSmart += `${cmdFullSmart ? 'printf \",\";' : ''}smartctl -a -j ${BSDName};`;\n });\n } catch (e) {\n util.noop();\n }\n }\n // check S.M.A.R.T. status\n if (cmdFullSmart) {\n exec(cmdFullSmart, { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n try {\n const data = JSON.parse(`[${stdout}]`);\n data.forEach(disk => {\n const diskBSDName = disk.smartctl.argv[disk.smartctl.argv.length - 1];\n\n for (let i = 0; i < result.length; i++) {\n if (result[i].BSDName === diskBSDName) {\n result[i].smartStatus = (disk.smart_status.passed ? 'Ok' : (disk.smart_status.passed === false ? 'Predicted Failure' : 'unknown'));\n if (disk.temperature && disk.temperature.current) {\n result[i].temperature = disk.temperature.current;\n }\n result[i].smartData = disk;\n }\n }\n });\n commitResult(result);\n } catch (e) {\n if (cmd) {\n cmd = cmd + 'printf \"\\n\"';\n exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(line => {\n if (line) {\n let parts = line.split('|');\n if (parts.length === 2) {\n let BSDName = parts[0];\n parts[1] = parts[1].trim();\n let parts2 = parts[1].split(':');\n if (parts2.length === 2) {\n parts2[1] = parts2[1].trim();\n let status = parts2[1].toLowerCase();\n for (let i = 0; i < result.length; i++) {\n if (result[i].BSDName === BSDName) {\n result[i].smartStatus = (status === 'passed' ? 'Ok' : (status === 'failed!' ? 'Predicted Failure' : 'unknown'));\n }\n }\n }\n }\n }\n });\n commitResult(result);\n });\n } else {\n commitResult(result);\n }\n }\n });\n } else {\n commitResult(result);\n }\n });\n }\n if (_freebsd || _openbsd || _netbsd) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_darwin) {\n exec('system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n // split by type:\n let lines = stdout.toString().split('\\n');\n let linesSATA = [];\n let linesNVMe = [];\n let linesUSB = [];\n let dataType = 'SATA';\n lines.forEach(line => {\n if (line === 'NVMExpress:') { dataType = 'NVMe'; }\n else if (line === 'USB:') { dataType = 'USB'; }\n else if (line === 'SATA/SATA Express:') { dataType = 'SATA'; }\n else if (dataType === 'SATA') { linesSATA.push(line); }\n else if (dataType === 'NVMe') { linesNVMe.push(line); }\n else if (dataType === 'USB') { linesUSB.push(line); }\n });\n try {\n // Serial ATA Drives\n let devices = linesSATA.join('\\n').split(' Physical Interconnect: ');\n devices.shift();\n devices.forEach(function (device) {\n device = 'InterfaceType: ' + device;\n let lines = device.split('\\n');\n const mediumType = util.getValue(lines, 'Medium Type', ':', true).trim();\n const sizeStr = util.getValue(lines, 'capacity', ':', true).trim();\n const BSDName = util.getValue(lines, 'BSD Name', ':', true).trim();\n if (sizeStr) {\n let sizeValue = 0;\n if (sizeStr.indexOf('(') >= 0) {\n sizeValue = parseInt(sizeStr.match(/\\(([^)]+)\\)/)[1].replace(/\\./g, '').replace(/,/g, '').replace(/\\s/g, ''));\n }\n if (!sizeValue) {\n sizeValue = parseInt(sizeStr);\n }\n if (sizeValue) {\n const smartStatusString = util.getValue(lines, 'S.M.A.R.T. status', ':', true).trim().toLowerCase();\n result.push({\n device: BSDName,\n type: mediumType.startsWith('Solid') ? 'SSD' : 'HD',\n name: util.getValue(lines, 'Model', ':', true).trim(),\n vendor: getVendorFromModel(util.getValue(lines, 'Model', ':', true).trim()) || util.getValue(lines, 'Manufacturer', ':', true),\n size: sizeValue,\n bytesPerSector: null,\n totalCylinders: null,\n totalHeads: null,\n totalSectors: null,\n totalTracks: null,\n tracksPerCylinder: null,\n sectorsPerTrack: null,\n firmwareRevision: util.getValue(lines, 'Revision', ':', true).trim(),\n serialNum: util.getValue(lines, 'Serial Number', ':', true).trim(),\n interfaceType: util.getValue(lines, 'InterfaceType', ':', true).trim(),\n smartStatus: smartStatusString === 'verified' ? 'OK' : smartStatusString || 'unknown',\n temperature: null,\n BSDName: BSDName\n });\n cmd = cmd + 'printf \"\\n' + BSDName + '|\"; diskutil info /dev/' + BSDName + ' | grep SMART;';\n }\n }\n });\n } catch (e) {\n util.noop();\n }\n\n // NVME Drives\n try {\n let devices = linesNVMe.join('\\n').split('\\n\\n Capacity:');\n devices.shift();\n devices.forEach(function (device) {\n device = '!Capacity: ' + device;\n let lines = device.split('\\n');\n const linkWidth = util.getValue(lines, 'link width', ':', true).trim();\n const sizeStr = util.getValue(lines, '!capacity', ':', true).trim();\n const BSDName = util.getValue(lines, 'BSD Name', ':', true).trim();\n if (sizeStr) {\n let sizeValue = 0;\n if (sizeStr.indexOf('(') >= 0) {\n sizeValue = parseInt(sizeStr.match(/\\(([^)]+)\\)/)[1].replace(/\\./g, '').replace(/,/g, '').replace(/\\s/g, ''));\n }\n if (!sizeValue) {\n sizeValue = parseInt(sizeStr);\n }\n if (sizeValue) {\n const smartStatusString = util.getValue(lines, 'S.M.A.R.T. status', ':', true).trim().toLowerCase();\n result.push({\n device: BSDName,\n type: 'NVMe',\n name: util.getValue(lines, 'Model', ':', true).trim(),\n vendor: getVendorFromModel(util.getValue(lines, 'Model', ':', true).trim()),\n size: sizeValue,\n bytesPerSector: null,\n totalCylinders: null,\n totalHeads: null,\n totalSectors: null,\n totalTracks: null,\n tracksPerCylinder: null,\n sectorsPerTrack: null,\n firmwareRevision: util.getValue(lines, 'Revision', ':', true).trim(),\n serialNum: util.getValue(lines, 'Serial Number', ':', true).trim(),\n interfaceType: ('PCIe ' + linkWidth).trim(),\n smartStatus: smartStatusString === 'verified' ? 'OK' : smartStatusString || 'unknown',\n temperature: null,\n BSDName: BSDName\n });\n cmd = cmd + 'printf \"\\n' + BSDName + '|\"; diskutil info /dev/' + BSDName + ' | grep SMART;';\n }\n }\n });\n } catch (e) {\n util.noop();\n }\n // USB Drives\n try {\n let devices = linesUSB.join('\\n').replaceAll('Media:\\n ', 'Model:').split('\\n\\n Product ID:');\n devices.shift();\n devices.forEach(function (device) {\n let lines = device.split('\\n');\n const sizeStr = util.getValue(lines, 'Capacity', ':', true).trim();\n const BSDName = util.getValue(lines, 'BSD Name', ':', true).trim();\n if (sizeStr) {\n let sizeValue = 0;\n if (sizeStr.indexOf('(') >= 0) {\n sizeValue = parseInt(sizeStr.match(/\\(([^)]+)\\)/)[1].replace(/\\./g, '').replace(/,/g, '').replace(/\\s/g, ''));\n }\n if (!sizeValue) {\n sizeValue = parseInt(sizeStr);\n }\n if (sizeValue) {\n const smartStatusString = util.getValue(lines, 'S.M.A.R.T. status', ':', true).trim().toLowerCase();\n result.push({\n device: BSDName,\n type: 'USB',\n name: util.getValue(lines, 'Model', ':', true).trim().replaceAll(':', ''),\n vendor: getVendorFromModel(util.getValue(lines, 'Model', ':', true).trim()),\n size: sizeValue,\n bytesPerSector: null,\n totalCylinders: null,\n totalHeads: null,\n totalSectors: null,\n totalTracks: null,\n tracksPerCylinder: null,\n sectorsPerTrack: null,\n firmwareRevision: util.getValue(lines, 'Revision', ':', true).trim(),\n serialNum: util.getValue(lines, 'Serial Number', ':', true).trim(),\n interfaceType: 'USB',\n smartStatus: smartStatusString === 'verified' ? 'OK' : smartStatusString || 'unknown',\n temperature: null,\n BSDName: BSDName\n });\n cmd = cmd + 'printf \"\\n' + BSDName + '|\"; diskutil info /dev/' + BSDName + ' | grep SMART;';\n }\n }\n });\n } catch (e) {\n util.noop();\n }\n if (cmd) {\n cmd = cmd + 'printf \"\\n\"';\n exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(line => {\n if (line) {\n let parts = line.split('|');\n if (parts.length === 2) {\n let BSDName = parts[0];\n parts[1] = parts[1].trim();\n let parts2 = parts[1].split(':');\n if (parts2.length === 2) {\n parts2[1] = parts2[1].trim();\n let status = parts2[1].toLowerCase();\n for (let i = 0; i < result.length; i++) {\n if (result[i].BSDName === BSDName) {\n result[i].smartStatus = (status === 'not supported' ? 'not supported' : (status === 'verified' ? 'Ok' : (status === 'failing' ? 'Predicted Failure' : 'unknown')));\n }\n }\n }\n }\n }\n });\n for (let i = 0; i < result.length; i++) {\n delete result[i].BSDName;\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else {\n for (let i = 0; i < result.length; i++) {\n delete result[i].BSDName;\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n }\n });\n }\n if (_windows) {\n try {\n const workload = [];\n workload.push(util.powerShell('Get-WmiObject Win32_DiskDrive | select Caption,Size,Status,PNPDeviceId,BytesPerSector,TotalCylinders,TotalHeads,TotalSectors,TotalTracks,TracksPerCylinder,SectorsPerTrack,FirmwareRevision,SerialNumber,InterfaceType | fl'));\n workload.push(util.powerShell('Get-PhysicalDisk | select BusType,MediaType,FriendlyName,Model,SerialNumber,Size | fl'));\n if (util.smartMonToolsInstalled()) {\n try {\n const smartDev = JSON.parse(execSync('smartctl --scan -j'));\n if (smartDev && smartDev.devices && smartDev.devices.length > 0) {\n smartDev.devices.forEach((dev) => {\n workload.push(execPromiseSave(`smartctl -j -a ${dev.name}`, util.execOptsWin));\n });\n }\n } catch (e) {\n util.noop();\n }\n }\n util.promiseAll(\n workload\n ).then(data => {\n let devices = data.results[0].toString().split(/\\n\\s*\\n/);\n devices.forEach(function (device) {\n let lines = device.split('\\r\\n');\n const size = util.getValue(lines, 'Size', ':').trim();\n const status = util.getValue(lines, 'Status', ':').trim().toLowerCase();\n if (size) {\n result.push({\n device: util.getValue(lines, 'PNPDeviceId', ':'),\n type: device.indexOf('SSD') > -1 ? 'SSD' : 'HD', // just a starting point ... better: MSFT_PhysicalDisk - Media Type ... see below\n name: util.getValue(lines, 'Caption', ':'),\n vendor: getVendorFromModel(util.getValue(lines, 'Caption', ':', true).trim()),\n size: parseInt(size),\n bytesPerSector: parseInt(util.getValue(lines, 'BytesPerSector', ':')),\n totalCylinders: parseInt(util.getValue(lines, 'TotalCylinders', ':')),\n totalHeads: parseInt(util.getValue(lines, 'TotalHeads', ':')),\n totalSectors: parseInt(util.getValue(lines, 'TotalSectors', ':')),\n totalTracks: parseInt(util.getValue(lines, 'TotalTracks', ':')),\n tracksPerCylinder: parseInt(util.getValue(lines, 'TracksPerCylinder', ':')),\n sectorsPerTrack: parseInt(util.getValue(lines, 'SectorsPerTrack', ':')),\n firmwareRevision: util.getValue(lines, 'FirmwareRevision', ':').trim(),\n serialNum: util.getValue(lines, 'SerialNumber', ':').trim(),\n interfaceType: util.getValue(lines, 'InterfaceType', ':').trim(),\n smartStatus: (status === 'ok' ? 'Ok' : (status === 'degraded' ? 'Degraded' : (status === 'pred fail' ? 'Predicted Failure' : 'Unknown'))),\n temperature: null,\n });\n }\n });\n devices = data.results[1].split(/\\n\\s*\\n/);\n devices.forEach(function (device) {\n let lines = device.split('\\r\\n');\n const serialNum = util.getValue(lines, 'SerialNumber', ':').trim();\n const name = util.getValue(lines, 'FriendlyName', ':').trim().replace('Msft ', 'Microsoft');\n const size = util.getValue(lines, 'Size', ':').trim();\n const model = util.getValue(lines, 'Model', ':').trim();\n const interfaceType = util.getValue(lines, 'BusType', ':').trim();\n let mediaType = util.getValue(lines, 'MediaType', ':').trim();\n if (mediaType === '3' || mediaType === 'HDD') { mediaType = 'HD'; }\n if (mediaType === '4') { mediaType = 'SSD'; }\n if (mediaType === '5') { mediaType = 'SCM'; }\n if (mediaType === 'Unspecified' && (model.toLowerCase().indexOf('virtual') > -1 || model.toLowerCase().indexOf('vbox') > -1)) { mediaType = 'Virtual'; }\n if (size) {\n let i = util.findObjectByKey(result, 'serialNum', serialNum);\n if (i === -1 || serialNum === '') {\n i = util.findObjectByKey(result, 'name', name);\n }\n if (i != -1) {\n result[i].type = mediaType;\n result[i].interfaceType = interfaceType;\n }\n }\n });\n // S.M.A.R.T\n data.results.shift();\n data.results.shift();\n if (data.results.length) {\n data.results.forEach((smartStr) => {\n try {\n const smartData = JSON.parse(smartStr);\n if (smartData.serial_number) {\n const serialNum = smartData.serial_number;\n let i = util.findObjectByKey(result, 'serialNum', serialNum);\n if (i != -1) {\n result[i].smartStatus = (smartData.smart_status && smartData.smart_status.passed ? 'Ok' : (smartData.smart_status && smartData.smart_status.passed === false ? 'Predicted Failure' : 'unknown'));\n if (smartData.temperature && smartData.temperature.current) {\n result[i].temperature = smartData.temperature.current;\n }\n result[i].smartData = smartData;\n }\n }\n } catch (e) {\n util.noop();\n }\n });\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.diskLayout = diskLayout;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// graphics.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 7. Graphics (controller, display)\n// ----------------------------------------------------------------------------------\n\nconst fs = require('fs');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst util = require('./util');\n\nlet _platform = process.platform;\nlet _nvidiaSmiPath = '';\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nlet _resolutionX = 0;\nlet _resolutionY = 0;\nlet _pixelDepth = 0;\nlet _refreshRate = 0;\n\nconst videoTypes = {\n '-2': 'UNINITIALIZED',\n '-1': 'OTHER',\n '0': 'HD15',\n '1': 'SVIDEO',\n '2': 'Composite video',\n '3': 'Component video',\n '4': 'DVI',\n '5': 'HDMI',\n '6': 'LVDS',\n '8': 'D_JPN',\n '9': 'SDI',\n '10': 'DP',\n '11': 'DP embedded',\n '12': 'UDI',\n '13': 'UDI embedded',\n '14': 'SDTVDONGLE',\n '15': 'MIRACAST',\n '2147483648': 'INTERNAL'\n};\n\nfunction getVendorFromModel(model) {\n const manufacturers = [\n { pattern: '^LG.+', manufacturer: 'LG' },\n { pattern: '^BENQ.+', manufacturer: 'BenQ' },\n { pattern: '^ASUS.+', manufacturer: 'Asus' },\n { pattern: '^DELL.+', manufacturer: 'Dell' },\n { pattern: '^SAMSUNG.+', manufacturer: 'Samsung' },\n { pattern: '^VIEWSON.+', manufacturer: 'ViewSonic' },\n { pattern: '^SONY.+', manufacturer: 'Sony' },\n { pattern: '^ACER.+', manufacturer: 'Acer' },\n { pattern: '^AOC.+', manufacturer: 'AOC Monitors' },\n { pattern: '^HP.+', manufacturer: 'HP' },\n { pattern: '^EIZO.?', manufacturer: 'Eizo' },\n { pattern: '^PHILIPS.?', manufacturer: 'Philips' },\n { pattern: '^IIYAMA.?', manufacturer: 'Iiyama' },\n { pattern: '^SHARP.?', manufacturer: 'Sharp' },\n { pattern: '^NEC.?', manufacturer: 'NEC' },\n { pattern: '^LENOVO.?', manufacturer: 'Lenovo' },\n { pattern: 'COMPAQ.?', manufacturer: 'Compaq' },\n { pattern: 'APPLE.?', manufacturer: 'Apple' },\n { pattern: 'INTEL.?', manufacturer: 'Intel' },\n { pattern: 'AMD.?', manufacturer: 'AMD' },\n { pattern: 'NVIDIA.?', manufacturer: 'NVDIA' },\n ];\n\n let result = '';\n if (model) {\n model = model.toUpperCase();\n manufacturers.forEach((manufacturer) => {\n const re = RegExp(manufacturer.pattern);\n if (re.test(model)) { result = manufacturer.manufacturer; }\n });\n }\n return result;\n}\n\nfunction getVendorFromId(id) {\n const vendors = {\n '610': 'Apple',\n '1e6d': 'LG',\n '10ac': 'DELL',\n '4dd9': 'Sony',\n '38a3': 'NEC',\n };\n return vendors[id] || '';\n}\n\nfunction vendorToId(str) {\n let result = '';\n str = (str || '').toLowerCase();\n if (str.indexOf('apple') >= 0) { result = '0x05ac'; }\n else if (str.indexOf('nvidia') >= 0) { result = '0x10de'; }\n else if (str.indexOf('intel') >= 0) { result = '0x8086'; }\n else if (str.indexOf('ati') >= 0 || str.indexOf('amd') >= 0) { result = '0x1002'; }\n\n return result;\n}\n\nfunction getMetalVersion(id) {\n const families = {\n 'spdisplays_mtlgpufamilymac1': 'mac1',\n 'spdisplays_mtlgpufamilymac2': 'mac2',\n 'spdisplays_mtlgpufamilyapple1': 'apple1',\n 'spdisplays_mtlgpufamilyapple2': 'apple2',\n 'spdisplays_mtlgpufamilyapple3': 'apple3',\n 'spdisplays_mtlgpufamilyapple4': 'apple4',\n 'spdisplays_mtlgpufamilyapple5': 'apple5',\n 'spdisplays_mtlgpufamilyapple6': 'apple6',\n 'spdisplays_mtlgpufamilyapple7': 'apple7',\n 'spdisplays_metalfeaturesetfamily11': 'family1_v1',\n 'spdisplays_metalfeaturesetfamily12': 'family1_v2',\n 'spdisplays_metalfeaturesetfamily13': 'family1_v3',\n 'spdisplays_metalfeaturesetfamily14': 'family1_v4',\n 'spdisplays_metalfeaturesetfamily21': 'family2_v1'\n };\n return families[id] || '';\n}\n\nfunction graphics(callback) {\n\n function parseLinesDarwin(graphicsArr) {\n const res = {\n controllers: [],\n displays: []\n };\n try {\n graphicsArr.forEach(function (item) {\n // controllers\n const bus = ((item.sppci_bus || '').indexOf('builtin') > -1 ? 'Built-In' : ((item.sppci_bus || '').indexOf('pcie') > -1 ? 'PCIe' : ''));\n const vram = (parseInt((item.spdisplays_vram || ''), 10) || 0) * (((item.spdisplays_vram || '').indexOf('GB') > -1) ? 1024 : 1);\n const vramDyn = (parseInt((item.spdisplays_vram_shared || ''), 10) || 0) * (((item.spdisplays_vram_shared || '').indexOf('GB') > -1) ? 1024 : 1);\n let metalVersion = getMetalVersion(item.spdisplays_metal || item.spdisplays_metalfamily || '');\n res.controllers.push({\n vendor: getVendorFromModel(item.spdisplays_vendor || '') || item.spdisplays_vendor || '',\n model: item.sppci_model || '',\n bus,\n vramDynamic: bus === 'Built-In',\n vram: vram || vramDyn || null,\n deviceId: item['spdisplays_device-id'] || '',\n vendorId: item['spdisplays_vendor-id'] || vendorToId((item['spdisplays_vendor'] || '') + (item.sppci_model || '')),\n external: (item.sppci_device_type === 'spdisplays_egpu'),\n cores: item['sppci_cores'] || null,\n metalVersion\n });\n\n // displays\n if (item.spdisplays_ndrvs && item.spdisplays_ndrvs.length) {\n item.spdisplays_ndrvs.forEach(function (displayItem) {\n const connectionType = displayItem['spdisplays_connection_type'] || '';\n const currentResolutionParts = (displayItem['_spdisplays_resolution'] || '').split('@');\n const currentResolution = currentResolutionParts[0].split('x');\n const pixelParts = (displayItem['_spdisplays_pixels'] || '').split('x');\n const pixelDepthString = displayItem['spdisplays_depth'] || '';\n const serial = displayItem['_spdisplays_display-serial-number'] || displayItem['_spdisplays_display-serial-number2'] || null;\n res.displays.push({\n vendor: getVendorFromId(displayItem['_spdisplays_display-vendor-id'] || '') || getVendorFromModel(displayItem['_name'] || ''),\n vendorId: displayItem['_spdisplays_display-vendor-id'] || '',\n model: displayItem['_name'] || '',\n productionYear: displayItem['_spdisplays_display-year'] || null,\n serial: serial !== '0' ? serial : null,\n displayId: displayItem['_spdisplays_displayID'] || null,\n main: displayItem['spdisplays_main'] ? displayItem['spdisplays_main'] === 'spdisplays_yes' : false,\n builtin: (displayItem['spdisplays_display_type'] || '').indexOf('built-in') > -1,\n connection: ((connectionType.indexOf('_internal') > -1) ? 'Internal' : ((connectionType.indexOf('_displayport') > -1) ? 'Display Port' : ((connectionType.indexOf('_hdmi') > -1) ? 'HDMI' : null))),\n sizeX: null,\n sizeY: null,\n pixelDepth: (pixelDepthString === 'CGSThirtyBitColor' ? 30 : (pixelDepthString === 'CGSThirtytwoBitColor' ? 32 : (pixelDepthString === 'CGSTwentyfourBitColor' ? 24 : null))),\n resolutionX: pixelParts.length > 1 ? parseInt(pixelParts[0], 10) : null,\n resolutionY: pixelParts.length > 1 ? parseInt(pixelParts[1], 10) : null,\n currentResX: currentResolution.length > 1 ? parseInt(currentResolution[0], 10) : null,\n currentResY: currentResolution.length > 1 ? parseInt(currentResolution[1], 10) : null,\n positionX: 0,\n positionY: 0,\n currentRefreshRate: currentResolutionParts.length > 1 ? parseInt(currentResolutionParts[1], 10) : null,\n\n });\n });\n }\n });\n return res;\n } catch (e) {\n return res;\n }\n }\n\n function parseLinesLinuxControllers(lines) {\n let controllers = [];\n let currentController = {\n vendor: '',\n model: '',\n bus: '',\n busAddress: '',\n vram: null,\n vramDynamic: false,\n pciID: ''\n };\n let isGraphicsController = false;\n // PCI bus IDs\n let pciIDs = [];\n try {\n pciIDs = execSync('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep \"Bus Address: \"').toString().split('\\n');\n for (let i = 0; i < pciIDs.length; i++) {\n pciIDs[i] = pciIDs[i].replace('Bus Address:', '').replace('0000:', '').trim();\n }\n pciIDs = pciIDs.filter(function (el) {\n return el != null && el;\n });\n } catch (e) {\n util.noop();\n }\n for (let i = 0; i < lines.length; i++) {\n if ('' !== lines[i].trim()) {\n if (' ' !== lines[i][0] && '\\t' !== lines[i][0]) { // first line of new entry\n let isExternal = (pciIDs.indexOf(lines[i].split(' ')[0]) >= 0);\n let vgapos = lines[i].toLowerCase().indexOf(' vga ');\n let _3dcontrollerpos = lines[i].toLowerCase().indexOf('3d controller');\n if (vgapos !== -1 || _3dcontrollerpos !== -1) { // VGA\n if (_3dcontrollerpos !== -1 && vgapos === -1) {\n vgapos = _3dcontrollerpos;\n }\n if (currentController.vendor || currentController.model || currentController.bus || currentController.vram !== null || currentController.vramDynamic) { // already a controller found\n controllers.push(currentController);\n currentController = {\n vendor: '',\n model: '',\n bus: '',\n busAddress: '',\n vram: null,\n vramDynamic: false,\n };\n }\n\n const pciIDCandidate = lines[i].split(' ')[0];\n if (/[\\da-fA-F]{2}:[\\da-fA-F]{2}\\.[\\da-fA-F]/.test(pciIDCandidate)) {\n currentController.busAddress = pciIDCandidate;\n }\n isGraphicsController = true;\n let endpos = lines[i].search(/\\[[0-9a-f]{4}:[0-9a-f]{4}]|$/);\n let parts = lines[i].substr(vgapos, endpos - vgapos).split(':');\n currentController.busAddress = lines[i].substr(0, vgapos).trim();\n if (parts.length > 1) {\n parts[1] = parts[1].trim();\n if (parts[1].toLowerCase().indexOf('corporation') >= 0) {\n currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf('corporation') + 11).trim();\n currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf('corporation') + 11, 200).trim().split('(')[0];\n currentController.bus = (pciIDs.length > 0 && isExternal) ? 'PCIe' : 'Onboard';\n currentController.vram = null;\n currentController.vramDynamic = false;\n } else if (parts[1].toLowerCase().indexOf(' inc.') >= 0) {\n if ((parts[1].match(new RegExp(']', 'g')) || []).length > 1) {\n currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf(']') + 1).trim();\n currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(']') + 1, 200).trim().split('(')[0].trim();\n } else {\n currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf(' inc.') + 5).trim();\n currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(' inc.') + 5, 200).trim().split('(')[0].trim();\n }\n currentController.bus = (pciIDs.length > 0 && isExternal) ? 'PCIe' : 'Onboard';\n currentController.vram = null;\n currentController.vramDynamic = false;\n } else if (parts[1].toLowerCase().indexOf(' ltd.') >= 0) {\n if ((parts[1].match(new RegExp(']', 'g')) || []).length > 1) {\n currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf(']') + 1).trim();\n currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(']') + 1, 200).trim().split('(')[0].trim();\n } else {\n currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf(' ltd.') + 5).trim();\n currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(' ltd.') + 5, 200).trim().split('(')[0].trim();\n }\n }\n }\n\n } else {\n isGraphicsController = false;\n }\n }\n if (isGraphicsController) { // within VGA details\n let parts = lines[i].split(':');\n if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('devicename') !== -1 && parts[1].toLowerCase().indexOf('onboard') !== -1) { currentController.bus = 'Onboard'; }\n if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('region') !== -1 && parts[1].toLowerCase().indexOf('memory') !== -1) {\n let memparts = parts[1].split('=');\n if (memparts.length > 1) {\n currentController.vram = parseInt(memparts[1]);\n }\n }\n }\n }\n }\n if (currentController.vendor || currentController.model || currentController.bus || currentController.busAddress || currentController.vram !== null || currentController.vramDynamic) { // already a controller found\n controllers.push(currentController);\n }\n return (controllers);\n }\n\n function parseLinesLinuxClinfo(controllers, lines) {\n const fieldPattern = /\\[([^\\]]+)\\]\\s+(\\w+)\\s+(.*)/;\n const devices = lines.reduce((devices, line) => {\n const field = fieldPattern.exec(line.trim());\n if (field) {\n if (!devices[field[1]]) {\n devices[field[1]] = {};\n }\n devices[field[1]][field[2]] = field[3];\n }\n return devices;\n }, {});\n for (let deviceId in devices) {\n const device = devices[deviceId];\n if (device['CL_DEVICE_TYPE'] === 'CL_DEVICE_TYPE_GPU') {\n let busAddress;\n if (device['CL_DEVICE_TOPOLOGY_AMD']) {\n const bdf = device['CL_DEVICE_TOPOLOGY_AMD'].match(/[a-zA-Z0-9]+:\\d+\\.\\d+/);\n if (bdf) {\n busAddress = bdf[0];\n }\n } else if (device['CL_DEVICE_PCI_BUS_ID_NV'] && device['CL_DEVICE_PCI_SLOT_ID_NV']) {\n const bus = parseInt(device['CL_DEVICE_PCI_BUS_ID_NV']);\n const slot = parseInt(device['CL_DEVICE_PCI_SLOT_ID_NV']);\n if (!isNaN(bus) && !isNaN(slot)) {\n const b = bus & 0xff;\n const d = (slot >> 3) & 0xff;\n const f = slot & 0x07;\n busAddress = `${b.toString().padStart(2, '0')}:${d.toString().padStart(2, '0')}.${f}`;\n }\n }\n if (busAddress) {\n let controller = controllers.find(controller => controller.busAddress === busAddress);\n if (!controller) {\n controller = {\n vendor: '',\n model: '',\n bus: '',\n busAddress,\n vram: null,\n vramDynamic: false\n };\n controllers.push(controller);\n }\n controller.vendor = device['CL_DEVICE_VENDOR'];\n if (device['CL_DEVICE_BOARD_NAME_AMD']) {\n controller.model = device['CL_DEVICE_BOARD_NAME_AMD'];\n } else {\n controller.model = device['CL_DEVICE_NAME'];\n }\n const memory = parseInt(device['CL_DEVICE_GLOBAL_MEM_SIZE']);\n if (!isNaN(memory)) {\n controller.vram = Math.round(memory / 1024 / 1024);\n }\n }\n }\n }\n return controllers;\n }\n\n function getNvidiaSmi() {\n if (_nvidiaSmiPath) {\n return _nvidiaSmiPath;\n }\n\n if (_windows) {\n try {\n const basePath = util.WINDIR + '\\\\System32\\\\DriverStore\\\\FileRepository';\n // find all directories that have an nvidia-smi.exe file\n const candidateDirs = fs.readdirSync(basePath).filter(dir => {\n return fs.readdirSync([basePath, dir].join('/')).includes('nvidia-smi.exe');\n });\n // use the directory with the most recently created nvidia-smi.exe file\n const targetDir = candidateDirs.reduce((prevDir, currentDir) => {\n const previousNvidiaSmi = fs.statSync([basePath, prevDir, 'nvidia-smi.exe'].join('/'));\n const currentNvidiaSmi = fs.statSync([basePath, currentDir, 'nvidia-smi.exe'].join('/'));\n return (previousNvidiaSmi.ctimeMs > currentNvidiaSmi.ctimeMs) ? prevDir : currentDir;\n });\n\n if (targetDir) {\n _nvidiaSmiPath = [basePath, targetDir, 'nvidia-smi.exe'].join('/');\n }\n } catch (e) {\n util.noop();\n }\n } else if (_linux) {\n _nvidiaSmiPath = 'nvidia-smi';\n }\n return _nvidiaSmiPath;\n }\n\n function nvidiaSmi(options) {\n const nvidiaSmiExe = getNvidiaSmi();\n options = options || util.execOptsWin;\n if (nvidiaSmiExe) {\n const nvidiaSmiOpts = '--query-gpu=driver_version,pci.sub_device_id,name,pci.bus_id,fan.speed,memory.total,memory.used,memory.free,utilization.gpu,utilization.memory,temperature.gpu,temperature.memory,power.draw,power.limit,clocks.gr,clocks.mem --format=csv,noheader,nounits';\n const cmd = nvidiaSmiExe + ' ' + nvidiaSmiOpts + (_linux ? ' 2>/dev/null' : '');\n try {\n const res = execSync(cmd, options).toString();\n return res;\n } catch (e) {\n util.noop();\n }\n }\n return '';\n }\n\n function nvidiaDevices() {\n\n function safeParseNumber(value) {\n if ([null, undefined].includes(value)) {\n return value;\n }\n return parseFloat(value);\n }\n\n const stdout = nvidiaSmi();\n if (!stdout) {\n return [];\n }\n\n const gpus = stdout.split('\\n').filter(Boolean);\n const results = gpus.map(gpu => {\n const splittedData = gpu.split(', ').map(value => value.includes('N/A') ? undefined : value);\n if (splittedData.length === 16) {\n return {\n driverVersion: splittedData[0],\n subDeviceId: splittedData[1],\n name: splittedData[2],\n pciBus: splittedData[3],\n fanSpeed: safeParseNumber(splittedData[4]),\n memoryTotal: safeParseNumber(splittedData[5]),\n memoryUsed: safeParseNumber(splittedData[6]),\n memoryFree: safeParseNumber(splittedData[7]),\n utilizationGpu: safeParseNumber(splittedData[8]),\n utilizationMemory: safeParseNumber(splittedData[9]),\n temperatureGpu: safeParseNumber(splittedData[10]),\n temperatureMemory: safeParseNumber(splittedData[11]),\n powerDraw: safeParseNumber(splittedData[12]),\n powerLimit: safeParseNumber(splittedData[13]),\n clockCore: safeParseNumber(splittedData[14]),\n clockMemory: safeParseNumber(splittedData[15]),\n };\n }\n });\n\n return results;\n }\n\n function mergeControllerNvidia(controller, nvidia) {\n if (nvidia.driverVersion) { controller.driverVersion = nvidia.driverVersion; }\n if (nvidia.subDeviceId) { controller.subDeviceId = nvidia.subDeviceId; }\n if (nvidia.name) { controller.name = nvidia.name; }\n if (nvidia.pciBus) { controller.pciBus = nvidia.pciBus; }\n if (nvidia.fanSpeed) { controller.fanSpeed = nvidia.fanSpeed; }\n if (nvidia.memoryTotal) {\n controller.memoryTotal = nvidia.memoryTotal;\n controller.vram = nvidia.memoryTotal;\n controller.vramDynamic = false;\n }\n if (nvidia.memoryUsed) { controller.memoryUsed = nvidia.memoryUsed; }\n if (nvidia.memoryFree) { controller.memoryFree = nvidia.memoryFree; }\n if (nvidia.utilizationGpu) { controller.utilizationGpu = nvidia.utilizationGpu; }\n if (nvidia.utilizationMemory) { controller.utilizationMemory = nvidia.utilizationMemory; }\n if (nvidia.temperatureGpu) { controller.temperatureGpu = nvidia.temperatureGpu; }\n if (nvidia.temperatureMemory) { controller.temperatureMemory = nvidia.temperatureMemory; }\n if (nvidia.powerDraw) { controller.powerDraw = nvidia.powerDraw; }\n if (nvidia.powerLimit) { controller.powerLimit = nvidia.powerLimit; }\n if (nvidia.clockCore) { controller.clockCore = nvidia.clockCore; }\n if (nvidia.clockMemory) { controller.clockMemory = nvidia.clockMemory; }\n return controller;\n }\n\n function parseLinesLinuxEdid(edid) {\n // parsen EDID\n // --> model\n // --> resolutionx\n // --> resolutiony\n // --> builtin = false\n // --> pixeldepth (?)\n // --> sizex\n // --> sizey\n let result = {\n vendor: '',\n model: '',\n deviceName: '',\n main: false,\n builtin: false,\n connection: '',\n sizeX: null,\n sizeY: null,\n pixelDepth: null,\n resolutionX: null,\n resolutionY: null,\n currentResX: null,\n currentResY: null,\n positionX: 0,\n positionY: 0,\n currentRefreshRate: null\n };\n // find first \"Detailed Timing Description\"\n let start = 108;\n if (edid.substr(start, 6) === '000000') {\n start += 36;\n }\n if (edid.substr(start, 6) === '000000') {\n start += 36;\n }\n if (edid.substr(start, 6) === '000000') {\n start += 36;\n }\n if (edid.substr(start, 6) === '000000') {\n start += 36;\n }\n result.resolutionX = parseInt('0x0' + edid.substr(start + 8, 1) + edid.substr(start + 4, 2));\n result.resolutionY = parseInt('0x0' + edid.substr(start + 14, 1) + edid.substr(start + 10, 2));\n result.sizeX = parseInt('0x0' + edid.substr(start + 28, 1) + edid.substr(start + 24, 2));\n result.sizeY = parseInt('0x0' + edid.substr(start + 29, 1) + edid.substr(start + 26, 2));\n // monitor name\n start = edid.indexOf('000000fc00'); // find first \"Monitor Description Data\"\n if (start >= 0) {\n let model_raw = edid.substr(start + 10, 26);\n if (model_raw.indexOf('0a') !== -1) {\n model_raw = model_raw.substr(0, model_raw.indexOf('0a'));\n }\n try {\n if (model_raw.length > 2) {\n result.model = model_raw.match(/.{1,2}/g).map(function (v) {\n return String.fromCharCode(parseInt(v, 16));\n }).join('');\n }\n } catch (e) {\n util.noop();\n }\n } else {\n result.model = '';\n }\n return result;\n }\n\n function parseLinesLinuxDisplays(lines, depth) {\n let displays = [];\n let currentDisplay = {\n vendor: '',\n model: '',\n deviceName: '',\n main: false,\n builtin: false,\n connection: '',\n sizeX: null,\n sizeY: null,\n pixelDepth: null,\n resolutionX: null,\n resolutionY: null,\n currentResX: null,\n currentResY: null,\n positionX: 0,\n positionY: 0,\n currentRefreshRate: null\n };\n let is_edid = false;\n let is_current = false;\n let edid_raw = '';\n let start = 0;\n for (let i = 1; i < lines.length; i++) { // start with second line\n if ('' !== lines[i].trim()) {\n if (' ' !== lines[i][0] && '\\t' !== lines[i][0] && lines[i].toLowerCase().indexOf(' connected ') !== -1) { // first line of new entry\n if (currentDisplay.model || currentDisplay.main || currentDisplay.builtin || currentDisplay.connection || currentDisplay.sizeX !== null || currentDisplay.pixelDepth !== null || currentDisplay.resolutionX !== null) { // push last display to array\n displays.push(currentDisplay);\n currentDisplay = {\n vendor: '',\n model: '',\n main: false,\n builtin: false,\n connection: '',\n sizeX: null,\n sizeY: null,\n pixelDepth: null,\n resolutionX: null,\n resolutionY: null,\n currentResX: null,\n currentResY: null,\n positionX: 0,\n positionY: 0,\n currentRefreshRate: null\n };\n }\n let parts = lines[i].split(' ');\n currentDisplay.connection = parts[0];\n currentDisplay.main = lines[i].toLowerCase().indexOf(' primary ') >= 0;\n currentDisplay.builtin = (parts[0].toLowerCase().indexOf('edp') >= 0);\n }\n\n // try to read EDID information\n if (is_edid) {\n if (lines[i].search(/\\S|$/) > start) {\n edid_raw += lines[i].toLowerCase().trim();\n } else {\n // parsen EDID\n let edid_decoded = parseLinesLinuxEdid(edid_raw);\n currentDisplay.vendor = edid_decoded.vendor;\n currentDisplay.model = edid_decoded.model;\n currentDisplay.resolutionX = edid_decoded.resolutionX;\n currentDisplay.resolutionY = edid_decoded.resolutionY;\n currentDisplay.sizeX = edid_decoded.sizeX;\n currentDisplay.sizeY = edid_decoded.sizeY;\n currentDisplay.pixelDepth = depth;\n is_edid = false;\n }\n }\n if (lines[i].toLowerCase().indexOf('edid:') >= 0) {\n is_edid = true;\n start = lines[i].search(/\\S|$/);\n }\n if (lines[i].toLowerCase().indexOf('*current') >= 0) {\n const parts1 = lines[i].split('(');\n if (parts1 && parts1.length > 1 && parts1[0].indexOf('x') >= 0) {\n const resParts = parts1[0].trim().split('x');\n currentDisplay.currentResX = util.toInt(resParts[0]);\n currentDisplay.currentResY = util.toInt(resParts[1]);\n }\n is_current = true;\n }\n if (is_current && lines[i].toLowerCase().indexOf('clock') >= 0 && lines[i].toLowerCase().indexOf('hz') >= 0 && lines[i].toLowerCase().indexOf('v: height') >= 0) {\n const parts1 = lines[i].split('clock');\n if (parts1 && parts1.length > 1 && parts1[1].toLowerCase().indexOf('hz') >= 0) {\n currentDisplay.currentRefreshRate = util.toInt(parts1[1]);\n }\n is_current = false;\n }\n }\n }\n\n // pushen displays\n if (currentDisplay.model || currentDisplay.main || currentDisplay.builtin || currentDisplay.connection || currentDisplay.sizeX !== null || currentDisplay.pixelDepth !== null || currentDisplay.resolutionX !== null) { // still information there\n displays.push(currentDisplay);\n }\n return displays;\n }\n\n // function starts here\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = {\n controllers: [],\n displays: []\n };\n if (_darwin) {\n let cmd = 'system_profiler -xml -detailLevel full SPDisplaysDataType';\n exec(cmd, function (error, stdout) {\n if (!error) {\n try {\n let output = stdout.toString();\n result = parseLinesDarwin(util.plistParser(output)[0]._items);\n } catch (e) {\n util.noop();\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_linux) {\n // Raspberry: https://elinux.org/RPI_vcgencmd_usage\n if (util.isRaspberry() && util.isRaspbian()) {\n let cmd = 'fbset -s | grep \\'mode \"\\'; vcgencmd get_mem gpu; tvservice -s; tvservice -n;';\n exec(cmd, function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n if (lines.length > 3 && lines[0].indexOf('mode \"') >= -1 && lines[2].indexOf('0x12000a') > -1) {\n const parts = lines[0].replace('mode', '').replace(/\"/g, '').trim().split('x');\n if (parts.length === 2) {\n result.displays.push({\n vendor: '',\n model: util.getValue(lines, 'device_name', '='),\n main: true,\n builtin: false,\n connection: 'HDMI',\n sizeX: null,\n sizeY: null,\n pixelDepth: null,\n resolutionX: parseInt(parts[0], 10),\n resolutionY: parseInt(parts[1], 10),\n currentResX: null,\n currentResY: null,\n positionX: 0,\n positionY: 0,\n currentRefreshRate: null\n });\n }\n }\n if (lines.length > 1 && stdout.toString().indexOf('gpu=') >= -1) {\n result.controllers.push({\n vendor: 'Broadcom',\n model: 'VideoCore IV',\n bus: '',\n vram: util.getValue(lines, 'gpu', '=').replace('M', ''),\n vramDynamic: true\n });\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else {\n let cmd = 'lspci -vvv 2>/dev/null';\n exec(cmd, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n result.controllers = parseLinesLinuxControllers(lines);\n const nvidiaData = nvidiaDevices();\n // needs to be rewritten ... using no spread operators\n result.controllers = result.controllers.map((controller) => { // match by busAddress\n return mergeControllerNvidia(controller, nvidiaData.find((contr) => contr.pciBus.toLowerCase().endsWith(controller.busAddress.toLowerCase())) || {});\n });\n }\n let cmd = 'clinfo --raw';\n exec(cmd, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n result.controllers = parseLinesLinuxClinfo(result.controllers, lines);\n }\n let cmd = 'xdpyinfo 2>/dev/null | grep \\'depth of root window\\' | awk \\'{ print $5 }\\'';\n exec(cmd, function (error, stdout) {\n let depth = 0;\n if (!error) {\n let lines = stdout.toString().split('\\n');\n depth = parseInt(lines[0]) || 0;\n }\n let cmd = 'xrandr --verbose 2>/dev/null';\n exec(cmd, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n result.displays = parseLinesLinuxDisplays(lines, depth);\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n });\n });\n });\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n if (callback) { callback(null); }\n resolve(null);\n }\n if (_sunos) {\n if (callback) { callback(null); }\n resolve(null);\n }\n if (_windows) {\n\n // https://blogs.technet.microsoft.com/heyscriptingguy/2013/10/03/use-powershell-to-discover-multi-monitor-information/\n // https://devblogs.microsoft.com/scripting/use-powershell-to-discover-multi-monitor-information/\n try {\n const workload = [];\n workload.push(util.powerShell('Get-WmiObject win32_VideoController | fl *'));\n workload.push(util.powerShell('gp \"HKLM:\\\\SYSTEM\\\\ControlSet001\\\\Control\\\\Class\\\\{4d36e968-e325-11ce-bfc1-08002be10318}\\\\*\" -ErrorAction SilentlyContinue | where MatchingDeviceId $null -NE | select MatchingDeviceId,HardwareInformation.qwMemorySize | fl'));\n workload.push(util.powerShell('Get-WmiObject win32_desktopmonitor | fl *'));\n workload.push(util.powerShell('Get-CimInstance -Namespace root\\\\wmi -ClassName WmiMonitorBasicDisplayParams | fl'));\n workload.push(util.powerShell('Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Screen]::AllScreens'));\n workload.push(util.powerShell('Get-CimInstance -Namespace root\\\\wmi -ClassName WmiMonitorConnectionParams | fl'));\n workload.push(util.powerShell('gwmi WmiMonitorID -Namespace root\\\\wmi | ForEach-Object {(($_.ManufacturerName -notmatch 0 | foreach {[char]$_}) -join \"\") + \"|\" + (($_.ProductCodeID -notmatch 0 | foreach {[char]$_}) -join \"\") + \"|\" + (($_.UserFriendlyName -notmatch 0 | foreach {[char]$_}) -join \"\") + \"|\" + (($_.SerialNumberID -notmatch 0 | foreach {[char]$_}) -join \"\") + \"|\" + $_.InstanceName}'));\n\n const nvidiaData = nvidiaDevices();\n\n Promise.all(\n workload\n ).then(data => {\n // controller + vram\n let csections = data[0].replace(/\\r/g, '').split(/\\n\\s*\\n/);\n let vsections = data[1].replace(/\\r/g, '').split(/\\n\\s*\\n/);\n result.controllers = parseLinesWindowsControllers(csections, vsections);\n result.controllers = result.controllers.map((controller) => { // match by subDeviceId\n if (controller.vendor.toLowerCase() === 'nvidia') {\n return mergeControllerNvidia(controller, nvidiaData.find(device => {\n let windowsSubDeviceId = (controller.subDeviceId || '').toLowerCase();\n const nvidiaSubDeviceIdParts = device.subDeviceId.split('x');\n let nvidiaSubDeviceId = nvidiaSubDeviceIdParts.length > 1 ? nvidiaSubDeviceIdParts[1].toLowerCase() : nvidiaSubDeviceIdParts[0].toLowerCase();\n const lengthDifference = Math.abs(windowsSubDeviceId.length - nvidiaSubDeviceId.length);\n if (windowsSubDeviceId.length > nvidiaSubDeviceId.length) {\n for (let i = 0; i < lengthDifference; i++) {\n nvidiaSubDeviceId = '0' + nvidiaSubDeviceId;\n }\n } else if (windowsSubDeviceId.length < nvidiaSubDeviceId.length) {\n for (let i = 0; i < lengthDifference; i++) {\n windowsSubDeviceId = '0' + windowsSubDeviceId;\n }\n }\n return windowsSubDeviceId === nvidiaSubDeviceId;\n }) || {});\n } else {\n return controller;\n }\n });\n\n // displays\n let dsections = data[2].replace(/\\r/g, '').split(/\\n\\s*\\n/);\n // result.displays = parseLinesWindowsDisplays(dsections);\n if (dsections[0].trim() === '') { dsections.shift(); }\n if (dsections.length && dsections[dsections.length - 1].trim() === '') { dsections.pop(); }\n\n // monitor (powershell)\n let msections = data[3].replace(/\\r/g, '').split('Active ');\n msections.shift();\n\n // forms.screens (powershell)\n let ssections = data[4].replace(/\\r/g, '').split('BitsPerPixel ');\n ssections.shift();\n\n // connection params (powershell) - video type\n let tsections = data[5].replace(/\\r/g, '').split(/\\n\\s*\\n/);\n tsections.shift();\n\n // monitor ID (powershell) - model / vendor\n const res = data[6].replace(/\\r/g, '').split(/\\n/);\n let isections = [];\n res.forEach(element => {\n const parts = element.split('|');\n if (parts.length === 5) {\n isections.push({\n vendor: parts[0],\n code: parts[1],\n model: parts[2],\n serial: parts[3],\n instanceId: parts[4]\n });\n }\n });\n\n result.displays = parseLinesWindowsDisplaysPowershell(ssections, msections, dsections, tsections, isections);\n\n if (result.displays.length === 1) {\n if (_resolutionX) {\n result.displays[0].resolutionX = _resolutionX;\n if (!result.displays[0].currentResX) {\n result.displays[0].currentResX = _resolutionX;\n }\n }\n if (_resolutionY) {\n result.displays[0].resolutionY = _resolutionY;\n if (result.displays[0].currentResY === 0) {\n result.displays[0].currentResY = _resolutionY;\n }\n }\n if (_pixelDepth) {\n result.displays[0].pixelDepth = _pixelDepth;\n }\n if (_refreshRate && !result.displays[0].currentRefreshRate) {\n result.displays[0].currentRefreshRate = _refreshRate;\n }\n }\n\n if (callback) {\n callback(result);\n }\n resolve(result);\n })\n .catch(() => {\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n\n function parseLinesWindowsControllers(sections, vections) {\n const memorySizes = {};\n for (const i in vections) {\n if ({}.hasOwnProperty.call(vections, i)) {\n if (vections[i].trim() !== '') {\n const lines = vections[i].trim().split('\\n');\n const matchingDeviceId = util.getValue(lines, 'MatchingDeviceId').match(/PCI\\\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i);\n if (matchingDeviceId) {\n const quadWordmemorySize = parseInt(util.getValue(lines, 'HardwareInformation.qwMemorySize'));\n if (!isNaN(quadWordmemorySize)) {\n let deviceId = matchingDeviceId[1].toUpperCase() + '&' + matchingDeviceId[2].toUpperCase();\n if (matchingDeviceId[3]) {\n deviceId += '&' + matchingDeviceId[3].toUpperCase();\n }\n if (matchingDeviceId[4]) {\n deviceId += '&' + matchingDeviceId[4].toUpperCase();\n }\n memorySizes[deviceId] = quadWordmemorySize;\n }\n }\n }\n }\n }\n\n let controllers = [];\n for (let i in sections) {\n if ({}.hasOwnProperty.call(sections, i)) {\n if (sections[i].trim() !== '') {\n let lines = sections[i].trim().split('\\n');\n let pnpDeviceId = util.getValue(lines, 'PNPDeviceID', ':').match(/PCI\\\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i);\n let subDeviceId = null;\n let memorySize = null;\n if (pnpDeviceId) {\n subDeviceId = pnpDeviceId[3] || '';\n if (subDeviceId) {\n subDeviceId = subDeviceId.split('_')[1];\n }\n\n // Match PCI device identifier (there's an order of increasing generality):\n // https://docs.microsoft.com/en-us/windows-hardware/drivers/install/identifiers-for-pci-devices\n\n // PCI\\VEN_v(4)&DEV_d(4)&SUBSYS_s(4)n(4)&REV_r(2)\n if (memorySize == null && pnpDeviceId[3] && pnpDeviceId[4]) {\n const deviceId = pnpDeviceId[1].toUpperCase() + '&' + pnpDeviceId[2].toUpperCase() + '&' + pnpDeviceId[3].toUpperCase() + '&' + pnpDeviceId[4].toUpperCase();\n if ({}.hasOwnProperty.call(memorySizes, deviceId)) {\n memorySize = memorySizes[deviceId];\n }\n }\n\n // PCI\\VEN_v(4)&DEV_d(4)&SUBSYS_s(4)n(4)\n if (memorySize == null && pnpDeviceId[3]) {\n const deviceId = pnpDeviceId[1].toUpperCase() + '&' + pnpDeviceId[2].toUpperCase() + '&' + pnpDeviceId[3].toUpperCase();\n if ({}.hasOwnProperty.call(memorySizes, deviceId)) {\n memorySize = memorySizes[deviceId];\n }\n }\n\n // PCI\\VEN_v(4)&DEV_d(4)&REV_r(2)\n if (memorySize == null && pnpDeviceId[4]) {\n const deviceId = pnpDeviceId[1].toUpperCase() + '&' + pnpDeviceId[2].toUpperCase() + '&' + pnpDeviceId[4].toUpperCase();\n if ({}.hasOwnProperty.call(memorySizes, deviceId)) {\n memorySize = memorySizes[deviceId];\n }\n }\n\n // PCI\\VEN_v(4)&DEV_d(4)\n if (memorySize == null) {\n const deviceId = pnpDeviceId[1].toUpperCase() + '&' + pnpDeviceId[2].toUpperCase();\n if ({}.hasOwnProperty.call(memorySizes, deviceId)) {\n memorySize = memorySizes[deviceId];\n }\n }\n }\n\n controllers.push({\n vendor: util.getValue(lines, 'AdapterCompatibility', ':'),\n model: util.getValue(lines, 'name', ':'),\n bus: util.getValue(lines, 'PNPDeviceID', ':').startsWith('PCI') ? 'PCI' : '',\n vram: (memorySize == null ? util.toInt(util.getValue(lines, 'AdapterRAM', ':')) : memorySize) / 1024 / 1024,\n vramDynamic: (util.getValue(lines, 'VideoMemoryType', ':') === '2'),\n subDeviceId\n });\n _resolutionX = util.toInt(util.getValue(lines, 'CurrentHorizontalResolution', ':')) || _resolutionX;\n _resolutionY = util.toInt(util.getValue(lines, 'CurrentVerticalResolution', ':')) || _resolutionY;\n _refreshRate = util.toInt(util.getValue(lines, 'CurrentRefreshRate', ':')) || _refreshRate;\n _pixelDepth = util.toInt(util.getValue(lines, 'CurrentBitsPerPixel', ':')) || _pixelDepth;\n }\n }\n }\n return controllers;\n }\n\n function parseLinesWindowsDisplaysPowershell(ssections, msections, dsections, tsections, isections) {\n let displays = [];\n let vendor = '';\n let model = '';\n let deviceID = '';\n let resolutionX = 0;\n let resolutionY = 0;\n if (dsections && dsections.length) {\n let linesDisplay = dsections[0].split('\\n');\n vendor = util.getValue(linesDisplay, 'MonitorManufacturer', ':');\n model = util.getValue(linesDisplay, 'Name', ':');\n deviceID = util.getValue(linesDisplay, 'PNPDeviceID', ':').replace(/&/g, '&').toLowerCase();\n resolutionX = util.toInt(util.getValue(linesDisplay, 'ScreenWidth', ':'));\n resolutionY = util.toInt(util.getValue(linesDisplay, 'ScreenHeight', ':'));\n }\n for (let i = 0; i < ssections.length; i++) {\n if (ssections[i].trim() !== '') {\n ssections[i] = 'BitsPerPixel ' + ssections[i];\n msections[i] = 'Active ' + msections[i];\n // tsections can be empty OR undefined on earlier versions of powershell (<=2.0)\n // Tag connection type as UNKNOWN by default if this information is missing\n if (tsections.length === 0 || tsections[i] === undefined) {\n tsections[i] = 'Unknown';\n }\n let linesScreen = ssections[i].split('\\n');\n let linesMonitor = msections[i].split('\\n');\n\n let linesConnection = tsections[i].split('\\n');\n const bitsPerPixel = util.getValue(linesScreen, 'BitsPerPixel');\n const bounds = util.getValue(linesScreen, 'Bounds').replace('{', '').replace('}', '').replace(/=/g, ':').split(',');\n const primary = util.getValue(linesScreen, 'Primary');\n const sizeX = util.getValue(linesMonitor, 'MaxHorizontalImageSize');\n const sizeY = util.getValue(linesMonitor, 'MaxVerticalImageSize');\n const instanceName = util.getValue(linesMonitor, 'InstanceName').toLowerCase();\n const videoOutputTechnology = util.getValue(linesConnection, 'VideoOutputTechnology');\n const deviceName = util.getValue(linesScreen, 'DeviceName');\n let displayVendor = '';\n let displayModel = '';\n isections.forEach(element => {\n if (element.instanceId.toLowerCase().startsWith(instanceName) && vendor.startsWith('(') && model.startsWith('PnP')) {\n displayVendor = element.vendor;\n displayModel = element.model;\n }\n });\n displays.push({\n vendor: instanceName.startsWith(deviceID) && displayVendor === '' ? vendor : displayVendor,\n model: instanceName.startsWith(deviceID) && displayModel === '' ? model : displayModel,\n deviceName,\n main: primary.toLowerCase() === 'true',\n builtin: videoOutputTechnology === '2147483648',\n connection: videoOutputTechnology && videoTypes[videoOutputTechnology] ? videoTypes[videoOutputTechnology] : '',\n resolutionX: util.toInt(util.getValue(bounds, 'Width', ':')),\n resolutionY: util.toInt(util.getValue(bounds, 'Height', ':')),\n sizeX: sizeX ? parseInt(sizeX, 10) : null,\n sizeY: sizeY ? parseInt(sizeY, 10) : null,\n pixelDepth: bitsPerPixel,\n currentResX: util.toInt(util.getValue(bounds, 'Width', ':')),\n currentResY: util.toInt(util.getValue(bounds, 'Height', ':')),\n positionX: util.toInt(util.getValue(bounds, 'X', ':')),\n positionY: util.toInt(util.getValue(bounds, 'Y', ':')),\n });\n }\n }\n if (ssections.length === 0) {\n displays.push({\n vendor,\n model,\n main: true,\n sizeX: null,\n sizeY: null,\n resolutionX,\n resolutionY,\n pixelDepth: null,\n currentResX: resolutionX,\n currentResY: resolutionY,\n positionX: 0,\n positionY: 0\n });\n }\n return displays;\n }\n}\n\nexports.graphics = graphics;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// index.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// Contributors: Guillaume Legrain (https://github.com/glegrain)\n// Riccardo Novaglia (https://github.com/richy24)\n// Quentin Busuttil (https://github.com/Buzut)\n// Lapsio (https://github.com/lapsio)\n// csy (https://github.com/csy1983)\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n\n// ----------------------------------------------------------------------------------\n// Dependencies\n// ----------------------------------------------------------------------------------\n\nconst lib_version = require('../package.json').version;\nconst util = require('./util');\nconst system = require('./system');\nconst osInfo = require('./osinfo');\nconst cpu = require('./cpu');\nconst memory = require('./memory');\nconst battery = require('./battery');\nconst graphics = require('./graphics');\nconst filesystem = require('./filesystem');\nconst network = require('./network');\nconst wifi = require('./wifi');\nconst processes = require('./processes');\nconst users = require('./users');\nconst internet = require('./internet');\nconst docker = require('./docker');\nconst vbox = require('./virtualbox');\nconst printer = require('./printer');\nconst usb = require('./usb');\nconst audio = require('./audio');\nconst bluetooth = require('./bluetooth');\n\nlet _platform = process.platform;\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\n// ----------------------------------------------------------------------------------\n// init\n// ----------------------------------------------------------------------------------\n\nif (_windows) {\n util.getCodepage();\n}\n\n// ----------------------------------------------------------------------------------\n// General\n// ----------------------------------------------------------------------------------\n\nfunction version() {\n return lib_version;\n}\n\n// ----------------------------------------------------------------------------------\n// Get static and dynamic data (all)\n// ----------------------------------------------------------------------------------\n\n// --------------------------\n// get static data - they should not change until restarted\n\nfunction getStaticData(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let data = {};\n\n data.version = version();\n\n Promise.all([\n system.system(),\n system.bios(),\n system.baseboard(),\n system.chassis(),\n osInfo.osInfo(),\n osInfo.uuid(),\n osInfo.versions(),\n cpu.cpu(),\n cpu.cpuFlags(),\n graphics.graphics(),\n network.networkInterfaces(),\n memory.memLayout(),\n filesystem.diskLayout()\n ]).then(res => {\n data.system = res[0];\n data.bios = res[1];\n data.baseboard = res[2];\n data.chassis = res[3];\n data.os = res[4];\n data.uuid = res[5];\n data.versions = res[6];\n data.cpu = res[7];\n data.cpu.flags = res[8];\n data.graphics = res[9];\n data.net = res[10];\n data.memLayout = res[11];\n data.diskLayout = res[12];\n if (callback) { callback(data); }\n resolve(data);\n });\n });\n });\n}\n\n\n// --------------------------\n// get all dynamic data - e.g. for monitoring agents\n// may take some seconds to get all data\n// --------------------------\n// 2 additional parameters needed\n// - srv: \t\tcomma separated list of services to monitor e.g. \"mysql, apache, postgresql\"\n// - iface:\tdefine network interface for which you like to monitor network speed e.g. \"eth0\"\n\nfunction getDynamicData(srv, iface, callback) {\n\n if (util.isFunction(iface)) {\n callback = iface;\n iface = '';\n }\n if (util.isFunction(srv)) {\n callback = srv;\n srv = '';\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n iface = iface || network.getDefaultNetworkInterface();\n srv = srv || '';\n\n // use closure to track ƒ completion\n let functionProcessed = (function () {\n let totalFunctions = 15;\n if (_windows) { totalFunctions = 13; }\n if (_freebsd || _openbsd || _netbsd) { totalFunctions = 11; }\n if (_sunos) { totalFunctions = 6; }\n\n return function () {\n if (--totalFunctions === 0) {\n if (callback) {\n callback(data);\n }\n resolve(data);\n }\n };\n })();\n\n // var totalFunctions = 14;\n // function functionProcessed() {\n // if (--totalFunctions === 0) {\n // if (callback) { callback(data) }\n // resolve(data);\n // }\n // }\n\n let data = {};\n\n // get time\n data.time = osInfo.time();\n\n /**\n * @namespace\n * @property {Object} versions\n * @property {string} versions.node\n * @property {string} versions.v8\n */\n data.node = process.versions.node;\n data.v8 = process.versions.v8;\n\n cpu.cpuCurrentSpeed().then(res => {\n data.cpuCurrentSpeed = res;\n functionProcessed();\n });\n\n users.users().then(res => {\n data.users = res;\n functionProcessed();\n });\n\n processes.processes().then(res => {\n data.processes = res;\n functionProcessed();\n });\n\n cpu.currentLoad().then(res => {\n data.currentLoad = res;\n functionProcessed();\n });\n\n if (!_sunos) {\n cpu.cpuTemperature().then(res => {\n data.temp = res;\n functionProcessed();\n });\n }\n\n if (!_openbsd && !_freebsd && !_netbsd && !_sunos) {\n network.networkStats(iface).then(res => {\n data.networkStats = res;\n functionProcessed();\n });\n }\n\n if (!_sunos) {\n network.networkConnections().then(res => {\n data.networkConnections = res;\n functionProcessed();\n });\n }\n\n memory.mem().then(res => {\n data.mem = res;\n functionProcessed();\n });\n\n if (!_sunos) {\n battery().then(res => {\n data.battery = res;\n functionProcessed();\n });\n }\n\n if (!_sunos) {\n processes.services(srv).then(res => {\n data.services = res;\n functionProcessed();\n });\n }\n\n if (!_sunos) {\n filesystem.fsSize().then(res => {\n data.fsSize = res;\n functionProcessed();\n });\n }\n\n if (!_windows && !_openbsd && !_freebsd && !_netbsd && !_sunos) {\n filesystem.fsStats().then(res => {\n data.fsStats = res;\n functionProcessed();\n });\n }\n\n if (!_windows && !_openbsd && !_freebsd && !_netbsd && !_sunos) {\n filesystem.disksIO().then(res => {\n data.disksIO = res;\n functionProcessed();\n });\n }\n\n if (!_openbsd && !_freebsd && !_netbsd && !_sunos) {\n wifi.wifiNetworks().then(res => {\n data.wifiNetworks = res;\n functionProcessed();\n });\n }\n\n internet.inetLatency().then(res => {\n data.inetLatency = res;\n functionProcessed();\n });\n });\n });\n}\n\n// --------------------------\n// get all data at once\n// --------------------------\n// 2 additional parameters needed\n// - srv: \t\tcomma separated list of services to monitor e.g. \"mysql, apache, postgresql\"\n// - iface:\tdefine network interface for which you like to monitor network speed e.g. \"eth0\"\n\nfunction getAllData(srv, iface, callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let data = {};\n\n if (iface && util.isFunction(iface) && !callback) {\n callback = iface;\n iface = '';\n }\n\n if (srv && util.isFunction(srv) && !iface && !callback) {\n callback = srv;\n srv = '';\n iface = '';\n }\n\n getStaticData().then(res => {\n data = res;\n getDynamicData(srv, iface).then(res => {\n for (let key in res) {\n if ({}.hasOwnProperty.call(res, key)) {\n data[key] = res[key];\n }\n }\n if (callback) { callback(data); }\n resolve(data);\n });\n });\n });\n });\n}\n\nfunction get(valueObject, callback) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n const allPromises = Object.keys(valueObject)\n .filter(func => ({}.hasOwnProperty.call(exports, func)))\n .map(func => {\n const params = valueObject[func].substring(valueObject[func].lastIndexOf('(') + 1, valueObject[func].lastIndexOf(')'));\n let funcWithoutParams = func.indexOf(')') >= 0 ? func.split(')')[1].trim() : func;\n funcWithoutParams = func.indexOf('|') >= 0 ? func.split('|')[0].trim() : funcWithoutParams;\n if (params) {\n return exports[funcWithoutParams](params);\n } else {\n return exports[funcWithoutParams]('');\n }\n });\n\n Promise.all(allPromises).then(data => {\n const result = {};\n let i = 0;\n for (let key in valueObject) {\n if ({}.hasOwnProperty.call(valueObject, key) && {}.hasOwnProperty.call(exports, key) && data.length > i) {\n if (valueObject[key] === '*' || valueObject[key] === 'all') {\n result[key] = data[i];\n } else {\n let keys = valueObject[key];\n // let params = '';\n let filter = '';\n let filterParts = [];\n // remove params\n if (keys.indexOf(')') >= 0) {\n keys = keys.split(')')[1].trim();\n }\n // extract filter and remove it from keys\n if (keys.indexOf('|') >= 0) {\n filter = keys.split('|')[1].trim();\n filterParts = filter.split(':');\n\n keys = keys.split('|')[0].trim();\n }\n keys = keys.replace(/,/g, ' ').replace(/ +/g, ' ').split(' ');\n if (data[i]) {\n if (Array.isArray(data[i])) {\n // result is in an array, go through all elements of array and pick only the right ones\n const partialArray = [];\n data[i].forEach(element => {\n let partialRes = {};\n if (keys.length === 1 && (keys[0] === '*' || keys[0] === 'all')) {\n partialRes = element;\n } else {\n keys.forEach(k => {\n if ({}.hasOwnProperty.call(element, k)) {\n partialRes[k] = element[k];\n }\n });\n }\n // if there is a filter, then just take those elements\n if (filter && filterParts.length === 2) {\n if ({}.hasOwnProperty.call(partialRes, filterParts[0].trim())) {\n const val = partialRes[filterParts[0].trim()];\n if (typeof val == 'number') {\n if (val === parseFloat(filterParts[1].trim())) {\n partialArray.push(partialRes);\n }\n } else if (typeof val == 'string') {\n if (val.toLowerCase() === filterParts[1].trim().toLowerCase()) {\n partialArray.push(partialRes);\n }\n }\n }\n } else {\n partialArray.push(partialRes);\n }\n\n });\n result[key] = partialArray;\n } else {\n const partialRes = {};\n keys.forEach(k => {\n if ({}.hasOwnProperty.call(data[i], k)) {\n partialRes[k] = data[i][k];\n }\n });\n result[key] = partialRes;\n }\n } else {\n result[key] = {};\n }\n }\n i++;\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n });\n}\n\nfunction observe(valueObject, interval, callback) {\n let _data = null;\n\n const result = setInterval(() => {\n get(valueObject).then(data => {\n if (JSON.stringify(_data) !== JSON.stringify(data)) {\n _data = Object.assign({}, data);\n callback(data);\n }\n });\n }, interval);\n return result;\n}\n\n// ----------------------------------------------------------------------------------\n// export all libs\n// ----------------------------------------------------------------------------------\n\nexports.version = version;\nexports.system = system.system;\nexports.bios = system.bios;\nexports.baseboard = system.baseboard;\nexports.chassis = system.chassis;\n\nexports.time = osInfo.time;\nexports.osInfo = osInfo.osInfo;\nexports.versions = osInfo.versions;\nexports.shell = osInfo.shell;\nexports.uuid = osInfo.uuid;\n\nexports.cpu = cpu.cpu;\nexports.cpuFlags = cpu.cpuFlags;\nexports.cpuCache = cpu.cpuCache;\nexports.cpuCurrentSpeed = cpu.cpuCurrentSpeed;\nexports.cpuTemperature = cpu.cpuTemperature;\nexports.currentLoad = cpu.currentLoad;\nexports.fullLoad = cpu.fullLoad;\n\nexports.mem = memory.mem;\nexports.memLayout = memory.memLayout;\n\nexports.battery = battery;\n\nexports.graphics = graphics.graphics;\n\nexports.fsSize = filesystem.fsSize;\nexports.fsOpenFiles = filesystem.fsOpenFiles;\nexports.blockDevices = filesystem.blockDevices;\nexports.fsStats = filesystem.fsStats;\nexports.disksIO = filesystem.disksIO;\nexports.diskLayout = filesystem.diskLayout;\n\nexports.networkInterfaceDefault = network.networkInterfaceDefault;\nexports.networkGatewayDefault = network.networkGatewayDefault;\nexports.networkInterfaces = network.networkInterfaces;\nexports.networkStats = network.networkStats;\nexports.networkConnections = network.networkConnections;\n\nexports.wifiNetworks = wifi.wifiNetworks;\nexports.wifiInterfaces = wifi.wifiInterfaces;\nexports.wifiConnections = wifi.wifiConnections;\n\nexports.services = processes.services;\nexports.processes = processes.processes;\nexports.processLoad = processes.processLoad;\n\nexports.users = users.users;\n\nexports.inetChecksite = internet.inetChecksite;\nexports.inetLatency = internet.inetLatency;\n\nexports.dockerInfo = docker.dockerInfo;\nexports.dockerImages = docker.dockerImages;\nexports.dockerContainers = docker.dockerContainers;\nexports.dockerContainerStats = docker.dockerContainerStats;\nexports.dockerContainerProcesses = docker.dockerContainerProcesses;\nexports.dockerVolumes = docker.dockerVolumes;\nexports.dockerAll = docker.dockerAll;\n\nexports.vboxInfo = vbox.vboxInfo;\n\nexports.printer = printer.printer;\n\nexports.usb = usb.usb;\n\nexports.audio = audio.audio;\nexports.bluetoothDevices = bluetooth.bluetoothDevices;\n\nexports.getStaticData = getStaticData;\nexports.getDynamicData = getDynamicData;\nexports.getAllData = getAllData;\nexports.get = get;\nexports.observe = observe;\n\nexports.powerShellStart = util.powerShellStart;\nexports.powerShellRelease = util.powerShellRelease;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// internet.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 12. Internet\n// ----------------------------------------------------------------------------------\n\n// const exec = require('child_process').exec;\nconst util = require('./util');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\n// --------------------------\n// check if external site is available\n\nfunction inetChecksite(url, callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = {\n url: url,\n ok: false,\n status: 404,\n ms: null\n };\n if (typeof url !== 'string') {\n if (callback) { callback(result); }\n return resolve(result);\n }\n let urlSanitized = '';\n const s = util.sanitizeShellString(url, true);\n for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {\n if (!(s[i] === undefined)) {\n s[i].__proto__.toLowerCase = util.stringToLower;\n const sl = s[i].toLowerCase();\n if (sl && sl[0] && !sl[1] && sl[0].length === 1) {\n urlSanitized = urlSanitized + sl[0];\n }\n }\n }\n result.url = urlSanitized;\n try {\n if (urlSanitized && !util.isPrototypePolluted()) {\n urlSanitized.__proto__.startsWith = util.stringStartWith;\n if (urlSanitized.startsWith('file:') || urlSanitized.startsWith('gopher:') || urlSanitized.startsWith('telnet:') || urlSanitized.startsWith('mailto:') || urlSanitized.startsWith('news:') || urlSanitized.startsWith('nntp:')) {\n if (callback) { callback(result); }\n return resolve(result);\n }\n let t = Date.now();\n if (_linux || _freebsd || _openbsd || _netbsd || _darwin || _sunos) {\n let args = ['-I', '--connect-timeout', '5', '-m', '5'];\n args.push(urlSanitized);\n let cmd = 'curl';\n util.execSafe(cmd, args).then((stdout) => {\n const lines = stdout.split('\\n');\n let statusCode = lines[0] && lines[0].indexOf(' ') >= 0 ? parseInt(lines[0].split(' ')[1], 10) : 404;\n result.status = statusCode || 404;\n result.ok = (statusCode === 200 || statusCode === 301 || statusCode === 302 || statusCode === 304);\n result.ms = (result.ok ? Date.now() - t : null);\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_windows) { // if this is stable, this can be used for all OS types\n const http = (urlSanitized.startsWith('https:') ? require('https') : require('http'));\n try {\n http.get(urlSanitized, (res) => {\n const statusCode = res.statusCode;\n\n result.status = statusCode || 404;\n result.ok = (statusCode === 200 || statusCode === 301 || statusCode === 302 || statusCode === 304);\n\n if (statusCode !== 200) {\n res.resume();\n result.ms = (result.ok ? Date.now() - t : null);\n if (callback) { callback(result); }\n resolve(result);\n } else {\n res.on('data', () => { });\n res.on('end', () => {\n result.ms = (result.ok ? Date.now() - t : null);\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n }).on('error', () => {\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (err) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } catch (err) {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n}\n\nexports.inetChecksite = inetChecksite;\n\n// --------------------------\n// check inet latency\n\nfunction inetLatency(host, callback) {\n\n // fallback - if only callback is given\n if (util.isFunction(host) && !callback) {\n callback = host;\n host = '';\n }\n\n host = host || '8.8.8.8';\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (typeof host !== 'string') {\n if (callback) { callback(null); }\n return resolve(null);\n }\n let hostSanitized = '';\n const s = (util.isPrototypePolluted() ? '8.8.8.8' : util.sanitizeShellString(host, true)).trim();\n for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {\n if (!(s[i] === undefined)) {\n s[i].__proto__.toLowerCase = util.stringToLower;\n const sl = s[i].toLowerCase();\n if (sl && sl[0] && !sl[1]) {\n hostSanitized = hostSanitized + sl[0];\n }\n }\n }\n hostSanitized.__proto__.startsWith = util.stringStartWith;\n if (hostSanitized.startsWith('file:') || hostSanitized.startsWith('gopher:') || hostSanitized.startsWith('telnet:') || hostSanitized.startsWith('mailto:') || hostSanitized.startsWith('news:') || hostSanitized.startsWith('nntp:')) {\n if (callback) { callback(null); }\n return resolve(null);\n }\n let params;\n let filt;\n if (_linux || _freebsd || _openbsd || _netbsd || _darwin) {\n if (_linux) {\n params = ['-c', '2', '-w', '3', hostSanitized];\n filt = 'rtt';\n }\n if (_freebsd || _openbsd || _netbsd) {\n params = ['-c', '2', '-t', '3', hostSanitized];\n filt = 'round-trip';\n }\n if (_darwin) {\n params = ['-c2', '-t3', hostSanitized];\n filt = 'avg';\n }\n util.execSafe('ping', params).then((stdout) => {\n let result = null;\n if (stdout) {\n const lines = stdout.split('\\n').filter(line => line.indexOf(filt) >= 0).join('\\n');\n\n const line = lines.split('=');\n if (line.length > 1) {\n const parts = line[1].split('/');\n if (parts.length > 1) {\n result = parseFloat(parts[1]);\n }\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n const params = ['-s', '-a', hostSanitized, '56', '2'];\n const filt = 'avg';\n util.execSafe('ping', params, { timeout: 3000 }).then((stdout) => {\n let result = null;\n if (stdout) {\n const lines = stdout.split('\\n').filter(line => line.indexOf(filt) >= 0).join('\\n');\n const line = lines.split('=');\n if (line.length > 1) {\n const parts = line[1].split('/');\n if (parts.length > 1) {\n result = parseFloat(parts[1].replace(',', '.'));\n }\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_windows) {\n let result = null;\n try {\n const params = [hostSanitized, '-n', '1'];\n util.execSafe('ping', params, util.execOptsWin).then((stdout) => {\n if (stdout) {\n let lines = stdout.split('\\r\\n');\n lines.shift();\n lines.forEach(function (line) {\n if ((line.toLowerCase().match(/ms/g) || []).length === 3) {\n let l = line.replace(/ +/g, ' ').split(' ');\n if (l.length > 6) {\n result = parseFloat(l[l.length - 1]);\n }\n }\n });\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.inetLatency = inetLatency;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// memory.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 5. Memory\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst util = require('./util');\nconst fs = require('fs');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nconst OSX_RAM_manufacturers = {\n '0x014F': 'Transcend Information',\n '0x2C00': 'Micron Technology Inc.',\n '0x802C': 'Micron Technology Inc.',\n '0x80AD': 'Hynix Semiconductor Inc.',\n '0x80CE': 'Samsung Electronics Inc.',\n '0xAD00': 'Hynix Semiconductor Inc.',\n '0xCE00': 'Samsung Electronics Inc.',\n '0x02FE': 'Elpida',\n '0x5105': 'Qimonda AG i. In.',\n '0x8551': 'Qimonda AG i. In.',\n '0x859B': 'Crucial',\n '0x04CD': 'G-Skill'\n};\n\nconst LINUX_RAM_manufacturers = {\n '017A': 'Apacer',\n '0198': 'HyperX',\n '029E': 'Corsair',\n '04CB': 'A-DATA',\n '04CD': 'G-Skill',\n '059B': 'Crucial',\n '00CE': 'Samsung',\n '1315': 'Crutial',\n '014F': 'Transcend Information',\n '2C00': 'Micron Technology Inc.',\n '802C': 'Micron Technology Inc.',\n '80AD': 'Hynix Semiconductor Inc.',\n '80CE': 'Samsung Electronics Inc.',\n 'AD00': 'Hynix Semiconductor Inc.',\n 'CE00': 'Samsung Electronics Inc.',\n '02FE': 'Elpida',\n '5105': 'Qimonda AG i. In.',\n '8551': 'Qimonda AG i. In.',\n '859B': 'Crucial'\n};\n\n// _______________________________________________________________________________________\n// | R A M | H D |\n// |______________________|_________________________| | |\n// | active buffers/cache | | |\n// |________________________________________________|___________|_________|______________|\n// | used free | used free |\n// |____________________________________________________________|________________________|\n// | total | swap |\n// |____________________________________________________________|________________________|\n\n// free (older versions)\n// ----------------------------------\n// # free\n// total used free shared buffers cached\n// Mem: 16038 (1) 15653 (2) 384 (3) 0 (4) 236 (5) 14788 (6)\n// -/+ buffers/cache: 628 (7) 15409 (8)\n// Swap: 16371 83 16288\n//\n// |------------------------------------------------------------|\n// | R A M |\n// |______________________|_____________________________________|\n// | active (2-(5+6) = 7) | available (3+5+6 = 8) |\n// |______________________|_________________________|___________|\n// | active | buffers/cache (5+6) | |\n// |________________________________________________|___________|\n// | used (2) | free (3) |\n// |____________________________________________________________|\n// | total (1) |\n// |____________________________________________________________|\n\n//\n// free (since free von procps-ng 3.3.10)\n// ----------------------------------\n// # free\n// total used free shared buffers/cache available\n// Mem: 16038 (1) 628 (2) 386 (3) 0 (4) 15024 (5) 14788 (6)\n// Swap: 16371 83 16288\n//\n// |------------------------------------------------------------|\n// | R A M |\n// |______________________|_____________________________________|\n// | | available (6) estimated |\n// |______________________|_________________________|___________|\n// | active (2) | buffers/cache (5) | free (3) |\n// |________________________________________________|___________|\n// | total (1) |\n// |____________________________________________________________|\n//\n// Reference: http://www.software-architect.net/blog/article/date/2015/06/12/-826c6e5052.html\n\n// /procs/meminfo - sample (all in kB)\n//\n// MemTotal: 32806380 kB\n// MemFree: 17977744 kB\n// MemAvailable: 19768972 kB\n// Buffers: 517028 kB\n// Cached: 2161876 kB\n// SwapCached: 456 kB\n// Active: 12081176 kB\n// Inactive: 2164616 kB\n// Active(anon): 10832884 kB\n// Inactive(anon): 1477272 kB\n// Active(file): 1248292 kB\n// Inactive(file): 687344 kB\n// Unevictable: 0 kB\n// Mlocked: 0 kB\n// SwapTotal: 16768892 kB\n// SwapFree: 16768304 kB\n// Dirty: 268 kB\n// Writeback: 0 kB\n// AnonPages: 11568832 kB\n// Mapped: 719992 kB\n// Shmem: 743272 kB\n// Slab: 335716 kB\n// SReclaimable: 256364 kB\n// SUnreclaim: 79352 kB\n\nfunction mem(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = {\n total: os.totalmem(),\n free: os.freemem(),\n used: os.totalmem() - os.freemem(),\n\n active: os.totalmem() - os.freemem(), // temporarily (fallback)\n available: os.freemem(), // temporarily (fallback)\n buffers: 0,\n cached: 0,\n slab: 0,\n buffcache: 0,\n\n swaptotal: 0,\n swapused: 0,\n swapfree: 0\n };\n\n if (_linux) {\n fs.readFile('/proc/meminfo', function (error, stdout) {\n if (!error) {\n const lines = stdout.toString().split('\\n');\n result.total = parseInt(util.getValue(lines, 'memtotal'), 10);\n result.total = result.total ? result.total * 1024 : os.totalmem();\n result.free = parseInt(util.getValue(lines, 'memfree'), 10);\n result.free = result.free ? result.free * 1024 : os.freemem();\n result.used = result.total - result.free;\n\n result.buffers = parseInt(util.getValue(lines, 'buffers'), 10);\n result.buffers = result.buffers ? result.buffers * 1024 : 0;\n result.cached = parseInt(util.getValue(lines, 'cached'), 10);\n result.cached = result.cached ? result.cached * 1024 : 0;\n result.slab = parseInt(util.getValue(lines, 'slab'), 10);\n result.slab = result.slab ? result.slab * 1024 : 0;\n result.buffcache = result.buffers + result.cached + result.slab;\n\n let available = parseInt(util.getValue(lines, 'memavailable'), 10);\n result.available = available ? available * 1024 : result.free + result.buffcache;\n result.active = result.total - result.available;\n\n result.swaptotal = parseInt(util.getValue(lines, 'swaptotal'), 10);\n result.swaptotal = result.swaptotal ? result.swaptotal * 1024 : 0;\n result.swapfree = parseInt(util.getValue(lines, 'swapfree'), 10);\n result.swapfree = result.swapfree ? result.swapfree * 1024 : 0;\n result.swapused = result.swaptotal - result.swapfree;\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_freebsd || _openbsd || _netbsd) {\n exec('/sbin/sysctl hw.realmem hw.physmem vm.stats.vm.v_page_count vm.stats.vm.v_wire_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count vm.stats.vm.v_page_size', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n const pagesize = parseInt(util.getValue(lines, 'vm.stats.vm.v_page_size'), 10);\n const inactive = parseInt(util.getValue(lines, 'vm.stats.vm.v_inactive_count'), 10) * pagesize;\n const cache = parseInt(util.getValue(lines, 'vm.stats.vm.v_cache_count'), 10) * pagesize;\n\n result.total = parseInt(util.getValue(lines, 'hw.realmem'), 10);\n if (isNaN(result.total)) { result.total = parseInt(util.getValue(lines, 'hw.physmem'), 10); }\n result.free = parseInt(util.getValue(lines, 'vm.stats.vm.v_free_count'), 10) * pagesize;\n result.buffcache = inactive + cache;\n result.available = result.buffcache + result.free;\n result.active = result.total - result.free - result.buffcache;\n\n result.swaptotal = 0;\n result.swapfree = 0;\n result.swapused = 0;\n\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_darwin) {\n let pageSize = 4096;\n try {\n let sysPpageSize = util.toInt(execSync('sysctl -n vm.pagesize').toString());\n pageSize = sysPpageSize || pageSize;\n } catch (e) {\n util.noop();\n }\n exec('vm_stat 2>/dev/null | grep \"Pages active\"', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n\n result.active = parseInt(lines[0].split(':')[1], 10) * pageSize;\n result.buffcache = result.used - result.active;\n result.available = result.free + result.buffcache;\n }\n exec('sysctl -n vm.swapusage 2>/dev/null', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines.length > 0) {\n let line = lines[0].replace(/,/g, '.').replace(/M/g, '');\n line = line.trim().split(' ');\n for (let i = 0; i < line.length; i++) {\n if (line[i].toLowerCase().indexOf('total') !== -1) { result.swaptotal = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024; }\n if (line[i].toLowerCase().indexOf('used') !== -1) { result.swapused = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024; }\n if (line[i].toLowerCase().indexOf('free') !== -1) { result.swapfree = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024; }\n }\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n }\n if (_windows) {\n let swaptotal = 0;\n let swapused = 0;\n try {\n util.powerShell('Get-CimInstance Win32_PageFileUsage | Select AllocatedBaseSize, CurrentUsage').then((stdout, error) => {\n if (!error) {\n let lines = stdout.split('\\r\\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0);\n lines.forEach(function (line) {\n if (line !== '') {\n line = line.trim().split(/\\s\\s+/);\n swaptotal = swaptotal + (parseInt(line[0], 10) || 0);\n swapused = swapused + (parseInt(line[1], 10) || 0);\n }\n });\n }\n result.swaptotal = swaptotal * 1024 * 1024;\n result.swapused = swapused * 1024 * 1024;\n result.swapfree = result.swaptotal - result.swapused;\n\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.mem = mem;\n\nfunction memLayout(callback) {\n\n function getManufacturerDarwin(manId) {\n if ({}.hasOwnProperty.call(OSX_RAM_manufacturers, manId)) {\n return (OSX_RAM_manufacturers[manId]);\n }\n return manId;\n }\n\n function getManufacturerLinux(manId) {\n const manIdSearch = manId.replace('0x', '').toUpperCase();\n if (manIdSearch.length === 4 && {}.hasOwnProperty.call(LINUX_RAM_manufacturers, manIdSearch)) {\n return (LINUX_RAM_manufacturers[manIdSearch]);\n }\n return manId;\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = [];\n\n if (_linux || _freebsd || _openbsd || _netbsd) {\n exec('export LC_ALL=C; dmidecode -t memory 2>/dev/null | grep -iE \"Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number\"; unset LC_ALL', function (error, stdout) {\n if (!error) {\n let devices = stdout.toString().split('Memory Device');\n devices.shift();\n devices.forEach(function (device) {\n let lines = device.split('\\n');\n const sizeString = util.getValue(lines, 'Size');\n const size = sizeString.indexOf('GB') >= 0 ? parseInt(sizeString, 10) * 1024 * 1024 * 1024 : parseInt(sizeString, 10) * 1024 * 1024;\n if (parseInt(util.getValue(lines, 'Size'), 10) > 0) {\n const totalWidth = util.toInt(util.getValue(lines, 'Total Width'));\n const dataWidth = util.toInt(util.getValue(lines, 'Data Width'));\n result.push({\n size,\n bank: util.getValue(lines, 'Bank Locator'),\n type: util.getValue(lines, 'Type:'),\n ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,\n clockSpeed: (util.getValue(lines, 'Configured Clock Speed:') ? parseInt(util.getValue(lines, 'Configured Clock Speed:'), 10) : (util.getValue(lines, 'Speed:') ? parseInt(util.getValue(lines, 'Speed:'), 10) : null)),\n formFactor: util.getValue(lines, 'Form Factor:'),\n manufacturer: getManufacturerLinux(util.getValue(lines, 'Manufacturer:')),\n partNum: util.getValue(lines, 'Part Number:'),\n serialNum: util.getValue(lines, 'Serial Number:'),\n voltageConfigured: parseFloat(util.getValue(lines, 'Configured Voltage:')) || null,\n voltageMin: parseFloat(util.getValue(lines, 'Minimum Voltage:')) || null,\n voltageMax: parseFloat(util.getValue(lines, 'Maximum Voltage:')) || null,\n });\n } else {\n result.push({\n size: 0,\n bank: util.getValue(lines, 'Bank Locator'),\n type: 'Empty',\n ecc: null,\n clockSpeed: 0,\n formFactor: util.getValue(lines, 'Form Factor:'),\n partNum: '',\n serialNum: '',\n voltageConfigured: null,\n voltageMin: null,\n voltageMax: null,\n });\n }\n });\n }\n if (!result.length) {\n result.push({\n size: os.totalmem(),\n bank: '',\n type: '',\n ecc: null,\n clockSpeed: 0,\n formFactor: '',\n partNum: '',\n serialNum: '',\n voltageConfigured: null,\n voltageMin: null,\n voltageMax: null,\n });\n\n // Try Raspberry PI\n try {\n let stdout = execSync('cat /proc/cpuinfo 2>/dev/null');\n let lines = stdout.toString().split('\\n');\n let model = util.getValue(lines, 'hardware', ':', true).toUpperCase();\n let version = util.getValue(lines, 'revision', ':', true).toLowerCase();\n\n if (model === 'BCM2835' || model === 'BCM2708' || model === 'BCM2709' || model === 'BCM2835' || model === 'BCM2837') {\n\n const clockSpeed = {\n '0': 400,\n '1': 450,\n '2': 450,\n '3': 3200\n };\n result[0].type = 'LPDDR2';\n result[0].type = version && version[2] && version[2] === '3' ? 'LPDDR4' : result[0].type;\n result[0].ecc = false;\n result[0].clockSpeed = version && version[2] && clockSpeed[version[2]] || 400;\n result[0].clockSpeed = version && version[4] && version[4] === 'd' ? 500 : result[0].clockSpeed;\n result[0].formFactor = 'SoC';\n\n stdout = execSync('vcgencmd get_config sdram_freq 2>/dev/null');\n lines = stdout.toString().split('\\n');\n let freq = parseInt(util.getValue(lines, 'sdram_freq', '=', true), 10) || 0;\n if (freq) {\n result[0].clockSpeed = freq;\n }\n\n stdout = execSync('vcgencmd measure_volts sdram_p 2>/dev/null');\n lines = stdout.toString().split('\\n');\n let voltage = parseFloat(util.getValue(lines, 'volt', '=', true)) || 0;\n if (voltage) {\n result[0].voltageConfigured = voltage;\n result[0].voltageMin = voltage;\n result[0].voltageMax = voltage;\n }\n }\n } catch (e) {\n util.noop();\n }\n\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n\n if (_darwin) {\n exec('system_profiler SPMemoryDataType', function (error, stdout) {\n if (!error) {\n const allLines = stdout.toString().split('\\n');\n const eccStatus = util.getValue(allLines, 'ecc', ':', true).toLowerCase();\n let devices = stdout.toString().split(' BANK ');\n let hasBank = true;\n if (devices.length === 1) {\n devices = stdout.toString().split(' DIMM');\n hasBank = false;\n }\n devices.shift();\n devices.forEach(function (device) {\n let lines = device.split('\\n');\n const bank = (hasBank ? 'BANK ' : 'DIMM') + lines[0].trim().split('/')[0];\n const size = parseInt(util.getValue(lines, ' Size'));\n if (size) {\n result.push({\n size: size * 1024 * 1024 * 1024,\n bank: bank,\n type: util.getValue(lines, ' Type:'),\n ecc: eccStatus ? eccStatus === 'enabled' : null,\n clockSpeed: parseInt(util.getValue(lines, ' Speed:'), 10),\n formFactor: '',\n manufacturer: getManufacturerDarwin(util.getValue(lines, ' Manufacturer:')),\n partNum: util.getValue(lines, ' Part Number:'),\n serialNum: util.getValue(lines, ' Serial Number:'),\n voltageConfigured: null,\n voltageMin: null,\n voltageMax: null,\n });\n } else {\n result.push({\n size: 0,\n bank: bank,\n type: 'Empty',\n ecc: null,\n clockSpeed: 0,\n formFactor: '',\n manufacturer: '',\n partNum: '',\n serialNum: '',\n voltageConfigured: null,\n voltageMin: null,\n voltageMax: null,\n });\n }\n });\n }\n if (!result.length) {\n const lines = stdout.toString().split('\\n');\n const size = parseInt(util.getValue(lines, ' Memory:'));\n const type = util.getValue(lines, ' Type:');\n if (size && type) {\n result.push({\n size: size * 1024 * 1024 * 1024,\n bank: '0',\n type,\n ecc: false,\n clockSpeed: 0,\n formFactor: '',\n manufacturer: 'Apple',\n partNum: '',\n serialNum: '',\n voltageConfigured: null,\n voltageMin: null,\n voltageMax: null,\n });\n\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n const memoryTypes = 'Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4'.split('|');\n const FormFactors = 'Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA'.split('|');\n\n try {\n util.powerShell('Get-WmiObject Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage | fl').then((stdout, error) => {\n if (!error) {\n let devices = stdout.toString().split(/\\n\\s*\\n/);\n devices.shift();\n devices.forEach(function (device) {\n let lines = device.split('\\r\\n');\n const dataWidth = util.toInt(util.getValue(lines, 'DataWidth', ':'));\n const totalWidth = util.toInt(util.getValue(lines, 'TotalWidth', ':'));\n const size = parseInt(util.getValue(lines, 'Capacity', ':'), 10) || 0;\n if (size) {\n result.push({\n size,\n bank: util.getValue(lines, 'BankLabel', ':'), // BankLabel\n type: memoryTypes[parseInt(util.getValue(lines, 'MemoryType', ':'), 10) || parseInt(util.getValue(lines, 'SMBIOSMemoryType', ':'), 10)],\n ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,\n clockSpeed: parseInt(util.getValue(lines, 'ConfiguredClockSpeed', ':'), 10) || parseInt(util.getValue(lines, 'Speed', ':'), 10) || 0,\n formFactor: FormFactors[parseInt(util.getValue(lines, 'FormFactor', ':'), 10) || 0],\n manufacturer: util.getValue(lines, 'Manufacturer', ':'),\n partNum: util.getValue(lines, 'PartNumber', ':'),\n serialNum: util.getValue(lines, 'SerialNumber', ':'),\n voltageConfigured: (parseInt(util.getValue(lines, 'ConfiguredVoltage', ':'), 10) || 0) / 1000.0,\n voltageMin: (parseInt(util.getValue(lines, 'MinVoltage', ':'), 10) || 0) / 1000.0,\n voltageMax: (parseInt(util.getValue(lines, 'MaxVoltage', ':'), 10) || 0) / 1000.0,\n });\n }\n });\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.memLayout = memLayout;\n\n","'use strict';\n// @ts-check\n// ==================================================================================\n// network.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 9. Network\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst fs = require('fs');\nconst util = require('./util');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nlet _network = {};\nlet _default_iface = '';\nlet _ifaces = {};\nlet _dhcpNics = [];\nlet _networkInterfaces = [];\nlet _mac = {};\nlet pathToIp;\n\nfunction getDefaultNetworkInterface() {\n\n let ifacename = '';\n let ifacenameFirst = '';\n try {\n let ifaces = os.networkInterfaces();\n\n let scopeid = 9999;\n\n // fallback - \"first\" external interface (sorted by scopeid)\n for (let dev in ifaces) {\n if ({}.hasOwnProperty.call(ifaces, dev)) {\n ifaces[dev].forEach(function (details) {\n if (details && details.internal === false) {\n ifacenameFirst = ifacenameFirst || dev; // fallback if no scopeid\n if (details.scopeid && details.scopeid < scopeid) {\n ifacename = dev;\n scopeid = details.scopeid;\n }\n }\n });\n }\n }\n ifacename = ifacename || ifacenameFirst || '';\n\n if (_windows) {\n // https://www.inetdaemon.com/tutorials/internet/ip/routing/default_route.shtml\n let defaultIp = '';\n const cmd = 'netstat -r';\n const result = execSync(cmd, util.execOptsWin);\n const lines = result.toString().split(os.EOL);\n lines.forEach(line => {\n line = line.replace(/\\s+/g, ' ').trim();\n if (line.indexOf('0.0.0.0 0.0.0.0') > -1 && !(/[a-zA-Z]/.test(line))) {\n const parts = line.split(' ');\n if (parts.length >= 5) {\n defaultIp = parts[parts.length - 2];\n }\n }\n });\n if (defaultIp) {\n for (let dev in ifaces) {\n if ({}.hasOwnProperty.call(ifaces, dev)) {\n ifaces[dev].forEach(function (details) {\n if (details && details.address && details.address === defaultIp) {\n ifacename = dev;\n }\n });\n }\n }\n }\n }\n if (_linux) {\n let cmd = 'ip route 2> /dev/null | grep default';\n let result = execSync(cmd);\n let parts = result.toString().split('\\n')[0].split(/\\s+/);\n if (parts[0] === 'none' && parts[5]) {\n ifacename = parts[5];\n } else if (parts[4]) {\n ifacename = parts[4];\n }\n\n if (ifacename.indexOf(':') > -1) {\n ifacename = ifacename.split(':')[1].trim();\n }\n }\n if (_darwin || _freebsd || _openbsd || _netbsd || _sunos) {\n let cmd = '';\n if (_linux) { cmd = 'ip route 2> /dev/null | grep default | awk \\'{print $5}\\''; }\n if (_darwin) { cmd = 'route -n get default 2>/dev/null | grep interface: | awk \\'{print $2}\\''; }\n if (_freebsd || _openbsd || _netbsd || _sunos) { cmd = 'route get 0.0.0.0 | grep interface:'; }\n // console.log('SYNC - default darwin 3');\n let result = execSync(cmd);\n ifacename = result.toString().split('\\n')[0];\n if (ifacename.indexOf(':') > -1) {\n ifacename = ifacename.split(':')[1].trim();\n }\n }\n } catch (e) {\n util.noop();\n }\n if (ifacename) { _default_iface = ifacename; }\n return _default_iface;\n}\n\nexports.getDefaultNetworkInterface = getDefaultNetworkInterface;\n\nfunction getMacAddresses() {\n let iface = '';\n let mac = '';\n let result = {};\n if (_linux || _freebsd || _openbsd || _netbsd) {\n if (typeof pathToIp === 'undefined') {\n try {\n const lines = execSync('which ip').toString().split('\\n');\n if (lines.length && lines[0].indexOf(':') === -1 && lines[0].indexOf('/') === 0) {\n pathToIp = lines[0];\n } else {\n pathToIp = '';\n }\n } catch (e) {\n pathToIp = '';\n }\n }\n try {\n const cmd = 'export LC_ALL=C; ' + ((pathToIp) ? pathToIp + ' link show up' : '/sbin/ifconfig') + '; unset LC_ALL';\n let res = execSync(cmd);\n const lines = res.toString().split('\\n');\n for (let i = 0; i < lines.length; i++) {\n if (lines[i] && lines[i][0] !== ' ') {\n if (pathToIp) {\n let nextline = lines[i + 1].trim().split(' ');\n if (nextline[0] === 'link/ether') {\n iface = lines[i].split(' ')[1];\n iface = iface.slice(0, iface.length - 1);\n mac = nextline[1];\n }\n } else {\n iface = lines[i].split(' ')[0];\n mac = lines[i].split('HWaddr ')[1];\n }\n\n if (iface && mac) {\n result[iface] = mac.trim();\n iface = '';\n mac = '';\n }\n }\n }\n } catch (e) {\n util.noop();\n }\n }\n if (_darwin) {\n try {\n const cmd = '/sbin/ifconfig';\n // console.log('SYNC - macAde darwin 6');\n let res = execSync(cmd);\n const lines = res.toString().split('\\n');\n for (let i = 0; i < lines.length; i++) {\n if (lines[i] && lines[i][0] !== '\\t' && lines[i].indexOf(':') > 0) {\n iface = lines[i].split(':')[0];\n } else if (lines[i].indexOf('\\tether ') === 0) {\n mac = lines[i].split('\\tether ')[1];\n if (iface && mac) {\n result[iface] = mac.trim();\n iface = '';\n mac = '';\n }\n }\n }\n } catch (e) {\n util.noop();\n }\n }\n return result;\n}\n\nfunction networkInterfaceDefault(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = getDefaultNetworkInterface();\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n}\n\nexports.networkInterfaceDefault = networkInterfaceDefault;\n\n// --------------------------\n// NET - interfaces\n\nfunction parseLinesWindowsNics(sections, nconfigsections) {\n let nics = [];\n for (let i in sections) {\n if ({}.hasOwnProperty.call(sections, i)) {\n\n if (sections[i].trim() !== '') {\n\n let lines = sections[i].trim().split('\\r\\n');\n let linesNicConfig = nconfigsections && nconfigsections[i] ? nconfigsections[i].trim().split('\\r\\n') : [];\n let netEnabled = util.getValue(lines, 'NetEnabled', ':');\n let adapterType = util.getValue(lines, 'AdapterTypeID', ':') === '9' ? 'wireless' : 'wired';\n let ifacename = util.getValue(lines, 'Name', ':').replace(/\\]/g, ')').replace(/\\[/g, '(');\n let iface = util.getValue(lines, 'NetConnectionID', ':').replace(/\\]/g, ')').replace(/\\[/g, '(');\n if (ifacename.toLowerCase().indexOf('wi-fi') >= 0 || ifacename.toLowerCase().indexOf('wireless') >= 0) {\n adapterType = 'wireless';\n }\n if (netEnabled !== '') {\n const speed = parseInt(util.getValue(lines, 'speed', ':').trim(), 10) / 1000000;\n nics.push({\n mac: util.getValue(lines, 'MACAddress', ':').toLowerCase(),\n dhcp: util.getValue(linesNicConfig, 'dhcpEnabled', ':').toLowerCase() === 'true',\n name: ifacename,\n iface,\n netEnabled: netEnabled === 'TRUE',\n speed: isNaN(speed) ? null : speed,\n operstate: util.getValue(lines, 'NetConnectionStatus', ':') === '2' ? 'up' : 'down',\n type: adapterType\n });\n }\n }\n }\n }\n return nics;\n}\n\nfunction getWindowsNics() {\n // const cmd = util.getWmic() + ' nic get /value';\n // const cmdnicconfig = util.getWmic() + ' nicconfig get dhcpEnabled /value';\n return new Promise((resolve) => {\n process.nextTick(() => {\n let cmd = 'Get-WmiObject Win32_NetworkAdapter | fl *' + '; echo \\'#-#-#-#\\';';\n cmd += 'Get-WmiObject Win32_NetworkAdapterConfiguration | fl DHCPEnabled' + '';\n try {\n util.powerShell(cmd).then(data => {\n data = data.split('#-#-#-#');\n const nsections = (data[0] || '').split(/\\n\\s*\\n/);\n const nconfigsections = (data[1] || '').split(/\\n\\s*\\n/);\n resolve(parseLinesWindowsNics(nsections, nconfigsections));\n });\n } catch (e) {\n resolve([]);\n }\n });\n });\n}\n\nfunction getWindowsDNSsuffixes() {\n\n let iface = {};\n\n let dnsSuffixes = {\n primaryDNS: '',\n exitCode: 0,\n ifaces: [],\n };\n\n try {\n const ipconfig = execSync('ipconfig /all', util.execOptsWin);\n const ipconfigArray = ipconfig.split('\\r\\n\\r\\n');\n\n ipconfigArray.forEach((element, index) => {\n\n if (index == 1) {\n const longPrimaryDNS = element.split('\\r\\n').filter((element) => {\n return element.toUpperCase().includes('DNS');\n });\n const primaryDNS = longPrimaryDNS[0].substring(longPrimaryDNS[0].lastIndexOf(':') + 1);\n dnsSuffixes.primaryDNS = primaryDNS.trim();\n if (!dnsSuffixes.primaryDNS) { dnsSuffixes.primaryDNS = 'Not defined'; }\n }\n if (index > 1) {\n if (index % 2 == 0) {\n const name = element.substring(element.lastIndexOf(' ') + 1).replace(':', '');\n iface.name = name;\n } else {\n const connectionSpecificDNS = element.split('\\r\\n').filter((element) => {\n return element.toUpperCase().includes('DNS');\n });\n const dnsSuffix = connectionSpecificDNS[0].substring(connectionSpecificDNS[0].lastIndexOf(':') + 1);\n iface.dnsSuffix = dnsSuffix.trim();\n dnsSuffixes.ifaces.push(iface);\n iface = {};\n }\n }\n });\n\n return dnsSuffixes;\n } catch (error) {\n // console.log('An error occurred trying to bring the Connection-specific DNS suffix', error.message);\n return {\n primaryDNS: '',\n exitCode: 0,\n ifaces: [],\n };\n }\n}\n\nfunction getWindowsIfaceDNSsuffix(ifaces, ifacename) {\n let dnsSuffix = '';\n // Adding (.) to ensure ifacename compatibility when duplicated iface-names\n const interfaceName = ifacename + '.';\n try {\n const connectionDnsSuffix = ifaces.filter((iface) => {\n return interfaceName.includes(iface.name + '.');\n }).map((iface) => iface.dnsSuffix);\n if (connectionDnsSuffix[0]) {\n dnsSuffix = connectionDnsSuffix[0];\n }\n if (!dnsSuffix) { dnsSuffix = ''; }\n return dnsSuffix;\n } catch (error) {\n // console.log('Error getting Connection-specific DNS suffix: ', error.message);\n return 'Unknown';\n }\n}\n\nfunction getWindowsWiredProfilesInformation() {\n try {\n const result = execSync('netsh lan show profiles', util.execOptsWin);\n const profileList = result.split('\\r\\nProfile on interface');\n return profileList;\n } catch (error) {\n if (error.status === 1 && error.stdout.includes('AutoConfig')) {\n return 'Disabled';\n }\n return [];\n }\n}\n\nfunction getWindowsWirelessIfaceSSID(interfaceName) {\n try {\n const result = execSync(`netsh wlan show interface name=\"${interfaceName}\" | findstr \"SSID\"`, util.execOptsWin);\n const SSID = result.split('\\r\\n').shift();\n const parseSSID = SSID.split(':').pop();\n return parseSSID;\n } catch (error) {\n return 'Unknown';\n }\n}\nfunction getWindowsIEEE8021x(connectionType, iface, ifaces) {\n let i8021x = {\n state: 'Unknown',\n protocol: 'Unknown',\n };\n\n if (ifaces === 'Disabled') {\n i8021x.state = 'Disabled';\n i8021x.protocol = 'Not defined';\n return i8021x;\n }\n\n if (connectionType == 'wired' && ifaces.length > 0) {\n try {\n // Get 802.1x information by interface name\n const iface8021xInfo = ifaces.find((element) => {\n return element.includes(iface + '\\r\\n');\n });\n const arrayIface8021xInfo = iface8021xInfo.split('\\r\\n');\n const state8021x = arrayIface8021xInfo.find((element) => {\n return element.includes('802.1x');\n });\n\n if (state8021x.includes('Disabled')) {\n i8021x.state = 'Disabled';\n i8021x.protocol = 'Not defined';\n } else if (state8021x.includes('Enabled')) {\n const protocol8021x = arrayIface8021xInfo.find((element) => {\n return element.includes('EAP');\n });\n i8021x.protocol = protocol8021x.split(':').pop();\n i8021x.state = 'Enabled';\n }\n } catch (error) {\n // console.log('Error getting wired information:', error);\n return i8021x;\n }\n } else if (connectionType == 'wireless') {\n\n let i8021xState = '';\n let i8021xProtocol = '';\n\n\n\n try {\n const SSID = getWindowsWirelessIfaceSSID(iface);\n if (SSID !== 'Unknown') {\n i8021xState = execSync(`netsh wlan show profiles \"${SSID}\" | findstr \"802.1X\"`, util.execOptsWin);\n i8021xProtocol = execSync(`netsh wlan show profiles \"${SSID}\" | findstr \"EAP\"`, util.execOptsWin);\n }\n\n if (i8021xState.includes(':') && i8021xProtocol.includes(':')) {\n i8021x.state = i8021xState.split(':').pop();\n i8021x.protocol = i8021xProtocol.split(':').pop();\n }\n } catch (error) {\n // console.log('Error getting wireless information:', error);\n if (error.status === 1 && error.stdout.includes('AutoConfig')) {\n i8021x.state = 'Disabled';\n i8021x.protocol = 'Not defined';\n }\n return i8021x;\n }\n }\n\n return i8021x;\n}\n\nfunction splitSectionsNics(lines) {\n const result = [];\n let section = [];\n lines.forEach(function (line) {\n if (!line.startsWith('\\t') && !line.startsWith(' ')) {\n if (section.length) {\n result.push(section);\n section = [];\n }\n }\n section.push(line);\n });\n if (section.length) {\n result.push(section);\n }\n return result;\n}\n\nfunction parseLinesDarwinNics(sections) {\n let nics = [];\n sections.forEach(section => {\n let nic = {\n iface: '',\n mtu: null,\n mac: '',\n ip6: '',\n ip4: '',\n speed: null,\n type: '',\n operstate: '',\n duplex: '',\n internal: false\n };\n const first = section[0];\n nic.iface = first.split(':')[0].trim();\n let parts = first.split('> mtu');\n nic.mtu = parts.length > 1 ? parseInt(parts[1], 10) : null;\n if (isNaN(nic.mtu)) {\n nic.mtu = null;\n }\n nic.internal = parts[0].toLowerCase().indexOf('loopback') > -1;\n section.forEach(line => {\n if (line.trim().startsWith('ether ')) {\n nic.mac = line.split('ether ')[1].toLowerCase().trim();\n }\n if (line.trim().startsWith('inet6 ') && !nic.ip6) {\n nic.ip6 = line.split('inet6 ')[1].toLowerCase().split('%')[0].split(' ')[0];\n }\n if (line.trim().startsWith('inet ') && !nic.ip4) {\n nic.ip4 = line.split('inet ')[1].toLowerCase().split(' ')[0];\n }\n });\n let speed = util.getValue(section, 'link rate');\n nic.speed = speed ? parseFloat(speed) : null;\n if (nic.speed === null) {\n speed = util.getValue(section, 'uplink rate');\n nic.speed = speed ? parseFloat(speed) : null;\n if (nic.speed !== null && speed.toLowerCase().indexOf('gbps') >= 0) {\n nic.speed = nic.speed * 1000;\n }\n } else {\n if (speed.toLowerCase().indexOf('gbps') >= 0) {\n nic.speed = nic.speed * 1000;\n }\n }\n nic.type = util.getValue(section, 'type').toLowerCase().indexOf('wi-fi') > -1 ? 'wireless' : 'wired';\n nic.operstate = util.getValue(section, 'status').toLowerCase().indexOf('active') > -1 ? 'up' : 'down';\n nic.duplex = util.getValue(section, 'media').toLowerCase().indexOf('half-duplex') > -1 ? 'half' : 'full';\n if (nic.ip6 || nic.ip4 || nic.mac) {\n nics.push(nic);\n }\n });\n return nics;\n}\n\nfunction getDarwinNics() {\n const cmd = '/sbin/ifconfig -v';\n try {\n // console.log('SYNC - Nics darwin 12');\n const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\\n');\n const nsections = splitSectionsNics(lines);\n return (parseLinesDarwinNics(nsections));\n } catch (e) {\n return [];\n }\n}\n\nfunction getLinuxIfaceConnectionName(interfaceName) {\n const cmd = `nmcli device status 2>/dev/null | grep ${interfaceName}`;\n\n try {\n const result = execSync(cmd).toString();\n const resultFormat = result.replace(/\\s+/g, ' ').trim();\n const connectionNameLines = resultFormat.split(' ').slice(3);\n const connectionName = connectionNameLines.join(' ');\n return connectionName != '--' ? connectionName : '';\n } catch (e) {\n return '';\n }\n}\n\nfunction checkLinuxDCHPInterfaces(file) {\n let result = [];\n try {\n let cmd = `cat ${file} 2> /dev/null | grep 'iface\\\\|source'`;\n const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\\n');\n\n lines.forEach(line => {\n const parts = line.replace(/\\s+/g, ' ').trim().split(' ');\n if (parts.length >= 4) {\n if (line.toLowerCase().indexOf(' inet ') >= 0 && line.toLowerCase().indexOf('dhcp') >= 0) {\n result.push(parts[1]);\n }\n }\n if (line.toLowerCase().includes('source')) {\n let file = line.split(' ')[1];\n result = result.concat(checkLinuxDCHPInterfaces(file));\n }\n });\n } catch (e) {\n util.noop();\n }\n return result;\n}\n\nfunction getLinuxDHCPNics() {\n // alternate methods getting interfaces using DHCP\n let cmd = 'ip a 2> /dev/null';\n let result = [];\n try {\n const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\\n');\n const nsections = splitSectionsNics(lines);\n result = (parseLinuxDHCPNics(nsections));\n } catch (e) {\n util.noop();\n }\n try {\n result = checkLinuxDCHPInterfaces('/etc/network/interfaces');\n } catch (e) {\n util.noop();\n }\n return result;\n}\n\nfunction parseLinuxDHCPNics(sections) {\n const result = [];\n if (sections && sections.length) {\n sections.forEach(lines => {\n if (lines && lines.length) {\n const parts = lines[0].split(':');\n if (parts.length > 2) {\n for (let line of lines) {\n if (line.indexOf(' inet ') >= 0 && line.indexOf(' dynamic ') >= 0) {\n const parts2 = line.split(' ');\n const nic = parts2[parts2.length - 1].trim();\n result.push(nic);\n break;\n }\n }\n }\n }\n });\n }\n return result;\n}\n\nfunction getLinuxIfaceDHCPstatus(iface, connectionName, DHCPNics) {\n let result = false;\n if (connectionName) {\n const cmd = `nmcli connection show \"${connectionName}\" 2>/dev/null | grep ipv4.method;`;\n try {\n const lines = execSync(cmd).toString();\n const resultFormat = lines.replace(/\\s+/g, ' ').trim();\n\n let dhcStatus = resultFormat.split(' ').slice(1).toString();\n switch (dhcStatus) {\n case 'auto':\n result = true;\n break;\n\n default:\n result = false;\n break;\n }\n return result;\n } catch (e) {\n return (DHCPNics.indexOf(iface) >= 0);\n }\n } else {\n return (DHCPNics.indexOf(iface) >= 0);\n }\n}\n\nfunction getDarwinIfaceDHCPstatus(iface) {\n let result = false;\n const cmd = `ipconfig getpacket \"${iface}\" 2>/dev/null | grep lease_time;`;\n try {\n // console.log('SYNC - DHCP status darwin 17');\n const lines = execSync(cmd).toString().split('\\n');\n if (lines.length && lines[0].startsWith('lease_time')) {\n result = true;\n }\n } catch (e) {\n util.noop();\n }\n return result;\n}\n\nfunction getLinuxIfaceDNSsuffix(connectionName) {\n if (connectionName) {\n const cmd = `nmcli connection show \"${connectionName}\" 2>/dev/null | grep ipv4.dns-search;`;\n try {\n const result = execSync(cmd).toString();\n const resultFormat = result.replace(/\\s+/g, ' ').trim();\n const dnsSuffix = resultFormat.split(' ').slice(1).toString();\n return dnsSuffix == '--' ? 'Not defined' : dnsSuffix;\n } catch (e) {\n return 'Unknown';\n }\n } else {\n return 'Unknown';\n }\n}\n\nfunction getLinuxIfaceIEEE8021xAuth(connectionName) {\n if (connectionName) {\n const cmd = `nmcli connection show \"${connectionName}\" 2>/dev/null | grep 802-1x.eap;`;\n try {\n const result = execSync(cmd).toString();\n const resultFormat = result.replace(/\\s+/g, ' ').trim();\n const authenticationProtocol = resultFormat.split(' ').slice(1).toString();\n\n\n return authenticationProtocol == '--' ? '' : authenticationProtocol;\n } catch (e) {\n return 'Not defined';\n }\n } else {\n return 'Not defined';\n }\n}\n\nfunction getLinuxIfaceIEEE8021xState(authenticationProtocol) {\n if (authenticationProtocol) {\n if (authenticationProtocol == 'Not defined') {\n return 'Disabled';\n }\n return 'Enabled';\n } else {\n return 'Unknown';\n }\n}\n\nfunction testVirtualNic(iface, ifaceName, mac) {\n const virtualMacs = ['00:00:00:00:00:00', '00:03:FF', '00:05:69', '00:0C:29', '00:0F:4B', '00:0F:4B', '00:13:07', '00:13:BE', '00:15:5d', '00:16:3E', '00:1C:42', '00:21:F6', '00:21:F6', '00:24:0B', '00:24:0B', '00:50:56', '00:A0:B1', '00:E0:C8', '08:00:27', '0A:00:27', '18:92:2C', '16:DF:49', '3C:F3:92', '54:52:00', 'FC:15:97'];\n if (mac) {\n return virtualMacs.filter(item => { return mac.toUpperCase().toUpperCase().startsWith(item.substr(0, mac.length)); }).length > 0 ||\n iface.toLowerCase().indexOf(' virtual ') > -1 ||\n ifaceName.toLowerCase().indexOf(' virtual ') > -1 ||\n iface.toLowerCase().indexOf('vethernet ') > -1 ||\n ifaceName.toLowerCase().indexOf('vethernet ') > -1 ||\n iface.toLowerCase().startsWith('veth') ||\n ifaceName.toLowerCase().startsWith('veth') ||\n iface.toLowerCase().startsWith('vboxnet') ||\n ifaceName.toLowerCase().startsWith('vboxnet');\n } else { return false; }\n}\n\nfunction networkInterfaces(callback, rescan, defaultString) {\n\n if (typeof callback === 'string') {\n defaultString = callback;\n rescan = true;\n callback = null;\n }\n\n if (typeof callback === 'boolean') {\n rescan = callback;\n callback = null;\n defaultString = '';\n }\n if (typeof rescan === 'undefined') {\n rescan = true;\n }\n defaultString = defaultString || '';\n defaultString = '' + defaultString;\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let ifaces = os.networkInterfaces();\n\n let result = [];\n let nics = [];\n let dnsSuffixes = [];\n let nics8021xInfo = [];\n // seperate handling in OSX\n if (_darwin || _freebsd || _openbsd || _netbsd) {\n if ((JSON.stringify(ifaces) === JSON.stringify(_ifaces)) && !rescan) {\n // no changes - just return object\n result = _networkInterfaces;\n\n if (callback) { callback(result); }\n resolve(result);\n } else {\n const defaultInterface = getDefaultNetworkInterface();\n _ifaces = JSON.parse(JSON.stringify(ifaces));\n\n nics = getDarwinNics();\n\n\n nics.forEach(nic => {\n\n if ({}.hasOwnProperty.call(ifaces, nic.iface)) {\n ifaces[nic.iface].forEach(function (details) {\n if (details.family === 'IPv4' || details.family === 4) {\n nic.ip4subnet = details.netmask;\n }\n if (details.family === 'IPv6' || details.family === 6) {\n nic.ip6subnet = details.netmask;\n }\n });\n }\n\n result.push({\n iface: nic.iface,\n ifaceName: nic.iface,\n default: nic.iface === defaultInterface,\n ip4: nic.ip4,\n ip4subnet: nic.ip4subnet || '',\n ip6: nic.ip6,\n ip6subnet: nic.ip6subnet || '',\n mac: nic.mac,\n internal: nic.internal,\n virtual: nic.internal ? false : testVirtualNic(nic.iface, nic.iface, nic.mac),\n operstate: nic.operstate,\n type: nic.type,\n duplex: nic.duplex,\n mtu: nic.mtu,\n speed: nic.speed,\n dhcp: getDarwinIfaceDHCPstatus(nic.iface),\n dnsSuffix: '',\n ieee8021xAuth: '',\n ieee8021xState: '',\n carrierChanges: 0\n });\n });\n _networkInterfaces = result;\n if (defaultString.toLowerCase().indexOf('default') >= 0) {\n result = result.filter(item => item.default);\n if (result.length > 0) {\n result = result[0];\n } else {\n result = [];\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_linux) {\n if ((JSON.stringify(ifaces) === JSON.stringify(_ifaces)) && !rescan) {\n // no changes - just return object\n result = _networkInterfaces;\n\n if (callback) { callback(result); }\n resolve(result);\n } else {\n _ifaces = JSON.parse(JSON.stringify(ifaces));\n _dhcpNics = getLinuxDHCPNics();\n const defaultInterface = getDefaultNetworkInterface();\n for (let dev in ifaces) {\n let ip4 = '';\n let ip4subnet = '';\n let ip6 = '';\n let ip6subnet = '';\n let mac = '';\n let duplex = '';\n let mtu = '';\n let speed = null;\n let carrierChanges = 0;\n let dhcp = false;\n let dnsSuffix = '';\n let ieee8021xAuth = '';\n let ieee8021xState = '';\n let type = '';\n\n if ({}.hasOwnProperty.call(ifaces, dev)) {\n let ifaceName = dev;\n ifaces[dev].forEach(function (details) {\n if (details.family === 'IPv4' || details.family === 4) {\n ip4 = details.address;\n ip4subnet = details.netmask;\n }\n if (details.family === 'IPv6' || details.family === 6) {\n if (!ip6 || ip6.match(/^fe80::/i)) {\n ip6 = details.address;\n ip6subnet = details.netmask;\n }\n }\n mac = details.mac;\n // fallback due to https://github.com/nodejs/node/issues/13581 (node 8.1 - node 8.2)\n const nodeMainVersion = parseInt(process.versions.node.split('.'), 10);\n if (mac.indexOf('00:00:0') > -1 && (_linux || _darwin) && (!details.internal) && nodeMainVersion >= 8 && nodeMainVersion <= 11) {\n if (Object.keys(_mac).length === 0) {\n _mac = getMacAddresses();\n }\n mac = _mac[dev] || '';\n }\n });\n let iface = dev.split(':')[0].trim().toLowerCase();\n const cmd = `echo -n \"addr_assign_type: \"; cat /sys/class/net/${iface}/addr_assign_type 2>/dev/null; echo;\n echo -n \"address: \"; cat /sys/class/net/${iface}/address 2>/dev/null; echo;\n echo -n \"addr_len: \"; cat /sys/class/net/${iface}/addr_len 2>/dev/null; echo;\n echo -n \"broadcast: \"; cat /sys/class/net/${iface}/broadcast 2>/dev/null; echo;\n echo -n \"carrier: \"; cat /sys/class/net/${iface}/carrier 2>/dev/null; echo;\n echo -n \"carrier_changes: \"; cat /sys/class/net/${iface}/carrier_changes 2>/dev/null; echo;\n echo -n \"dev_id: \"; cat /sys/class/net/${iface}/dev_id 2>/dev/null; echo;\n echo -n \"dev_port: \"; cat /sys/class/net/${iface}/dev_port 2>/dev/null; echo;\n echo -n \"dormant: \"; cat /sys/class/net/${iface}/dormant 2>/dev/null; echo;\n echo -n \"duplex: \"; cat /sys/class/net/${iface}/duplex 2>/dev/null; echo;\n echo -n \"flags: \"; cat /sys/class/net/${iface}/flags 2>/dev/null; echo;\n echo -n \"gro_flush_timeout: \"; cat /sys/class/net/${iface}/gro_flush_timeout 2>/dev/null; echo;\n echo -n \"ifalias: \"; cat /sys/class/net/${iface}/ifalias 2>/dev/null; echo;\n echo -n \"ifindex: \"; cat /sys/class/net/${iface}/ifindex 2>/dev/null; echo;\n echo -n \"iflink: \"; cat /sys/class/net/${iface}/iflink 2>/dev/null; echo;\n echo -n \"link_mode: \"; cat /sys/class/net/${iface}/link_mode 2>/dev/null; echo;\n echo -n \"mtu: \"; cat /sys/class/net/${iface}/mtu 2>/dev/null; echo;\n echo -n \"netdev_group: \"; cat /sys/class/net/${iface}/netdev_group 2>/dev/null; echo;\n echo -n \"operstate: \"; cat /sys/class/net/${iface}/operstate 2>/dev/null; echo;\n echo -n \"proto_down: \"; cat /sys/class/net/${iface}/proto_down 2>/dev/null; echo;\n echo -n \"speed: \"; cat /sys/class/net/${iface}/speed 2>/dev/null; echo;\n echo -n \"tx_queue_len: \"; cat /sys/class/net/${iface}/tx_queue_len 2>/dev/null; echo;\n echo -n \"type: \"; cat /sys/class/net/${iface}/type 2>/dev/null; echo;\n echo -n \"wireless: \"; cat /proc/net/wireless 2>/dev/null | grep ${iface}; echo;\n echo -n \"wirelessspeed: \"; iw dev ${iface} link 2>&1 | grep bitrate; echo;`;\n\n let lines = [];\n try {\n lines = execSync(cmd).toString().split('\\n');\n const connectionName = getLinuxIfaceConnectionName(iface);\n dhcp = getLinuxIfaceDHCPstatus(iface, connectionName, _dhcpNics);\n dnsSuffix = getLinuxIfaceDNSsuffix(connectionName);\n ieee8021xAuth = getLinuxIfaceIEEE8021xAuth(connectionName);\n ieee8021xState = getLinuxIfaceIEEE8021xState(ieee8021xAuth);\n } catch (e) {\n util.noop();\n }\n duplex = util.getValue(lines, 'duplex');\n duplex = duplex.startsWith('cat') ? '' : duplex;\n mtu = parseInt(util.getValue(lines, 'mtu'), 10);\n let myspeed = parseInt(util.getValue(lines, 'speed'), 10);\n speed = isNaN(myspeed) ? null : myspeed;\n let wirelessspeed = util.getValue(lines, 'wirelessspeed').split('tx bitrate: ');\n if (speed === null && wirelessspeed.length === 2) {\n myspeed = parseFloat(wirelessspeed[1]);\n speed = isNaN(myspeed) ? null : myspeed;\n }\n carrierChanges = parseInt(util.getValue(lines, 'carrier_changes'), 10);\n const operstate = util.getValue(lines, 'operstate');\n type = operstate === 'up' ? (util.getValue(lines, 'wireless').trim() ? 'wireless' : 'wired') : 'unknown';\n if (iface === 'lo' || iface.startsWith('bond')) { type = 'virtual'; }\n\n let internal = (ifaces[dev] && ifaces[dev][0]) ? ifaces[dev][0].internal : false;\n if (dev.toLowerCase().indexOf('loopback') > -1 || ifaceName.toLowerCase().indexOf('loopback') > -1) {\n internal = true;\n }\n const virtual = internal ? false : testVirtualNic(dev, ifaceName, mac);\n result.push({\n iface,\n ifaceName,\n default: iface === defaultInterface,\n ip4,\n ip4subnet,\n ip6,\n ip6subnet,\n mac,\n internal,\n virtual,\n operstate,\n type,\n duplex,\n mtu,\n speed,\n dhcp,\n dnsSuffix,\n ieee8021xAuth,\n ieee8021xState,\n carrierChanges,\n });\n }\n }\n _networkInterfaces = result;\n if (defaultString.toLowerCase().indexOf('default') >= 0) {\n result = result.filter(item => item.default);\n if (result.length > 0) {\n result = result[0];\n } else {\n result = [];\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_windows) {\n if ((JSON.stringify(ifaces) === JSON.stringify(_ifaces)) && !rescan) {\n // no changes - just return object\n result = _networkInterfaces;\n\n if (callback) { callback(result); }\n resolve(result);\n } else {\n _ifaces = JSON.parse(JSON.stringify(ifaces));\n const defaultInterface = getDefaultNetworkInterface();\n\n getWindowsNics().then(function (nics) {\n nics.forEach(nic => {\n let found = false;\n Object.keys(ifaces).forEach(key => {\n if (!found) {\n ifaces[key].forEach(value => {\n if (Object.keys(value).indexOf('mac') >= 0) {\n found = value['mac'] === nic.mac;\n }\n });\n }\n });\n\n if (!found) {\n ifaces[nic.name] = [{ mac: nic.mac }];\n }\n });\n nics8021xInfo = getWindowsWiredProfilesInformation();\n dnsSuffixes = getWindowsDNSsuffixes();\n for (let dev in ifaces) {\n let iface = dev;\n let ip4 = '';\n let ip4subnet = '';\n let ip6 = '';\n let ip6subnet = '';\n let mac = '';\n let duplex = '';\n let mtu = '';\n let speed = null;\n let carrierChanges = 0;\n let operstate = 'down';\n let dhcp = false;\n let dnsSuffix = '';\n let ieee8021xAuth = '';\n let ieee8021xState = '';\n let type = '';\n\n if ({}.hasOwnProperty.call(ifaces, dev)) {\n let ifaceName = dev;\n ifaces[dev].forEach(function (details) {\n if (details.family === 'IPv4' || details.family === 4) {\n ip4 = details.address;\n ip4subnet = details.netmask;\n }\n if (details.family === 'IPv6' || details.family === 6) {\n if (!ip6 || ip6.match(/^fe80::/i)) {\n ip6 = details.address;\n ip6subnet = details.netmask;\n }\n }\n mac = details.mac;\n // fallback due to https://github.com/nodejs/node/issues/13581 (node 8.1 - node 8.2)\n const nodeMainVersion = parseInt(process.versions.node.split('.'), 10);\n if (mac.indexOf('00:00:0') > -1 && (_linux || _darwin) && (!details.internal) && nodeMainVersion >= 8 && nodeMainVersion <= 11) {\n if (Object.keys(_mac).length === 0) {\n _mac = getMacAddresses();\n }\n mac = _mac[dev] || '';\n }\n });\n\n\n\n dnsSuffix = getWindowsIfaceDNSsuffix(dnsSuffixes.ifaces, dev);\n let foundFirst = false;\n nics.forEach(detail => {\n if (detail.mac === mac && !foundFirst) {\n iface = detail.iface || iface;\n ifaceName = detail.name;\n dhcp = detail.dhcp;\n operstate = detail.operstate;\n speed = detail.speed;\n type = detail.type;\n foundFirst = true;\n }\n });\n\n if (dev.toLowerCase().indexOf('wlan') >= 0 || ifaceName.toLowerCase().indexOf('wlan') >= 0 || ifaceName.toLowerCase().indexOf('802.11n') >= 0 || ifaceName.toLowerCase().indexOf('wireless') >= 0 || ifaceName.toLowerCase().indexOf('wi-fi') >= 0 || ifaceName.toLowerCase().indexOf('wifi') >= 0) {\n type = 'wireless';\n }\n\n const IEEE8021x = getWindowsIEEE8021x(type, dev, nics8021xInfo);\n ieee8021xAuth = IEEE8021x.protocol;\n ieee8021xState = IEEE8021x.state;\n let internal = (ifaces[dev] && ifaces[dev][0]) ? ifaces[dev][0].internal : false;\n if (dev.toLowerCase().indexOf('loopback') > -1 || ifaceName.toLowerCase().indexOf('loopback') > -1) {\n internal = true;\n }\n const virtual = internal ? false : testVirtualNic(dev, ifaceName, mac);\n result.push({\n iface,\n ifaceName,\n default: iface === defaultInterface,\n ip4,\n ip4subnet,\n ip6,\n ip6subnet,\n mac,\n internal,\n virtual,\n operstate,\n type,\n duplex,\n mtu,\n speed,\n dhcp,\n dnsSuffix,\n ieee8021xAuth,\n ieee8021xState,\n carrierChanges,\n });\n }\n }\n _networkInterfaces = result;\n if (defaultString.toLowerCase().indexOf('default') >= 0) {\n result = result.filter(item => item.default);\n if (result.length > 0) {\n result = result[0];\n } else {\n result = [];\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n }\n });\n });\n}\n\nexports.networkInterfaces = networkInterfaces;\n\n// --------------------------\n// NET - Speed\n\nfunction calcNetworkSpeed(iface, rx_bytes, tx_bytes, operstate, rx_dropped, rx_errors, tx_dropped, tx_errors) {\n let result = {\n iface,\n operstate,\n rx_bytes,\n rx_dropped,\n rx_errors,\n tx_bytes,\n tx_dropped,\n tx_errors,\n rx_sec: null,\n tx_sec: null,\n ms: 0\n };\n\n if (_network[iface] && _network[iface].ms) {\n result.ms = Date.now() - _network[iface].ms;\n result.rx_sec = (rx_bytes - _network[iface].rx_bytes) >= 0 ? (rx_bytes - _network[iface].rx_bytes) / (result.ms / 1000) : 0;\n result.tx_sec = (tx_bytes - _network[iface].tx_bytes) >= 0 ? (tx_bytes - _network[iface].tx_bytes) / (result.ms / 1000) : 0;\n _network[iface].rx_bytes = rx_bytes;\n _network[iface].tx_bytes = tx_bytes;\n _network[iface].rx_sec = result.rx_sec;\n _network[iface].tx_sec = result.tx_sec;\n _network[iface].ms = Date.now();\n _network[iface].last_ms = result.ms;\n _network[iface].operstate = operstate;\n } else {\n if (!_network[iface]) { _network[iface] = {}; }\n _network[iface].rx_bytes = rx_bytes;\n _network[iface].tx_bytes = tx_bytes;\n _network[iface].rx_sec = null;\n _network[iface].tx_sec = null;\n _network[iface].ms = Date.now();\n _network[iface].last_ms = 0;\n _network[iface].operstate = operstate;\n }\n return result;\n}\n\nfunction networkStats(ifaces, callback) {\n\n let ifacesArray = [];\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n // fallback - if only callback is given\n if (util.isFunction(ifaces) && !callback) {\n callback = ifaces;\n ifacesArray = [getDefaultNetworkInterface()];\n } else {\n if (typeof ifaces !== 'string' && ifaces !== undefined) {\n if (callback) { callback([]); }\n return resolve([]);\n }\n ifaces = ifaces || getDefaultNetworkInterface();\n\n ifaces.__proto__.toLowerCase = util.stringToLower;\n ifaces.__proto__.replace = util.stringReplace;\n ifaces.__proto__.trim = util.stringTrim;\n\n ifaces = ifaces.trim().toLowerCase().replace(/,+/g, '|');\n ifacesArray = ifaces.split('|');\n }\n\n const result = [];\n\n const workload = [];\n if (ifacesArray.length && ifacesArray[0].trim() === '*') {\n ifacesArray = [];\n networkInterfaces(false).then(allIFaces => {\n for (let iface of allIFaces) {\n ifacesArray.push(iface.iface);\n }\n networkStats(ifacesArray.join(',')).then(result => {\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n } else {\n for (let iface of ifacesArray) {\n workload.push(networkStatsSingle(iface.trim()));\n }\n if (workload.length) {\n Promise.all(\n workload\n ).then(data => {\n if (callback) { callback(data); }\n resolve(data);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nfunction networkStatsSingle(iface) {\n\n function parseLinesWindowsPerfData(sections) {\n let perfData = [];\n for (let i in sections) {\n if ({}.hasOwnProperty.call(sections, i)) {\n if (sections[i].trim() !== '') {\n let lines = sections[i].trim().split('\\r\\n');\n perfData.push({\n name: util.getValue(lines, 'Name', ':').replace(/[()[\\] ]+/g, '').replace('#', '_').toLowerCase(),\n rx_bytes: parseInt(util.getValue(lines, 'BytesReceivedPersec', ':'), 10),\n rx_errors: parseInt(util.getValue(lines, 'PacketsReceivedErrors', ':'), 10),\n rx_dropped: parseInt(util.getValue(lines, 'PacketsReceivedDiscarded', ':'), 10),\n tx_bytes: parseInt(util.getValue(lines, 'BytesSentPersec', ':'), 10),\n tx_errors: parseInt(util.getValue(lines, 'PacketsOutboundErrors', ':'), 10),\n tx_dropped: parseInt(util.getValue(lines, 'PacketsOutboundDiscarded', ':'), 10)\n });\n }\n }\n }\n return perfData;\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let ifaceSanitized = '';\n const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);\n for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {\n if (!(s[i] === undefined)) {\n ifaceSanitized = ifaceSanitized + s[i];\n }\n }\n\n let result = {\n iface: ifaceSanitized,\n operstate: 'unknown',\n rx_bytes: 0,\n rx_dropped: 0,\n rx_errors: 0,\n tx_bytes: 0,\n tx_dropped: 0,\n tx_errors: 0,\n rx_sec: null,\n tx_sec: null,\n ms: 0\n };\n\n let operstate = 'unknown';\n let rx_bytes = 0;\n let tx_bytes = 0;\n let rx_dropped = 0;\n let rx_errors = 0;\n let tx_dropped = 0;\n let tx_errors = 0;\n\n let cmd, lines, stats;\n if (!_network[ifaceSanitized] || (_network[ifaceSanitized] && !_network[ifaceSanitized].ms) || (_network[ifaceSanitized] && _network[ifaceSanitized].ms && Date.now() - _network[ifaceSanitized].ms >= 500)) {\n if (_linux) {\n if (fs.existsSync('/sys/class/net/' + ifaceSanitized)) {\n cmd =\n 'cat /sys/class/net/' + ifaceSanitized + '/operstate; ' +\n 'cat /sys/class/net/' + ifaceSanitized + '/statistics/rx_bytes; ' +\n 'cat /sys/class/net/' + ifaceSanitized + '/statistics/tx_bytes; ' +\n 'cat /sys/class/net/' + ifaceSanitized + '/statistics/rx_dropped; ' +\n 'cat /sys/class/net/' + ifaceSanitized + '/statistics/rx_errors; ' +\n 'cat /sys/class/net/' + ifaceSanitized + '/statistics/tx_dropped; ' +\n 'cat /sys/class/net/' + ifaceSanitized + '/statistics/tx_errors; ';\n exec(cmd, function (error, stdout) {\n if (!error) {\n lines = stdout.toString().split('\\n');\n operstate = lines[0].trim();\n rx_bytes = parseInt(lines[1], 10);\n tx_bytes = parseInt(lines[2], 10);\n rx_dropped = parseInt(lines[3], 10);\n rx_errors = parseInt(lines[4], 10);\n tx_dropped = parseInt(lines[5], 10);\n tx_errors = parseInt(lines[6], 10);\n\n result = calcNetworkSpeed(ifaceSanitized, rx_bytes, tx_bytes, operstate, rx_dropped, rx_errors, tx_dropped, tx_errors);\n\n }\n resolve(result);\n });\n } else {\n resolve(result);\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n cmd = 'netstat -ibndI ' + ifaceSanitized; // lgtm [js/shell-command-constructed-from-input]\n exec(cmd, function (error, stdout) {\n if (!error) {\n lines = stdout.toString().split('\\n');\n for (let i = 1; i < lines.length; i++) {\n const line = lines[i].replace(/ +/g, ' ').split(' ');\n if (line && line[0] && line[7] && line[10]) {\n rx_bytes = rx_bytes + parseInt(line[7]);\n if (line[6].trim() !== '-') { rx_dropped = rx_dropped + parseInt(line[6]); }\n if (line[5].trim() !== '-') { rx_errors = rx_errors + parseInt(line[5]); }\n tx_bytes = tx_bytes + parseInt(line[10]);\n if (line[12].trim() !== '-') { tx_dropped = tx_dropped + parseInt(line[12]); }\n if (line[9].trim() !== '-') { tx_errors = tx_errors + parseInt(line[9]); }\n operstate = 'up';\n }\n }\n result = calcNetworkSpeed(ifaceSanitized, rx_bytes, tx_bytes, operstate, rx_dropped, rx_errors, tx_dropped, tx_errors);\n }\n resolve(result);\n });\n }\n if (_darwin) {\n cmd = 'ifconfig ' + ifaceSanitized + ' | grep \"status\"'; // lgtm [js/shell-command-constructed-from-input]\n exec(cmd, function (error, stdout) {\n result.operstate = (stdout.toString().split(':')[1] || '').trim();\n result.operstate = (result.operstate || '').toLowerCase();\n result.operstate = (result.operstate === 'active' ? 'up' : (result.operstate === 'inactive' ? 'down' : 'unknown'));\n cmd = 'netstat -bdI ' + ifaceSanitized; // lgtm [js/shell-command-constructed-from-input]\n exec(cmd, function (error, stdout) {\n if (!error) {\n lines = stdout.toString().split('\\n');\n // if there is less than 2 lines, no information for this interface was found\n if (lines.length > 1 && lines[1].trim() !== '') {\n // skip header line\n // use the second line because it is tied to the NIC instead of the ipv4 or ipv6 address\n stats = lines[1].replace(/ +/g, ' ').split(' ');\n const offset = stats.length > 11 ? 1 : 0;\n rx_bytes = parseInt(stats[offset + 5]);\n rx_dropped = parseInt(stats[offset + 10]);\n rx_errors = parseInt(stats[offset + 4]);\n tx_bytes = parseInt(stats[offset + 8]);\n tx_dropped = parseInt(stats[offset + 10]);\n tx_errors = parseInt(stats[offset + 7]);\n result = calcNetworkSpeed(ifaceSanitized, rx_bytes, tx_bytes, result.operstate, rx_dropped, rx_errors, tx_dropped, tx_errors);\n }\n }\n resolve(result);\n });\n });\n }\n if (_windows) {\n let perfData = [];\n let ifaceName = ifaceSanitized;\n\n // Performance Data\n util.powerShell('Get-WmiObject Win32_PerfRawData_Tcpip_NetworkInterface | select Name,BytesReceivedPersec,PacketsReceivedErrors,PacketsReceivedDiscarded,BytesSentPersec,PacketsOutboundErrors,PacketsOutboundDiscarded | fl').then((stdout, error) => {\n if (!error) {\n const psections = stdout.toString().split(/\\n\\s*\\n/);\n perfData = parseLinesWindowsPerfData(psections);\n }\n\n // Network Interfaces\n networkInterfaces(false).then(interfaces => {\n // get bytes sent, received from perfData by name\n rx_bytes = 0;\n tx_bytes = 0;\n perfData.forEach(detail => {\n interfaces.forEach(det => {\n if ((det.iface.toLowerCase() === ifaceSanitized.toLowerCase() ||\n det.mac.toLowerCase() === ifaceSanitized.toLowerCase() ||\n det.ip4.toLowerCase() === ifaceSanitized.toLowerCase() ||\n det.ip6.toLowerCase() === ifaceSanitized.toLowerCase() ||\n det.ifaceName.replace(/[()[\\] ]+/g, '').replace('#', '_').toLowerCase() === ifaceSanitized.replace(/[()[\\] ]+/g, '').replace('#', '_').toLowerCase()) &&\n (det.ifaceName.replace(/[()[\\] ]+/g, '').replace('#', '_').toLowerCase() === detail.name)) {\n ifaceName = det.iface;\n rx_bytes = detail.rx_bytes;\n rx_dropped = detail.rx_dropped;\n rx_errors = detail.rx_errors;\n tx_bytes = detail.tx_bytes;\n tx_dropped = detail.tx_dropped;\n tx_errors = detail.tx_errors;\n operstate = det.operstate;\n }\n });\n });\n if (rx_bytes && tx_bytes) {\n result = calcNetworkSpeed(ifaceName, parseInt(rx_bytes), parseInt(tx_bytes), operstate, rx_dropped, rx_errors, tx_dropped, tx_errors);\n }\n resolve(result);\n });\n });\n }\n } else {\n result.rx_bytes = _network[ifaceSanitized].rx_bytes;\n result.tx_bytes = _network[ifaceSanitized].tx_bytes;\n result.rx_sec = _network[ifaceSanitized].rx_sec;\n result.tx_sec = _network[ifaceSanitized].tx_sec;\n result.ms = _network[ifaceSanitized].last_ms;\n result.operstate = _network[ifaceSanitized].operstate;\n resolve(result);\n }\n });\n });\n}\n\nexports.networkStats = networkStats;\n\n// --------------------------\n// NET - connections (sockets)\n\nfunction networkConnections(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = [];\n if (_linux || _freebsd || _openbsd || _netbsd) {\n let cmd = 'export LC_ALL=C; netstat -tunap | grep \"ESTABLISHED\\\\|SYN_SENT\\\\|SYN_RECV\\\\|FIN_WAIT1\\\\|FIN_WAIT2\\\\|TIME_WAIT\\\\|CLOSE\\\\|CLOSE_WAIT\\\\|LAST_ACK\\\\|LISTEN\\\\|CLOSING\\\\|UNKNOWN\"; unset LC_ALL';\n if (_freebsd || _openbsd || _netbsd) { cmd = 'export LC_ALL=C; netstat -na | grep \"ESTABLISHED\\\\|SYN_SENT\\\\|SYN_RECV\\\\|FIN_WAIT1\\\\|FIN_WAIT2\\\\|TIME_WAIT\\\\|CLOSE\\\\|CLOSE_WAIT\\\\|LAST_ACK\\\\|LISTEN\\\\|CLOSING\\\\|UNKNOWN\"; unset LC_ALL'; }\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n if (!error && (lines.length > 1 || lines[0] != '')) {\n lines.forEach(function (line) {\n line = line.replace(/ +/g, ' ').split(' ');\n if (line.length >= 7) {\n let localip = line[3];\n let localport = '';\n let localaddress = line[3].split(':');\n if (localaddress.length > 1) {\n localport = localaddress[localaddress.length - 1];\n localaddress.pop();\n localip = localaddress.join(':');\n }\n let peerip = line[4];\n let peerport = '';\n let peeraddress = line[4].split(':');\n if (peeraddress.length > 1) {\n peerport = peeraddress[peeraddress.length - 1];\n peeraddress.pop();\n peerip = peeraddress.join(':');\n }\n let connstate = line[5];\n // if (connstate === 'VERBUNDEN') connstate = 'ESTABLISHED';\n let proc = line[6].split('/');\n\n if (connstate) {\n result.push({\n protocol: line[0],\n localAddress: localip,\n localPort: localport,\n peerAddress: peerip,\n peerPort: peerport,\n state: connstate,\n pid: proc[0] && proc[0] !== '-' ? parseInt(proc[0], 10) : null,\n process: proc[1] ? proc[1].split(' ')[0] : ''\n });\n }\n }\n });\n if (callback) {\n callback(result);\n }\n resolve(result);\n } else {\n cmd = 'ss -tunap | grep \"ESTAB\\\\|SYN-SENT\\\\|SYN-RECV\\\\|FIN-WAIT1\\\\|FIN-WAIT2\\\\|TIME-WAIT\\\\|CLOSE\\\\|CLOSE-WAIT\\\\|LAST-ACK\\\\|LISTEN\\\\|CLOSING\"';\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n line = line.replace(/ +/g, ' ').split(' ');\n if (line.length >= 6) {\n let localip = line[4];\n let localport = '';\n let localaddress = line[4].split(':');\n if (localaddress.length > 1) {\n localport = localaddress[localaddress.length - 1];\n localaddress.pop();\n localip = localaddress.join(':');\n }\n let peerip = line[5];\n let peerport = '';\n let peeraddress = line[5].split(':');\n if (peeraddress.length > 1) {\n peerport = peeraddress[peeraddress.length - 1];\n peeraddress.pop();\n peerip = peeraddress.join(':');\n }\n let connstate = line[1];\n if (connstate === 'ESTAB') { connstate = 'ESTABLISHED'; }\n if (connstate === 'TIME-WAIT') { connstate = 'TIME_WAIT'; }\n let pid = null;\n let process = '';\n if (line.length >= 7 && line[6].indexOf('users:') > -1) {\n let proc = line[6].replace('users:((\"', '').replace(/\"/g, '').split(',');\n if (proc.length > 2) {\n process = proc[0].split(' ')[0];\n pid = parseInt(proc[1], 10);\n }\n }\n if (connstate) {\n result.push({\n protocol: line[0],\n localAddress: localip,\n localPort: localport,\n peerAddress: peerip,\n peerPort: peerport,\n state: connstate,\n pid,\n process\n });\n }\n }\n });\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n });\n }\n if (_darwin) {\n let cmd = 'netstat -natv | grep \"ESTABLISHED\\\\|SYN_SENT\\\\|SYN_RECV\\\\|FIN_WAIT1\\\\|FIN_WAIT2\\\\|TIME_WAIT\\\\|CLOSE\\\\|CLOSE_WAIT\\\\|LAST_ACK\\\\|LISTEN\\\\|CLOSING\\\\|UNKNOWN\"';\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n if (!error) {\n\n let lines = stdout.toString().split('\\n');\n\n lines.forEach(function (line) {\n line = line.replace(/ +/g, ' ').split(' ');\n if (line.length >= 8) {\n let localip = line[3];\n let localport = '';\n let localaddress = line[3].split('.');\n if (localaddress.length > 1) {\n localport = localaddress[localaddress.length - 1];\n localaddress.pop();\n localip = localaddress.join('.');\n }\n let peerip = line[4];\n let peerport = '';\n let peeraddress = line[4].split('.');\n if (peeraddress.length > 1) {\n peerport = peeraddress[peeraddress.length - 1];\n peeraddress.pop();\n peerip = peeraddress.join('.');\n }\n let connstate = line[5];\n let pid = parseInt(line[8], 10);\n if (connstate) {\n result.push({\n protocol: line[0],\n localAddress: localip,\n localPort: localport,\n peerAddress: peerip,\n peerPort: peerport,\n state: connstate,\n pid: pid,\n process: ''\n });\n }\n }\n });\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n }\n if (_windows) {\n let cmd = 'netstat -nao';\n try {\n exec(cmd, util.execOptsWin, function (error, stdout) {\n if (!error) {\n\n let lines = stdout.toString().split('\\r\\n');\n\n lines.forEach(function (line) {\n line = line.trim().replace(/ +/g, ' ').split(' ');\n if (line.length >= 4) {\n let localip = line[1];\n let localport = '';\n let localaddress = line[1].split(':');\n if (localaddress.length > 1) {\n localport = localaddress[localaddress.length - 1];\n localaddress.pop();\n localip = localaddress.join(':');\n }\n let peerip = line[2];\n let peerport = '';\n let peeraddress = line[2].split(':');\n if (peeraddress.length > 1) {\n peerport = peeraddress[peeraddress.length - 1];\n peeraddress.pop();\n peerip = peeraddress.join(':');\n }\n let pid = util.toInt(line[4]);\n let connstate = line[3];\n if (connstate === 'HERGESTELLT') { connstate = 'ESTABLISHED'; }\n if (connstate.startsWith('ABH')) { connstate = 'LISTEN'; }\n if (connstate === 'SCHLIESSEN_WARTEN') { connstate = 'CLOSE_WAIT'; }\n if (connstate === 'WARTEND') { connstate = 'TIME_WAIT'; }\n if (connstate === 'SYN_GESENDET') { connstate = 'SYN_SENT'; }\n\n if (connstate === 'LISTENING') { connstate = 'LISTEN'; }\n if (connstate === 'SYN_RECEIVED') { connstate = 'SYN_RECV'; }\n if (connstate === 'FIN_WAIT_1') { connstate = 'FIN_WAIT1'; }\n if (connstate === 'FIN_WAIT_2') { connstate = 'FIN_WAIT2'; }\n if (connstate) {\n result.push({\n protocol: line[0].toLowerCase(),\n localAddress: localip,\n localPort: localport,\n peerAddress: peerip,\n peerPort: peerport,\n state: connstate,\n pid,\n process: ''\n });\n }\n }\n });\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.networkConnections = networkConnections;\n\nfunction networkGatewayDefault(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = '';\n if (_linux || _freebsd || _openbsd || _netbsd) {\n let cmd = 'ip route get 1';\n try {\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n const line = lines && lines[0] ? lines[0] : '';\n let parts = line.split(' via ');\n if (parts && parts[1]) {\n parts = parts[1].split(' ');\n result = parts[0];\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_darwin) {\n let cmd = 'route -n get default';\n try {\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n if (!error) {\n const lines = stdout.toString().split('\\n').map(line => line.trim());\n result = util.getValue(lines, 'gateway');\n }\n if (!result) {\n cmd = 'netstat -rn | awk \\'/default/ {print $2}\\'';\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n const lines = stdout.toString().split('\\n').map(line => line.trim());\n result = lines.find(line => (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(line)));\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_windows) {\n try {\n exec('netstat -r', util.execOptsWin, function (error, stdout) {\n const lines = stdout.toString().split(os.EOL);\n lines.forEach(line => {\n line = line.replace(/\\s+/g, ' ').trim();\n if (line.indexOf('0.0.0.0 0.0.0.0') > -1 && !(/[a-zA-Z]/.test(line))) {\n const parts = line.split(' ');\n if (parts.length >= 5 && (parts[parts.length - 3]).indexOf('.') > -1) {\n result = parts[parts.length - 3];\n }\n }\n });\n if (!result) {\n util.powerShell('Get-CimInstance -ClassName Win32_IP4RouteTable | Where-Object { $_.Destination -eq \\'0.0.0.0\\' -and $_.Mask -eq \\'0.0.0.0\\' }')\n .then(data => {\n let lines = data.toString().split('\\r\\n');\n if (lines.length > 1 && !result) {\n result = util.getValue(lines, 'NextHop');\n if (callback) {\n callback(result);\n }\n resolve(result);\n // } else {\n // exec('ipconfig', util.execOptsWin, function (error, stdout) {\n // let lines = stdout.toString().split('\\r\\n');\n // lines.forEach(function (line) {\n // line = line.trim().replace(/\\. /g, '');\n // line = line.trim().replace(/ +/g, '');\n // const parts = line.split(':');\n // if ((parts[0].toLowerCase().startsWith('standardgate') || parts[0].toLowerCase().indexOf('gateway') > -1 || parts[0].toLowerCase().indexOf('enlace') > -1) && parts[1]) {\n // result = parts[1];\n // }\n // });\n // if (callback) { callback(result); }\n // resolve(result);\n // });\n }\n });\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.networkGatewayDefault = networkGatewayDefault;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// osinfo.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 3. Operating System\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst fs = require('fs');\nconst util = require('./util');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\n// const execPromise = util.promisify(require('child_process').exec);\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\n// --------------------------\n// Get current time and OS uptime\n\nfunction time() {\n let t = new Date().toString().split(' ');\n return {\n current: Date.now(),\n uptime: os.uptime(),\n timezone: (t.length >= 7) ? t[5] : '',\n timezoneName: Intl ? Intl.DateTimeFormat().resolvedOptions().timeZone : (t.length >= 7) ? t.slice(6).join(' ').replace(/\\(/g, '').replace(/\\)/g, '') : ''\n };\n}\n\nexports.time = time;\n\n// --------------------------\n// Get logo filename of OS distribution\n\nfunction getLogoFile(distro) {\n distro = distro || '';\n distro = distro.toLowerCase();\n let result = _platform;\n if (_windows) {\n result = 'windows';\n }\n else if (distro.indexOf('mac os') !== -1) {\n result = 'apple';\n }\n else if (distro.indexOf('arch') !== -1) {\n result = 'arch';\n }\n else if (distro.indexOf('centos') !== -1) {\n result = 'centos';\n }\n else if (distro.indexOf('coreos') !== -1) {\n result = 'coreos';\n }\n else if (distro.indexOf('debian') !== -1) {\n result = 'debian';\n }\n else if (distro.indexOf('deepin') !== -1) {\n result = 'deepin';\n }\n else if (distro.indexOf('elementary') !== -1) {\n result = 'elementary';\n }\n else if (distro.indexOf('fedora') !== -1) {\n result = 'fedora';\n }\n else if (distro.indexOf('gentoo') !== -1) {\n result = 'gentoo';\n }\n else if (distro.indexOf('mageia') !== -1) {\n result = 'mageia';\n }\n else if (distro.indexOf('mandriva') !== -1) {\n result = 'mandriva';\n }\n else if (distro.indexOf('manjaro') !== -1) {\n result = 'manjaro';\n }\n else if (distro.indexOf('mint') !== -1) {\n result = 'mint';\n }\n else if (distro.indexOf('mx') !== -1) {\n result = 'mx';\n }\n else if (distro.indexOf('openbsd') !== -1) {\n result = 'openbsd';\n }\n else if (distro.indexOf('freebsd') !== -1) {\n result = 'freebsd';\n }\n else if (distro.indexOf('opensuse') !== -1) {\n result = 'opensuse';\n }\n else if (distro.indexOf('pclinuxos') !== -1) {\n result = 'pclinuxos';\n }\n else if (distro.indexOf('puppy') !== -1) {\n result = 'puppy';\n }\n else if (distro.indexOf('raspbian') !== -1) {\n result = 'raspbian';\n }\n else if (distro.indexOf('reactos') !== -1) {\n result = 'reactos';\n }\n else if (distro.indexOf('redhat') !== -1) {\n result = 'redhat';\n }\n else if (distro.indexOf('slackware') !== -1) {\n result = 'slackware';\n }\n else if (distro.indexOf('sugar') !== -1) {\n result = 'sugar';\n }\n else if (distro.indexOf('steam') !== -1) {\n result = 'steam';\n }\n else if (distro.indexOf('suse') !== -1) {\n result = 'suse';\n }\n else if (distro.indexOf('mate') !== -1) {\n result = 'ubuntu-mate';\n }\n else if (distro.indexOf('lubuntu') !== -1) {\n result = 'lubuntu';\n }\n else if (distro.indexOf('xubuntu') !== -1) {\n result = 'xubuntu';\n }\n else if (distro.indexOf('ubuntu') !== -1) {\n result = 'ubuntu';\n }\n else if (distro.indexOf('solaris') !== -1) {\n result = 'solaris';\n }\n else if (distro.indexOf('tails') !== -1) {\n result = 'tails';\n }\n else if (distro.indexOf('feren') !== -1) {\n result = 'ferenos';\n }\n else if (distro.indexOf('robolinux') !== -1) {\n result = 'robolinux';\n } else if (_linux && distro) {\n result = distro.toLowerCase().trim().replace(/\\s+/g, '-');\n }\n return result;\n}\n\n// --------------------------\n// FQDN\n\nfunction getFQDN() {\n let fqdn = os.hostname;\n if (_linux || _darwin) {\n try {\n const stdout = execSync('hostname -f');\n fqdn = stdout.toString().split(os.EOL)[0];\n } catch (e) {\n util.noop();\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n try {\n const stdout = execSync('hostname');\n fqdn = stdout.toString().split(os.EOL)[0];\n } catch (e) {\n util.noop();\n }\n }\n if (_windows) {\n try {\n const stdout = execSync('echo %COMPUTERNAME%.%USERDNSDOMAIN%', util.execOptsWin);\n fqdn = stdout.toString().replace('.%USERDNSDOMAIN%', '').split(os.EOL)[0];\n } catch (e) {\n util.noop();\n }\n }\n return fqdn;\n}\n\n// --------------------------\n// OS Information\n\nfunction osInfo(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = {\n\n platform: (_platform === 'win32' ? 'Windows' : _platform),\n distro: 'unknown',\n release: 'unknown',\n codename: '',\n kernel: os.release(),\n arch: os.arch(),\n hostname: os.hostname(),\n fqdn: getFQDN(),\n codepage: '',\n logofile: '',\n serial: '',\n build: '',\n servicepack: '',\n uefi: false\n };\n\n if (_linux) {\n\n exec('cat /etc/*-release; cat /usr/lib/os-release; cat /etc/openwrt_release', function (error, stdout) {\n //if (!error) {\n /**\n * @namespace\n * @property {string} DISTRIB_ID\n * @property {string} NAME\n * @property {string} DISTRIB_RELEASE\n * @property {string} VERSION_ID\n * @property {string} DISTRIB_CODENAME\n */\n let release = {};\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n if (line.indexOf('=') !== -1) {\n release[line.split('=')[0].trim().toUpperCase()] = line.split('=')[1].trim();\n }\n });\n let releaseVersion = (release.VERSION || '').replace(/\"/g, '');\n let codename = (release.DISTRIB_CODENAME || release.VERSION_CODENAME || '').replace(/\"/g, '');\n if (releaseVersion.indexOf('(') >= 0) {\n codename = releaseVersion.split('(')[1].replace(/[()]/g, '').trim();\n releaseVersion = releaseVersion.split('(')[0].trim();\n }\n result.distro = (release.DISTRIB_ID || release.NAME || 'unknown').replace(/\"/g, '');\n result.logofile = getLogoFile(result.distro);\n result.release = (releaseVersion || release.DISTRIB_RELEASE || release.VERSION_ID || 'unknown').replace(/\"/g, '');\n result.codename = codename;\n result.codepage = util.getCodepage();\n result.build = (release.BUILD_ID || '').replace(/\"/g, '').trim();\n isUefiLinux().then(uefi => {\n result.uefi = uefi;\n uuid().then(data => {\n result.serial = data.os;\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n });\n //}\n });\n }\n if (_freebsd || _openbsd || _netbsd) {\n\n exec('sysctl kern.ostype kern.osrelease kern.osrevision kern.hostuuid machdep.bootmethod', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n result.distro = util.getValue(lines, 'kern.ostype');\n result.logofile = getLogoFile(result.distro);\n result.release = util.getValue(lines, 'kern.osrelease').split('-')[0];\n result.serial = util.getValue(lines, 'kern.uuid');\n result.codename = '';\n result.codepage = util.getCodepage();\n result.uefi = util.getValue(lines, 'machdep.bootmethod').toLowerCase().indexOf('uefi') >= 0;\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_darwin) {\n exec('sw_vers; sysctl kern.ostype kern.osrelease kern.osrevision kern.uuid', function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n result.serial = util.getValue(lines, 'kern.uuid');\n result.distro = util.getValue(lines, 'ProductName');\n result.release = util.getValue(lines, 'ProductVersion');\n result.build = util.getValue(lines, 'BuildVersion');\n result.logofile = getLogoFile(result.distro);\n result.codename = 'macOS';\n result.codename = (result.release.indexOf('10.4') > -1 ? 'Mac OS X Tiger' : result.codename);\n result.codename = (result.release.indexOf('10.4') > -1 ? 'Mac OS X Tiger' : result.codename);\n result.codename = (result.release.indexOf('10.4') > -1 ? 'Mac OS X Tiger' : result.codename);\n result.codename = (result.release.indexOf('10.5') > -1 ? 'Mac OS X Leopard' : result.codename);\n result.codename = (result.release.indexOf('10.6') > -1 ? 'Mac OS X Snow Leopard' : result.codename);\n result.codename = (result.release.indexOf('10.7') > -1 ? 'Mac OS X Lion' : result.codename);\n result.codename = (result.release.indexOf('10.8') > -1 ? 'OS X Mountain Lion' : result.codename);\n result.codename = (result.release.indexOf('10.9') > -1 ? 'OS X Mavericks' : result.codename);\n result.codename = (result.release.indexOf('10.10') > -1 ? 'OS X Yosemite' : result.codename);\n result.codename = (result.release.indexOf('10.11') > -1 ? 'OS X El Capitan' : result.codename);\n result.codename = (result.release.indexOf('10.12') > -1 ? 'macOS Sierra' : result.codename);\n result.codename = (result.release.indexOf('10.13') > -1 ? 'macOS High Sierra' : result.codename);\n result.codename = (result.release.indexOf('10.14') > -1 ? 'macOS Mojave' : result.codename);\n result.codename = (result.release.indexOf('10.15') > -1 ? 'macOS Catalina' : result.codename);\n result.codename = (result.release.startsWith('11.') ? 'macOS Big Sur' : result.codename);\n result.codename = (result.release.startsWith('12.') ? 'macOS Monterey' : result.codename);\n result.uefi = true;\n result.codepage = util.getCodepage();\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_sunos) {\n result.release = result.kernel;\n exec('uname -o', function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n result.distro = lines[0];\n result.logofile = getLogoFile(result.distro);\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_windows) {\n result.logofile = getLogoFile();\n result.release = result.kernel;\n try {\n const workload = [];\n workload.push(util.powerShell('Get-WmiObject Win32_OperatingSystem | select Caption,SerialNumber,BuildNumber,ServicePackMajorVersion,ServicePackMinorVersion | fl'));\n // workload.push(execPromise('systeminfo', util.execOptsWin));\n // workload.push(util.powerShell('Get-ComputerInfo -property \"HyperV*\"'));\n workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));\n workload.push(util.powerShell('Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession'));\n util.promiseAll(\n workload\n ).then(data => {\n let lines = data.results[0] ? data.results[0].toString().split('\\r\\n') : [''];\n result.distro = util.getValue(lines, 'Caption', ':').trim();\n result.serial = util.getValue(lines, 'SerialNumber', ':').trim();\n result.build = util.getValue(lines, 'BuildNumber', ':').trim();\n result.servicepack = util.getValue(lines, 'ServicePackMajorVersion', ':').trim() + '.' + util.getValue(lines, 'ServicePackMinorVersion', ':').trim();\n result.codepage = util.getCodepage();\n // const systeminfo = data.results[1] ? data.results[1].toString() : '';\n // result.hypervisor = (systeminfo.indexOf('hypervisor has been detected') !== -1) || (systeminfo.indexOf('ein Hypervisor erkannt') !== -1) || (systeminfo.indexOf('Un hyperviseur a ') !== -1);\n // const hyperv = data.results[1] ? data.results[1].toString().split('\\r\\n') : [];\n // result.hypervisor = (util.getValue(hyperv, 'HyperVisorPresent').toLowerCase() === 'true');\n const hyperv = data.results[1] ? data.results[1].toString().toLowerCase() : '';\n result.hypervisor = hyperv.indexOf('true') !== -1;\n const term = data.results[2] ? data.results[2].toString() : '';\n result.remoteSession = (term.toString().toLowerCase().indexOf('true') >= 0);\n isUefiWindows().then(uefi => {\n result.uefi = uefi;\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.osInfo = osInfo;\n\nfunction isUefiLinux() {\n return new Promise((resolve) => {\n process.nextTick(() => {\n fs.stat('/sys/firmware/efi', function (err) {\n if (!err) {\n return resolve(true);\n } else {\n exec('dmesg | grep -E \"EFI v\"', function (error, stdout) {\n if (!error) {\n const lines = stdout.toString().split('\\n');\n return resolve(lines.length > 0);\n }\n return resolve(false);\n });\n }\n });\n });\n });\n}\n\nfunction isUefiWindows() {\n return new Promise((resolve) => {\n process.nextTick(() => {\n try {\n exec('findstr /C:\"Detected boot environment\" \"%windir%\\\\Panther\\\\setupact.log\"', util.execOptsWin, function (error, stdout) {\n if (!error) {\n const line = stdout.toString().split('\\n\\r')[0];\n return resolve(line.toLowerCase().indexOf('efi') >= 0);\n } else {\n exec('echo %firmware_type%', util.execOptsWin, function (error, stdout) {\n if (!error) {\n const line = stdout.toString() || '';\n return resolve(line.toLowerCase().indexOf('efi') >= 0);\n } else {\n return resolve(false);\n }\n });\n }\n });\n } catch (e) {\n return resolve(false);\n }\n });\n });\n}\n\nfunction versions(apps, callback) {\n let versionObject = {\n kernel: os.release(),\n openssl: '',\n systemOpenssl: '',\n systemOpensslLib: '',\n node: process.versions.node,\n v8: process.versions.v8,\n npm: '',\n yarn: '',\n pm2: '',\n gulp: '',\n grunt: '',\n git: '',\n tsc: '',\n mysql: '',\n redis: '',\n mongodb: '',\n apache: '',\n nginx: '',\n php: '',\n docker: '',\n postfix: '',\n postgresql: '',\n perl: '',\n python: '',\n python3: '',\n pip: '',\n pip3: '',\n java: '',\n gcc: '',\n virtualbox: '',\n bash: '',\n zsh: '',\n fish: '',\n powershell: '',\n dotnet: ''\n };\n\n function checkVersionParam(apps) {\n if (apps === '*') {\n return {\n versions: versionObject,\n counter: 30\n };\n }\n if (!Array.isArray(apps)) {\n apps = apps.trim().toLowerCase().replace(/,+/g, '|').replace(/ /g, '|');\n apps = apps.split('|');\n const result = {\n versions: {},\n counter: 0\n };\n apps.forEach(el => {\n if (el) {\n for (let key in versionObject) {\n if ({}.hasOwnProperty.call(versionObject, key)) {\n if (key.toLowerCase() === el.toLowerCase() && !{}.hasOwnProperty.call(result.versions, key)) {\n result.versions[key] = versionObject[key];\n if (key === 'openssl') {\n result.versions.systemOpenssl = '';\n result.versions.systemOpensslLib = '';\n }\n\n if (!result.versions[key]) { result.counter++; }\n }\n }\n }\n }\n });\n return result;\n }\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (util.isFunction(apps) && !callback) {\n callback = apps;\n apps = '*';\n } else {\n apps = apps || '*';\n if (typeof apps !== 'string') {\n if (callback) { callback({}); }\n return resolve({});\n }\n }\n const appsObj = checkVersionParam(apps);\n let totalFunctions = appsObj.counter;\n\n let functionProcessed = (function () {\n return function () {\n if (--totalFunctions === 0) {\n if (callback) {\n callback(appsObj.versions);\n }\n resolve(appsObj.versions);\n }\n };\n })();\n\n let cmd = '';\n try {\n if ({}.hasOwnProperty.call(appsObj.versions, 'openssl')) {\n appsObj.versions.openssl = process.versions.openssl;\n exec('openssl version', function (error, stdout) {\n if (!error) {\n let openssl_string = stdout.toString().split('\\n')[0].trim();\n let openssl = openssl_string.split(' ');\n appsObj.versions.systemOpenssl = openssl.length > 0 ? openssl[1] : openssl[0];\n appsObj.versions.systemOpensslLib = openssl.length > 0 ? openssl[0] : 'openssl';\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'npm')) {\n exec('npm -v', function (error, stdout) {\n if (!error) {\n appsObj.versions.npm = stdout.toString().split('\\n')[0];\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'pm2')) {\n cmd = 'pm2';\n if (_windows) {\n cmd += '.cmd';\n }\n exec(`${cmd} -v`, function (error, stdout) {\n if (!error) {\n let pm2 = stdout.toString().split('\\n')[0].trim();\n if (!pm2.startsWith('[PM2]')) {\n appsObj.versions.pm2 = pm2;\n }\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'yarn')) {\n exec('yarn --version', function (error, stdout) {\n if (!error) {\n appsObj.versions.yarn = stdout.toString().split('\\n')[0];\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'gulp')) {\n cmd = 'gulp';\n if (_windows) {\n cmd += '.cmd';\n }\n exec(`${cmd} --version`, function (error, stdout) {\n if (!error) {\n const gulp = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.gulp = (gulp.toLowerCase().split('version')[1] || '').trim();\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'tsc')) {\n cmd = 'tsc';\n if (_windows) {\n cmd += '.cmd';\n }\n exec(`${cmd} --version`, function (error, stdout) {\n if (!error) {\n const tsc = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.tsc = (tsc.toLowerCase().split('version')[1] || '').trim();\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'grunt')) {\n cmd = 'grunt';\n if (_windows) {\n cmd += '.cmd';\n }\n exec(`${cmd} --version`, function (error, stdout) {\n if (!error) {\n const grunt = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.grunt = (grunt.toLowerCase().split('cli v')[1] || '').trim();\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'git')) {\n if (_darwin) {\n const gitHomebrewExists = fs.existsSync('/usr/local/Cellar/git') || fs.existsSync('/opt/homebrew/bin/git');\n if (util.darwinXcodeExists() || gitHomebrewExists) {\n exec('git --version', function (error, stdout) {\n if (!error) {\n let git = stdout.toString().split('\\n')[0] || '';\n git = (git.toLowerCase().split('version')[1] || '').trim();\n appsObj.versions.git = (git.split(' ')[0] || '').trim();\n }\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n } else {\n exec('git --version', function (error, stdout) {\n if (!error) {\n let git = stdout.toString().split('\\n')[0] || '';\n git = (git.toLowerCase().split('version')[1] || '').trim();\n appsObj.versions.git = (git.split(' ')[0] || '').trim();\n }\n functionProcessed();\n });\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'apache')) {\n exec('apachectl -v 2>&1', function (error, stdout) {\n if (!error) {\n const apache = (stdout.toString().split('\\n')[0] || '').split(':');\n appsObj.versions.apache = (apache.length > 1 ? apache[1].replace('Apache', '').replace('/', '').split('(')[0].trim() : '');\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'nginx')) {\n exec('nginx -v 2>&1', function (error, stdout) {\n if (!error) {\n const nginx = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.nginx = (nginx.toLowerCase().split('/')[1] || '').trim();\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'mysql')) {\n exec('mysql -V', function (error, stdout) {\n if (!error) {\n let mysql = stdout.toString().split('\\n')[0] || '';\n mysql = mysql.toLowerCase();\n if (mysql.indexOf(',') > -1) {\n mysql = (mysql.split(',')[0] || '').trim();\n const parts = mysql.split(' ');\n appsObj.versions.mysql = (parts[parts.length - 1] || '').trim();\n } else {\n if (mysql.indexOf(' ver ') > -1) {\n mysql = mysql.split(' ver ')[1];\n appsObj.versions.mysql = mysql.split(' ')[0];\n }\n }\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'php')) {\n exec('php -v', function (error, stdout) {\n if (!error) {\n const php = stdout.toString().split('\\n')[0] || '';\n let parts = php.split('(');\n if (parts[0].indexOf('-')) {\n parts = parts[0].split('-');\n }\n appsObj.versions.php = parts[0].replace(/[^0-9.]/g, '');\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'redis')) {\n exec('redis-server --version', function (error, stdout) {\n if (!error) {\n const redis = stdout.toString().split('\\n')[0] || '';\n const parts = redis.split(' ');\n appsObj.versions.redis = util.getValue(parts, 'v', '=', true);\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'docker')) {\n exec('docker --version', function (error, stdout) {\n if (!error) {\n const docker = stdout.toString().split('\\n')[0] || '';\n const parts = docker.split(' ');\n appsObj.versions.docker = parts.length > 2 && parts[2].endsWith(',') ? parts[2].slice(0, -1) : '';\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'postfix')) {\n exec('postconf -d | grep mail_version', function (error, stdout) {\n if (!error) {\n const postfix = stdout.toString().split('\\n') || [];\n appsObj.versions.postfix = util.getValue(postfix, 'mail_version', '=', true);\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'mongodb')) {\n exec('mongod --version', function (error, stdout) {\n if (!error) {\n const mongodb = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.mongodb = (mongodb.toLowerCase().split(',')[0] || '').replace(/[^0-9.]/g, '');\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'postgresql')) {\n if (_linux) {\n exec('locate bin/postgres', function (error, stdout) {\n if (!error) {\n const postgresqlBin = stdout.toString().split('\\n').sort();\n if (postgresqlBin.length) {\n exec(postgresqlBin[postgresqlBin.length - 1] + ' -V', function (error, stdout) {\n if (!error) {\n const postgresql = stdout.toString().split('\\n')[0].split(' ') || [];\n appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';\n }\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n } else {\n exec('psql -V', function (error, stdout) {\n if (!error) {\n const postgresql = stdout.toString().split('\\n')[0].split(' ') || [];\n appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';\n appsObj.versions.postgresql = appsObj.versions.postgresql.split('-')[0];\n }\n functionProcessed();\n });\n functionProcessed();\n }\n });\n } else {\n if (_windows) {\n util.powerShell('Get-WmiObject Win32_Service | select caption | fl').then((stdout) => {\n let serviceSections = stdout.split(/\\n\\s*\\n/);\n for (let i = 0; i < serviceSections.length; i++) {\n if (serviceSections[i].trim() !== '') {\n let lines = serviceSections[i].trim().split('\\r\\n');\n let srvCaption = util.getValue(lines, 'caption', ':', true).toLowerCase();\n if (srvCaption.indexOf('postgresql') > -1) {\n const parts = srvCaption.split(' server ');\n if (parts.length > 1) {\n appsObj.versions.postgresql = parts[1];\n }\n }\n }\n }\n functionProcessed();\n });\n } else {\n exec('postgres -V', function (error, stdout) {\n if (!error) {\n const postgresql = stdout.toString().split('\\n')[0].split(' ') || [];\n appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';\n }\n functionProcessed();\n });\n }\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'perl')) {\n exec('perl -v', function (error, stdout) {\n if (!error) {\n const perl = stdout.toString().split('\\n') || '';\n while (perl.length > 0 && perl[0].trim() === '') {\n perl.shift();\n }\n if (perl.length > 0) {\n appsObj.versions.perl = perl[0].split('(').pop().split(')')[0].replace('v', '');\n }\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'python')) {\n if (_darwin) {\n const stdout = execSync('sw_vers');\n const lines = stdout.toString().split('\\n');\n const osVersion = util.getValue(lines, 'ProductVersion', ':');\n const gitHomebrewExists1 = fs.existsSync('/usr/local/Cellar/python');\n const gitHomebrewExists2 = fs.existsSync('/opt/homebrew/bin/python');\n if ((util.darwinXcodeExists() && util.semverCompare('12.0.1', osVersion) < 0) || gitHomebrewExists1 || gitHomebrewExists2) {\n const cmd = gitHomebrewExists1 ? '/usr/local/Cellar/python -V 2>&1' : (gitHomebrewExists2 ? '/opt/homebrew/bin/python -V 2>&1' : 'python -V 2>&1');\n exec(cmd, function (error, stdout) {\n if (!error) {\n const python = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.python = python.toLowerCase().replace('python', '').trim();\n }\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n } else {\n exec('python -V 2>&1', function (error, stdout) {\n if (!error) {\n const python = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.python = python.toLowerCase().replace('python', '').trim();\n }\n functionProcessed();\n });\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'python3')) {\n if (_darwin) {\n const gitHomebrewExists = fs.existsSync('/usr/local/Cellar/python3') || fs.existsSync('/opt/homebrew/bin/python3');\n if (util.darwinXcodeExists() || gitHomebrewExists) {\n exec('python3 -V 2>&1', function (error, stdout) {\n if (!error) {\n const python = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.python3 = python.toLowerCase().replace('python', '').trim();\n }\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n } else {\n exec('python3 -V 2>&1', function (error, stdout) {\n if (!error) {\n const python = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.python3 = python.toLowerCase().replace('python', '').trim();\n }\n functionProcessed();\n });\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'pip')) {\n if (_darwin) {\n const gitHomebrewExists = fs.existsSync('/usr/local/Cellar/pip') || fs.existsSync('/opt/homebrew/bin/pip');\n if (util.darwinXcodeExists() || gitHomebrewExists) {\n exec('pip -V 2>&1', function (error, stdout) {\n if (!error) {\n const pip = stdout.toString().split('\\n')[0] || '';\n const parts = pip.split(' ');\n appsObj.versions.pip = parts.length >= 2 ? parts[1] : '';\n }\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n } else {\n exec('pip -V 2>&1', function (error, stdout) {\n if (!error) {\n const pip = stdout.toString().split('\\n')[0] || '';\n const parts = pip.split(' ');\n appsObj.versions.pip = parts.length >= 2 ? parts[1] : '';\n }\n functionProcessed();\n });\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'pip3')) {\n if (_darwin) {\n const gitHomebrewExists = fs.existsSync('/usr/local/Cellar/pip3') || fs.existsSync('/opt/homebrew/bin/pip3');\n if (util.darwinXcodeExists() || gitHomebrewExists) {\n exec('pip3 -V 2>&1', function (error, stdout) {\n if (!error) {\n const pip = stdout.toString().split('\\n')[0] || '';\n const parts = pip.split(' ');\n appsObj.versions.pip3 = parts.length >= 2 ? parts[1] : '';\n }\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n } else {\n exec('pip3 -V 2>&1', function (error, stdout) {\n if (!error) {\n const pip = stdout.toString().split('\\n')[0] || '';\n const parts = pip.split(' ');\n appsObj.versions.pip3 = parts.length >= 2 ? parts[1] : '';\n }\n functionProcessed();\n });\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'java')) {\n if (_darwin) {\n // check if any JVM is installed but avoid dialog box that Java needs to be installed\n exec('/usr/libexec/java_home -V 2>&1', function (error, stdout) {\n if (!error && stdout.toString().toLowerCase().indexOf('no java runtime') === -1) {\n // now this can be done savely\n exec('java -version 2>&1', function (error, stdout) {\n if (!error) {\n const java = stdout.toString().split('\\n')[0] || '';\n const parts = java.split('\"');\n appsObj.versions.java = parts.length === 3 ? parts[1].trim() : '';\n }\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n });\n } else {\n exec('java -version 2>&1', function (error, stdout) {\n if (!error) {\n const java = stdout.toString().split('\\n')[0] || '';\n const parts = java.split('\"');\n appsObj.versions.java = parts.length === 3 ? parts[1].trim() : '';\n }\n functionProcessed();\n });\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'gcc')) {\n if ((_darwin && util.darwinXcodeExists()) || !_darwin) {\n exec('gcc -dumpversion', function (error, stdout) {\n if (!error) {\n appsObj.versions.gcc = stdout.toString().split('\\n')[0].trim() || '';\n }\n if (appsObj.versions.gcc.indexOf('.') > -1) {\n functionProcessed();\n } else {\n exec('gcc --version', function (error, stdout) {\n if (!error) {\n const gcc = stdout.toString().split('\\n')[0].trim();\n if (gcc.indexOf('gcc') > -1 && gcc.indexOf(')') > -1) {\n const parts = gcc.split(')');\n appsObj.versions.gcc = parts[1].trim() || appsObj.versions.gcc;\n }\n }\n functionProcessed();\n });\n }\n });\n } else {\n functionProcessed();\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'virtualbox')) {\n exec(util.getVboxmanage() + ' -v 2>&1', function (error, stdout) {\n if (!error) {\n const vbox = stdout.toString().split('\\n')[0] || '';\n const parts = vbox.split('r');\n appsObj.versions.virtualbox = parts[0];\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'bash')) {\n exec('bash --version', function (error, stdout) {\n if (!error) {\n const line = stdout.toString().split('\\n')[0];\n const parts = line.split(' version ');\n if (parts.length > 1) {\n appsObj.versions.bash = parts[1].split(' ')[0].split('(')[0];\n }\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'zsh')) {\n exec('zsh --version', function (error, stdout) {\n if (!error) {\n const line = stdout.toString().split('\\n')[0];\n const parts = line.split('zsh ');\n if (parts.length > 1) {\n appsObj.versions.zsh = parts[1].split(' ')[0];\n }\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'fish')) {\n exec('fish --version', function (error, stdout) {\n if (!error) {\n const line = stdout.toString().split('\\n')[0];\n const parts = line.split(' version ');\n if (parts.length > 1) {\n appsObj.versions.fish = parts[1].split(' ')[0];\n }\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'powershell')) {\n if (_windows) {\n util.powerShell('$PSVersionTable').then(stdout => {\n const lines = stdout.toString().split('\\n').map(line => line.replace(/ +/g, ' ').replace(/ +/g, ':'));\n appsObj.versions.powershell = util.getValue(lines, 'psversion');\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'dotnet')) {\n util.powerShell('gci \"HKLM:\\\\SOFTWARE\\\\Microsoft\\\\NET Framework Setup\\\\NDP\" -recurse | gp -name Version,Release -EA 0 | where { $_.PSChildName -match \"^(?!S)\\\\p{L}\"} | select PSChildName, Version, Release').then(stdout => {\n const lines = stdout.toString().split('\\r\\n');\n let dotnet = '';\n lines.forEach(line => {\n line = line.replace(/ +/g, ' ');\n const parts = line.split(' ');\n dotnet = dotnet || ((parts[0].toLowerCase().startsWith('client') && parts.length > 2 ? parts[1].trim() : (parts[0].toLowerCase().startsWith('full') && parts.length > 2 ? parts[1].trim() : '')));\n });\n appsObj.versions.dotnet = dotnet.trim();\n functionProcessed();\n });\n }\n } catch (e) {\n if (callback) { callback(appsObj.versions); }\n resolve(appsObj.versions);\n }\n });\n });\n}\n\nexports.versions = versions;\n\nfunction shell(callback) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (_windows) {\n resolve('cmd');\n } else {\n let result = '';\n exec('echo $SHELL', function (error, stdout) {\n if (!error) {\n result = stdout.toString().split('\\n')[0];\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n });\n });\n}\n\nexports.shell = shell;\n\nfunction getUniqueMacAdresses() {\n const ifaces = os.networkInterfaces();\n let macs = [];\n for (let dev in ifaces) {\n if ({}.hasOwnProperty.call(ifaces, dev)) {\n ifaces[dev].forEach(function (details) {\n if (details && details.mac && details.mac !== '00:00:00:00:00:00') {\n const mac = details.mac.toLowerCase();\n if (macs.indexOf(mac) === -1) {\n macs.push(mac);\n }\n }\n });\n }\n }\n macs = macs.sort(function (a, b) {\n if (a < b) { return -1; }\n if (a > b) { return 1; }\n return 0;\n });\n return macs;\n}\n\nfunction uuid(callback) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = {\n os: '',\n hardware: '',\n macs: getUniqueMacAdresses()\n };\n let parts;\n\n if (_darwin) {\n exec('system_profiler SPHardwareDataType -json', function (error, stdout) {\n if (!error) {\n try {\n const jsonObj = JSON.parse(stdout.toString());\n if (jsonObj.SPHardwareDataType && jsonObj.SPHardwareDataType.length > 0) {\n const spHardware = jsonObj.SPHardwareDataType[0];\n // result.os = parts.length > 1 ? parts[1].trim().toLowerCase() : '';\n result.os = spHardware.platform_UUID.toLowerCase();\n result.hardware = spHardware.serial_number;\n }\n } catch (e) {\n util.noop();\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_linux) {\n const cmd = `echo -n \"os: \"; cat /var/lib/dbus/machine-id 2> /dev/null; echo;\necho -n \"os: \"; cat /etc/machine-id 2> /dev/null; echo;\necho -n \"hardware: \"; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`;\n exec(cmd, function (error, stdout) {\n const lines = stdout.toString().split('\\n');\n result.os = util.getValue(lines, 'os').toLowerCase();\n result.hardware = util.getValue(lines, 'hardware').toLowerCase();\n if (!result.hardware) {\n const lines = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' }).toString().split('\\n');\n const serial = util.getValue(lines, 'serial');\n result.hardware = serial || '';\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_freebsd || _openbsd || _netbsd) {\n exec('sysctl -i kern.hostid kern.hostuuid', function (error, stdout) {\n const lines = stdout.toString().split('\\n');\n result.os = util.getValue(lines, 'kern.hostid', ':').toLowerCase();\n result.hardware = util.getValue(lines, 'kern.hostuuid', ':').toLowerCase();\n if (result.os.indexOf('unknown') >= 0) { result.os = ''; }\n if (result.hardware.indexOf('unknown') >= 0) { result.hardware = ''; }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_windows) {\n let sysdir = '%windir%\\\\System32';\n if (process.arch === 'ia32' && Object.prototype.hasOwnProperty.call(process.env, 'PROCESSOR_ARCHITEW6432')) {\n sysdir = '%windir%\\\\sysnative\\\\cmd.exe /c %windir%\\\\System32';\n }\n util.powerShell('Get-WmiObject Win32_ComputerSystemProduct | select UUID | fl').then((stdout) => {\n // let lines = stdout.split('\\r\\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0)[0].trim().split(/\\s\\s+/);\n let lines = stdout.split('\\r\\n');\n result.hardware = util.getValue(lines, 'uuid', ':').toLowerCase();\n exec(`${sysdir}\\\\reg query \"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Cryptography\" /v MachineGuid`, util.execOptsWin, function (error, stdout) {\n parts = stdout.toString().split('\\n\\r')[0].split('REG_SZ');\n result.os = parts.length > 1 ? parts[1].replace(/\\r+|\\n+|\\s+/ig, '').toLowerCase() : '';\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n });\n }\n });\n });\n}\n\nexports.uuid = uuid;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// printers.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 15. printers\n// ----------------------------------------------------------------------------------\n\nconst exec = require('child_process').exec;\n// const execSync = require('child_process').execSync;\nconst util = require('./util');\n// const fs = require('fs');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nconst winPrinterStatus = {\n 1: 'Other',\n 2: 'Unknown',\n 3: 'Idle',\n 4: 'Printing',\n 5: 'Warmup',\n 6: 'Stopped Printing',\n 7: 'Offline',\n};\n\nfunction parseLinuxCupsHeader(lines) {\n const result = {};\n if (lines && lines.length) {\n if (lines[0].indexOf(' CUPS v') > 0) {\n const parts = lines[0].split(' CUPS v');\n result.cupsVersion = parts[1];\n }\n }\n return result;\n}\n\nfunction parseLinuxCupsPrinter(lines) {\n const result = {};\n const printerId = util.getValue(lines, 'PrinterId', ' ');\n result.id = printerId ? parseInt(printerId, 10) : null;\n result.name = util.getValue(lines, 'Info', ' ');\n result.model = lines.length > 0 && lines[0] ? lines[0].split(' ')[0] : '';\n result.uri = util.getValue(lines, 'DeviceURI', ' ');\n result.uuid = util.getValue(lines, 'UUID', ' ');\n result.status = util.getValue(lines, 'State', ' ');\n result.local = util.getValue(lines, 'Location', ' ').toLowerCase().startsWith('local');\n result.default = null;\n result.shared = util.getValue(lines, 'Shared', ' ').toLowerCase().startsWith('yes');\n\n return result;\n}\n\nfunction parseLinuxLpstatPrinter(lines, id) {\n const result = {};\n result.id = id;\n result.name = util.getValue(lines, 'Description', ':', true);\n result.model = lines.length > 0 && lines[0] ? lines[0].split(' ')[0] : '';\n result.uri = null;\n result.uuid = null;\n result.status = lines.length > 0 && lines[0] ? (lines[0].indexOf(' idle') > 0 ? 'idle' : (lines[0].indexOf(' printing') > 0 ? 'printing' : 'unknown')) : null;\n result.local = util.getValue(lines, 'Location', ':', true).toLowerCase().startsWith('local');\n result.default = null;\n result.shared = util.getValue(lines, 'Shared', ' ').toLowerCase().startsWith('yes');\n\n return result;\n}\n\nfunction parseDarwinPrinters(printerObject, id) {\n const result = {};\n const uriParts = printerObject.uri.split('/');\n result.id = id;\n result.name = printerObject._name;\n result.model = uriParts.length ? uriParts[uriParts.length - 1] : '';\n result.uri = printerObject.uri;\n result.uuid = null;\n result.status = printerObject.status;\n result.local = printerObject.printserver === 'local';\n result.default = printerObject.default === 'yes';\n result.shared = printerObject.shared === 'yes';\n\n return result;\n}\n\nfunction parseWindowsPrinters(lines, id) {\n const result = {};\n const status = parseInt(util.getValue(lines, 'PrinterStatus', ':'), 10);\n\n result.id = id;\n result.name = util.getValue(lines, 'name', ':');\n result.model = util.getValue(lines, 'DriverName', ':');\n result.uri = null;\n result.uuid = null;\n result.status = winPrinterStatus[status] ? winPrinterStatus[status] : null;\n result.local = util.getValue(lines, 'Local', ':').toUpperCase() === 'TRUE';\n result.default = util.getValue(lines, 'Default', ':').toUpperCase() === 'TRUE';\n result.shared = util.getValue(lines, 'Shared', ':').toUpperCase() === 'TRUE';\n\n return result;\n}\n\nfunction printer(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = [];\n if (_linux || _freebsd || _openbsd || _netbsd) {\n let cmd = 'cat /etc/cups/printers.conf 2>/dev/null';\n exec(cmd, function (error, stdout) {\n // printers.conf\n if (!error) {\n const parts = stdout.toString().split(' {\n if (!error) {\n const parts = stdout.toString().split(/\\n\\s*\\n/);\n for (let i = 0; i < parts.length; i++) {\n const printer = parseWindowsPrinters(parts[i].split('\\n'), i);\n if (printer.name || printer.model) {\n result.push(parseWindowsPrinters(parts[i].split('\\n'), i));\n }\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_sunos) {\n resolve(null);\n }\n });\n });\n}\n\nexports.printer = printer;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// processes.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 10. Processes\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst fs = require('fs');\nconst path = require('path');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\n\nconst util = require('./util');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nconst _processes_cpu = {\n all: 0,\n all_utime: 0,\n all_stime: 0,\n list: {},\n ms: 0,\n result: {}\n};\nconst _services_cpu = {\n all: 0,\n all_utime: 0,\n all_stime: 0,\n list: {},\n ms: 0,\n result: {}\n};\nconst _process_cpu = {\n all: 0,\n all_utime: 0,\n all_stime: 0,\n list: {},\n ms: 0,\n result: {}\n};\n\nconst _winStatusValues = {\n '0': 'unknown',\n '1': 'other',\n '2': 'ready',\n '3': 'running',\n '4': 'blocked',\n '5': 'suspended blocked',\n '6': 'suspended ready',\n '7': 'terminated',\n '8': 'stopped',\n '9': 'growing',\n};\n\n\nfunction parseTimeWin(time) {\n time = time || '';\n if (time) {\n return (time.substr(0, 4) + '-' + time.substr(4, 2) + '-' + time.substr(6, 2) + ' ' + time.substr(8, 2) + ':' + time.substr(10, 2) + ':' + time.substr(12, 2));\n } else {\n return '';\n }\n}\n\nfunction parseTimeUnix(time) {\n let result = time;\n let parts = time.replace(/ +/g, ' ').split(' ');\n if (parts.length === 5) {\n result = parts[4] + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(parts[1].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + parts[2]).slice(-2) + ' ' + parts[3];\n }\n return result;\n}\n\n// --------------------------\n// PS - services\n// pass a comma separated string with services to check (mysql, apache, postgresql, ...)\n// this function gives an array back, if the services are running.\n\nfunction services(srv, callback) {\n\n // fallback - if only callback is given\n if (util.isFunction(srv) && !callback) {\n callback = srv;\n srv = '';\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (typeof srv !== 'string') {\n if (callback) { callback([]); }\n return resolve([]);\n }\n\n if (srv) {\n let srvString = '';\n srvString.__proto__.toLowerCase = util.stringToLower;\n srvString.__proto__.replace = util.stringReplace;\n srvString.__proto__.trim = util.stringTrim;\n\n const s = util.sanitizeShellString(srv);\n for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {\n if (!(s[i] === undefined)) {\n srvString = srvString + s[i];\n }\n }\n\n srvString = srvString.trim().toLowerCase().replace(/, /g, '|').replace(/,+/g, '|');\n if (srvString === '') {\n srvString = '*';\n }\n if (util.isPrototypePolluted() && srvString !== '*') {\n srvString = '------';\n }\n let srvs = srvString.split('|');\n let result = [];\n let dataSrv = [];\n // let allSrv = [];\n\n if (_linux || _freebsd || _openbsd || _netbsd || _darwin) {\n if ((_linux || _freebsd || _openbsd || _netbsd) && srvString === '*') {\n try {\n const tmpsrv = execSync('systemctl --type=service --no-legend 2> /dev/null').toString().split('\\n');\n srvs = [];\n for (const s of tmpsrv) {\n const name = s.split('.service')[0];\n if (name) {\n srvs.push(name);\n }\n }\n srvString = srvs.join('|');\n } catch (d) {\n try {\n srvString = '';\n const tmpsrv = execSync('service --status-all 2> /dev/null').toString().split('\\n');\n for (const s of tmpsrv) {\n const parts = s.split(']');\n if (parts.length === 2) {\n srvString += (srvString !== '' ? '|' : '') + parts[1].trim();\n // allSrv.push({ name: parts[1].trim(), running: parts[0].indexOf('+') > 0 });\n }\n }\n srvs = srvString.split('|');\n } catch (e) {\n try {\n const srvStr = execSync('ls /etc/init.d/ -m 2> /dev/null').toString().split('\\n').join('');\n srvString = '';\n if (srvStr) {\n const tmpsrv = srvStr.split(',');\n for (const s of tmpsrv) {\n const name = s.trim();\n if (name) {\n srvString += (srvString !== '' ? '|' : '') + name;\n // allSrv.push({ name: name, running: null });\n }\n }\n srvs = srvString.split('|');\n }\n } catch (f) {\n // allSrv = [];\n srvString = '';\n srvs = [];\n }\n }\n }\n }\n if ((_darwin) && srvString === '*') { // service enumeration not yet suported on mac OS\n if (callback) { callback(result); }\n resolve(result);\n }\n let args = (_darwin) ? ['-caxo', 'pcpu,pmem,pid,command'] : ['-axo', 'pcpu,pmem,pid,command'];\n if (srvString !== '' && srvs.length > 0) {\n util.execSafe('ps', args).then((stdout) => {\n if (stdout) {\n let lines = stdout.replace(/ +/g, ' ').replace(/,+/g, '.').split('\\n');\n srvs.forEach(function (srv) {\n let ps;\n if (_darwin) {\n ps = lines.filter(function (e) {\n return (e.toLowerCase().indexOf(srv) !== -1);\n });\n\n } else {\n ps = lines.filter(function (e) {\n return (e.toLowerCase().indexOf(' ' + srv + ':') !== -1) || (e.toLowerCase().indexOf('/' + srv) !== -1);\n });\n }\n // let singleSrv = allSrv.filter(item => { return item.name === srv; });\n const pids = [];\n for (const p of ps) {\n const pid = p.trim().split(' ')[2];\n if (pid) {\n pids.push(parseInt(pid, 10));\n }\n }\n result.push({\n name: srv,\n // running: (allSrv.length && singleSrv.length && singleSrv[0].running !== null ? singleSrv[0].running : ps.length > 0),\n running: ps.length > 0,\n startmode: '',\n pids: pids,\n cpu: parseFloat((ps.reduce(function (pv, cv) {\n return pv + parseFloat(cv.trim().split(' ')[0]);\n }, 0)).toFixed(2)),\n mem: parseFloat((ps.reduce(function (pv, cv) {\n return pv + parseFloat(cv.trim().split(' ')[1]);\n }, 0)).toFixed(2))\n });\n });\n if (_linux) {\n // calc process_cpu - ps is not accurate in linux!\n let cmd = 'cat /proc/stat | grep \"cpu \"';\n for (let i in result) {\n for (let j in result[i].pids) {\n cmd += (';cat /proc/' + result[i].pids[j] + '/stat');\n }\n }\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n let curr_processes = stdout.toString().split('\\n');\n\n // first line (all - /proc/stat)\n let all = parseProcStat(curr_processes.shift());\n\n // process\n let list_new = {};\n let resultProcess = {};\n for (let i = 0; i < curr_processes.length; i++) {\n resultProcess = calcProcStatLinux(curr_processes[i], all, _services_cpu);\n\n if (resultProcess.pid) {\n let listPos = -1;\n for (let i in result) {\n for (let j in result[i].pids) {\n if (parseInt(result[i].pids[j]) === parseInt(resultProcess.pid)) {\n listPos = i;\n }\n }\n }\n if (listPos >= 0) {\n result[listPos].cpu += resultProcess.cpuu + resultProcess.cpus;\n }\n\n // save new values\n list_new[resultProcess.pid] = {\n cpuu: resultProcess.cpuu,\n cpus: resultProcess.cpus,\n utime: resultProcess.utime,\n stime: resultProcess.stime,\n cutime: resultProcess.cutime,\n cstime: resultProcess.cstime\n };\n }\n }\n\n // store old values\n _services_cpu.all = all;\n // _services_cpu.list = list_new;\n _services_cpu.list = Object.assign({}, list_new);\n _services_cpu.ms = Date.now() - _services_cpu.ms;\n // _services_cpu.result = result;\n _services_cpu.result = Object.assign({}, result);\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n args = ['-o', 'comm'];\n util.execSafe('ps', args).then((stdout) => {\n if (stdout) {\n let lines = stdout.replace(/ +/g, ' ').replace(/,+/g, '.').split('\\n');\n srvs.forEach(function (srv) {\n let ps = lines.filter(function (e) {\n return e.indexOf(srv) !== -1;\n });\n result.push({\n name: srv,\n running: ps.length > 0,\n startmode: '',\n cpu: 0,\n mem: 0\n });\n });\n if (callback) { callback(result); }\n resolve(result);\n } else {\n srvs.forEach(function (srv) {\n result.push({\n name: srv,\n running: false,\n startmode: '',\n cpu: 0,\n mem: 0\n });\n });\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n }\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_windows) {\n try {\n let wincommand = 'Get-WmiObject Win32_Service';\n if (srvs[0] !== '*') {\n wincommand += ' -Filter \"';\n for (let i = 0; i < srvs.length; i++) {\n wincommand += `Name='${srvs[i]}' or `;\n }\n wincommand = `${wincommand.slice(0, -4)}\"`;\n }\n wincommand += ' | select Name,Caption,Started,StartMode,ProcessId | fl';\n util.powerShell(wincommand).then((stdout, error) => {\n if (!error) {\n let serviceSections = stdout.split(/\\n\\s*\\n/);\n for (let i = 0; i < serviceSections.length; i++) {\n if (serviceSections[i].trim() !== '') {\n let lines = serviceSections[i].trim().split('\\r\\n');\n let srvName = util.getValue(lines, 'Name', ':', true).toLowerCase();\n let srvCaption = util.getValue(lines, 'Caption', ':', true).toLowerCase();\n let started = util.getValue(lines, 'Started', ':', true);\n let startMode = util.getValue(lines, 'StartMode', ':', true);\n let pid = util.getValue(lines, 'ProcessId', ':', true);\n if (srvString === '*' || srvs.indexOf(srvName) >= 0 || srvs.indexOf(srvCaption) >= 0) {\n result.push({\n name: srvName,\n running: (started.toLowerCase() === 'true'),\n startmode: startMode,\n pids: [pid],\n cpu: 0,\n mem: 0\n });\n dataSrv.push(srvName);\n dataSrv.push(srvCaption);\n }\n }\n }\n if (srvString !== '*') {\n let srvsMissing = srvs.filter(function (e) {\n return dataSrv.indexOf(e) === -1;\n });\n srvsMissing.forEach(function (srvName) {\n result.push({\n name: srvName,\n running: false,\n startmode: '',\n pids: [],\n cpu: 0,\n mem: 0\n });\n });\n }\n if (callback) { callback(result); }\n resolve(result);\n } else {\n srvs.forEach(function (srvName) {\n result.push({\n name: srvName,\n running: false,\n startmode: '',\n cpu: 0,\n mem: 0\n });\n });\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n } else {\n if (callback) { callback([]); }\n resolve([]);\n }\n });\n });\n}\n\nexports.services = services;\n\nfunction parseProcStat(line) {\n let parts = line.replace(/ +/g, ' ').split(' ');\n let user = (parts.length >= 2 ? parseInt(parts[1]) : 0);\n let nice = (parts.length >= 3 ? parseInt(parts[2]) : 0);\n let system = (parts.length >= 4 ? parseInt(parts[3]) : 0);\n let idle = (parts.length >= 5 ? parseInt(parts[4]) : 0);\n let iowait = (parts.length >= 6 ? parseInt(parts[5]) : 0);\n let irq = (parts.length >= 7 ? parseInt(parts[6]) : 0);\n let softirq = (parts.length >= 8 ? parseInt(parts[7]) : 0);\n let steal = (parts.length >= 9 ? parseInt(parts[8]) : 0);\n let guest = (parts.length >= 10 ? parseInt(parts[9]) : 0);\n let guest_nice = (parts.length >= 11 ? parseInt(parts[10]) : 0);\n return user + nice + system + idle + iowait + irq + softirq + steal + guest + guest_nice;\n}\n\nfunction calcProcStatLinux(line, all, _cpu_old) {\n let statparts = line.replace(/ +/g, ' ').split(')');\n if (statparts.length >= 2) {\n let parts = statparts[1].split(' ');\n if (parts.length >= 16) {\n let pid = parseInt(statparts[0].split(' ')[0]);\n let utime = parseInt(parts[12]);\n let stime = parseInt(parts[13]);\n let cutime = parseInt(parts[14]);\n let cstime = parseInt(parts[15]);\n\n // calc\n let cpuu = 0;\n let cpus = 0;\n if (_cpu_old.all > 0 && _cpu_old.list[pid]) {\n cpuu = (utime + cutime - _cpu_old.list[pid].utime - _cpu_old.list[pid].cutime) / (all - _cpu_old.all) * 100; // user\n cpus = (stime + cstime - _cpu_old.list[pid].stime - _cpu_old.list[pid].cstime) / (all - _cpu_old.all) * 100; // system\n } else {\n cpuu = (utime + cutime) / (all) * 100; // user\n cpus = (stime + cstime) / (all) * 100; // system\n }\n return {\n pid: pid,\n utime: utime,\n stime: stime,\n cutime: cutime,\n cstime: cstime,\n cpuu: cpuu,\n cpus: cpus\n };\n } else {\n return {\n pid: 0,\n utime: 0,\n stime: 0,\n cutime: 0,\n cstime: 0,\n cpuu: 0,\n cpus: 0\n };\n }\n } else {\n return {\n pid: 0,\n utime: 0,\n stime: 0,\n cutime: 0,\n cstime: 0,\n cpuu: 0,\n cpus: 0\n };\n }\n}\n\nfunction calcProcStatWin(procStat, all, _cpu_old) {\n // calc\n let cpuu = 0;\n let cpus = 0;\n if (_cpu_old.all > 0 && _cpu_old.list[procStat.pid]) {\n cpuu = (procStat.utime - _cpu_old.list[procStat.pid].utime) / (all - _cpu_old.all) * 100; // user\n cpus = (procStat.stime - _cpu_old.list[procStat.pid].stime) / (all - _cpu_old.all) * 100; // system\n } else {\n cpuu = (procStat.utime) / (all) * 100; // user\n cpus = (procStat.stime) / (all) * 100; // system\n }\n return {\n pid: procStat.pid,\n utime: cpuu > 0 ? procStat.utime : 0,\n stime: cpus > 0 ? procStat.stime : 0,\n cpuu: cpuu > 0 ? cpuu : 0,\n cpus: cpus > 0 ? cpus : 0\n };\n}\n\n\n\n// --------------------------\n// running processes\n\nfunction processes(callback) {\n\n let parsedhead = [];\n\n function getName(command) {\n command = command || '';\n let result = command.split(' ')[0];\n if (result.substr(-1) === ':') {\n result = result.substr(0, result.length - 1);\n }\n if (result.substr(0, 1) !== '[') {\n let parts = result.split('/');\n if (isNaN(parseInt(parts[parts.length - 1]))) {\n result = parts[parts.length - 1];\n } else {\n result = parts[0];\n }\n }\n return result;\n }\n\n function parseLine(line) {\n\n let offset = 0;\n let offset2 = 0;\n\n function checkColumn(i) {\n offset = offset2;\n if (parsedhead[i]) {\n offset2 = line.substring(parsedhead[i].to + offset, 10000).indexOf(' ');\n } else {\n offset2 = 10000;\n }\n }\n\n checkColumn(0);\n const pid = parseInt(line.substring(parsedhead[0].from + offset, parsedhead[0].to + offset2));\n checkColumn(1);\n const ppid = parseInt(line.substring(parsedhead[1].from + offset, parsedhead[1].to + offset2));\n checkColumn(2);\n const cpu = parseFloat(line.substring(parsedhead[2].from + offset, parsedhead[2].to + offset2).replace(/,/g, '.'));\n checkColumn(3);\n const mem = parseFloat(line.substring(parsedhead[3].from + offset, parsedhead[3].to + offset2).replace(/,/g, '.'));\n checkColumn(4);\n const priority = parseInt(line.substring(parsedhead[4].from + offset, parsedhead[4].to + offset2));\n checkColumn(5);\n const vsz = parseInt(line.substring(parsedhead[5].from + offset, parsedhead[5].to + offset2));\n checkColumn(6);\n const rss = parseInt(line.substring(parsedhead[6].from + offset, parsedhead[6].to + offset2));\n checkColumn(7);\n const nice = parseInt(line.substring(parsedhead[7].from + offset, parsedhead[7].to + offset2)) || 0;\n checkColumn(8);\n const started = parseTimeUnix(line.substring(parsedhead[8].from + offset, parsedhead[8].to + offset2).trim());\n checkColumn(9);\n let state = line.substring(parsedhead[9].from + offset, parsedhead[9].to + offset2).trim();\n state = (state[0] === 'R' ? 'running' : (state[0] === 'S' ? 'sleeping' : (state[0] === 'T' ? 'stopped' : (state[0] === 'W' ? 'paging' : (state[0] === 'X' ? 'dead' : (state[0] === 'Z' ? 'zombie' : ((state[0] === 'D' || state[0] === 'U') ? 'blocked' : 'unknown')))))));\n checkColumn(10);\n let tty = line.substring(parsedhead[10].from + offset, parsedhead[10].to + offset2).trim();\n if (tty === '?' || tty === '??') { tty = ''; }\n checkColumn(11);\n const user = line.substring(parsedhead[11].from + offset, parsedhead[11].to + offset2).trim();\n checkColumn(12);\n let cmdPath = '';\n let command = '';\n let params = '';\n let fullcommand = line.substring(parsedhead[12].from + offset, parsedhead[12].to + offset2).trim();\n if (fullcommand.substr(fullcommand.length - 1) === ']') { fullcommand = fullcommand.slice(0, -1); }\n if (fullcommand.substr(0, 1) === '[') { command = fullcommand.substring(1); }\n else {\n // try to figure out where parameter starts\n let firstParamPos = fullcommand.indexOf(' -');\n let firstParamPathPos = fullcommand.indexOf(' /');\n firstParamPos = (firstParamPos >= 0 ? firstParamPos : 10000);\n firstParamPathPos = (firstParamPathPos >= 0 ? firstParamPathPos : 10000);\n const firstPos = Math.min(firstParamPos, firstParamPathPos);\n let tmpCommand = fullcommand.substr(0, firstPos);\n const tmpParams = fullcommand.substr(firstPos);\n const lastSlashPos = tmpCommand.lastIndexOf('/');\n if (lastSlashPos >= 0) {\n cmdPath = tmpCommand.substr(0, lastSlashPos);\n tmpCommand = tmpCommand.substr(lastSlashPos + 1);\n }\n\n if (firstPos === 10000 && tmpCommand.indexOf(' ') > -1) {\n const parts = tmpCommand.split(' ');\n if (fs.existsSync(path.join(cmdPath, parts[0]))) {\n command = parts.shift();\n params = (parts.join(' ') + ' ' + tmpParams).trim();\n } else {\n command = tmpCommand.trim();\n params = tmpParams.trim();\n }\n } else {\n command = tmpCommand.trim();\n params = tmpParams.trim();\n }\n }\n\n return ({\n pid: pid,\n parentPid: ppid,\n name: _linux ? getName(command) : command,\n cpu: cpu,\n cpuu: 0,\n cpus: 0,\n mem: mem,\n priority: priority,\n memVsz: vsz,\n memRss: rss,\n nice: nice,\n started: started,\n state: state,\n tty: tty,\n user: user,\n command: command,\n params: params,\n path: cmdPath\n });\n }\n\n function parseProcesses(lines) {\n let result = [];\n if (lines.length > 1) {\n let head = lines[0];\n parsedhead = util.parseHead(head, 8);\n lines.shift();\n lines.forEach(function (line) {\n if (line.trim() !== '') {\n result.push(parseLine(line));\n }\n });\n }\n return result;\n }\n function parseProcesses2(lines) {\n\n function formatDateTime(time) {\n const month = ('0' + (time.getMonth() + 1).toString()).substr(-2);\n const year = time.getFullYear().toString();\n const day = ('0' + time.getDay().toString()).substr(-2);\n const hours = time.getHours().toString();\n const mins = time.getMinutes().toString();\n const secs = ('0' + time.getSeconds().toString()).substr(-2);\n\n return (year + '-' + month + '-' + day + ' ' + hours + ':' + mins + ':' + secs);\n }\n\n let result = [];\n lines.forEach(function (line) {\n if (line.trim() !== '') {\n line = line.trim().replace(/ +/g, ' ').replace(/,+/g, '.');\n const parts = line.split(' ');\n const command = parts.slice(9).join(' ');\n const pmem = parseFloat((1.0 * parseInt(parts[3]) * 1024 / os.totalmem()).toFixed(1));\n const elapsed_parts = parts[5].split(':');\n const started = formatDateTime(new Date(Date.now() - (elapsed_parts.length > 1 ? (elapsed_parts[0] * 60 + elapsed_parts[1]) * 1000 : elapsed_parts[0] * 1000)));\n\n result.push({\n pid: parseInt(parts[0]),\n parentPid: parseInt(parts[1]),\n name: getName(command),\n cpu: 0,\n cpuu: 0,\n cpus: 0,\n mem: pmem,\n priority: 0,\n memVsz: parseInt(parts[2]),\n memRss: parseInt(parts[3]),\n nice: parseInt(parts[4]),\n started: started,\n state: (parts[6] === 'R' ? 'running' : (parts[6] === 'S' ? 'sleeping' : (parts[6] === 'T' ? 'stopped' : (parts[6] === 'W' ? 'paging' : (parts[6] === 'X' ? 'dead' : (parts[6] === 'Z' ? 'zombie' : ((parts[6] === 'D' || parts[6] === 'U') ? 'blocked' : 'unknown'))))))),\n tty: parts[7],\n user: parts[8],\n command: command\n });\n }\n });\n return result;\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = {\n all: 0,\n running: 0,\n blocked: 0,\n sleeping: 0,\n unknown: 0,\n list: []\n };\n\n let cmd = '';\n\n if ((_processes_cpu.ms && Date.now() - _processes_cpu.ms >= 500) || _processes_cpu.ms === 0) {\n if (_linux || _freebsd || _openbsd || _netbsd || _darwin || _sunos) {\n if (_linux) { cmd = 'export LC_ALL=C; ps -axo pid:11,ppid:11,pcpu:6,pmem:6,pri:5,vsz:11,rss:11,ni:5,lstart:30,state:5,tty:15,user:20,command; unset LC_ALL'; }\n if (_freebsd || _openbsd || _netbsd) { cmd = 'export LC_ALL=C; ps -axo pid,ppid,pcpu,pmem,pri,vsz,rss,ni,lstart,state,tty,user,command; unset LC_ALL'; }\n if (_darwin) { cmd = 'ps -axo pid,ppid,pcpu,pmem,pri,vsz=xxx_fake_title,rss=fake_title2,nice,lstart,state,tty,user,command -r'; }\n if (_sunos) { cmd = 'ps -Ao pid,ppid,pcpu,pmem,pri,vsz,rss,nice,stime,s,tty,user,comm'; }\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n if (!error && stdout.toString().trim()) {\n result.list = (parseProcesses(stdout.toString().split('\\n'))).slice();\n result.all = result.list.length;\n result.running = result.list.filter(function (e) {\n return e.state === 'running';\n }).length;\n result.blocked = result.list.filter(function (e) {\n return e.state === 'blocked';\n }).length;\n result.sleeping = result.list.filter(function (e) {\n return e.state === 'sleeping';\n }).length;\n\n if (_linux) {\n // calc process_cpu - ps is not accurate in linux!\n cmd = 'cat /proc/stat | grep \"cpu \"';\n for (let i = 0; i < result.list.length; i++) {\n cmd += (';cat /proc/' + result.list[i].pid + '/stat');\n }\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n let curr_processes = stdout.toString().split('\\n');\n\n // first line (all - /proc/stat)\n let all = parseProcStat(curr_processes.shift());\n\n // process\n let list_new = {};\n let resultProcess = {};\n for (let i = 0; i < curr_processes.length; i++) {\n resultProcess = calcProcStatLinux(curr_processes[i], all, _processes_cpu);\n\n if (resultProcess.pid) {\n\n // store pcpu in outer array\n let listPos = result.list.map(function (e) { return e.pid; }).indexOf(resultProcess.pid);\n if (listPos >= 0) {\n result.list[listPos].cpu = resultProcess.cpuu + resultProcess.cpus;\n result.list[listPos].cpuu = resultProcess.cpuu;\n result.list[listPos].cpus = resultProcess.cpus;\n }\n\n // save new values\n list_new[resultProcess.pid] = {\n cpuu: resultProcess.cpuu,\n cpus: resultProcess.cpus,\n utime: resultProcess.utime,\n stime: resultProcess.stime,\n cutime: resultProcess.cutime,\n cstime: resultProcess.cstime\n };\n }\n }\n\n // store old values\n _processes_cpu.all = all;\n // _processes_cpu.list = list_new;\n _processes_cpu.list = Object.assign({}, list_new);\n _processes_cpu.ms = Date.now() - _processes_cpu.ms;\n // _processes_cpu.result = result;\n _processes_cpu.result = Object.assign({}, result);\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n cmd = 'ps -o pid,ppid,vsz,rss,nice,etime,stat,tty,user,comm';\n if (_sunos) {\n cmd = 'ps -o pid,ppid,vsz,rss,nice,etime,s,tty,user,comm';\n }\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.shift();\n\n result.list = parseProcesses2(lines).slice();\n result.all = result.list.length;\n result.running = result.list.filter(function (e) {\n return e.state === 'running';\n }).length;\n result.blocked = result.list.filter(function (e) {\n return e.state === 'blocked';\n }).length;\n result.sleeping = result.list.filter(function (e) {\n return e.state === 'sleeping';\n }).length;\n if (callback) { callback(result); }\n resolve(result);\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n }\n });\n } else if (_windows) {\n try {\n util.powerShell('Get-WmiObject Win32_Process | select ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage,CreationDate | fl').then((stdout, error) => {\n if (!error) {\n let processSections = stdout.split(/\\n\\s*\\n/);\n let procs = [];\n let procStats = [];\n let list_new = {};\n let allcpuu = 0;\n let allcpus = 0;\n // let allcpuu = _processes_cpu.all_utime;\n // let allcpus = _processes_cpu.all_stime;\n for (let i = 0; i < processSections.length; i++) {\n if (processSections[i].trim() !== '') {\n let lines = processSections[i].trim().split('\\r\\n');\n let pid = parseInt(util.getValue(lines, 'ProcessId', ':', true), 10);\n let parentPid = parseInt(util.getValue(lines, 'ParentProcessId', ':', true), 10);\n let statusValue = util.getValue(lines, 'ExecutionState', ':');\n let name = util.getValue(lines, 'Caption', ':', true);\n let commandLine = util.getValue(lines, 'CommandLine', ':', true);\n let commandPath = util.getValue(lines, 'ExecutablePath', ':', true);\n let utime = parseInt(util.getValue(lines, 'UserModeTime', ':', true), 10);\n let stime = parseInt(util.getValue(lines, 'KernelModeTime', ':', true), 10);\n let memw = parseInt(util.getValue(lines, 'WorkingSetSize', ':', true), 10);\n allcpuu = allcpuu + utime;\n allcpus = allcpus + stime;\n // allcpuu += utime - (_processes_cpu.list[pid] ? _processes_cpu.list[pid].utime : 0);\n // allcpus += stime - (_processes_cpu.list[pid] ? _processes_cpu.list[pid].stime : 0);\n result.all++;\n if (!statusValue) { result.unknown++; }\n if (statusValue === '3') { result.running++; }\n if (statusValue === '4' || statusValue === '5') { result.blocked++; }\n\n procStats.push({\n pid: pid,\n utime: utime,\n stime: stime,\n cpu: 0,\n cpuu: 0,\n cpus: 0,\n });\n procs.push({\n pid: pid,\n parentPid: parentPid,\n name: name,\n cpu: 0,\n cpuu: 0,\n cpus: 0,\n mem: memw / os.totalmem() * 100,\n priority: parseInt(util.getValue(lines, 'Priority', ':', true), 10),\n memVsz: parseInt(util.getValue(lines, 'PageFileUsage', ':', true), 10),\n memRss: Math.floor(parseInt(util.getValue(lines, 'WorkingSetSize', ':', true), 10) / 1024),\n nice: 0,\n started: parseTimeWin(util.getValue(lines, 'CreationDate', ':', true)),\n state: (!statusValue ? _winStatusValues[0] : _winStatusValues[statusValue]),\n tty: '',\n user: '',\n command: commandLine || name,\n path: commandPath,\n params: ''\n });\n }\n }\n result.sleeping = result.all - result.running - result.blocked - result.unknown;\n result.list = procs;\n for (let i = 0; i < procStats.length; i++) {\n let resultProcess = calcProcStatWin(procStats[i], allcpuu + allcpus, _processes_cpu);\n\n // store pcpu in outer array\n let listPos = result.list.map(function (e) { return e.pid; }).indexOf(resultProcess.pid);\n if (listPos >= 0) {\n result.list[listPos].cpu = resultProcess.cpuu + resultProcess.cpus;\n result.list[listPos].cpuu = resultProcess.cpuu;\n result.list[listPos].cpus = resultProcess.cpus;\n }\n\n // save new values\n list_new[resultProcess.pid] = {\n cpuu: resultProcess.cpuu,\n cpus: resultProcess.cpus,\n utime: resultProcess.utime,\n stime: resultProcess.stime\n };\n }\n // store old values\n _processes_cpu.all = allcpuu + allcpus;\n _processes_cpu.all_utime = allcpuu;\n _processes_cpu.all_stime = allcpus;\n // _processes_cpu.list = list_new;\n _processes_cpu.list = Object.assign({}, list_new);\n _processes_cpu.ms = Date.now() - _processes_cpu.ms;\n // _processes_cpu.result = result;\n _processes_cpu.result = Object.assign({}, result);\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n if (callback) { callback(_processes_cpu.result); }\n resolve(_processes_cpu.result);\n }\n });\n });\n}\n\nexports.processes = processes;\n\n// --------------------------\n// PS - process load\n// get detailed information about a certain process\n// (PID, CPU-Usage %, Mem-Usage %)\n\nfunction processLoad(proc, callback) {\n\n // fallback - if only callback is given\n if (util.isFunction(proc) && !callback) {\n callback = proc;\n proc = '';\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n proc = proc || '';\n\n if (typeof proc !== 'string') {\n if (callback) { callback([]); }\n return resolve([]);\n }\n\n let processesString = '';\n processesString.__proto__.toLowerCase = util.stringToLower;\n processesString.__proto__.replace = util.stringReplace;\n processesString.__proto__.trim = util.stringTrim;\n\n const s = util.sanitizeShellString(proc);\n for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {\n if (!(s[i] === undefined)) {\n processesString = processesString + s[i];\n }\n }\n\n processesString = processesString.trim().toLowerCase().replace(/, /g, '|').replace(/,+/g, '|');\n if (processesString === '') {\n processesString = '*';\n }\n if (util.isPrototypePolluted() && processesString !== '*') {\n processesString = '------';\n }\n let processes = processesString.split('|');\n let result = [];\n\n const procSanitized = util.isPrototypePolluted() ? '' : util.sanitizeShellString(proc);\n\n // from here new\n // let result = {\n // 'proc': procSanitized,\n // 'pid': null,\n // 'cpu': 0,\n // 'mem': 0\n // };\n if (procSanitized && processes.length && processes[0] !== '------') {\n if (_windows) {\n try {\n util.powerShell('Get-WmiObject Win32_Process | select ProcessId,Caption,UserModeTime,KernelModeTime,WorkingSetSize | fl').then((stdout, error) => {\n if (!error) {\n let processSections = stdout.split(/\\n\\s*\\n/);\n let procStats = [];\n let list_new = {};\n let allcpuu = 0;\n let allcpus = 0;\n // let allcpuu = _process_cpu.all_utime;\n // let allcpus = _process_cpu.all_stime;\n\n // go through all processes\n for (let i = 0; i < processSections.length; i++) {\n if (processSections[i].trim() !== '') {\n let lines = processSections[i].trim().split('\\r\\n');\n let pid = parseInt(util.getValue(lines, 'ProcessId', ':', true), 10);\n let name = util.getValue(lines, 'Caption', ':', true);\n let utime = parseInt(util.getValue(lines, 'UserModeTime', ':', true), 10);\n let stime = parseInt(util.getValue(lines, 'KernelModeTime', ':', true), 10);\n let mem = parseInt(util.getValue(lines, 'WorkingSetSize', ':', true), 10);\n allcpuu = allcpuu + utime;\n allcpus = allcpus + stime;\n // allcpuu += utime - (_process_cpu.list[pid] ? _process_cpu.list[pid].utime : 0);\n // allcpus += stime - (_process_cpu.list[pid] ? _process_cpu.list[pid].stime : 0);\n\n procStats.push({\n pid: pid,\n name,\n utime: utime,\n stime: stime,\n cpu: 0,\n cpuu: 0,\n cpus: 0,\n mem\n });\n let pname = '';\n let inList = false;\n processes.forEach(function (proc) {\n // console.log(proc)\n // console.log(item)\n // inList = inList || item.name.toLowerCase() === proc.toLowerCase();\n if (name.toLowerCase().indexOf(proc.toLowerCase()) >= 0 && !inList) {\n inList = true;\n pname = proc;\n }\n });\n\n if (processesString === '*' || inList) {\n let processFound = false;\n result.forEach(function (item) {\n if (item.proc.toLowerCase() === pname.toLowerCase()) {\n item.pids.push(pid);\n item.mem += mem / os.totalmem() * 100;\n processFound = true;\n }\n });\n if (!processFound) {\n result.push({\n proc: pname,\n pid: pid,\n pids: [pid],\n cpu: 0,\n mem: mem / os.totalmem() * 100\n });\n }\n }\n }\n }\n // add missing processes\n if (processesString !== '*') {\n let processesMissing = processes.filter(function (name) {\n // return procStats.filter(function(item) { return item.name.toLowerCase() === name }).length === 0;\n return procStats.filter(function (item) { return item.name.toLowerCase().indexOf(name) >= 0; }).length === 0;\n\n });\n processesMissing.forEach(function (procName) {\n result.push({\n proc: procName,\n pid: null,\n pids: [],\n cpu: 0,\n mem: 0\n });\n });\n }\n\n // calculate proc stats for each proc\n for (let i = 0; i < procStats.length; i++) {\n let resultProcess = calcProcStatWin(procStats[i], allcpuu + allcpus, _process_cpu);\n\n let listPos = -1;\n for (let j = 0; j < result.length; j++) {\n if (result[j].pid === resultProcess.pid || result[j].pids.indexOf(resultProcess.pid) >= 0) { listPos = j; }\n }\n if (listPos >= 0) {\n result[listPos].cpu += resultProcess.cpuu + resultProcess.cpus;\n }\n\n // save new values\n list_new[resultProcess.pid] = {\n cpuu: resultProcess.cpuu,\n cpus: resultProcess.cpus,\n utime: resultProcess.utime,\n stime: resultProcess.stime\n };\n }\n // store old values\n _process_cpu.all = allcpuu + allcpus;\n _process_cpu.all_utime = allcpuu;\n _process_cpu.all_stime = allcpus;\n // _process_cpu.list = list_new;\n _process_cpu.list = Object.assign({}, list_new);\n _process_cpu.ms = Date.now() - _process_cpu.ms;\n _process_cpu.result = JSON.parse(JSON.stringify(result));\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n\n if (_darwin || _linux || _freebsd || _openbsd || _netbsd) {\n const params = ['-axo', 'pid,pcpu,pmem,comm'];\n util.execSafe('ps', params).then((stdout) => {\n if (stdout) {\n let procStats = [];\n let lines = stdout.toString().split('\\n').filter(function (line) {\n if (processesString === '*') { return true; }\n if (line.toLowerCase().indexOf('grep') !== -1) { return false; } // remove this??\n let found = false;\n processes.forEach(function (item) {\n found = found || (line.toLowerCase().indexOf(item.toLowerCase()) >= 0);\n });\n return found;\n });\n\n lines.forEach(function (line) {\n let data = line.trim().replace(/ +/g, ' ').split(' ');\n if (data.length > 3) {\n procStats.push({\n name: data[3].substring(data[3].lastIndexOf('/') + 1),\n pid: parseInt(data[0]) || 0,\n cpu: parseFloat(data[1].replace(',', '.')),\n mem: parseFloat(data[2].replace(',', '.'))\n });\n }\n });\n\n procStats.forEach(function (item) {\n let listPos = -1;\n let inList = false;\n let name = '';\n for (let j = 0; j < result.length; j++) {\n // if (result[j].proc.toLowerCase() === item.name.toLowerCase()) {\n // if (result[j].proc.toLowerCase().indexOf(item.name.toLowerCase()) >= 0) {\n if (item.name.toLowerCase().indexOf(result[j].proc.toLowerCase()) >= 0) {\n listPos = j;\n }\n }\n // console.log(listPos);\n processes.forEach(function (proc) {\n // console.log(proc)\n // console.log(item)\n // inList = inList || item.name.toLowerCase() === proc.toLowerCase();\n if (item.name.toLowerCase().indexOf(proc.toLowerCase()) >= 0 && !inList) {\n inList = true;\n name = proc;\n }\n });\n // console.log(item);\n // console.log(listPos);\n if ((processesString === '*') || inList) {\n if (listPos < 0) {\n result.push({\n proc: name,\n pid: item.pid,\n pids: [item.pid],\n cpu: item.cpu,\n mem: item.mem\n });\n } else {\n result[listPos].pids.push(item.pid);\n result[listPos].cpu += item.cpu;\n result[listPos].mem += item.mem;\n }\n }\n });\n\n if (processesString !== '*') {\n // add missing processes\n let processesMissing = processes.filter(function (name) {\n return procStats.filter(function (item) { return item.name.toLowerCase().indexOf(name) >= 0; }).length === 0;\n });\n processesMissing.forEach(function (procName) {\n result.push({\n proc: procName,\n pid: null,\n pids: [],\n cpu: 0,\n mem: 0\n });\n });\n }\n if (_linux) {\n // calc process_cpu - ps is not accurate in linux!\n result.forEach(function (item) {\n item.cpu = 0;\n });\n let cmd = 'cat /proc/stat | grep \"cpu \"';\n for (let i in result) {\n for (let j in result[i].pids) {\n cmd += (';cat /proc/' + result[i].pids[j] + '/stat');\n }\n }\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n let curr_processes = stdout.toString().split('\\n');\n\n // first line (all - /proc/stat)\n let all = parseProcStat(curr_processes.shift());\n\n // process\n let list_new = {};\n let resultProcess = {};\n\n for (let i = 0; i < curr_processes.length; i++) {\n resultProcess = calcProcStatLinux(curr_processes[i], all, _process_cpu);\n\n if (resultProcess.pid) {\n\n // find result item\n let resultItemId = -1;\n for (let i in result) {\n if (result[i].pids.indexOf(resultProcess.pid) >= 0) {\n resultItemId = i;\n }\n }\n // store pcpu in outer result\n if (resultItemId >= 0) {\n result[resultItemId].cpu += resultProcess.cpuu + resultProcess.cpus;\n }\n\n // save new values\n list_new[resultProcess.pid] = {\n cpuu: resultProcess.cpuu,\n cpus: resultProcess.cpus,\n utime: resultProcess.utime,\n stime: resultProcess.stime,\n cutime: resultProcess.cutime,\n cstime: resultProcess.cstime\n };\n }\n }\n\n result.forEach(function (item) {\n item.cpu = Math.round(item.cpu * 100) / 100;\n });\n\n _process_cpu.all = all;\n // _process_cpu.list = list_new;\n _process_cpu.list = Object.assign({}, list_new);\n _process_cpu.ms = Date.now() - _process_cpu.ms;\n // _process_cpu.result = result;\n _process_cpu.result = Object.assign({}, result);\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n }\n }\n });\n });\n}\n\nexports.processLoad = processLoad;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// system.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 2. System (Hardware, BIOS, Base Board)\n// ----------------------------------------------------------------------------------\n\nconst fs = require('fs');\nconst os = require('os');\nconst util = require('./util');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst execPromise = util.promisify(require('child_process').exec);\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nfunction system(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = {\n manufacturer: '',\n model: 'Computer',\n version: '',\n serial: '-',\n uuid: '-',\n sku: '-',\n virtual: false\n };\n\n if (_linux || _freebsd || _openbsd || _netbsd) {\n exec('export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL', function (error, stdout) {\n // if (!error) {\n let lines = stdout.toString().split('\\n');\n result.manufacturer = util.getValue(lines, 'manufacturer');\n result.model = util.getValue(lines, 'product name');\n result.version = util.getValue(lines, 'version');\n result.serial = util.getValue(lines, 'serial number');\n result.uuid = util.getValue(lines, 'uuid').toLowerCase();\n result.sku = util.getValue(lines, 'sku number');\n // }\n // Non-Root values\n const cmd = `echo -n \"product_name: \"; cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null; echo;\n echo -n \"product_serial: \"; cat /sys/devices/virtual/dmi/id/product_serial 2>/dev/null; echo;\n echo -n \"product_uuid: \"; cat /sys/devices/virtual/dmi/id/product_uuid 2>/dev/null; echo;\n echo -n \"product_version: \"; cat /sys/devices/virtual/dmi/id/product_version 2>/dev/null; echo;\n echo -n \"sys_vendor: \"; cat /sys/devices/virtual/dmi/id/sys_vendor 2>/dev/null; echo;`;\n try {\n lines = execSync(cmd).toString().split('\\n');\n result.manufacturer = result.manufacturer === '' ? util.getValue(lines, 'sys_vendor') : result.manufacturer;\n result.model = result.model === '' ? util.getValue(lines, 'product_name') : result.model;\n result.version = result.version === '' ? util.getValue(lines, 'product_version') : result.version;\n result.serial = result.serial === '' ? util.getValue(lines, 'product_serial') : result.serial;\n result.uuid = result.uuid === '' ? util.getValue(lines, 'product_uuid').toLowerCase() : result.uuid;\n } catch (e) {\n util.noop();\n }\n if (!result.serial || result.serial.toLowerCase().indexOf('o.e.m.') !== -1) { result.serial = '-'; }\n if (!result.manufacturer || result.manufacturer.toLowerCase().indexOf('o.e.m.') !== -1) { result.manufacturer = ''; }\n if (!result.model || result.model.toLowerCase().indexOf('o.e.m.') !== -1) { result.model = 'Computer'; }\n if (!result.version || result.version.toLowerCase().indexOf('o.e.m.') !== -1) { result.version = ''; }\n if (!result.sku || result.sku.toLowerCase().indexOf('o.e.m.') !== -1) { result.sku = '-'; }\n\n // detect virtual (1)\n if (result.model.toLowerCase() === 'virtualbox' || result.model.toLowerCase() === 'kvm' || result.model.toLowerCase() === 'virtual machine' || result.model.toLowerCase() === 'bochs' || result.model.toLowerCase().startsWith('vmware') || result.model.toLowerCase().startsWith('droplet')) {\n result.virtual = true;\n switch (result.model.toLowerCase()) {\n case 'virtualbox':\n result.virtualHost = 'VirtualBox';\n break;\n case 'vmware':\n result.virtualHost = 'VMware';\n break;\n case 'kvm':\n result.virtualHost = 'KVM';\n break;\n case 'bochs':\n result.virtualHost = 'bochs';\n break;\n }\n }\n if (result.manufacturer.toLowerCase().startsWith('vmware') || result.manufacturer.toLowerCase() === 'xen') {\n result.virtual = true;\n switch (result.manufacturer.toLowerCase()) {\n case 'vmware':\n result.virtualHost = 'VMware';\n break;\n case 'xen':\n result.virtualHost = 'Xen';\n break;\n }\n }\n if (!result.virtual) {\n try {\n const disksById = execSync('ls -1 /dev/disk/by-id/ 2>/dev/null').toString();\n if (disksById.indexOf('_QEMU_') >= 0) {\n result.virtual = true;\n result.virtualHost = 'QEMU';\n }\n if (disksById.indexOf('_VBOX_') >= 0) {\n result.virtual = true;\n result.virtualHost = 'VirtualBox';\n }\n } catch (e) {\n util.noop();\n }\n }\n if (!result.virtual && (os.release().toLowerCase().indexOf('microsoft') >= 0 || os.release().toLowerCase().endsWith('wsl2'))) {\n const kernelVersion = parseFloat(os.release().toLowerCase());\n result.virtual = true;\n result.manufacturer = 'Microsoft';\n result.model = 'WSL';\n result.version = kernelVersion < 4.19 ? '1' : '2';\n }\n if ((_freebsd || _openbsd || _netbsd) && !result.virtualHost) {\n try {\n const procInfo = execSync('dmidecode -t 4');\n const procLines = procInfo.toString().split('\\n');\n const procManufacturer = util.getValue(procLines, 'manufacturer', ':', true);\n switch (procManufacturer.toLowerCase()) {\n case 'virtualbox':\n result.virtualHost = 'VirtualBox';\n break;\n case 'vmware':\n result.virtualHost = 'VMware';\n break;\n case 'kvm':\n result.virtualHost = 'KVM';\n break;\n case 'bochs':\n result.virtualHost = 'bochs';\n break;\n }\n } catch (e) {\n util.noop();\n }\n }\n // detect docker\n if (fs.existsSync('/.dockerenv') || fs.existsSync('/.dockerinit')) {\n result.model = 'Docker Container';\n }\n try {\n const stdout = execSync('dmesg 2>/dev/null | grep -iE \"virtual|hypervisor\" | grep -iE \"vmware|qemu|kvm|xen\" | grep -viE \"Nested Virtualization|/virtual/\"');\n // detect virtual machines\n let lines = stdout.toString().split('\\n');\n if (lines.length > 0) {\n if (result.model === 'Computer') { result.model = 'Virtual machine'; }\n result.virtual = true;\n if (stdout.toString().toLowerCase().indexOf('vmware') >= 0 && !result.virtualHost) {\n result.virtualHost = 'VMware';\n }\n if (stdout.toString().toLowerCase().indexOf('qemu') >= 0 && !result.virtualHost) {\n result.virtualHost = 'QEMU';\n }\n if (stdout.toString().toLowerCase().indexOf('xen') >= 0 && !result.virtualHost) {\n result.virtualHost = 'Xen';\n }\n if (stdout.toString().toLowerCase().indexOf('kvm') >= 0 && !result.virtualHost) {\n result.virtualHost = 'KVM';\n }\n }\n } catch (e) {\n util.noop();\n }\n\n if (result.manufacturer === '' && result.model === 'Computer' && result.version === '') {\n // Check Raspberry Pi\n fs.readFile('/proc/cpuinfo', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n result.model = util.getValue(lines, 'hardware', ':', true).toUpperCase();\n result.version = util.getValue(lines, 'revision', ':', true).toLowerCase();\n result.serial = util.getValue(lines, 'serial', ':', true);\n const model = util.getValue(lines, 'model:', ':', true);\n // reference values: https://elinux.org/RPi_HardwareHistory\n // https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md\n if ((result.model === 'BCM2835' || result.model === 'BCM2708' || result.model === 'BCM2709' || result.model === 'BCM2710' || result.model === 'BCM2711' || result.model === 'BCM2836' || result.model === 'BCM2837') && model.toLowerCase().indexOf('raspberry') >= 0) {\n const rPIRevision = util.decodePiCpuinfo(lines);\n result.model = rPIRevision.model;\n result.version = rPIRevision.revisionCode;\n result.manufacturer = 'Raspberry Pi Foundation';\n result.raspberry = {\n manufacturer: rPIRevision.manufacturer,\n processor: rPIRevision.processor,\n type: rPIRevision.type,\n revision: rPIRevision.revision\n };\n }\n\n // if (result.model === 'BCM2835' || result.model === 'BCM2708' || result.model === 'BCM2709' || result.model === 'BCM2835' || result.model === 'BCM2837') {\n\n\n // // Pi 4\n // if (['d03114'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 4 Model B';\n // result.version = result.version + ' - Rev. 1.4';\n // }\n // if (['b03112', 'c03112'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 4 Model B';\n // result.version = result.version + ' - Rev. 1.2';\n // }\n // if (['a03111', 'b03111', 'c03111'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 4 Model B';\n // result.version = result.version + ' - Rev. 1.1';\n // }\n // // Pi 3\n // if (['a02082', 'a22082', 'a32082', 'a52082'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 3 Model B';\n // result.version = result.version + ' - Rev. 1.2';\n // }\n // if (['a22083'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 3 Model B';\n // result.version = result.version + ' - Rev. 1.3';\n // }\n // if (['a020d3'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 3 Model B+';\n // result.version = result.version + ' - Rev. 1.3';\n // }\n // if (['9020e0'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 3 Model A+';\n // result.version = result.version + ' - Rev. 1.3';\n // }\n // // Pi 2 Model B\n // if (['a01040'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 2 Model B';\n // result.version = result.version + ' - Rev. 1.0';\n // }\n // if (['a01041', 'a21041'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 2 Model B';\n // result.version = result.version + ' - Rev. 1.1';\n // }\n // if (['a22042', 'a02042'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 2 Model B';\n // result.version = result.version + ' - Rev. 1.2';\n // }\n\n // // Compute Model\n // if (['a02100'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi CM3+';\n // result.version = result.version + ' - Rev 1.0';\n // }\n // if (['a020a0', 'a220a0'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi CM3';\n // result.version = result.version + ' - Rev 1.0';\n // }\n // if (['900061'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi CM';\n // result.version = result.version + ' - Rev 1.1';\n // }\n\n // // Pi Zero\n // if (['900092', '920092'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Zero';\n // result.version = result.version + ' - Rev 1.2';\n // }\n // if (['900093', '920093'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Zero';\n // result.version = result.version + ' - Rev 1.3';\n // }\n // if (['9000c1'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Zero W';\n // result.version = result.version + ' - Rev 1.1';\n // }\n\n // // A, B, A+ B+\n // if (['0002', '0003'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Model B';\n // result.version = result.version + ' - Rev 1.0';\n // }\n // if (['0004', '0005', '0006', '000d', '000e', '000f'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Model B';\n // result.version = result.version + ' - Rev 2.0';\n // }\n // if (['0007', '0008', '0009'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Model A';\n // result.version = result.version + ' - Rev 2.0';\n // }\n // if (['0010'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Model B+';\n // result.version = result.version + ' - Rev 1.0';\n // }\n // if (['0012'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Model A+';\n // result.version = result.version + ' - Rev 1.0';\n // }\n // if (['0013', '900032'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Model B+';\n // result.version = result.version + ' - Rev 1.2';\n // }\n // if (['0015', '900021'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Model A+';\n // result.version = result.version + ' - Rev 1.1';\n // }\n // if (result.model.indexOf('Pi') !== -1 && result.version) { // Pi, Pi Zero\n // result.manufacturer = 'Raspberry Pi Foundation';\n // }\n // }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n }\n if (_darwin) {\n exec('ioreg -c IOPlatformExpertDevice -d 2', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().replace(/[<>\"]/g, '').split('\\n');\n result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);\n result.model = util.getValue(lines, 'model', '=', true);\n result.version = util.getValue(lines, 'version', '=', true);\n result.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true);\n result.uuid = util.getValue(lines, 'ioplatformuuid', '=', true).toLowerCase();\n result.sku = util.getValue(lines, 'board-id', '=', true);\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n try {\n util.powerShell('Get-WmiObject Win32_ComputerSystemProduct | select Name,Vendor,Version,IdentifyingNumber,UUID | fl').then((stdout, error) => {\n if (!error) {\n // let lines = stdout.split('\\r\\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0)[0].trim().split(/\\s\\s+/);\n let lines = stdout.split('\\r\\n');\n result.manufacturer = util.getValue(lines, 'vendor', ':');\n result.model = util.getValue(lines, 'name', ':');\n result.version = util.getValue(lines, 'version', ':');\n result.serial = util.getValue(lines, 'identifyingnumber', ':');\n result.uuid = util.getValue(lines, 'uuid', ':').toLowerCase();\n // detect virtual (1)\n const model = result.model.toLowerCase();\n if (model === 'virtualbox' || model === 'kvm' || model === 'virtual machine' || model === 'bochs' || model.startsWith('vmware') || model.startsWith('qemu')) {\n result.virtual = true;\n if (model.startsWith('virtualbox')) { result.virtualHost = 'VirtualBox'; }\n if (model.startsWith('vmware')) { result.virtualHost = 'VMware'; }\n if (model.startsWith('kvm')) { result.virtualHost = 'KVM'; }\n if (model.startsWith('bochs')) { result.virtualHost = 'bochs'; }\n if (model.startsWith('qemu')) { result.virtualHost = 'KVM'; }\n }\n const manufacturer = result.manufacturer.toLowerCase();\n if (manufacturer.startsWith('vmware') || manufacturer.startsWith('qemu') || manufacturer === 'xen') {\n result.virtual = true;\n if (manufacturer.startsWith('vmware')) { result.virtualHost = 'VMware'; }\n if (manufacturer.startsWith('xen')) { result.virtualHost = 'Xen'; }\n if (manufacturer.startsWith('qemu')) { result.virtualHost = 'KVM'; }\n }\n util.powerShell('Get-WmiObject MS_Systeminformation -Namespace \"root/wmi\" | select systemsku | fl ').then((stdout, error) => {\n if (!error) {\n let lines = stdout.split('\\r\\n');\n result.sku = util.getValue(lines, 'systemsku', ':');\n }\n if (!result.virtual) {\n util.powerShell('Get-WmiObject Win32_bios | select Version, SerialNumber, SMBIOSBIOSVersion').then((stdout, error) => {\n if (!error) {\n let lines = stdout.toString();\n if (lines.indexOf('VRTUAL') >= 0 || lines.indexOf('A M I ') >= 0 || lines.indexOf('VirtualBox') >= 0 || lines.indexOf('VMWare') >= 0 || lines.indexOf('Xen') >= 0) {\n result.virtual = true;\n if (lines.indexOf('VirtualBox') >= 0 && !result.virtualHost) {\n result.virtualHost = 'VirtualBox';\n }\n if (lines.indexOf('VMware') >= 0 && !result.virtualHost) {\n result.virtualHost = 'VMware';\n }\n if (lines.indexOf('Xen') >= 0 && !result.virtualHost) {\n result.virtualHost = 'Xen';\n }\n if (lines.indexOf('VRTUAL') >= 0 && !result.virtualHost) {\n result.virtualHost = 'Hyper-V';\n }\n if (lines.indexOf('A M I') >= 0 && !result.virtualHost) {\n result.virtualHost = 'Virtual PC';\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.system = system;\n\nfunction bios(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = {\n vendor: '',\n version: '',\n releaseDate: '',\n revision: '',\n };\n let cmd = '';\n if (_linux || _freebsd || _openbsd || _netbsd) {\n if (process.arch === 'arm') {\n cmd = 'cat /proc/cpuinfo | grep Serial';\n } else {\n cmd = 'export LC_ALL=C; dmidecode -t bios 2>/dev/null; unset LC_ALL';\n }\n exec(cmd, function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n result.vendor = util.getValue(lines, 'Vendor');\n result.version = util.getValue(lines, 'Version');\n let datetime = util.getValue(lines, 'Release Date');\n result.releaseDate = util.parseDateTime(datetime).date;\n result.revision = util.getValue(lines, 'BIOS Revision');\n result.serial = util.getValue(lines, 'SerialNumber');\n let language = util.getValue(lines, 'Currently Installed Language').split('|')[0];\n if (language) {\n result.language = language;\n }\n if (lines.length && stdout.toString().indexOf('Characteristics:') >= 0) {\n const features = [];\n lines.forEach(line => {\n if (line.indexOf(' is supported') >= 0) {\n const feature = line.split(' is supported')[0].trim();\n features.push(feature);\n }\n });\n result.features = features;\n }\n // Non-Root values\n const cmd = `echo -n \"bios_date: \"; cat /sys/devices/virtual/dmi/id/bios_date 2>/dev/null; echo;\n echo -n \"bios_vendor: \"; cat /sys/devices/virtual/dmi/id/bios_vendor 2>/dev/null; echo;\n echo -n \"bios_version: \"; cat /sys/devices/virtual/dmi/id/bios_version 2>/dev/null; echo;`;\n try {\n lines = execSync(cmd).toString().split('\\n');\n result.vendor = !result.vendor ? util.getValue(lines, 'bios_vendor') : result.vendor;\n result.version = !result.version ? util.getValue(lines, 'bios_version') : result.version;\n datetime = util.getValue(lines, 'bios_date');\n result.releaseDate = !result.releaseDate ? util.parseDateTime(datetime).date : result.releaseDate;\n } catch (e) {\n util.noop();\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_darwin) {\n result.vendor = 'Apple Inc.';\n exec(\n 'system_profiler SPHardwareDataType -json', function (error, stdout) {\n try {\n const hardwareData = JSON.parse(stdout.toString());\n if (hardwareData && hardwareData.SPHardwareDataType && hardwareData.SPHardwareDataType.length) {\n let bootRomVersion = hardwareData.SPHardwareDataType[0].boot_rom_version;\n bootRomVersion = bootRomVersion ? bootRomVersion.split('(')[0].trim() : null;\n result.version = bootRomVersion;\n }\n } catch (e) {\n util.noop();\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n result.vendor = 'Sun Microsystems';\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n try {\n util.powerShell('Get-WmiObject Win32_bios | select Description,Version,Manufacturer,ReleaseDate,BuildNumber,SerialNumber | fl').then((stdout, error) => {\n if (!error) {\n let lines = stdout.toString().split('\\r\\n');\n const description = util.getValue(lines, 'description', ':');\n if (description.indexOf(' Version ') !== -1) {\n // ... Phoenix ROM BIOS PLUS Version 1.10 A04\n result.vendor = description.split(' Version ')[0].trim();\n result.version = description.split(' Version ')[1].trim();\n } else if (description.indexOf(' Ver: ') !== -1) {\n // ... BIOS Date: 06/27/16 17:50:16 Ver: 1.4.5\n result.vendor = util.getValue(lines, 'manufacturer', ':');\n result.version = description.split(' Ver: ')[1].trim();\n } else {\n result.vendor = util.getValue(lines, 'manufacturer', ':');\n result.version = util.getValue(lines, 'version', ':');\n }\n result.releaseDate = util.getValue(lines, 'releasedate', ':');\n if (result.releaseDate.length >= 10) {\n result.releaseDate = result.releaseDate.substr(0, 4) + '-' + result.releaseDate.substr(4, 2) + '-' + result.releaseDate.substr(6, 2);\n }\n result.revision = util.getValue(lines, 'buildnumber', ':');\n result.serial = util.getValue(lines, 'serialnumber', ':');\n }\n\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.bios = bios;\n\nfunction baseboard(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = {\n manufacturer: '',\n model: '',\n version: '',\n serial: '-',\n assetTag: '-',\n memMax: null,\n memSlots: null\n };\n let cmd = '';\n if (_linux || _freebsd || _openbsd || _netbsd) {\n if (process.arch === 'arm') {\n cmd = 'cat /proc/cpuinfo | grep Serial';\n // 'BCM2709', 'BCM2835', 'BCM2708' -->\n } else {\n cmd = 'export LC_ALL=C; dmidecode -t 2 2>/dev/null; unset LC_ALL';\n }\n const workload = [];\n workload.push(execPromise(cmd));\n workload.push(execPromise('export LC_ALL=C; dmidecode -t memory 2>/dev/null'));\n util.promiseAll(\n workload\n ).then(data => {\n let lines = data.results[0] ? data.results[0].toString().split('\\n') : [''];\n result.manufacturer = util.getValue(lines, 'Manufacturer');\n result.model = util.getValue(lines, 'Product Name');\n result.version = util.getValue(lines, 'Version');\n result.serial = util.getValue(lines, 'Serial Number');\n result.assetTag = util.getValue(lines, 'Asset Tag');\n // Non-Root values\n const cmd = `echo -n \"board_asset_tag: \"; cat /sys/devices/virtual/dmi/id/board_asset_tag 2>/dev/null; echo;\n echo -n \"board_name: \"; cat /sys/devices/virtual/dmi/id/board_name 2>/dev/null; echo;\n echo -n \"board_serial: \"; cat /sys/devices/virtual/dmi/id/board_serial 2>/dev/null; echo;\n echo -n \"board_vendor: \"; cat /sys/devices/virtual/dmi/id/board_vendor 2>/dev/null; echo;\n echo -n \"board_version: \"; cat /sys/devices/virtual/dmi/id/board_version 2>/dev/null; echo;`;\n try {\n lines = execSync(cmd).toString().split('\\n');\n result.manufacturer = !result.manufacturer ? util.getValue(lines, 'board_vendor') : result.manufacturer;\n result.model = !result.model ? util.getValue(lines, 'board_name') : result.model;\n result.version = !result.version ? util.getValue(lines, 'board_version') : result.version;\n result.serial = !result.serial ? util.getValue(lines, 'board_serial') : result.serial;\n result.assetTag = !result.assetTag ? util.getValue(lines, 'board_asset_tag') : result.assetTag;\n } catch (e) {\n util.noop();\n }\n if (result.serial.toLowerCase().indexOf('o.e.m.') !== -1) { result.serial = '-'; }\n if (result.assetTag.toLowerCase().indexOf('o.e.m.') !== -1) { result.assetTag = '-'; }\n\n // mem\n lines = data.results[1] ? data.results[1].toString().split('\\n') : [''];\n result.memMax = util.toInt(util.getValue(lines, 'Maximum Capacity')) * 1024 * 1024 * 1024 || null;\n result.memSlots = util.toInt(util.getValue(lines, 'Number Of Devices')) || null;\n\n // raspberry\n let linesRpi = '';\n try {\n linesRpi = fs.readFileSync('/proc/cpuinfo').toString().split('\\n');\n } catch (e) {\n util.noop();\n }\n const hardware = util.getValue(linesRpi, 'hardware');\n if (hardware.startsWith('BCM')) {\n const rpi = util.decodePiCpuinfo(linesRpi);\n result.manufacturer = rpi.manufacturer;\n result.model = 'Raspberry Pi';\n result.serial = rpi.serial;\n result.version = rpi.type + ' - ' + rpi.revision;\n result.memMax = os.totalmem();\n result.memSlots = 0;\n }\n\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_darwin) {\n const workload = [];\n workload.push(execPromise('ioreg -c IOPlatformExpertDevice -d 2'));\n workload.push(execPromise('system_profiler SPMemoryDataType'));\n util.promiseAll(\n workload\n ).then(data => {\n let lines = data.results[0] ? data.results[0].toString().replace(/[<>\"]/g, '').split('\\n') : [''];\n result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);\n result.model = util.getValue(lines, 'model', '=', true);\n result.version = util.getValue(lines, 'version', '=', true);\n result.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true);\n result.assetTag = util.getValue(lines, 'board-id', '=', true);\n\n // mem\n let devices = data.results[1] ? data.results[1].toString().split(' BANK ') : [''];\n if (devices.length === 1) {\n devices = data.results[1] ? data.results[1].toString().split(' DIMM') : [''];\n }\n devices.shift();\n result.memSlots = devices.length;\n\n if (os.arch() === 'arm64') {\n result.memSlots = 0;\n result.memMax = os.totalmem();\n }\n\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n try {\n const workload = [];\n workload.push(util.powerShell('Get-WmiObject Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl'));\n workload.push(util.powerShell('Get-WmiObject Win32_physicalmemoryarray | select MaxCapacity, MemoryDevices | fl'));\n util.promiseAll(\n workload\n ).then(data => {\n let lines = data.results[0] ? data.results[0].toString().split('\\r\\n') : [''];\n\n result.manufacturer = util.getValue(lines, 'manufacturer', ':');\n result.model = util.getValue(lines, 'model', ':');\n if (!result.model) {\n result.model = util.getValue(lines, 'product', ':');\n }\n result.version = util.getValue(lines, 'version', ':');\n result.serial = util.getValue(lines, 'serialnumber', ':');\n result.assetTag = util.getValue(lines, 'partnumber', ':');\n if (!result.assetTag) {\n result.assetTag = util.getValue(lines, 'sku', ':');\n }\n\n // memphysical\n lines = data.results[1] ? data.results[1].toString().split('\\r\\n') : [''];\n result.memMax = util.toInt(util.getValue(lines, 'MaxCapacity', ':')) || null;\n result.memSlots = util.toInt(util.getValue(lines, 'MemoryDevices', ':')) || null;\n\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.baseboard = baseboard;\n\nfunction chassis(callback) {\n const chassisTypes = ['Other',\n 'Unknown',\n 'Desktop',\n 'Low Profile Desktop',\n 'Pizza Box',\n 'Mini Tower',\n 'Tower',\n 'Portable',\n 'Laptop',\n 'Notebook',\n 'Hand Held',\n 'Docking Station',\n 'All in One',\n 'Sub Notebook',\n 'Space-Saving',\n 'Lunch Box',\n 'Main System Chassis',\n 'Expansion Chassis',\n 'SubChassis',\n 'Bus Expansion Chassis',\n 'Peripheral Chassis',\n 'Storage Chassis',\n 'Rack Mount Chassis',\n 'Sealed-Case PC',\n 'Multi-System Chassis',\n 'Compact PCI',\n 'Advanced TCA',\n 'Blade',\n 'Blade Enclosure',\n 'Tablet',\n 'Convertible',\n 'Detachable',\n 'IoT Gateway ',\n 'Embedded PC',\n 'Mini PC',\n 'Stick PC',\n ];\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = {\n manufacturer: '',\n model: '',\n type: '',\n version: '',\n serial: '-',\n assetTag: '-',\n sku: '',\n };\n if (_linux || _freebsd || _openbsd || _netbsd) {\n const cmd = `echo -n \"chassis_asset_tag: \"; cat /sys/devices/virtual/dmi/id/chassis_asset_tag 2>/dev/null; echo;\n echo -n \"chassis_serial: \"; cat /sys/devices/virtual/dmi/id/chassis_serial 2>/dev/null; echo;\n echo -n \"chassis_type: \"; cat /sys/devices/virtual/dmi/id/chassis_type 2>/dev/null; echo;\n echo -n \"chassis_vendor: \"; cat /sys/devices/virtual/dmi/id/chassis_vendor 2>/dev/null; echo;\n echo -n \"chassis_version: \"; cat /sys/devices/virtual/dmi/id/chassis_version 2>/dev/null; echo;`;\n exec(cmd, function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n result.manufacturer = util.getValue(lines, 'chassis_vendor');\n const ctype = parseInt(util.getValue(lines, 'chassis_type').replace(/\\D/g, ''));\n result.type = (ctype && !isNaN(ctype) && ctype < chassisTypes.length) ? chassisTypes[ctype - 1] : '';\n result.version = util.getValue(lines, 'chassis_version');\n result.serial = util.getValue(lines, 'chassis_serial');\n result.assetTag = util.getValue(lines, 'chassis_asset_tag');\n if (result.manufacturer.toLowerCase().indexOf('o.e.m.') !== -1) { result.manufacturer = '-'; }\n if (result.version.toLowerCase().indexOf('o.e.m.') !== -1) { result.version = '-'; }\n if (result.serial.toLowerCase().indexOf('o.e.m.') !== -1) { result.serial = '-'; }\n if (result.assetTag.toLowerCase().indexOf('o.e.m.') !== -1) { result.assetTag = '-'; }\n\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_darwin) {\n exec('ioreg -c IOPlatformExpertDevice -d 2', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().replace(/[<>\"]/g, '').split('\\n');\n result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);\n result.model = util.getValue(lines, 'model', '=', true);\n result.version = util.getValue(lines, 'version', '=', true);\n result.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true);\n result.assetTag = util.getValue(lines, 'board-id', '=', true);\n }\n\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n try {\n util.powerShell('Get-WmiObject Win32_SystemEnclosure | select Model,Manufacturer,ChassisTypes,Version,SerialNumber,PartNumber,SKU | fl').then((stdout, error) => {\n if (!error) {\n let lines = stdout.toString().split('\\r\\n');\n\n result.manufacturer = util.getValue(lines, 'manufacturer', ':');\n result.model = util.getValue(lines, 'model', ':');\n const ctype = parseInt(util.getValue(lines, 'ChassisTypes', ':').replace(/\\D/g, ''));\n result.type = (ctype && !isNaN(ctype) && ctype < chassisTypes.length) ? chassisTypes[ctype - 1] : '';\n result.version = util.getValue(lines, 'version', ':');\n result.serial = util.getValue(lines, 'serialnumber', ':');\n result.assetTag = util.getValue(lines, 'partnumber', ':');\n result.sku = util.getValue(lines, 'sku', ':');\n if (result.manufacturer.toLowerCase().indexOf('o.e.m.') !== -1) { result.manufacturer = '-'; }\n if (result.version.toLowerCase().indexOf('o.e.m.') !== -1) { result.version = '-'; }\n if (result.serial.toLowerCase().indexOf('o.e.m.') !== -1) { result.serial = '-'; }\n if (result.assetTag.toLowerCase().indexOf('o.e.m.') !== -1) { result.assetTag = '-'; }\n }\n\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.chassis = chassis;\n\n","'use strict';\n// @ts-check\n// ==================================================================================\n// usb.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 16. usb\n// ----------------------------------------------------------------------------------\n\nconst exec = require('child_process').exec;\n// const execSync = require('child_process').execSync;\nconst util = require('./util');\n// const fs = require('fs');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nfunction getLinuxUsbType(type, name) {\n let result = type;\n const str = (name + ' ' + type).toLowerCase();\n if (str.indexOf('camera') >= 0) { result = 'Camera'; }\n else if (str.indexOf('hub') >= 0) { result = 'Hub'; }\n else if (str.indexOf('keybrd') >= 0) { result = 'Keyboard'; }\n else if (str.indexOf('keyboard') >= 0) { result = 'Keyboard'; }\n else if (str.indexOf('mouse') >= 0) { result = 'Mouse'; }\n else if (str.indexOf('stora') >= 0) { result = 'Storage'; }\n else if (str.indexOf('mic') >= 0) { result = 'Microphone'; }\n else if (str.indexOf('headset') >= 0) { result = 'Audio'; }\n else if (str.indexOf('audio') >= 0) { result = 'Audio'; }\n\n return result;\n}\n\nfunction parseLinuxUsb(usb) {\n const result = {};\n const lines = usb.split('\\n');\n if (lines && lines.length && lines[0].indexOf('Device') >= 0) {\n const parts = lines[0].split(' ');\n result.bus = parseInt(parts[0], 10);\n if (parts[2]) {\n result.deviceId = parseInt(parts[2], 10);\n } else {\n result.deviceId = null;\n }\n } else {\n result.bus = null;\n result.deviceId = null;\n }\n const idVendor = util.getValue(lines, 'idVendor', ' ', true).trim();\n let vendorParts = idVendor.split(' ');\n vendorParts.shift();\n const vendor = vendorParts.join(' ');\n\n const idProduct = util.getValue(lines, 'idProduct', ' ', true).trim();\n let productParts = idProduct.split(' ');\n productParts.shift();\n const product = productParts.join(' ');\n\n const interfaceClass = util.getValue(lines, 'bInterfaceClass', ' ', true).trim();\n let interfaceClassParts = interfaceClass.split(' ');\n interfaceClassParts.shift();\n const usbType = interfaceClassParts.join(' ');\n\n const iManufacturer = util.getValue(lines, 'iManufacturer', ' ', true).trim();\n let iManufacturerParts = iManufacturer.split(' ');\n iManufacturerParts.shift();\n const manufacturer = iManufacturerParts.join(' ');\n\n result.id = (idVendor.startsWith('0x') ? idVendor.split(' ')[0].substr(2, 10) : '') + ':' + (idProduct.startsWith('0x') ? idProduct.split(' ')[0].substr(2, 10) : '');\n result.name = product;\n result.type = getLinuxUsbType(usbType, product);\n result.removable = null;\n result.vendor = vendor;\n result.manufacturer = manufacturer;\n result.maxPower = util.getValue(lines, 'MaxPower', ' ', true);\n result.serialNumber = null;\n\n return result;\n}\n\n// bus\n// deviceId\n// id\n// name(product)\n// type(bInterfaceClass)\n// removable / hotplug\n// vendor\n// manufacturer\n// maxpower(linux)\n\nfunction getDarwinUsbType(name) {\n let result = '';\n if (name.indexOf('camera') >= 0) { result = 'Camera'; }\n else if (name.indexOf('touch bar') >= 0) { result = 'Touch Bar'; }\n else if (name.indexOf('controller') >= 0) { result = 'Controller'; }\n else if (name.indexOf('headset') >= 0) { result = 'Audio'; }\n else if (name.indexOf('keyboard') >= 0) { result = 'Keyboard'; }\n else if (name.indexOf('trackpad') >= 0) { result = 'Trackpad'; }\n else if (name.indexOf('sensor') >= 0) { result = 'Sensor'; }\n else if (name.indexOf('bthusb') >= 0) { result = 'Bluetooth'; }\n else if (name.indexOf('bth') >= 0) { result = 'Bluetooth'; }\n else if (name.indexOf('rfcomm') >= 0) { result = 'Bluetooth'; }\n else if (name.indexOf('usbhub') >= 0) { result = 'Hub'; }\n else if (name.indexOf(' hub') >= 0) { result = 'Hub'; }\n else if (name.indexOf('mouse') >= 0) { result = 'Mouse'; }\n else if (name.indexOf('mic') >= 0) { result = 'Microphone'; }\n else if (name.indexOf('removable') >= 0) { result = 'Storage'; }\n return result;\n}\n\n\nfunction parseDarwinUsb(usb, id) {\n const result = {};\n result.id = id;\n\n usb = usb.replace(/ \\|/g, '');\n usb = usb.trim();\n let lines = usb.split('\\n');\n lines.shift();\n try {\n for (let i = 0; i < lines.length; i++) {\n lines[i] = lines[i].trim();\n lines[i] = lines[i].replace(/=/g, ':');\n if (lines[i] !== '{' && lines[i] !== '}' && lines[i + 1] && lines[i + 1].trim() !== '}') {\n lines[i] = lines[i] + ',';\n }\n lines[i] = lines[i].replace(': Yes,', ': \"Yes\",');\n lines[i] = lines[i].replace(': No,', ': \"No\",');\n }\n const usbObj = JSON.parse(lines.join('\\n'));\n const removableDrive = usbObj['Built-In'].toLowerCase() !== 'yes' && usbObj['non-removable'].toLowerCase() === 'no';\n\n result.bus = null;\n result.deviceId = null;\n result.id = usbObj['USB Address'] || null;\n result.name = usbObj['kUSBProductString'] || usbObj['USB Product Name'] || null;\n result.type = getDarwinUsbType((usbObj['kUSBProductString'] || usbObj['USB Product Name'] || '').toLowerCase() + (removableDrive ? ' removable' : ''));\n result.removable = usbObj['non-removable'].toLowerCase() === 'no';\n result.vendor = usbObj['kUSBVendorString'] || usbObj['USB Vendor Name'] || null;\n result.manufacturer = usbObj['kUSBVendorString'] || usbObj['USB Vendor Name'] || null;\n result.maxPower = null;\n result.serialNumber = usbObj['kUSBSerialNumberString'] || null;\n\n if (result.name) {\n return result;\n } else {\n return null;\n }\n } catch (e) {\n return null;\n }\n}\n\n// function getWindowsUsbType(service) {\n// let result = ''\n// if (service.indexOf('usbhub3') >= 0) { result = 'Hub'; }\n// else if (service.indexOf('usbstor') >= 0) { result = 'Storage'; }\n// else if (service.indexOf('hidusb') >= 0) { result = 'Input'; }\n// else if (service.indexOf('usbccgp') >= 0) { result = 'Controller'; }\n// else if (service.indexOf('usbxhci') >= 0) { result = 'Controller'; }\n// else if (service.indexOf('usbehci') >= 0) { result = 'Controller'; }\n// else if (service.indexOf('kbdhid') >= 0) { result = 'Keyboard'; }\n// else if (service.indexOf('keyboard') >= 0) { result = 'Keyboard'; }\n// else if (service.indexOf('pointing') >= 0) { result = 'Mouse'; }\n// else if (service.indexOf('disk') >= 0) { result = 'Storage'; }\n// else if (service.indexOf('usbhub') >= 0) { result = 'Hub'; }\n// else if (service.indexOf('bthusb') >= 0) { result = ''; }\n// else if (service.indexOf('bth') >= 0) { result = ''; }\n// else if (service.indexOf('rfcomm') >= 0) { result = ''; }\n// return result;\n// }\n\nfunction getWindowsUsbTypeCreation(creationclass, name) {\n let result = '';\n if (name.indexOf('storage') >= 0) { result = 'Storage'; }\n else if (name.indexOf('speicher') >= 0) { result = 'Storage'; }\n else if (creationclass.indexOf('usbhub') >= 0) { result = 'Hub'; }\n else if (creationclass.indexOf('storage') >= 0) { result = 'Storage'; }\n else if (creationclass.indexOf('usbcontroller') >= 0) { result = 'Controller'; }\n else if (creationclass.indexOf('keyboard') >= 0) { result = 'Keyboard'; }\n else if (creationclass.indexOf('pointing') >= 0) { result = 'Mouse'; }\n else if (creationclass.indexOf('disk') >= 0) { result = 'Storage'; }\n return result;\n}\n\nfunction parseWindowsUsb(lines, id) {\n const usbType = getWindowsUsbTypeCreation(util.getValue(lines, 'CreationClassName', ':').toLowerCase(), util.getValue(lines, 'name', ':').toLowerCase());\n\n if (usbType) {\n const result = {};\n result.bus = null;\n result.deviceId = util.getValue(lines, 'deviceid', ':');\n result.id = id;\n result.name = util.getValue(lines, 'name', ':');\n result.type = usbType;\n result.removable = null;\n result.vendor = null;\n result.manufacturer = util.getValue(lines, 'Manufacturer', ':');\n result.maxPower = null;\n result.serialNumber = null;\n\n return result;\n } else {\n return null;\n }\n\n}\n\nfunction usb(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = [];\n if (_linux) {\n const cmd = 'export LC_ALL=C; lsusb -v 2>/dev/null; unset LC_ALL';\n exec(cmd, { maxBuffer: 1024 * 1024 * 128 }, function (error, stdout) {\n if (!error) {\n const parts = ('\\n\\n' + stdout.toString()).split('\\n\\nBus ');\n for (let i = 1; i < parts.length; i++) {\n const usb = parseLinuxUsb(parts[i]);\n result.push(usb);\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_darwin) {\n let cmd = 'ioreg -p IOUSB -c AppleUSBRootHubDevice -w0 -l';\n exec(cmd, { maxBuffer: 1024 * 1024 * 128 }, function (error, stdout) {\n if (!error) {\n const parts = (stdout.toString()).split(' +-o ');\n for (let i = 1; i < parts.length; i++) {\n const usb = parseDarwinUsb(parts[i]);\n if (usb) {\n result.push(usb);\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_windows) {\n util.powerShell('Get-WmiObject CIM_LogicalDevice | where { $_.Description -match \"USB\"} | select Name,CreationClassName,DeviceId,Manufacturer | fl').then((stdout, error) => {\n if (!error) {\n const parts = stdout.toString().split(/\\n\\s*\\n/);\n for (let i = 0; i < parts.length; i++) {\n const usb = parseWindowsUsb(parts[i].split('\\n'), i);\n if (usb) {\n result.push(usb);\n }\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n\n // util.powerShell(\"gwmi Win32_USBControllerDevice |\\%{[wmi]($_.Dependent)}\").then(data => {\n\n // const parts = data.toString().split(/\\n\\s*\\n/);\n // for (let i = 0; i < parts.length; i++) {\n // const usb = parseWindowsUsb(parts[i].split('\\n'), i)\n // if (usb) {\n // result.push(usb)\n // }\n // }\n // if (callback) {\n // callback(result);\n // }\n // resolve(result);\n // });\n }\n if (_sunos || _freebsd || _openbsd || _netbsd) {\n resolve(null);\n }\n });\n });\n}\n\nexports.usb = usb;\n\n","'use strict';\n// @ts-check\n// ==================================================================================\n// users.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 11. Users/Sessions\n// ----------------------------------------------------------------------------------\n\nconst exec = require('child_process').exec;\nconst util = require('./util');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\n// let _winDateFormat = {\n// dateFormat: '',\n// dateSeperator: '',\n// timeFormat: '',\n// timeSeperator: '',\n// amDesignator: '',\n// pmDesignator: ''\n// };\n\n// --------------------------\n// array of users online = sessions\n\n// function getWinCulture() {\n// return new Promise((resolve) => {\n// process.nextTick(() => {\n// if (!_winDateFormat.dateFormat) {\n// util.powerShell('(get-culture).DateTimeFormat')\n// .then(data => {\n// let lines = data.toString().split('\\r\\n');\n// _winDateFormat.dateFormat = util.getValue(lines, 'ShortDatePattern', ':');\n// _winDateFormat.dateSeperator = util.getValue(lines, 'DateSeparator', ':');\n// _winDateFormat.timeFormat = util.getValue(lines, 'ShortTimePattern', ':');\n// _winDateFormat.timeSeperator = util.getValue(lines, 'TimeSeparator', ':');\n// _winDateFormat.amDesignator = util.getValue(lines, 'AMDesignator', ':');\n// _winDateFormat.pmDesignator = util.getValue(lines, 'PMDesignator', ':');\n\n// resolve(_winDateFormat);\n// })\n// .catch(() => {\n// resolve(_winDateFormat);\n// });\n// } else {\n// resolve(_winDateFormat);\n// }\n// });\n// });\n// }\n\nfunction parseUsersLinux(lines, phase) {\n let result = [];\n let result_who = [];\n let result_w = {};\n let w_first = true;\n let w_header = [];\n let w_pos = [];\n let who_line = {};\n\n let is_whopart = true;\n lines.forEach(function (line) {\n if (line === '---') {\n is_whopart = false;\n } else {\n let l = line.replace(/ +/g, ' ').split(' ');\n\n // who part\n if (is_whopart) {\n result_who.push({\n user: l[0],\n tty: l[1],\n date: l[2],\n time: l[3],\n ip: (l && l.length > 4) ? l[4].replace(/\\(/g, '').replace(/\\)/g, '') : ''\n });\n } else {\n // w part\n if (w_first) { // header\n w_header = l;\n w_header.forEach(function (item) {\n w_pos.push(line.indexOf(item));\n });\n w_first = false;\n } else {\n // split by w_pos\n result_w.user = line.substring(w_pos[0], w_pos[1] - 1).trim();\n result_w.tty = line.substring(w_pos[1], w_pos[2] - 1).trim();\n result_w.ip = line.substring(w_pos[2], w_pos[3] - 1).replace(/\\(/g, '').replace(/\\)/g, '').trim();\n result_w.command = line.substring(w_pos[7], 1000).trim();\n // find corresponding 'who' line\n who_line = result_who.filter(function (obj) {\n return (obj.user.substring(0, 8).trim() === result_w.user && obj.tty === result_w.tty);\n });\n if (who_line.length === 1) {\n result.push({\n user: who_line[0].user,\n tty: who_line[0].tty,\n date: who_line[0].date,\n time: who_line[0].time,\n ip: who_line[0].ip,\n command: result_w.command\n });\n }\n }\n }\n }\n });\n if (result.length === 0 && phase === 2) {\n return result_who;\n } else {\n return result;\n }\n}\n\nfunction parseUsersDarwin(lines) {\n let result = [];\n let result_who = [];\n let result_w = {};\n let who_line = {};\n\n let is_whopart = true;\n lines.forEach(function (line) {\n if (line === '---') {\n is_whopart = false;\n } else {\n let l = line.replace(/ +/g, ' ').split(' ');\n\n // who part\n if (is_whopart) {\n result_who.push({\n user: l[0],\n tty: l[1],\n date: ('' + new Date().getFullYear()) + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2),\n time: l[4],\n });\n } else {\n // w part\n // split by w_pos\n result_w.user = l[0];\n result_w.tty = l[1];\n result_w.ip = (l[2] !== '-') ? l[2] : '';\n result_w.command = l.slice(5, 1000).join(' ');\n // find corresponding 'who' line\n who_line = result_who.filter(function (obj) {\n return (obj.user === result_w.user && (obj.tty.substring(3, 1000) === result_w.tty || obj.tty === result_w.tty));\n });\n if (who_line.length === 1) {\n result.push({\n user: who_line[0].user,\n tty: who_line[0].tty,\n date: who_line[0].date,\n time: who_line[0].time,\n ip: result_w.ip,\n command: result_w.command\n });\n }\n }\n }\n });\n return result;\n}\n\nfunction users(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = [];\n\n // linux\n if (_linux) {\n exec('who --ips; echo \"---\"; w | tail -n +2', function (error, stdout) {\n if (!error) {\n // lines / split\n let lines = stdout.toString().split('\\n');\n result = parseUsersLinux(lines, 1);\n if (result.length === 0) {\n exec('who; echo \"---\"; w | tail -n +2', function (error, stdout) {\n if (!error) {\n // lines / split\n lines = stdout.toString().split('\\n');\n result = parseUsersLinux(lines, 2);\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n }\n if (_freebsd || _openbsd || _netbsd) {\n exec('who; echo \"---\"; w -ih', function (error, stdout) {\n if (!error) {\n // lines / split\n let lines = stdout.toString().split('\\n');\n result = parseUsersDarwin(lines);\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n exec('who; echo \"---\"; w -h', function (error, stdout) {\n if (!error) {\n // lines / split\n let lines = stdout.toString().split('\\n');\n result = parseUsersDarwin(lines);\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n\n if (_darwin) {\n exec('who; echo \"---\"; w -ih', function (error, stdout) {\n if (!error) {\n // lines / split\n let lines = stdout.toString().split('\\n');\n result = parseUsersDarwin(lines);\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_windows) {\n try {\n // const workload = [];\n // // workload.push(util.powerShell('Get-CimInstance -ClassName Win32_Account | fl *'));\n // workload.push(util.powerShell('Get-WmiObject Win32_LogonSession | fl *'));\n // workload.push(util.powerShell('Get-WmiObject Win32_LoggedOnUser | fl *'));\n // workload.push(util.powerShell('Get-WmiObject Win32_Process -Filter \"name=\\'explorer.exe\\'\" | Select @{Name=\"domain\";Expression={$_.GetOwner().Domain}}, @{Name=\"username\";Expression={$_.GetOwner().User}} | fl'));\n // Promise.all(\n // workload\n // ).then(data => {\n let cmd = 'Get-WmiObject Win32_LogonSession | select LogonId,StartTime | fl' + '; echo \\'#-#-#-#\\';';\n cmd += 'Get-WmiObject Win32_LoggedOnUser | select antecedent,dependent | fl ' + '; echo \\'#-#-#-#\\';';\n cmd += 'Get-WmiObject Win32_Process -Filter \"name=\\'explorer.exe\\'\" | Select @{Name=\"sessionid\";Expression={$_.SessionId}}, @{Name=\"domain\";Expression={$_.GetOwner().Domain}}, @{Name=\"username\";Expression={$_.GetOwner().User}} | fl' + '; echo \\'#-#-#-#\\';';\n cmd += 'query user';\n util.powerShell(cmd).then(data => {\n // controller + vram\n // let accounts = parseWinAccounts(data[0].split(/\\n\\s*\\n/));\n if (data) {\n data = data.split('#-#-#-#');\n let sessions = parseWinSessions((data[0] || '').split(/\\n\\s*\\n/));\n let loggedons = parseWinLoggedOn((data[1] || '').split(/\\n\\s*\\n/));\n let queryUser = parseWinUsersQuery((data[3] || '').split('\\r\\n'));\n let users = parseWinUsers((data[2] || '').split(/\\n\\s*\\n/), queryUser);\n for (let id in loggedons) {\n if ({}.hasOwnProperty.call(loggedons, id)) {\n loggedons[id].dateTime = {}.hasOwnProperty.call(sessions, id) ? sessions[id] : '';\n }\n }\n users.forEach(user => {\n let dateTime = '';\n for (let id in loggedons) {\n if ({}.hasOwnProperty.call(loggedons, id)) {\n if (loggedons[id].user === user.user && (!dateTime || dateTime < loggedons[id].dateTime)) {\n dateTime = loggedons[id].dateTime;\n }\n }\n }\n\n result.push({\n user: user.user,\n tty: user.tty,\n date: `${dateTime.substr(0, 4)}-${dateTime.substr(4, 2)}-${dateTime.substr(6, 2)}`,\n time: `${dateTime.substr(8, 2)}:${dateTime.substr(10, 2)}`,\n ip: '',\n command: ''\n });\n });\n }\n if (callback) { callback(result); }\n resolve(result);\n\n });\n // util.powerShell('query user').then(stdout => {\n // if (stdout) {\n // // lines / split\n // let lines = stdout.toString().split('\\r\\n');\n // getWinCulture()\n // .then(culture => {\n // result = parseUsersWin(lines, culture);\n // if (callback) { callback(result); }\n // resolve(result);\n // });\n // } else {\n // if (callback) { callback(result); }\n // resolve(result);\n // }\n // });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n\n });\n });\n}\n\n// function parseWinAccounts(accountParts) {\n// const accounts = [];\n// accountParts.forEach(account => {\n// const lines = account.split('\\r\\n');\n// const name = util.getValue(lines, 'name', ':', true);\n// const domain = util.getValue(lines, 'domain', ':', true);\n// accounts.push(`${domain}\\${name}`);\n// });\n// return accounts;\n// }\n\nfunction parseWinSessions(sessionParts) {\n const sessions = {};\n sessionParts.forEach(session => {\n const lines = session.split('\\r\\n');\n const id = util.getValue(lines, 'LogonId');\n const starttime = util.getValue(lines, 'starttime');\n if (id) {\n sessions[id] = starttime;\n }\n });\n return sessions;\n}\n\nfunction fuzzyMatch(name1, name2) {\n name1 = name1.toLowerCase();\n name2 = name2.toLowerCase();\n let eq = 0;\n let len = name1.length;\n if (name2.length > len) { len = name2.length; }\n\n for (let i = 0; i < len; i++) {\n const c1 = name1[i] || '';\n const c2 = name2[i] || '';\n if (c1 === c2) { eq++; }\n }\n return (len > 10 ? eq / len > 0.9 : (len > 0 ? eq / len > 0.8 : false));\n}\n\nfunction parseWinUsers(userParts, userQuery) {\n const users = [];\n userParts.forEach(user => {\n const lines = user.split('\\r\\n');\n\n const domain = util.getValue(lines, 'domain', ':', true);\n const username = util.getValue(lines, 'username', ':', true);\n const sessionid = util.getValue(lines, 'sessionid', ':', true);\n\n if (username) {\n const quser = userQuery.filter(item => fuzzyMatch(item.user, username));\n users.push({\n domain,\n user: username,\n tty: quser && quser[0] && quser[0].tty ? quser[0].tty : sessionid\n });\n }\n });\n return users;\n}\n\nfunction parseWinLoggedOn(loggedonParts) {\n const loggedons = {};\n loggedonParts.forEach(loggedon => {\n const lines = loggedon.split('\\r\\n');\n\n const antecendent = util.getValue(lines, 'antecedent', ':', true);\n let parts = antecendent.split(',');\n const domainParts = parts.length > 1 ? parts[0].split('=') : [];\n const nameParts = parts.length > 1 ? parts[1].split('=') : [];\n const domain = domainParts.length > 1 ? domainParts[1].replace(/\"/g, '') : '';\n const name = nameParts.length > 1 ? nameParts[1].replace(/\"/g, '') : '';\n const dependent = util.getValue(lines, 'dependent', ':', true);\n parts = dependent.split('=');\n const id = parts.length > 1 ? parts[1].replace(/\"/g, '') : '';\n if (id) {\n loggedons[id] = {\n domain,\n user: name\n };\n }\n });\n return loggedons;\n}\n\nfunction parseWinUsersQuery(lines) {\n lines = lines.filter(item => item);\n let result = [];\n const header = lines[0];\n const headerDelimiter = [];\n if (header) {\n const start = (header[0] === ' ') ? 1 : 0;\n headerDelimiter.push(start - 1);\n let nextSpace = 0;\n for (let i = start + 1; i < header.length; i++) {\n if (header[i] === ' ' && ((header[i - 1] === ' ') || (header[i - 1] === '.'))) {\n nextSpace = i;\n } else {\n if (nextSpace) {\n headerDelimiter.push(nextSpace);\n nextSpace = 0;\n }\n }\n }\n for (let i = 1; i < lines.length; i++) {\n if (lines[i].trim()) {\n const user = lines[i].substring(headerDelimiter[0] + 1, headerDelimiter[1]).trim() || '';\n const tty = lines[i].substring(headerDelimiter[1] + 1, headerDelimiter[2] - 2).trim() || '';\n // const dateTime = util.parseDateTime(lines[i].substring(headerDelimiter[5] + 1, 2000).trim(), culture) || '';\n result.push({\n user: user,\n tty: tty,\n });\n }\n }\n }\n return result;\n}\n\nexports.users = users;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// utils.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 0. helper functions\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst fs = require('fs');\nconst path = require('path');\nconst spawn = require('child_process').spawn;\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst util = require('util');\n\nlet _platform = process.platform;\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\n// const _sunos = (_platform === 'sunos');\n\nlet _cores = 0;\nlet wmicPath = '';\nlet codepage = '';\nlet _smartMonToolsInstalled = null;\n\nconst WINDIR = process.env.WINDIR || 'C:\\\\Windows';\n\n// powerShell\nlet _psChild;\nlet _psResult = '';\nlet _psCmds = [];\nlet _psPersistent = false;\nconst _psToUTF8 = '$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 ; ';\nconst _psCmdStart = '--###START###--';\nconst _psError = '--ERROR--';\nconst _psCmdSeperator = '--###ENDCMD###--';\nconst _psIdSeperator = '--##ID##--';\n\nconst execOptsWin = {\n windowsHide: true,\n maxBuffer: 1024 * 20000,\n encoding: 'UTF-8',\n env: util._extend({}, process.env, { LANG: 'en_US.UTF-8' })\n};\n\nfunction toInt(value) {\n let result = parseInt(value, 10);\n if (isNaN(result)) {\n result = 0;\n }\n return result;\n}\n\n\nconst stringReplace = new String().replace;\nconst stringToLower = new String().toLowerCase;\nconst stringToString = new String().toString;\nconst stringSubstr = new String().substr;\nconst stringTrim = new String().trim;\nconst stringStartWith = new String().startsWith;\nconst mathMin = Math.min;\n\nfunction isFunction(functionToCheck) {\n let getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n}\n\nfunction unique(obj) {\n let uniques = [];\n let stringify = {};\n for (let i = 0; i < obj.length; i++) {\n let keys = Object.keys(obj[i]);\n keys.sort(function (a, b) { return a - b; });\n let str = '';\n for (let j = 0; j < keys.length; j++) {\n str += JSON.stringify(keys[j]);\n str += JSON.stringify(obj[i][keys[j]]);\n }\n if (!{}.hasOwnProperty.call(stringify, str)) {\n uniques.push(obj[i]);\n stringify[str] = true;\n }\n }\n return uniques;\n}\n\nfunction sortByKey(array, keys) {\n return array.sort(function (a, b) {\n let x = '';\n let y = '';\n keys.forEach(function (key) {\n x = x + a[key]; y = y + b[key];\n });\n return ((x < y) ? -1 : ((x > y) ? 1 : 0));\n });\n}\n\nfunction cores() {\n if (_cores === 0) {\n _cores = os.cpus().length;\n }\n return _cores;\n}\n\nfunction getValue(lines, property, separator, trimmed, lineMatch) {\n separator = separator || ':';\n property = property.toLowerCase();\n trimmed = trimmed || false;\n lineMatch = lineMatch || false;\n for (let i = 0; i < lines.length; i++) {\n let line = lines[i].toLowerCase().replace(/\\t/g, '');\n if (trimmed) {\n line = line.trim();\n }\n if (line.startsWith(property) && (lineMatch ? (line.match(property + separator)) : true)) {\n const parts = trimmed ? lines[i].trim().split(separator) : lines[i].split(separator);\n if (parts.length >= 2) {\n parts.shift();\n return parts.join(separator).trim();\n } else {\n return '';\n }\n }\n }\n return '';\n}\n\nfunction decodeEscapeSequence(str, base) {\n base = base || 16;\n return str.replace(/\\\\x([0-9A-Fa-f]{2})/g, function () {\n return String.fromCharCode(parseInt(arguments[1], base));\n });\n}\n\nfunction detectSplit(str) {\n let seperator = '';\n let part = 0;\n str.split('').forEach(element => {\n if (element >= '0' && element <= '9') {\n if (part === 1) { part++; }\n } else {\n if (part === 0) { part++; }\n if (part === 1) {\n seperator += element;\n }\n }\n });\n return seperator;\n}\n\nfunction parseTime(t, pmDesignator) {\n pmDesignator = pmDesignator || '';\n t = t.toUpperCase();\n let hour = 0;\n let min = 0;\n let splitter = detectSplit(t);\n let parts = t.split(splitter);\n if (parts.length >= 2) {\n if (parts[2]) {\n parts[1] += parts[2];\n }\n let isPM = (parts[1] && (parts[1].toLowerCase().indexOf('pm') > -1) || (parts[1].toLowerCase().indexOf('p.m.') > -1) || (parts[1].toLowerCase().indexOf('p. m.') > -1) || (parts[1].toLowerCase().indexOf('n') > -1) || (parts[1].toLowerCase().indexOf('ch') > -1) || (parts[1].toLowerCase().indexOf('ös') > -1) || (pmDesignator && parts[1].toLowerCase().indexOf(pmDesignator) > -1));\n hour = parseInt(parts[0], 10);\n min = parseInt(parts[1], 10);\n hour = isPM && hour < 12 ? hour + 12 : hour;\n return ('0' + hour).substr(-2) + ':' + ('0' + min).substr(-2);\n }\n}\n\nfunction parseDateTime(dt, culture) {\n const result = {\n date: '',\n time: ''\n };\n culture = culture || {};\n let dateFormat = (culture.dateFormat || '').toLowerCase();\n let pmDesignator = (culture.pmDesignator || '');\n\n const parts = dt.split(' ');\n if (parts[0]) {\n if (parts[0].indexOf('/') >= 0) {\n // Dateformat: mm/dd/yyyy or dd/mm/yyyy or dd/mm/yy or yyyy/mm/dd\n const dtparts = parts[0].split('/');\n if (dtparts.length === 3) {\n if (dtparts[0].length === 4) {\n // Dateformat: yyyy/mm/dd\n result.date = dtparts[0] + '-' + ('0' + dtparts[1]).substr(-2) + '-' + ('0' + dtparts[2]).substr(-2);\n } else if (dtparts[2].length === 2) {\n if ((dateFormat.indexOf('/d/') > -1 || dateFormat.indexOf('/dd/') > -1)) {\n // Dateformat: mm/dd/yy\n result.date = '20' + dtparts[2] + '-' + ('0' + dtparts[1]).substr(-2) + '-' + ('0' + dtparts[0]).substr(-2);\n } else {\n // Dateformat: dd/mm/yy\n result.date = '20' + dtparts[2] + '-' + ('0' + dtparts[1]).substr(-2) + '-' + ('0' + dtparts[0]).substr(-2);\n }\n } else {\n // Dateformat: mm/dd/yyyy or dd/mm/yyyy\n const isEN = ((dt.toLowerCase().indexOf('pm') > -1) || (dt.toLowerCase().indexOf('p.m.') > -1) || (dt.toLowerCase().indexOf('p. m.') > -1) || (dt.toLowerCase().indexOf('am') > -1) || (dt.toLowerCase().indexOf('a.m.') > -1) || (dt.toLowerCase().indexOf('a. m.') > -1));\n if ((isEN || dateFormat.indexOf('/d/') > -1 || dateFormat.indexOf('/dd/') > -1) && dateFormat.indexOf('dd/') !== 0) {\n // Dateformat: mm/dd/yyyy\n result.date = dtparts[2] + '-' + ('0' + dtparts[0]).substr(-2) + '-' + ('0' + dtparts[1]).substr(-2);\n } else {\n // Dateformat: dd/mm/yyyy\n result.date = dtparts[2] + '-' + ('0' + dtparts[1]).substr(-2) + '-' + ('0' + dtparts[0]).substr(-2);\n }\n }\n }\n }\n if (parts[0].indexOf('.') >= 0) {\n const dtparts = parts[0].split('.');\n if (dtparts.length === 3) {\n if (dateFormat.indexOf('.d.') > -1 || dateFormat.indexOf('.dd.') > -1) {\n // Dateformat: mm.dd.yyyy\n result.date = dtparts[2] + '-' + ('0' + dtparts[0]).substr(-2) + '-' + ('0' + dtparts[1]).substr(-2);\n } else {\n // Dateformat: dd.mm.yyyy\n result.date = dtparts[2] + '-' + ('0' + dtparts[1]).substr(-2) + '-' + ('0' + dtparts[0]).substr(-2);\n }\n }\n }\n if (parts[0].indexOf('-') >= 0) {\n // Dateformat: yyyy-mm-dd\n const dtparts = parts[0].split('-');\n if (dtparts.length === 3) {\n result.date = dtparts[0] + '-' + ('0' + dtparts[1]).substr(-2) + '-' + ('0' + dtparts[2]).substr(-2);\n }\n }\n }\n if (parts[1]) {\n parts.shift();\n let time = parts.join(' ');\n result.time = parseTime(time, pmDesignator);\n }\n return result;\n}\n\nfunction parseHead(head, rights) {\n let space = (rights > 0);\n let count = 1;\n let from = 0;\n let to = 0;\n let result = [];\n for (let i = 0; i < head.length; i++) {\n if (count <= rights) {\n // if (head[i] === ' ' && !space) {\n if (/\\s/.test(head[i]) && !space) {\n to = i - 1;\n result.push({\n from: from,\n to: to + 1,\n cap: head.substring(from, to + 1)\n });\n from = to + 2;\n count++;\n }\n space = head[i] === ' ';\n } else {\n if (!/\\s/.test(head[i]) && space) {\n to = i - 1;\n if (from < to) {\n result.push({\n from: from,\n to: to,\n cap: head.substring(from, to)\n });\n }\n from = to + 1;\n count++;\n }\n space = head[i] === ' ';\n }\n }\n to = 1000;\n result.push({\n from: from,\n to: to,\n cap: head.substring(from, to)\n });\n let len = result.length;\n for (var i = 0; i < len; i++) {\n if (result[i].cap.replace(/\\s/g, '').length === 0) {\n if (i + 1 < len) {\n result[i].to = result[i + 1].to;\n result[i].cap = result[i].cap + result[i + 1].cap;\n result.splice(i + 1, 1);\n len = len - 1;\n }\n }\n }\n return result;\n}\n\nfunction findObjectByKey(array, key, value) {\n for (let i = 0; i < array.length; i++) {\n if (array[i][key] === value) {\n return i;\n }\n }\n return -1;\n}\n\nfunction getWmic() {\n if (os.type() === 'Windows_NT' && !wmicPath) {\n wmicPath = WINDIR + '\\\\system32\\\\wbem\\\\wmic.exe';\n if (!fs.existsSync(wmicPath)) {\n try {\n const wmicPathArray = execSync('WHERE WMIC', execOptsWin).toString().split('\\r\\n');\n if (wmicPathArray && wmicPathArray.length) {\n wmicPath = wmicPathArray[0];\n } else {\n wmicPath = 'wmic';\n }\n } catch (e) {\n wmicPath = 'wmic';\n }\n }\n }\n return wmicPath;\n}\n\nfunction wmic(command) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n try {\n powerShell(getWmic() + ' ' + command).then(stdout => {\n resolve(stdout, '');\n });\n } catch (e) {\n resolve('', e);\n }\n });\n });\n}\n\n// function wmic(command, options) {\n// options = options || execOptsWin;\n// return new Promise((resolve) => {\n// process.nextTick(() => {\n// try {\n// exec(WINDIR + '\\\\system32\\\\chcp.com 65001 | ' + getWmic() + ' ' + command, options, function (error, stdout) {\n// resolve(stdout, error);\n// }).stdin.end();\n// } catch (e) {\n// resolve('', e);\n// }\n// });\n// });\n// }\n\nfunction getVboxmanage() {\n return _windows ? `\"${process.env.VBOX_INSTALL_PATH || process.env.VBOX_MSI_INSTALL_PATH}\\\\VBoxManage.exe\"` : 'vboxmanage';\n}\n\nfunction powerShellProceedResults(data) {\n let id = '';\n let parts;\n let res = '';\n // startID\n if (data.indexOf(_psCmdStart) >= 0) {\n parts = data.split(_psCmdStart);\n const parts2 = parts[1].split(_psIdSeperator);\n id = parts2[0];\n if (parts2.length > 1) {\n data = parts2.slice(1).join(_psIdSeperator);\n }\n }\n // result;\n if (data.indexOf(_psCmdSeperator) >= 0) {\n parts = data.split(_psCmdSeperator);\n res = parts[0];\n }\n let remove = -1;\n for (let i = 0; i < _psCmds.length; i++) {\n if (_psCmds[i].id === id) {\n remove = i;\n // console.log(`----- TIME : ${(new Date() - _psCmds[i].start) * 0.001} s`);\n\n _psCmds[i].callback(res);\n }\n }\n if (remove >= 0) {\n _psCmds.splice(remove, 1);\n }\n}\n\nfunction powerShellStart() {\n _psChild = spawn('powershell.exe', ['-NoLogo', '-InputFormat', 'Text', '-NoExit', '-Command', '-'], {\n stdio: 'pipe',\n windowsHide: true,\n maxBuffer: 1024 * 20000,\n encoding: 'UTF-8',\n env: util._extend({}, process.env, { LANG: 'en_US.UTF-8' })\n });\n if (_psChild && _psChild.pid) {\n _psPersistent = true;\n _psChild.stdout.on('data', function (data) {\n _psResult = _psResult + data.toString('utf8');\n if (data.indexOf(_psCmdSeperator) >= 0) {\n powerShellProceedResults(_psResult);\n _psResult = '';\n }\n });\n _psChild.stderr.on('data', function () {\n powerShellProceedResults(_psResult + _psError);\n });\n _psChild.on('error', function () {\n powerShellProceedResults(_psResult + _psError);\n });\n _psChild.on('close', function () {\n _psChild.kill();\n });\n }\n}\n\nfunction powerShellRelease() {\n try {\n _psChild.stdin.write('exit' + os.EOL);\n _psChild.stdin.end();\n _psPersistent = false;\n } catch (e) {\n _psChild.kill();\n }\n}\n\nfunction powerShell(cmd) {\n\n if (_psPersistent) {\n const id = Math.random().toString(36).substr(2, 10);\n return new Promise((resolve) => {\n process.nextTick(() => {\n function callback(data) {\n resolve(data);\n }\n _psCmds.push({\n id,\n cmd,\n callback,\n start: new Date()\n });\n try {\n if (_psChild && _psChild.pid) {\n _psChild.stdin.write(_psToUTF8 + 'echo ' + _psCmdStart + id + _psIdSeperator + '; ' + os.EOL + cmd + os.EOL + 'echo ' + _psCmdSeperator + os.EOL);\n }\n } catch (e) {\n resolve('');\n }\n });\n });\n\n } else {\n let result = '';\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n try {\n // const start = new Date();\n const child = spawn('powershell.exe', ['-NoLogo', '-InputFormat', 'Text', '-NoExit', '-ExecutionPolicy', 'Unrestricted', '-Command', '-'], {\n stdio: 'pipe',\n windowsHide: true,\n maxBuffer: 1024 * 20000,\n encoding: 'UTF-8',\n env: util._extend({}, process.env, { LANG: 'en_US.UTF-8' })\n });\n\n if (child && !child.pid) {\n child.on('error', function () {\n resolve(result);\n });\n }\n if (child && child.pid) {\n child.stdout.on('data', function (data) {\n result = result + data.toString('utf8');\n });\n child.stderr.on('data', function () {\n child.kill();\n resolve(result);\n });\n child.on('close', function () {\n child.kill();\n // console.log(`----- TIME : ${(new Date() - start) * 0.001} s`);\n\n resolve(result);\n });\n child.on('error', function () {\n child.kill();\n resolve(result);\n });\n try {\n child.stdin.write(_psToUTF8 + cmd + os.EOL);\n child.stdin.write('exit' + os.EOL);\n child.stdin.end();\n } catch (e) {\n child.kill();\n resolve(result);\n }\n } else {\n resolve(result);\n }\n } catch (e) {\n resolve(result);\n }\n });\n });\n }\n}\n\nfunction execSafe(cmd, args, options) {\n let result = '';\n options = options || {};\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n try {\n const child = spawn(cmd, args, options);\n\n if (child && !child.pid) {\n child.on('error', function () {\n resolve(result);\n });\n }\n if (child && child.pid) {\n child.stdout.on('data', function (data) {\n result += data.toString();\n });\n child.on('close', function () {\n child.kill();\n resolve(result);\n });\n child.on('error', function () {\n child.kill();\n resolve(result);\n });\n } else {\n resolve(result);\n }\n } catch (e) {\n resolve(result);\n }\n });\n });\n}\n\nfunction getCodepage() {\n if (_windows) {\n if (!codepage) {\n try {\n const stdout = execSync('chcp', execOptsWin);\n const lines = stdout.toString().split('\\r\\n');\n const parts = lines[0].split(':');\n codepage = parts.length > 1 ? parts[1].replace('.', '') : '';\n } catch (err) {\n codepage = '437';\n }\n }\n return codepage;\n }\n if (_linux || _darwin || _freebsd || _openbsd || _netbsd) {\n if (!codepage) {\n try {\n const stdout = execSync('echo $LANG');\n const lines = stdout.toString().split('\\r\\n');\n const parts = lines[0].split('.');\n codepage = parts.length > 1 ? parts[1].trim() : '';\n if (!codepage) {\n codepage = 'UTF-8';\n }\n } catch (err) {\n codepage = 'UTF-8';\n }\n }\n return codepage;\n }\n}\n\nfunction smartMonToolsInstalled() {\n if (_smartMonToolsInstalled !== null) {\n return _smartMonToolsInstalled;\n }\n _smartMonToolsInstalled = false;\n if (_windows) {\n try {\n const pathArray = execSync('WHERE smartctl 2>nul', execOptsWin).toString().split('\\r\\n');\n if (pathArray && pathArray.length) {\n _smartMonToolsInstalled = pathArray[0].indexOf(':\\\\') >= 0;\n } else {\n _smartMonToolsInstalled = false;\n }\n } catch (e) {\n _smartMonToolsInstalled = false;\n }\n }\n if (_linux || _darwin || _freebsd || _openbsd || _netbsd) {\n const pathArray = execSync('which smartctl 2>/dev/null', execOptsWin).toString().split('\\r\\n');\n _smartMonToolsInstalled = pathArray.length > 0;\n }\n return _smartMonToolsInstalled;\n}\n\nfunction isRaspberry() {\n const PI_MODEL_NO = [\n 'BCM2708',\n 'BCM2709',\n 'BCM2710',\n 'BCM2711',\n 'BCM2835',\n 'BCM2836',\n 'BCM2837',\n 'BCM2837B0'\n ];\n let cpuinfo = [];\n try {\n cpuinfo = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' }).toString().split('\\n');\n } catch (e) {\n return false;\n }\n const hardware = getValue(cpuinfo, 'hardware');\n return (hardware && PI_MODEL_NO.indexOf(hardware) > -1);\n}\n\nfunction isRaspbian() {\n let osrelease = [];\n try {\n osrelease = fs.readFileSync('/etc/os-release', { encoding: 'utf8' }).toString().split('\\n');\n } catch (e) {\n return false;\n }\n const id = getValue(osrelease, 'id', '=');\n return (id && id.indexOf('raspbian') > -1);\n}\n\nfunction execWin(cmd, opts, callback) {\n if (!callback) {\n callback = opts;\n opts = execOptsWin;\n }\n let newCmd = 'chcp 65001 > nul && cmd /C ' + cmd + ' && chcp ' + codepage + ' > nul';\n exec(newCmd, opts, function (error, stdout) {\n callback(error, stdout);\n });\n}\n\nfunction darwinXcodeExists() {\n const cmdLineToolsExists = fs.existsSync('/Library/Developer/CommandLineTools/usr/bin/');\n const xcodeAppExists = fs.existsSync('/Applications/Xcode.app/Contents/Developer/Tools');\n const xcodeExists = fs.existsSync('/Library/Developer/Xcode/');\n return (cmdLineToolsExists || xcodeExists || xcodeAppExists);\n}\n\nfunction nanoSeconds() {\n const time = process.hrtime();\n if (!Array.isArray(time) || time.length !== 2) {\n return 0;\n }\n return +time[0] * 1e9 + +time[1];\n}\n\nfunction countUniqueLines(lines, startingWith) {\n startingWith = startingWith || '';\n const uniqueLines = [];\n lines.forEach(line => {\n if (line.startsWith(startingWith)) {\n if (uniqueLines.indexOf(line) === -1) {\n uniqueLines.push(line);\n }\n }\n });\n return uniqueLines.length;\n}\n\nfunction countLines(lines, startingWith) {\n startingWith = startingWith || '';\n const uniqueLines = [];\n lines.forEach(line => {\n if (line.startsWith(startingWith)) {\n uniqueLines.push(line);\n }\n });\n return uniqueLines.length;\n}\n\nfunction sanitizeShellString(str, strict) {\n if (typeof strict === 'undefined') { strict = false; }\n const s = str || '';\n let result = '';\n for (let i = 0; i <= mathMin(s.length, 2000); i++) {\n if (!(s[i] === undefined ||\n s[i] === '>' ||\n s[i] === '<' ||\n s[i] === '*' ||\n s[i] === '?' ||\n s[i] === '[' ||\n s[i] === ']' ||\n s[i] === '|' ||\n s[i] === '˚' ||\n s[i] === '$' ||\n s[i] === ';' ||\n s[i] === '&' ||\n s[i] === '(' ||\n s[i] === ')' ||\n s[i] === ']' ||\n s[i] === '#' ||\n s[i] === '\\\\' ||\n s[i] === '\\t' ||\n s[i] === '\\n' ||\n s[i] === '\\'' ||\n s[i] === '`' ||\n s[i] === '\"' ||\n s[i].length > 1 ||\n (strict && s[i] === '@') ||\n (strict && s[i] === ' ') ||\n (strict && s[i] == '{') ||\n (strict && s[i] == ')'))) {\n result = result + s[i];\n }\n }\n return result;\n}\n\nfunction isPrototypePolluted() {\n const s = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n let notPolluted = true;\n let st = '';\n\n st.__proto__.replace = stringReplace;\n st.__proto__.toLowerCase = stringToLower;\n st.__proto__.toString = stringToString;\n st.__proto__.substr = stringSubstr;\n\n notPolluted = notPolluted || !(s.length === 62);\n const ms = Date.now();\n if (typeof ms === 'number' && ms > 1600000000000) {\n const l = ms % 100 + 15;\n for (let i = 0; i < l; i++) {\n const r = Math.random() * 61.99999999 + 1;\n const rs = parseInt(Math.floor(r).toString(), 10);\n const rs2 = parseInt(r.toString().split('.')[0], 10);\n const q = Math.random() * 61.99999999 + 1;\n const qs = parseInt(Math.floor(q).toString(), 10);\n const qs2 = parseInt(q.toString().split('.')[0], 10);\n notPolluted = notPolluted && !(r === q);\n notPolluted = notPolluted && rs === rs2 && qs === qs2;\n st += s[rs - 1];\n }\n notPolluted = notPolluted && st.length === l;\n // string manipulation\n let p = Math.random() * l * 0.9999999999;\n let stm = st.substr(0, p) + ' ' + st.substr(p, 2000);\n stm.__proto__.replace = stringReplace;\n let sto = stm.replace(/ /g, '');\n notPolluted = notPolluted && st === sto;\n p = Math.random() * l * 0.9999999999;\n stm = st.substr(0, p) + '{' + st.substr(p, 2000);\n sto = stm.replace(/{/g, '');\n notPolluted = notPolluted && st === sto;\n p = Math.random() * l * 0.9999999999;\n stm = st.substr(0, p) + '*' + st.substr(p, 2000);\n sto = stm.replace(/\\*/g, '');\n notPolluted = notPolluted && st === sto;\n p = Math.random() * l * 0.9999999999;\n stm = st.substr(0, p) + '$' + st.substr(p, 2000);\n sto = stm.replace(/\\$/g, '');\n notPolluted = notPolluted && st === sto;\n\n // lower\n const stl = st.toLowerCase();\n notPolluted = notPolluted && (stl.length === l) && stl[l - 1] && !(stl[l]);\n for (let i = 0; i < l; i++) {\n const s1 = st[i];\n s1.__proto__.toLowerCase = stringToLower;\n const s2 = stl ? stl[i] : '';\n const s1l = s1.toLowerCase();\n notPolluted = notPolluted && s1l[0] === s2 && s1l[0] && !(s1l[1]);\n }\n }\n return !notPolluted;\n}\n\nfunction hex2bin(hex) {\n return ('00000000' + (parseInt(hex, 16)).toString(2)).substr(-8);\n}\n\nfunction getFilesInPath(source) {\n const lstatSync = fs.lstatSync;\n const readdirSync = fs.readdirSync;\n const join = path.join;\n\n function isDirectory(source) {\n return lstatSync(source).isDirectory();\n }\n function isFile(source) { return lstatSync(source).isFile(); }\n\n function getDirectories(source) {\n return readdirSync(source).map(function (name) { return join(source, name); }).filter(isDirectory);\n }\n function getFiles(source) {\n return readdirSync(source).map(function (name) { return join(source, name); }).filter(isFile);\n }\n\n function getFilesRecursively(source) {\n try {\n let dirs = getDirectories(source);\n let files = dirs\n .map(function (dir) { return getFilesRecursively(dir); })\n .reduce(function (a, b) { return a.concat(b); }, []);\n return files.concat(getFiles(source));\n } catch (e) {\n return [];\n }\n }\n\n if (fs.existsSync(source)) {\n return getFilesRecursively(source);\n } else {\n return [];\n }\n}\n\nfunction decodePiCpuinfo(lines) {\n\n // https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md\n\n const oldRevisionCodes = {\n '0002': {\n type: 'B',\n revision: '1.0',\n memory: 256,\n manufacturer: 'Egoman',\n processor: 'BCM2835'\n },\n '0003': {\n type: 'B',\n revision: '1.0',\n memory: 256,\n manufacturer: 'Egoman',\n processor: 'BCM2835'\n },\n '0004': {\n type: 'B',\n revision: '2.0',\n memory: 256,\n manufacturer: 'Sony UK',\n processor: 'BCM2835'\n },\n '0005': {\n type: 'B',\n revision: '2.0',\n memory: 256,\n manufacturer: 'Qisda',\n processor: 'BCM2835'\n },\n '0006': {\n type: 'B',\n revision: '2.0',\n memory: 256,\n manufacturer: 'Egoman',\n processor: 'BCM2835'\n },\n '0007': {\n type: 'A',\n revision: '2.0',\n memory: 256,\n manufacturer: 'Egoman',\n processor: 'BCM2835'\n },\n '0008': {\n type: 'A',\n revision: '2.0',\n memory: 256,\n manufacturer: 'Sony UK',\n processor: 'BCM2835'\n },\n '0009': {\n type: 'A',\n revision: '2.0',\n memory: 256,\n manufacturer: 'Qisda',\n processor: 'BCM2835'\n },\n '000d': {\n type: 'B',\n revision: '2.0',\n memory: 512,\n manufacturer: 'Egoman',\n processor: 'BCM2835'\n },\n '000e': {\n type: 'B',\n revision: '2.0',\n memory: 512,\n manufacturer: 'Sony UK',\n processor: 'BCM2835'\n },\n '000f': {\n type: 'B',\n revision: '2.0',\n memory: 512,\n manufacturer: 'Egoman',\n processor: 'BCM2835'\n },\n '0010': {\n type: 'B+',\n revision: '1.2',\n memory: 512,\n manufacturer: 'Sony UK',\n processor: 'BCM2835'\n },\n '0011': {\n type: 'CM1',\n revision: '1.0',\n memory: 512,\n manufacturer: 'Sony UK',\n processor: 'BCM2835'\n },\n '0012': {\n type: 'A+',\n revision: '1.1',\n memory: 256,\n manufacturer: 'Sony UK',\n processor: 'BCM2835'\n },\n '0013': {\n type: 'B+',\n revision: '1.2',\n memory: 512,\n manufacturer: 'Embest',\n processor: 'BCM2835'\n },\n '0014': {\n type: 'CM1',\n revision: '1.0',\n memory: 512,\n manufacturer: 'Embest',\n processor: 'BCM2835'\n },\n '0015': {\n type: 'A+',\n revision: '1.1',\n memory: 256,\n manufacturer: '512MB\tEmbest',\n processor: 'BCM2835'\n }\n };\n\n const processorList = [\n 'BCM2835',\n 'BCM2836',\n 'BCM2837',\n 'BCM2711',\n ];\n const manufacturerList = [\n 'Sony UK',\n 'Egoman',\n 'Embest',\n 'Sony Japan',\n 'Embest',\n 'Stadium'\n ];\n const typeList = {\n '00': 'A',\n '01': 'B',\n '02': 'A+',\n '03': 'B+',\n '04': '2B',\n '05': 'Alpha (early prototype)',\n '06': 'CM1',\n '08': '3B',\n '09': 'Zero',\n '0a': 'CM3',\n '0c': 'Zero W',\n '0d': '3B+',\n '0e': '3A+',\n '0f': 'Internal use only',\n '10': 'CM3+',\n '11': '4B',\n '12': 'Zero 2 W',\n '13': '400',\n '14': 'CM4'\n };\n\n const revisionCode = getValue(lines, 'revision', ':', true);\n const model = getValue(lines, 'model:', ':', true);\n const serial = getValue(lines, 'serial', ':', true);\n\n let result = {};\n if ({}.hasOwnProperty.call(oldRevisionCodes, revisionCode)) {\n // old revision codes\n result = {\n model,\n serial,\n revisionCode,\n memory: oldRevisionCodes[revisionCode].memory,\n manufacturer: oldRevisionCodes[revisionCode].manufacturer,\n processor: oldRevisionCodes[revisionCode].processor,\n type: oldRevisionCodes[revisionCode].type,\n revision: oldRevisionCodes[revisionCode].revision,\n };\n\n } else {\n // new revision code\n const revision = ('00000000' + getValue(lines, 'revision', ':', true).toLowerCase()).substr(-8);\n // const revisionStyleNew = hex2bin(revision.substr(2, 1)).substr(4, 1) === '1';\n const memSizeCode = parseInt(hex2bin(revision.substr(2, 1)).substr(5, 3), 2) || 0;\n const manufacturer = manufacturerList[parseInt(revision.substr(3, 1), 10)];\n const processor = processorList[parseInt(revision.substr(4, 1), 10)];\n const typeCode = revision.substr(5, 2);\n\n\n result = {\n model,\n serial,\n revisionCode,\n memory: 256 * Math.pow(2, memSizeCode),\n manufacturer,\n processor,\n type: {}.hasOwnProperty.call(typeList, typeCode) ? typeList[typeCode] : '',\n revision: '1.' + revision.substr(7, 1),\n };\n }\n return result;\n}\n\nfunction promiseAll(promises) {\n const resolvingPromises = promises.map(function (promise) {\n return new Promise(function (resolve) {\n var payload = new Array(2);\n promise.then(function (result) {\n payload[0] = result;\n })\n .catch(function (error) {\n payload[1] = error;\n })\n .then(function () {\n // The wrapped Promise returns an array: 0 = result, 1 = error ... we resolve all\n resolve(payload);\n });\n });\n });\n var errors = [];\n var results = [];\n\n // Execute all wrapped Promises\n return Promise.all(resolvingPromises)\n .then(function (items) {\n items.forEach(function (payload) {\n if (payload[1]) {\n errors.push(payload[1]);\n results.push(null);\n } else {\n errors.push(null);\n results.push(payload[0]);\n }\n });\n\n return {\n errors: errors,\n results: results\n };\n });\n}\n\nfunction promisify(nodeStyleFunction) {\n return function () {\n var args = Array.prototype.slice.call(arguments);\n return new Promise(function (resolve, reject) {\n args.push(function (err, data) {\n if (err) {\n reject(err);\n } else {\n resolve(data);\n }\n });\n nodeStyleFunction.apply(null, args);\n });\n };\n}\n\nfunction promisifySave(nodeStyleFunction) {\n return function () {\n var args = Array.prototype.slice.call(arguments);\n return new Promise(function (resolve) {\n args.push(function (err, data) {\n resolve(data);\n });\n nodeStyleFunction.apply(null, args);\n });\n };\n}\n\nfunction linuxVersion() {\n let result = '';\n if (_linux) {\n try {\n result = execSync('uname -v').toString();\n } catch (e) {\n result = '';\n }\n }\n return result;\n}\n\nfunction plistParser(xmlStr) {\n const tags = ['array', 'dict', 'key', 'string', 'integer', 'date', 'real', 'data', 'boolean', 'arrayEmpty'];\n const startStr = '' && pos < len) {\n pos++;\n }\n\n let depth = 0;\n let inTagStart = false;\n let inTagContent = false;\n let inTagEnd = false;\n let metaData = [{ tagStart: '', tagEnd: '', tagContent: '', key: '', data: null }];\n let c = '';\n let cn = xmlStr[pos];\n\n while (pos < len) {\n c = cn;\n if (pos + 1 < len) { cn = xmlStr[pos + 1]; }\n if (c === '<') {\n inTagContent = false;\n if (cn === '/') { inTagEnd = true; }\n else if (metaData[depth].tagStart) {\n metaData[depth].tagContent = '';\n if (!metaData[depth].data) { metaData[depth].data = metaData[depth].tagStart === 'array' ? [] : {}; }\n depth++;\n metaData.push({ tagStart: '', tagEnd: '', tagContent: '', key: null, data: null });\n inTagStart = true;\n inTagContent = false;\n }\n else if (!inTagStart) { inTagStart = true; }\n } else if (c === '>') {\n if (metaData[depth].tagStart === 'true/') { inTagStart = false; inTagEnd = true; metaData[depth].tagStart = ''; metaData[depth].tagEnd = '/boolean'; metaData[depth].data = true; }\n if (metaData[depth].tagStart === 'false/') { inTagStart = false; inTagEnd = true; metaData[depth].tagStart = ''; metaData[depth].tagEnd = '/boolean'; metaData[depth].data = false; }\n if (metaData[depth].tagStart === 'array/') { inTagStart = false; inTagEnd = true; metaData[depth].tagStart = ''; metaData[depth].tagEnd = '/arrayEmpty'; metaData[depth].data = []; }\n if (inTagContent) { inTagContent = false; }\n if (inTagStart) {\n inTagStart = false;\n inTagContent = true;\n if (metaData[depth].tagStart === 'array') {\n metaData[depth].data = [];\n }\n if (metaData[depth].tagStart === 'dict') {\n metaData[depth].data = {};\n }\n }\n if (inTagEnd) {\n inTagEnd = false;\n if (metaData[depth].tagEnd && tags.indexOf(metaData[depth].tagEnd.substr(1)) >= 0) {\n if (metaData[depth].tagEnd === '/dict' || metaData[depth].tagEnd === '/array') {\n if (depth > 1 && metaData[depth - 2].tagStart === 'array') {\n metaData[depth - 2].data.push(metaData[depth - 1].data);\n }\n if (depth > 1 && metaData[depth - 2].tagStart === 'dict') {\n metaData[depth - 2].data[metaData[depth - 1].key] = metaData[depth - 1].data;\n }\n depth--;\n metaData.pop();\n metaData[depth].tagContent = '';\n metaData[depth].tagStart = '';\n metaData[depth].tagEnd = '';\n }\n else {\n if (metaData[depth].tagEnd === '/key' && metaData[depth].tagContent) {\n metaData[depth].key = metaData[depth].tagContent;\n } else {\n if (metaData[depth].tagEnd === '/real' && metaData[depth].tagContent) { metaData[depth].data = parseFloat(metaData[depth].tagContent) || 0; }\n if (metaData[depth].tagEnd === '/integer' && metaData[depth].tagContent) { metaData[depth].data = parseInt(metaData[depth].tagContent) || 0; }\n if (metaData[depth].tagEnd === '/string' && metaData[depth].tagContent) { metaData[depth].data = metaData[depth].tagContent || ''; }\n if (metaData[depth].tagEnd === '/boolean') { metaData[depth].data = metaData[depth].tagContent || false; }\n if (metaData[depth].tagEnd === '/arrayEmpty') { metaData[depth].data = metaData[depth].tagContent || []; }\n if (depth > 0 && metaData[depth - 1].tagStart === 'array') { metaData[depth - 1].data.push(metaData[depth].data); }\n if (depth > 0 && metaData[depth - 1].tagStart === 'dict') { metaData[depth - 1].data[metaData[depth].key] = metaData[depth].data; }\n }\n metaData[depth].tagContent = '';\n metaData[depth].tagStart = '';\n metaData[depth].tagEnd = '';\n }\n }\n metaData[depth].tagEnd = '';\n inTagStart = false;\n inTagContent = false;\n }\n } else {\n if (inTagStart) { metaData[depth].tagStart += c; }\n if (inTagEnd) { metaData[depth].tagEnd += c; }\n if (inTagContent) { metaData[depth].tagContent += c; }\n }\n pos++;\n }\n return metaData[0].data;\n}\n\nfunction semverCompare(v1, v2) {\n let res = 0;\n const parts1 = v1.split('.');\n const parts2 = v2.split('.');\n if (parts1[0] < parts2[0]) { res = 1; }\n else if (parts1[0] > parts2[0]) { res = -1; }\n else if (parts1[0] === parts2[0] && parts1.length >= 2 && parts2.length >= 2) {\n if (parts1[1] < parts2[1]) { res = 1; }\n else if (parts1[1] > parts2[1]) { res = -1; }\n else if (parts1[1] === parts2[1]) {\n if (parts1.length >= 3 && parts2.length >= 3) {\n if (parts1[2] < parts2[2]) { res = 1; }\n else if (parts1[2] > parts2[2]) { res = -1; }\n } else if (parts2.length >= 3) {\n res = 1;\n }\n }\n }\n return res;\n}\n\nfunction noop() { }\n\nexports.toInt = toInt;\nexports.execOptsWin = execOptsWin;\nexports.getCodepage = getCodepage;\nexports.execWin = execWin;\nexports.isFunction = isFunction;\nexports.unique = unique;\nexports.sortByKey = sortByKey;\nexports.cores = cores;\nexports.getValue = getValue;\nexports.decodeEscapeSequence = decodeEscapeSequence;\nexports.parseDateTime = parseDateTime;\nexports.parseHead = parseHead;\nexports.findObjectByKey = findObjectByKey;\nexports.getWmic = getWmic;\nexports.wmic = wmic;\nexports.darwinXcodeExists = darwinXcodeExists;\nexports.getVboxmanage = getVboxmanage;\nexports.powerShell = powerShell;\nexports.powerShellStart = powerShellStart;\nexports.powerShellRelease = powerShellRelease;\nexports.execSafe = execSafe;\nexports.nanoSeconds = nanoSeconds;\nexports.countUniqueLines = countUniqueLines;\nexports.countLines = countLines;\nexports.noop = noop;\nexports.isRaspberry = isRaspberry;\nexports.isRaspbian = isRaspbian;\nexports.sanitizeShellString = sanitizeShellString;\nexports.isPrototypePolluted = isPrototypePolluted;\nexports.decodePiCpuinfo = decodePiCpuinfo;\nexports.promiseAll = promiseAll;\nexports.promisify = promisify;\nexports.promisifySave = promisifySave;\nexports.smartMonToolsInstalled = smartMonToolsInstalled;\nexports.linuxVersion = linuxVersion;\nexports.plistParser = plistParser;\nexports.stringReplace = stringReplace;\nexports.stringToLower = stringToLower;\nexports.stringToString = stringToString;\nexports.stringSubstr = stringSubstr;\nexports.stringTrim = stringTrim;\nexports.stringStartWith = stringStartWith;\nexports.mathMin = mathMin;\nexports.WINDIR = WINDIR;\nexports.getFilesInPath = getFilesInPath;\nexports.semverCompare = semverCompare;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// virtualbox.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 14. Docker\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst exec = require('child_process').exec;\nconst util = require('./util');\n\nfunction vboxInfo(callback) {\n\n // fallback - if only callback is given\n let result = [];\n return new Promise((resolve) => {\n process.nextTick(() => {\n try {\n exec(util.getVboxmanage() + ' list vms --long', function (error, stdout) {\n let parts = (os.EOL + stdout.toString()).split(os.EOL + 'Name:');\n parts.shift();\n parts.forEach(part => {\n const lines = ('Name:' + part).split(os.EOL);\n const state = util.getValue(lines, 'State');\n const running = state.startsWith('running');\n const runningSinceString = running ? state.replace('running (since ', '').replace(')', '').trim() : '';\n let runningSince = 0;\n try {\n if (running) {\n const sinceDateObj = new Date(runningSinceString);\n const offset = sinceDateObj.getTimezoneOffset();\n runningSince = Math.round((Date.now() - Date.parse(sinceDateObj)) / 1000) + offset * 60;\n }\n } catch (e) {\n util.noop();\n }\n const stoppedSinceString = !running ? state.replace('powered off (since', '').replace(')', '').trim() : '';\n let stoppedSince = 0;\n try {\n if (!running) {\n const sinceDateObj = new Date(stoppedSinceString);\n const offset = sinceDateObj.getTimezoneOffset();\n stoppedSince = Math.round((Date.now() - Date.parse(sinceDateObj)) / 1000) + offset * 60;\n }\n } catch (e) {\n util.noop();\n }\n result.push({\n id: util.getValue(lines, 'UUID'),\n name: util.getValue(lines, 'Name'),\n running,\n started: runningSinceString,\n runningSince,\n stopped: stoppedSinceString,\n stoppedSince,\n guestOS: util.getValue(lines, 'Guest OS'),\n hardwareUUID: util.getValue(lines, 'Hardware UUID'),\n memory: parseInt(util.getValue(lines, 'Memory size', ' '), 10),\n vram: parseInt(util.getValue(lines, 'VRAM size'), 10),\n cpus: parseInt(util.getValue(lines, 'Number of CPUs'), 10),\n cpuExepCap: util.getValue(lines, 'CPU exec cap'),\n cpuProfile: util.getValue(lines, 'CPUProfile'),\n chipset: util.getValue(lines, 'Chipset'),\n firmware: util.getValue(lines, 'Firmware'),\n pageFusion: util.getValue(lines, 'Page Fusion') === 'enabled',\n configFile: util.getValue(lines, 'Config file'),\n snapshotFolder: util.getValue(lines, 'Snapshot folder'),\n logFolder: util.getValue(lines, 'Log folder'),\n hpet: util.getValue(lines, 'HPET') === 'enabled',\n pae: util.getValue(lines, 'PAE') === 'enabled',\n longMode: util.getValue(lines, 'Long Mode') === 'enabled',\n tripleFaultReset: util.getValue(lines, 'Triple Fault Reset') === 'enabled',\n apic: util.getValue(lines, 'APIC') === 'enabled',\n x2Apic: util.getValue(lines, 'X2APIC') === 'enabled',\n acpi: util.getValue(lines, 'ACPI') === 'enabled',\n ioApic: util.getValue(lines, 'IOAPIC') === 'enabled',\n biosApicMode: util.getValue(lines, 'BIOS APIC mode'),\n bootMenuMode: util.getValue(lines, 'Boot menu mode'),\n bootDevice1: util.getValue(lines, 'Boot Device 1'),\n bootDevice2: util.getValue(lines, 'Boot Device 2'),\n bootDevice3: util.getValue(lines, 'Boot Device 3'),\n bootDevice4: util.getValue(lines, 'Boot Device 4'),\n timeOffset: util.getValue(lines, 'Time offset'),\n rtc: util.getValue(lines, 'RTC'),\n });\n });\n\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n}\n\nexports.vboxInfo = vboxInfo;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// wifi.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 9. wifi\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst util = require('./util');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\n\nfunction wifiDBFromQuality(quality) {\n return (parseFloat(quality) / 2 - 100);\n}\n\nfunction wifiQualityFromDB(db) {\n const result = 2 * (parseFloat(db) + 100);\n return result <= 100 ? result : 100;\n}\n\nconst _wifi_frequencies = {\n 1: 2412,\n 2: 2417,\n 3: 2422,\n 4: 2427,\n 5: 2432,\n 6: 2437,\n 7: 2442,\n 8: 2447,\n 9: 2452,\n 10: 2457,\n 11: 2462,\n 12: 2467,\n 13: 2472,\n 14: 2484,\n 32: 5160,\n 34: 5170,\n 36: 5180,\n 38: 5190,\n 40: 5200,\n 42: 5210,\n 44: 5220,\n 46: 5230,\n 48: 5240,\n 50: 5250,\n 52: 5260,\n 54: 5270,\n 56: 5280,\n 58: 5290,\n 60: 5300,\n 62: 5310,\n 64: 5320,\n 68: 5340,\n 96: 5480,\n 100: 5500,\n 102: 5510,\n 104: 5520,\n 106: 5530,\n 108: 5540,\n 110: 5550,\n 112: 5560,\n 114: 5570,\n 116: 5580,\n 118: 5590,\n 120: 5600,\n 122: 5610,\n 124: 5620,\n 126: 5630,\n 128: 5640,\n 132: 5660,\n 134: 5670,\n 136: 5680,\n 138: 5690,\n 140: 5700,\n 142: 5710,\n 144: 5720,\n 149: 5745,\n 151: 5755,\n 153: 5765,\n 155: 5775,\n 157: 5785,\n 159: 5795,\n 161: 5805,\n 165: 5825,\n 169: 5845,\n 173: 5865,\n 183: 4915,\n 184: 4920,\n 185: 4925,\n 187: 4935,\n 188: 4940,\n 189: 4945,\n 192: 4960,\n 196: 4980\n};\n\nfunction wifiFrequencyFromChannel(channel) {\n return {}.hasOwnProperty.call(_wifi_frequencies, channel) ? _wifi_frequencies[channel] : null;\n}\n\nfunction wifiChannelFromFrequencs(frequency) {\n let channel = 0;\n for (let key in _wifi_frequencies) {\n if ({}.hasOwnProperty.call(_wifi_frequencies, key)) {\n if (_wifi_frequencies[key] === frequency) { channel = util.toInt(key); }\n }\n }\n return channel;\n}\n\nfunction ifaceListLinux() {\n const result = [];\n const cmd = 'iw dev';\n try {\n const all = execSync(cmd).toString().split('\\n').map(line => line.trim()).join('\\n');\n const parts = all.split('\\nInterface ');\n parts.shift();\n parts.forEach(ifaceDetails => {\n const lines = ifaceDetails.split('\\n');\n const iface = lines[0];\n const id = util.toInt(util.getValue(lines, 'ifindex', ' '));\n const mac = util.getValue(lines, 'addr', ' ');\n const channel = util.toInt(util.getValue(lines, 'channel', ' '));\n result.push({\n id,\n iface,\n mac,\n channel\n });\n });\n return result;\n } catch (e) {\n return [];\n }\n}\n\nfunction nmiDeviceLinux(iface) {\n const cmd = `nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${iface} 2>/dev/null`;\n try {\n const lines = execSync(cmd).toString().split('\\n');\n const ssid = util.getValue(lines, 'GENERAL.CONNECTION');\n return {\n iface,\n type: util.getValue(lines, 'GENERAL.TYPE'),\n vendor: util.getValue(lines, 'GENERAL.VENDOR'),\n product: util.getValue(lines, 'GENERAL.PRODUCT'),\n mac: util.getValue(lines, 'GENERAL.HWADDR').toLowerCase(),\n ssid: ssid !== '--' ? ssid : null\n };\n } catch (e) {\n return {};\n }\n}\n\nfunction nmiConnectionLinux(ssid) {\n const cmd = `nmcli -t --show-secrets connection show ${ssid} 2>/dev/null`;\n try {\n const lines = execSync(cmd).toString().split('\\n');\n const bssid = util.getValue(lines, '802-11-wireless.seen-bssids').toLowerCase();\n return {\n ssid: ssid !== '--' ? ssid : null,\n uuid: util.getValue(lines, 'connection.uuid'),\n type: util.getValue(lines, 'connection.type'),\n autoconnect: util.getValue(lines, 'connection.autoconnect') === 'yes',\n security: util.getValue(lines, '802-11-wireless-security.key-mgmt'),\n bssid: bssid !== '--' ? bssid : null\n };\n } catch (e) {\n return {};\n }\n}\n\nfunction wpaConnectionLinux(iface) {\n const cmd = `wpa_cli -i ${iface} status 2>&1`;\n try {\n const lines = execSync(cmd).toString().split('\\n');\n const freq = util.toInt(util.getValue(lines, 'freq', '='));\n return {\n ssid: util.getValue(lines, 'ssid', '='),\n uuid: util.getValue(lines, 'uuid', '='),\n security: util.getValue(lines, 'key_mgmt', '='),\n freq,\n channel: wifiChannelFromFrequencs(freq),\n bssid: util.getValue(lines, 'bssid', '=').toLowerCase()\n };\n } catch (e) {\n return {};\n }\n}\n\nfunction getWifiNetworkListNmi() {\n const result = [];\n const cmd = 'nmcli -t -m multiline --fields active,ssid,bssid,mode,chan,freq,signal,security,wpa-flags,rsn-flags device wifi list 2>/dev/null';\n try {\n const stdout = execSync(cmd, { maxBuffer: 1024 * 20000 });\n const parts = stdout.toString().split('ACTIVE:');\n parts.shift();\n parts.forEach(part => {\n part = 'ACTIVE:' + part;\n const lines = part.split(os.EOL);\n const channel = util.getValue(lines, 'CHAN');\n const frequency = util.getValue(lines, 'FREQ').toLowerCase().replace('mhz', '').trim();\n const security = util.getValue(lines, 'SECURITY').replace('(', '').replace(')', '');\n const wpaFlags = util.getValue(lines, 'WPA-FLAGS').replace('(', '').replace(')', '');\n const rsnFlags = util.getValue(lines, 'RSN-FLAGS').replace('(', '').replace(')', '');\n result.push({\n ssid: util.getValue(lines, 'SSID'),\n bssid: util.getValue(lines, 'BSSID').toLowerCase(),\n mode: util.getValue(lines, 'MODE'),\n channel: channel ? parseInt(channel, 10) : null,\n frequency: frequency ? parseInt(frequency, 10) : null,\n signalLevel: wifiDBFromQuality(util.getValue(lines, 'SIGNAL')),\n quality: parseFloat(util.getValue(lines, 'SIGNAL')),\n security: security && security !== 'none' ? security.split(' ') : [],\n wpaFlags: wpaFlags && wpaFlags !== 'none' ? wpaFlags.split(' ') : [],\n rsnFlags: rsnFlags && rsnFlags !== 'none' ? rsnFlags.split(' ') : []\n });\n });\n return result;\n } catch (e) {\n return [];\n }\n}\n\nfunction getWifiNetworkListIw(iface) {\n const result = [];\n try {\n let iwlistParts = execSync(`export LC_ALL=C; iwlist ${iface} scan 2>&1; unset LC_ALL`).toString().split(' Cell ');\n if (iwlistParts[0].indexOf('resource busy') >= 0) { return -1; }\n if (iwlistParts.length > 1) {\n iwlistParts.shift();\n for (let i = 0; i < iwlistParts.length; i++) {\n const lines = iwlistParts[i].split('\\n');\n const channel = util.getValue(lines, 'channel', ':', true);\n const address = (lines && lines.length && lines[0].indexOf('Address:') >= 0 ? lines[0].split('Address:')[1].trim().toLowerCase() : '');\n const mode = util.getValue(lines, 'mode', ':', true);\n const frequency = util.getValue(lines, 'frequency', ':', true);\n const qualityString = util.getValue(lines, 'Quality', '=', true);\n const dbParts = qualityString.toLowerCase().split('signal level=');\n const db = dbParts.length > 1 ? util.toInt(dbParts[1]) : 0;\n const quality = db ? wifiQualityFromDB(db) : 0;\n const ssid = util.getValue(lines, 'essid', ':', true);\n\n // security and wpa-flags\n const isWpa = iwlistParts[i].indexOf(' WPA ') >= 0;\n const isWpa2 = iwlistParts[i].indexOf('WPA2 ') >= 0;\n const security = [];\n if (isWpa) { security.push('WPA'); }\n if (isWpa2) { security.push('WPA2'); }\n const wpaFlags = [];\n let wpaFlag = '';\n lines.forEach(function (line) {\n const l = line.trim().toLowerCase();\n if (l.indexOf('group cipher') >= 0) {\n if (wpaFlag) {\n wpaFlags.push(wpaFlag);\n }\n const parts = l.split(':');\n if (parts.length > 1) {\n wpaFlag = parts[1].trim().toUpperCase();\n }\n }\n if (l.indexOf('pairwise cipher') >= 0) {\n const parts = l.split(':');\n if (parts.length > 1) {\n if (parts[1].indexOf('tkip')) { wpaFlag = (wpaFlag ? 'TKIP/' + wpaFlag : 'TKIP'); }\n else if (parts[1].indexOf('ccmp')) { wpaFlag = (wpaFlag ? 'CCMP/' + wpaFlag : 'CCMP'); }\n else if (parts[1].indexOf('proprietary')) { wpaFlag = (wpaFlag ? 'PROP/' + wpaFlag : 'PROP'); }\n }\n }\n if (l.indexOf('authentication suites') >= 0) {\n const parts = l.split(':');\n if (parts.length > 1) {\n if (parts[1].indexOf('802.1x')) { wpaFlag = (wpaFlag ? '802.1x/' + wpaFlag : '802.1x'); }\n else if (parts[1].indexOf('psk')) { wpaFlag = (wpaFlag ? 'PSK/' + wpaFlag : 'PSK'); }\n }\n }\n });\n if (wpaFlag) {\n wpaFlags.push(wpaFlag);\n }\n\n result.push({\n ssid,\n bssid: address,\n mode,\n channel: channel ? util.toInt(channel) : null,\n frequency: frequency ? util.toInt(frequency.replace('.', '')) : null,\n signalLevel: db,\n quality,\n security,\n wpaFlags,\n rsnFlags: []\n });\n }\n }\n return result;\n } catch (e) {\n return -1;\n }\n}\n\n/*\n ssid: line.substring(parsedhead[0].from, parsedhead[0].to).trim(),\n bssid: line.substring(parsedhead[1].from, parsedhead[1].to).trim().toLowerCase(),\n mode: '',\n channel,\n frequency: wifiFrequencyFromChannel(channel),\n signalLevel: signalLevel ? parseInt(signalLevel, 10) : null,\n quality: wifiQualityFromDB(signalLevel),\n security,\n wpaFlags,\n rsnFlags: []\n\n const securityAll = line.substring(parsedhead[6].from, 1000).trim().split(' ');\n let security = [];\n let wpaFlags = [];\n securityAll.forEach(securitySingle => {\n if (securitySingle.indexOf('(') > 0) {\n const parts = securitySingle.split('(');\n security.push(parts[0]);\n wpaFlags = wpaFlags.concat(parts[1].replace(')', '').split(','));\n }\n });\n\n*/\nfunction parseWifiDarwin(wifiObj) {\n const result = [];\n if (wifiObj) {\n wifiObj.forEach(function (wifiItem) {\n const signalLevel = wifiItem.RSSI;\n let security = [];\n let wpaFlags = [];\n if (wifiItem.WPA_IE) {\n security.push('WPA');\n if (wifiItem.WPA_IE.IE_KEY_WPA_UCIPHERS) {\n wifiItem.WPA_IE.IE_KEY_WPA_UCIPHERS.forEach(function (ciphers) {\n if (ciphers === 0 && wpaFlags.indexOf('unknown/TKIP') === -1) { wpaFlags.push('unknown/TKIP'); }\n if (ciphers === 2 && wpaFlags.indexOf('PSK/TKIP') === -1) { wpaFlags.push('PSK/TKIP'); }\n if (ciphers === 4 && wpaFlags.indexOf('PSK/AES') === -1) { wpaFlags.push('PSK/AES'); }\n });\n }\n }\n if (wifiItem.RSN_IE) {\n security.push('WPA2');\n if (wifiItem.RSN_IE.IE_KEY_RSN_UCIPHERS) {\n wifiItem.RSN_IE.IE_KEY_RSN_UCIPHERS.forEach(function (ciphers) {\n if (ciphers === 0 && wpaFlags.indexOf('unknown/TKIP') === -1) { wpaFlags.push('unknown/TKIP'); }\n if (ciphers === 2 && wpaFlags.indexOf('TKIP/TKIP') === -1) { wpaFlags.push('TKIP/TKIP'); }\n if (ciphers === 4 && wpaFlags.indexOf('PSK/AES') === -1) { wpaFlags.push('PSK/AES'); }\n });\n }\n }\n result.push({\n ssid: wifiItem.SSID_STR,\n bssid: wifiItem.BSSID,\n mode: '',\n channel: wifiItem.CHANNEL,\n frequency: wifiFrequencyFromChannel(wifiItem.CHANNEL),\n signalLevel: signalLevel ? parseInt(signalLevel, 10) : null,\n quality: wifiQualityFromDB(signalLevel),\n security,\n wpaFlags,\n rsnFlags: []\n });\n });\n }\n return result;\n}\nfunction wifiNetworks(callback) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = [];\n if (_linux) {\n result = getWifiNetworkListNmi();\n if (result.length === 0) {\n try {\n const iwconfigParts = execSync('export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL').toString().split('\\n\\n');\n let iface = '';\n for (let i = 0; i < iwconfigParts.length; i++) {\n if (iwconfigParts[i].indexOf('no wireless') === -1 && iwconfigParts[i].trim() !== '') {\n iface = iwconfigParts[i].split(' ')[0];\n }\n }\n if (iface) {\n const res = getWifiNetworkListIw(iface);\n if (res === -1) {\n // try again after 4 secs\n setTimeout(function (iface) {\n const res = getWifiNetworkListIw(iface);\n if (res != -1) { result = res; }\n if (callback) {\n callback(result);\n }\n resolve(result);\n }, 4000);\n } else {\n result = res;\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n } catch (e) {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n } else if (_darwin) {\n let cmd = '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s -x';\n exec(cmd, { maxBuffer: 1024 * 40000 }, function (error, stdout) {\n const output = stdout.toString();\n result = parseWifiDarwin(util.plistParser(output));\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else if (_windows) {\n let cmd = 'netsh wlan show networks mode=Bssid';\n util.powerShell(cmd).then((stdout) => {\n const ssidParts = stdout.toString('utf8').split(os.EOL + os.EOL + 'SSID ');\n ssidParts.shift();\n\n ssidParts.forEach(ssidPart => {\n const ssidLines = ssidPart.split(os.EOL);\n if (ssidLines && ssidLines.length >= 8 && ssidLines[0].indexOf(':') >= 0) {\n const bssidsParts = ssidPart.split(' BSSID');\n bssidsParts.shift();\n\n bssidsParts.forEach((bssidPart) => {\n const bssidLines = bssidPart.split(os.EOL);\n const bssidLine = bssidLines[0].split(':');\n bssidLine.shift();\n const bssid = bssidLine.join(':').trim().toLowerCase();\n const channel = bssidLines[3].split(':').pop().trim();\n const quality = bssidLines[1].split(':').pop().trim();\n\n result.push({\n ssid: ssidLines[0].split(':').pop().trim(),\n bssid,\n mode: '',\n channel: channel ? parseInt(channel, 10) : null,\n frequency: wifiFrequencyFromChannel(channel),\n signalLevel: wifiDBFromQuality(quality),\n quality: quality ? parseInt(quality, 10) : null,\n security: [ssidLines[2].split(':').pop().trim()],\n wpaFlags: [ssidLines[3].split(':').pop().trim()],\n rsnFlags: []\n });\n });\n }\n });\n\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n });\n}\n\nexports.wifiNetworks = wifiNetworks;\n\nfunction getVendor(model) {\n model = model.toLowerCase();\n let result = '';\n if (model.indexOf('intel') >= 0) { result = 'Intel'; }\n else if (model.indexOf('realtek') >= 0) { result = 'Realtek'; }\n else if (model.indexOf('qualcom') >= 0) { result = 'Qualcom'; }\n else if (model.indexOf('broadcom') >= 0) { result = 'Broadcom'; }\n else if (model.indexOf('cavium') >= 0) { result = 'Cavium'; }\n else if (model.indexOf('cisco') >= 0) { result = 'Cisco'; }\n else if (model.indexOf('marvel') >= 0) { result = 'Marvel'; }\n else if (model.indexOf('zyxel') >= 0) { result = 'Zyxel'; }\n else if (model.indexOf('melanox') >= 0) { result = 'Melanox'; }\n else if (model.indexOf('d-link') >= 0) { result = 'D-Link'; }\n else if (model.indexOf('tp-link') >= 0) { result = 'TP-Link'; }\n else if (model.indexOf('asus') >= 0) { result = 'Asus'; }\n else if (model.indexOf('linksys') >= 0) { result = 'Linksys'; }\n return result;\n}\n\nfunction wifiConnections(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n const result = [];\n\n if (_linux) {\n const ifaces = ifaceListLinux();\n const networkList = getWifiNetworkListNmi();\n ifaces.forEach(ifaceDetail => {\n const nmiDetails = nmiDeviceLinux(ifaceDetail.iface);\n const wpaDetails = wpaConnectionLinux(ifaceDetail.iface);\n const ssid = nmiDetails.ssid || wpaDetails.ssid;\n const network = networkList.filter(nw => nw.ssid === ssid);\n const nmiConnection = nmiConnectionLinux(ssid);\n const channel = network && network.length && network[0].channel ? network[0].channel : (wpaDetails.channel ? wpaDetails.channel : null);\n const bssid = network && network.length && network[0].bssid ? network[0].bssid : (wpaDetails.bssid ? wpaDetails.bssid : null);\n if (ssid && bssid) {\n result.push({\n id: ifaceDetail.id,\n iface: ifaceDetail.iface,\n model: nmiDetails.product,\n ssid,\n bssid: network && network.length && network[0].bssid ? network[0].bssid : (wpaDetails.bssid ? wpaDetails.bssid : null),\n channel,\n frequency: channel ? wifiFrequencyFromChannel(channel) : null,\n type: nmiConnection.type ? nmiConnection.type : '802.11',\n security: nmiConnection.security ? nmiConnection.security : (wpaDetails.security ? wpaDetails.security : null),\n signalLevel: network && network.length && network[0].signalLevel ? network[0].signalLevel : null,\n txRate: null\n });\n }\n });\n if (callback) {\n callback(result);\n }\n resolve(result);\n } else if (_darwin) {\n let cmd = 'system_profiler SPNetworkDataType';\n exec(cmd, function (error, stdout) {\n const parts1 = stdout.toString().split('\\n\\n Wi-Fi:\\n\\n');\n if (parts1.length > 1) {\n const lines = parts1[1].split('\\n\\n')[0].split('\\n');\n const iface = util.getValue(lines, 'BSD Device Name', ':', true);\n const model = util.getValue(lines, 'hardware', ':', true);\n cmd = '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I';\n exec(cmd, function (error, stdout) {\n const lines2 = stdout.toString().split('\\n');\n if (lines.length > 10) {\n const ssid = util.getValue(lines2, 'ssid', ':', true);\n const bssid = util.getValue(lines2, 'bssid', ':', true);\n const security = util.getValue(lines2, 'link auth', ':', true);\n const txRate = util.getValue(lines2, 'lastTxRate', ':', true);\n const channel = util.getValue(lines2, 'channel', ':', true).split(',')[0];\n const type = '802.11';\n const rssi = util.toInt(util.getValue(lines2, 'agrCtlRSSI', ':', true));\n const noise = util.toInt(util.getValue(lines2, 'agrCtlNoise', ':', true));\n const signalLevel = rssi - noise;\n // const signal = wifiQualityFromDB(signalLevel);\n if (ssid || bssid) {\n result.push({\n id: 'Wi-Fi',\n iface,\n model,\n ssid,\n bssid,\n channel: util.toInt(channel),\n frequency: channel ? wifiFrequencyFromChannel(channel) : null,\n type,\n security,\n signalLevel,\n txRate\n });\n\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n });\n } else if (_windows) {\n let cmd = 'netsh wlan show interfaces';\n util.powerShell(cmd).then(function (stdout) {\n const allLines = stdout.toString().split('\\r\\n');\n for (let i = 0; i < allLines.length; i++) {\n allLines[i] = allLines[i].trim();\n }\n const parts = allLines.join('\\r\\n').split(':\\r\\n\\r\\n');\n parts.shift();\n parts.forEach(part => {\n const lines = part.split('\\r\\n');\n if (lines.length >= 5) {\n const iface = lines[0].indexOf(':') >= 0 ? lines[0].split(':')[1].trim() : '';\n const model = lines[1].indexOf(':') >= 0 ? lines[1].split(':')[1].trim() : '';\n const id = lines[2].indexOf(':') >= 0 ? lines[2].split(':')[1].trim() : '';\n const ssid = util.getValue(lines, 'SSID', ':', true);\n const bssid = util.getValue(lines, 'BSSID', ':', true);\n const signalLevel = util.getValue(lines, 'Signal', ':', true);\n const type = util.getValue(lines, 'Radio type', ':', true) || util.getValue(lines, 'Type de radio', ':', true) || util.getValue(lines, 'Funktyp', ':', true) || null;\n const security = util.getValue(lines, 'authentication', ':', true) || util.getValue(lines, 'Authentification', ':', true) || util.getValue(lines, 'Authentifizierung', ':', true) || null;\n const channel = util.getValue(lines, 'Channel', ':', true) || util.getValue(lines, 'Canal', ':', true) || util.getValue(lines, 'Kanal', ':', true) || null;\n const txRate = util.getValue(lines, 'Transmit rate (mbps)', ':', true) || util.getValue(lines, 'Transmission (mbit/s)', ':', true) || util.getValue(lines, 'Empfangsrate (MBit/s)', ':', true) || null;\n if (model && id && ssid && bssid) {\n result.push({\n id,\n iface,\n model,\n ssid,\n bssid,\n channel: util.toInt(channel),\n frequency: channel ? wifiFrequencyFromChannel(channel) : null,\n type,\n security,\n signalLevel,\n txRate: util.toInt(txRate) || null\n });\n }\n }\n });\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n });\n}\n\nexports.wifiConnections = wifiConnections;\n\nfunction wifiInterfaces(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n const result = [];\n\n if (_linux) {\n const ifaces = ifaceListLinux();\n ifaces.forEach(ifaceDetail => {\n const nmiDetails = nmiDeviceLinux(ifaceDetail.iface);\n result.push({\n id: ifaceDetail.id,\n iface: ifaceDetail.iface,\n model: nmiDetails.product ? nmiDetails.product : null,\n vendor: nmiDetails.vendor ? nmiDetails.vendor : null,\n mac: ifaceDetail.mac,\n });\n });\n if (callback) {\n callback(result);\n }\n resolve(result);\n } else if (_darwin) {\n let cmd = 'system_profiler SPNetworkDataType';\n exec(cmd, function (error, stdout) {\n const parts1 = stdout.toString().split('\\n\\n Wi-Fi:\\n\\n');\n if (parts1.length > 1) {\n const lines = parts1[1].split('\\n\\n')[0].split('\\n');\n const iface = util.getValue(lines, 'BSD Device Name', ':', true);\n const mac = util.getValue(lines, 'MAC Address', ':', true);\n const model = util.getValue(lines, 'hardware', ':', true);\n result.push({\n id: 'Wi-Fi',\n iface,\n model,\n vendor: '',\n mac\n });\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else if (_windows) {\n let cmd = 'netsh wlan show interfaces';\n util.powerShell(cmd).then(function (stdout) {\n const allLines = stdout.toString().split('\\r\\n');\n for (let i = 0; i < allLines.length; i++) {\n allLines[i] = allLines[i].trim();\n }\n const parts = allLines.join('\\r\\n').split(':\\r\\n\\r\\n');\n parts.shift();\n parts.forEach(part => {\n const lines = part.split('\\r\\n');\n if (lines.length >= 5) {\n const iface = lines[0].indexOf(':') >= 0 ? lines[0].split(':')[1].trim() : '';\n const model = lines[1].indexOf(':') >= 0 ? lines[1].split(':')[1].trim() : '';\n const id = lines[2].indexOf(':') >= 0 ? lines[2].split(':')[1].trim() : '';\n const macParts = lines[3].indexOf(':') >= 0 ? lines[3].split(':') : [];\n macParts.shift();\n const mac = macParts.join(':').trim();\n const vendor = getVendor(model);\n if (iface && model && id && mac) {\n result.push({\n id,\n iface,\n model,\n vendor,\n mac,\n });\n }\n }\n });\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n });\n}\n\nexports.wifiInterfaces = wifiInterfaces;\n","\"use strict\";\n\nvar punycode = require(\"punycode\");\nvar mappingTable = require(\"./lib/mappingTable.json\");\n\nvar PROCESSING_OPTIONS = {\n TRANSITIONAL: 0,\n NONTRANSITIONAL: 1\n};\n\nfunction normalize(str) { // fix bug in v8\n return str.split('\\u0000').map(function (s) { return s.normalize('NFC'); }).join('\\u0000');\n}\n\nfunction findStatus(val) {\n var start = 0;\n var end = mappingTable.length - 1;\n\n while (start <= end) {\n var mid = Math.floor((start + end) / 2);\n\n var target = mappingTable[mid];\n if (target[0][0] <= val && target[0][1] >= val) {\n return target;\n } else if (target[0][0] > val) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n }\n\n return null;\n}\n\nvar regexAstralSymbols = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n\nfunction countSymbols(string) {\n return string\n // replace every surrogate pair with a BMP symbol\n .replace(regexAstralSymbols, '_')\n // then get the length\n .length;\n}\n\nfunction mapChars(domain_name, useSTD3, processing_option) {\n var hasError = false;\n var processed = \"\";\n\n var len = countSymbols(domain_name);\n for (var i = 0; i < len; ++i) {\n var codePoint = domain_name.codePointAt(i);\n var status = findStatus(codePoint);\n\n switch (status[1]) {\n case \"disallowed\":\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n break;\n case \"ignored\":\n break;\n case \"mapped\":\n processed += String.fromCodePoint.apply(String, status[2]);\n break;\n case \"deviation\":\n if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) {\n processed += String.fromCodePoint.apply(String, status[2]);\n } else {\n processed += String.fromCodePoint(codePoint);\n }\n break;\n case \"valid\":\n processed += String.fromCodePoint(codePoint);\n break;\n case \"disallowed_STD3_mapped\":\n if (useSTD3) {\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n } else {\n processed += String.fromCodePoint.apply(String, status[2]);\n }\n break;\n case \"disallowed_STD3_valid\":\n if (useSTD3) {\n hasError = true;\n }\n\n processed += String.fromCodePoint(codePoint);\n break;\n }\n }\n\n return {\n string: processed,\n error: hasError\n };\n}\n\nvar combiningMarksRegex = /[\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D01-\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1ABE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF8\\u1CF9\\u1DC0-\\u1DF5\\u1DFC-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2D]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDE2C-\\uDE37\\uDEDF-\\uDEEA\\uDF01-\\uDF03\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDE30-\\uDE40\\uDEAB-\\uDEB7]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD83A[\\uDCD0-\\uDCD6]|\\uDB40[\\uDD00-\\uDDEF]/;\n\nfunction validateLabel(label, processing_option) {\n if (label.substr(0, 4) === \"xn--\") {\n label = punycode.toUnicode(label);\n processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL;\n }\n\n var error = false;\n\n if (normalize(label) !== label ||\n (label[3] === \"-\" && label[4] === \"-\") ||\n label[0] === \"-\" || label[label.length - 1] === \"-\" ||\n label.indexOf(\".\") !== -1 ||\n label.search(combiningMarksRegex) === 0) {\n error = true;\n }\n\n var len = countSymbols(label);\n for (var i = 0; i < len; ++i) {\n var status = findStatus(label.codePointAt(i));\n if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== \"valid\") ||\n (processing === PROCESSING_OPTIONS.NONTRANSITIONAL &&\n status[1] !== \"valid\" && status[1] !== \"deviation\")) {\n error = true;\n break;\n }\n }\n\n return {\n label: label,\n error: error\n };\n}\n\nfunction processing(domain_name, useSTD3, processing_option) {\n var result = mapChars(domain_name, useSTD3, processing_option);\n result.string = normalize(result.string);\n\n var labels = result.string.split(\".\");\n for (var i = 0; i < labels.length; ++i) {\n try {\n var validation = validateLabel(labels[i]);\n labels[i] = validation.label;\n result.error = result.error || validation.error;\n } catch(e) {\n result.error = true;\n }\n }\n\n return {\n string: labels.join(\".\"),\n error: result.error\n };\n}\n\nmodule.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) {\n var result = processing(domain_name, useSTD3, processing_option);\n var labels = result.string.split(\".\");\n labels = labels.map(function(l) {\n try {\n return punycode.toASCII(l);\n } catch(e) {\n result.error = true;\n return l;\n }\n });\n\n if (verifyDnsLength) {\n var total = labels.slice(0, labels.length - 1).join(\".\").length;\n if (total.length > 253 || total.length === 0) {\n result.error = true;\n }\n\n for (var i=0; i < labels.length; ++i) {\n if (labels.length > 63 || labels.length === 0) {\n result.error = true;\n break;\n }\n }\n }\n\n if (result.error) return null;\n return labels.join(\".\");\n};\n\nmodule.exports.toUnicode = function(domain_name, useSTD3) {\n var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL);\n\n return {\n domain: result.string,\n error: result.error\n };\n};\n\nmodule.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS;\n","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction getUserAgent() {\n if (typeof navigator === \"object\" && \"userAgent\" in navigator) {\n return navigator.userAgent;\n }\n\n if (typeof process === \"object\" && \"version\" in process) {\n return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;\n }\n\n return \"\";\n}\n\nexports.getUserAgent = getUserAgent;\n//# sourceMappingURL=index.js.map\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto\");;","import crypto from 'crypto';\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\nexport default function rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n crypto.randomFillSync(rnds8Pool);\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js'; // **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || rng)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || stringify(b);\n}\n\nexport default v1;","import validate from './validate.js';\n\nfunction parse(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nexport default parse;","import stringify from './stringify.js';\nimport parse from './parse.js';\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nexport const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexport const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexport default function (name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = parse(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return stringify(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","import crypto from 'crypto';\n\nfunction md5(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return crypto.createHash('md5').update(bytes).digest();\n}\n\nexport default md5;","import v35 from './v35.js';\nimport md5 from './md5.js';\nconst v3 = v35('v3', 0x30, md5);\nexport default v3;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","import crypto from 'crypto';\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return crypto.createHash('sha1').update(bytes).digest();\n}\n\nexport default sha1;","import v35 from './v35.js';\nimport sha1 from './sha1.js';\nconst v5 = v35('v5', 0x50, sha1);\nexport default v5;","export default '00000000-0000-0000-0000-000000000000';","import validate from './validate.js';\n\nfunction version(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nexport default version;","export { default as v1 } from './v1.js';\nexport { default as v3 } from './v3.js';\nexport { default as v4 } from './v4.js';\nexport { default as v5 } from './v5.js';\nexport { default as NIL } from './nil.js';\nexport { default as version } from './version.js';\nexport { default as validate } from './validate.js';\nexport { default as stringify } from './stringify.js';\nexport { default as parse } from './parse.js';","\"use strict\";\n\nvar conversions = {};\nmodule.exports = conversions;\n\nfunction sign(x) {\n return x < 0 ? -1 : 1;\n}\n\nfunction evenRound(x) {\n // Round x to the nearest integer, choosing the even integer if it lies halfway between two.\n if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor)\n return Math.floor(x);\n } else {\n return Math.round(x);\n }\n}\n\nfunction createNumberConversion(bitLength, typeOpts) {\n if (!typeOpts.unsigned) {\n --bitLength;\n }\n const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);\n const upperBound = Math.pow(2, bitLength) - 1;\n\n const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);\n const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);\n\n return function(V, opts) {\n if (!opts) opts = {};\n\n let x = +V;\n\n if (opts.enforceRange) {\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite number\");\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(\"Argument is not in byte range\");\n }\n\n return x;\n }\n\n if (!isNaN(x) && opts.clamp) {\n x = evenRound(x);\n\n if (x < lowerBound) x = lowerBound;\n if (x > upperBound) x = upperBound;\n return x;\n }\n\n if (!Number.isFinite(x) || x === 0) {\n return 0;\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n x = x % moduloVal;\n\n if (!typeOpts.unsigned && x >= moduloBound) {\n return x - moduloVal;\n } else if (typeOpts.unsigned) {\n if (x < 0) {\n x += moduloVal;\n } else if (x === -0) { // don't return negative zero\n return 0;\n }\n }\n\n return x;\n }\n}\n\nconversions[\"void\"] = function () {\n return undefined;\n};\n\nconversions[\"boolean\"] = function (val) {\n return !!val;\n};\n\nconversions[\"byte\"] = createNumberConversion(8, { unsigned: false });\nconversions[\"octet\"] = createNumberConversion(8, { unsigned: true });\n\nconversions[\"short\"] = createNumberConversion(16, { unsigned: false });\nconversions[\"unsigned short\"] = createNumberConversion(16, { unsigned: true });\n\nconversions[\"long\"] = createNumberConversion(32, { unsigned: false });\nconversions[\"unsigned long\"] = createNumberConversion(32, { unsigned: true });\n\nconversions[\"long long\"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });\nconversions[\"unsigned long long\"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });\n\nconversions[\"double\"] = function (V) {\n const x = +V;\n\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite floating-point value\");\n }\n\n return x;\n};\n\nconversions[\"unrestricted double\"] = function (V) {\n const x = +V;\n\n if (isNaN(x)) {\n throw new TypeError(\"Argument is NaN\");\n }\n\n return x;\n};\n\n// not quite valid, but good enough for JS\nconversions[\"float\"] = conversions[\"double\"];\nconversions[\"unrestricted float\"] = conversions[\"unrestricted double\"];\n\nconversions[\"DOMString\"] = function (V, opts) {\n if (!opts) opts = {};\n\n if (opts.treatNullAsEmptyString && V === null) {\n return \"\";\n }\n\n return String(V);\n};\n\nconversions[\"ByteString\"] = function (V, opts) {\n const x = String(V);\n let c = undefined;\n for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {\n if (c > 255) {\n throw new TypeError(\"Argument is not a valid bytestring\");\n }\n }\n\n return x;\n};\n\nconversions[\"USVString\"] = function (V) {\n const S = String(V);\n const n = S.length;\n const U = [];\n for (let i = 0; i < n; ++i) {\n const c = S.charCodeAt(i);\n if (c < 0xD800 || c > 0xDFFF) {\n U.push(String.fromCodePoint(c));\n } else if (0xDC00 <= c && c <= 0xDFFF) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n if (i === n - 1) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n const d = S.charCodeAt(i + 1);\n if (0xDC00 <= d && d <= 0xDFFF) {\n const a = c & 0x3FF;\n const b = d & 0x3FF;\n U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b));\n ++i;\n } else {\n U.push(String.fromCodePoint(0xFFFD));\n }\n }\n }\n }\n\n return U.join('');\n};\n\nconversions[\"Date\"] = function (V, opts) {\n if (!(V instanceof Date)) {\n throw new TypeError(\"Argument is not a Date object\");\n }\n if (isNaN(V)) {\n return undefined;\n }\n\n return V;\n};\n\nconversions[\"RegExp\"] = function (V, opts) {\n if (!(V instanceof RegExp)) {\n V = new RegExp(V);\n }\n\n return V;\n};\n","\"use strict\";\nconst usm = require(\"./url-state-machine\");\n\nexports.implementation = class URLImpl {\n constructor(constructorArgs) {\n const url = constructorArgs[0];\n const base = constructorArgs[1];\n\n let parsedBase = null;\n if (base !== undefined) {\n parsedBase = usm.basicURLParse(base);\n if (parsedBase === \"failure\") {\n throw new TypeError(\"Invalid base URL\");\n }\n }\n\n const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n\n // TODO: query stuff\n }\n\n get href() {\n return usm.serializeURL(this._url);\n }\n\n set href(v) {\n const parsedURL = usm.basicURLParse(v);\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n }\n\n get origin() {\n return usm.serializeURLOrigin(this._url);\n }\n\n get protocol() {\n return this._url.scheme + \":\";\n }\n\n set protocol(v) {\n usm.basicURLParse(v + \":\", { url: this._url, stateOverride: \"scheme start\" });\n }\n\n get username() {\n return this._url.username;\n }\n\n set username(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setTheUsername(this._url, v);\n }\n\n get password() {\n return this._url.password;\n }\n\n set password(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setThePassword(this._url, v);\n }\n\n get host() {\n const url = this._url;\n\n if (url.host === null) {\n return \"\";\n }\n\n if (url.port === null) {\n return usm.serializeHost(url.host);\n }\n\n return usm.serializeHost(url.host) + \":\" + usm.serializeInteger(url.port);\n }\n\n set host(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"host\" });\n }\n\n get hostname() {\n if (this._url.host === null) {\n return \"\";\n }\n\n return usm.serializeHost(this._url.host);\n }\n\n set hostname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"hostname\" });\n }\n\n get port() {\n if (this._url.port === null) {\n return \"\";\n }\n\n return usm.serializeInteger(this._url.port);\n }\n\n set port(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n if (v === \"\") {\n this._url.port = null;\n } else {\n usm.basicURLParse(v, { url: this._url, stateOverride: \"port\" });\n }\n }\n\n get pathname() {\n if (this._url.cannotBeABaseURL) {\n return this._url.path[0];\n }\n\n if (this._url.path.length === 0) {\n return \"\";\n }\n\n return \"/\" + this._url.path.join(\"/\");\n }\n\n set pathname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n this._url.path = [];\n usm.basicURLParse(v, { url: this._url, stateOverride: \"path start\" });\n }\n\n get search() {\n if (this._url.query === null || this._url.query === \"\") {\n return \"\";\n }\n\n return \"?\" + this._url.query;\n }\n\n set search(v) {\n // TODO: query stuff\n\n const url = this._url;\n\n if (v === \"\") {\n url.query = null;\n return;\n }\n\n const input = v[0] === \"?\" ? v.substring(1) : v;\n url.query = \"\";\n usm.basicURLParse(input, { url, stateOverride: \"query\" });\n }\n\n get hash() {\n if (this._url.fragment === null || this._url.fragment === \"\") {\n return \"\";\n }\n\n return \"#\" + this._url.fragment;\n }\n\n set hash(v) {\n if (v === \"\") {\n this._url.fragment = null;\n return;\n }\n\n const input = v[0] === \"#\" ? v.substring(1) : v;\n this._url.fragment = \"\";\n usm.basicURLParse(input, { url: this._url, stateOverride: \"fragment\" });\n }\n\n toJSON() {\n return this.href;\n }\n};\n","\"use strict\";\n\nconst conversions = require(\"webidl-conversions\");\nconst utils = require(\"./utils.js\");\nconst Impl = require(\".//URL-impl.js\");\n\nconst impl = utils.implSymbol;\n\nfunction URL(url) {\n if (!this || this[impl] || !(this instanceof URL)) {\n throw new TypeError(\"Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.\");\n }\n if (arguments.length < 1) {\n throw new TypeError(\"Failed to construct 'URL': 1 argument required, but only \" + arguments.length + \" present.\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 2; ++i) {\n args[i] = arguments[i];\n }\n args[0] = conversions[\"USVString\"](args[0]);\n if (args[1] !== undefined) {\n args[1] = conversions[\"USVString\"](args[1]);\n }\n\n module.exports.setup(this, args);\n}\n\nURL.prototype.toJSON = function toJSON() {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 0; ++i) {\n args[i] = arguments[i];\n }\n return this[impl].toJSON.apply(this[impl], args);\n};\nObject.defineProperty(URL.prototype, \"href\", {\n get() {\n return this[impl].href;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].href = V;\n },\n enumerable: true,\n configurable: true\n});\n\nURL.prototype.toString = function () {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n return this.href;\n};\n\nObject.defineProperty(URL.prototype, \"origin\", {\n get() {\n return this[impl].origin;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"protocol\", {\n get() {\n return this[impl].protocol;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].protocol = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"username\", {\n get() {\n return this[impl].username;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].username = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"password\", {\n get() {\n return this[impl].password;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].password = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"host\", {\n get() {\n return this[impl].host;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].host = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hostname\", {\n get() {\n return this[impl].hostname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hostname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"port\", {\n get() {\n return this[impl].port;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].port = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"pathname\", {\n get() {\n return this[impl].pathname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].pathname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"search\", {\n get() {\n return this[impl].search;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].search = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hash\", {\n get() {\n return this[impl].hash;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hash = V;\n },\n enumerable: true,\n configurable: true\n});\n\n\nmodule.exports = {\n is(obj) {\n return !!obj && obj[impl] instanceof Impl.implementation;\n },\n create(constructorArgs, privateData) {\n let obj = Object.create(URL.prototype);\n this.setup(obj, constructorArgs, privateData);\n return obj;\n },\n setup(obj, constructorArgs, privateData) {\n if (!privateData) privateData = {};\n privateData.wrapper = obj;\n\n obj[impl] = new Impl.implementation(constructorArgs, privateData);\n obj[impl][utils.wrapperSymbol] = obj;\n },\n interface: URL,\n expose: {\n Window: { URL: URL },\n Worker: { URL: URL }\n }\n};\n\n","\"use strict\";\n\nexports.URL = require(\"./URL\").interface;\nexports.serializeURL = require(\"./url-state-machine\").serializeURL;\nexports.serializeURLOrigin = require(\"./url-state-machine\").serializeURLOrigin;\nexports.basicURLParse = require(\"./url-state-machine\").basicURLParse;\nexports.setTheUsername = require(\"./url-state-machine\").setTheUsername;\nexports.setThePassword = require(\"./url-state-machine\").setThePassword;\nexports.serializeHost = require(\"./url-state-machine\").serializeHost;\nexports.serializeInteger = require(\"./url-state-machine\").serializeInteger;\nexports.parseURL = require(\"./url-state-machine\").parseURL;\n","\"use strict\";\r\nconst punycode = require(\"punycode\");\r\nconst tr46 = require(\"tr46\");\r\n\r\nconst specialSchemes = {\r\n ftp: 21,\r\n file: null,\r\n gopher: 70,\r\n http: 80,\r\n https: 443,\r\n ws: 80,\r\n wss: 443\r\n};\r\n\r\nconst failure = Symbol(\"failure\");\r\n\r\nfunction countSymbols(str) {\r\n return punycode.ucs2.decode(str).length;\r\n}\r\n\r\nfunction at(input, idx) {\r\n const c = input[idx];\r\n return isNaN(c) ? undefined : String.fromCodePoint(c);\r\n}\r\n\r\nfunction isASCIIDigit(c) {\r\n return c >= 0x30 && c <= 0x39;\r\n}\r\n\r\nfunction isASCIIAlpha(c) {\r\n return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);\r\n}\r\n\r\nfunction isASCIIAlphanumeric(c) {\r\n return isASCIIAlpha(c) || isASCIIDigit(c);\r\n}\r\n\r\nfunction isASCIIHex(c) {\r\n return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);\r\n}\r\n\r\nfunction isSingleDot(buffer) {\r\n return buffer === \".\" || buffer.toLowerCase() === \"%2e\";\r\n}\r\n\r\nfunction isDoubleDot(buffer) {\r\n buffer = buffer.toLowerCase();\r\n return buffer === \"..\" || buffer === \"%2e.\" || buffer === \".%2e\" || buffer === \"%2e%2e\";\r\n}\r\n\r\nfunction isWindowsDriveLetterCodePoints(cp1, cp2) {\r\n return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124);\r\n}\r\n\r\nfunction isWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === \":\" || string[1] === \"|\");\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === \":\";\r\n}\r\n\r\nfunction containsForbiddenHostCodePoint(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|%|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction containsForbiddenHostCodePointExcludingPercent(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction isSpecialScheme(scheme) {\r\n return specialSchemes[scheme] !== undefined;\r\n}\r\n\r\nfunction isSpecial(url) {\r\n return isSpecialScheme(url.scheme);\r\n}\r\n\r\nfunction defaultPort(scheme) {\r\n return specialSchemes[scheme];\r\n}\r\n\r\nfunction percentEncode(c) {\r\n let hex = c.toString(16).toUpperCase();\r\n if (hex.length === 1) {\r\n hex = \"0\" + hex;\r\n }\r\n\r\n return \"%\" + hex;\r\n}\r\n\r\nfunction utf8PercentEncode(c) {\r\n const buf = new Buffer(c);\r\n\r\n let str = \"\";\r\n\r\n for (let i = 0; i < buf.length; ++i) {\r\n str += percentEncode(buf[i]);\r\n }\r\n\r\n return str;\r\n}\r\n\r\nfunction utf8PercentDecode(str) {\r\n const input = new Buffer(str);\r\n const output = [];\r\n for (let i = 0; i < input.length; ++i) {\r\n if (input[i] !== 37) {\r\n output.push(input[i]);\r\n } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) {\r\n output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));\r\n i += 2;\r\n } else {\r\n output.push(input[i]);\r\n }\r\n }\r\n return new Buffer(output).toString();\r\n}\r\n\r\nfunction isC0ControlPercentEncode(c) {\r\n return c <= 0x1F || c > 0x7E;\r\n}\r\n\r\nconst extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]);\r\nfunction isPathPercentEncode(c) {\r\n return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c);\r\n}\r\n\r\nconst extraUserinfoPercentEncodeSet =\r\n new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]);\r\nfunction isUserinfoPercentEncode(c) {\r\n return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c);\r\n}\r\n\r\nfunction percentEncodeChar(c, encodeSetPredicate) {\r\n const cStr = String.fromCodePoint(c);\r\n\r\n if (encodeSetPredicate(c)) {\r\n return utf8PercentEncode(cStr);\r\n }\r\n\r\n return cStr;\r\n}\r\n\r\nfunction parseIPv4Number(input) {\r\n let R = 10;\r\n\r\n if (input.length >= 2 && input.charAt(0) === \"0\" && input.charAt(1).toLowerCase() === \"x\") {\r\n input = input.substring(2);\r\n R = 16;\r\n } else if (input.length >= 2 && input.charAt(0) === \"0\") {\r\n input = input.substring(1);\r\n R = 8;\r\n }\r\n\r\n if (input === \"\") {\r\n return 0;\r\n }\r\n\r\n const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/);\r\n if (regex.test(input)) {\r\n return failure;\r\n }\r\n\r\n return parseInt(input, R);\r\n}\r\n\r\nfunction parseIPv4(input) {\r\n const parts = input.split(\".\");\r\n if (parts[parts.length - 1] === \"\") {\r\n if (parts.length > 1) {\r\n parts.pop();\r\n }\r\n }\r\n\r\n if (parts.length > 4) {\r\n return input;\r\n }\r\n\r\n const numbers = [];\r\n for (const part of parts) {\r\n if (part === \"\") {\r\n return input;\r\n }\r\n const n = parseIPv4Number(part);\r\n if (n === failure) {\r\n return input;\r\n }\r\n\r\n numbers.push(n);\r\n }\r\n\r\n for (let i = 0; i < numbers.length - 1; ++i) {\r\n if (numbers[i] > 255) {\r\n return failure;\r\n }\r\n }\r\n if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) {\r\n return failure;\r\n }\r\n\r\n let ipv4 = numbers.pop();\r\n let counter = 0;\r\n\r\n for (const n of numbers) {\r\n ipv4 += n * Math.pow(256, 3 - counter);\r\n ++counter;\r\n }\r\n\r\n return ipv4;\r\n}\r\n\r\nfunction serializeIPv4(address) {\r\n let output = \"\";\r\n let n = address;\r\n\r\n for (let i = 1; i <= 4; ++i) {\r\n output = String(n % 256) + output;\r\n if (i !== 4) {\r\n output = \".\" + output;\r\n }\r\n n = Math.floor(n / 256);\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseIPv6(input) {\r\n const address = [0, 0, 0, 0, 0, 0, 0, 0];\r\n let pieceIndex = 0;\r\n let compress = null;\r\n let pointer = 0;\r\n\r\n input = punycode.ucs2.decode(input);\r\n\r\n if (input[pointer] === 58) {\r\n if (input[pointer + 1] !== 58) {\r\n return failure;\r\n }\r\n\r\n pointer += 2;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n }\r\n\r\n while (pointer < input.length) {\r\n if (pieceIndex === 8) {\r\n return failure;\r\n }\r\n\r\n if (input[pointer] === 58) {\r\n if (compress !== null) {\r\n return failure;\r\n }\r\n ++pointer;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n continue;\r\n }\r\n\r\n let value = 0;\r\n let length = 0;\r\n\r\n while (length < 4 && isASCIIHex(input[pointer])) {\r\n value = value * 0x10 + parseInt(at(input, pointer), 16);\r\n ++pointer;\r\n ++length;\r\n }\r\n\r\n if (input[pointer] === 46) {\r\n if (length === 0) {\r\n return failure;\r\n }\r\n\r\n pointer -= length;\r\n\r\n if (pieceIndex > 6) {\r\n return failure;\r\n }\r\n\r\n let numbersSeen = 0;\r\n\r\n while (input[pointer] !== undefined) {\r\n let ipv4Piece = null;\r\n\r\n if (numbersSeen > 0) {\r\n if (input[pointer] === 46 && numbersSeen < 4) {\r\n ++pointer;\r\n } else {\r\n return failure;\r\n }\r\n }\r\n\r\n if (!isASCIIDigit(input[pointer])) {\r\n return failure;\r\n }\r\n\r\n while (isASCIIDigit(input[pointer])) {\r\n const number = parseInt(at(input, pointer));\r\n if (ipv4Piece === null) {\r\n ipv4Piece = number;\r\n } else if (ipv4Piece === 0) {\r\n return failure;\r\n } else {\r\n ipv4Piece = ipv4Piece * 10 + number;\r\n }\r\n if (ipv4Piece > 255) {\r\n return failure;\r\n }\r\n ++pointer;\r\n }\r\n\r\n address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece;\r\n\r\n ++numbersSeen;\r\n\r\n if (numbersSeen === 2 || numbersSeen === 4) {\r\n ++pieceIndex;\r\n }\r\n }\r\n\r\n if (numbersSeen !== 4) {\r\n return failure;\r\n }\r\n\r\n break;\r\n } else if (input[pointer] === 58) {\r\n ++pointer;\r\n if (input[pointer] === undefined) {\r\n return failure;\r\n }\r\n } else if (input[pointer] !== undefined) {\r\n return failure;\r\n }\r\n\r\n address[pieceIndex] = value;\r\n ++pieceIndex;\r\n }\r\n\r\n if (compress !== null) {\r\n let swaps = pieceIndex - compress;\r\n pieceIndex = 7;\r\n while (pieceIndex !== 0 && swaps > 0) {\r\n const temp = address[compress + swaps - 1];\r\n address[compress + swaps - 1] = address[pieceIndex];\r\n address[pieceIndex] = temp;\r\n --pieceIndex;\r\n --swaps;\r\n }\r\n } else if (compress === null && pieceIndex !== 8) {\r\n return failure;\r\n }\r\n\r\n return address;\r\n}\r\n\r\nfunction serializeIPv6(address) {\r\n let output = \"\";\r\n const seqResult = findLongestZeroSequence(address);\r\n const compress = seqResult.idx;\r\n let ignore0 = false;\r\n\r\n for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {\r\n if (ignore0 && address[pieceIndex] === 0) {\r\n continue;\r\n } else if (ignore0) {\r\n ignore0 = false;\r\n }\r\n\r\n if (compress === pieceIndex) {\r\n const separator = pieceIndex === 0 ? \"::\" : \":\";\r\n output += separator;\r\n ignore0 = true;\r\n continue;\r\n }\r\n\r\n output += address[pieceIndex].toString(16);\r\n\r\n if (pieceIndex !== 7) {\r\n output += \":\";\r\n }\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseHost(input, isSpecialArg) {\r\n if (input[0] === \"[\") {\r\n if (input[input.length - 1] !== \"]\") {\r\n return failure;\r\n }\r\n\r\n return parseIPv6(input.substring(1, input.length - 1));\r\n }\r\n\r\n if (!isSpecialArg) {\r\n return parseOpaqueHost(input);\r\n }\r\n\r\n const domain = utf8PercentDecode(input);\r\n const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);\r\n if (asciiDomain === null) {\r\n return failure;\r\n }\r\n\r\n if (containsForbiddenHostCodePoint(asciiDomain)) {\r\n return failure;\r\n }\r\n\r\n const ipv4Host = parseIPv4(asciiDomain);\r\n if (typeof ipv4Host === \"number\" || ipv4Host === failure) {\r\n return ipv4Host;\r\n }\r\n\r\n return asciiDomain;\r\n}\r\n\r\nfunction parseOpaqueHost(input) {\r\n if (containsForbiddenHostCodePointExcludingPercent(input)) {\r\n return failure;\r\n }\r\n\r\n let output = \"\";\r\n const decoded = punycode.ucs2.decode(input);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n output += percentEncodeChar(decoded[i], isC0ControlPercentEncode);\r\n }\r\n return output;\r\n}\r\n\r\nfunction findLongestZeroSequence(arr) {\r\n let maxIdx = null;\r\n let maxLen = 1; // only find elements > 1\r\n let currStart = null;\r\n let currLen = 0;\r\n\r\n for (let i = 0; i < arr.length; ++i) {\r\n if (arr[i] !== 0) {\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n currStart = null;\r\n currLen = 0;\r\n } else {\r\n if (currStart === null) {\r\n currStart = i;\r\n }\r\n ++currLen;\r\n }\r\n }\r\n\r\n // if trailing zeros\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n return {\r\n idx: maxIdx,\r\n len: maxLen\r\n };\r\n}\r\n\r\nfunction serializeHost(host) {\r\n if (typeof host === \"number\") {\r\n return serializeIPv4(host);\r\n }\r\n\r\n // IPv6 serializer\r\n if (host instanceof Array) {\r\n return \"[\" + serializeIPv6(host) + \"]\";\r\n }\r\n\r\n return host;\r\n}\r\n\r\nfunction trimControlChars(url) {\r\n return url.replace(/^[\\u0000-\\u001F\\u0020]+|[\\u0000-\\u001F\\u0020]+$/g, \"\");\r\n}\r\n\r\nfunction trimTabAndNewline(url) {\r\n return url.replace(/\\u0009|\\u000A|\\u000D/g, \"\");\r\n}\r\n\r\nfunction shortenPath(url) {\r\n const path = url.path;\r\n if (path.length === 0) {\r\n return;\r\n }\r\n if (url.scheme === \"file\" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) {\r\n return;\r\n }\r\n\r\n path.pop();\r\n}\r\n\r\nfunction includesCredentials(url) {\r\n return url.username !== \"\" || url.password !== \"\";\r\n}\r\n\r\nfunction cannotHaveAUsernamePasswordPort(url) {\r\n return url.host === null || url.host === \"\" || url.cannotBeABaseURL || url.scheme === \"file\";\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetter(string) {\r\n return /^[A-Za-z]:$/.test(string);\r\n}\r\n\r\nfunction URLStateMachine(input, base, encodingOverride, url, stateOverride) {\r\n this.pointer = 0;\r\n this.input = input;\r\n this.base = base || null;\r\n this.encodingOverride = encodingOverride || \"utf-8\";\r\n this.stateOverride = stateOverride;\r\n this.url = url;\r\n this.failure = false;\r\n this.parseError = false;\r\n\r\n if (!this.url) {\r\n this.url = {\r\n scheme: \"\",\r\n username: \"\",\r\n password: \"\",\r\n host: null,\r\n port: null,\r\n path: [],\r\n query: null,\r\n fragment: null,\r\n\r\n cannotBeABaseURL: false\r\n };\r\n\r\n const res = trimControlChars(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n }\r\n\r\n const res = trimTabAndNewline(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n\r\n this.state = stateOverride || \"scheme start\";\r\n\r\n this.buffer = \"\";\r\n this.atFlag = false;\r\n this.arrFlag = false;\r\n this.passwordTokenSeenFlag = false;\r\n\r\n this.input = punycode.ucs2.decode(this.input);\r\n\r\n for (; this.pointer <= this.input.length; ++this.pointer) {\r\n const c = this.input[this.pointer];\r\n const cStr = isNaN(c) ? undefined : String.fromCodePoint(c);\r\n\r\n // exec state machine\r\n const ret = this[\"parse \" + this.state](c, cStr);\r\n if (!ret) {\r\n break; // terminate algorithm\r\n } else if (ret === failure) {\r\n this.failure = true;\r\n break;\r\n }\r\n }\r\n}\r\n\r\nURLStateMachine.prototype[\"parse scheme start\"] = function parseSchemeStart(c, cStr) {\r\n if (isASCIIAlpha(c)) {\r\n this.buffer += cStr.toLowerCase();\r\n this.state = \"scheme\";\r\n } else if (!this.stateOverride) {\r\n this.state = \"no scheme\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse scheme\"] = function parseScheme(c, cStr) {\r\n if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) {\r\n this.buffer += cStr.toLowerCase();\r\n } else if (c === 58) {\r\n if (this.stateOverride) {\r\n if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === \"file\") {\r\n return false;\r\n }\r\n\r\n if (this.url.scheme === \"file\" && (this.url.host === \"\" || this.url.host === null)) {\r\n return false;\r\n }\r\n }\r\n this.url.scheme = this.buffer;\r\n this.buffer = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n if (this.url.scheme === \"file\") {\r\n if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file\";\r\n } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) {\r\n this.state = \"special relative or authority\";\r\n } else if (isSpecial(this.url)) {\r\n this.state = \"special authority slashes\";\r\n } else if (this.input[this.pointer + 1] === 47) {\r\n this.state = \"path or authority\";\r\n ++this.pointer;\r\n } else {\r\n this.url.cannotBeABaseURL = true;\r\n this.url.path.push(\"\");\r\n this.state = \"cannot-be-a-base-URL path\";\r\n }\r\n } else if (!this.stateOverride) {\r\n this.buffer = \"\";\r\n this.state = \"no scheme\";\r\n this.pointer = -1;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse no scheme\"] = function parseNoScheme(c) {\r\n if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) {\r\n return failure;\r\n } else if (this.base.cannotBeABaseURL && c === 35) {\r\n this.url.scheme = this.base.scheme;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.url.cannotBeABaseURL = true;\r\n this.state = \"fragment\";\r\n } else if (this.base.scheme === \"file\") {\r\n this.state = \"file\";\r\n --this.pointer;\r\n } else {\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special relative or authority\"] = function parseSpecialRelativeOrAuthority(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path or authority\"] = function parsePathOrAuthority(c) {\r\n if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative\"] = function parseRelative(c) {\r\n this.url.scheme = this.base.scheme;\r\n if (isNaN(c)) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 47) {\r\n this.state = \"relative slash\";\r\n } else if (c === 63) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n this.state = \"relative slash\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice(0, this.base.path.length - 1);\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative slash\"] = function parseRelativeSlash(c) {\r\n if (isSpecial(this.url) && (c === 47 || c === 92)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"special authority ignore slashes\";\r\n } else if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority slashes\"] = function parseSpecialAuthoritySlashes(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"special authority ignore slashes\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority ignore slashes\"] = function parseSpecialAuthorityIgnoreSlashes(c) {\r\n if (c !== 47 && c !== 92) {\r\n this.state = \"authority\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse authority\"] = function parseAuthority(c, cStr) {\r\n if (c === 64) {\r\n this.parseError = true;\r\n if (this.atFlag) {\r\n this.buffer = \"%40\" + this.buffer;\r\n }\r\n this.atFlag = true;\r\n\r\n // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars\r\n const len = countSymbols(this.buffer);\r\n for (let pointer = 0; pointer < len; ++pointer) {\r\n const codePoint = this.buffer.codePointAt(pointer);\r\n\r\n if (codePoint === 58 && !this.passwordTokenSeenFlag) {\r\n this.passwordTokenSeenFlag = true;\r\n continue;\r\n }\r\n const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode);\r\n if (this.passwordTokenSeenFlag) {\r\n this.url.password += encodedCodePoints;\r\n } else {\r\n this.url.username += encodedCodePoints;\r\n }\r\n }\r\n this.buffer = \"\";\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n if (this.atFlag && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.pointer -= countSymbols(this.buffer) + 1;\r\n this.buffer = \"\";\r\n this.state = \"host\";\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse hostname\"] =\r\nURLStateMachine.prototype[\"parse host\"] = function parseHostName(c, cStr) {\r\n if (this.stateOverride && this.url.scheme === \"file\") {\r\n --this.pointer;\r\n this.state = \"file host\";\r\n } else if (c === 58 && !this.arrFlag) {\r\n if (this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"port\";\r\n if (this.stateOverride === \"hostname\") {\r\n return false;\r\n }\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n --this.pointer;\r\n if (isSpecial(this.url) && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n } else if (this.stateOverride && this.buffer === \"\" &&\r\n (includesCredentials(this.url) || this.url.port !== null)) {\r\n this.parseError = true;\r\n return false;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n } else {\r\n if (c === 91) {\r\n this.arrFlag = true;\r\n } else if (c === 93) {\r\n this.arrFlag = false;\r\n }\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse port\"] = function parsePort(c, cStr) {\r\n if (isASCIIDigit(c)) {\r\n this.buffer += cStr;\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92) ||\r\n this.stateOverride) {\r\n if (this.buffer !== \"\") {\r\n const port = parseInt(this.buffer);\r\n if (port > Math.pow(2, 16) - 1) {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.url.port = port === defaultPort(this.url.scheme) ? null : port;\r\n this.buffer = \"\";\r\n }\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst fileOtherwiseCodePoints = new Set([47, 92, 63, 35]);\r\n\r\nURLStateMachine.prototype[\"parse file\"] = function parseFile(c) {\r\n this.url.scheme = \"file\";\r\n\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file slash\";\r\n } else if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNaN(c)) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 63) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points\r\n !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) ||\r\n (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points\r\n !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n shortenPath(this.url);\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file slash\"] = function parseFileSlash(c) {\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file host\";\r\n } else {\r\n if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNormalizedWindowsDriveLetterString(this.base.path[0])) {\r\n this.url.path.push(this.base.path[0]);\r\n } else {\r\n this.url.host = this.base.host;\r\n }\r\n }\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file host\"] = function parseFileHost(c, cStr) {\r\n if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) {\r\n --this.pointer;\r\n if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) {\r\n this.parseError = true;\r\n this.state = \"path\";\r\n } else if (this.buffer === \"\") {\r\n this.url.host = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n } else {\r\n let host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n if (host === \"localhost\") {\r\n host = \"\";\r\n }\r\n this.url.host = host;\r\n\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n }\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path start\"] = function parsePathStart(c) {\r\n if (isSpecial(this.url)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"path\";\r\n\r\n if (c !== 47 && c !== 92) {\r\n --this.pointer;\r\n }\r\n } else if (!this.stateOverride && c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (!this.stateOverride && c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (c !== undefined) {\r\n this.state = \"path\";\r\n if (c !== 47) {\r\n --this.pointer;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path\"] = function parsePath(c) {\r\n if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) ||\r\n (!this.stateOverride && (c === 63 || c === 35))) {\r\n if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n }\r\n\r\n if (isDoubleDot(this.buffer)) {\r\n shortenPath(this.url);\r\n if (c !== 47 && !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n }\r\n } else if (isSingleDot(this.buffer) && c !== 47 &&\r\n !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n } else if (!isSingleDot(this.buffer)) {\r\n if (this.url.scheme === \"file\" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) {\r\n if (this.url.host !== \"\" && this.url.host !== null) {\r\n this.parseError = true;\r\n this.url.host = \"\";\r\n }\r\n this.buffer = this.buffer[0] + \":\";\r\n }\r\n this.url.path.push(this.buffer);\r\n }\r\n this.buffer = \"\";\r\n if (this.url.scheme === \"file\" && (c === undefined || c === 63 || c === 35)) {\r\n while (this.url.path.length > 1 && this.url.path[0] === \"\") {\r\n this.parseError = true;\r\n this.url.path.shift();\r\n }\r\n }\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n }\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += percentEncodeChar(c, isPathPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse cannot-be-a-base-URL path\"] = function parseCannotBeABaseURLPath(c) {\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n // TODO: Add: not a URL code point\r\n if (!isNaN(c) && c !== 37) {\r\n this.parseError = true;\r\n }\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n if (!isNaN(c)) {\r\n this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse query\"] = function parseQuery(c, cStr) {\r\n if (isNaN(c) || (!this.stateOverride && c === 35)) {\r\n if (!isSpecial(this.url) || this.url.scheme === \"ws\" || this.url.scheme === \"wss\") {\r\n this.encodingOverride = \"utf-8\";\r\n }\r\n\r\n const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead\r\n for (let i = 0; i < buffer.length; ++i) {\r\n if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 ||\r\n buffer[i] === 0x3C || buffer[i] === 0x3E) {\r\n this.url.query += percentEncode(buffer[i]);\r\n } else {\r\n this.url.query += String.fromCodePoint(buffer[i]);\r\n }\r\n }\r\n\r\n this.buffer = \"\";\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse fragment\"] = function parseFragment(c) {\r\n if (isNaN(c)) { // do nothing\r\n } else if (c === 0x0) {\r\n this.parseError = true;\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nfunction serializeURL(url, excludeFragment) {\r\n let output = url.scheme + \":\";\r\n if (url.host !== null) {\r\n output += \"//\";\r\n\r\n if (url.username !== \"\" || url.password !== \"\") {\r\n output += url.username;\r\n if (url.password !== \"\") {\r\n output += \":\" + url.password;\r\n }\r\n output += \"@\";\r\n }\r\n\r\n output += serializeHost(url.host);\r\n\r\n if (url.port !== null) {\r\n output += \":\" + url.port;\r\n }\r\n } else if (url.host === null && url.scheme === \"file\") {\r\n output += \"//\";\r\n }\r\n\r\n if (url.cannotBeABaseURL) {\r\n output += url.path[0];\r\n } else {\r\n for (const string of url.path) {\r\n output += \"/\" + string;\r\n }\r\n }\r\n\r\n if (url.query !== null) {\r\n output += \"?\" + url.query;\r\n }\r\n\r\n if (!excludeFragment && url.fragment !== null) {\r\n output += \"#\" + url.fragment;\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction serializeOrigin(tuple) {\r\n let result = tuple.scheme + \"://\";\r\n result += serializeHost(tuple.host);\r\n\r\n if (tuple.port !== null) {\r\n result += \":\" + tuple.port;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nmodule.exports.serializeURL = serializeURL;\r\n\r\nmodule.exports.serializeURLOrigin = function (url) {\r\n // https://url.spec.whatwg.org/#concept-url-origin\r\n switch (url.scheme) {\r\n case \"blob\":\r\n try {\r\n return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0]));\r\n } catch (e) {\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n case \"ftp\":\r\n case \"gopher\":\r\n case \"http\":\r\n case \"https\":\r\n case \"ws\":\r\n case \"wss\":\r\n return serializeOrigin({\r\n scheme: url.scheme,\r\n host: url.host,\r\n port: url.port\r\n });\r\n case \"file\":\r\n // spec says \"exercise to the reader\", chrome says \"file://\"\r\n return \"file://\";\r\n default:\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n};\r\n\r\nmodule.exports.basicURLParse = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride);\r\n if (usm.failure) {\r\n return \"failure\";\r\n }\r\n\r\n return usm.url;\r\n};\r\n\r\nmodule.exports.setTheUsername = function (url, username) {\r\n url.username = \"\";\r\n const decoded = punycode.ucs2.decode(username);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.setThePassword = function (url, password) {\r\n url.password = \"\";\r\n const decoded = punycode.ucs2.decode(password);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.serializeHost = serializeHost;\r\n\r\nmodule.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;\r\n\r\nmodule.exports.serializeInteger = function (integer) {\r\n return String(integer);\r\n};\r\n\r\nmodule.exports.parseURL = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n // We don't handle blobs, so this just delegates:\r\n return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });\r\n};\r\n","\"use strict\";\n\nmodule.exports.mixin = function mixin(target, source) {\n const keys = Object.getOwnPropertyNames(source);\n for (let i = 0; i < keys.length; ++i) {\n Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));\n }\n};\n\nmodule.exports.wrapperSymbol = Symbol(\"wrapper\");\nmodule.exports.implSymbol = Symbol(\"impl\");\n\nmodule.exports.wrapperForImpl = function (impl) {\n return impl[module.exports.wrapperSymbol];\n};\n\nmodule.exports.implForWrapper = function (wrapper) {\n return wrapper[module.exports.implSymbol];\n};\n\n","// Returns a wrapper function that returns a wrapped callback\n// The wrapper function should do some stuff, and return a\n// presumably different callback function.\n// This makes sure that own properties are retained, so that\n// decorations and such are not lost along the way.\nmodule.exports = wrappy\nfunction wrappy (fn, cb) {\n if (fn && cb) return wrappy(fn)(cb)\n\n if (typeof fn !== 'function')\n throw new TypeError('need wrapper function')\n\n Object.keys(fn).forEach(function (k) {\n wrapper[k] = fn[k]\n })\n\n return wrapper\n\n function wrapper() {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n var ret = fn.apply(this, args)\n var cb = args[args.length-1]\n if (typeof ret === 'function' && ret !== cb) {\n Object.keys(cb).forEach(function (k) {\n ret[k] = cb[k]\n })\n }\n return ret\n }\n}\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.error = exports.info = exports.debug = exports.isDebugEnabled = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst LOG_HEADER = '[Workflow Telemetry]';\nfunction isDebugEnabled() {\n return core.isDebug();\n}\nexports.isDebugEnabled = isDebugEnabled;\nfunction debug(msg) {\n core.debug(LOG_HEADER + ' ' + msg);\n}\nexports.debug = debug;\nfunction info(msg) {\n core.info(LOG_HEADER + ' ' + msg);\n}\nexports.info = info;\nfunction error(msg) {\n if (msg instanceof String || typeof msg === 'string') {\n core.error(LOG_HEADER + ' ' + msg);\n }\n else {\n core.error(LOG_HEADER + ' ' + msg.name);\n core.error(msg);\n }\n}\nexports.error = error;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core = __importStar(require(\"@actions/core\"));\nconst github = __importStar(require(\"@actions/github\"));\nconst action_1 = require(\"@octokit/action\");\nconst stepTracer = __importStar(require(\"./stepTracer\"));\nconst statCollector = __importStar(require(\"./statCollector\"));\nconst processTracer = __importStar(require(\"./processTracer\"));\nconst logger = __importStar(require(\"./logger\"));\nconst { pull_request } = github.context.payload;\nconst { workflow, job, repo, runId, sha } = github.context;\nconst PAGE_SIZE = 100;\nconst octokit = new action_1.Octokit();\nfunction getCurrentJob() {\n return __awaiter(this, void 0, void 0, function* () {\n const _getCurrentJob = () => __awaiter(this, void 0, void 0, function* () {\n for (let page = 0;; page++) {\n const result = yield octokit.rest.actions.listJobsForWorkflowRun({\n owner: repo.owner,\n repo: repo.repo,\n run_id: runId,\n per_page: PAGE_SIZE,\n page\n });\n const jobs = result.data.jobs;\n // If there are no jobs, stop here\n if (!jobs || !jobs.length) {\n break;\n }\n const currentJobs = jobs.filter(it => it.status === 'in_progress' &&\n it.runner_name === process.env.RUNNER_NAME);\n if (currentJobs && currentJobs.length) {\n return currentJobs[0];\n }\n // Since returning job count is less than page size, this means that there are no other jobs.\n // So no need to make another request for the next page.\n if (jobs.length < PAGE_SIZE) {\n break;\n }\n }\n return null;\n });\n try {\n for (let i = 0; i < 10; i++) {\n const currentJob = yield _getCurrentJob();\n if (currentJob && currentJob.id) {\n return currentJob;\n }\n yield new Promise(r => setTimeout(r, 1000));\n }\n }\n catch (error) {\n logger.error(`Unable to get current workflow job info. ` +\n `Please sure that your workflow have \"actions:read\" permission!`);\n }\n return null;\n });\n}\nfunction reportAll(currentJob, content) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Reporting all content ...`);\n logger.debug(`Workflow - Job: ${workflow} - ${job}`);\n const jobUrl = `https://github.com/${repo.owner}/${repo.repo}/runs/${currentJob.id}?check_suite_focus=true`;\n logger.debug(`Job url: ${jobUrl}`);\n const title = `## Workflow Telemetry - ${workflow} / ${currentJob.name}`;\n logger.debug(`Title: ${title}`);\n const commit = (pull_request && pull_request.head && pull_request.head.sha) || sha;\n logger.debug(`Commit: ${commit}`);\n const commitUrl = `https://github.com/${repo.owner}/${repo.repo}/commit/${commit}`;\n logger.debug(`Commit url: ${commitUrl}`);\n const info = `Workflow telemetry for commit [${commit}](${commitUrl})\\n` +\n `You can access workflow job details [here](${jobUrl})`;\n const postContent = [title, info, content].join('\\n');\n const jobSummary = core.getInput('job_summary');\n if ('true' === jobSummary) {\n core.summary.addRaw(postContent);\n yield core.summary.write();\n }\n const commentOnPR = core.getInput('comment_on_pr');\n if (pull_request && 'true' === commentOnPR) {\n if (logger.isDebugEnabled()) {\n logger.debug(`Found Pull Request: ${JSON.stringify(pull_request)}`);\n }\n yield octokit.rest.issues.createComment(Object.assign(Object.assign({}, github.context.repo), { issue_number: Number((_a = github.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.number), body: postContent }));\n }\n else {\n logger.debug(`Couldn't find Pull Request`);\n }\n logger.info(`Reporting all content completed`);\n });\n}\nfunction run() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n logger.info(`Finishing ...`);\n const currentJob = yield getCurrentJob();\n if (!currentJob) {\n logger.error(`Couldn't find current job. So action will not report any data.`);\n return;\n }\n logger.debug(`Current job: ${JSON.stringify(currentJob)}`);\n // Finish step tracer\n yield stepTracer.finish(currentJob);\n // Finish stat collector\n yield statCollector.finish(currentJob);\n // Finish process tracer\n yield processTracer.finish(currentJob);\n // Report step tracer\n const stepTracerContent = yield stepTracer.report(currentJob);\n // Report stat collector\n const stepCollectorContent = yield statCollector.report(currentJob);\n // Report process tracer\n const procTracerContent = yield processTracer.report(currentJob);\n let allContent = '';\n if (stepTracerContent) {\n allContent = allContent.concat(stepTracerContent, '\\n');\n }\n if (stepCollectorContent) {\n allContent = allContent.concat(stepCollectorContent, '\\n');\n }\n if (procTracerContent) {\n allContent = allContent.concat(procTracerContent, '\\n');\n }\n yield reportAll(currentJob, allContent);\n logger.info(`Finish completed`);\n }\n catch (error) {\n logger.error(error.message);\n }\n });\n}\nrun();\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parse = void 0;\nconst fs = __importStar(require(\"fs\"));\nconst readline = __importStar(require(\"readline\"));\nconst logger = __importStar(require(\"./logger\"));\nconst SYS_PROCS_TO_BE_IGNORED = new Set([\n 'awk',\n 'basename',\n 'cat',\n 'cut',\n 'date',\n 'echo',\n 'envsubst',\n 'expr',\n 'dirname',\n 'grep',\n 'head',\n 'id',\n 'ip',\n 'ln',\n 'ls',\n 'lsblk',\n 'mkdir',\n 'mktemp',\n 'mv',\n 'ps',\n 'readlink',\n 'rm',\n 'sed',\n 'seq',\n 'sh',\n 'uname',\n 'whoami'\n]);\nfunction parse(filePath, procEventParseOptions) {\n var e_1, _a;\n return __awaiter(this, void 0, void 0, function* () {\n const minDuration = (procEventParseOptions && procEventParseOptions.minDuration) || -1;\n const traceSystemProcesses = (procEventParseOptions && procEventParseOptions.traceSystemProcesses) ||\n false;\n const fileStream = fs.createReadStream(filePath);\n const rl = readline.createInterface({\n input: fileStream,\n crlfDelay: Infinity\n });\n // Note: we use the crlfDelay option to recognize all instances of CR LF\n // ('\\r\\n') in input file as a single line break.\n const activeCommands = new Map();\n const replacedCommands = new Map();\n const completedCommands = [];\n let commandOrder = 0;\n try {\n for (var rl_1 = __asyncValues(rl), rl_1_1; rl_1_1 = yield rl_1.next(), !rl_1_1.done;) {\n let line = rl_1_1.value;\n line = line.trim();\n if (!line || !line.length) {\n continue;\n }\n try {\n if (logger.isDebugEnabled()) {\n logger.debug(`Parsing trace process event: ${line}`);\n }\n const event = JSON.parse(line);\n event.order = ++commandOrder;\n if (!traceSystemProcesses && SYS_PROCS_TO_BE_IGNORED.has(event.name)) {\n continue;\n }\n if ('EXEC' === event.event) {\n const existingCommand = activeCommands.get(event.pid);\n activeCommands.set(event.pid, event);\n if (existingCommand) {\n replacedCommands.set(event.pid, existingCommand);\n }\n }\n else if ('EXIT' === event.event) {\n let activeCommandCompleted = false;\n let replacedCommandCompleted = false;\n // Process active command\n const activeCommand = activeCommands.get(event.pid);\n activeCommands.delete(event.pid);\n if (activeCommand) {\n for (let key of Object.keys(event)) {\n if (!activeCommand.hasOwnProperty(key)) {\n activeCommand[key] = event[key];\n }\n }\n activeCommandCompleted = true;\n }\n // Process replaced command if there is\n const replacedCommand = replacedCommands.get(event.pid);\n replacedCommands.delete(event.pid);\n if (replacedCommand && activeCommandCompleted) {\n for (let key of Object.keys(event)) {\n if (!replacedCommand.hasOwnProperty(key)) {\n replacedCommand[key] = event[key];\n }\n }\n const finishTime = activeCommand.startTime + activeCommand.duration;\n replacedCommand.duration = finishTime - replacedCommand.startTime;\n replacedCommandCompleted = true;\n }\n // Complete the replaced command first if there is\n if (replacedCommandCompleted &&\n replacedCommand.duration > minDuration) {\n completedCommands.push(replacedCommand);\n }\n // Then complete the actual command\n if (activeCommandCompleted && activeCommand.duration > minDuration) {\n completedCommands.push(activeCommand);\n }\n }\n else {\n if (logger.isDebugEnabled()) {\n logger.debug(`Unknown trace process event: ${line}`);\n }\n }\n }\n catch (error) {\n logger.debug(`Unable to parse process trace event (${error}): ${line}`);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (rl_1_1 && !rl_1_1.done && (_a = rl_1.return)) yield _a.call(rl_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n completedCommands.sort((a, b) => {\n return a.startTime - b.startTime;\n });\n if (logger.isDebugEnabled()) {\n logger.debug(`Completed commands: ${JSON.stringify(completedCommands)}`);\n }\n return completedCommands;\n });\n}\nexports.parse = parse;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.report = exports.finish = exports.start = void 0;\nconst child_process_1 = require(\"child_process\");\nconst path_1 = __importDefault(require(\"path\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst systeminformation_1 = __importDefault(require(\"systeminformation\"));\nconst sprintf_js_1 = require(\"sprintf-js\");\nconst procTraceParser_1 = require(\"./procTraceParser\");\nconst logger = __importStar(require(\"./logger\"));\nconst PROC_TRACER_PID_KEY = 'PROC_TRACER_PID';\nconst PROC_TRACER_OUTPUT_FILE_NAME = 'proc-trace.out';\nconst PROC_TRACER_BINARY_NAME_UBUNTU_20 = 'proc_tracer_ubuntu-20';\nconst PROC_TRACER_BINARY_NAME_UBUNTU_22 = 'proc_tracer_ubuntu-22';\nconst DEFAULT_PROC_TRACE_CHART_MAX_COUNT = 100;\nconst GHA_FILE_NAME_PREFIX = '/home/runner/work/_actions/';\nlet finished = false;\nfunction getProcessTracerBinaryName() {\n return __awaiter(this, void 0, void 0, function* () {\n const osInfo = yield systeminformation_1.default.osInfo();\n if (osInfo) {\n // Check whether we are running on Ubuntu\n if (osInfo.distro === 'Ubuntu') {\n const majorVersion = parseInt(osInfo.release.split('.')[0]);\n if (majorVersion === 20) {\n logger.info(`Using ${PROC_TRACER_BINARY_NAME_UBUNTU_20}`);\n return PROC_TRACER_BINARY_NAME_UBUNTU_20;\n }\n if (majorVersion === 22) {\n logger.info(`Using ${PROC_TRACER_BINARY_NAME_UBUNTU_22}`);\n return PROC_TRACER_BINARY_NAME_UBUNTU_22;\n }\n }\n }\n logger.info(`Process tracing disabled because of unsupported OS: ${JSON.stringify(osInfo)}`);\n return null;\n });\n}\nfunction getExtraProcessInfo(command) {\n // Check whether this is node process with args\n if (command.name === 'node' && command.args.length > 1) {\n const arg1 = command.args[1];\n // Check whether this is Node.js GHA process\n if (arg1.startsWith(GHA_FILE_NAME_PREFIX)) {\n const actionFile = arg1.substring(GHA_FILE_NAME_PREFIX.length);\n const idx1 = actionFile.indexOf('/');\n const idx2 = actionFile.indexOf('/', idx1 + 1);\n if (idx1 >= 0 && idx2 > idx1) {\n // If we could find a valid GHA name, use it as extra info\n return actionFile.substring(idx1 + 1, idx2);\n }\n }\n }\n return null;\n}\n///////////////////////////\nfunction start() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Starting process tracer ...`);\n try {\n const procTracerBinaryName = yield getProcessTracerBinaryName();\n if (procTracerBinaryName) {\n const procTraceOutFilePath = path_1.default.join(__dirname, '../proc-tracer', PROC_TRACER_OUTPUT_FILE_NAME);\n const child = (0, child_process_1.spawn)('sudo', [\n path_1.default.join(__dirname, `../proc-tracer/${procTracerBinaryName}`),\n '-f',\n 'json',\n '-o',\n procTraceOutFilePath\n ], {\n detached: true,\n stdio: 'ignore',\n env: Object.assign({}, process.env)\n });\n child.unref();\n core.saveState(PROC_TRACER_PID_KEY, (_a = child.pid) === null || _a === void 0 ? void 0 : _a.toString());\n logger.info(`Started process tracer`);\n return true;\n }\n else {\n return false;\n }\n }\n catch (error) {\n logger.error('Unable to start process tracer');\n logger.error(error);\n return false;\n }\n });\n}\nexports.start = start;\nfunction finish(currentJob) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Finishing process tracer ...`);\n const procTracePID = core.getState(PROC_TRACER_PID_KEY);\n if (!procTracePID) {\n logger.info(`Skipped finishing process tracer since process tracer didn't started`);\n return false;\n }\n try {\n logger.debug(`Interrupting process tracer with pid ${procTracePID} to stop gracefully ...`);\n (0, child_process_1.exec)(`sudo kill -s INT ${procTracePID}`);\n finished = true;\n logger.info(`Finished process tracer`);\n return true;\n }\n catch (error) {\n logger.error('Unable to finish process tracer');\n logger.error(error);\n return false;\n }\n });\n}\nexports.finish = finish;\nfunction report(currentJob) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Reporting process tracer result ...`);\n if (!finished) {\n logger.info(`Skipped reporting process tracer since process tracer didn't finished`);\n return null;\n }\n try {\n const procTraceOutFilePath = path_1.default.join(__dirname, '../proc-tracer', PROC_TRACER_OUTPUT_FILE_NAME);\n logger.info(`Getting process tracer result from file ${procTraceOutFilePath} ...`);\n let procTraceMinDuration = -1;\n const procTraceMinDurationInput = core.getInput('proc_trace_min_duration');\n if (procTraceMinDurationInput) {\n const minProcDurationVal = parseInt(procTraceMinDurationInput);\n if (Number.isInteger(minProcDurationVal)) {\n procTraceMinDuration = minProcDurationVal;\n }\n }\n const procTraceSysEnable = core.getInput('proc_trace_sys_enable') === 'true';\n const procTraceChartShow = core.getInput('proc_trace_chart_show') === 'true';\n const procTraceChartMaxCountInput = parseInt(core.getInput('proc_trace_chart_max_count'));\n const procTraceChartMaxCount = Number.isInteger(procTraceChartMaxCountInput)\n ? procTraceChartMaxCountInput\n : DEFAULT_PROC_TRACE_CHART_MAX_COUNT;\n const procTraceTableShow = core.getInput('proc_trace_table_show') === 'true';\n const completedCommands = yield (0, procTraceParser_1.parse)(procTraceOutFilePath, {\n minDuration: procTraceMinDuration,\n traceSystemProcesses: procTraceSysEnable\n });\n ///////////////////////////////////////////////////////////////////////////\n let chartContent = '';\n if (procTraceChartShow) {\n chartContent = chartContent.concat('gantt', '\\n');\n chartContent = chartContent.concat('\\t', `title ${currentJob.name}`, '\\n');\n chartContent = chartContent.concat('\\t', `dateFormat x`, '\\n');\n chartContent = chartContent.concat('\\t', `axisFormat %H:%M:%S`, '\\n');\n const filteredCommands = [...completedCommands]\n .sort((a, b) => {\n return -(a.duration - b.duration);\n })\n .slice(0, procTraceChartMaxCount)\n .sort((a, b) => {\n let result = a.startTime - b.startTime;\n if (result === 0 && a.order && b.order) {\n result = a.order - b.order;\n }\n return result;\n });\n for (const command of filteredCommands) {\n const extraProcessInfo = getExtraProcessInfo(command);\n if (extraProcessInfo) {\n chartContent = chartContent.concat('\\t', `${command.name} (${extraProcessInfo}) : `);\n }\n else {\n chartContent = chartContent.concat('\\t', `${command.name} : `);\n }\n if (command.exitCode !== 0) {\n // to show red\n chartContent = chartContent.concat('crit, ');\n }\n const startTime = command.startTime;\n const finishTime = command.startTime + command.duration;\n chartContent = chartContent.concat(`${Math.min(startTime, finishTime)}, ${finishTime}`, '\\n');\n }\n }\n ///////////////////////////////////////////////////////////////////////////\n let tableContent = '';\n if (procTraceTableShow) {\n const commandInfos = [];\n commandInfos.push((0, sprintf_js_1.sprintf)('%-12s %-16s %7s %7s %7s %15s %15s %10s %-20s', 'TIME', 'NAME', 'UID', 'PID', 'PPID', 'START TIME', 'DURATION (ms)', 'EXIT CODE', 'FILE NAME + ARGS'));\n for (const command of completedCommands) {\n commandInfos.push((0, sprintf_js_1.sprintf)('%-12s %-16s %7d %7d %7d %15d %15d %10d %s %s', command.ts, command.name, command.uid, command.pid, command.ppid, command.startTime, command.duration, command.exitCode, command.fileName, command.args.join(' ')));\n }\n tableContent = commandInfos.join('\\n');\n }\n ///////////////////////////////////////////////////////////////////////////\n const postContentItems = ['', '### Process Trace'];\n if (procTraceChartShow) {\n postContentItems.push('', `#### Top ${procTraceChartMaxCount} processes with highest duration`, '', '```mermaid' + '\\n' + chartContent + '\\n' + '```');\n }\n if (procTraceTableShow) {\n postContentItems.push('', `#### All processes with detail`, '', '```' + '\\n' + tableContent + '\\n' + '```');\n }\n const postContent = postContentItems.join('\\n');\n logger.info(`Reported process tracer result`);\n return postContent;\n }\n catch (error) {\n logger.error('Unable to report process tracer result');\n logger.error(error);\n return null;\n }\n });\n}\nexports.report = report;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.report = exports.finish = exports.start = void 0;\nconst child_process_1 = require(\"child_process\");\nconst path_1 = __importDefault(require(\"path\"));\nconst axios_1 = __importDefault(require(\"axios\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst logger = __importStar(require(\"./logger\"));\nconst STAT_SERVER_PORT = 7777;\nconst BLACK = '#000000';\nconst WHITE = '#FFFFFF';\nfunction triggerStatCollect() {\n return __awaiter(this, void 0, void 0, function* () {\n logger.debug('Triggering stat collect ...');\n const response = yield axios_1.default.post(`http://localhost:${STAT_SERVER_PORT}/collect`);\n if (logger.isDebugEnabled()) {\n logger.debug(`Triggered stat collect: ${JSON.stringify(response.data)}`);\n }\n });\n}\nfunction reportWorkflowMetrics() {\n return __awaiter(this, void 0, void 0, function* () {\n const theme = core.getInput('theme', { required: false });\n let axisColor = BLACK;\n switch (theme) {\n case 'light':\n axisColor = BLACK;\n break;\n case 'dark':\n axisColor = WHITE;\n break;\n default:\n core.warning(`Invalid theme: ${theme}`);\n }\n const { userLoadX, systemLoadX } = yield getCPUStats();\n const { activeMemoryX, availableMemoryX } = yield getMemoryStats();\n const { networkReadX, networkWriteX } = yield getNetworkStats();\n const { diskReadX, diskWriteX } = yield getDiskStats();\n const cpuLoad = userLoadX && userLoadX.length && systemLoadX && systemLoadX.length\n ? yield getStackedAreaGraph({\n label: 'CPU Load (%)',\n axisColor,\n areas: [\n {\n label: 'User Load',\n color: '#e41a1c99',\n points: userLoadX\n },\n {\n label: 'System Load',\n color: '#ff7f0099',\n points: systemLoadX\n }\n ]\n })\n : null;\n const memoryUsage = activeMemoryX &&\n activeMemoryX.length &&\n availableMemoryX &&\n availableMemoryX.length\n ? yield getStackedAreaGraph({\n label: 'Memory Usage (MB)',\n axisColor,\n areas: [\n {\n label: 'Used',\n color: '#377eb899',\n points: activeMemoryX\n },\n {\n label: 'Free',\n color: '#4daf4a99',\n points: availableMemoryX\n }\n ]\n })\n : null;\n const networkIORead = networkReadX && networkReadX.length\n ? yield getLineGraph({\n label: 'Network I/O Read (MB)',\n axisColor,\n line: {\n label: 'Read',\n color: '#be4d25',\n points: networkReadX\n }\n })\n : null;\n const networkIOWrite = networkWriteX && networkWriteX.length\n ? yield getLineGraph({\n label: 'Network I/O Write (MB)',\n axisColor,\n line: {\n label: 'Write',\n color: '#6c25be',\n points: networkWriteX\n }\n })\n : null;\n const diskIORead = diskReadX && diskReadX.length\n ? yield getLineGraph({\n label: 'Disk I/O Read (MB)',\n axisColor,\n line: {\n label: 'Read',\n color: '#be4d25',\n points: diskReadX\n }\n })\n : null;\n const diskIOWrite = diskWriteX && diskWriteX.length\n ? yield getLineGraph({\n label: 'Disk I/O Write (MB)',\n axisColor,\n line: {\n label: 'Write',\n color: '#6c25be',\n points: diskWriteX\n }\n })\n : null;\n const postContentItems = [];\n if (cpuLoad) {\n postContentItems.push('### CPU Metrics', `![${cpuLoad.id}](${cpuLoad.url})`, '');\n }\n if (memoryUsage) {\n postContentItems.push('### Memory Metrics', `![${memoryUsage.id}](${memoryUsage.url})`, '');\n }\n if ((networkIORead && networkIOWrite) || (diskIORead && diskIOWrite)) {\n postContentItems.push('### IO Metrics', '| | Read | Write |', '|--- |--- |--- |');\n }\n if (networkIORead && networkIOWrite) {\n postContentItems.push(`| Network I/O | ![${networkIORead.id}](${networkIORead.url}) | ![${networkIOWrite.id}](${networkIOWrite.url}) |`);\n }\n if (diskIORead && diskIOWrite) {\n postContentItems.push(`| Disk I/O | ![${diskIORead.id}](${diskIORead.url}) | ![${diskIOWrite.id}](${diskIOWrite.url}) |`);\n }\n return postContentItems.join('\\n');\n });\n}\nfunction getCPUStats() {\n return __awaiter(this, void 0, void 0, function* () {\n const userLoadX = [];\n const systemLoadX = [];\n logger.debug('Getting CPU stats ...');\n const response = yield axios_1.default.get(`http://localhost:${STAT_SERVER_PORT}/cpu`);\n if (logger.isDebugEnabled()) {\n logger.debug(`Got CPU stats: ${JSON.stringify(response.data)}`);\n }\n response.data.forEach((element) => {\n userLoadX.push({\n x: element.time,\n y: element.userLoad && element.userLoad > 0 ? element.userLoad : 0\n });\n systemLoadX.push({\n x: element.time,\n y: element.systemLoad && element.systemLoad > 0 ? element.systemLoad : 0\n });\n });\n return { userLoadX, systemLoadX };\n });\n}\nfunction getMemoryStats() {\n return __awaiter(this, void 0, void 0, function* () {\n const activeMemoryX = [];\n const availableMemoryX = [];\n logger.debug('Getting memory stats ...');\n const response = yield axios_1.default.get(`http://localhost:${STAT_SERVER_PORT}/memory`);\n if (logger.isDebugEnabled()) {\n logger.debug(`Got memory stats: ${JSON.stringify(response.data)}`);\n }\n response.data.forEach((element) => {\n activeMemoryX.push({\n x: element.time,\n y: element.activeMemoryMb && element.activeMemoryMb > 0\n ? element.activeMemoryMb\n : 0\n });\n availableMemoryX.push({\n x: element.time,\n y: element.availableMemoryMb && element.availableMemoryMb > 0\n ? element.availableMemoryMb\n : 0\n });\n });\n return { activeMemoryX, availableMemoryX };\n });\n}\nfunction getNetworkStats() {\n return __awaiter(this, void 0, void 0, function* () {\n const networkReadX = [];\n const networkWriteX = [];\n logger.debug('Getting network stats ...');\n const response = yield axios_1.default.get(`http://localhost:${STAT_SERVER_PORT}/network`);\n if (logger.isDebugEnabled()) {\n logger.debug(`Got network stats: ${JSON.stringify(response.data)}`);\n }\n response.data.forEach((element) => {\n networkReadX.push({\n x: element.time,\n y: element.rxMb && element.rxMb > 0 ? element.rxMb : 0\n });\n networkWriteX.push({\n x: element.time,\n y: element.txMb && element.txMb > 0 ? element.txMb : 0\n });\n });\n return { networkReadX, networkWriteX };\n });\n}\nfunction getDiskStats() {\n return __awaiter(this, void 0, void 0, function* () {\n const diskReadX = [];\n const diskWriteX = [];\n logger.debug('Getting disk stats ...');\n const response = yield axios_1.default.get(`http://localhost:${STAT_SERVER_PORT}/disk`);\n if (logger.isDebugEnabled()) {\n logger.debug(`Got disk stats: ${JSON.stringify(response.data)}`);\n }\n response.data.forEach((element) => {\n diskReadX.push({\n x: element.time,\n y: element.rxMb && element.rxMb > 0 ? element.rxMb : 0\n });\n diskWriteX.push({\n x: element.time,\n y: element.wxMb && element.wxMb > 0 ? element.wxMb : 0\n });\n });\n return { diskReadX, diskWriteX };\n });\n}\nfunction getLineGraph(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const payload = {\n options: {\n width: 1000,\n height: 500,\n xAxis: {\n label: 'Time'\n },\n yAxis: {\n label: options.label\n },\n timeTicks: {\n unit: 'auto'\n }\n },\n lines: [options.line]\n };\n let response = null;\n try {\n response = yield axios_1.default.put('https://api.globadge.com/v1/chartgen/line/time', payload);\n }\n catch (error) {\n logger.error(error);\n logger.error(`getLineGraph ${JSON.stringify(payload)}`);\n }\n return response === null || response === void 0 ? void 0 : response.data;\n });\n}\nfunction getStackedAreaGraph(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const payload = {\n options: {\n width: 1000,\n height: 500,\n xAxis: {\n label: 'Time'\n },\n yAxis: {\n label: options.label\n },\n timeTicks: {\n unit: 'auto'\n }\n },\n areas: options.areas\n };\n let response = null;\n try {\n response = yield axios_1.default.put('https://api.globadge.com/v1/chartgen/stacked-area/time', payload);\n }\n catch (error) {\n logger.error(error);\n logger.error(`getStackedAreaGraph ${JSON.stringify(payload)}`);\n }\n return response === null || response === void 0 ? void 0 : response.data;\n });\n}\n///////////////////////////\nfunction start() {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Starting stat collector ...`);\n try {\n let metricFrequency = 0;\n const metricFrequencyInput = core.getInput('metric_frequency');\n if (metricFrequencyInput) {\n const metricFrequencyVal = parseInt(metricFrequencyInput);\n if (Number.isInteger(metricFrequencyVal)) {\n metricFrequency = metricFrequencyVal * 1000;\n }\n }\n const child = (0, child_process_1.spawn)(process.argv[0], [path_1.default.join(__dirname, '../scw/index.js')], {\n detached: true,\n stdio: 'ignore',\n env: Object.assign(Object.assign({}, process.env), { WORKFLOW_TELEMETRY_STAT_FREQ: metricFrequency\n ? `${metricFrequency}`\n : undefined })\n });\n child.unref();\n logger.info(`Started stat collector`);\n return true;\n }\n catch (error) {\n logger.error('Unable to start stat collector');\n logger.error(error);\n return false;\n }\n });\n}\nexports.start = start;\nfunction finish(currentJob) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Finishing stat collector ...`);\n try {\n // Trigger stat collect, so we will have remaining stats since the latest schedule\n yield triggerStatCollect();\n logger.info(`Finished stat collector`);\n return true;\n }\n catch (error) {\n logger.error('Unable to finish stat collector');\n logger.error(error);\n return false;\n }\n });\n}\nexports.finish = finish;\nfunction report(currentJob) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Reporting stat collector result ...`);\n try {\n const postContent = yield reportWorkflowMetrics();\n logger.info(`Reported stat collector result`);\n return postContent;\n }\n catch (error) {\n logger.error('Unable to report stat collector result');\n logger.error(error);\n return null;\n }\n });\n}\nexports.report = report;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.report = exports.finish = exports.start = void 0;\nconst logger = __importStar(require(\"./logger\"));\nfunction generateTraceChartForSteps(job) {\n let chartContent = '';\n /**\n gantt\n title Build\n dateFormat x\n axisFormat %H:%M:%S\n Set up job : milestone, 1658073446000, 1658073450000\n Collect Workflow Telemetry : 1658073450000, 1658073450000\n Run actions/checkout@v2 : 1658073451000, 1658073453000\n Set up JDK 8 : 1658073453000, 1658073458000\n Build with Maven : 1658073459000, 1658073654000\n Run invalid command : crit, 1658073655000, 1658073654000\n Archive test results : done, 1658073655000, 1658073654000\n Post Set up JDK 8 : 1658073655000, 1658073654000\n Post Run actions/checkout@v2 : 1658073655000, 1658073655000\n */\n chartContent = chartContent.concat('gantt', '\\n');\n chartContent = chartContent.concat('\\t', `title ${job.name}`, '\\n');\n chartContent = chartContent.concat('\\t', `dateFormat x`, '\\n');\n chartContent = chartContent.concat('\\t', `axisFormat %H:%M:%S`, '\\n');\n for (const step of job.steps || []) {\n if (!step.started_at || !step.completed_at) {\n continue;\n }\n chartContent = chartContent.concat('\\t', `${step.name.replace(/:/g, '-')} : `);\n if (step.name === 'Set up job' && step.number === 1) {\n chartContent = chartContent.concat('milestone, ');\n }\n if (step.conclusion === 'failure') {\n // to show red\n chartContent = chartContent.concat('crit, ');\n }\n else if (step.conclusion === 'skipped') {\n // to show grey\n chartContent = chartContent.concat('done, ');\n }\n const startTime = new Date(step.started_at).getTime();\n const finishTime = new Date(step.completed_at).getTime();\n chartContent = chartContent.concat(`${Math.min(startTime, finishTime)}, ${finishTime}`, '\\n');\n }\n const postContentItems = [\n '',\n '### Step Trace',\n '',\n '```mermaid' + '\\n' + chartContent + '\\n' + '```'\n ];\n return postContentItems.join('\\n');\n}\n///////////////////////////\nfunction start() {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Starting step tracer ...`);\n try {\n logger.info(`Started step tracer`);\n return true;\n }\n catch (error) {\n logger.error('Unable to start step tracer');\n logger.error(error);\n return false;\n }\n });\n}\nexports.start = start;\nfunction finish(currentJob) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Finishing step tracer ...`);\n try {\n logger.info(`Finished step tracer`);\n return true;\n }\n catch (error) {\n logger.error('Unable to finish step tracer');\n logger.error(error);\n return false;\n }\n });\n}\nexports.finish = finish;\nfunction report(currentJob) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Reporting step tracer result ...`);\n if (!currentJob) {\n return null;\n }\n try {\n const postContent = generateTraceChartForSteps(currentJob);\n logger.info(`Reported step tracer result`);\n return postContent;\n }\n catch (error) {\n logger.error('Unable to report step tracer result');\n logger.error(error);\n return null;\n }\n });\n}\nexports.report = report;\n",null,"// Axios v1.1.3 Copyright (c) 2022 Matt Zabriskie and contributors\n'use strict';\n\nconst FormData$1 = require('form-data');\nconst url = require('url');\nconst proxyFromEnv = require('proxy-from-env');\nconst http = require('http');\nconst https = require('https');\nconst followRedirects = require('follow-redirects');\nconst zlib = require('zlib');\nconst stream = require('stream');\nconst EventEmitter = require('events');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nconst FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1);\nconst url__default = /*#__PURE__*/_interopDefaultLegacy(url);\nconst http__default = /*#__PURE__*/_interopDefaultLegacy(http);\nconst https__default = /*#__PURE__*/_interopDefaultLegacy(https);\nconst followRedirects__default = /*#__PURE__*/_interopDefaultLegacy(followRedirects);\nconst zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib);\nconst stream__default = /*#__PURE__*/_interopDefaultLegacy(stream);\nconst EventEmitter__default = /*#__PURE__*/_interopDefaultLegacy(EventEmitter);\n\nfunction bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n};\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n};\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n const pattern = '[object FormData]';\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) ||\n toString.call(thing) === pattern ||\n (isFunction(thing.toString) && thing.toString() === pattern)\n );\n};\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {void}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const result = {};\n const assignValue = (val, key) => {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n };\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n};\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n};\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n};\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n};\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n};\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n};\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n};\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n};\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[_-\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n if (reducer(descriptor, name, obj) !== false) {\n reducedDescriptors[name] = descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n};\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not read-only method \\'' + name + '\\'');\n };\n }\n });\n};\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n };\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n};\n\nconst noop = () => {};\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n};\n\nconst utils = {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber\n};\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype$1 = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype$1, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype$1);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliant(thing) {\n return thing && utils.isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator];\n}\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (FormData__default[\"default\"] || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && isSpecCompliant(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n (utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode$1(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode$1);\n } : encode$1;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nfunction buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nconst transitionalDefaults = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n\nconst URLSearchParams = url__default[\"default\"].URLSearchParams;\n\nconst platform = {\n isNode: true,\n classes: {\n URLSearchParams,\n FormData: FormData__default[\"default\"],\n Blob: typeof Blob !== 'undefined' && Blob || null\n },\n protocols: [ 'http', 'https', 'file', 'data' ]\n};\n\nfunction toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nfunction settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nfunction isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nfunction combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nfunction buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n\nconst VERSION = \"1.1.3\";\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nfunction parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n\nconst DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\\s\\S]*)$/;\n\n/**\n * Parse data uri to a Buffer or Blob\n *\n * @param {String} uri\n * @param {?Boolean} asBlob\n * @param {?Object} options\n * @param {?Function} options.Blob\n *\n * @returns {Buffer|Blob}\n */\nfunction fromDataURI(uri, asBlob, options) {\n const _Blob = options && options.Blob || platform.classes.Blob;\n const protocol = parseProtocol(uri);\n\n if (asBlob === undefined && _Blob) {\n asBlob = true;\n }\n\n if (protocol === 'data') {\n uri = protocol.length ? uri.slice(protocol.length + 1) : uri;\n\n const match = DATA_URL_PATTERN.exec(uri);\n\n if (!match) {\n throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);\n }\n\n const mime = match[1];\n const isBase64 = match[2];\n const body = match[3];\n const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8');\n\n if (asBlob) {\n if (!_Blob) {\n throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);\n }\n\n return new _Blob([buffer], {type: mime});\n }\n\n return buffer;\n }\n\n throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);\n}\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nconst parseHeaders = rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n\nconst $internals = Symbol('internals');\nconst $defaults = Symbol('defaults');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nfunction matchHeaderValue(context, value, header, filter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nfunction AxiosHeaders(headers, defaults) {\n headers && this.set(headers);\n this[$defaults] = defaults || null;\n}\n\nObject.assign(AxiosHeaders.prototype, {\n set: function(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = findKey(self, lHeader);\n\n if (key && _rewrite !== true && (self[key] === false || _rewrite === false)) {\n return;\n }\n\n self[key || _header] = normalizeValue(_value);\n }\n\n if (utils.isPlainObject(header)) {\n utils.forEach(header, (_value, _header) => {\n setHeader(_value, _header, valueOrRewrite);\n });\n } else {\n setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n },\n\n get: function(header, parser) {\n header = normalizeHeader(header);\n\n if (!header) return undefined;\n\n const key = findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n },\n\n has: function(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = findKey(this, header);\n\n return !!(key && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n },\n\n delete: function(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n },\n\n clear: function() {\n return Object.keys(this).forEach(this.delete.bind(this));\n },\n\n normalize: function(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n },\n\n toJSON: function(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(Object.assign({}, this[$defaults] || null, this),\n (value, header) => {\n if (value == null || value === false) return;\n obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value;\n });\n\n return obj;\n }\n});\n\nObject.assign(AxiosHeaders, {\n from: function(thing) {\n if (utils.isString(thing)) {\n return new this(parseHeaders(thing));\n }\n return thing instanceof this ? thing : new this(thing);\n },\n\n accessor: function(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n});\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent']);\n\nutils.freezeMethods(AxiosHeaders.prototype);\nutils.freezeMethods(AxiosHeaders);\n\n/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n const threshold = 1000 / freq;\n let timer = null;\n return function throttled(force, args) {\n const now = Date.now();\n if (force || now - timestamp > threshold) {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n timestamp = now;\n return fn.apply(null, args);\n }\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n timestamp = Date.now();\n return fn.apply(null, args);\n }, threshold - (now - timestamp));\n }\n };\n}\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nconst kInternals = Symbol('internals');\n\nclass AxiosTransformStream extends stream__default[\"default\"].Transform{\n constructor(options) {\n options = utils.toFlatObject(options, {\n maxRate: 0,\n chunkSize: 64 * 1024,\n minChunkSize: 100,\n timeWindow: 500,\n ticksRate: 2,\n samplesCount: 15\n }, null, (prop, source) => {\n return !utils.isUndefined(source[prop]);\n });\n\n super({\n readableHighWaterMark: options.chunkSize\n });\n\n const self = this;\n\n const internals = this[kInternals] = {\n length: options.length,\n timeWindow: options.timeWindow,\n ticksRate: options.ticksRate,\n chunkSize: options.chunkSize,\n maxRate: options.maxRate,\n minChunkSize: options.minChunkSize,\n bytesSeen: 0,\n isCaptured: false,\n notifiedBytesLoaded: 0,\n ts: Date.now(),\n bytes: 0,\n onReadCallback: null\n };\n\n const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);\n\n this.on('newListener', event => {\n if (event === 'progress') {\n if (!internals.isCaptured) {\n internals.isCaptured = true;\n }\n }\n });\n\n let bytesNotified = 0;\n\n internals.updateProgress = throttle(function throttledHandler() {\n const totalBytes = internals.length;\n const bytesTransferred = internals.bytesSeen;\n const progressBytes = bytesTransferred - bytesNotified;\n if (!progressBytes || self.destroyed) return;\n\n const rate = _speedometer(progressBytes);\n\n bytesNotified = bytesTransferred;\n\n process.nextTick(() => {\n self.emit('progress', {\n 'loaded': bytesTransferred,\n 'total': totalBytes,\n 'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined,\n 'bytes': progressBytes,\n 'rate': rate ? rate : undefined,\n 'estimated': rate && totalBytes && bytesTransferred <= totalBytes ?\n (totalBytes - bytesTransferred) / rate : undefined\n });\n });\n }, internals.ticksRate);\n\n const onFinish = () => {\n internals.updateProgress(true);\n };\n\n this.once('end', onFinish);\n this.once('error', onFinish);\n }\n\n _read(size) {\n const internals = this[kInternals];\n\n if (internals.onReadCallback) {\n internals.onReadCallback();\n }\n\n return super._read(size);\n }\n\n _transform(chunk, encoding, callback) {\n const self = this;\n const internals = this[kInternals];\n const maxRate = internals.maxRate;\n\n const readableHighWaterMark = this.readableHighWaterMark;\n\n const timeWindow = internals.timeWindow;\n\n const divider = 1000 / timeWindow;\n const bytesThreshold = (maxRate / divider);\n const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;\n\n function pushChunk(_chunk, _callback) {\n const bytes = Buffer.byteLength(_chunk);\n internals.bytesSeen += bytes;\n internals.bytes += bytes;\n\n if (internals.isCaptured) {\n internals.updateProgress();\n }\n\n if (self.push(_chunk)) {\n process.nextTick(_callback);\n } else {\n internals.onReadCallback = () => {\n internals.onReadCallback = null;\n process.nextTick(_callback);\n };\n }\n }\n\n const transformChunk = (_chunk, _callback) => {\n const chunkSize = Buffer.byteLength(_chunk);\n let chunkRemainder = null;\n let maxChunkSize = readableHighWaterMark;\n let bytesLeft;\n let passed = 0;\n\n if (maxRate) {\n const now = Date.now();\n\n if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) {\n internals.ts = now;\n bytesLeft = bytesThreshold - internals.bytes;\n internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;\n passed = 0;\n }\n\n bytesLeft = bytesThreshold - internals.bytes;\n }\n\n if (maxRate) {\n if (bytesLeft <= 0) {\n // next time window\n return setTimeout(() => {\n _callback(null, _chunk);\n }, timeWindow - passed);\n }\n\n if (bytesLeft < maxChunkSize) {\n maxChunkSize = bytesLeft;\n }\n }\n\n if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) {\n chunkRemainder = _chunk.subarray(maxChunkSize);\n _chunk = _chunk.subarray(0, maxChunkSize);\n }\n\n pushChunk(_chunk, chunkRemainder ? () => {\n process.nextTick(_callback, null, chunkRemainder);\n } : _callback);\n };\n\n transformChunk(chunk, function transformNextChunk(err, _chunk) {\n if (err) {\n return callback(err);\n }\n\n if (_chunk) {\n transformChunk(_chunk, transformNextChunk);\n } else {\n callback(null);\n }\n });\n }\n\n setLength(length) {\n this[kInternals].length = +length;\n return this;\n }\n}\n\nconst isBrotliSupported = utils.isFunction(zlib__default[\"default\"].createBrotliDecompress);\n\nconst {http: httpFollow, https: httpsFollow} = followRedirects__default[\"default\"];\n\nconst isHttps = /https:?/;\n\nconst supportedProtocols = platform.protocols.map(protocol => {\n return protocol + ':';\n});\n\n/**\n * If the proxy or config beforeRedirects functions are defined, call them with the options\n * object.\n *\n * @param {Object} options - The options object that was passed to the request.\n *\n * @returns {Object}\n */\nfunction dispatchBeforeRedirect(options) {\n if (options.beforeRedirects.proxy) {\n options.beforeRedirects.proxy(options);\n }\n if (options.beforeRedirects.config) {\n options.beforeRedirects.config(options);\n }\n}\n\n/**\n * If the proxy or config afterRedirects functions are defined, call them with the options\n *\n * @param {http.ClientRequestArgs} options\n * @param {AxiosProxyConfig} configProxy configuration from Axios options object\n * @param {string} location\n *\n * @returns {http.ClientRequestArgs}\n */\nfunction setProxy(options, configProxy, location) {\n let proxy = configProxy;\n if (!proxy && proxy !== false) {\n const proxyUrl = proxyFromEnv.getProxyForUrl(location);\n if (proxyUrl) {\n proxy = new URL(proxyUrl);\n }\n }\n if (proxy) {\n // Basic proxy authorization\n if (proxy.username) {\n proxy.auth = (proxy.username || '') + ':' + (proxy.password || '');\n }\n\n if (proxy.auth) {\n // Support proxy auth object form\n if (proxy.auth.username || proxy.auth.password) {\n proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');\n }\n const base64 = Buffer\n .from(proxy.auth, 'utf8')\n .toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n\n options.headers.host = options.hostname + (options.port ? ':' + options.port : '');\n const proxyHost = proxy.hostname || proxy.host;\n options.hostname = proxyHost;\n // Replace 'host' since options is not a URL object\n options.host = proxyHost;\n options.port = proxy.port;\n options.path = location;\n if (proxy.protocol) {\n options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`;\n }\n }\n\n options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {\n // Configure proxy for redirected request, passing the original config proxy to apply\n // the exact same logic as if the redirected request was performed by axios directly.\n setProxy(redirectOptions, configProxy, redirectOptions.href);\n };\n}\n\n/*eslint consistent-return:0*/\nfunction httpAdapter(config) {\n return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {\n let data = config.data;\n const responseType = config.responseType;\n const responseEncoding = config.responseEncoding;\n const method = config.method.toUpperCase();\n let isFinished;\n let isDone;\n let rejected = false;\n let req;\n\n // temporary internal emitter until the AxiosRequest class will be implemented\n const emitter = new EventEmitter__default[\"default\"]();\n\n function onFinished() {\n if (isFinished) return;\n isFinished = true;\n\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(abort);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', abort);\n }\n\n emitter.removeAllListeners();\n }\n\n function done(value, isRejected) {\n if (isDone) return;\n\n isDone = true;\n\n if (isRejected) {\n rejected = true;\n onFinished();\n }\n\n isRejected ? rejectPromise(value) : resolvePromise(value);\n }\n\n const resolve = function resolve(value) {\n done(value);\n };\n\n const reject = function reject(value) {\n done(value, true);\n };\n\n function abort(reason) {\n emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);\n }\n\n emitter.once('abort', reject);\n\n if (config.cancelToken || config.signal) {\n config.cancelToken && config.cancelToken.subscribe(abort);\n if (config.signal) {\n config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);\n }\n }\n\n // Parse url\n const fullPath = buildFullPath(config.baseURL, config.url);\n const parsed = new URL(fullPath);\n const protocol = parsed.protocol || supportedProtocols[0];\n\n if (protocol === 'data:') {\n let convertedData;\n\n if (method !== 'GET') {\n return settle(resolve, reject, {\n status: 405,\n statusText: 'method not allowed',\n headers: {},\n config\n });\n }\n\n try {\n convertedData = fromDataURI(config.url, responseType === 'blob', {\n Blob: config.env && config.env.Blob\n });\n } catch (err) {\n throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);\n }\n\n if (responseType === 'text') {\n convertedData = convertedData.toString(responseEncoding);\n\n if (!responseEncoding || responseEncoding === 'utf8') {\n data = utils.stripBOM(convertedData);\n }\n } else if (responseType === 'stream') {\n convertedData = stream__default[\"default\"].Readable.from(convertedData);\n }\n\n return settle(resolve, reject, {\n data: convertedData,\n status: 200,\n statusText: 'OK',\n headers: {},\n config\n });\n }\n\n if (supportedProtocols.indexOf(protocol) === -1) {\n return reject(new AxiosError(\n 'Unsupported protocol ' + protocol,\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n\n const headers = AxiosHeaders.from(config.headers).normalize();\n\n // Set User-Agent (required by some servers)\n // See https://github.com/axios/axios/issues/69\n // User-Agent is specified; handle case where no UA header is desired\n // Only set header if it hasn't been set in config\n headers.set('User-Agent', 'axios/' + VERSION, false);\n\n const onDownloadProgress = config.onDownloadProgress;\n const onUploadProgress = config.onUploadProgress;\n const maxRate = config.maxRate;\n let maxUploadRate = undefined;\n let maxDownloadRate = undefined;\n\n // support for https://www.npmjs.com/package/form-data api\n if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {\n headers.set(data.getHeaders());\n } else if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) ; else if (utils.isArrayBuffer(data)) {\n data = Buffer.from(new Uint8Array(data));\n } else if (utils.isString(data)) {\n data = Buffer.from(data, 'utf-8');\n } else {\n return reject(new AxiosError(\n 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n\n // Add Content-Length header if data exists\n headers.set('Content-Length', data.length, false);\n\n if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {\n return reject(new AxiosError(\n 'Request body larger than maxBodyLength limit',\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n }\n\n const contentLength = +headers.getContentLength();\n\n if (utils.isArray(maxRate)) {\n maxUploadRate = maxRate[0];\n maxDownloadRate = maxRate[1];\n } else {\n maxUploadRate = maxDownloadRate = maxRate;\n }\n\n if (data && (onUploadProgress || maxUploadRate)) {\n if (!utils.isStream(data)) {\n data = stream__default[\"default\"].Readable.from(data, {objectMode: false});\n }\n\n data = stream__default[\"default\"].pipeline([data, new AxiosTransformStream({\n length: utils.toFiniteNumber(contentLength),\n maxRate: utils.toFiniteNumber(maxUploadRate)\n })], utils.noop);\n\n onUploadProgress && data.on('progress', progress => {\n onUploadProgress(Object.assign(progress, {\n upload: true\n }));\n });\n }\n\n // HTTP basic authentication\n let auth = undefined;\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n if (!auth && parsed.username) {\n const urlUsername = parsed.username;\n const urlPassword = parsed.password;\n auth = urlUsername + ':' + urlPassword;\n }\n\n auth && headers.delete('authorization');\n\n let path;\n\n try {\n path = buildURL(\n parsed.pathname + parsed.search,\n config.params,\n config.paramsSerializer\n ).replace(/^\\?/, '');\n } catch (err) {\n const customErr = new Error(err.message);\n customErr.config = config;\n customErr.url = config.url;\n customErr.exists = true;\n return reject(customErr);\n }\n\n headers.set('Accept-Encoding', 'gzip, deflate, br', false);\n\n const options = {\n path,\n method: method,\n headers: headers.toJSON(),\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth,\n protocol,\n beforeRedirect: dispatchBeforeRedirect,\n beforeRedirects: {}\n };\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);\n }\n\n let transport;\n const isHttpsRequest = isHttps.test(options.protocol);\n options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsRequest ? https__default[\"default\"] : http__default[\"default\"];\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n if (config.beforeRedirect) {\n options.beforeRedirects.config = config.beforeRedirect;\n }\n transport = isHttpsRequest ? httpsFollow : httpFollow;\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n } else {\n // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited\n options.maxBodyLength = Infinity;\n }\n\n if (config.insecureHTTPParser) {\n options.insecureHTTPParser = config.insecureHTTPParser;\n }\n\n // Create the request\n req = transport.request(options, function handleResponse(res) {\n if (req.destroyed) return;\n\n const streams = [res];\n\n // uncompress the response body transparently if required\n let responseStream = res;\n\n // return the last request in case of redirects\n const lastRequest = res.req || req;\n\n // if decompress disabled we should not decompress\n if (config.decompress !== false) {\n // if no content, but headers still say that it is encoded,\n // remove the header not confuse downstream operations\n if (data && data.length === 0 && res.headers['content-encoding']) {\n delete res.headers['content-encoding'];\n }\n\n switch (res.headers['content-encoding']) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'compress':\n case 'deflate':\n // add the unzipper to the body stream processing pipeline\n streams.push(zlib__default[\"default\"].createUnzip());\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n case 'br':\n if (isBrotliSupported) {\n streams.push(zlib__default[\"default\"].createBrotliDecompress());\n delete res.headers['content-encoding'];\n }\n }\n }\n\n if (onDownloadProgress) {\n const responseLength = +res.headers['content-length'];\n\n const transformStream = new AxiosTransformStream({\n length: utils.toFiniteNumber(responseLength),\n maxRate: utils.toFiniteNumber(maxDownloadRate)\n });\n\n onDownloadProgress && transformStream.on('progress', progress => {\n onDownloadProgress(Object.assign(progress, {\n download: true\n }));\n });\n\n streams.push(transformStream);\n }\n\n responseStream = streams.length > 1 ? stream__default[\"default\"].pipeline(streams, utils.noop) : streams[0];\n\n const offListeners = stream__default[\"default\"].finished(responseStream, () => {\n offListeners();\n onFinished();\n });\n\n const response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: new AxiosHeaders(res.headers),\n config,\n request: lastRequest\n };\n\n if (responseType === 'stream') {\n response.data = responseStream;\n settle(resolve, reject, response);\n } else {\n const responseBuffer = [];\n let totalResponseBytes = 0;\n\n responseStream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n totalResponseBytes += chunk.length;\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {\n // stream.destroy() emit aborted event before calling reject() on Node.js v16\n rejected = true;\n responseStream.destroy();\n reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE, config, lastRequest));\n }\n });\n\n responseStream.on('aborted', function handlerStreamAborted() {\n if (rejected) {\n return;\n }\n\n const err = new AxiosError(\n 'maxContentLength size of ' + config.maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n lastRequest\n );\n responseStream.destroy(err);\n reject(err);\n });\n\n responseStream.on('error', function handleStreamError(err) {\n if (req.destroyed) return;\n reject(AxiosError.from(err, null, config, lastRequest));\n });\n\n responseStream.on('end', function handleStreamEnd() {\n try {\n let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);\n if (responseType !== 'arraybuffer') {\n responseData = responseData.toString(responseEncoding);\n if (!responseEncoding || responseEncoding === 'utf8') {\n responseData = utils.stripBOM(responseData);\n }\n }\n response.data = responseData;\n } catch (err) {\n reject(AxiosError.from(err, null, config, response.request, response));\n }\n settle(resolve, reject, response);\n });\n }\n\n emitter.once('abort', err => {\n if (!responseStream.destroyed) {\n responseStream.emit('error', err);\n responseStream.destroy();\n }\n });\n });\n\n emitter.once('abort', err => {\n reject(err);\n req.destroy(err);\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n // @todo remove\n // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;\n reject(AxiosError.from(err, null, config, req));\n });\n\n // set tcp keep alive to prevent drop connection by peer\n req.on('socket', function handleRequestSocket(socket) {\n // default interval of sending ack packet is 1 minute\n socket.setKeepAlive(true, 1000 * 60);\n });\n\n // Handle request timeout\n if (config.timeout) {\n // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.\n const timeout = parseInt(config.timeout, 10);\n\n if (isNaN(timeout)) {\n reject(new AxiosError(\n 'error trying to parse `config.timeout` to int',\n AxiosError.ERR_BAD_OPTION_VALUE,\n config,\n req\n ));\n\n return;\n }\n\n // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.\n // And timer callback will be fired, and abort() will be invoked before connection, then get \"socket hang up\" and code ECONNRESET.\n // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.\n // And then these socket which be hang up will devouring CPU little by little.\n // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.\n req.setTimeout(timeout, function handleRequestTimeout() {\n if (isDone) return;\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n req\n ));\n abort();\n });\n }\n\n\n // Send the request\n if (utils.isStream(data)) {\n let ended = false;\n let errored = false;\n\n data.on('end', () => {\n ended = true;\n });\n\n data.once('error', err => {\n errored = true;\n req.destroy(err);\n });\n\n data.on('close', () => {\n if (!ended && !errored) {\n abort(new CanceledError('Request stream has been aborted', config, req));\n }\n });\n\n data.pipe(req);\n } else {\n req.end(data);\n }\n });\n}\n\nconst cookies = platform.isStandardBrowserEnv ?\n\n// Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n const cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n// Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })();\n\nconst isURLSameOrigin = platform.isStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nfunction xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n const responseType = config.responseType;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData) && platform.isStandardBrowserEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (platform.isStandardBrowserEnv) {\n // Add xsrf header\n const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))\n && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n\nconst adapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n};\n\nconst adapters$1 = {\n getAdapter: (nameOrAdapter) => {\n if(utils.isString(nameOrAdapter)){\n const adapter = adapters[nameOrAdapter];\n\n if (!nameOrAdapter) {\n throw Error(\n utils.hasOwnProp(nameOrAdapter) ?\n `Adapter '${nameOrAdapter}' is not available in the build` :\n `Can not resolve adapter '${nameOrAdapter}'`\n );\n }\n\n return adapter\n }\n\n if (!utils.isFunction(nameOrAdapter)) {\n throw new TypeError('adapter is not a function');\n }\n\n return nameOrAdapter;\n },\n adapters\n};\n\nconst DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\n/**\n * If the browser has an XMLHttpRequest object, use the XHR adapter, otherwise use the HTTP\n * adapter\n *\n * @returns {Function}\n */\nfunction getDefaultAdapter() {\n let adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = adapters$1.getAdapter('xhr');\n } else if (typeof process !== 'undefined' && utils.kindOf(process) === 'process') {\n // For node use HTTP adapter\n adapter = adapters$1.getAdapter('http');\n }\n return adapter;\n}\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n if (!hasJSONContentType) {\n return data;\n }\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nfunction transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n\nfunction isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nfunction dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n const adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nfunction mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n const mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'beforeRedirect': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n\nconst validators$1 = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators$1[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators$1.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nconst validator = {\n assertOptions,\n validators: validators$1\n};\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer !== undefined) {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n const defaultHeaders = config.headers && utils.merge(\n config.headers.common,\n config.headers[config.method]\n );\n\n defaultHeaders && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n config.headers = new AxiosHeaders(config.headers, defaultHeaders);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nfunction spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nfunction isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\naxios.formToJSON = thing => {\n return formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n};\n\nmodule.exports = axios;\n//# sourceMappingURL=axios.cjs.map\n","module.exports = require(\"assert\");;","module.exports = require(\"child_process\");;","module.exports = require(\"events\");;","module.exports = require(\"fs\");;","module.exports = require(\"http\");;","module.exports = require(\"https\");;","module.exports = require(\"net\");;","module.exports = require(\"os\");;","module.exports = require(\"path\");;","module.exports = require(\"punycode\");;","module.exports = require(\"readline\");;","module.exports = require(\"stream\");;","module.exports = require(\"tls\");;","module.exports = require(\"tty\");;","module.exports = require(\"url\");;","module.exports = require(\"util\");;","module.exports = require(\"zlib\");;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => module['default'] :\n\t\t() => module;\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\n__webpack_require__.ab = __dirname + \"/\";","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(7051);\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AChVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACljCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClgCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACjNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC9QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACnRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACxQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACvlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACtfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC7LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACnKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AClqDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3qDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7vBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7vCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACviCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClsDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1oCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1uCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC9zBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1bA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7vCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5uBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AClMA;AACA;AACA;A;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACzQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;;;;;;;;;;;;;ACnBA;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;;ACHA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC9LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACxIA;AACA;AACA;A;;;;;AAFA;AACA;AACA;A;;;;;AAFA;AACA;AACA;A;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;A;;;;;;;;A;;;;;;;;A;;;;;;ACrrHA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACNA;AACA;ACDA;AACA;AACA;AACA;;A","sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../webpack://workflow-telemetry-action/./node_modules/@actions/core/lib/command.js","../webpack://workflow-telemetry-action/./node_modules/@actions/core/lib/core.js","../webpack://workflow-telemetry-action/./node_modules/@actions/core/lib/file-command.js","../webpack://workflow-telemetry-action/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://workflow-telemetry-action/./node_modules/@actions/core/lib/path-utils.js","../webpack://workflow-telemetry-action/./node_modules/@actions/core/lib/summary.js","../webpack://workflow-telemetry-action/./node_modules/@actions/core/lib/utils.js","../webpack://workflow-telemetry-action/./node_modules/@actions/github/lib/context.js","../webpack://workflow-telemetry-action/./node_modules/@actions/github/lib/github.js","../webpack://workflow-telemetry-action/./node_modules/@actions/github/lib/internal/utils.js","../webpack://workflow-telemetry-action/./node_modules/@actions/github/lib/utils.js","../webpack://workflow-telemetry-action/./node_modules/@actions/http-client/lib/auth.js","../webpack://workflow-telemetry-action/./node_modules/@actions/http-client/lib/index.js","../webpack://workflow-telemetry-action/./node_modules/@actions/http-client/lib/proxy.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/auth-token/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/core/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/endpoint/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/graphql/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/request-error/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/action/node_modules/@octokit/request/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/auth-action/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/auth-action/node_modules/@octokit/auth-token/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/auth-token/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/core/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/endpoint/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/graphql/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/request-error/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/@octokit/request/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/agent-base/dist/src/index.js","../webpack://workflow-telemetry-action/./node_modules/agent-base/dist/src/promisify.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/index.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/lib/abort.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/lib/async.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/lib/defer.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/lib/iterate.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/lib/state.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/lib/terminator.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/parallel.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/serial.js","../webpack://workflow-telemetry-action/./node_modules/asynckit/serialOrdered.js","../webpack://workflow-telemetry-action/./node_modules/before-after-hook/index.js","../webpack://workflow-telemetry-action/./node_modules/before-after-hook/lib/add.js","../webpack://workflow-telemetry-action/./node_modules/before-after-hook/lib/register.js","../webpack://workflow-telemetry-action/./node_modules/before-after-hook/lib/remove.js","../webpack://workflow-telemetry-action/./node_modules/combined-stream/lib/combined_stream.js","../webpack://workflow-telemetry-action/./node_modules/debug/src/browser.js","../webpack://workflow-telemetry-action/./node_modules/debug/src/common.js","../webpack://workflow-telemetry-action/./node_modules/debug/src/index.js","../webpack://workflow-telemetry-action/./node_modules/debug/src/node.js","../webpack://workflow-telemetry-action/./node_modules/delayed-stream/lib/delayed_stream.js","../webpack://workflow-telemetry-action/./node_modules/deprecation/dist-node/index.js","../webpack://workflow-telemetry-action/./node_modules/follow-redirects/debug.js","../webpack://workflow-telemetry-action/./node_modules/follow-redirects/index.js","../webpack://workflow-telemetry-action/./node_modules/form-data/lib/form_data.js","../webpack://workflow-telemetry-action/./node_modules/form-data/lib/populate.js","../webpack://workflow-telemetry-action/./node_modules/https-proxy-agent/dist/agent.js","../webpack://workflow-telemetry-action/./node_modules/https-proxy-agent/dist/index.js","../webpack://workflow-telemetry-action/./node_modules/https-proxy-agent/dist/parse-proxy-response.js","../webpack://workflow-telemetry-action/./node_modules/is-plain-object/dist/is-plain-object.js","../webpack://workflow-telemetry-action/./node_modules/mime-db/index.js","../webpack://workflow-telemetry-action/./node_modules/mime-types/index.js","../webpack://workflow-telemetry-action/./node_modules/ms/index.js","../webpack://workflow-telemetry-action/./node_modules/node-fetch/lib/index.js","../webpack://workflow-telemetry-action/./node_modules/once/once.js","../webpack://workflow-telemetry-action/./node_modules/proxy-from-env/index.js","../webpack://workflow-telemetry-action/./node_modules/sprintf-js/src/sprintf.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/audio.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/battery.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/bluetooth.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/cpu.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/docker.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/dockerSocket.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/filesystem.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/graphics.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/index.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/internet.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/memory.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/network.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/osinfo.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/printer.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/processes.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/system.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/usb.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/users.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/util.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/virtualbox.js","../webpack://workflow-telemetry-action/./node_modules/systeminformation/lib/wifi.js","../webpack://workflow-telemetry-action/./node_modules/tr46/index.js","../webpack://workflow-telemetry-action/./node_modules/tunnel/index.js","../webpack://workflow-telemetry-action/./node_modules/tunnel/lib/tunnel.js","../webpack://workflow-telemetry-action/./node_modules/universal-user-agent/dist-node/index.js","../webpack://workflow-telemetry-action/external \"crypto\"","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/rng.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/regex.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/validate.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/stringify.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/v1.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/parse.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/v35.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/md5.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/v3.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/v4.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/sha1.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/v5.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/nil.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/version.js","../webpack://workflow-telemetry-action/./node_modules/uuid/dist/esm-node/index.js","../webpack://workflow-telemetry-action/./node_modules/webidl-conversions/lib/index.js","../webpack://workflow-telemetry-action/./node_modules/whatwg-url/lib/URL-impl.js","../webpack://workflow-telemetry-action/./node_modules/whatwg-url/lib/URL.js","../webpack://workflow-telemetry-action/./node_modules/whatwg-url/lib/public-api.js","../webpack://workflow-telemetry-action/./node_modules/whatwg-url/lib/url-state-machine.js","../webpack://workflow-telemetry-action/./node_modules/whatwg-url/lib/utils.js","../webpack://workflow-telemetry-action/./node_modules/wrappy/wrappy.js","../webpack://workflow-telemetry-action/./src/logger.ts","../webpack://workflow-telemetry-action/./src/post.ts","../webpack://workflow-telemetry-action/./src/procTraceParser.ts","../webpack://workflow-telemetry-action/./src/processTracer.ts","../webpack://workflow-telemetry-action/./src/statCollector.ts","../webpack://workflow-telemetry-action/./src/stepTracer.ts","../webpack://workflow-telemetry-action/./node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack://workflow-telemetry-action/./node_modules/axios/dist/node/axios.cjs","../webpack://workflow-telemetry-action/external \"assert\"","../webpack://workflow-telemetry-action/external \"child_process\"","../webpack://workflow-telemetry-action/external \"events\"","../webpack://workflow-telemetry-action/external \"fs\"","../webpack://workflow-telemetry-action/external \"http\"","../webpack://workflow-telemetry-action/external \"https\"","../webpack://workflow-telemetry-action/external \"net\"","../webpack://workflow-telemetry-action/external \"os\"","../webpack://workflow-telemetry-action/external \"path\"","../webpack://workflow-telemetry-action/external \"punycode\"","../webpack://workflow-telemetry-action/external \"readline\"","../webpack://workflow-telemetry-action/external \"stream\"","../webpack://workflow-telemetry-action/external \"tls\"","../webpack://workflow-telemetry-action/external \"tty\"","../webpack://workflow-telemetry-action/external \"url\"","../webpack://workflow-telemetry-action/external \"util\"","../webpack://workflow-telemetry-action/external \"zlib\"","../webpack://workflow-telemetry-action/webpack/bootstrap","../webpack://workflow-telemetry-action/webpack/runtime/compat get default export","../webpack://workflow-telemetry-action/webpack/runtime/define property getters","../webpack://workflow-telemetry-action/webpack/runtime/hasOwnProperty shorthand","../webpack://workflow-telemetry-action/webpack/runtime/make namespace object","../webpack://workflow-telemetry-action/webpack/runtime/compat","../webpack://workflow-telemetry-action/webpack/startup"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));\n }\n command_1.issueCommand('set-env', { name }, convertedVal);\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueFileCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));\n }\n command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.prepareKeyValueMessage = exports.issueFileCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst uuid_1 = require(\"uuid\");\nconst utils_1 = require(\"./utils\");\nfunction issueFileCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueFileCommand = issueFileCommand;\nfunction prepareKeyValueMessage(key, value) {\n const delimiter = `ghadelimiter_${uuid_1.v4()}`;\n const convertedValue = utils_1.toCommandValue(value);\n // These should realistically never happen, but just in case someone finds a\n // way to exploit uuid generation let's not allow keys or values that contain\n // the delimiter.\n if (key.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedValue.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\nexports.prepareKeyValueMessage = prepareKeyValueMessage;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Context = void 0;\nconst fs_1 = require(\"fs\");\nconst os_1 = require(\"os\");\nclass Context {\n /**\n * Hydrate the context from the environment\n */\n constructor() {\n var _a, _b, _c;\n this.payload = {};\n if (process.env.GITHUB_EVENT_PATH) {\n if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {\n this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));\n }\n else {\n const path = process.env.GITHUB_EVENT_PATH;\n process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);\n }\n }\n this.eventName = process.env.GITHUB_EVENT_NAME;\n this.sha = process.env.GITHUB_SHA;\n this.ref = process.env.GITHUB_REF;\n this.workflow = process.env.GITHUB_WORKFLOW;\n this.action = process.env.GITHUB_ACTION;\n this.actor = process.env.GITHUB_ACTOR;\n this.job = process.env.GITHUB_JOB;\n this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);\n this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);\n this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;\n this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;\n this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;\n }\n get issue() {\n const payload = this.payload;\n return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });\n }\n get repo() {\n if (process.env.GITHUB_REPOSITORY) {\n const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');\n return { owner, repo };\n }\n if (this.payload.repository) {\n return {\n owner: this.payload.repository.owner.login,\n repo: this.payload.repository.name\n };\n }\n throw new Error(\"context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'\");\n }\n}\nexports.Context = Context;\n//# sourceMappingURL=context.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokit = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst utils_1 = require(\"./utils\");\nexports.context = new Context.Context();\n/**\n * Returns a hydrated octokit ready to use for GitHub Actions\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokit(token, options, ...additionalPlugins) {\n const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);\n return new GitHubWithPlugins(utils_1.getOctokitOptions(token, options));\n}\nexports.getOctokit = getOctokit;\n//# sourceMappingURL=github.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0;\nconst httpClient = __importStar(require(\"@actions/http-client\"));\nfunction getAuthString(token, options) {\n if (!token && !options.auth) {\n throw new Error('Parameter token or opts.auth is required');\n }\n else if (token && options.auth) {\n throw new Error('Parameters token and opts.auth may not both be specified');\n }\n return typeof options.auth === 'string' ? options.auth : `token ${token}`;\n}\nexports.getAuthString = getAuthString;\nfunction getProxyAgent(destinationUrl) {\n const hc = new httpClient.HttpClient();\n return hc.getAgent(destinationUrl);\n}\nexports.getProxyAgent = getProxyAgent;\nfunction getApiBaseUrl() {\n return process.env['GITHUB_API_URL'] || 'https://api.github.com';\n}\nexports.getApiBaseUrl = getApiBaseUrl;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst Utils = __importStar(require(\"./internal/utils\"));\n// octokit + plugins\nconst core_1 = require(\"@octokit/core\");\nconst plugin_rest_endpoint_methods_1 = require(\"@octokit/plugin-rest-endpoint-methods\");\nconst plugin_paginate_rest_1 = require(\"@octokit/plugin-paginate-rest\");\nexports.context = new Context.Context();\nconst baseUrl = Utils.getApiBaseUrl();\nexports.defaults = {\n baseUrl,\n request: {\n agent: Utils.getProxyAgent(baseUrl)\n }\n};\nexports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);\n/**\n * Convience function to correctly format Octokit Options to pass into the constructor.\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}\nexports.getOctokitOptions = getOctokitOptions;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","\"use strict\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nconst pm = __importStar(require(\"./proxy\"));\nconst tunnel = __importStar(require(\"tunnel\"));\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nexports.HttpClient = HttpClient;\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkBypass = exports.getProxyUrl = void 0;\nfunction getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n return new URL(proxyVar);\n }\n else {\n return undefined;\n }\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperReqHosts.some(x => x === upperNoProxyItem)) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\n//# sourceMappingURL=proxy.js.map","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar core = require('@octokit/core');\nvar authAction = require('@octokit/auth-action');\nvar pluginPaginateRest = require('@octokit/plugin-paginate-rest');\nvar pluginRestEndpointMethods = require('@octokit/plugin-rest-endpoint-methods');\n\nconst VERSION = \"4.0.10\";\n\nconst HttpsProxyAgent = require(\"https-proxy-agent\");\n\nconst DEFAULTS = {\n authStrategy: authAction.createActionAuth,\n baseUrl: getApiBaseUrl(),\n userAgent: `octokit-action.js/${VERSION}`\n};\n\nfunction getProxyAgent() {\n const httpProxy = process.env[\"HTTP_PROXY\"] || process.env[\"http_proxy\"];\n\n if (httpProxy) {\n return new HttpsProxyAgent(httpProxy);\n }\n\n const httpsProxy = process.env[\"HTTPS_PROXY\"] || process.env[\"https_proxy\"];\n\n if (httpsProxy) {\n return new HttpsProxyAgent(httpsProxy);\n }\n\n return undefined;\n}\n\nconst Octokit = core.Octokit.plugin(pluginPaginateRest.paginateRest, pluginRestEndpointMethods.legacyRestEndpointMethods).defaults(function buildDefaults(options) {\n return { ...DEFAULTS,\n ...options,\n request: {\n agent: getProxyAgent(),\n ...options.request\n }\n };\n});\n\nfunction getApiBaseUrl() {\n /* istanbul ignore next */\n return process.env[\"GITHUB_API_URL\"] || \"https://api.github.com\";\n}\n\nexports.Octokit = Octokit;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst REGEX_IS_INSTALLATION_LEGACY = /^v1\\./;\nconst REGEX_IS_INSTALLATION = /^ghs_/;\nconst REGEX_IS_USER_TO_SERVER = /^ghu_/;\nasync function auth(token) {\n const isApp = token.split(/\\./).length === 3;\n const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);\n const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);\n const tokenType = isApp ? \"app\" : isInstallation ? \"installation\" : isUserToServer ? \"user-to-server\" : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n\n/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nfunction withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}\n\nasync function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n\nconst createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n\nexports.createTokenAuth = createTokenAuth;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar universalUserAgent = require('universal-user-agent');\nvar beforeAfterHook = require('before-after-hook');\nvar request = require('@octokit/request');\nvar graphql = require('@octokit/graphql');\nvar authToken = require('@octokit/auth-token');\n\nconst VERSION = \"4.1.0\";\n\nclass Octokit {\n constructor(options = {}) {\n const hook = new beforeAfterHook.Collection();\n const requestDefaults = {\n baseUrl: request.request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n // @ts-ignore internal usage only, no need to type\n hook: hook.bind(null, \"request\")\n }),\n mediaType: {\n previews: [],\n format: \"\"\n }\n }; // prepend default user agent with `options.userAgent` if set\n\n requestDefaults.headers[\"user-agent\"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(\" \");\n\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n\n this.request = request.request.defaults(requestDefaults);\n this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults);\n this.log = Object.assign({\n debug: () => {},\n info: () => {},\n warn: console.warn.bind(console),\n error: console.error.bind(console)\n }, options.log);\n this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance\n // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.\n // (2) If only `options.auth` is set, use the default token authentication strategy.\n // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.\n // TODO: type `options.auth` based on `options.authStrategy`.\n\n if (!options.authStrategy) {\n if (!options.auth) {\n // (1)\n this.auth = async () => ({\n type: \"unauthenticated\"\n });\n } else {\n // (2)\n const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n } else {\n const {\n authStrategy,\n ...otherOptions\n } = options;\n const auth = authStrategy(Object.assign({\n request: this.request,\n log: this.log,\n // we pass the current octokit instance as well as its constructor options\n // to allow for authentication strategies that return a new octokit instance\n // that shares the same internal state as the current one. The original\n // requirement for this was the \"event-octokit\" authentication strategy\n // of https://github.com/probot/octokit-auth-probot.\n octokit: this,\n octokitOptions: otherOptions\n }, options.auth)); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n } // apply plugins\n // https://stackoverflow.com/a/16345172\n\n\n const classConstructor = this.constructor;\n classConstructor.plugins.forEach(plugin => {\n Object.assign(this, plugin(this, options));\n });\n }\n\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n\n super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`\n } : null));\n }\n\n };\n return OctokitWithDefaults;\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n\n\n static plugin(...newPlugins) {\n var _a;\n\n const currentPlugins = this.plugins;\n const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a);\n return NewOctokit;\n }\n\n}\nOctokit.VERSION = VERSION;\nOctokit.plugins = [];\n\nexports.Octokit = Octokit;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar isPlainObject = require('is-plain-object');\nvar universalUserAgent = require('universal-user-agent');\n\nfunction lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n\nfunction mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach(key => {\n if (isPlainObject.isPlainObject(options[key])) {\n if (!(key in defaults)) Object.assign(result, {\n [key]: options[key]\n });else result[key] = mergeDeep(defaults[key], options[key]);\n } else {\n Object.assign(result, {\n [key]: options[key]\n });\n }\n });\n return result;\n}\n\nfunction removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n\n return obj;\n}\n\nfunction merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? {\n method,\n url\n } : {\n url: method\n }, options);\n } else {\n options = Object.assign({}, route);\n } // lowercase header names before merging with defaults to avoid duplicates\n\n\n options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging\n\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten\n\n if (defaults && defaults.mediaType.previews.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);\n }\n\n mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, \"\"));\n return mergedOptions;\n}\n\nfunction addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n\n if (names.length === 0) {\n return url;\n }\n\n return url + separator + names.map(name => {\n if (name === \"q\") {\n return \"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\");\n }\n\n return `${name}=${encodeURIComponent(parameters[name])}`;\n }).join(\"&\");\n}\n\nconst urlVariableRegex = /\\{[^}]+\\}/g;\n\nfunction removeNonChars(variableName) {\n return variableName.replace(/^\\W+|\\W+$/g, \"\").split(/,/);\n}\n\nfunction extractUrlVariableNames(url) {\n const matches = url.match(urlVariableRegex);\n\n if (!matches) {\n return [];\n }\n\n return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);\n}\n\nfunction omit(object, keysToOmit) {\n return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {\n obj[key] = object[key];\n return obj;\n }, {});\n}\n\n// Based on https://github.com/bramstein/url-template, licensed under BSD\n// TODO: create separate package.\n//\n// Copyright (c) 2012-2014, Bram Stein\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// 3. The name of the author may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/* istanbul ignore file */\nfunction encodeReserved(str) {\n return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n\n return part;\n }).join(\"\");\n}\n\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\n\nfunction encodeValue(operator, value, key) {\n value = operator === \"+\" || operator === \"#\" ? encodeReserved(value) : encodeUnreserved(value);\n\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n } else {\n return value;\n }\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\n\nfunction getValues(context, operator, key, modifier) {\n var value = context[key],\n result = [];\n\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n value = value.toString();\n\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n } else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n } else {\n const tmp = [];\n\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n tmp.push(encodeValue(operator, value));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n } else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n } else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n } else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n } else if (value === \"\") {\n result.push(\"\");\n }\n }\n\n return result;\n}\n\nfunction parseUrl(template) {\n return {\n expand: expand.bind(null, template)\n };\n}\n\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n\n if (operator && operator !== \"+\") {\n var separator = \",\";\n\n if (operator === \"?\") {\n separator = \"&\";\n } else if (operator !== \"#\") {\n separator = operator;\n }\n\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n } else {\n return values.join(\",\");\n }\n } else {\n return encodeReserved(literal);\n }\n });\n}\n\nfunction parse(options) {\n // https://fetch.spec.whatwg.org/#methods\n let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible\n\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"mediaType\"]); // extract variable names from URL to calculate remaining variables later\n\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n\n const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw\n headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(\",\");\n }\n\n if (options.mediaType.previews.length) {\n const previewsFromAcceptHeader = headers.accept.match(/[\\w-]+(?=-preview)/g) || [];\n headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {\n const format = options.mediaType.format ? `.${options.mediaType.format}` : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n }).join(\",\");\n }\n } // for GET/HEAD requests, set URL query parameters from remaining parameters\n // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters\n\n\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n } else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n } else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n }\n }\n } // default content-type for JSON if body is set\n\n\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.\n // fetch does not allow to set `content-length` header, but we can set body to an empty string\n\n\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n } // Only return body/request keys if present\n\n\n return Object.assign({\n method,\n url,\n headers\n }, typeof body !== \"undefined\" ? {\n body\n } : null, options.request ? {\n request: options.request\n } : null);\n}\n\nfunction endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n\nfunction withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse\n });\n}\n\nconst VERSION = \"7.0.3\";\n\nconst userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.\n// So we use RequestParameters and add method as additional required property.\n\nconst DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent\n },\n mediaType: {\n format: \"\",\n previews: []\n }\n};\n\nconst endpoint = withDefaults(null, DEFAULTS);\n\nexports.endpoint = endpoint;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar request = require('@octokit/request');\nvar universalUserAgent = require('universal-user-agent');\n\nconst VERSION = \"5.0.3\";\n\nfunction _buildMessageForResponseErrors(data) {\n return `Request failed due to following response errors:\\n` + data.errors.map(e => ` - ${e.message}`).join(\"\\n\");\n}\n\nclass GraphqlResponseError extends Error {\n constructor(request, headers, response) {\n super(_buildMessageForResponseErrors(response));\n this.request = request;\n this.headers = headers;\n this.response = response;\n this.name = \"GraphqlResponseError\"; // Expose the errors and response data in their shorthand properties.\n\n this.errors = response.errors;\n this.data = response.data; // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n\n}\n\nconst NON_VARIABLE_OPTIONS = [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"query\", \"mediaType\"];\nconst FORBIDDEN_VARIABLE_OPTIONS = [\"query\", \"method\", \"url\"];\nconst GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nfunction graphql(request, query, options) {\n if (options) {\n if (typeof query === \"string\" && \"query\" in options) {\n return Promise.reject(new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`));\n }\n\n for (const key in options) {\n if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;\n return Promise.reject(new Error(`[@octokit/graphql] \"${key}\" cannot be used as variable name`));\n }\n }\n\n const parsedOptions = typeof query === \"string\" ? Object.assign({\n query\n }, options) : query;\n const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n\n if (!result.variables) {\n result.variables = {};\n }\n\n result.variables[key] = parsedOptions[key];\n return result;\n }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix\n // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451\n\n const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;\n\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n\n return request(requestOptions).then(response => {\n if (response.data.errors) {\n const headers = {};\n\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n\n throw new GraphqlResponseError(requestOptions, headers, response.data);\n }\n\n return response.data.data;\n });\n}\n\nfunction withDefaults(request, newDefaults) {\n const newRequest = request.defaults(newDefaults);\n\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: newRequest.endpoint\n });\n}\n\nconst graphql$1 = withDefaults(request.request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n },\n method: \"POST\",\n url: \"/graphql\"\n});\nfunction withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\"\n });\n}\n\nexports.GraphqlResponseError = GraphqlResponseError;\nexports.graphql = graphql$1;\nexports.withCustomRequest = withCustomRequest;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst VERSION = \"5.0.1\";\n\n/**\n * Some “list” response that can be paginated have a different response structure\n *\n * They have a `total_count` key in the response (search also has `incomplete_results`,\n * /installation/repositories also has `repository_selection`), as well as a key with\n * the list of the items which name varies from endpoint to endpoint.\n *\n * Octokit normalizes these responses so that paginated results are always returned following\n * the same structure. One challenge is that if the list response has only one page, no Link\n * header is provided, so this header alone is not sufficient to check wether a response is\n * paginated or not.\n *\n * We check if a \"total_count\" key is present in the response data, but also make sure that\n * a \"url\" property is not, as the \"Get the combined status for a specific ref\" endpoint would\n * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref\n */\nfunction normalizePaginatedListResponse(response) {\n // endpoints can respond with 204 if repository is empty\n if (!response.data) {\n return {\n ...response,\n data: []\n };\n }\n const responseNeedsNormalization = \"total_count\" in response.data && !(\"url\" in response.data);\n if (!responseNeedsNormalization) return response;\n // keep the additional properties intact as there is currently no other way\n // to retrieve the same information.\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n response.data.total_count = totalCount;\n return response;\n}\n\nfunction iterator(octokit, route, parameters) {\n const options = typeof route === \"function\" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n async next() {\n if (!url) return {\n done: true\n };\n try {\n const response = await requestMethod({\n method,\n url,\n headers\n });\n const normalizedResponse = normalizePaginatedListResponse(response);\n // `response.headers.link` format:\n // '; rel=\"next\", ; rel=\"last\"'\n // sets `url` to undefined if \"next\" URL is not present or `link` header is not set\n url = ((normalizedResponse.headers.link || \"\").match(/<([^>]+)>;\\s*rel=\"next\"/) || [])[1];\n return {\n value: normalizedResponse\n };\n } catch (error) {\n if (error.status !== 409) throw error;\n url = \"\";\n return {\n value: {\n status: 200,\n headers: {},\n data: []\n }\n };\n }\n }\n })\n };\n}\n\nfunction paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = undefined;\n }\n return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);\n}\nfunction gather(octokit, results, iterator, mapFn) {\n return iterator.next().then(result => {\n if (result.done) {\n return results;\n }\n let earlyExit = false;\n function done() {\n earlyExit = true;\n }\n results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);\n if (earlyExit) {\n return results;\n }\n return gather(octokit, results, iterator, mapFn);\n });\n}\n\nconst composePaginateRest = Object.assign(paginate, {\n iterator\n});\n\nconst paginatingEndpoints = [\"GET /app/hook/deliveries\", \"GET /app/installations\", \"GET /enterprises/{enterprise}/actions/permissions/organizations\", \"GET /enterprises/{enterprise}/actions/runner-groups\", \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\", \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\", \"GET /enterprises/{enterprise}/actions/runners\", \"GET /enterprises/{enterprise}/code-scanning/alerts\", \"GET /enterprises/{enterprise}/secret-scanning/alerts\", \"GET /enterprises/{enterprise}/settings/billing/advanced-security\", \"GET /events\", \"GET /gists\", \"GET /gists/public\", \"GET /gists/starred\", \"GET /gists/{gist_id}/comments\", \"GET /gists/{gist_id}/commits\", \"GET /gists/{gist_id}/forks\", \"GET /installation/repositories\", \"GET /issues\", \"GET /licenses\", \"GET /marketplace_listing/plans\", \"GET /marketplace_listing/plans/{plan_id}/accounts\", \"GET /marketplace_listing/stubbed/plans\", \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\", \"GET /networks/{owner}/{repo}/events\", \"GET /notifications\", \"GET /organizations\", \"GET /organizations/{org}/codespaces/secrets\", \"GET /organizations/{org}/codespaces/secrets/{secret_name}/repositories\", \"GET /orgs/{org}/actions/cache/usage-by-repository\", \"GET /orgs/{org}/actions/permissions/repositories\", \"GET /orgs/{org}/actions/runner-groups\", \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\", \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners\", \"GET /orgs/{org}/actions/runners\", \"GET /orgs/{org}/actions/secrets\", \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\", \"GET /orgs/{org}/blocks\", \"GET /orgs/{org}/code-scanning/alerts\", \"GET /orgs/{org}/codespaces\", \"GET /orgs/{org}/dependabot/secrets\", \"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories\", \"GET /orgs/{org}/events\", \"GET /orgs/{org}/failed_invitations\", \"GET /orgs/{org}/hooks\", \"GET /orgs/{org}/hooks/{hook_id}/deliveries\", \"GET /orgs/{org}/installations\", \"GET /orgs/{org}/invitations\", \"GET /orgs/{org}/invitations/{invitation_id}/teams\", \"GET /orgs/{org}/issues\", \"GET /orgs/{org}/members\", \"GET /orgs/{org}/migrations\", \"GET /orgs/{org}/migrations/{migration_id}/repositories\", \"GET /orgs/{org}/outside_collaborators\", \"GET /orgs/{org}/packages\", \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\", \"GET /orgs/{org}/projects\", \"GET /orgs/{org}/public_members\", \"GET /orgs/{org}/repos\", \"GET /orgs/{org}/secret-scanning/alerts\", \"GET /orgs/{org}/settings/billing/advanced-security\", \"GET /orgs/{org}/teams\", \"GET /orgs/{org}/teams/{team_slug}/discussions\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\", \"GET /orgs/{org}/teams/{team_slug}/invitations\", \"GET /orgs/{org}/teams/{team_slug}/members\", \"GET /orgs/{org}/teams/{team_slug}/projects\", \"GET /orgs/{org}/teams/{team_slug}/repos\", \"GET /orgs/{org}/teams/{team_slug}/teams\", \"GET /projects/columns/{column_id}/cards\", \"GET /projects/{project_id}/collaborators\", \"GET /projects/{project_id}/columns\", \"GET /repos/{owner}/{repo}/actions/artifacts\", \"GET /repos/{owner}/{repo}/actions/caches\", \"GET /repos/{owner}/{repo}/actions/runners\", \"GET /repos/{owner}/{repo}/actions/runs\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\", \"GET /repos/{owner}/{repo}/actions/secrets\", \"GET /repos/{owner}/{repo}/actions/workflows\", \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\", \"GET /repos/{owner}/{repo}/assignees\", \"GET /repos/{owner}/{repo}/branches\", \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\", \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\", \"GET /repos/{owner}/{repo}/code-scanning/alerts\", \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\", \"GET /repos/{owner}/{repo}/code-scanning/analyses\", \"GET /repos/{owner}/{repo}/codespaces\", \"GET /repos/{owner}/{repo}/codespaces/devcontainers\", \"GET /repos/{owner}/{repo}/codespaces/secrets\", \"GET /repos/{owner}/{repo}/collaborators\", \"GET /repos/{owner}/{repo}/comments\", \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/commits\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\", \"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\", \"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\", \"GET /repos/{owner}/{repo}/commits/{ref}/status\", \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\", \"GET /repos/{owner}/{repo}/contributors\", \"GET /repos/{owner}/{repo}/dependabot/alerts\", \"GET /repos/{owner}/{repo}/dependabot/secrets\", \"GET /repos/{owner}/{repo}/deployments\", \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\", \"GET /repos/{owner}/{repo}/environments\", \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\", \"GET /repos/{owner}/{repo}/events\", \"GET /repos/{owner}/{repo}/forks\", \"GET /repos/{owner}/{repo}/hooks\", \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\", \"GET /repos/{owner}/{repo}/invitations\", \"GET /repos/{owner}/{repo}/issues\", \"GET /repos/{owner}/{repo}/issues/comments\", \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/issues/events\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/events\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\", \"GET /repos/{owner}/{repo}/keys\", \"GET /repos/{owner}/{repo}/labels\", \"GET /repos/{owner}/{repo}/milestones\", \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\", \"GET /repos/{owner}/{repo}/notifications\", \"GET /repos/{owner}/{repo}/pages/builds\", \"GET /repos/{owner}/{repo}/projects\", \"GET /repos/{owner}/{repo}/pulls\", \"GET /repos/{owner}/{repo}/pulls/comments\", \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\", \"GET /repos/{owner}/{repo}/releases\", \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\", \"GET /repos/{owner}/{repo}/releases/{release_id}/reactions\", \"GET /repos/{owner}/{repo}/secret-scanning/alerts\", \"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations\", \"GET /repos/{owner}/{repo}/stargazers\", \"GET /repos/{owner}/{repo}/subscribers\", \"GET /repos/{owner}/{repo}/tags\", \"GET /repos/{owner}/{repo}/teams\", \"GET /repos/{owner}/{repo}/topics\", \"GET /repositories\", \"GET /repositories/{repository_id}/environments/{environment_name}/secrets\", \"GET /search/code\", \"GET /search/commits\", \"GET /search/issues\", \"GET /search/labels\", \"GET /search/repositories\", \"GET /search/topics\", \"GET /search/users\", \"GET /teams/{team_id}/discussions\", \"GET /teams/{team_id}/discussions/{discussion_number}/comments\", \"GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\", \"GET /teams/{team_id}/discussions/{discussion_number}/reactions\", \"GET /teams/{team_id}/invitations\", \"GET /teams/{team_id}/members\", \"GET /teams/{team_id}/projects\", \"GET /teams/{team_id}/repos\", \"GET /teams/{team_id}/teams\", \"GET /user/blocks\", \"GET /user/codespaces\", \"GET /user/codespaces/secrets\", \"GET /user/emails\", \"GET /user/followers\", \"GET /user/following\", \"GET /user/gpg_keys\", \"GET /user/installations\", \"GET /user/installations/{installation_id}/repositories\", \"GET /user/issues\", \"GET /user/keys\", \"GET /user/marketplace_purchases\", \"GET /user/marketplace_purchases/stubbed\", \"GET /user/memberships/orgs\", \"GET /user/migrations\", \"GET /user/migrations/{migration_id}/repositories\", \"GET /user/orgs\", \"GET /user/packages\", \"GET /user/packages/{package_type}/{package_name}/versions\", \"GET /user/public_emails\", \"GET /user/repos\", \"GET /user/repository_invitations\", \"GET /user/ssh_signing_keys\", \"GET /user/starred\", \"GET /user/subscriptions\", \"GET /user/teams\", \"GET /users\", \"GET /users/{username}/events\", \"GET /users/{username}/events/orgs/{org}\", \"GET /users/{username}/events/public\", \"GET /users/{username}/followers\", \"GET /users/{username}/following\", \"GET /users/{username}/gists\", \"GET /users/{username}/gpg_keys\", \"GET /users/{username}/keys\", \"GET /users/{username}/orgs\", \"GET /users/{username}/packages\", \"GET /users/{username}/projects\", \"GET /users/{username}/received_events\", \"GET /users/{username}/received_events/public\", \"GET /users/{username}/repos\", \"GET /users/{username}/ssh_signing_keys\", \"GET /users/{username}/starred\", \"GET /users/{username}/subscriptions\"];\n\nfunction isPaginatingEndpoint(arg) {\n if (typeof arg === \"string\") {\n return paginatingEndpoints.includes(arg);\n } else {\n return false;\n }\n}\n\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\nfunction paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit)\n })\n };\n}\npaginateRest.VERSION = VERSION;\n\nexports.composePaginateRest = composePaginateRest;\nexports.isPaginatingEndpoint = isPaginatingEndpoint;\nexports.paginateRest = paginateRest;\nexports.paginatingEndpoints = paginatingEndpoints;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst Endpoints = {\n actions: {\n addCustomLabelsToSelfHostedRunnerForOrg: [\"POST /orgs/{org}/actions/runners/{runner_id}/labels\"],\n addCustomLabelsToSelfHostedRunnerForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n addSelectedRepoToOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n approveWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve\"],\n cancelWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\"],\n createOrUpdateEnvironmentSecret: [\"PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n createRegistrationTokenForOrg: [\"POST /orgs/{org}/actions/runners/registration-token\"],\n createRegistrationTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/registration-token\"],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/remove-token\"],\n createWorkflowDispatch: [\"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\"],\n deleteActionsCacheById: [\"DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}\"],\n deleteActionsCacheByKey: [\"DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}\"],\n deleteArtifact: [\"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n deleteEnvironmentSecret: [\"DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n deleteSelfHostedRunnerFromOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}\"],\n deleteSelfHostedRunnerFromRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n disableSelectedRepositoryGithubActionsOrganization: [\"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n disableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\"],\n downloadArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\"],\n downloadJobLogsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\"],\n downloadWorkflowRunAttemptLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs\"],\n downloadWorkflowRunLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n enableSelectedRepositoryGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n enableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\"],\n getActionsCacheList: [\"GET /repos/{owner}/{repo}/actions/caches\"],\n getActionsCacheUsage: [\"GET /repos/{owner}/{repo}/actions/cache/usage\"],\n getActionsCacheUsageByRepoForOrg: [\"GET /orgs/{org}/actions/cache/usage-by-repository\"],\n getActionsCacheUsageForEnterprise: [\"GET /enterprises/{enterprise}/actions/cache/usage\"],\n getActionsCacheUsageForOrg: [\"GET /orgs/{org}/actions/cache/usage\"],\n getAllowedActionsOrganization: [\"GET /orgs/{org}/actions/permissions/selected-actions\"],\n getAllowedActionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getEnvironmentPublicKey: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key\"],\n getEnvironmentSecret: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n getGithubActionsDefaultWorkflowPermissionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/workflow\"],\n getGithubActionsDefaultWorkflowPermissionsOrganization: [\"GET /orgs/{org}/actions/permissions/workflow\"],\n getGithubActionsDefaultWorkflowPermissionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/workflow\"],\n getGithubActionsPermissionsOrganization: [\"GET /orgs/{org}/actions/permissions\"],\n getGithubActionsPermissionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions\"],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getPendingDeploymentsForRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"],\n getRepoPermissions: [\"GET /repos/{owner}/{repo}/actions/permissions\", {}, {\n renamed: [\"actions\", \"getGithubActionsPermissionsRepository\"]\n }],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getReviewsForRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals\"],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowAccessToRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/access\"],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunAttempt: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}\"],\n getWorkflowRunUsage: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\"],\n getWorkflowUsage: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\"],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listEnvironmentSecrets: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets\"],\n listJobsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\"],\n listJobsForWorkflowRunAttempt: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\"],\n listLabelsForSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}/labels\"],\n listLabelsForSelfHostedRunnerForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/downloads\"],\n listSelectedReposForOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n listSelectedRepositoriesEnabledGithubActionsOrganization: [\"GET /orgs/{org}/actions/permissions/repositories\"],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\"],\n listWorkflowRuns: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\"],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n reRunJobForWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun\"],\n reRunWorkflow: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun\"],\n reRunWorkflowFailedJobs: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs\"],\n removeAllCustomLabelsFromSelfHostedRunnerForOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}/labels\"],\n removeAllCustomLabelsFromSelfHostedRunnerForRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n removeCustomLabelFromSelfHostedRunnerForOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}\"],\n removeCustomLabelFromSelfHostedRunnerForRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n reviewPendingDeploymentsForRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"],\n setAllowedActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/selected-actions\"],\n setAllowedActionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n setCustomLabelsForSelfHostedRunnerForOrg: [\"PUT /orgs/{org}/actions/runners/{runner_id}/labels\"],\n setCustomLabelsForSelfHostedRunnerForRepo: [\"PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n setGithubActionsDefaultWorkflowPermissionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/workflow\"],\n setGithubActionsDefaultWorkflowPermissionsOrganization: [\"PUT /orgs/{org}/actions/permissions/workflow\"],\n setGithubActionsDefaultWorkflowPermissionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/workflow\"],\n setGithubActionsPermissionsOrganization: [\"PUT /orgs/{org}/actions/permissions\"],\n setGithubActionsPermissionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions\"],\n setSelectedReposForOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n setSelectedRepositoriesEnabledGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories\"],\n setWorkflowAccessToRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/access\"]\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\"DELETE /notifications/threads/{thread_id}/subscription\"],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\"GET /notifications/threads/{thread_id}/subscription\"],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\"GET /users/{username}/events/orgs/{org}\"],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\"GET /users/{username}/received_events/public\"],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/notifications\"],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\"PUT /notifications/threads/{thread_id}/subscription\"],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"]\n },\n apps: {\n addRepoToInstallation: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\", {}, {\n renamed: [\"apps\", \"addRepoToInstallationForAuthenticatedUser\"]\n }],\n addRepoToInstallationForAuthenticatedUser: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\"],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\"POST /app/installations/{installation_id}/access_tokens\"],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\"GET /marketplace_listing/accounts/{account_id}\"],\n getSubscriptionPlanForAccountStubbed: [\"GET /marketplace_listing/stubbed/accounts/{account_id}\"],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n getWebhookConfigForApp: [\"GET /app/hook/config\"],\n getWebhookDelivery: [\"GET /app/hook/deliveries/{delivery_id}\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\"],\n listInstallationReposForAuthenticatedUser: [\"GET /user/installations/{installation_id}/repositories\"],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\"GET /user/marketplace_purchases/stubbed\"],\n listWebhookDeliveries: [\"GET /app/hook/deliveries\"],\n redeliverWebhookDelivery: [\"POST /app/hook/deliveries/{delivery_id}/attempts\"],\n removeRepoFromInstallation: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\", {}, {\n renamed: [\"apps\", \"removeRepoFromInstallationForAuthenticatedUser\"]\n }],\n removeRepoFromInstallationForAuthenticatedUser: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\"],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n scopeToken: [\"POST /applications/{client_id}/token/scoped\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\"DELETE /app/installations/{installation_id}/suspended\"],\n updateWebhookConfigForApp: [\"PATCH /app/hook/config\"]\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\"GET /users/{username}/settings/billing/actions\"],\n getGithubAdvancedSecurityBillingGhe: [\"GET /enterprises/{enterprise}/settings/billing/advanced-security\"],\n getGithubAdvancedSecurityBillingOrg: [\"GET /orgs/{org}/settings/billing/advanced-security\"],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\"GET /users/{username}/settings/billing/packages\"],\n getSharedStorageBillingOrg: [\"GET /orgs/{org}/settings/billing/shared-storage\"],\n getSharedStorageBillingUser: [\"GET /users/{username}/settings/billing/shared-storage\"]\n },\n checks: {\n create: [\"POST /repos/{owner}/{repo}/check-runs\"],\n createSuite: [\"POST /repos/{owner}/{repo}/check-suites\"],\n get: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n getSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\"],\n listAnnotations: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\"],\n listForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\"],\n listForSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\"],\n listSuitesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\"],\n rerequestRun: [\"POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest\"],\n rerequestSuite: [\"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\"],\n setSuitesPreferences: [\"PATCH /repos/{owner}/{repo}/check-suites/preferences\"],\n update: [\"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\"]\n },\n codeScanning: {\n deleteAnalysis: [\"DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}\"],\n getAlert: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\", {}, {\n renamedParameters: {\n alert_id: \"alert_number\"\n }\n }],\n getAnalysis: [\"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\"],\n getCodeqlDatabase: [\"GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}\"],\n getSarif: [\"GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}\"],\n listAlertInstances: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\"],\n listAlertsForEnterprise: [\"GET /enterprises/{enterprise}/code-scanning/alerts\"],\n listAlertsForOrg: [\"GET /orgs/{org}/code-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listAlertsInstances: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\", {}, {\n renamed: [\"codeScanning\", \"listAlertInstances\"]\n }],\n listCodeqlDatabases: [\"GET /repos/{owner}/{repo}/code-scanning/codeql/databases\"],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\"],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"]\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\"GET /codes_of_conduct\"],\n getConductCode: [\"GET /codes_of_conduct/{key}\"]\n },\n codespaces: {\n addRepositoryForSecretForAuthenticatedUser: [\"PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\"],\n addSelectedRepoToOrgSecret: [\"PUT /organizations/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}\"],\n codespaceMachinesForAuthenticatedUser: [\"GET /user/codespaces/{codespace_name}/machines\"],\n createForAuthenticatedUser: [\"POST /user/codespaces\"],\n createOrUpdateOrgSecret: [\"PUT /organizations/{org}/codespaces/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"],\n createOrUpdateSecretForAuthenticatedUser: [\"PUT /user/codespaces/secrets/{secret_name}\"],\n createWithPrForAuthenticatedUser: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces\"],\n createWithRepoForAuthenticatedUser: [\"POST /repos/{owner}/{repo}/codespaces\"],\n deleteForAuthenticatedUser: [\"DELETE /user/codespaces/{codespace_name}\"],\n deleteFromOrganization: [\"DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}\"],\n deleteOrgSecret: [\"DELETE /organizations/{org}/codespaces/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"],\n deleteSecretForAuthenticatedUser: [\"DELETE /user/codespaces/secrets/{secret_name}\"],\n exportForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/exports\"],\n getExportDetailsForAuthenticatedUser: [\"GET /user/codespaces/{codespace_name}/exports/{export_id}\"],\n getForAuthenticatedUser: [\"GET /user/codespaces/{codespace_name}\"],\n getOrgPublicKey: [\"GET /organizations/{org}/codespaces/secrets/public-key\"],\n getOrgSecret: [\"GET /organizations/{org}/codespaces/secrets/{secret_name}\"],\n getPublicKeyForAuthenticatedUser: [\"GET /user/codespaces/secrets/public-key\"],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/codespaces/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"],\n getSecretForAuthenticatedUser: [\"GET /user/codespaces/secrets/{secret_name}\"],\n listDevcontainersInRepositoryForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/codespaces/devcontainers\"],\n listForAuthenticatedUser: [\"GET /user/codespaces\"],\n listInOrganization: [\"GET /orgs/{org}/codespaces\", {}, {\n renamedParameters: {\n org_id: \"org\"\n }\n }],\n listInRepositoryForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/codespaces\"],\n listOrgSecrets: [\"GET /organizations/{org}/codespaces/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/codespaces/secrets\"],\n listRepositoriesForSecretForAuthenticatedUser: [\"GET /user/codespaces/secrets/{secret_name}/repositories\"],\n listSecretsForAuthenticatedUser: [\"GET /user/codespaces/secrets\"],\n listSelectedReposForOrgSecret: [\"GET /organizations/{org}/codespaces/secrets/{secret_name}/repositories\"],\n preFlightWithRepoForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/codespaces/new\"],\n removeRepositoryForSecretForAuthenticatedUser: [\"DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /organizations/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}\"],\n repoMachinesForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/codespaces/machines\"],\n setRepositoriesForSecretForAuthenticatedUser: [\"PUT /user/codespaces/secrets/{secret_name}/repositories\"],\n setSelectedReposForOrgSecret: [\"PUT /organizations/{org}/codespaces/secrets/{secret_name}/repositories\"],\n startForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/start\"],\n stopForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/stop\"],\n stopInOrganization: [\"POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop\"],\n updateForAuthenticatedUser: [\"PATCH /user/codespaces/{codespace_name}\"]\n },\n dependabot: {\n addSelectedRepoToOrgSecret: [\"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\"],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/dependabot/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"],\n deleteOrgSecret: [\"DELETE /orgs/{org}/dependabot/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"],\n getAlert: [\"GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/dependabot/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/dependabot/secrets/{secret_name}\"],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/dependabot/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/dependabot/alerts\"],\n listOrgSecrets: [\"GET /orgs/{org}/dependabot/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/dependabot/secrets\"],\n listSelectedReposForOrgSecret: [\"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\"],\n setSelectedReposForOrgSecret: [\"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}\"]\n },\n dependencyGraph: {\n createRepositorySnapshot: [\"POST /repos/{owner}/{repo}/dependency-graph/snapshots\"],\n diffRange: [\"GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}\"]\n },\n emojis: {\n get: [\"GET /emojis\"]\n },\n enterpriseAdmin: {\n addCustomLabelsToSelfHostedRunnerForEnterprise: [\"POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n disableSelectedOrganizationGithubActionsEnterprise: [\"DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n enableSelectedOrganizationGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n getAllowedActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n getGithubActionsPermissionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions\"],\n getServerStatistics: [\"GET /enterprise-installation/{enterprise_or_org}/server-statistics\"],\n listLabelsForSelfHostedRunnerForEnterprise: [\"GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n listSelectedOrganizationsEnabledGithubActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/organizations\"],\n removeAllCustomLabelsFromSelfHostedRunnerForEnterprise: [\"DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n removeCustomLabelFromSelfHostedRunnerForEnterprise: [\"DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name}\"],\n setAllowedActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n setCustomLabelsForSelfHostedRunnerForEnterprise: [\"PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n setGithubActionsPermissionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions\"],\n setSelectedOrganizationsEnabledGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations\"]\n },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"]\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"]\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"]\n },\n interactions: {\n getRestrictionsForAuthenticatedUser: [\"GET /user/interaction-limits\"],\n getRestrictionsForOrg: [\"GET /orgs/{org}/interaction-limits\"],\n getRestrictionsForRepo: [\"GET /repos/{owner}/{repo}/interaction-limits\"],\n getRestrictionsForYourPublicRepos: [\"GET /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"getRestrictionsForAuthenticatedUser\"]\n }],\n removeRestrictionsForAuthenticatedUser: [\"DELETE /user/interaction-limits\"],\n removeRestrictionsForOrg: [\"DELETE /orgs/{org}/interaction-limits\"],\n removeRestrictionsForRepo: [\"DELETE /repos/{owner}/{repo}/interaction-limits\"],\n removeRestrictionsForYourPublicRepos: [\"DELETE /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"removeRestrictionsForAuthenticatedUser\"]\n }],\n setRestrictionsForAuthenticatedUser: [\"PUT /user/interaction-limits\"],\n setRestrictionsForOrg: [\"PUT /orgs/{org}/interaction-limits\"],\n setRestrictionsForRepo: [\"PUT /repos/{owner}/{repo}/interaction-limits\"],\n setRestrictionsForYourPublicRepos: [\"PUT /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"setRestrictionsForAuthenticatedUser\"]\n }]\n },\n issues: {\n addAssignees: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\"],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\"],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n removeAssignees: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n removeLabel: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\"],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\"]\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"]\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\"POST /markdown/raw\", {\n headers: {\n \"content-type\": \"text/plain; charset=utf-8\"\n }\n }]\n },\n meta: {\n get: [\"GET /meta\"],\n getOctocat: [\"GET /octocat\"],\n getZen: [\"GET /zen\"],\n root: [\"GET /\"]\n },\n migrations: {\n cancelImport: [\"DELETE /repos/{owner}/{repo}/import\"],\n deleteArchiveForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/archive\"],\n deleteArchiveForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/archive\"],\n downloadArchiveForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/archive\"],\n getArchiveForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/archive\"],\n getCommitAuthors: [\"GET /repos/{owner}/{repo}/import/authors\"],\n getImportStatus: [\"GET /repos/{owner}/{repo}/import\"],\n getLargeFiles: [\"GET /repos/{owner}/{repo}/import/large_files\"],\n getStatusForAuthenticatedUser: [\"GET /user/migrations/{migration_id}\"],\n getStatusForOrg: [\"GET /orgs/{org}/migrations/{migration_id}\"],\n listForAuthenticatedUser: [\"GET /user/migrations\"],\n listForOrg: [\"GET /orgs/{org}/migrations\"],\n listReposForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/repositories\"],\n listReposForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/repositories\"],\n listReposForUser: [\"GET /user/migrations/{migration_id}/repositories\", {}, {\n renamed: [\"migrations\", \"listReposForAuthenticatedUser\"]\n }],\n mapCommitAuthor: [\"PATCH /repos/{owner}/{repo}/import/authors/{author_id}\"],\n setLfsPreference: [\"PATCH /repos/{owner}/{repo}/import/lfs\"],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n startImport: [\"PUT /repos/{owner}/{repo}/import\"],\n unlockRepoForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\"],\n unlockRepoForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\"],\n updateImport: [\"PATCH /repos/{owner}/{repo}/import\"]\n },\n orgs: {\n addSecurityManagerTeam: [\"PUT /orgs/{org}/security-managers/teams/{team_slug}\"],\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n cancelInvitation: [\"DELETE /orgs/{org}/invitations/{invitation_id}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\"PUT /orgs/{org}/outside_collaborators/{username}\"],\n createCustomRole: [\"POST /orgs/{org}/custom_roles\"],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n deleteCustomRole: [\"DELETE /orgs/{org}/custom_roles/{role_id}\"],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n enableOrDisableSecurityProductOnAllOrgRepos: [\"POST /orgs/{org}/{security_product}/{enablement}\"],\n get: [\"GET /orgs/{org}\"],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n getWebhookConfigForOrg: [\"GET /orgs/{org}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}\"],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listCustomRoles: [\"GET /organizations/{organization_id}/custom_roles\"],\n listFailedInvitations: [\"GET /orgs/{org}/failed_invitations\"],\n listFineGrainedPermissions: [\"GET /orgs/{org}/fine_grained_permissions\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listSecurityManagerTeams: [\"GET /orgs/{org}/security-managers\"],\n listWebhookDeliveries: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\"DELETE /orgs/{org}/outside_collaborators/{username}\"],\n removePublicMembershipForAuthenticatedUser: [\"DELETE /orgs/{org}/public_members/{username}\"],\n removeSecurityManagerTeam: [\"DELETE /orgs/{org}/security-managers/teams/{team_slug}\"],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\"PUT /orgs/{org}/public_members/{username}\"],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateCustomRole: [\"PATCH /orgs/{org}/custom_roles/{role_id}\"],\n updateMembershipForAuthenticatedUser: [\"PATCH /user/memberships/orgs/{org}\"],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n updateWebhookConfigForOrg: [\"PATCH /orgs/{org}/hooks/{hook_id}/config\"]\n },\n packages: {\n deletePackageForAuthenticatedUser: [\"DELETE /user/packages/{package_type}/{package_name}\"],\n deletePackageForOrg: [\"DELETE /orgs/{org}/packages/{package_type}/{package_name}\"],\n deletePackageForUser: [\"DELETE /users/{username}/packages/{package_type}/{package_name}\"],\n deletePackageVersionForAuthenticatedUser: [\"DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n deletePackageVersionForOrg: [\"DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n deletePackageVersionForUser: [\"DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getAllPackageVersionsForAPackageOwnedByAnOrg: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\", {}, {\n renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByOrg\"]\n }],\n getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions\", {}, {\n renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByAuthenticatedUser\"]\n }],\n getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions\"],\n getAllPackageVersionsForPackageOwnedByOrg: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\"],\n getAllPackageVersionsForPackageOwnedByUser: [\"GET /users/{username}/packages/{package_type}/{package_name}/versions\"],\n getPackageForAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}\"],\n getPackageForOrganization: [\"GET /orgs/{org}/packages/{package_type}/{package_name}\"],\n getPackageForUser: [\"GET /users/{username}/packages/{package_type}/{package_name}\"],\n getPackageVersionForAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getPackageVersionForOrganization: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getPackageVersionForUser: [\"GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n listPackagesForAuthenticatedUser: [\"GET /user/packages\"],\n listPackagesForOrganization: [\"GET /orgs/{org}/packages\"],\n listPackagesForUser: [\"GET /users/{username}/packages\"],\n restorePackageForAuthenticatedUser: [\"POST /user/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageForOrg: [\"POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageForUser: [\"POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageVersionForAuthenticatedUser: [\"POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"],\n restorePackageVersionForOrg: [\"POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"],\n restorePackageVersionForUser: [\"POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"]\n },\n projects: {\n addCollaborator: [\"PUT /projects/{project_id}/collaborators/{username}\"],\n createCard: [\"POST /projects/columns/{column_id}/cards\"],\n createColumn: [\"POST /projects/{project_id}/columns\"],\n createForAuthenticatedUser: [\"POST /user/projects\"],\n createForOrg: [\"POST /orgs/{org}/projects\"],\n createForRepo: [\"POST /repos/{owner}/{repo}/projects\"],\n delete: [\"DELETE /projects/{project_id}\"],\n deleteCard: [\"DELETE /projects/columns/cards/{card_id}\"],\n deleteColumn: [\"DELETE /projects/columns/{column_id}\"],\n get: [\"GET /projects/{project_id}\"],\n getCard: [\"GET /projects/columns/cards/{card_id}\"],\n getColumn: [\"GET /projects/columns/{column_id}\"],\n getPermissionForUser: [\"GET /projects/{project_id}/collaborators/{username}/permission\"],\n listCards: [\"GET /projects/columns/{column_id}/cards\"],\n listCollaborators: [\"GET /projects/{project_id}/collaborators\"],\n listColumns: [\"GET /projects/{project_id}/columns\"],\n listForOrg: [\"GET /orgs/{org}/projects\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/projects\"],\n listForUser: [\"GET /users/{username}/projects\"],\n moveCard: [\"POST /projects/columns/cards/{card_id}/moves\"],\n moveColumn: [\"POST /projects/columns/{column_id}/moves\"],\n removeCollaborator: [\"DELETE /projects/{project_id}/collaborators/{username}\"],\n update: [\"PATCH /projects/{project_id}\"],\n updateCard: [\"PATCH /projects/columns/cards/{card_id}\"],\n updateColumn: [\"PATCH /projects/columns/{column_id}\"]\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\"],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n deletePendingReview: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n deleteReviewComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n dismissReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\"],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\"],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n listReviewComments: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n requestReviewers: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n submitReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\"],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\"],\n updateReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n updateReviewComment: [\"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\"]\n },\n rateLimit: {\n get: [\"GET /rate_limit\"]\n },\n reactions: {\n createForCommitComment: [\"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\"],\n createForIssue: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n createForIssueComment: [\"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"],\n createForPullRequestReviewComment: [\"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"],\n createForRelease: [\"POST /repos/{owner}/{repo}/releases/{release_id}/reactions\"],\n createForTeamDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"],\n createForTeamDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"],\n deleteForCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForIssue: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\"],\n deleteForIssueComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForPullRequestComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}\"],\n deleteForTeamDiscussion: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\"],\n deleteForTeamDiscussionComment: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\"],\n listForCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\"],\n listForIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n listForIssueComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"],\n listForPullRequestReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"],\n listForRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}/reactions\"],\n listForTeamDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"],\n listForTeamDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"]\n },\n repos: {\n acceptInvitation: [\"PATCH /user/repository_invitations/{invitation_id}\", {}, {\n renamed: [\"repos\", \"acceptInvitationForAuthenticatedUser\"]\n }],\n acceptInvitationForAuthenticatedUser: [\"PATCH /user/repository_invitations/{invitation_id}\"],\n addAppAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n addTeamAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n addUserAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkVulnerabilityAlerts: [\"GET /repos/{owner}/{repo}/vulnerability-alerts\"],\n codeownersErrors: [\"GET /repos/{owner}/{repo}/codeowners/errors\"],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n compareCommitsWithBasehead: [\"GET /repos/{owner}/{repo}/compare/{basehead}\"],\n createAutolink: [\"POST /repos/{owner}/{repo}/autolinks\"],\n createCommitComment: [\"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n createCommitSignatureProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentBranchPolicy: [\"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\"],\n createDeploymentStatus: [\"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateEnvironment: [\"PUT /repos/{owner}/{repo}/environments/{environment_name}\"],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createPagesDeployment: [\"POST /repos/{owner}/{repo}/pages/deployment\"],\n createPagesSite: [\"POST /repos/{owner}/{repo}/pages\"],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createTagProtection: [\"POST /repos/{owner}/{repo}/tags/protection\"],\n createUsingTemplate: [\"POST /repos/{template_owner}/{template_repo}/generate\"],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n declineInvitation: [\"DELETE /user/repository_invitations/{invitation_id}\", {}, {\n renamed: [\"repos\", \"declineInvitationForAuthenticatedUser\"]\n }],\n declineInvitationForAuthenticatedUser: [\"DELETE /user/repository_invitations/{invitation_id}\"],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n deleteAdminBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n deleteAnEnvironment: [\"DELETE /repos/{owner}/{repo}/environments/{environment_name}\"],\n deleteAutolink: [\"DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n deleteBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\"],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n deleteDeploymentBranchPolicy: [\"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\"],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n deletePagesSite: [\"DELETE /repos/{owner}/{repo}/pages\"],\n deletePullRequestReviewProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n deleteTagProtection: [\"DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}\"],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\"DELETE /repos/{owner}/{repo}/automated-security-fixes\"],\n disableLfsForRepo: [\"DELETE /repos/{owner}/{repo}/lfs\"],\n disableVulnerabilityAlerts: [\"DELETE /repos/{owner}/{repo}/vulnerability-alerts\"],\n downloadArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\", {}, {\n renamed: [\"repos\", \"downloadZipballArchive\"]\n }],\n downloadTarballArchive: [\"GET /repos/{owner}/{repo}/tarball/{ref}\"],\n downloadZipballArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\"],\n enableAutomatedSecurityFixes: [\"PUT /repos/{owner}/{repo}/automated-security-fixes\"],\n enableLfsForRepo: [\"PUT /repos/{owner}/{repo}/lfs\"],\n enableVulnerabilityAlerts: [\"PUT /repos/{owner}/{repo}/vulnerability-alerts\"],\n generateReleaseNotes: [\"POST /repos/{owner}/{repo}/releases/generate-notes\"],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n getAdminBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n getAllEnvironments: [\"GET /repos/{owner}/{repo}/environments\"],\n getAllStatusCheckContexts: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\"],\n getAllTopics: [\"GET /repos/{owner}/{repo}/topics\"],\n getAppsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\"],\n getAutolink: [\"GET /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection\"],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\"GET /repos/{owner}/{repo}/collaborators/{username}/permission\"],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n getCommunityProfileMetrics: [\"GET /repos/{owner}/{repo}/community/profile\"],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentBranchPolicy: [\"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\"],\n getDeploymentStatus: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\"],\n getEnvironment: [\"GET /repos/{owner}/{repo}/environments/{environment_name}\"],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getPagesHealthCheck: [\"GET /repos/{owner}/{repo}/pages/health\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getReadmeInDirectory: [\"GET /repos/{owner}/{repo}/readme/{dir}\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getStatusChecksProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n getTeamsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\"],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\"],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n getWebhookConfigForRepo: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}\"],\n listAutolinks: [\"GET /repos/{owner}/{repo}/autolinks\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\"],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/statuses\"],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentBranchPolicies: [\"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\"],\n listDeploymentStatuses: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\"],\n listReleaseAssets: [\"GET /repos/{owner}/{repo}/releases/{release_id}/assets\"],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTagProtection: [\"GET /repos/{owner}/{repo}/tags/protection\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhookDeliveries: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n mergeUpstream: [\"POST /repos/{owner}/{repo}/merge-upstream\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"],\n removeAppAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n removeCollaborator: [\"DELETE /repos/{owner}/{repo}/collaborators/{username}\"],\n removeStatusCheckContexts: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n removeStatusCheckProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n removeTeamAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n removeUserAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n renameBranch: [\"POST /repos/{owner}/{repo}/branches/{branch}/rename\"],\n replaceAllTopics: [\"PUT /repos/{owner}/{repo}/topics\"],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n setAppAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n setStatusCheckContexts: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n setTeamAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n setUserAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection\"],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateDeploymentBranchPolicy: [\"PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\"],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n updatePullRequestReviewProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n updateStatusCheckPotection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\", {}, {\n renamed: [\"repos\", \"updateStatusCheckProtection\"]\n }],\n updateStatusCheckProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n updateWebhookConfigForRepo: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n uploadReleaseAsset: [\"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\", {\n baseUrl: \"https://uploads.github.com\"\n }]\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\"],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\"],\n users: [\"GET /search/users\"]\n },\n secretScanning: {\n getAlert: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"],\n listAlertsForEnterprise: [\"GET /enterprises/{enterprise}/secret-scanning/alerts\"],\n listAlertsForOrg: [\"GET /orgs/{org}/secret-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts\"],\n listLocationsForAlert: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"]\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n addOrUpdateProjectPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n addOrUpdateRepoPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n checkPermissionsForProjectInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n checkPermissionsForRepoInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n deleteDiscussionInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n getDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n getMembershipForUserInOrg: [\"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/invitations\"],\n listProjectsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects\"],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n removeProjectInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n removeRepoInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n updateDiscussionCommentInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n updateDiscussionInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"]\n },\n users: {\n addEmailForAuthenticated: [\"POST /user/emails\", {}, {\n renamed: [\"users\", \"addEmailForAuthenticatedUser\"]\n }],\n addEmailForAuthenticatedUser: [\"POST /user/emails\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\"POST /user/gpg_keys\", {}, {\n renamed: [\"users\", \"createGpgKeyForAuthenticatedUser\"]\n }],\n createGpgKeyForAuthenticatedUser: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\"POST /user/keys\", {}, {\n renamed: [\"users\", \"createPublicSshKeyForAuthenticatedUser\"]\n }],\n createPublicSshKeyForAuthenticatedUser: [\"POST /user/keys\"],\n createSshSigningKeyForAuthenticatedUser: [\"POST /user/ssh_signing_keys\"],\n deleteEmailForAuthenticated: [\"DELETE /user/emails\", {}, {\n renamed: [\"users\", \"deleteEmailForAuthenticatedUser\"]\n }],\n deleteEmailForAuthenticatedUser: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\"DELETE /user/gpg_keys/{gpg_key_id}\", {}, {\n renamed: [\"users\", \"deleteGpgKeyForAuthenticatedUser\"]\n }],\n deleteGpgKeyForAuthenticatedUser: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\"DELETE /user/keys/{key_id}\", {}, {\n renamed: [\"users\", \"deletePublicSshKeyForAuthenticatedUser\"]\n }],\n deletePublicSshKeyForAuthenticatedUser: [\"DELETE /user/keys/{key_id}\"],\n deleteSshSigningKeyForAuthenticatedUser: [\"DELETE /user/ssh_signing_keys/{ssh_signing_key_id}\"],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\"GET /user/gpg_keys/{gpg_key_id}\", {}, {\n renamed: [\"users\", \"getGpgKeyForAuthenticatedUser\"]\n }],\n getGpgKeyForAuthenticatedUser: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\"GET /user/keys/{key_id}\", {}, {\n renamed: [\"users\", \"getPublicSshKeyForAuthenticatedUser\"]\n }],\n getPublicSshKeyForAuthenticatedUser: [\"GET /user/keys/{key_id}\"],\n getSshSigningKeyForAuthenticatedUser: [\"GET /user/ssh_signing_keys/{ssh_signing_key_id}\"],\n list: [\"GET /users\"],\n listBlockedByAuthenticated: [\"GET /user/blocks\", {}, {\n renamed: [\"users\", \"listBlockedByAuthenticatedUser\"]\n }],\n listBlockedByAuthenticatedUser: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\"GET /user/emails\", {}, {\n renamed: [\"users\", \"listEmailsForAuthenticatedUser\"]\n }],\n listEmailsForAuthenticatedUser: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\"GET /user/following\", {}, {\n renamed: [\"users\", \"listFollowedByAuthenticatedUser\"]\n }],\n listFollowedByAuthenticatedUser: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\"GET /user/gpg_keys\", {}, {\n renamed: [\"users\", \"listGpgKeysForAuthenticatedUser\"]\n }],\n listGpgKeysForAuthenticatedUser: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\"GET /user/public_emails\", {}, {\n renamed: [\"users\", \"listPublicEmailsForAuthenticatedUser\"]\n }],\n listPublicEmailsForAuthenticatedUser: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\"GET /user/keys\", {}, {\n renamed: [\"users\", \"listPublicSshKeysForAuthenticatedUser\"]\n }],\n listPublicSshKeysForAuthenticatedUser: [\"GET /user/keys\"],\n listSshSigningKeysForAuthenticatedUser: [\"GET /user/ssh_signing_keys\"],\n listSshSigningKeysForUser: [\"GET /users/{username}/ssh_signing_keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\"PATCH /user/email/visibility\", {}, {\n renamed: [\"users\", \"setPrimaryEmailVisibilityForAuthenticatedUser\"]\n }],\n setPrimaryEmailVisibilityForAuthenticatedUser: [\"PATCH /user/email/visibility\"],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"]\n }\n};\n\nconst VERSION = \"6.7.0\";\n\nfunction endpointsToMethods(octokit, endpointsMap) {\n const newMethods = {};\n for (const [scope, endpoints] of Object.entries(endpointsMap)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign({\n method,\n url\n }, defaults);\n if (!newMethods[scope]) {\n newMethods[scope] = {};\n }\n const scopeMethods = newMethods[scope];\n if (decorations) {\n scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations);\n continue;\n }\n scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);\n }\n }\n return newMethods;\n}\nfunction decorate(octokit, scope, methodName, defaults, decorations) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n /* istanbul ignore next */\n function withDecorations(...args) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n let options = requestWithDefaults.endpoint.merge(...args);\n // There are currently no other decorations than `.mapToData`\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: undefined\n });\n return requestWithDefaults(options);\n }\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`);\n }\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n if (decorations.renamedParameters) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n const options = requestWithDefaults.endpoint.merge(...args);\n for (const [name, alias] of Object.entries(decorations.renamedParameters)) {\n if (name in options) {\n octokit.log.warn(`\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`);\n if (!(alias in options)) {\n options[alias] = options[name];\n }\n delete options[name];\n }\n }\n return requestWithDefaults(options);\n }\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n return requestWithDefaults(...args);\n }\n return Object.assign(withDecorations, requestWithDefaults);\n}\n\nfunction restEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, Endpoints);\n return {\n rest: api\n };\n}\nrestEndpointMethods.VERSION = VERSION;\nfunction legacyRestEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, Endpoints);\n return {\n ...api,\n rest: api\n };\n}\nlegacyRestEndpointMethods.VERSION = VERSION;\n\nexports.legacyRestEndpointMethods = legacyRestEndpointMethods;\nexports.restEndpointMethods = restEndpointMethods;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar deprecation = require('deprecation');\nvar once = _interopDefault(require('once'));\n\nconst logOnceCode = once(deprecation => console.warn(deprecation));\nconst logOnceHeaders = once(deprecation => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\n\nclass RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"HttpError\";\n this.status = statusCode;\n let headers;\n\n if (\"headers\" in options && typeof options.headers !== \"undefined\") {\n headers = options.headers;\n }\n\n if (\"response\" in options) {\n this.response = options.response;\n headers = options.response.headers;\n } // redact request credentials without mutating original request options\n\n\n const requestCopy = Object.assign({}, options.request);\n\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\")\n });\n }\n\n requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\") // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy; // deprecations\n\n Object.defineProperty(this, \"code\", {\n get() {\n logOnceCode(new deprecation.Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n }\n\n });\n Object.defineProperty(this, \"headers\", {\n get() {\n logOnceHeaders(new deprecation.Deprecation(\"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.\"));\n return headers || {};\n }\n\n });\n }\n\n}\n\nexports.RequestError = RequestError;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar endpoint = require('@octokit/endpoint');\nvar universalUserAgent = require('universal-user-agent');\nvar isPlainObject = require('is-plain-object');\nvar nodeFetch = _interopDefault(require('node-fetch'));\nvar requestError = require('@octokit/request-error');\n\nconst VERSION = \"6.2.2\";\n\nfunction getBufferResponse(response) {\n return response.arrayBuffer();\n}\n\nfunction fetchWrapper(requestOptions) {\n const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;\n\n if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n\n let headers = {};\n let status;\n let url;\n const fetch = requestOptions.request && requestOptions.request.fetch || globalThis.fetch ||\n /* istanbul ignore next */\n nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect\n }, // `requestOptions.request.agent` type is incompatible\n // see https://github.com/octokit/types.ts/pull/264\n requestOptions.request)).then(async response => {\n url = response.url;\n status = response.status;\n\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n\n if (\"deprecation\" in headers) {\n const matches = headers.link && headers.link.match(/<([^>]+)>; rel=\"deprecation\"/);\n const deprecationLink = matches && matches.pop();\n log.warn(`[@octokit/request] \"${requestOptions.method} ${requestOptions.url}\" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : \"\"}`);\n }\n\n if (status === 204 || status === 205) {\n return;\n } // GitHub API returns 200 for HEAD requests\n\n\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n\n throw new requestError.RequestError(response.statusText, status, {\n response: {\n url,\n status,\n headers,\n data: undefined\n },\n request: requestOptions\n });\n }\n\n if (status === 304) {\n throw new requestError.RequestError(\"Not modified\", status, {\n response: {\n url,\n status,\n headers,\n data: await getResponseData(response)\n },\n request: requestOptions\n });\n }\n\n if (status >= 400) {\n const data = await getResponseData(response);\n const error = new requestError.RequestError(toErrorMessage(data), status, {\n response: {\n url,\n status,\n headers,\n data\n },\n request: requestOptions\n });\n throw error;\n }\n\n return getResponseData(response);\n }).then(data => {\n return {\n status,\n url,\n headers,\n data\n };\n }).catch(error => {\n if (error instanceof requestError.RequestError) throw error;else if (error.name === \"AbortError\") throw error;\n throw new requestError.RequestError(error.message, 500, {\n request: requestOptions\n });\n });\n}\n\nasync function getResponseData(response) {\n const contentType = response.headers.get(\"content-type\");\n\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n\n return getBufferResponse(response);\n}\n\nfunction toErrorMessage(data) {\n if (typeof data === \"string\") return data; // istanbul ignore else - just in case\n\n if (\"message\" in data) {\n if (Array.isArray(data.errors)) {\n return `${data.message}: ${data.errors.map(JSON.stringify).join(\", \")}`;\n }\n\n return data.message;\n } // istanbul ignore next - just in case\n\n\n return `Unknown error: ${JSON.stringify(data)}`;\n}\n\nfunction withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n}\n\nconst request = withDefaults(endpoint.endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n }\n});\n\nexports.request = request;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar authToken = require('@octokit/auth-token');\n\nconst createActionAuth = function createActionAuth() {\n if (!process.env.GITHUB_ACTION) {\n throw new Error(\"[@octokit/auth-action] `GITHUB_ACTION` environment variable is not set. @octokit/auth-action is meant to be used in GitHub Actions only.\");\n }\n\n const definitions = [process.env.GITHUB_TOKEN, process.env.INPUT_GITHUB_TOKEN, process.env.INPUT_TOKEN].filter(Boolean);\n\n if (definitions.length === 0) {\n throw new Error(\"[@octokit/auth-action] `GITHUB_TOKEN` variable is not set. It must be set on either `env:` or `with:`. See https://github.com/octokit/auth-action.js#createactionauth\");\n }\n\n if (definitions.length > 1) {\n throw new Error(\"[@octokit/auth-action] The token variable is specified more than once. Use either `with.token`, `with.GITHUB_TOKEN`, or `env.GITHUB_TOKEN`. See https://github.com/octokit/auth-action.js#createactionauth\");\n }\n\n const token = definitions.pop();\n return authToken.createTokenAuth(token);\n};\n\nexports.createActionAuth = createActionAuth;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst REGEX_IS_INSTALLATION_LEGACY = /^v1\\./;\nconst REGEX_IS_INSTALLATION = /^ghs_/;\nconst REGEX_IS_USER_TO_SERVER = /^ghu_/;\nasync function auth(token) {\n const isApp = token.split(/\\./).length === 3;\n const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);\n const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);\n const tokenType = isApp ? \"app\" : isInstallation ? \"installation\" : isUserToServer ? \"user-to-server\" : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n\n/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nfunction withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}\n\nasync function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n\nconst createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n\nexports.createTokenAuth = createTokenAuth;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst REGEX_IS_INSTALLATION_LEGACY = /^v1\\./;\nconst REGEX_IS_INSTALLATION = /^ghs_/;\nconst REGEX_IS_USER_TO_SERVER = /^ghu_/;\nasync function auth(token) {\n const isApp = token.split(/\\./).length === 3;\n const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);\n const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);\n const tokenType = isApp ? \"app\" : isInstallation ? \"installation\" : isUserToServer ? \"user-to-server\" : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n\n/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nfunction withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}\n\nasync function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n\nconst createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n\nexports.createTokenAuth = createTokenAuth;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar universalUserAgent = require('universal-user-agent');\nvar beforeAfterHook = require('before-after-hook');\nvar request = require('@octokit/request');\nvar graphql = require('@octokit/graphql');\nvar authToken = require('@octokit/auth-token');\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nconst VERSION = \"3.6.0\";\n\nconst _excluded = [\"authStrategy\"];\nclass Octokit {\n constructor(options = {}) {\n const hook = new beforeAfterHook.Collection();\n const requestDefaults = {\n baseUrl: request.request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n // @ts-ignore internal usage only, no need to type\n hook: hook.bind(null, \"request\")\n }),\n mediaType: {\n previews: [],\n format: \"\"\n }\n }; // prepend default user agent with `options.userAgent` if set\n\n requestDefaults.headers[\"user-agent\"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(\" \");\n\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n\n this.request = request.request.defaults(requestDefaults);\n this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults);\n this.log = Object.assign({\n debug: () => {},\n info: () => {},\n warn: console.warn.bind(console),\n error: console.error.bind(console)\n }, options.log);\n this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance\n // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.\n // (2) If only `options.auth` is set, use the default token authentication strategy.\n // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.\n // TODO: type `options.auth` based on `options.authStrategy`.\n\n if (!options.authStrategy) {\n if (!options.auth) {\n // (1)\n this.auth = async () => ({\n type: \"unauthenticated\"\n });\n } else {\n // (2)\n const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n } else {\n const {\n authStrategy\n } = options,\n otherOptions = _objectWithoutProperties(options, _excluded);\n\n const auth = authStrategy(Object.assign({\n request: this.request,\n log: this.log,\n // we pass the current octokit instance as well as its constructor options\n // to allow for authentication strategies that return a new octokit instance\n // that shares the same internal state as the current one. The original\n // requirement for this was the \"event-octokit\" authentication strategy\n // of https://github.com/probot/octokit-auth-probot.\n octokit: this,\n octokitOptions: otherOptions\n }, options.auth)); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n } // apply plugins\n // https://stackoverflow.com/a/16345172\n\n\n const classConstructor = this.constructor;\n classConstructor.plugins.forEach(plugin => {\n Object.assign(this, plugin(this, options));\n });\n }\n\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n\n super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`\n } : null));\n }\n\n };\n return OctokitWithDefaults;\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n\n\n static plugin(...newPlugins) {\n var _a;\n\n const currentPlugins = this.plugins;\n const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a);\n return NewOctokit;\n }\n\n}\nOctokit.VERSION = VERSION;\nOctokit.plugins = [];\n\nexports.Octokit = Octokit;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar isPlainObject = require('is-plain-object');\nvar universalUserAgent = require('universal-user-agent');\n\nfunction lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n\nfunction mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach(key => {\n if (isPlainObject.isPlainObject(options[key])) {\n if (!(key in defaults)) Object.assign(result, {\n [key]: options[key]\n });else result[key] = mergeDeep(defaults[key], options[key]);\n } else {\n Object.assign(result, {\n [key]: options[key]\n });\n }\n });\n return result;\n}\n\nfunction removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n\n return obj;\n}\n\nfunction merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? {\n method,\n url\n } : {\n url: method\n }, options);\n } else {\n options = Object.assign({}, route);\n } // lowercase header names before merging with defaults to avoid duplicates\n\n\n options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging\n\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten\n\n if (defaults && defaults.mediaType.previews.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);\n }\n\n mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, \"\"));\n return mergedOptions;\n}\n\nfunction addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n\n if (names.length === 0) {\n return url;\n }\n\n return url + separator + names.map(name => {\n if (name === \"q\") {\n return \"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\");\n }\n\n return `${name}=${encodeURIComponent(parameters[name])}`;\n }).join(\"&\");\n}\n\nconst urlVariableRegex = /\\{[^}]+\\}/g;\n\nfunction removeNonChars(variableName) {\n return variableName.replace(/^\\W+|\\W+$/g, \"\").split(/,/);\n}\n\nfunction extractUrlVariableNames(url) {\n const matches = url.match(urlVariableRegex);\n\n if (!matches) {\n return [];\n }\n\n return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);\n}\n\nfunction omit(object, keysToOmit) {\n return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {\n obj[key] = object[key];\n return obj;\n }, {});\n}\n\n// Based on https://github.com/bramstein/url-template, licensed under BSD\n// TODO: create separate package.\n//\n// Copyright (c) 2012-2014, Bram Stein\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// 3. The name of the author may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/* istanbul ignore file */\nfunction encodeReserved(str) {\n return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n\n return part;\n }).join(\"\");\n}\n\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\n\nfunction encodeValue(operator, value, key) {\n value = operator === \"+\" || operator === \"#\" ? encodeReserved(value) : encodeUnreserved(value);\n\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n } else {\n return value;\n }\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\n\nfunction getValues(context, operator, key, modifier) {\n var value = context[key],\n result = [];\n\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n value = value.toString();\n\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n } else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n } else {\n const tmp = [];\n\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n tmp.push(encodeValue(operator, value));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n } else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n } else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n } else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n } else if (value === \"\") {\n result.push(\"\");\n }\n }\n\n return result;\n}\n\nfunction parseUrl(template) {\n return {\n expand: expand.bind(null, template)\n };\n}\n\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n\n if (operator && operator !== \"+\") {\n var separator = \",\";\n\n if (operator === \"?\") {\n separator = \"&\";\n } else if (operator !== \"#\") {\n separator = operator;\n }\n\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n } else {\n return values.join(\",\");\n }\n } else {\n return encodeReserved(literal);\n }\n });\n}\n\nfunction parse(options) {\n // https://fetch.spec.whatwg.org/#methods\n let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible\n\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"mediaType\"]); // extract variable names from URL to calculate remaining variables later\n\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n\n const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw\n headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(\",\");\n }\n\n if (options.mediaType.previews.length) {\n const previewsFromAcceptHeader = headers.accept.match(/[\\w-]+(?=-preview)/g) || [];\n headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {\n const format = options.mediaType.format ? `.${options.mediaType.format}` : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n }).join(\",\");\n }\n } // for GET/HEAD requests, set URL query parameters from remaining parameters\n // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters\n\n\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n } else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n } else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n } else {\n headers[\"content-length\"] = 0;\n }\n }\n } // default content-type for JSON if body is set\n\n\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.\n // fetch does not allow to set `content-length` header, but we can set body to an empty string\n\n\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n } // Only return body/request keys if present\n\n\n return Object.assign({\n method,\n url,\n headers\n }, typeof body !== \"undefined\" ? {\n body\n } : null, options.request ? {\n request: options.request\n } : null);\n}\n\nfunction endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n\nfunction withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse\n });\n}\n\nconst VERSION = \"6.0.12\";\n\nconst userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.\n// So we use RequestParameters and add method as additional required property.\n\nconst DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent\n },\n mediaType: {\n format: \"\",\n previews: []\n }\n};\n\nconst endpoint = withDefaults(null, DEFAULTS);\n\nexports.endpoint = endpoint;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar request = require('@octokit/request');\nvar universalUserAgent = require('universal-user-agent');\n\nconst VERSION = \"4.8.0\";\n\nfunction _buildMessageForResponseErrors(data) {\n return `Request failed due to following response errors:\\n` + data.errors.map(e => ` - ${e.message}`).join(\"\\n\");\n}\n\nclass GraphqlResponseError extends Error {\n constructor(request, headers, response) {\n super(_buildMessageForResponseErrors(response));\n this.request = request;\n this.headers = headers;\n this.response = response;\n this.name = \"GraphqlResponseError\"; // Expose the errors and response data in their shorthand properties.\n\n this.errors = response.errors;\n this.data = response.data; // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n\n}\n\nconst NON_VARIABLE_OPTIONS = [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"query\", \"mediaType\"];\nconst FORBIDDEN_VARIABLE_OPTIONS = [\"query\", \"method\", \"url\"];\nconst GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nfunction graphql(request, query, options) {\n if (options) {\n if (typeof query === \"string\" && \"query\" in options) {\n return Promise.reject(new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`));\n }\n\n for (const key in options) {\n if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;\n return Promise.reject(new Error(`[@octokit/graphql] \"${key}\" cannot be used as variable name`));\n }\n }\n\n const parsedOptions = typeof query === \"string\" ? Object.assign({\n query\n }, options) : query;\n const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n\n if (!result.variables) {\n result.variables = {};\n }\n\n result.variables[key] = parsedOptions[key];\n return result;\n }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix\n // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451\n\n const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;\n\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n\n return request(requestOptions).then(response => {\n if (response.data.errors) {\n const headers = {};\n\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n\n throw new GraphqlResponseError(requestOptions, headers, response.data);\n }\n\n return response.data.data;\n });\n}\n\nfunction withDefaults(request$1, newDefaults) {\n const newRequest = request$1.defaults(newDefaults);\n\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: request.request.endpoint\n });\n}\n\nconst graphql$1 = withDefaults(request.request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n },\n method: \"POST\",\n url: \"/graphql\"\n});\nfunction withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\"\n });\n}\n\nexports.GraphqlResponseError = GraphqlResponseError;\nexports.graphql = graphql$1;\nexports.withCustomRequest = withCustomRequest;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst VERSION = \"2.17.0\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\n/**\n * Some “list” response that can be paginated have a different response structure\n *\n * They have a `total_count` key in the response (search also has `incomplete_results`,\n * /installation/repositories also has `repository_selection`), as well as a key with\n * the list of the items which name varies from endpoint to endpoint.\n *\n * Octokit normalizes these responses so that paginated results are always returned following\n * the same structure. One challenge is that if the list response has only one page, no Link\n * header is provided, so this header alone is not sufficient to check wether a response is\n * paginated or not.\n *\n * We check if a \"total_count\" key is present in the response data, but also make sure that\n * a \"url\" property is not, as the \"Get the combined status for a specific ref\" endpoint would\n * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref\n */\nfunction normalizePaginatedListResponse(response) {\n // endpoints can respond with 204 if repository is empty\n if (!response.data) {\n return _objectSpread2(_objectSpread2({}, response), {}, {\n data: []\n });\n }\n\n const responseNeedsNormalization = \"total_count\" in response.data && !(\"url\" in response.data);\n if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way\n // to retrieve the same information.\n\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n\n response.data.total_count = totalCount;\n return response;\n}\n\nfunction iterator(octokit, route, parameters) {\n const options = typeof route === \"function\" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n async next() {\n if (!url) return {\n done: true\n };\n\n try {\n const response = await requestMethod({\n method,\n url,\n headers\n });\n const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format:\n // '; rel=\"next\", ; rel=\"last\"'\n // sets `url` to undefined if \"next\" URL is not present or `link` header is not set\n\n url = ((normalizedResponse.headers.link || \"\").match(/<([^>]+)>;\\s*rel=\"next\"/) || [])[1];\n return {\n value: normalizedResponse\n };\n } catch (error) {\n if (error.status !== 409) throw error;\n url = \"\";\n return {\n value: {\n status: 200,\n headers: {},\n data: []\n }\n };\n }\n }\n\n })\n };\n}\n\nfunction paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = undefined;\n }\n\n return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);\n}\n\nfunction gather(octokit, results, iterator, mapFn) {\n return iterator.next().then(result => {\n if (result.done) {\n return results;\n }\n\n let earlyExit = false;\n\n function done() {\n earlyExit = true;\n }\n\n results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);\n\n if (earlyExit) {\n return results;\n }\n\n return gather(octokit, results, iterator, mapFn);\n });\n}\n\nconst composePaginateRest = Object.assign(paginate, {\n iterator\n});\n\nconst paginatingEndpoints = [\"GET /app/hook/deliveries\", \"GET /app/installations\", \"GET /applications/grants\", \"GET /authorizations\", \"GET /enterprises/{enterprise}/actions/permissions/organizations\", \"GET /enterprises/{enterprise}/actions/runner-groups\", \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\", \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\", \"GET /enterprises/{enterprise}/actions/runners\", \"GET /enterprises/{enterprise}/actions/runners/downloads\", \"GET /events\", \"GET /gists\", \"GET /gists/public\", \"GET /gists/starred\", \"GET /gists/{gist_id}/comments\", \"GET /gists/{gist_id}/commits\", \"GET /gists/{gist_id}/forks\", \"GET /installation/repositories\", \"GET /issues\", \"GET /marketplace_listing/plans\", \"GET /marketplace_listing/plans/{plan_id}/accounts\", \"GET /marketplace_listing/stubbed/plans\", \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\", \"GET /networks/{owner}/{repo}/events\", \"GET /notifications\", \"GET /organizations\", \"GET /orgs/{org}/actions/permissions/repositories\", \"GET /orgs/{org}/actions/runner-groups\", \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\", \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners\", \"GET /orgs/{org}/actions/runners\", \"GET /orgs/{org}/actions/runners/downloads\", \"GET /orgs/{org}/actions/secrets\", \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\", \"GET /orgs/{org}/blocks\", \"GET /orgs/{org}/credential-authorizations\", \"GET /orgs/{org}/events\", \"GET /orgs/{org}/failed_invitations\", \"GET /orgs/{org}/hooks\", \"GET /orgs/{org}/hooks/{hook_id}/deliveries\", \"GET /orgs/{org}/installations\", \"GET /orgs/{org}/invitations\", \"GET /orgs/{org}/invitations/{invitation_id}/teams\", \"GET /orgs/{org}/issues\", \"GET /orgs/{org}/members\", \"GET /orgs/{org}/migrations\", \"GET /orgs/{org}/migrations/{migration_id}/repositories\", \"GET /orgs/{org}/outside_collaborators\", \"GET /orgs/{org}/packages\", \"GET /orgs/{org}/projects\", \"GET /orgs/{org}/public_members\", \"GET /orgs/{org}/repos\", \"GET /orgs/{org}/secret-scanning/alerts\", \"GET /orgs/{org}/team-sync/groups\", \"GET /orgs/{org}/teams\", \"GET /orgs/{org}/teams/{team_slug}/discussions\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\", \"GET /orgs/{org}/teams/{team_slug}/invitations\", \"GET /orgs/{org}/teams/{team_slug}/members\", \"GET /orgs/{org}/teams/{team_slug}/projects\", \"GET /orgs/{org}/teams/{team_slug}/repos\", \"GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings\", \"GET /orgs/{org}/teams/{team_slug}/teams\", \"GET /projects/columns/{column_id}/cards\", \"GET /projects/{project_id}/collaborators\", \"GET /projects/{project_id}/columns\", \"GET /repos/{owner}/{repo}/actions/artifacts\", \"GET /repos/{owner}/{repo}/actions/runners\", \"GET /repos/{owner}/{repo}/actions/runners/downloads\", \"GET /repos/{owner}/{repo}/actions/runs\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\", \"GET /repos/{owner}/{repo}/actions/secrets\", \"GET /repos/{owner}/{repo}/actions/workflows\", \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\", \"GET /repos/{owner}/{repo}/assignees\", \"GET /repos/{owner}/{repo}/autolinks\", \"GET /repos/{owner}/{repo}/branches\", \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\", \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\", \"GET /repos/{owner}/{repo}/code-scanning/alerts\", \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\", \"GET /repos/{owner}/{repo}/code-scanning/analyses\", \"GET /repos/{owner}/{repo}/collaborators\", \"GET /repos/{owner}/{repo}/comments\", \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/commits\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\", \"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\", \"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\", \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\", \"GET /repos/{owner}/{repo}/contributors\", \"GET /repos/{owner}/{repo}/deployments\", \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\", \"GET /repos/{owner}/{repo}/events\", \"GET /repos/{owner}/{repo}/forks\", \"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\", \"GET /repos/{owner}/{repo}/hooks\", \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\", \"GET /repos/{owner}/{repo}/invitations\", \"GET /repos/{owner}/{repo}/issues\", \"GET /repos/{owner}/{repo}/issues/comments\", \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/issues/events\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/events\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\", \"GET /repos/{owner}/{repo}/keys\", \"GET /repos/{owner}/{repo}/labels\", \"GET /repos/{owner}/{repo}/milestones\", \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\", \"GET /repos/{owner}/{repo}/notifications\", \"GET /repos/{owner}/{repo}/pages/builds\", \"GET /repos/{owner}/{repo}/projects\", \"GET /repos/{owner}/{repo}/pulls\", \"GET /repos/{owner}/{repo}/pulls/comments\", \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\", \"GET /repos/{owner}/{repo}/releases\", \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\", \"GET /repos/{owner}/{repo}/secret-scanning/alerts\", \"GET /repos/{owner}/{repo}/stargazers\", \"GET /repos/{owner}/{repo}/subscribers\", \"GET /repos/{owner}/{repo}/tags\", \"GET /repos/{owner}/{repo}/teams\", \"GET /repositories\", \"GET /repositories/{repository_id}/environments/{environment_name}/secrets\", \"GET /scim/v2/enterprises/{enterprise}/Groups\", \"GET /scim/v2/enterprises/{enterprise}/Users\", \"GET /scim/v2/organizations/{org}/Users\", \"GET /search/code\", \"GET /search/commits\", \"GET /search/issues\", \"GET /search/labels\", \"GET /search/repositories\", \"GET /search/topics\", \"GET /search/users\", \"GET /teams/{team_id}/discussions\", \"GET /teams/{team_id}/discussions/{discussion_number}/comments\", \"GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\", \"GET /teams/{team_id}/discussions/{discussion_number}/reactions\", \"GET /teams/{team_id}/invitations\", \"GET /teams/{team_id}/members\", \"GET /teams/{team_id}/projects\", \"GET /teams/{team_id}/repos\", \"GET /teams/{team_id}/team-sync/group-mappings\", \"GET /teams/{team_id}/teams\", \"GET /user/blocks\", \"GET /user/emails\", \"GET /user/followers\", \"GET /user/following\", \"GET /user/gpg_keys\", \"GET /user/installations\", \"GET /user/installations/{installation_id}/repositories\", \"GET /user/issues\", \"GET /user/keys\", \"GET /user/marketplace_purchases\", \"GET /user/marketplace_purchases/stubbed\", \"GET /user/memberships/orgs\", \"GET /user/migrations\", \"GET /user/migrations/{migration_id}/repositories\", \"GET /user/orgs\", \"GET /user/packages\", \"GET /user/public_emails\", \"GET /user/repos\", \"GET /user/repository_invitations\", \"GET /user/starred\", \"GET /user/subscriptions\", \"GET /user/teams\", \"GET /users\", \"GET /users/{username}/events\", \"GET /users/{username}/events/orgs/{org}\", \"GET /users/{username}/events/public\", \"GET /users/{username}/followers\", \"GET /users/{username}/following\", \"GET /users/{username}/gists\", \"GET /users/{username}/gpg_keys\", \"GET /users/{username}/keys\", \"GET /users/{username}/orgs\", \"GET /users/{username}/packages\", \"GET /users/{username}/projects\", \"GET /users/{username}/received_events\", \"GET /users/{username}/received_events/public\", \"GET /users/{username}/repos\", \"GET /users/{username}/starred\", \"GET /users/{username}/subscriptions\"];\n\nfunction isPaginatingEndpoint(arg) {\n if (typeof arg === \"string\") {\n return paginatingEndpoints.includes(arg);\n } else {\n return false;\n }\n}\n\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\n\nfunction paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit)\n })\n };\n}\npaginateRest.VERSION = VERSION;\n\nexports.composePaginateRest = composePaginateRest;\nexports.isPaginatingEndpoint = isPaginatingEndpoint;\nexports.paginateRest = paginateRest;\nexports.paginatingEndpoints = paginatingEndpoints;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nconst Endpoints = {\n actions: {\n addSelectedRepoToOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n approveWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve\"],\n cancelWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\"],\n createOrUpdateEnvironmentSecret: [\"PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n createRegistrationTokenForOrg: [\"POST /orgs/{org}/actions/runners/registration-token\"],\n createRegistrationTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/registration-token\"],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/remove-token\"],\n createWorkflowDispatch: [\"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\"],\n deleteArtifact: [\"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n deleteEnvironmentSecret: [\"DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n deleteSelfHostedRunnerFromOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}\"],\n deleteSelfHostedRunnerFromRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n disableSelectedRepositoryGithubActionsOrganization: [\"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n disableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\"],\n downloadArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\"],\n downloadJobLogsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\"],\n downloadWorkflowRunAttemptLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs\"],\n downloadWorkflowRunLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n enableSelectedRepositoryGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n enableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\"],\n getAllowedActionsOrganization: [\"GET /orgs/{org}/actions/permissions/selected-actions\"],\n getAllowedActionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getEnvironmentPublicKey: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key\"],\n getEnvironmentSecret: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n getGithubActionsPermissionsOrganization: [\"GET /orgs/{org}/actions/permissions\"],\n getGithubActionsPermissionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions\"],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getPendingDeploymentsForRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"],\n getRepoPermissions: [\"GET /repos/{owner}/{repo}/actions/permissions\", {}, {\n renamed: [\"actions\", \"getGithubActionsPermissionsRepository\"]\n }],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getReviewsForRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals\"],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunAttempt: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}\"],\n getWorkflowRunUsage: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\"],\n getWorkflowUsage: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\"],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listEnvironmentSecrets: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets\"],\n listJobsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\"],\n listJobsForWorkflowRunAttempt: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\"],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/downloads\"],\n listSelectedReposForOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n listSelectedRepositoriesEnabledGithubActionsOrganization: [\"GET /orgs/{org}/actions/permissions/repositories\"],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\"],\n listWorkflowRuns: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\"],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n reviewPendingDeploymentsForRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"],\n setAllowedActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/selected-actions\"],\n setAllowedActionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n setGithubActionsPermissionsOrganization: [\"PUT /orgs/{org}/actions/permissions\"],\n setGithubActionsPermissionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions\"],\n setSelectedReposForOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n setSelectedRepositoriesEnabledGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories\"]\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\"DELETE /notifications/threads/{thread_id}/subscription\"],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\"GET /notifications/threads/{thread_id}/subscription\"],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\"GET /users/{username}/events/orgs/{org}\"],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\"GET /users/{username}/received_events/public\"],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/notifications\"],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\"PUT /notifications/threads/{thread_id}/subscription\"],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"]\n },\n apps: {\n addRepoToInstallation: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\", {}, {\n renamed: [\"apps\", \"addRepoToInstallationForAuthenticatedUser\"]\n }],\n addRepoToInstallationForAuthenticatedUser: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\"],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createContentAttachment: [\"POST /content_references/{content_reference_id}/attachments\", {\n mediaType: {\n previews: [\"corsair\"]\n }\n }],\n createContentAttachmentForRepo: [\"POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments\", {\n mediaType: {\n previews: [\"corsair\"]\n }\n }],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\"POST /app/installations/{installation_id}/access_tokens\"],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\"GET /marketplace_listing/accounts/{account_id}\"],\n getSubscriptionPlanForAccountStubbed: [\"GET /marketplace_listing/stubbed/accounts/{account_id}\"],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n getWebhookConfigForApp: [\"GET /app/hook/config\"],\n getWebhookDelivery: [\"GET /app/hook/deliveries/{delivery_id}\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\"],\n listInstallationReposForAuthenticatedUser: [\"GET /user/installations/{installation_id}/repositories\"],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\"GET /user/marketplace_purchases/stubbed\"],\n listWebhookDeliveries: [\"GET /app/hook/deliveries\"],\n redeliverWebhookDelivery: [\"POST /app/hook/deliveries/{delivery_id}/attempts\"],\n removeRepoFromInstallation: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\", {}, {\n renamed: [\"apps\", \"removeRepoFromInstallationForAuthenticatedUser\"]\n }],\n removeRepoFromInstallationForAuthenticatedUser: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\"],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n scopeToken: [\"POST /applications/{client_id}/token/scoped\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\"DELETE /app/installations/{installation_id}/suspended\"],\n updateWebhookConfigForApp: [\"PATCH /app/hook/config\"]\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\"GET /users/{username}/settings/billing/actions\"],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\"GET /users/{username}/settings/billing/packages\"],\n getSharedStorageBillingOrg: [\"GET /orgs/{org}/settings/billing/shared-storage\"],\n getSharedStorageBillingUser: [\"GET /users/{username}/settings/billing/shared-storage\"]\n },\n checks: {\n create: [\"POST /repos/{owner}/{repo}/check-runs\"],\n createSuite: [\"POST /repos/{owner}/{repo}/check-suites\"],\n get: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n getSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\"],\n listAnnotations: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\"],\n listForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\"],\n listForSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\"],\n listSuitesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\"],\n rerequestRun: [\"POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest\"],\n rerequestSuite: [\"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\"],\n setSuitesPreferences: [\"PATCH /repos/{owner}/{repo}/check-suites/preferences\"],\n update: [\"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\"]\n },\n codeScanning: {\n deleteAnalysis: [\"DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}\"],\n getAlert: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\", {}, {\n renamedParameters: {\n alert_id: \"alert_number\"\n }\n }],\n getAnalysis: [\"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\"],\n getSarif: [\"GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}\"],\n listAlertInstances: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listAlertsInstances: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\", {}, {\n renamed: [\"codeScanning\", \"listAlertInstances\"]\n }],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\"],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"]\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\"GET /codes_of_conduct\"],\n getConductCode: [\"GET /codes_of_conduct/{key}\"]\n },\n emojis: {\n get: [\"GET /emojis\"]\n },\n enterpriseAdmin: {\n disableSelectedOrganizationGithubActionsEnterprise: [\"DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n enableSelectedOrganizationGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n getAllowedActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n getGithubActionsPermissionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions\"],\n listSelectedOrganizationsEnabledGithubActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/organizations\"],\n setAllowedActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n setGithubActionsPermissionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions\"],\n setSelectedOrganizationsEnabledGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations\"]\n },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"]\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"]\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"]\n },\n interactions: {\n getRestrictionsForAuthenticatedUser: [\"GET /user/interaction-limits\"],\n getRestrictionsForOrg: [\"GET /orgs/{org}/interaction-limits\"],\n getRestrictionsForRepo: [\"GET /repos/{owner}/{repo}/interaction-limits\"],\n getRestrictionsForYourPublicRepos: [\"GET /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"getRestrictionsForAuthenticatedUser\"]\n }],\n removeRestrictionsForAuthenticatedUser: [\"DELETE /user/interaction-limits\"],\n removeRestrictionsForOrg: [\"DELETE /orgs/{org}/interaction-limits\"],\n removeRestrictionsForRepo: [\"DELETE /repos/{owner}/{repo}/interaction-limits\"],\n removeRestrictionsForYourPublicRepos: [\"DELETE /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"removeRestrictionsForAuthenticatedUser\"]\n }],\n setRestrictionsForAuthenticatedUser: [\"PUT /user/interaction-limits\"],\n setRestrictionsForOrg: [\"PUT /orgs/{org}/interaction-limits\"],\n setRestrictionsForRepo: [\"PUT /repos/{owner}/{repo}/interaction-limits\"],\n setRestrictionsForYourPublicRepos: [\"PUT /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"setRestrictionsForAuthenticatedUser\"]\n }]\n },\n issues: {\n addAssignees: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\"],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\"],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n removeAssignees: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n removeLabel: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\"],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\"]\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"]\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\"POST /markdown/raw\", {\n headers: {\n \"content-type\": \"text/plain; charset=utf-8\"\n }\n }]\n },\n meta: {\n get: [\"GET /meta\"],\n getOctocat: [\"GET /octocat\"],\n getZen: [\"GET /zen\"],\n root: [\"GET /\"]\n },\n migrations: {\n cancelImport: [\"DELETE /repos/{owner}/{repo}/import\"],\n deleteArchiveForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/archive\"],\n deleteArchiveForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/archive\"],\n downloadArchiveForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/archive\"],\n getArchiveForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/archive\"],\n getCommitAuthors: [\"GET /repos/{owner}/{repo}/import/authors\"],\n getImportStatus: [\"GET /repos/{owner}/{repo}/import\"],\n getLargeFiles: [\"GET /repos/{owner}/{repo}/import/large_files\"],\n getStatusForAuthenticatedUser: [\"GET /user/migrations/{migration_id}\"],\n getStatusForOrg: [\"GET /orgs/{org}/migrations/{migration_id}\"],\n listForAuthenticatedUser: [\"GET /user/migrations\"],\n listForOrg: [\"GET /orgs/{org}/migrations\"],\n listReposForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/repositories\"],\n listReposForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/repositories\"],\n listReposForUser: [\"GET /user/migrations/{migration_id}/repositories\", {}, {\n renamed: [\"migrations\", \"listReposForAuthenticatedUser\"]\n }],\n mapCommitAuthor: [\"PATCH /repos/{owner}/{repo}/import/authors/{author_id}\"],\n setLfsPreference: [\"PATCH /repos/{owner}/{repo}/import/lfs\"],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n startImport: [\"PUT /repos/{owner}/{repo}/import\"],\n unlockRepoForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\"],\n unlockRepoForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\"],\n updateImport: [\"PATCH /repos/{owner}/{repo}/import\"]\n },\n orgs: {\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n cancelInvitation: [\"DELETE /orgs/{org}/invitations/{invitation_id}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\"PUT /orgs/{org}/outside_collaborators/{username}\"],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n get: [\"GET /orgs/{org}\"],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n getWebhookConfigForOrg: [\"GET /orgs/{org}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}\"],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listFailedInvitations: [\"GET /orgs/{org}/failed_invitations\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listWebhookDeliveries: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\"DELETE /orgs/{org}/outside_collaborators/{username}\"],\n removePublicMembershipForAuthenticatedUser: [\"DELETE /orgs/{org}/public_members/{username}\"],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\"PUT /orgs/{org}/public_members/{username}\"],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateMembershipForAuthenticatedUser: [\"PATCH /user/memberships/orgs/{org}\"],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n updateWebhookConfigForOrg: [\"PATCH /orgs/{org}/hooks/{hook_id}/config\"]\n },\n packages: {\n deletePackageForAuthenticatedUser: [\"DELETE /user/packages/{package_type}/{package_name}\"],\n deletePackageForOrg: [\"DELETE /orgs/{org}/packages/{package_type}/{package_name}\"],\n deletePackageForUser: [\"DELETE /users/{username}/packages/{package_type}/{package_name}\"],\n deletePackageVersionForAuthenticatedUser: [\"DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n deletePackageVersionForOrg: [\"DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n deletePackageVersionForUser: [\"DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getAllPackageVersionsForAPackageOwnedByAnOrg: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\", {}, {\n renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByOrg\"]\n }],\n getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions\", {}, {\n renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByAuthenticatedUser\"]\n }],\n getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions\"],\n getAllPackageVersionsForPackageOwnedByOrg: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\"],\n getAllPackageVersionsForPackageOwnedByUser: [\"GET /users/{username}/packages/{package_type}/{package_name}/versions\"],\n getPackageForAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}\"],\n getPackageForOrganization: [\"GET /orgs/{org}/packages/{package_type}/{package_name}\"],\n getPackageForUser: [\"GET /users/{username}/packages/{package_type}/{package_name}\"],\n getPackageVersionForAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getPackageVersionForOrganization: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getPackageVersionForUser: [\"GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n listPackagesForAuthenticatedUser: [\"GET /user/packages\"],\n listPackagesForOrganization: [\"GET /orgs/{org}/packages\"],\n listPackagesForUser: [\"GET /users/{username}/packages\"],\n restorePackageForAuthenticatedUser: [\"POST /user/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageForOrg: [\"POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageForUser: [\"POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageVersionForAuthenticatedUser: [\"POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"],\n restorePackageVersionForOrg: [\"POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"],\n restorePackageVersionForUser: [\"POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"]\n },\n projects: {\n addCollaborator: [\"PUT /projects/{project_id}/collaborators/{username}\"],\n createCard: [\"POST /projects/columns/{column_id}/cards\"],\n createColumn: [\"POST /projects/{project_id}/columns\"],\n createForAuthenticatedUser: [\"POST /user/projects\"],\n createForOrg: [\"POST /orgs/{org}/projects\"],\n createForRepo: [\"POST /repos/{owner}/{repo}/projects\"],\n delete: [\"DELETE /projects/{project_id}\"],\n deleteCard: [\"DELETE /projects/columns/cards/{card_id}\"],\n deleteColumn: [\"DELETE /projects/columns/{column_id}\"],\n get: [\"GET /projects/{project_id}\"],\n getCard: [\"GET /projects/columns/cards/{card_id}\"],\n getColumn: [\"GET /projects/columns/{column_id}\"],\n getPermissionForUser: [\"GET /projects/{project_id}/collaborators/{username}/permission\"],\n listCards: [\"GET /projects/columns/{column_id}/cards\"],\n listCollaborators: [\"GET /projects/{project_id}/collaborators\"],\n listColumns: [\"GET /projects/{project_id}/columns\"],\n listForOrg: [\"GET /orgs/{org}/projects\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/projects\"],\n listForUser: [\"GET /users/{username}/projects\"],\n moveCard: [\"POST /projects/columns/cards/{card_id}/moves\"],\n moveColumn: [\"POST /projects/columns/{column_id}/moves\"],\n removeCollaborator: [\"DELETE /projects/{project_id}/collaborators/{username}\"],\n update: [\"PATCH /projects/{project_id}\"],\n updateCard: [\"PATCH /projects/columns/cards/{card_id}\"],\n updateColumn: [\"PATCH /projects/columns/{column_id}\"]\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\"],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n deletePendingReview: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n deleteReviewComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n dismissReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\"],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\"],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n listReviewComments: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n requestReviewers: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n submitReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\"],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\"],\n updateReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n updateReviewComment: [\"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\"]\n },\n rateLimit: {\n get: [\"GET /rate_limit\"]\n },\n reactions: {\n createForCommitComment: [\"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\"],\n createForIssue: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n createForIssueComment: [\"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"],\n createForPullRequestReviewComment: [\"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"],\n createForRelease: [\"POST /repos/{owner}/{repo}/releases/{release_id}/reactions\"],\n createForTeamDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"],\n createForTeamDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"],\n deleteForCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForIssue: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\"],\n deleteForIssueComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForPullRequestComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForTeamDiscussion: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\"],\n deleteForTeamDiscussionComment: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\"],\n listForCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\"],\n listForIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n listForIssueComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"],\n listForPullRequestReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"],\n listForTeamDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"],\n listForTeamDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"]\n },\n repos: {\n acceptInvitation: [\"PATCH /user/repository_invitations/{invitation_id}\", {}, {\n renamed: [\"repos\", \"acceptInvitationForAuthenticatedUser\"]\n }],\n acceptInvitationForAuthenticatedUser: [\"PATCH /user/repository_invitations/{invitation_id}\"],\n addAppAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n addTeamAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n addUserAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkVulnerabilityAlerts: [\"GET /repos/{owner}/{repo}/vulnerability-alerts\"],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n compareCommitsWithBasehead: [\"GET /repos/{owner}/{repo}/compare/{basehead}\"],\n createAutolink: [\"POST /repos/{owner}/{repo}/autolinks\"],\n createCommitComment: [\"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n createCommitSignatureProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentStatus: [\"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateEnvironment: [\"PUT /repos/{owner}/{repo}/environments/{environment_name}\"],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createPagesSite: [\"POST /repos/{owner}/{repo}/pages\"],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createUsingTemplate: [\"POST /repos/{template_owner}/{template_repo}/generate\"],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n declineInvitation: [\"DELETE /user/repository_invitations/{invitation_id}\", {}, {\n renamed: [\"repos\", \"declineInvitationForAuthenticatedUser\"]\n }],\n declineInvitationForAuthenticatedUser: [\"DELETE /user/repository_invitations/{invitation_id}\"],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n deleteAdminBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n deleteAnEnvironment: [\"DELETE /repos/{owner}/{repo}/environments/{environment_name}\"],\n deleteAutolink: [\"DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n deleteBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\"],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n deletePagesSite: [\"DELETE /repos/{owner}/{repo}/pages\"],\n deletePullRequestReviewProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\"DELETE /repos/{owner}/{repo}/automated-security-fixes\"],\n disableLfsForRepo: [\"DELETE /repos/{owner}/{repo}/lfs\"],\n disableVulnerabilityAlerts: [\"DELETE /repos/{owner}/{repo}/vulnerability-alerts\"],\n downloadArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\", {}, {\n renamed: [\"repos\", \"downloadZipballArchive\"]\n }],\n downloadTarballArchive: [\"GET /repos/{owner}/{repo}/tarball/{ref}\"],\n downloadZipballArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\"],\n enableAutomatedSecurityFixes: [\"PUT /repos/{owner}/{repo}/automated-security-fixes\"],\n enableLfsForRepo: [\"PUT /repos/{owner}/{repo}/lfs\"],\n enableVulnerabilityAlerts: [\"PUT /repos/{owner}/{repo}/vulnerability-alerts\"],\n generateReleaseNotes: [\"POST /repos/{owner}/{repo}/releases/generate-notes\"],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n getAdminBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n getAllEnvironments: [\"GET /repos/{owner}/{repo}/environments\"],\n getAllStatusCheckContexts: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\"],\n getAllTopics: [\"GET /repos/{owner}/{repo}/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n getAppsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\"],\n getAutolink: [\"GET /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection\"],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\"GET /repos/{owner}/{repo}/collaborators/{username}/permission\"],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n getCommunityProfileMetrics: [\"GET /repos/{owner}/{repo}/community/profile\"],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentStatus: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\"],\n getEnvironment: [\"GET /repos/{owner}/{repo}/environments/{environment_name}\"],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getPagesHealthCheck: [\"GET /repos/{owner}/{repo}/pages/health\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getReadmeInDirectory: [\"GET /repos/{owner}/{repo}/readme/{dir}\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getStatusChecksProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n getTeamsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\"],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\"],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n getWebhookConfigForRepo: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}\"],\n listAutolinks: [\"GET /repos/{owner}/{repo}/autolinks\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\"],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/statuses\"],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentStatuses: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\"],\n listReleaseAssets: [\"GET /repos/{owner}/{repo}/releases/{release_id}/assets\"],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhookDeliveries: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n mergeUpstream: [\"POST /repos/{owner}/{repo}/merge-upstream\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"],\n removeAppAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n removeCollaborator: [\"DELETE /repos/{owner}/{repo}/collaborators/{username}\"],\n removeStatusCheckContexts: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n removeStatusCheckProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n removeTeamAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n removeUserAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n renameBranch: [\"POST /repos/{owner}/{repo}/branches/{branch}/rename\"],\n replaceAllTopics: [\"PUT /repos/{owner}/{repo}/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n setAppAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n setStatusCheckContexts: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n setTeamAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n setUserAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection\"],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n updatePullRequestReviewProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n updateStatusCheckPotection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\", {}, {\n renamed: [\"repos\", \"updateStatusCheckProtection\"]\n }],\n updateStatusCheckProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n updateWebhookConfigForRepo: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n uploadReleaseAsset: [\"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\", {\n baseUrl: \"https://uploads.github.com\"\n }]\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\"],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n users: [\"GET /search/users\"]\n },\n secretScanning: {\n getAlert: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"],\n listAlertsForOrg: [\"GET /orgs/{org}/secret-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"]\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n addOrUpdateProjectPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n addOrUpdateRepoPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n checkPermissionsForProjectInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n checkPermissionsForRepoInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n deleteDiscussionInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n getDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n getMembershipForUserInOrg: [\"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/invitations\"],\n listProjectsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects\"],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n removeProjectInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n removeRepoInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n updateDiscussionCommentInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n updateDiscussionInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"]\n },\n users: {\n addEmailForAuthenticated: [\"POST /user/emails\", {}, {\n renamed: [\"users\", \"addEmailForAuthenticatedUser\"]\n }],\n addEmailForAuthenticatedUser: [\"POST /user/emails\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\"POST /user/gpg_keys\", {}, {\n renamed: [\"users\", \"createGpgKeyForAuthenticatedUser\"]\n }],\n createGpgKeyForAuthenticatedUser: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\"POST /user/keys\", {}, {\n renamed: [\"users\", \"createPublicSshKeyForAuthenticatedUser\"]\n }],\n createPublicSshKeyForAuthenticatedUser: [\"POST /user/keys\"],\n deleteEmailForAuthenticated: [\"DELETE /user/emails\", {}, {\n renamed: [\"users\", \"deleteEmailForAuthenticatedUser\"]\n }],\n deleteEmailForAuthenticatedUser: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\"DELETE /user/gpg_keys/{gpg_key_id}\", {}, {\n renamed: [\"users\", \"deleteGpgKeyForAuthenticatedUser\"]\n }],\n deleteGpgKeyForAuthenticatedUser: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\"DELETE /user/keys/{key_id}\", {}, {\n renamed: [\"users\", \"deletePublicSshKeyForAuthenticatedUser\"]\n }],\n deletePublicSshKeyForAuthenticatedUser: [\"DELETE /user/keys/{key_id}\"],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\"GET /user/gpg_keys/{gpg_key_id}\", {}, {\n renamed: [\"users\", \"getGpgKeyForAuthenticatedUser\"]\n }],\n getGpgKeyForAuthenticatedUser: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\"GET /user/keys/{key_id}\", {}, {\n renamed: [\"users\", \"getPublicSshKeyForAuthenticatedUser\"]\n }],\n getPublicSshKeyForAuthenticatedUser: [\"GET /user/keys/{key_id}\"],\n list: [\"GET /users\"],\n listBlockedByAuthenticated: [\"GET /user/blocks\", {}, {\n renamed: [\"users\", \"listBlockedByAuthenticatedUser\"]\n }],\n listBlockedByAuthenticatedUser: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\"GET /user/emails\", {}, {\n renamed: [\"users\", \"listEmailsForAuthenticatedUser\"]\n }],\n listEmailsForAuthenticatedUser: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\"GET /user/following\", {}, {\n renamed: [\"users\", \"listFollowedByAuthenticatedUser\"]\n }],\n listFollowedByAuthenticatedUser: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\"GET /user/gpg_keys\", {}, {\n renamed: [\"users\", \"listGpgKeysForAuthenticatedUser\"]\n }],\n listGpgKeysForAuthenticatedUser: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\"GET /user/public_emails\", {}, {\n renamed: [\"users\", \"listPublicEmailsForAuthenticatedUser\"]\n }],\n listPublicEmailsForAuthenticatedUser: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\"GET /user/keys\", {}, {\n renamed: [\"users\", \"listPublicSshKeysForAuthenticatedUser\"]\n }],\n listPublicSshKeysForAuthenticatedUser: [\"GET /user/keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\"PATCH /user/email/visibility\", {}, {\n renamed: [\"users\", \"setPrimaryEmailVisibilityForAuthenticatedUser\"]\n }],\n setPrimaryEmailVisibilityForAuthenticatedUser: [\"PATCH /user/email/visibility\"],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"]\n }\n};\n\nconst VERSION = \"5.13.0\";\n\nfunction endpointsToMethods(octokit, endpointsMap) {\n const newMethods = {};\n\n for (const [scope, endpoints] of Object.entries(endpointsMap)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign({\n method,\n url\n }, defaults);\n\n if (!newMethods[scope]) {\n newMethods[scope] = {};\n }\n\n const scopeMethods = newMethods[scope];\n\n if (decorations) {\n scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations);\n continue;\n }\n\n scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);\n }\n }\n\n return newMethods;\n}\n\nfunction decorate(octokit, scope, methodName, defaults, decorations) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n /* istanbul ignore next */\n\n function withDecorations(...args) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n let options = requestWithDefaults.endpoint.merge(...args); // There are currently no other decorations than `.mapToData`\n\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: undefined\n });\n return requestWithDefaults(options);\n }\n\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`);\n }\n\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n\n if (decorations.renamedParameters) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n const options = requestWithDefaults.endpoint.merge(...args);\n\n for (const [name, alias] of Object.entries(decorations.renamedParameters)) {\n if (name in options) {\n octokit.log.warn(`\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`);\n\n if (!(alias in options)) {\n options[alias] = options[name];\n }\n\n delete options[name];\n }\n }\n\n return requestWithDefaults(options);\n } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n\n\n return requestWithDefaults(...args);\n }\n\n return Object.assign(withDecorations, requestWithDefaults);\n}\n\nfunction restEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, Endpoints);\n return {\n rest: api\n };\n}\nrestEndpointMethods.VERSION = VERSION;\nfunction legacyRestEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, Endpoints);\n return _objectSpread2(_objectSpread2({}, api), {}, {\n rest: api\n });\n}\nlegacyRestEndpointMethods.VERSION = VERSION;\n\nexports.legacyRestEndpointMethods = legacyRestEndpointMethods;\nexports.restEndpointMethods = restEndpointMethods;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar deprecation = require('deprecation');\nvar once = _interopDefault(require('once'));\n\nconst logOnceCode = once(deprecation => console.warn(deprecation));\nconst logOnceHeaders = once(deprecation => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\n\nclass RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"HttpError\";\n this.status = statusCode;\n let headers;\n\n if (\"headers\" in options && typeof options.headers !== \"undefined\") {\n headers = options.headers;\n }\n\n if (\"response\" in options) {\n this.response = options.response;\n headers = options.response.headers;\n } // redact request credentials without mutating original request options\n\n\n const requestCopy = Object.assign({}, options.request);\n\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\")\n });\n }\n\n requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\") // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy; // deprecations\n\n Object.defineProperty(this, \"code\", {\n get() {\n logOnceCode(new deprecation.Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n }\n\n });\n Object.defineProperty(this, \"headers\", {\n get() {\n logOnceHeaders(new deprecation.Deprecation(\"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.\"));\n return headers || {};\n }\n\n });\n }\n\n}\n\nexports.RequestError = RequestError;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar endpoint = require('@octokit/endpoint');\nvar universalUserAgent = require('universal-user-agent');\nvar isPlainObject = require('is-plain-object');\nvar nodeFetch = _interopDefault(require('node-fetch'));\nvar requestError = require('@octokit/request-error');\n\nconst VERSION = \"5.6.3\";\n\nfunction getBufferResponse(response) {\n return response.arrayBuffer();\n}\n\nfunction fetchWrapper(requestOptions) {\n const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;\n\n if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n\n let headers = {};\n let status;\n let url;\n const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect\n }, // `requestOptions.request.agent` type is incompatible\n // see https://github.com/octokit/types.ts/pull/264\n requestOptions.request)).then(async response => {\n url = response.url;\n status = response.status;\n\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n\n if (\"deprecation\" in headers) {\n const matches = headers.link && headers.link.match(/<([^>]+)>; rel=\"deprecation\"/);\n const deprecationLink = matches && matches.pop();\n log.warn(`[@octokit/request] \"${requestOptions.method} ${requestOptions.url}\" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : \"\"}`);\n }\n\n if (status === 204 || status === 205) {\n return;\n } // GitHub API returns 200 for HEAD requests\n\n\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n\n throw new requestError.RequestError(response.statusText, status, {\n response: {\n url,\n status,\n headers,\n data: undefined\n },\n request: requestOptions\n });\n }\n\n if (status === 304) {\n throw new requestError.RequestError(\"Not modified\", status, {\n response: {\n url,\n status,\n headers,\n data: await getResponseData(response)\n },\n request: requestOptions\n });\n }\n\n if (status >= 400) {\n const data = await getResponseData(response);\n const error = new requestError.RequestError(toErrorMessage(data), status, {\n response: {\n url,\n status,\n headers,\n data\n },\n request: requestOptions\n });\n throw error;\n }\n\n return getResponseData(response);\n }).then(data => {\n return {\n status,\n url,\n headers,\n data\n };\n }).catch(error => {\n if (error instanceof requestError.RequestError) throw error;\n throw new requestError.RequestError(error.message, 500, {\n request: requestOptions\n });\n });\n}\n\nasync function getResponseData(response) {\n const contentType = response.headers.get(\"content-type\");\n\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n\n return getBufferResponse(response);\n}\n\nfunction toErrorMessage(data) {\n if (typeof data === \"string\") return data; // istanbul ignore else - just in case\n\n if (\"message\" in data) {\n if (Array.isArray(data.errors)) {\n return `${data.message}: ${data.errors.map(JSON.stringify).join(\", \")}`;\n }\n\n return data.message;\n } // istanbul ignore next - just in case\n\n\n return `Unknown error: ${JSON.stringify(data)}`;\n}\n\nfunction withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n}\n\nconst request = withDefaults(endpoint.endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n }\n});\n\nexports.request = request;\n//# sourceMappingURL=index.js.map\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nconst events_1 = require(\"events\");\nconst debug_1 = __importDefault(require(\"debug\"));\nconst promisify_1 = __importDefault(require(\"./promisify\"));\nconst debug = debug_1.default('agent-base');\nfunction isAgent(v) {\n return Boolean(v) && typeof v.addRequest === 'function';\n}\nfunction isSecureEndpoint() {\n const { stack } = new Error();\n if (typeof stack !== 'string')\n return false;\n return stack.split('\\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1);\n}\nfunction createAgent(callback, opts) {\n return new createAgent.Agent(callback, opts);\n}\n(function (createAgent) {\n /**\n * Base `http.Agent` implementation.\n * No pooling/keep-alive is implemented by default.\n *\n * @param {Function} callback\n * @api public\n */\n class Agent extends events_1.EventEmitter {\n constructor(callback, _opts) {\n super();\n let opts = _opts;\n if (typeof callback === 'function') {\n this.callback = callback;\n }\n else if (callback) {\n opts = callback;\n }\n // Timeout for the socket to be returned from the callback\n this.timeout = null;\n if (opts && typeof opts.timeout === 'number') {\n this.timeout = opts.timeout;\n }\n // These aren't actually used by `agent-base`, but are required\n // for the TypeScript definition files in `@types/node` :/\n this.maxFreeSockets = 1;\n this.maxSockets = 1;\n this.maxTotalSockets = Infinity;\n this.sockets = {};\n this.freeSockets = {};\n this.requests = {};\n this.options = {};\n }\n get defaultPort() {\n if (typeof this.explicitDefaultPort === 'number') {\n return this.explicitDefaultPort;\n }\n return isSecureEndpoint() ? 443 : 80;\n }\n set defaultPort(v) {\n this.explicitDefaultPort = v;\n }\n get protocol() {\n if (typeof this.explicitProtocol === 'string') {\n return this.explicitProtocol;\n }\n return isSecureEndpoint() ? 'https:' : 'http:';\n }\n set protocol(v) {\n this.explicitProtocol = v;\n }\n callback(req, opts, fn) {\n throw new Error('\"agent-base\" has no default implementation, you must subclass and override `callback()`');\n }\n /**\n * Called by node-core's \"_http_client.js\" module when creating\n * a new HTTP request with this Agent instance.\n *\n * @api public\n */\n addRequest(req, _opts) {\n const opts = Object.assign({}, _opts);\n if (typeof opts.secureEndpoint !== 'boolean') {\n opts.secureEndpoint = isSecureEndpoint();\n }\n if (opts.host == null) {\n opts.host = 'localhost';\n }\n if (opts.port == null) {\n opts.port = opts.secureEndpoint ? 443 : 80;\n }\n if (opts.protocol == null) {\n opts.protocol = opts.secureEndpoint ? 'https:' : 'http:';\n }\n if (opts.host && opts.path) {\n // If both a `host` and `path` are specified then it's most\n // likely the result of a `url.parse()` call... we need to\n // remove the `path` portion so that `net.connect()` doesn't\n // attempt to open that as a unix socket file.\n delete opts.path;\n }\n delete opts.agent;\n delete opts.hostname;\n delete opts._defaultAgent;\n delete opts.defaultPort;\n delete opts.createConnection;\n // Hint to use \"Connection: close\"\n // XXX: non-documented `http` module API :(\n req._last = true;\n req.shouldKeepAlive = false;\n let timedOut = false;\n let timeoutId = null;\n const timeoutMs = opts.timeout || this.timeout;\n const onerror = (err) => {\n if (req._hadError)\n return;\n req.emit('error', err);\n // For Safety. Some additional errors might fire later on\n // and we need to make sure we don't double-fire the error event.\n req._hadError = true;\n };\n const ontimeout = () => {\n timeoutId = null;\n timedOut = true;\n const err = new Error(`A \"socket\" was not created for HTTP request before ${timeoutMs}ms`);\n err.code = 'ETIMEOUT';\n onerror(err);\n };\n const callbackError = (err) => {\n if (timedOut)\n return;\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n onerror(err);\n };\n const onsocket = (socket) => {\n if (timedOut)\n return;\n if (timeoutId != null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n if (isAgent(socket)) {\n // `socket` is actually an `http.Agent` instance, so\n // relinquish responsibility for this `req` to the Agent\n // from here on\n debug('Callback returned another Agent instance %o', socket.constructor.name);\n socket.addRequest(req, opts);\n return;\n }\n if (socket) {\n socket.once('free', () => {\n this.freeSocket(socket, opts);\n });\n req.onSocket(socket);\n return;\n }\n const err = new Error(`no Duplex stream was returned to agent-base for \\`${req.method} ${req.path}\\``);\n onerror(err);\n };\n if (typeof this.callback !== 'function') {\n onerror(new Error('`callback` is not defined'));\n return;\n }\n if (!this.promisifiedCallback) {\n if (this.callback.length >= 3) {\n debug('Converting legacy callback function to promise');\n this.promisifiedCallback = promisify_1.default(this.callback);\n }\n else {\n this.promisifiedCallback = this.callback;\n }\n }\n if (typeof timeoutMs === 'number' && timeoutMs > 0) {\n timeoutId = setTimeout(ontimeout, timeoutMs);\n }\n if ('port' in opts && typeof opts.port !== 'number') {\n opts.port = Number(opts.port);\n }\n try {\n debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`);\n Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError);\n }\n catch (err) {\n Promise.reject(err).catch(callbackError);\n }\n }\n freeSocket(socket, opts) {\n debug('Freeing socket %o %o', socket.constructor.name, opts);\n socket.destroy();\n }\n destroy() {\n debug('Destroying agent %o', this.constructor.name);\n }\n }\n createAgent.Agent = Agent;\n // So that `instanceof` works correctly\n createAgent.prototype = createAgent.Agent.prototype;\n})(createAgent || (createAgent = {}));\nmodule.exports = createAgent;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction promisify(fn) {\n return function (req, opts) {\n return new Promise((resolve, reject) => {\n fn.call(this, req, opts, (err, rtn) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(rtn);\n }\n });\n });\n };\n}\nexports.default = promisify;\n//# sourceMappingURL=promisify.js.map","module.exports =\n{\n parallel : require('./parallel.js'),\n serial : require('./serial.js'),\n serialOrdered : require('./serialOrdered.js')\n};\n","// API\nmodule.exports = abort;\n\n/**\n * Aborts leftover active jobs\n *\n * @param {object} state - current state object\n */\nfunction abort(state)\n{\n Object.keys(state.jobs).forEach(clean.bind(state));\n\n // reset leftover jobs\n state.jobs = {};\n}\n\n/**\n * Cleans up leftover job by invoking abort function for the provided job id\n *\n * @this state\n * @param {string|number} key - job id to abort\n */\nfunction clean(key)\n{\n if (typeof this.jobs[key] == 'function')\n {\n this.jobs[key]();\n }\n}\n","var defer = require('./defer.js');\n\n// API\nmodule.exports = async;\n\n/**\n * Runs provided callback asynchronously\n * even if callback itself is not\n *\n * @param {function} callback - callback to invoke\n * @returns {function} - augmented callback\n */\nfunction async(callback)\n{\n var isAsync = false;\n\n // check if async happened\n defer(function() { isAsync = true; });\n\n return function async_callback(err, result)\n {\n if (isAsync)\n {\n callback(err, result);\n }\n else\n {\n defer(function nextTick_callback()\n {\n callback(err, result);\n });\n }\n };\n}\n","module.exports = defer;\n\n/**\n * Runs provided function on next iteration of the event loop\n *\n * @param {function} fn - function to run\n */\nfunction defer(fn)\n{\n var nextTick = typeof setImmediate == 'function'\n ? setImmediate\n : (\n typeof process == 'object' && typeof process.nextTick == 'function'\n ? process.nextTick\n : null\n );\n\n if (nextTick)\n {\n nextTick(fn);\n }\n else\n {\n setTimeout(fn, 0);\n }\n}\n","var async = require('./async.js')\n , abort = require('./abort.js')\n ;\n\n// API\nmodule.exports = iterate;\n\n/**\n * Iterates over each job object\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {object} state - current job status\n * @param {function} callback - invoked when all elements processed\n */\nfunction iterate(list, iterator, state, callback)\n{\n // store current index\n var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;\n\n state.jobs[key] = runJob(iterator, key, list[key], function(error, output)\n {\n // don't repeat yourself\n // skip secondary callbacks\n if (!(key in state.jobs))\n {\n return;\n }\n\n // clean up jobs\n delete state.jobs[key];\n\n if (error)\n {\n // don't process rest of the results\n // stop still active jobs\n // and reset the list\n abort(state);\n }\n else\n {\n state.results[key] = output;\n }\n\n // return salvaged results\n callback(error, state.results);\n });\n}\n\n/**\n * Runs iterator over provided job element\n *\n * @param {function} iterator - iterator to invoke\n * @param {string|number} key - key/index of the element in the list of jobs\n * @param {mixed} item - job description\n * @param {function} callback - invoked after iterator is done with the job\n * @returns {function|mixed} - job abort function or something else\n */\nfunction runJob(iterator, key, item, callback)\n{\n var aborter;\n\n // allow shortcut if iterator expects only two arguments\n if (iterator.length == 2)\n {\n aborter = iterator(item, async(callback));\n }\n // otherwise go with full three arguments\n else\n {\n aborter = iterator(item, key, async(callback));\n }\n\n return aborter;\n}\n","// API\nmodule.exports = state;\n\n/**\n * Creates initial state object\n * for iteration over list\n *\n * @param {array|object} list - list to iterate over\n * @param {function|null} sortMethod - function to use for keys sort,\n * or `null` to keep them as is\n * @returns {object} - initial state object\n */\nfunction state(list, sortMethod)\n{\n var isNamedList = !Array.isArray(list)\n , initState =\n {\n index : 0,\n keyedList: isNamedList || sortMethod ? Object.keys(list) : null,\n jobs : {},\n results : isNamedList ? {} : [],\n size : isNamedList ? Object.keys(list).length : list.length\n }\n ;\n\n if (sortMethod)\n {\n // sort array keys based on it's values\n // sort object's keys just on own merit\n initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)\n {\n return sortMethod(list[a], list[b]);\n });\n }\n\n return initState;\n}\n","var abort = require('./abort.js')\n , async = require('./async.js')\n ;\n\n// API\nmodule.exports = terminator;\n\n/**\n * Terminates jobs in the attached state context\n *\n * @this AsyncKitState#\n * @param {function} callback - final callback to invoke after termination\n */\nfunction terminator(callback)\n{\n if (!Object.keys(this.jobs).length)\n {\n return;\n }\n\n // fast forward iteration index\n this.index = this.size;\n\n // abort jobs\n abort(this);\n\n // send back results we have so far\n async(callback)(null, this.results);\n}\n","var iterate = require('./lib/iterate.js')\n , initState = require('./lib/state.js')\n , terminator = require('./lib/terminator.js')\n ;\n\n// Public API\nmodule.exports = parallel;\n\n/**\n * Runs iterator over provided array elements in parallel\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction parallel(list, iterator, callback)\n{\n var state = initState(list);\n\n while (state.index < (state['keyedList'] || list).length)\n {\n iterate(list, iterator, state, function(error, result)\n {\n if (error)\n {\n callback(error, result);\n return;\n }\n\n // looks like it's the last one\n if (Object.keys(state.jobs).length === 0)\n {\n callback(null, state.results);\n return;\n }\n });\n\n state.index++;\n }\n\n return terminator.bind(state, callback);\n}\n","var serialOrdered = require('./serialOrdered.js');\n\n// Public API\nmodule.exports = serial;\n\n/**\n * Runs iterator over provided array elements in series\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction serial(list, iterator, callback)\n{\n return serialOrdered(list, iterator, null, callback);\n}\n","var iterate = require('./lib/iterate.js')\n , initState = require('./lib/state.js')\n , terminator = require('./lib/terminator.js')\n ;\n\n// Public API\nmodule.exports = serialOrdered;\n// sorting helpers\nmodule.exports.ascending = ascending;\nmodule.exports.descending = descending;\n\n/**\n * Runs iterator over provided sorted array elements in series\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} sortMethod - custom sort function\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction serialOrdered(list, iterator, sortMethod, callback)\n{\n var state = initState(list, sortMethod);\n\n iterate(list, iterator, state, function iteratorHandler(error, result)\n {\n if (error)\n {\n callback(error, result);\n return;\n }\n\n state.index++;\n\n // are we there yet?\n if (state.index < (state['keyedList'] || list).length)\n {\n iterate(list, iterator, state, iteratorHandler);\n return;\n }\n\n // done here\n callback(null, state.results);\n });\n\n return terminator.bind(state, callback);\n}\n\n/*\n * -- Sort methods\n */\n\n/**\n * sort helper to sort array elements in ascending order\n *\n * @param {mixed} a - an item to compare\n * @param {mixed} b - an item to compare\n * @returns {number} - comparison result\n */\nfunction ascending(a, b)\n{\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\n/**\n * sort helper to sort array elements in descending order\n *\n * @param {mixed} a - an item to compare\n * @param {mixed} b - an item to compare\n * @returns {number} - comparison result\n */\nfunction descending(a, b)\n{\n return -1 * ascending(a, b);\n}\n","var register = require('./lib/register')\nvar addHook = require('./lib/add')\nvar removeHook = require('./lib/remove')\n\n// bind with array of arguments: https://stackoverflow.com/a/21792913\nvar bind = Function.bind\nvar bindable = bind.bind(bind)\n\nfunction bindApi (hook, state, name) {\n var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])\n hook.api = { remove: removeHookRef }\n hook.remove = removeHookRef\n\n ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {\n var args = name ? [state, kind, name] : [state, kind]\n hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)\n })\n}\n\nfunction HookSingular () {\n var singularHookName = 'h'\n var singularHookState = {\n registry: {}\n }\n var singularHook = register.bind(null, singularHookState, singularHookName)\n bindApi(singularHook, singularHookState, singularHookName)\n return singularHook\n}\n\nfunction HookCollection () {\n var state = {\n registry: {}\n }\n\n var hook = register.bind(null, state)\n bindApi(hook, state)\n\n return hook\n}\n\nvar collectionHookDeprecationMessageDisplayed = false\nfunction Hook () {\n if (!collectionHookDeprecationMessageDisplayed) {\n console.warn('[before-after-hook]: \"Hook()\" repurposing warning, use \"Hook.Collection()\". Read more: https://git.io/upgrade-before-after-hook-to-1.4')\n collectionHookDeprecationMessageDisplayed = true\n }\n return HookCollection()\n}\n\nHook.Singular = HookSingular.bind()\nHook.Collection = HookCollection.bind()\n\nmodule.exports = Hook\n// expose constructors as a named property for TypeScript\nmodule.exports.Hook = Hook\nmodule.exports.Singular = Hook.Singular\nmodule.exports.Collection = Hook.Collection\n","module.exports = addHook;\n\nfunction addHook(state, kind, name, hook) {\n var orig = hook;\n if (!state.registry[name]) {\n state.registry[name] = [];\n }\n\n if (kind === \"before\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(orig.bind(null, options))\n .then(method.bind(null, options));\n };\n }\n\n if (kind === \"after\") {\n hook = function (method, options) {\n var result;\n return Promise.resolve()\n .then(method.bind(null, options))\n .then(function (result_) {\n result = result_;\n return orig(result, options);\n })\n .then(function () {\n return result;\n });\n };\n }\n\n if (kind === \"error\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(method.bind(null, options))\n .catch(function (error) {\n return orig(error, options);\n });\n };\n }\n\n state.registry[name].push({\n hook: hook,\n orig: orig,\n });\n}\n","module.exports = register;\n\nfunction register(state, name, method, options) {\n if (typeof method !== \"function\") {\n throw new Error(\"method for before hook must be a function\");\n }\n\n if (!options) {\n options = {};\n }\n\n if (Array.isArray(name)) {\n return name.reverse().reduce(function (callback, name) {\n return register.bind(null, state, name, callback, options);\n }, method)();\n }\n\n return Promise.resolve().then(function () {\n if (!state.registry[name]) {\n return method(options);\n }\n\n return state.registry[name].reduce(function (method, registered) {\n return registered.hook.bind(null, method, options);\n }, method)();\n });\n}\n","module.exports = removeHook;\n\nfunction removeHook(state, name, method) {\n if (!state.registry[name]) {\n return;\n }\n\n var index = state.registry[name]\n .map(function (registered) {\n return registered.orig;\n })\n .indexOf(method);\n\n if (index === -1) {\n return;\n }\n\n state.registry[name].splice(index, 1);\n}\n","var util = require('util');\nvar Stream = require('stream').Stream;\nvar DelayedStream = require('delayed-stream');\n\nmodule.exports = CombinedStream;\nfunction CombinedStream() {\n this.writable = false;\n this.readable = true;\n this.dataSize = 0;\n this.maxDataSize = 2 * 1024 * 1024;\n this.pauseStreams = true;\n\n this._released = false;\n this._streams = [];\n this._currentStream = null;\n this._insideLoop = false;\n this._pendingNext = false;\n}\nutil.inherits(CombinedStream, Stream);\n\nCombinedStream.create = function(options) {\n var combinedStream = new this();\n\n options = options || {};\n for (var option in options) {\n combinedStream[option] = options[option];\n }\n\n return combinedStream;\n};\n\nCombinedStream.isStreamLike = function(stream) {\n return (typeof stream !== 'function')\n && (typeof stream !== 'string')\n && (typeof stream !== 'boolean')\n && (typeof stream !== 'number')\n && (!Buffer.isBuffer(stream));\n};\n\nCombinedStream.prototype.append = function(stream) {\n var isStreamLike = CombinedStream.isStreamLike(stream);\n\n if (isStreamLike) {\n if (!(stream instanceof DelayedStream)) {\n var newStream = DelayedStream.create(stream, {\n maxDataSize: Infinity,\n pauseStream: this.pauseStreams,\n });\n stream.on('data', this._checkDataSize.bind(this));\n stream = newStream;\n }\n\n this._handleErrors(stream);\n\n if (this.pauseStreams) {\n stream.pause();\n }\n }\n\n this._streams.push(stream);\n return this;\n};\n\nCombinedStream.prototype.pipe = function(dest, options) {\n Stream.prototype.pipe.call(this, dest, options);\n this.resume();\n return dest;\n};\n\nCombinedStream.prototype._getNext = function() {\n this._currentStream = null;\n\n if (this._insideLoop) {\n this._pendingNext = true;\n return; // defer call\n }\n\n this._insideLoop = true;\n try {\n do {\n this._pendingNext = false;\n this._realGetNext();\n } while (this._pendingNext);\n } finally {\n this._insideLoop = false;\n }\n};\n\nCombinedStream.prototype._realGetNext = function() {\n var stream = this._streams.shift();\n\n\n if (typeof stream == 'undefined') {\n this.end();\n return;\n }\n\n if (typeof stream !== 'function') {\n this._pipeNext(stream);\n return;\n }\n\n var getStream = stream;\n getStream(function(stream) {\n var isStreamLike = CombinedStream.isStreamLike(stream);\n if (isStreamLike) {\n stream.on('data', this._checkDataSize.bind(this));\n this._handleErrors(stream);\n }\n\n this._pipeNext(stream);\n }.bind(this));\n};\n\nCombinedStream.prototype._pipeNext = function(stream) {\n this._currentStream = stream;\n\n var isStreamLike = CombinedStream.isStreamLike(stream);\n if (isStreamLike) {\n stream.on('end', this._getNext.bind(this));\n stream.pipe(this, {end: false});\n return;\n }\n\n var value = stream;\n this.write(value);\n this._getNext();\n};\n\nCombinedStream.prototype._handleErrors = function(stream) {\n var self = this;\n stream.on('error', function(err) {\n self._emitError(err);\n });\n};\n\nCombinedStream.prototype.write = function(data) {\n this.emit('data', data);\n};\n\nCombinedStream.prototype.pause = function() {\n if (!this.pauseStreams) {\n return;\n }\n\n if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();\n this.emit('pause');\n};\n\nCombinedStream.prototype.resume = function() {\n if (!this._released) {\n this._released = true;\n this.writable = true;\n this._getNext();\n }\n\n if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();\n this.emit('resume');\n};\n\nCombinedStream.prototype.end = function() {\n this._reset();\n this.emit('end');\n};\n\nCombinedStream.prototype.destroy = function() {\n this._reset();\n this.emit('close');\n};\n\nCombinedStream.prototype._reset = function() {\n this.writable = false;\n this._streams = [];\n this._currentStream = null;\n};\n\nCombinedStream.prototype._checkDataSize = function() {\n this._updateDataSize();\n if (this.dataSize <= this.maxDataSize) {\n return;\n }\n\n var message =\n 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';\n this._emitError(new Error(message));\n};\n\nCombinedStream.prototype._updateDataSize = function() {\n this.dataSize = 0;\n\n var self = this;\n this._streams.forEach(function(stream) {\n if (!stream.dataSize) {\n return;\n }\n\n self.dataSize += stream.dataSize;\n });\n\n if (this._currentStream && this._currentStream.dataSize) {\n this.dataSize += this._currentStream.dataSize;\n }\n};\n\nCombinedStream.prototype._emitError = function(err) {\n this._reset();\n this.emit('error', err);\n};\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.format(...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n","var Stream = require('stream').Stream;\nvar util = require('util');\n\nmodule.exports = DelayedStream;\nfunction DelayedStream() {\n this.source = null;\n this.dataSize = 0;\n this.maxDataSize = 1024 * 1024;\n this.pauseStream = true;\n\n this._maxDataSizeExceeded = false;\n this._released = false;\n this._bufferedEvents = [];\n}\nutil.inherits(DelayedStream, Stream);\n\nDelayedStream.create = function(source, options) {\n var delayedStream = new this();\n\n options = options || {};\n for (var option in options) {\n delayedStream[option] = options[option];\n }\n\n delayedStream.source = source;\n\n var realEmit = source.emit;\n source.emit = function() {\n delayedStream._handleEmit(arguments);\n return realEmit.apply(source, arguments);\n };\n\n source.on('error', function() {});\n if (delayedStream.pauseStream) {\n source.pause();\n }\n\n return delayedStream;\n};\n\nObject.defineProperty(DelayedStream.prototype, 'readable', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this.source.readable;\n }\n});\n\nDelayedStream.prototype.setEncoding = function() {\n return this.source.setEncoding.apply(this.source, arguments);\n};\n\nDelayedStream.prototype.resume = function() {\n if (!this._released) {\n this.release();\n }\n\n this.source.resume();\n};\n\nDelayedStream.prototype.pause = function() {\n this.source.pause();\n};\n\nDelayedStream.prototype.release = function() {\n this._released = true;\n\n this._bufferedEvents.forEach(function(args) {\n this.emit.apply(this, args);\n }.bind(this));\n this._bufferedEvents = [];\n};\n\nDelayedStream.prototype.pipe = function() {\n var r = Stream.prototype.pipe.apply(this, arguments);\n this.resume();\n return r;\n};\n\nDelayedStream.prototype._handleEmit = function(args) {\n if (this._released) {\n this.emit.apply(this, args);\n return;\n }\n\n if (args[0] === 'data') {\n this.dataSize += args[1].length;\n this._checkIfMaxDataSizeExceeded();\n }\n\n this._bufferedEvents.push(args);\n};\n\nDelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {\n if (this._maxDataSizeExceeded) {\n return;\n }\n\n if (this.dataSize <= this.maxDataSize) {\n return;\n }\n\n this._maxDataSizeExceeded = true;\n var message =\n 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'\n this.emit('error', new Error(message));\n};\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nclass Deprecation extends Error {\n constructor(message) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = 'Deprecation';\n }\n\n}\n\nexports.Deprecation = Deprecation;\n","var debug;\n\nmodule.exports = function () {\n if (!debug) {\n try {\n /* eslint global-require: off */\n debug = require(\"debug\")(\"follow-redirects\");\n }\n catch (error) { /* */ }\n if (typeof debug !== \"function\") {\n debug = function () { /* */ };\n }\n }\n debug.apply(null, arguments);\n};\n","var url = require(\"url\");\nvar URL = url.URL;\nvar http = require(\"http\");\nvar https = require(\"https\");\nvar Writable = require(\"stream\").Writable;\nvar assert = require(\"assert\");\nvar debug = require(\"./debug\");\n\n// Create handlers that pass events from native requests\nvar events = [\"abort\", \"aborted\", \"connect\", \"error\", \"socket\", \"timeout\"];\nvar eventHandlers = Object.create(null);\nevents.forEach(function (event) {\n eventHandlers[event] = function (arg1, arg2, arg3) {\n this._redirectable.emit(event, arg1, arg2, arg3);\n };\n});\n\n// Error types with codes\nvar RedirectionError = createErrorType(\n \"ERR_FR_REDIRECTION_FAILURE\",\n \"Redirected request failed\"\n);\nvar TooManyRedirectsError = createErrorType(\n \"ERR_FR_TOO_MANY_REDIRECTS\",\n \"Maximum number of redirects exceeded\"\n);\nvar MaxBodyLengthExceededError = createErrorType(\n \"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\",\n \"Request body larger than maxBodyLength limit\"\n);\nvar WriteAfterEndError = createErrorType(\n \"ERR_STREAM_WRITE_AFTER_END\",\n \"write after end\"\n);\n\n// An HTTP(S) request that can be redirected\nfunction RedirectableRequest(options, responseCallback) {\n // Initialize the request\n Writable.call(this);\n this._sanitizeOptions(options);\n this._options = options;\n this._ended = false;\n this._ending = false;\n this._redirectCount = 0;\n this._redirects = [];\n this._requestBodyLength = 0;\n this._requestBodyBuffers = [];\n\n // Attach a callback if passed\n if (responseCallback) {\n this.on(\"response\", responseCallback);\n }\n\n // React to responses of native requests\n var self = this;\n this._onNativeResponse = function (response) {\n self._processResponse(response);\n };\n\n // Perform the first request\n this._performRequest();\n}\nRedirectableRequest.prototype = Object.create(Writable.prototype);\n\nRedirectableRequest.prototype.abort = function () {\n abortRequest(this._currentRequest);\n this.emit(\"abort\");\n};\n\n// Writes buffered data to the current native request\nRedirectableRequest.prototype.write = function (data, encoding, callback) {\n // Writing is not allowed if end has been called\n if (this._ending) {\n throw new WriteAfterEndError();\n }\n\n // Validate input and shift parameters if necessary\n if (!(typeof data === \"string\" || typeof data === \"object\" && (\"length\" in data))) {\n throw new TypeError(\"data should be a string, Buffer or Uint8Array\");\n }\n if (typeof encoding === \"function\") {\n callback = encoding;\n encoding = null;\n }\n\n // Ignore empty buffers, since writing them doesn't invoke the callback\n // https://github.com/nodejs/node/issues/22066\n if (data.length === 0) {\n if (callback) {\n callback();\n }\n return;\n }\n // Only write when we don't exceed the maximum body length\n if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {\n this._requestBodyLength += data.length;\n this._requestBodyBuffers.push({ data: data, encoding: encoding });\n this._currentRequest.write(data, encoding, callback);\n }\n // Error when we exceed the maximum body length\n else {\n this.emit(\"error\", new MaxBodyLengthExceededError());\n this.abort();\n }\n};\n\n// Ends the current native request\nRedirectableRequest.prototype.end = function (data, encoding, callback) {\n // Shift parameters if necessary\n if (typeof data === \"function\") {\n callback = data;\n data = encoding = null;\n }\n else if (typeof encoding === \"function\") {\n callback = encoding;\n encoding = null;\n }\n\n // Write data if needed and end\n if (!data) {\n this._ended = this._ending = true;\n this._currentRequest.end(null, null, callback);\n }\n else {\n var self = this;\n var currentRequest = this._currentRequest;\n this.write(data, encoding, function () {\n self._ended = true;\n currentRequest.end(null, null, callback);\n });\n this._ending = true;\n }\n};\n\n// Sets a header value on the current native request\nRedirectableRequest.prototype.setHeader = function (name, value) {\n this._options.headers[name] = value;\n this._currentRequest.setHeader(name, value);\n};\n\n// Clears a header value on the current native request\nRedirectableRequest.prototype.removeHeader = function (name) {\n delete this._options.headers[name];\n this._currentRequest.removeHeader(name);\n};\n\n// Global timeout for all underlying requests\nRedirectableRequest.prototype.setTimeout = function (msecs, callback) {\n var self = this;\n\n // Destroys the socket on timeout\n function destroyOnTimeout(socket) {\n socket.setTimeout(msecs);\n socket.removeListener(\"timeout\", socket.destroy);\n socket.addListener(\"timeout\", socket.destroy);\n }\n\n // Sets up a timer to trigger a timeout event\n function startTimer(socket) {\n if (self._timeout) {\n clearTimeout(self._timeout);\n }\n self._timeout = setTimeout(function () {\n self.emit(\"timeout\");\n clearTimer();\n }, msecs);\n destroyOnTimeout(socket);\n }\n\n // Stops a timeout from triggering\n function clearTimer() {\n // Clear the timeout\n if (self._timeout) {\n clearTimeout(self._timeout);\n self._timeout = null;\n }\n\n // Clean up all attached listeners\n self.removeListener(\"abort\", clearTimer);\n self.removeListener(\"error\", clearTimer);\n self.removeListener(\"response\", clearTimer);\n if (callback) {\n self.removeListener(\"timeout\", callback);\n }\n if (!self.socket) {\n self._currentRequest.removeListener(\"socket\", startTimer);\n }\n }\n\n // Attach callback if passed\n if (callback) {\n this.on(\"timeout\", callback);\n }\n\n // Start the timer if or when the socket is opened\n if (this.socket) {\n startTimer(this.socket);\n }\n else {\n this._currentRequest.once(\"socket\", startTimer);\n }\n\n // Clean up on events\n this.on(\"socket\", destroyOnTimeout);\n this.on(\"abort\", clearTimer);\n this.on(\"error\", clearTimer);\n this.on(\"response\", clearTimer);\n\n return this;\n};\n\n// Proxy all other public ClientRequest methods\n[\n \"flushHeaders\", \"getHeader\",\n \"setNoDelay\", \"setSocketKeepAlive\",\n].forEach(function (method) {\n RedirectableRequest.prototype[method] = function (a, b) {\n return this._currentRequest[method](a, b);\n };\n});\n\n// Proxy all public ClientRequest properties\n[\"aborted\", \"connection\", \"socket\"].forEach(function (property) {\n Object.defineProperty(RedirectableRequest.prototype, property, {\n get: function () { return this._currentRequest[property]; },\n });\n});\n\nRedirectableRequest.prototype._sanitizeOptions = function (options) {\n // Ensure headers are always present\n if (!options.headers) {\n options.headers = {};\n }\n\n // Since http.request treats host as an alias of hostname,\n // but the url module interprets host as hostname plus port,\n // eliminate the host property to avoid confusion.\n if (options.host) {\n // Use hostname if set, because it has precedence\n if (!options.hostname) {\n options.hostname = options.host;\n }\n delete options.host;\n }\n\n // Complete the URL object when necessary\n if (!options.pathname && options.path) {\n var searchPos = options.path.indexOf(\"?\");\n if (searchPos < 0) {\n options.pathname = options.path;\n }\n else {\n options.pathname = options.path.substring(0, searchPos);\n options.search = options.path.substring(searchPos);\n }\n }\n};\n\n\n// Executes the next native request (initial or redirect)\nRedirectableRequest.prototype._performRequest = function () {\n // Load the native protocol\n var protocol = this._options.protocol;\n var nativeProtocol = this._options.nativeProtocols[protocol];\n if (!nativeProtocol) {\n this.emit(\"error\", new TypeError(\"Unsupported protocol \" + protocol));\n return;\n }\n\n // If specified, use the agent corresponding to the protocol\n // (HTTP and HTTPS use different types of agents)\n if (this._options.agents) {\n var scheme = protocol.slice(0, -1);\n this._options.agent = this._options.agents[scheme];\n }\n\n // Create the native request and set up its event handlers\n var request = this._currentRequest =\n nativeProtocol.request(this._options, this._onNativeResponse);\n request._redirectable = this;\n for (var event of events) {\n request.on(event, eventHandlers[event]);\n }\n\n // RFC7230§5.3.1: When making a request directly to an origin server, […]\n // a client MUST send only the absolute path […] as the request-target.\n this._currentUrl = /^\\//.test(this._options.path) ?\n url.format(this._options) :\n // When making a request to a proxy, […]\n // a client MUST send the target URI in absolute-form […].\n this._currentUrl = this._options.path;\n\n // End a redirected request\n // (The first request must be ended explicitly with RedirectableRequest#end)\n if (this._isRedirect) {\n // Write the request entity and end\n var i = 0;\n var self = this;\n var buffers = this._requestBodyBuffers;\n (function writeNext(error) {\n // Only write if this request has not been redirected yet\n /* istanbul ignore else */\n if (request === self._currentRequest) {\n // Report any write errors\n /* istanbul ignore if */\n if (error) {\n self.emit(\"error\", error);\n }\n // Write the next buffer if there are still left\n else if (i < buffers.length) {\n var buffer = buffers[i++];\n /* istanbul ignore else */\n if (!request.finished) {\n request.write(buffer.data, buffer.encoding, writeNext);\n }\n }\n // End the request if `end` has been called on us\n else if (self._ended) {\n request.end();\n }\n }\n }());\n }\n};\n\n// Processes a response from the current native request\nRedirectableRequest.prototype._processResponse = function (response) {\n // Store the redirected response\n var statusCode = response.statusCode;\n if (this._options.trackRedirects) {\n this._redirects.push({\n url: this._currentUrl,\n headers: response.headers,\n statusCode: statusCode,\n });\n }\n\n // RFC7231§6.4: The 3xx (Redirection) class of status code indicates\n // that further action needs to be taken by the user agent in order to\n // fulfill the request. If a Location header field is provided,\n // the user agent MAY automatically redirect its request to the URI\n // referenced by the Location field value,\n // even if the specific status code is not understood.\n\n // If the response is not a redirect; return it as-is\n var location = response.headers.location;\n if (!location || this._options.followRedirects === false ||\n statusCode < 300 || statusCode >= 400) {\n response.responseUrl = this._currentUrl;\n response.redirects = this._redirects;\n this.emit(\"response\", response);\n\n // Clean up\n this._requestBodyBuffers = [];\n return;\n }\n\n // The response is a redirect, so abort the current request\n abortRequest(this._currentRequest);\n // Discard the remainder of the response to avoid waiting for data\n response.destroy();\n\n // RFC7231§6.4: A client SHOULD detect and intervene\n // in cyclical redirections (i.e., \"infinite\" redirection loops).\n if (++this._redirectCount > this._options.maxRedirects) {\n this.emit(\"error\", new TooManyRedirectsError());\n return;\n }\n\n // Store the request headers if applicable\n var requestHeaders;\n var beforeRedirect = this._options.beforeRedirect;\n if (beforeRedirect) {\n requestHeaders = Object.assign({\n // The Host header was set by nativeProtocol.request\n Host: response.req.getHeader(\"host\"),\n }, this._options.headers);\n }\n\n // RFC7231§6.4: Automatic redirection needs to done with\n // care for methods not known to be safe, […]\n // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change\n // the request method from POST to GET for the subsequent request.\n var method = this._options.method;\n if ((statusCode === 301 || statusCode === 302) && this._options.method === \"POST\" ||\n // RFC7231§6.4.4: The 303 (See Other) status code indicates that\n // the server is redirecting the user agent to a different resource […]\n // A user agent can perform a retrieval request targeting that URI\n // (a GET or HEAD request if using HTTP) […]\n (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {\n this._options.method = \"GET\";\n // Drop a possible entity and headers related to it\n this._requestBodyBuffers = [];\n removeMatchingHeaders(/^content-/i, this._options.headers);\n }\n\n // Drop the Host header, as the redirect might lead to a different host\n var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);\n\n // If the redirect is relative, carry over the host of the last request\n var currentUrlParts = url.parse(this._currentUrl);\n var currentHost = currentHostHeader || currentUrlParts.host;\n var currentUrl = /^\\w+:/.test(location) ? this._currentUrl :\n url.format(Object.assign(currentUrlParts, { host: currentHost }));\n\n // Determine the URL of the redirection\n var redirectUrl;\n try {\n redirectUrl = url.resolve(currentUrl, location);\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError(cause));\n return;\n }\n\n // Create the redirected request\n debug(\"redirecting to\", redirectUrl);\n this._isRedirect = true;\n var redirectUrlParts = url.parse(redirectUrl);\n Object.assign(this._options, redirectUrlParts);\n\n // Drop confidential headers when redirecting to a less secure protocol\n // or to a different domain that is not a superdomain\n if (redirectUrlParts.protocol !== currentUrlParts.protocol &&\n redirectUrlParts.protocol !== \"https:\" ||\n redirectUrlParts.host !== currentHost &&\n !isSubdomain(redirectUrlParts.host, currentHost)) {\n removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);\n }\n\n // Evaluate the beforeRedirect callback\n if (typeof beforeRedirect === \"function\") {\n var responseDetails = {\n headers: response.headers,\n statusCode: statusCode,\n };\n var requestDetails = {\n url: currentUrl,\n method: method,\n headers: requestHeaders,\n };\n try {\n beforeRedirect(this._options, responseDetails, requestDetails);\n }\n catch (err) {\n this.emit(\"error\", err);\n return;\n }\n this._sanitizeOptions(this._options);\n }\n\n // Perform the redirected request\n try {\n this._performRequest();\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError(cause));\n }\n};\n\n// Wraps the key/value object of protocols with redirect functionality\nfunction wrap(protocols) {\n // Default settings\n var exports = {\n maxRedirects: 21,\n maxBodyLength: 10 * 1024 * 1024,\n };\n\n // Wrap each protocol\n var nativeProtocols = {};\n Object.keys(protocols).forEach(function (scheme) {\n var protocol = scheme + \":\";\n var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];\n var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);\n\n // Executes a request, following redirects\n function request(input, options, callback) {\n // Parse parameters\n if (typeof input === \"string\") {\n var urlStr = input;\n try {\n input = urlToOptions(new URL(urlStr));\n }\n catch (err) {\n /* istanbul ignore next */\n input = url.parse(urlStr);\n }\n }\n else if (URL && (input instanceof URL)) {\n input = urlToOptions(input);\n }\n else {\n callback = options;\n options = input;\n input = { protocol: protocol };\n }\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n\n // Set defaults\n options = Object.assign({\n maxRedirects: exports.maxRedirects,\n maxBodyLength: exports.maxBodyLength,\n }, input, options);\n options.nativeProtocols = nativeProtocols;\n\n assert.equal(options.protocol, protocol, \"protocol mismatch\");\n debug(\"options\", options);\n return new RedirectableRequest(options, callback);\n }\n\n // Executes a GET request, following redirects\n function get(input, options, callback) {\n var wrappedRequest = wrappedProtocol.request(input, options, callback);\n wrappedRequest.end();\n return wrappedRequest;\n }\n\n // Expose the properties on the wrapped protocol\n Object.defineProperties(wrappedProtocol, {\n request: { value: request, configurable: true, enumerable: true, writable: true },\n get: { value: get, configurable: true, enumerable: true, writable: true },\n });\n });\n return exports;\n}\n\n/* istanbul ignore next */\nfunction noop() { /* empty */ }\n\n// from https://github.com/nodejs/node/blob/master/lib/internal/url.js\nfunction urlToOptions(urlObject) {\n var options = {\n protocol: urlObject.protocol,\n hostname: urlObject.hostname.startsWith(\"[\") ?\n /* istanbul ignore next */\n urlObject.hostname.slice(1, -1) :\n urlObject.hostname,\n hash: urlObject.hash,\n search: urlObject.search,\n pathname: urlObject.pathname,\n path: urlObject.pathname + urlObject.search,\n href: urlObject.href,\n };\n if (urlObject.port !== \"\") {\n options.port = Number(urlObject.port);\n }\n return options;\n}\n\nfunction removeMatchingHeaders(regex, headers) {\n var lastValue;\n for (var header in headers) {\n if (regex.test(header)) {\n lastValue = headers[header];\n delete headers[header];\n }\n }\n return (lastValue === null || typeof lastValue === \"undefined\") ?\n undefined : String(lastValue).trim();\n}\n\nfunction createErrorType(code, defaultMessage) {\n function CustomError(cause) {\n Error.captureStackTrace(this, this.constructor);\n if (!cause) {\n this.message = defaultMessage;\n }\n else {\n this.message = defaultMessage + \": \" + cause.message;\n this.cause = cause;\n }\n }\n CustomError.prototype = new Error();\n CustomError.prototype.constructor = CustomError;\n CustomError.prototype.name = \"Error [\" + code + \"]\";\n CustomError.prototype.code = code;\n return CustomError;\n}\n\nfunction abortRequest(request) {\n for (var event of events) {\n request.removeListener(event, eventHandlers[event]);\n }\n request.on(\"error\", noop);\n request.abort();\n}\n\nfunction isSubdomain(subdomain, domain) {\n const dot = subdomain.length - domain.length - 1;\n return dot > 0 && subdomain[dot] === \".\" && subdomain.endsWith(domain);\n}\n\n// Exports\nmodule.exports = wrap({ http: http, https: https });\nmodule.exports.wrap = wrap;\n","var CombinedStream = require('combined-stream');\nvar util = require('util');\nvar path = require('path');\nvar http = require('http');\nvar https = require('https');\nvar parseUrl = require('url').parse;\nvar fs = require('fs');\nvar Stream = require('stream').Stream;\nvar mime = require('mime-types');\nvar asynckit = require('asynckit');\nvar populate = require('./populate.js');\n\n// Public API\nmodule.exports = FormData;\n\n// make it a Stream\nutil.inherits(FormData, CombinedStream);\n\n/**\n * Create readable \"multipart/form-data\" streams.\n * Can be used to submit forms\n * and file uploads to other web applications.\n *\n * @constructor\n * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream\n */\nfunction FormData(options) {\n if (!(this instanceof FormData)) {\n return new FormData(options);\n }\n\n this._overheadLength = 0;\n this._valueLength = 0;\n this._valuesToMeasure = [];\n\n CombinedStream.call(this);\n\n options = options || {};\n for (var option in options) {\n this[option] = options[option];\n }\n}\n\nFormData.LINE_BREAK = '\\r\\n';\nFormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';\n\nFormData.prototype.append = function(field, value, options) {\n\n options = options || {};\n\n // allow filename as single option\n if (typeof options == 'string') {\n options = {filename: options};\n }\n\n var append = CombinedStream.prototype.append.bind(this);\n\n // all that streamy business can't handle numbers\n if (typeof value == 'number') {\n value = '' + value;\n }\n\n // https://github.com/felixge/node-form-data/issues/38\n if (util.isArray(value)) {\n // Please convert your array into string\n // the way web server expects it\n this._error(new Error('Arrays are not supported.'));\n return;\n }\n\n var header = this._multiPartHeader(field, value, options);\n var footer = this._multiPartFooter();\n\n append(header);\n append(value);\n append(footer);\n\n // pass along options.knownLength\n this._trackLength(header, value, options);\n};\n\nFormData.prototype._trackLength = function(header, value, options) {\n var valueLength = 0;\n\n // used w/ getLengthSync(), when length is known.\n // e.g. for streaming directly from a remote server,\n // w/ a known file a size, and not wanting to wait for\n // incoming file to finish to get its size.\n if (options.knownLength != null) {\n valueLength += +options.knownLength;\n } else if (Buffer.isBuffer(value)) {\n valueLength = value.length;\n } else if (typeof value === 'string') {\n valueLength = Buffer.byteLength(value);\n }\n\n this._valueLength += valueLength;\n\n // @check why add CRLF? does this account for custom/multiple CRLFs?\n this._overheadLength +=\n Buffer.byteLength(header) +\n FormData.LINE_BREAK.length;\n\n // empty or either doesn't have path or not an http response or not a stream\n if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) {\n return;\n }\n\n // no need to bother with the length\n if (!options.knownLength) {\n this._valuesToMeasure.push(value);\n }\n};\n\nFormData.prototype._lengthRetriever = function(value, callback) {\n\n if (value.hasOwnProperty('fd')) {\n\n // take read range into a account\n // `end` = Infinity –> read file till the end\n //\n // TODO: Looks like there is bug in Node fs.createReadStream\n // it doesn't respect `end` options without `start` options\n // Fix it when node fixes it.\n // https://github.com/joyent/node/issues/7819\n if (value.end != undefined && value.end != Infinity && value.start != undefined) {\n\n // when end specified\n // no need to calculate range\n // inclusive, starts with 0\n callback(null, value.end + 1 - (value.start ? value.start : 0));\n\n // not that fast snoopy\n } else {\n // still need to fetch file size from fs\n fs.stat(value.path, function(err, stat) {\n\n var fileSize;\n\n if (err) {\n callback(err);\n return;\n }\n\n // update final size based on the range options\n fileSize = stat.size - (value.start ? value.start : 0);\n callback(null, fileSize);\n });\n }\n\n // or http response\n } else if (value.hasOwnProperty('httpVersion')) {\n callback(null, +value.headers['content-length']);\n\n // or request stream http://github.com/mikeal/request\n } else if (value.hasOwnProperty('httpModule')) {\n // wait till response come back\n value.on('response', function(response) {\n value.pause();\n callback(null, +response.headers['content-length']);\n });\n value.resume();\n\n // something else\n } else {\n callback('Unknown stream');\n }\n};\n\nFormData.prototype._multiPartHeader = function(field, value, options) {\n // custom header specified (as string)?\n // it becomes responsible for boundary\n // (e.g. to handle extra CRLFs on .NET servers)\n if (typeof options.header == 'string') {\n return options.header;\n }\n\n var contentDisposition = this._getContentDisposition(value, options);\n var contentType = this._getContentType(value, options);\n\n var contents = '';\n var headers = {\n // add custom disposition as third element or keep it two elements if not\n 'Content-Disposition': ['form-data', 'name=\"' + field + '\"'].concat(contentDisposition || []),\n // if no content type. allow it to be empty array\n 'Content-Type': [].concat(contentType || [])\n };\n\n // allow custom headers.\n if (typeof options.header == 'object') {\n populate(headers, options.header);\n }\n\n var header;\n for (var prop in headers) {\n if (!headers.hasOwnProperty(prop)) continue;\n header = headers[prop];\n\n // skip nullish headers.\n if (header == null) {\n continue;\n }\n\n // convert all headers to arrays.\n if (!Array.isArray(header)) {\n header = [header];\n }\n\n // add non-empty headers.\n if (header.length) {\n contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;\n }\n }\n\n return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;\n};\n\nFormData.prototype._getContentDisposition = function(value, options) {\n\n var filename\n , contentDisposition\n ;\n\n if (typeof options.filepath === 'string') {\n // custom filepath for relative paths\n filename = path.normalize(options.filepath).replace(/\\\\/g, '/');\n } else if (options.filename || value.name || value.path) {\n // custom filename take precedence\n // formidable and the browser add a name property\n // fs- and request- streams have path property\n filename = path.basename(options.filename || value.name || value.path);\n } else if (value.readable && value.hasOwnProperty('httpVersion')) {\n // or try http response\n filename = path.basename(value.client._httpMessage.path || '');\n }\n\n if (filename) {\n contentDisposition = 'filename=\"' + filename + '\"';\n }\n\n return contentDisposition;\n};\n\nFormData.prototype._getContentType = function(value, options) {\n\n // use custom content-type above all\n var contentType = options.contentType;\n\n // or try `name` from formidable, browser\n if (!contentType && value.name) {\n contentType = mime.lookup(value.name);\n }\n\n // or try `path` from fs-, request- streams\n if (!contentType && value.path) {\n contentType = mime.lookup(value.path);\n }\n\n // or if it's http-reponse\n if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {\n contentType = value.headers['content-type'];\n }\n\n // or guess it from the filepath or filename\n if (!contentType && (options.filepath || options.filename)) {\n contentType = mime.lookup(options.filepath || options.filename);\n }\n\n // fallback to the default content type if `value` is not simple value\n if (!contentType && typeof value == 'object') {\n contentType = FormData.DEFAULT_CONTENT_TYPE;\n }\n\n return contentType;\n};\n\nFormData.prototype._multiPartFooter = function() {\n return function(next) {\n var footer = FormData.LINE_BREAK;\n\n var lastPart = (this._streams.length === 0);\n if (lastPart) {\n footer += this._lastBoundary();\n }\n\n next(footer);\n }.bind(this);\n};\n\nFormData.prototype._lastBoundary = function() {\n return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;\n};\n\nFormData.prototype.getHeaders = function(userHeaders) {\n var header;\n var formHeaders = {\n 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()\n };\n\n for (header in userHeaders) {\n if (userHeaders.hasOwnProperty(header)) {\n formHeaders[header.toLowerCase()] = userHeaders[header];\n }\n }\n\n return formHeaders;\n};\n\nFormData.prototype.setBoundary = function(boundary) {\n this._boundary = boundary;\n};\n\nFormData.prototype.getBoundary = function() {\n if (!this._boundary) {\n this._generateBoundary();\n }\n\n return this._boundary;\n};\n\nFormData.prototype.getBuffer = function() {\n var dataBuffer = new Buffer.alloc( 0 );\n var boundary = this.getBoundary();\n\n // Create the form content. Add Line breaks to the end of data.\n for (var i = 0, len = this._streams.length; i < len; i++) {\n if (typeof this._streams[i] !== 'function') {\n\n // Add content to the buffer.\n if(Buffer.isBuffer(this._streams[i])) {\n dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]);\n }else {\n dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]);\n }\n\n // Add break after content.\n if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) {\n dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] );\n }\n }\n }\n\n // Add the footer and return the Buffer object.\n return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] );\n};\n\nFormData.prototype._generateBoundary = function() {\n // This generates a 50 character boundary similar to those used by Firefox.\n // They are optimized for boyer-moore parsing.\n var boundary = '--------------------------';\n for (var i = 0; i < 24; i++) {\n boundary += Math.floor(Math.random() * 10).toString(16);\n }\n\n this._boundary = boundary;\n};\n\n// Note: getLengthSync DOESN'T calculate streams length\n// As workaround one can calculate file size manually\n// and add it as knownLength option\nFormData.prototype.getLengthSync = function() {\n var knownLength = this._overheadLength + this._valueLength;\n\n // Don't get confused, there are 3 \"internal\" streams for each keyval pair\n // so it basically checks if there is any value added to the form\n if (this._streams.length) {\n knownLength += this._lastBoundary().length;\n }\n\n // https://github.com/form-data/form-data/issues/40\n if (!this.hasKnownLength()) {\n // Some async length retrievers are present\n // therefore synchronous length calculation is false.\n // Please use getLength(callback) to get proper length\n this._error(new Error('Cannot calculate proper length in synchronous way.'));\n }\n\n return knownLength;\n};\n\n// Public API to check if length of added values is known\n// https://github.com/form-data/form-data/issues/196\n// https://github.com/form-data/form-data/issues/262\nFormData.prototype.hasKnownLength = function() {\n var hasKnownLength = true;\n\n if (this._valuesToMeasure.length) {\n hasKnownLength = false;\n }\n\n return hasKnownLength;\n};\n\nFormData.prototype.getLength = function(cb) {\n var knownLength = this._overheadLength + this._valueLength;\n\n if (this._streams.length) {\n knownLength += this._lastBoundary().length;\n }\n\n if (!this._valuesToMeasure.length) {\n process.nextTick(cb.bind(this, null, knownLength));\n return;\n }\n\n asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {\n if (err) {\n cb(err);\n return;\n }\n\n values.forEach(function(length) {\n knownLength += length;\n });\n\n cb(null, knownLength);\n });\n};\n\nFormData.prototype.submit = function(params, cb) {\n var request\n , options\n , defaults = {method: 'post'}\n ;\n\n // parse provided url if it's string\n // or treat it as options object\n if (typeof params == 'string') {\n\n params = parseUrl(params);\n options = populate({\n port: params.port,\n path: params.pathname,\n host: params.hostname,\n protocol: params.protocol\n }, defaults);\n\n // use custom params\n } else {\n\n options = populate(params, defaults);\n // if no port provided use default one\n if (!options.port) {\n options.port = options.protocol == 'https:' ? 443 : 80;\n }\n }\n\n // put that good code in getHeaders to some use\n options.headers = this.getHeaders(params.headers);\n\n // https if specified, fallback to http in any other case\n if (options.protocol == 'https:') {\n request = https.request(options);\n } else {\n request = http.request(options);\n }\n\n // get content length and fire away\n this.getLength(function(err, length) {\n if (err && err !== 'Unknown stream') {\n this._error(err);\n return;\n }\n\n // add content length\n if (length) {\n request.setHeader('Content-Length', length);\n }\n\n this.pipe(request);\n if (cb) {\n var onResponse;\n\n var callback = function (error, responce) {\n request.removeListener('error', callback);\n request.removeListener('response', onResponse);\n\n return cb.call(this, error, responce);\n };\n\n onResponse = callback.bind(this, null);\n\n request.on('error', callback);\n request.on('response', onResponse);\n }\n }.bind(this));\n\n return request;\n};\n\nFormData.prototype._error = function(err) {\n if (!this.error) {\n this.error = err;\n this.pause();\n this.emit('error', err);\n }\n};\n\nFormData.prototype.toString = function () {\n return '[object FormData]';\n};\n","// populates missing values\nmodule.exports = function(dst, src) {\n\n Object.keys(src).forEach(function(prop)\n {\n dst[prop] = dst[prop] || src[prop];\n });\n\n return dst;\n};\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst net_1 = __importDefault(require(\"net\"));\nconst tls_1 = __importDefault(require(\"tls\"));\nconst url_1 = __importDefault(require(\"url\"));\nconst assert_1 = __importDefault(require(\"assert\"));\nconst debug_1 = __importDefault(require(\"debug\"));\nconst agent_base_1 = require(\"agent-base\");\nconst parse_proxy_response_1 = __importDefault(require(\"./parse-proxy-response\"));\nconst debug = debug_1.default('https-proxy-agent:agent');\n/**\n * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to\n * the specified \"HTTP(s) proxy server\" in order to proxy HTTPS requests.\n *\n * Outgoing HTTP requests are first tunneled through the proxy server using the\n * `CONNECT` HTTP request method to establish a connection to the proxy server,\n * and then the proxy server connects to the destination target and issues the\n * HTTP request from the proxy server.\n *\n * `https:` requests have their socket connection upgraded to TLS once\n * the connection to the proxy server has been established.\n *\n * @api public\n */\nclass HttpsProxyAgent extends agent_base_1.Agent {\n constructor(_opts) {\n let opts;\n if (typeof _opts === 'string') {\n opts = url_1.default.parse(_opts);\n }\n else {\n opts = _opts;\n }\n if (!opts) {\n throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!');\n }\n debug('creating new HttpsProxyAgent instance: %o', opts);\n super(opts);\n const proxy = Object.assign({}, opts);\n // If `true`, then connect to the proxy server over TLS.\n // Defaults to `false`.\n this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol);\n // Prefer `hostname` over `host`, and set the `port` if needed.\n proxy.host = proxy.hostname || proxy.host;\n if (typeof proxy.port === 'string') {\n proxy.port = parseInt(proxy.port, 10);\n }\n if (!proxy.port && proxy.host) {\n proxy.port = this.secureProxy ? 443 : 80;\n }\n // ALPN is supported by Node.js >= v5.\n // attempt to negotiate http/1.1 for proxy servers that support http/2\n if (this.secureProxy && !('ALPNProtocols' in proxy)) {\n proxy.ALPNProtocols = ['http 1.1'];\n }\n if (proxy.host && proxy.path) {\n // If both a `host` and `path` are specified then it's most likely\n // the result of a `url.parse()` call... we need to remove the\n // `path` portion so that `net.connect()` doesn't attempt to open\n // that as a Unix socket file.\n delete proxy.path;\n delete proxy.pathname;\n }\n this.proxy = proxy;\n }\n /**\n * Called when the node-core HTTP client library is creating a\n * new HTTP request.\n *\n * @api protected\n */\n callback(req, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n const { proxy, secureProxy } = this;\n // Create a socket connection to the proxy server.\n let socket;\n if (secureProxy) {\n debug('Creating `tls.Socket`: %o', proxy);\n socket = tls_1.default.connect(proxy);\n }\n else {\n debug('Creating `net.Socket`: %o', proxy);\n socket = net_1.default.connect(proxy);\n }\n const headers = Object.assign({}, proxy.headers);\n const hostname = `${opts.host}:${opts.port}`;\n let payload = `CONNECT ${hostname} HTTP/1.1\\r\\n`;\n // Inject the `Proxy-Authorization` header if necessary.\n if (proxy.auth) {\n headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`;\n }\n // The `Host` header should only include the port\n // number when it is not the default port.\n let { host, port, secureEndpoint } = opts;\n if (!isDefaultPort(port, secureEndpoint)) {\n host += `:${port}`;\n }\n headers.Host = host;\n headers.Connection = 'close';\n for (const name of Object.keys(headers)) {\n payload += `${name}: ${headers[name]}\\r\\n`;\n }\n const proxyResponsePromise = parse_proxy_response_1.default(socket);\n socket.write(`${payload}\\r\\n`);\n const { statusCode, buffered } = yield proxyResponsePromise;\n if (statusCode === 200) {\n req.once('socket', resume);\n if (opts.secureEndpoint) {\n // The proxy is connecting to a TLS server, so upgrade\n // this socket connection to a TLS connection.\n debug('Upgrading socket connection to TLS');\n const servername = opts.servername || opts.host;\n return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,\n servername }));\n }\n return socket;\n }\n // Some other status code that's not 200... need to re-play the HTTP\n // header \"data\" events onto the socket once the HTTP machinery is\n // attached so that the node core `http` can parse and handle the\n // error status code.\n // Close the original socket, and a new \"fake\" socket is returned\n // instead, so that the proxy doesn't get the HTTP request\n // written to it (which may contain `Authorization` headers or other\n // sensitive data).\n //\n // See: https://hackerone.com/reports/541502\n socket.destroy();\n const fakeSocket = new net_1.default.Socket({ writable: false });\n fakeSocket.readable = true;\n // Need to wait for the \"socket\" event to re-play the \"data\" events.\n req.once('socket', (s) => {\n debug('replaying proxy buffer for failed request');\n assert_1.default(s.listenerCount('data') > 0);\n // Replay the \"buffered\" Buffer onto the fake `socket`, since at\n // this point the HTTP module machinery has been hooked up for\n // the user.\n s.push(buffered);\n s.push(null);\n });\n return fakeSocket;\n });\n }\n}\nexports.default = HttpsProxyAgent;\nfunction resume(socket) {\n socket.resume();\n}\nfunction isDefaultPort(port, secure) {\n return Boolean((!secure && port === 80) || (secure && port === 443));\n}\nfunction isHTTPS(protocol) {\n return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false;\n}\nfunction omit(obj, ...keys) {\n const ret = {};\n let key;\n for (key in obj) {\n if (!keys.includes(key)) {\n ret[key] = obj[key];\n }\n }\n return ret;\n}\n//# sourceMappingURL=agent.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nconst agent_1 = __importDefault(require(\"./agent\"));\nfunction createHttpsProxyAgent(opts) {\n return new agent_1.default(opts);\n}\n(function (createHttpsProxyAgent) {\n createHttpsProxyAgent.HttpsProxyAgent = agent_1.default;\n createHttpsProxyAgent.prototype = agent_1.default.prototype;\n})(createHttpsProxyAgent || (createHttpsProxyAgent = {}));\nmodule.exports = createHttpsProxyAgent;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst debug_1 = __importDefault(require(\"debug\"));\nconst debug = debug_1.default('https-proxy-agent:parse-proxy-response');\nfunction parseProxyResponse(socket) {\n return new Promise((resolve, reject) => {\n // we need to buffer any HTTP traffic that happens with the proxy before we get\n // the CONNECT response, so that if the response is anything other than an \"200\"\n // response code, then we can re-play the \"data\" events on the socket once the\n // HTTP parser is hooked up...\n let buffersLength = 0;\n const buffers = [];\n function read() {\n const b = socket.read();\n if (b)\n ondata(b);\n else\n socket.once('readable', read);\n }\n function cleanup() {\n socket.removeListener('end', onend);\n socket.removeListener('error', onerror);\n socket.removeListener('close', onclose);\n socket.removeListener('readable', read);\n }\n function onclose(err) {\n debug('onclose had error %o', err);\n }\n function onend() {\n debug('onend');\n }\n function onerror(err) {\n cleanup();\n debug('onerror %o', err);\n reject(err);\n }\n function ondata(b) {\n buffers.push(b);\n buffersLength += b.length;\n const buffered = Buffer.concat(buffers, buffersLength);\n const endOfHeaders = buffered.indexOf('\\r\\n\\r\\n');\n if (endOfHeaders === -1) {\n // keep buffering\n debug('have not received end of HTTP headers yet...');\n read();\n return;\n }\n const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\\r\\n'));\n const statusCode = +firstLine.split(' ')[1];\n debug('got proxy server response: %o', firstLine);\n resolve({\n statusCode,\n buffered\n });\n }\n socket.on('error', onerror);\n socket.on('close', onclose);\n socket.on('end', onend);\n read();\n });\n}\nexports.default = parseProxyResponse;\n//# sourceMappingURL=parse-proxy-response.js.map","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/*!\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObject(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nfunction isPlainObject(o) {\n var ctor,prot;\n\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n\nexports.isPlainObject = isPlainObject;\n","/*!\n * mime-db\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n/**\n * Module exports.\n */\n\nmodule.exports = require('./db.json')\n","/*!\n * mime-types\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar db = require('mime-db')\nvar extname = require('path').extname\n\n/**\n * Module variables.\n * @private\n */\n\nvar EXTRACT_TYPE_REGEXP = /^\\s*([^;\\s]*)(?:;|\\s|$)/\nvar TEXT_TYPE_REGEXP = /^text\\//i\n\n/**\n * Module exports.\n * @public\n */\n\nexports.charset = charset\nexports.charsets = { lookup: charset }\nexports.contentType = contentType\nexports.extension = extension\nexports.extensions = Object.create(null)\nexports.lookup = lookup\nexports.types = Object.create(null)\n\n// Populate the extensions/types maps\npopulateMaps(exports.extensions, exports.types)\n\n/**\n * Get the default charset for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction charset (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n var mime = match && db[match[1].toLowerCase()]\n\n if (mime && mime.charset) {\n return mime.charset\n }\n\n // default text/* to utf-8\n if (match && TEXT_TYPE_REGEXP.test(match[1])) {\n return 'UTF-8'\n }\n\n return false\n}\n\n/**\n * Create a full Content-Type header given a MIME type or extension.\n *\n * @param {string} str\n * @return {boolean|string}\n */\n\nfunction contentType (str) {\n // TODO: should this even be in this module?\n if (!str || typeof str !== 'string') {\n return false\n }\n\n var mime = str.indexOf('/') === -1\n ? exports.lookup(str)\n : str\n\n if (!mime) {\n return false\n }\n\n // TODO: use content-type or other module\n if (mime.indexOf('charset') === -1) {\n var charset = exports.charset(mime)\n if (charset) mime += '; charset=' + charset.toLowerCase()\n }\n\n return mime\n}\n\n/**\n * Get the default extension for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction extension (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n\n // get extensions\n var exts = match && exports.extensions[match[1].toLowerCase()]\n\n if (!exts || !exts.length) {\n return false\n }\n\n return exts[0]\n}\n\n/**\n * Lookup the MIME type for a file path/extension.\n *\n * @param {string} path\n * @return {boolean|string}\n */\n\nfunction lookup (path) {\n if (!path || typeof path !== 'string') {\n return false\n }\n\n // get the extension (\"ext\" or \".ext\" or full path)\n var extension = extname('x.' + path)\n .toLowerCase()\n .substr(1)\n\n if (!extension) {\n return false\n }\n\n return exports.types[extension] || false\n}\n\n/**\n * Populate the extensions and types maps.\n * @private\n */\n\nfunction populateMaps (extensions, types) {\n // source preference (least -> most)\n var preference = ['nginx', 'apache', undefined, 'iana']\n\n Object.keys(db).forEach(function forEachMimeType (type) {\n var mime = db[type]\n var exts = mime.extensions\n\n if (!exts || !exts.length) {\n return\n }\n\n // mime -> extensions\n extensions[type] = exts\n\n // extension -> mime\n for (var i = 0; i < exts.length; i++) {\n var extension = exts[i]\n\n if (types[extension]) {\n var from = preference.indexOf(db[types[extension]].source)\n var to = preference.indexOf(mime.source)\n\n if (types[extension] !== 'application/octet-stream' &&\n (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {\n // skip the remapping\n continue\n }\n }\n\n // set the extension -> mime\n types[extension] = type\n }\n })\n}\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar Stream = _interopDefault(require('stream'));\nvar http = _interopDefault(require('http'));\nvar Url = _interopDefault(require('url'));\nvar whatwgUrl = _interopDefault(require('whatwg-url'));\nvar https = _interopDefault(require('https'));\nvar zlib = _interopDefault(require('zlib'));\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\nconst URL = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\n/**\n * Wrapper around `new URL` to handle arbitrary URLs\n *\n * @param {string} urlStr\n * @return {void}\n */\nfunction parseURL(urlStr) {\n\t/*\n \tCheck whether the URL is absolute or not\n \t\tScheme: https://tools.ietf.org/html/rfc3986#section-3.1\n \tAbsolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\n */\n\tif (/^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.exec(urlStr)) {\n\t\turlStr = new URL(urlStr).toString();\n\t}\n\n\t// Fallback to old implementation for arbitrary URLs\n\treturn parse_url(urlStr);\n}\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parseURL(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parseURL(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parseURL(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\nconst URL$1 = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\n\nconst isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {\n\tconst orig = new URL$1(original).hostname;\n\tconst dest = new URL$1(destination).hostname;\n\n\treturn orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);\n};\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tlet locationURL = null;\n\t\t\t\ttry {\n\t\t\t\t\tlocationURL = location === null ? null : new URL$1(location, request.url).toString();\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// error here can only be invalid URL in Location: header\n\t\t\t\t\t// do not throw when options.redirect == manual\n\t\t\t\t\t// let the user extract the errorneous redirect URL\n\t\t\t\t\tif (request.redirect !== 'manual') {\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (!isDomainOrSubdomain(request.url, locationURL)) {\n\t\t\t\t\t\t\tfor (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {\n\t\t\t\t\t\t\t\trequestOpts.headers.delete(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nmodule.exports = exports = fetch;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = exports;\nexports.Headers = Headers;\nexports.Request = Request;\nexports.Response = Response;\nexports.FetchError = FetchError;\n","var wrappy = require('wrappy')\nmodule.exports = wrappy(once)\nmodule.exports.strict = wrappy(onceStrict)\n\nonce.proto = once(function () {\n Object.defineProperty(Function.prototype, 'once', {\n value: function () {\n return once(this)\n },\n configurable: true\n })\n\n Object.defineProperty(Function.prototype, 'onceStrict', {\n value: function () {\n return onceStrict(this)\n },\n configurable: true\n })\n})\n\nfunction once (fn) {\n var f = function () {\n if (f.called) return f.value\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n f.called = false\n return f\n}\n\nfunction onceStrict (fn) {\n var f = function () {\n if (f.called)\n throw new Error(f.onceError)\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n var name = fn.name || 'Function wrapped with `once`'\n f.onceError = name + \" shouldn't be called more than once\"\n f.called = false\n return f\n}\n","'use strict';\n\nvar parseUrl = require('url').parse;\n\nvar DEFAULT_PORTS = {\n ftp: 21,\n gopher: 70,\n http: 80,\n https: 443,\n ws: 80,\n wss: 443,\n};\n\nvar stringEndsWith = String.prototype.endsWith || function(s) {\n return s.length <= this.length &&\n this.indexOf(s, this.length - s.length) !== -1;\n};\n\n/**\n * @param {string|object} url - The URL, or the result from url.parse.\n * @return {string} The URL of the proxy that should handle the request to the\n * given URL. If no proxy is set, this will be an empty string.\n */\nfunction getProxyForUrl(url) {\n var parsedUrl = typeof url === 'string' ? parseUrl(url) : url || {};\n var proto = parsedUrl.protocol;\n var hostname = parsedUrl.host;\n var port = parsedUrl.port;\n if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') {\n return ''; // Don't proxy URLs without a valid scheme or host.\n }\n\n proto = proto.split(':', 1)[0];\n // Stripping ports in this way instead of using parsedUrl.hostname to make\n // sure that the brackets around IPv6 addresses are kept.\n hostname = hostname.replace(/:\\d*$/, '');\n port = parseInt(port) || DEFAULT_PORTS[proto] || 0;\n if (!shouldProxy(hostname, port)) {\n return ''; // Don't proxy URLs that match NO_PROXY.\n }\n\n var proxy =\n getEnv('npm_config_' + proto + '_proxy') ||\n getEnv(proto + '_proxy') ||\n getEnv('npm_config_proxy') ||\n getEnv('all_proxy');\n if (proxy && proxy.indexOf('://') === -1) {\n // Missing scheme in proxy, default to the requested URL's scheme.\n proxy = proto + '://' + proxy;\n }\n return proxy;\n}\n\n/**\n * Determines whether a given URL should be proxied.\n *\n * @param {string} hostname - The host name of the URL.\n * @param {number} port - The effective port of the URL.\n * @returns {boolean} Whether the given URL should be proxied.\n * @private\n */\nfunction shouldProxy(hostname, port) {\n var NO_PROXY =\n (getEnv('npm_config_no_proxy') || getEnv('no_proxy')).toLowerCase();\n if (!NO_PROXY) {\n return true; // Always proxy if NO_PROXY is not set.\n }\n if (NO_PROXY === '*') {\n return false; // Never proxy if wildcard is set.\n }\n\n return NO_PROXY.split(/[,\\s]/).every(function(proxy) {\n if (!proxy) {\n return true; // Skip zero-length hosts.\n }\n var parsedProxy = proxy.match(/^(.+):(\\d+)$/);\n var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;\n var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;\n if (parsedProxyPort && parsedProxyPort !== port) {\n return true; // Skip if ports don't match.\n }\n\n if (!/^[.*]/.test(parsedProxyHostname)) {\n // No wildcards, so stop proxying if there is an exact match.\n return hostname !== parsedProxyHostname;\n }\n\n if (parsedProxyHostname.charAt(0) === '*') {\n // Remove leading wildcard.\n parsedProxyHostname = parsedProxyHostname.slice(1);\n }\n // Stop proxying if the hostname ends with the no_proxy host.\n return !stringEndsWith.call(hostname, parsedProxyHostname);\n });\n}\n\n/**\n * Get the value for an environment variable.\n *\n * @param {string} key - The name of the environment variable.\n * @return {string} The value of the environment variable.\n * @private\n */\nfunction getEnv(key) {\n return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || '';\n}\n\nexports.getProxyForUrl = getProxyForUrl;\n","/* global window, exports, define */\n\n!function() {\n 'use strict'\n\n var re = {\n not_string: /[^s]/,\n not_bool: /[^t]/,\n not_type: /[^T]/,\n not_primitive: /[^v]/,\n number: /[diefg]/,\n numeric_arg: /[bcdiefguxX]/,\n json: /[j]/,\n not_json: /[^j]/,\n text: /^[^\\x25]+/,\n modulo: /^\\x25{2}/,\n placeholder: /^\\x25(?:([1-9]\\d*)\\$|\\(([^)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijostTuvxX])/,\n key: /^([a-z_][a-z_\\d]*)/i,\n key_access: /^\\.([a-z_][a-z_\\d]*)/i,\n index_access: /^\\[(\\d+)\\]/,\n sign: /^[+-]/\n }\n\n function sprintf(key) {\n // `arguments` is not an array, but should be fine for this call\n return sprintf_format(sprintf_parse(key), arguments)\n }\n\n function vsprintf(fmt, argv) {\n return sprintf.apply(null, [fmt].concat(argv || []))\n }\n\n function sprintf_format(parse_tree, argv) {\n var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign\n for (i = 0; i < tree_length; i++) {\n if (typeof parse_tree[i] === 'string') {\n output += parse_tree[i]\n }\n else if (typeof parse_tree[i] === 'object') {\n ph = parse_tree[i] // convenience purposes only\n if (ph.keys) { // keyword argument\n arg = argv[cursor]\n for (k = 0; k < ph.keys.length; k++) {\n if (arg == undefined) {\n throw new Error(sprintf('[sprintf] Cannot access property \"%s\" of undefined value \"%s\"', ph.keys[k], ph.keys[k-1]))\n }\n arg = arg[ph.keys[k]]\n }\n }\n else if (ph.param_no) { // positional argument (explicit)\n arg = argv[ph.param_no]\n }\n else { // positional argument (implicit)\n arg = argv[cursor++]\n }\n\n if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {\n arg = arg()\n }\n\n if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) {\n throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg))\n }\n\n if (re.number.test(ph.type)) {\n is_positive = arg >= 0\n }\n\n switch (ph.type) {\n case 'b':\n arg = parseInt(arg, 10).toString(2)\n break\n case 'c':\n arg = String.fromCharCode(parseInt(arg, 10))\n break\n case 'd':\n case 'i':\n arg = parseInt(arg, 10)\n break\n case 'j':\n arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0)\n break\n case 'e':\n arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential()\n break\n case 'f':\n arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg)\n break\n case 'g':\n arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg)\n break\n case 'o':\n arg = (parseInt(arg, 10) >>> 0).toString(8)\n break\n case 's':\n arg = String(arg)\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 't':\n arg = String(!!arg)\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'T':\n arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'u':\n arg = parseInt(arg, 10) >>> 0\n break\n case 'v':\n arg = arg.valueOf()\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'x':\n arg = (parseInt(arg, 10) >>> 0).toString(16)\n break\n case 'X':\n arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()\n break\n }\n if (re.json.test(ph.type)) {\n output += arg\n }\n else {\n if (re.number.test(ph.type) && (!is_positive || ph.sign)) {\n sign = is_positive ? '+' : '-'\n arg = arg.toString().replace(re.sign, '')\n }\n else {\n sign = ''\n }\n pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' '\n pad_length = ph.width - (sign + arg).length\n pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''\n output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)\n }\n }\n }\n return output\n }\n\n var sprintf_cache = Object.create(null)\n\n function sprintf_parse(fmt) {\n if (sprintf_cache[fmt]) {\n return sprintf_cache[fmt]\n }\n\n var _fmt = fmt, match, parse_tree = [], arg_names = 0\n while (_fmt) {\n if ((match = re.text.exec(_fmt)) !== null) {\n parse_tree.push(match[0])\n }\n else if ((match = re.modulo.exec(_fmt)) !== null) {\n parse_tree.push('%')\n }\n else if ((match = re.placeholder.exec(_fmt)) !== null) {\n if (match[2]) {\n arg_names |= 1\n var field_list = [], replacement_field = match[2], field_match = []\n if ((field_match = re.key.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\n if ((field_match = re.key_access.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n }\n else if ((field_match = re.index_access.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n }\n else {\n throw new SyntaxError('[sprintf] failed to parse named argument key')\n }\n }\n }\n else {\n throw new SyntaxError('[sprintf] failed to parse named argument key')\n }\n match[2] = field_list\n }\n else {\n arg_names |= 2\n }\n if (arg_names === 3) {\n throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')\n }\n\n parse_tree.push(\n {\n placeholder: match[0],\n param_no: match[1],\n keys: match[2],\n sign: match[3],\n pad_char: match[4],\n align: match[5],\n width: match[6],\n precision: match[7],\n type: match[8]\n }\n )\n }\n else {\n throw new SyntaxError('[sprintf] unexpected placeholder')\n }\n _fmt = _fmt.substring(match[0].length)\n }\n return sprintf_cache[fmt] = parse_tree\n }\n\n /**\n * export to either browser or node.js\n */\n /* eslint-disable quote-props */\n if (typeof exports !== 'undefined') {\n exports['sprintf'] = sprintf\n exports['vsprintf'] = vsprintf\n }\n if (typeof window !== 'undefined') {\n window['sprintf'] = sprintf\n window['vsprintf'] = vsprintf\n\n if (typeof define === 'function' && define['amd']) {\n define(function() {\n return {\n 'sprintf': sprintf,\n 'vsprintf': vsprintf\n }\n })\n }\n }\n /* eslint-enable quote-props */\n}(); // eslint-disable-line\n","'use strict';\n// @ts-check\n// ==================================================================================\n// audio.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 16. audio\n// ----------------------------------------------------------------------------------\n\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst util = require('./util');\n// const fs = require('fs');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nfunction parseAudioType(str, input, output) {\n let result = '';\n\n if (str.indexOf('speak') >= 0) { result = 'Speaker'; }\n if (str.indexOf('laut') >= 0) { result = 'Speaker'; }\n if (str.indexOf('loud') >= 0) { result = 'Speaker'; }\n if (str.indexOf('head') >= 0) { result = 'Headset'; }\n if (str.indexOf('mic') >= 0) { result = 'Microphone'; }\n if (str.indexOf('mikr') >= 0) { result = 'Microphone'; }\n if (str.indexOf('phone') >= 0) { result = 'Phone'; }\n if (str.indexOf('controll') >= 0) { result = 'Controller'; }\n if (str.indexOf('line o') >= 0) { result = 'Line Out'; }\n if (str.indexOf('digital o') >= 0) { result = 'Digital Out'; }\n\n if (!result && output) {\n result = 'Speaker';\n } else if (!result && input) {\n result = 'Microphone';\n }\n return result;\n}\n\n\nfunction getLinuxAudioPci() {\n let cmd = 'lspci -v 2>/dev/null';\n let result = [];\n try {\n const parts = execSync(cmd).toString().split('\\n\\n');\n for (let i = 0; i < parts.length; i++) {\n const lines = parts[i].split('\\n');\n if (lines && lines.length && lines[0].toLowerCase().indexOf('audio') >= 0) {\n const audio = {};\n audio.slotId = lines[0].split(' ')[0];\n audio.driver = util.getValue(lines, 'Kernel driver in use', ':', true) || util.getValue(lines, 'Kernel modules', ':', true);\n result.push(audio);\n }\n }\n return result;\n } catch (e) {\n return result;\n }\n}\n\nfunction parseLinuxAudioPciMM(lines, audioPCI) {\n const result = {};\n const slotId = util.getValue(lines, 'Slot');\n\n const pciMatch = audioPCI.filter(function (item) { return item.slotId === slotId; });\n\n result.id = slotId;\n result.name = util.getValue(lines, 'SDevice');\n // result.type = util.getValue(lines, 'Class');\n result.manufacturer = util.getValue(lines, 'SVendor');\n result.revision = util.getValue(lines, 'Rev');\n result.driver = pciMatch && pciMatch.length === 1 && pciMatch[0].driver ? pciMatch[0].driver : '';\n result.default = null;\n result.channel = 'PCIe';\n result.type = parseAudioType(result.name, null, null);\n result.in = null;\n result.out = null;\n result.status = 'online';\n\n return result;\n}\n\nfunction parseDarwinChannel(str) {\n let result = '';\n\n if (str.indexOf('builtin') >= 0) { result = 'Built-In'; }\n if (str.indexOf('extern') >= 0) { result = 'Audio-Jack'; }\n if (str.indexOf('hdmi') >= 0) { result = 'HDMI'; }\n if (str.indexOf('displayport') >= 0) { result = 'Display-Port'; }\n if (str.indexOf('usb') >= 0) { result = 'USB'; }\n if (str.indexOf('pci') >= 0) { result = 'PCIe'; }\n\n return result;\n}\n\nfunction parseDarwinAudio(audioObject, id) {\n const result = {};\n const channelStr = ((audioObject.coreaudio_device_transport || '') + ' ' + (audioObject._name || '')).toLowerCase();\n\n result.id = id;\n result.name = audioObject._name;\n result.manufacturer = audioObject.coreaudio_device_manufacturer;\n result.revision = null;\n result.driver = null;\n result.default = !!(audioObject.coreaudio_default_audio_input_device || '') || !!(audioObject.coreaudio_default_audio_output_device || '');\n result.channel = parseDarwinChannel(channelStr);\n result.type = parseAudioType(result.name, !!(audioObject.coreaudio_device_input || ''), !!(audioObject.coreaudio_device_output || ''));\n result.in = !!(audioObject.coreaudio_device_input || '');\n result.out = !!(audioObject.coreaudio_device_output || '');\n result.status = 'online';\n\n return result;\n}\n\nfunction parseWindowsAudio(lines) {\n const result = {};\n const status = util.getValue(lines, 'StatusInfo', ':');\n // const description = util.getValue(lines, 'Description', ':');\n\n result.id = util.getValue(lines, 'DeviceID', ':'); // PNPDeviceID??\n result.name = util.getValue(lines, 'name', ':');\n result.manufacturer = util.getValue(lines, 'manufacturer', ':');\n result.revision = null;\n result.driver = null;\n result.default = null;\n result.channel = null;\n result.type = parseAudioType(result.name, null, null);\n result.in = null;\n result.out = null;\n result.status = status;\n\n return result;\n}\n\nfunction audio(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = [];\n if (_linux || _freebsd || _openbsd || _netbsd) {\n let cmd = 'lspci -vmm 2>/dev/null';\n exec(cmd, function (error, stdout) {\n // PCI\n if (!error) {\n const audioPCI = getLinuxAudioPci();\n const parts = stdout.toString().split('\\n\\n');\n for (let i = 0; i < parts.length; i++) {\n const lines = parts[i].split('\\n');\n if (util.getValue(lines, 'class', ':', true).toLowerCase().indexOf('audio') >= 0) {\n const audio = parseLinuxAudioPciMM(lines, audioPCI);\n result.push(audio);\n }\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_darwin) {\n let cmd = 'system_profiler SPAudioDataType -json';\n exec(cmd, function (error, stdout) {\n if (!error) {\n try {\n const outObj = JSON.parse(stdout.toString());\n if (outObj.SPAudioDataType && outObj.SPAudioDataType.length && outObj.SPAudioDataType[0] && outObj.SPAudioDataType[0]['_items'] && outObj.SPAudioDataType[0]['_items'].length) {\n for (let i = 0; i < outObj.SPAudioDataType[0]['_items'].length; i++) {\n const audio = parseDarwinAudio(outObj.SPAudioDataType[0]['_items'][i], i);\n result.push(audio);\n }\n }\n } catch (e) {\n util.noop();\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_windows) {\n util.powerShell('Get-WmiObject Win32_SoundDevice | select DeviceID,StatusInfo,Name,Manufacturer | fl').then((stdout, error) => {\n if (!error) {\n const parts = stdout.toString().split(/\\n\\s*\\n/);\n for (let i = 0; i < parts.length; i++) {\n if (util.getValue(parts[i].split('\\n'), 'name', ':')) {\n result.push(parseWindowsAudio(parts[i].split('\\n')));\n }\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_sunos) {\n resolve(null);\n }\n });\n });\n}\n\nexports.audio = audio;\n","'use strict';\n// @ts-check;\n// ==================================================================================\n// battery.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 6. Battery\n// ----------------------------------------------------------------------------------\n\nconst exec = require('child_process').exec;\nconst fs = require('fs');\nconst util = require('./util');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nfunction parseWinBatteryPart(lines, designedCapacity, fullChargeCapacity) {\n const result = {};\n let status = util.getValue(lines, 'BatteryStatus', ':').trim();\n // 1 = \"Discharging\"\n // 2 = \"On A/C\"\n // 3 = \"Fully Charged\"\n // 4 = \"Low\"\n // 5 = \"Critical\"\n // 6 = \"Charging\"\n // 7 = \"Charging High\"\n // 8 = \"Charging Low\"\n // 9 = \"Charging Critical\"\n // 10 = \"Undefined\"\n // 11 = \"Partially Charged\"\n if (status >= 0) {\n const statusValue = status ? parseInt(status) : 0;\n result.status = statusValue;\n result.hasBattery = true;\n result.maxCapacity = fullChargeCapacity || parseInt(util.getValue(lines, 'DesignCapacity', ':') || 0);\n result.designedCapacity = parseInt(util.getValue(lines, 'DesignCapacity', ':') || designedCapacity);\n result.voltage = parseInt(util.getValue(lines, 'DesignVoltage', ':') || 0) / 1000.0;\n result.capacityUnit = 'mWh';\n result.percent = parseInt(util.getValue(lines, 'EstimatedChargeRemaining', ':') || 0);\n result.currentCapacity = parseInt(result.maxCapacity * result.percent / 100);\n result.isCharging = (statusValue >= 6 && statusValue <= 9) || statusValue === 11 || (!(statusValue === 3) && !(statusValue === 1) && result.percent < 100);\n result.acConnected = result.isCharging || statusValue === 2;\n result.model = util.getValue(lines, 'DeviceID', ':');\n } else {\n result.status = -1;\n }\n\n return result;\n}\n\nmodule.exports = function (callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = {\n hasBattery: false,\n cycleCount: 0,\n isCharging: false,\n designedCapacity: 0,\n maxCapacity: 0,\n currentCapacity: 0,\n voltage: 0,\n capacityUnit: '',\n percent: 0,\n timeRemaining: null,\n acConnected: true,\n type: '',\n model: '',\n manufacturer: '',\n serial: ''\n };\n\n if (_linux) {\n let battery_path = '';\n if (fs.existsSync('/sys/class/power_supply/BAT1/uevent')) {\n battery_path = '/sys/class/power_supply/BAT1/';\n } else if (fs.existsSync('/sys/class/power_supply/BAT0/uevent')) {\n battery_path = '/sys/class/power_supply/BAT0/';\n }\n\n let acConnected = false;\n let acPath = '';\n if (fs.existsSync('/sys/class/power_supply/AC/online')) {\n acPath = '/sys/class/power_supply/AC/online';\n } else if (fs.existsSync('/sys/class/power_supply/AC0/online')) {\n acPath = '/sys/class/power_supply/AC0/online';\n }\n\n if (acPath) {\n const file = fs.readFileSync(acPath);\n acConnected = file.toString().trim() === '1';\n }\n\n if (battery_path) {\n fs.readFile(battery_path + 'uevent', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n\n result.isCharging = (util.getValue(lines, 'POWER_SUPPLY_STATUS', '=').toLowerCase() === 'charging');\n result.acConnected = acConnected || result.isCharging;\n result.voltage = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_VOLTAGE_NOW', '='), 10) / 1000000.0;\n result.capacityUnit = result.voltage ? 'mWh' : 'mAh';\n result.cycleCount = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CYCLE_COUNT', '='), 10);\n result.maxCapacity = Math.round(parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CHARGE_FULL', '=', true, true), 10) / 1000.0 * (result.voltage || 1));\n const desingedMinVoltage = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_VOLTAGE_MIN_DESIGN', '='), 10) / 1000000.0;\n result.designedCapacity = Math.round(parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CHARGE_FULL_DESIGN', '=', true, true), 10) / 1000.0 * (desingedMinVoltage || result.voltage || 1));\n result.currentCapacity = Math.round(parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CHARGE_NOW', '='), 10) / 1000.0 * (result.voltage || 1));\n if (!result.maxCapacity) {\n result.maxCapacity = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_FULL', '=', true, true), 10) / 1000.0;\n result.designedCapacity = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_FULL_DESIGN', '=', true, true), 10) / 1000.0 | result.maxCapacity;\n result.currentCapacity = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_NOW', '='), 10) / 1000.0;\n }\n const percent = util.getValue(lines, 'POWER_SUPPLY_CAPACITY', '=');\n const energy = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_NOW', '='), 10);\n const power = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_POWER_NOW', '='), 10);\n const current = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CURRENT_NOW', '='), 10);\n\n result.percent = parseInt('0' + percent, 10);\n if (result.maxCapacity && result.currentCapacity) {\n result.hasBattery = true;\n if (!percent) {\n result.percent = 100.0 * result.currentCapacity / result.maxCapacity;\n }\n }\n if (result.isCharging) {\n result.hasBattery = true;\n }\n if (energy && power) {\n result.timeRemaining = Math.floor(energy / power * 60);\n } else if (current && result.currentCapacity) {\n result.timeRemaining = Math.floor(result.currentCapacity / current * 60);\n }\n result.type = util.getValue(lines, 'POWER_SUPPLY_TECHNOLOGY', '=');\n result.model = util.getValue(lines, 'POWER_SUPPLY_MODEL_NAME', '=');\n result.manufacturer = util.getValue(lines, 'POWER_SUPPLY_MANUFACTURER', '=');\n result.serial = util.getValue(lines, 'POWER_SUPPLY_SERIAL_NUMBER', '=');\n if (callback) { callback(result); }\n resolve(result);\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n exec('sysctl -i hw.acpi.battery hw.acpi.acline', function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n const batteries = parseInt('0' + util.getValue(lines, 'hw.acpi.battery.units'), 10);\n const percent = parseInt('0' + util.getValue(lines, 'hw.acpi.battery.life'), 10);\n result.hasBattery = (batteries > 0);\n result.cycleCount = null;\n result.isCharging = util.getValue(lines, 'hw.acpi.acline') !== '1';\n result.acConnected = result.isCharging;\n result.maxCapacity = null;\n result.currentCapacity = null;\n result.capacityUnit = 'unknown';\n result.percent = batteries ? percent : null;\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n\n if (_darwin) {\n exec('ioreg -n AppleSmartBattery -r | egrep \"CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|BatterySerialNumber|TimeRemaining|Voltage\"; pmset -g batt | grep %', function (error, stdout) {\n if (stdout) {\n let lines = stdout.toString().replace(/ +/g, '').replace(/\"+/g, '').replace(/-/g, '').split('\\n');\n result.cycleCount = parseInt('0' + util.getValue(lines, 'cyclecount', '='), 10);\n result.voltage = parseInt('0' + util.getValue(lines, 'voltage', '='), 10) / 1000.0;\n result.capacityUnit = result.voltage ? 'mWh' : 'mAh';\n result.maxCapacity = Math.round(parseInt('0' + util.getValue(lines, 'applerawmaxcapacity', '='), 10) * (result.voltage || 1));\n result.currentCapacity = Math.round(parseInt('0' + util.getValue(lines, 'applerawcurrentcapacity', '='), 10) * (result.voltage || 1));\n result.designedCapacity = Math.round(parseInt('0' + util.getValue(lines, 'DesignCapacity', '='), 10) * (result.voltage || 1));\n result.manufacturer = 'Apple';\n result.serial = util.getValue(lines, 'BatterySerialNumber', '=');\n let percent = null;\n const line = util.getValue(lines, 'internal', 'Battery');\n let parts = line.split(';');\n if (parts && parts[0]) {\n let parts2 = parts[0].split('\\t');\n if (parts2 && parts2[1]) {\n percent = parseFloat(parts2[1].trim().replace(/%/g, ''));\n }\n }\n if (parts && parts[1]) {\n result.isCharging = (parts[1].trim() === 'charging');\n result.acConnected = (parts[1].trim() !== 'discharging');\n } else {\n result.isCharging = util.getValue(lines, 'ischarging', '=').toLowerCase() === 'yes';\n result.acConnected = result.isCharging;\n }\n if (result.maxCapacity && result.currentCapacity) {\n result.hasBattery = true;\n result.type = 'Li-ion';\n result.percent = percent !== null ? percent : Math.round(100.0 * result.currentCapacity / result.maxCapacity);\n if (!result.isCharging) {\n result.timeRemaining = parseInt('0' + util.getValue(lines, 'TimeRemaining', '='), 10);\n }\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n try {\n const workload = [];\n workload.push(util.powerShell('Get-WmiObject Win32_Battery | select BatteryStatus, DesignCapacity, DesignVoltage, EstimatedChargeRemaining, DeviceID | fl'));\n workload.push(util.powerShell('(Get-WmiObject -Class BatteryStaticData -Namespace ROOT/WMI).DesignedCapacity'));\n workload.push(util.powerShell('(Get-WmiObject -Class BatteryFullChargedCapacity -Namespace ROOT/WMI).FullChargedCapacity'));\n util.promiseAll(\n workload\n ).then(data => {\n if (data) {\n // let parts = data.results[0].split(/\\n\\s*\\n/);\n let parts = data.results[0].split(/\\n\\s*\\n/);\n let batteries = [];\n const hasValue = value => /\\S/.test(value);\n for (let i = 0; i < parts.length; i++) {\n if (hasValue(parts[i]) && (!batteries.length || !hasValue(parts[i - 1]))) {\n batteries.push([]);\n }\n if (hasValue(parts[i])) {\n batteries[batteries.length - 1].push(parts[i]);\n }\n }\n let designCapacities = data.results[1].split('\\r\\n').filter(e => e);\n let fullChargeCapacities = data.results[2].split('\\r\\n').filter(e => e);\n if (batteries.length) {\n let first = false;\n let additionalBatteries = [];\n for (let i = 0; i < batteries.length; i++) {\n let lines = batteries[i][0].split('\\r\\n');\n const designedCapacity = designCapacities && designCapacities.length >= (i + 1) && designCapacities[i] ? util.toInt(designCapacities[i]) : 0;\n const fullChargeCapacity = fullChargeCapacities && fullChargeCapacities.length >= (i + 1) && fullChargeCapacities[i] ? util.toInt(fullChargeCapacities[i]) : 0;\n const parsed = parseWinBatteryPart(lines, designedCapacity, fullChargeCapacity);\n if (!first && parsed.status > 0 && parsed.status !== 10) {\n result.hasBattery = parsed.hasBattery;\n result.maxCapacity = parsed.maxCapacity;\n result.designedCapacity = parsed.designedCapacity;\n result.voltage = parsed.voltage;\n result.capacityUnit = parsed.capacityUnit;\n result.percent = parsed.percent;\n result.currentCapacity = parsed.currentCapacity;\n result.isCharging = parsed.isCharging;\n result.acConnected = parsed.acConnected;\n result.model = parsed.model;\n first = true;\n } else if (parsed.status !== -1) {\n additionalBatteries.push(\n {\n hasBattery: parsed.hasBattery,\n maxCapacity: parsed.maxCapacity,\n designedCapacity: parsed.designedCapacity,\n voltage: parsed.voltage,\n capacityUnit: parsed.capacityUnit,\n percent: parsed.percent,\n currentCapacity: parsed.currentCapacity,\n isCharging: parsed.isCharging,\n timeRemaining: null,\n acConnected: parsed.acConnected,\n model: parsed.model,\n type: '',\n manufacturer: '',\n serial: ''\n }\n );\n }\n }\n if (!first && additionalBatteries.length) {\n result = additionalBatteries[0];\n additionalBatteries.shift();\n }\n if (additionalBatteries.length) {\n result.additionalBatteries = additionalBatteries;\n }\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n};\n","'use strict';\n// @ts-check\n// ==================================================================================\n// audio.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 17. bluetooth\n// ----------------------------------------------------------------------------------\n\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst path = require('path');\nconst util = require('./util');\nconst fs = require('fs');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nfunction parseBluetoothType(str) {\n let result = '';\n\n if (str.indexOf('keyboard') >= 0) { result = 'Keyboard'; }\n if (str.indexOf('mouse') >= 0) { result = 'Mouse'; }\n if (str.indexOf('speaker') >= 0) { result = 'Speaker'; }\n if (str.indexOf('headset') >= 0) { result = 'Headset'; }\n if (str.indexOf('phone') >= 0) { result = 'Phone'; }\n // to be continued ...\n\n return result;\n}\n\nfunction parseLinuxBluetoothInfo(lines, macAddr1, macAddr2) {\n const result = {};\n\n result.device = null;\n result.name = util.getValue(lines, 'name', '=');\n result.manufacturer = null;\n result.macDevice = macAddr1;\n result.macHost = macAddr2;\n result.batteryPercent = null;\n result.type = parseBluetoothType(result.name.toLowerCase());\n result.connected = false;\n\n return result;\n}\n\nfunction parseDarwinBluetoothDevices(bluetoothObject, macAddr2) {\n const result = {};\n const typeStr = ((bluetoothObject.device_minorClassOfDevice_string || bluetoothObject.device_majorClassOfDevice_string || '') + (bluetoothObject.device_name || '')).toLowerCase();\n\n result.device = bluetoothObject.device_services || '';\n result.name = bluetoothObject.device_name || '';\n result.manufacturer = bluetoothObject.device_manufacturer || '';\n result.macDevice = (bluetoothObject.device_addr || '').toLowerCase().replace(/-/g, ':');\n result.macHost = macAddr2;\n result.batteryPercent = bluetoothObject.device_batteryPercent || null;\n result.type = parseBluetoothType(typeStr);\n result.connected = bluetoothObject.device_isconnected === 'attrib_Yes' || false;\n\n return result;\n}\n\nfunction parseWindowsBluetooth(lines) {\n const result = {};\n\n result.device = null;\n result.name = util.getValue(lines, 'name', ':');\n result.manufacturer = util.getValue(lines, 'manufacturer', ':');\n result.macDevice = null;\n result.macHost = null;\n result.batteryPercent = null;\n result.type = parseBluetoothType(result.name.toLowerCase());\n result.connected = null;\n\n return result;\n}\n\nfunction bluetoothDevices(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = [];\n if (_linux) {\n // get files in /var/lib/bluetooth/ recursive\n const btFiles = util.getFilesInPath('/var/lib/bluetooth/');\n for (let i = 0; i < btFiles.length; i++) {\n const filename = path.basename(btFiles[i]);\n const pathParts = btFiles[i].split('/');\n const macAddr1 = pathParts.length >= 6 ? pathParts[pathParts.length - 2] : null;\n const macAddr2 = pathParts.length >= 7 ? pathParts[pathParts.length - 3] : null;\n if (filename === 'info') {\n const infoFile = fs.readFileSync(btFiles[i], { encoding: 'utf8' }).split('\\n');\n result.push(parseLinuxBluetoothInfo(infoFile, macAddr1, macAddr2));\n }\n }\n // determine \"connected\" with hcitool con\n try {\n const hdicon = execSync('hcitool con').toString().toLowerCase();\n for (let i = 0; i < result.length; i++) {\n if (result[i].macDevice && result[i].macDevice.length > 10 && hdicon.indexOf(result[i].macDevice.toLowerCase()) >= 0) {\n result[i].connected = true;\n }\n }\n } catch (e) {\n util.noop();\n }\n\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n if (_darwin) {\n let cmd = 'system_profiler SPBluetoothDataType -json';\n exec(cmd, function (error, stdout) {\n if (!error) {\n try {\n const outObj = JSON.parse(stdout.toString());\n if (outObj.SPBluetoothDataType && outObj.SPBluetoothDataType.length && outObj.SPBluetoothDataType[0] && outObj.SPBluetoothDataType[0]['device_title'] && outObj.SPBluetoothDataType[0]['device_title'].length) {\n // missing: host BT Adapter macAddr ()\n let macAddr2 = null;\n if (outObj.SPBluetoothDataType[0]['local_device_title'] && outObj.SPBluetoothDataType[0].local_device_title.general_address) {\n macAddr2 = outObj.SPBluetoothDataType[0].local_device_title.general_address.toLowerCase().replace(/-/g, ':');\n }\n\n for (let i = 0; i < outObj.SPBluetoothDataType[0]['device_title'].length; i++) {\n const obj = outObj.SPBluetoothDataType[0]['device_title'][i];\n const objKey = Object.keys(obj);\n if (objKey && objKey.length === 1) {\n const innerObject = obj[objKey[0]];\n innerObject.device_name = objKey[0];\n const bluetoothDevice = parseDarwinBluetoothDevices(innerObject, macAddr2);\n result.push(bluetoothDevice);\n }\n }\n }\n } catch (e) {\n util.noop();\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_windows) {\n util.powerShell('Get-WmiObject Win32_PNPEntity | select PNPClass, Name, Manufacturer | fl').then((stdout, error) => {\n if (!error) {\n const parts = stdout.toString().split(/\\n\\s*\\n/);\n for (let i = 0; i < parts.length; i++) {\n if (util.getValue(parts[i].split('\\n'), 'PNPClass', ':') === 'Bluetooth') {\n result.push(parseWindowsBluetooth(parts[i].split('\\n')));\n }\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_freebsd || _netbsd || _openbsd || _sunos) {\n resolve(null);\n }\n });\n });\n}\n\nexports.bluetoothDevices = bluetoothDevices;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// cpu.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 4. CPU\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst fs = require('fs');\nconst util = require('./util');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nlet _cpu_speed = 0;\nlet _current_cpu = {\n user: 0,\n nice: 0,\n system: 0,\n idle: 0,\n irq: 0,\n load: 0,\n tick: 0,\n ms: 0,\n currentLoad: 0,\n currentLoadUser: 0,\n currentLoadSystem: 0,\n currentLoadNice: 0,\n currentLoadIdle: 0,\n currentLoadIrq: 0,\n rawCurrentLoad: 0,\n rawCurrentLoadUser: 0,\n rawCurrentLoadSystem: 0,\n rawCurrentLoadNice: 0,\n rawCurrentLoadIdle: 0,\n rawCurrentLoadIrq: 0\n};\nlet _cpus = [];\nlet _corecount = 0;\n\nconst AMDBaseFrequencies = {\n '8346': '1.8',\n '8347': '1.9',\n '8350': '2.0',\n '8354': '2.2',\n '8356|SE': '2.4',\n '8356': '2.3',\n '8360': '2.5',\n '2372': '2.1',\n '2373': '2.1',\n '2374': '2.2',\n '2376': '2.3',\n '2377': '2.3',\n '2378': '2.4',\n '2379': '2.4',\n '2380': '2.5',\n '2381': '2.5',\n '2382': '2.6',\n '2384': '2.7',\n '2386': '2.8',\n '2387': '2.8',\n '2389': '2.9',\n '2393': '3.1',\n '8374': '2.2',\n '8376': '2.3',\n '8378': '2.4',\n '8379': '2.4',\n '8380': '2.5',\n '8381': '2.5',\n '8382': '2.6',\n '8384': '2.7',\n '8386': '2.8',\n '8387': '2.8',\n '8389': '2.9',\n '8393': '3.1',\n '2419EE': '1.8',\n '2423HE': '2.0',\n '2425HE': '2.1',\n '2427': '2.2',\n '2431': '2.4',\n '2435': '2.6',\n '2439SE': '2.8',\n '8425HE': '2.1',\n '8431': '2.4',\n '8435': '2.6',\n '8439SE': '2.8',\n '4122': '2.2',\n '4130': '2.6',\n '4162EE': '1.7',\n '4164EE': '1.8',\n '4170HE': '2.1',\n '4174HE': '2.3',\n '4176HE': '2.4',\n '4180': '2.6',\n '4184': '2.8',\n '6124HE': '1.8',\n '6128HE': '2.0',\n '6132HE': '2.2',\n '6128': '2.0',\n '6134': '2.3',\n '6136': '2.4',\n '6140': '2.6',\n '6164HE': '1.7',\n '6166HE': '1.8',\n '6168': '1.9',\n '6172': '2.1',\n '6174': '2.2',\n '6176': '2.3',\n '6176SE': '2.3',\n '6180SE': '2.5',\n '3250': '2.5',\n '3260': '2.7',\n '3280': '2.4',\n '4226': '2.7',\n '4228': '2.8',\n '4230': '2.9',\n '4234': '3.1',\n '4238': '3.3',\n '4240': '3.4',\n '4256': '1.6',\n '4274': '2.5',\n '4276': '2.6',\n '4280': '2.8',\n '4284': '3.0',\n '6204': '3.3',\n '6212': '2.6',\n '6220': '3.0',\n '6234': '2.4',\n '6238': '2.6',\n '6262HE': '1.6',\n '6272': '2.1',\n '6274': '2.2',\n '6276': '2.3',\n '6278': '2.4',\n '6282SE': '2.6',\n '6284SE': '2.7',\n '6308': '3.5',\n '6320': '2.8',\n '6328': '3.2',\n '6338P': '2.3',\n '6344': '2.6',\n '6348': '2.8',\n '6366': '1.8',\n '6370P': '2.0',\n '6376': '2.3',\n '6378': '2.4',\n '6380': '2.5',\n '6386': '2.8',\n 'FX|4100': '3.6',\n 'FX|4120': '3.9',\n 'FX|4130': '3.8',\n 'FX|4150': '3.8',\n 'FX|4170': '4.2',\n 'FX|6100': '3.3',\n 'FX|6120': '3.6',\n 'FX|6130': '3.6',\n 'FX|6200': '3.8',\n 'FX|8100': '2.8',\n 'FX|8120': '3.1',\n 'FX|8140': '3.2',\n 'FX|8150': '3.6',\n 'FX|8170': '3.9',\n 'FX|4300': '3.8',\n 'FX|4320': '4.0',\n 'FX|4350': '4.2',\n 'FX|6300': '3.5',\n 'FX|6350': '3.9',\n 'FX|8300': '3.3',\n 'FX|8310': '3.4',\n 'FX|8320': '3.5',\n 'FX|8350': '4.0',\n 'FX|8370': '4.0',\n 'FX|9370': '4.4',\n 'FX|9590': '4.7',\n 'FX|8320E': '3.2',\n 'FX|8370E': '3.3',\n\n // ZEN Desktop CPUs\n '1200': '3.1',\n 'Pro 1200': '3.1',\n '1300X': '3.5',\n 'Pro 1300': '3.5',\n '1400': '3.2',\n '1500X': '3.5',\n 'Pro 1500': '3.5',\n '1600': '3.2',\n '1600X': '3.6',\n 'Pro 1600': '3.2',\n '1700': '3.0',\n 'Pro 1700': '3.0',\n '1700X': '3.4',\n 'Pro 1700X': '3.4',\n '1800X': '3.6',\n '1900X': '3.8',\n '1920': '3.2',\n '1920X': '3.5',\n '1950X': '3.4',\n\n // ZEN Desktop APUs\n '200GE': '3.2',\n 'Pro 200GE': '3.2',\n '220GE': '3.4',\n '240GE': '3.5',\n '3000G': '3.5',\n '300GE': '3.4',\n '3050GE': '3.4',\n '2200G': '3.5',\n 'Pro 2200G': '3.5',\n '2200GE': '3.2',\n 'Pro 2200GE': '3.2',\n '2400G': '3.6',\n 'Pro 2400G': '3.6',\n '2400GE': '3.2',\n 'Pro 2400GE': '3.2',\n\n // ZEN Mobile APUs\n 'Pro 200U': '2.3',\n '300U': '2.4',\n '2200U': '2.5',\n '3200U': '2.6',\n '2300U': '2.0',\n 'Pro 2300U': '2.0',\n '2500U': '2.0',\n 'Pro 2500U': '2.2',\n '2600H': '3.2',\n '2700U': '2.0',\n 'Pro 2700U': '2.2',\n '2800H': '3.3',\n\n // ZEN Server Processors\n '7351': '2.4',\n '7351P': '2.4',\n '7401': '2.0',\n '7401P': '2.0',\n '7551P': '2.0',\n '7551': '2.0',\n '7251': '2.1',\n '7261': '2.5',\n '7281': '2.1',\n '7301': '2.2',\n '7371': '3.1',\n '7451': '2.3',\n '7501': '2.0',\n '7571': '2.2',\n '7601': '2.2',\n\n // ZEN Embedded Processors\n 'V1500B': '2.2',\n 'V1780B': '3.35',\n 'V1202B': '2.3',\n 'V1404I': '2.0',\n 'V1605B': '2.0',\n 'V1756B': '3.25',\n 'V1807B': '3.35',\n\n '3101': '2.1',\n '3151': '2.7',\n '3201': '1.5',\n '3251': '2.5',\n '3255': '2.5',\n '3301': '2.0',\n '3351': '1.9',\n '3401': '1.85',\n '3451': '2.15',\n\n // ZEN+ Desktop\n '1200|AF': '3.1',\n '2300X': '3.5',\n '2500X': '3.6',\n '2600': '3.4',\n '2600E': '3.1',\n '1600|AF': '3.2',\n '2600X': '3.6',\n '2700': '3.2',\n '2700E': '2.8',\n 'Pro 2700': '3.2',\n '2700X': '3.7',\n 'Pro 2700X': '3.6',\n '2920X': '3.5',\n '2950X': '3.5',\n '2970WX': '3.0',\n '2990WX': '3.0',\n\n // ZEN+ Desktop APU\n 'Pro 300GE': '3.4',\n 'Pro 3125GE': '3.4',\n '3150G': '3.5',\n 'Pro 3150G': '3.5',\n '3150GE': '3.3',\n 'Pro 3150GE': '3.3',\n '3200G': '3.6',\n 'Pro 3200G': '3.6',\n '3200GE': '3.3',\n 'Pro 3200GE': '3.3',\n '3350G': '3.6',\n 'Pro 3350G': '3.6',\n '3350GE': '3.3',\n 'Pro 3350GE': '3.3',\n '3400G': '3.7',\n 'Pro 3400G': '3.7',\n '3400GE': '3.3',\n 'Pro 3400GE': '3.3',\n\n // ZEN+ Mobile\n '3300U': '2.1',\n 'PRO 3300U': '2.1',\n '3450U': '2.1',\n '3500U': '2.1',\n 'PRO 3500U': '2.1',\n '3500C': '2.1',\n '3550H': '2.1',\n '3580U': '2.1',\n '3700U': '2.3',\n 'PRO 3700U': '2.3',\n '3700C': '2.3',\n '3750H': '2.3',\n '3780U': '2.3',\n\n // ZEN2 Desktop CPUS\n '3100': '3.6',\n '3300X': '3.8',\n '3500': '3.6',\n '3500X': '3.6',\n '3600': '3.6',\n 'Pro 3600': '3.6',\n '3600X': '3.8',\n '3600XT': '3.8',\n 'Pro 3700': '3.6',\n '3700X': '3.6',\n '3800X': '3.9',\n '3800XT': '3.9',\n '3900': '3.1',\n 'Pro 3900': '3.1',\n '3900X': '3.8',\n '3900XT': '3.8',\n '3950X': '3.5',\n '3960X': '3.8',\n '3970X': '3.7',\n '3990X': '2.9',\n '3945WX': '4.0',\n '3955WX': '3.9',\n '3975WX': '3.5',\n '3995WX': '2.7',\n\n // ZEN2 Desktop APUs\n '4300GE': '3.5',\n 'Pro 4300GE': '3.5',\n '4300G': '3.8',\n 'Pro 4300G': '3.8',\n '4600GE': '3.3',\n 'Pro 4650GE': '3.3',\n '4600G': '3.7',\n 'Pro 4650G': '3.7',\n '4700GE': '3.1',\n 'Pro 4750GE': '3.1',\n '4700G': '3.6',\n 'Pro 4750G': '3.6',\n '4300U': '2.7',\n '4450U': '2.5',\n 'Pro 4450U': '2.5',\n '4500U': '2.3',\n '4600U': '2.1',\n 'PRO 4650U': '2.1',\n '4680U': '2.1',\n '4600HS': '3.0',\n '4600H': '3.0',\n '4700U': '2.0',\n 'PRO 4750U': '1.7',\n '4800U': '1.8',\n '4800HS': '2.9',\n '4800H': '2.9',\n '4900HS': '3.0',\n '4900H': '3.3',\n '5300U': '2.6',\n '5500U': '2.1',\n '5700U': '1.8',\n\n // ZEN2 - EPYC\n '7232P': '3.1',\n '7302P': '3.0',\n '7402P': '2.8',\n '7502P': '2.5',\n '7702P': '2.0',\n '7252': '3.1',\n '7262': '3.2',\n '7272': '2.9',\n '7282': '2.8',\n '7302': '3.0',\n '7352': '2.3',\n '7402': '2.8',\n '7452': '2.35',\n '7502': '2.5',\n '7532': '2.4',\n '7542': '2.9',\n '7552': '2.2',\n '7642': '2.3',\n '7662': '2.0',\n '7702': '2.0',\n '7742': '2.25',\n '7H12': '2.6',\n '7F32': '3.7',\n '7F52': '3.5',\n '7F72': '3.2',\n\n // Epyc (Milan)\n\n '7763': '2.45',\n '7713': '2.0',\n '7713P': '2.0',\n '7663': '2.0',\n '7643': '2.3',\n '75F3': '2.95',\n '7543': '2.8',\n '7543P': '2.8',\n '7513': '2.6',\n '7453': '2.75',\n '74F3': '3.2',\n '7443': '2.85',\n '7443P': '2.85',\n '7413': '2.65',\n '73F3': '3.5',\n '7343': '3.2',\n '7313': '3.0',\n '7313P': '3.0',\n '72F3': '3.7',\n\n // ZEN3\n '5600X': '3.7',\n '5800X': '3.8',\n '5900X': '3.7',\n '5950X': '3.4'\n};\n\n\nconst socketTypes = {\n 1: 'Other',\n 2: 'Unknown',\n 3: 'Daughter Board',\n 4: 'ZIF Socket',\n 5: 'Replacement/Piggy Back',\n 6: 'None',\n 7: 'LIF Socket',\n 8: 'Slot 1',\n 9: 'Slot 2',\n 10: '370 Pin Socket',\n 11: 'Slot A',\n 12: 'Slot M',\n 13: '423',\n 14: 'A (Socket 462)',\n 15: '478',\n 16: '754',\n 17: '940',\n 18: '939',\n 19: 'mPGA604',\n 20: 'LGA771',\n 21: 'LGA775',\n 22: 'S1',\n 23: 'AM2',\n 24: 'F (1207)',\n 25: 'LGA1366',\n 26: 'G34',\n 27: 'AM3',\n 28: 'C32',\n 29: 'LGA1156',\n 30: 'LGA1567',\n 31: 'PGA988A',\n 32: 'BGA1288',\n 33: 'rPGA988B',\n 34: 'BGA1023',\n 35: 'BGA1224',\n 36: 'LGA1155',\n 37: 'LGA1356',\n 38: 'LGA2011',\n 39: 'FS1',\n 40: 'FS2',\n 41: 'FM1',\n 42: 'FM2',\n 43: 'LGA2011-3',\n 44: 'LGA1356-3',\n 45: 'LGA1150',\n 46: 'BGA1168',\n 47: 'BGA1234',\n 48: 'BGA1364',\n 49: 'AM4',\n 50: 'LGA1151',\n 51: 'BGA1356',\n 52: 'BGA1440',\n 53: 'BGA1515',\n 54: 'LGA3647-1',\n 55: 'SP3',\n 56: 'SP3r2',\n 57: 'LGA2066',\n 58: 'BGA1392',\n 59: 'BGA1510',\n 60: 'BGA1528',\n 61: 'LGA4189',\n 62: 'LGA1200',\n 63: 'LGA4677',\n};\n\nconst socketTypesByName = {\n 'LGA1150': 'i7-5775C i3-4340 i3-4170 G3250 i3-4160T i3-4160 E3-1231 G3258 G3240 i7-4790S i7-4790K i7-4790 i5-4690K i5-4690 i5-4590T i5-4590S i5-4590 i5-4460 i3-4360 i3-4150 G1820 G3420 G3220 i7-4771 i5-4440 i3-4330 i3-4130T i3-4130 E3-1230 i7-4770S i7-4770K i7-4770 i5-4670K i5-4670 i5-4570T i5-4570S i5-4570 i5-4430',\n 'LGA1151': 'i9-9900KS E-2288G E-2224 G5420 i9-9900T i9-9900 i7-9700T i7-9700F i7-9700E i7-9700 i5-9600 i5-9500T i5-9500F i5-9500 i5-9400T i3-9350K i3-9300 i3-9100T i3-9100F i3-9100 G4930 i9-9900KF i7-9700KF i5-9600KF i5-9400F i5-9400 i3-9350KF i9-9900K i7-9700K i5-9600K G5500 G5400 i7-8700T i7-8086K i5-8600 i5-8500T i5-8500 i5-8400T i3-8300 i3-8100T G4900 i7-8700K i7-8700 i5-8600K i5-8400 i3-8350K i3-8100 E3-1270 G4600 G4560 i7-7700T i7-7700K i7-7700 i5-7600K i5-7600 i5-7500T i5-7500 i5-7400 i3-7350K i3-7300 i3-7100T i3-7100 G3930 G3900 G4400 i7-6700T i7-6700K i7-6700 i5-6600K i5-6600 i5-6500T i5-6500 i5-6400T i5-6400 i3-6300 i3-6100T i3-6100 E3-1270 E3-1270 T4500 T4400',\n '1155': 'G440 G460 G465 G470 G530T G540T G550T G1610T G1620T G530 G540 G1610 G550 G1620 G555 G1630 i3-2100T i3-2120T i3-3220T i3-3240T i3-3250T i3-2100 i3-2105 i3-2102 i3-3210 i3-3220 i3-2125 i3-2120 i3-3225 i3-2130 i3-3245 i3-3240 i3-3250 i5-3570T i5-2500T i5-2400S i5-2405S i5-2390T i5-3330S i5-2500S i5-3335S i5-2300 i5-3450S i5-3340S i5-3470S i5-3475S i5-3470T i5-2310 i5-3550S i5-2320 i5-3330 i5-3350P i5-3450 i5-2400 i5-3340 i5-3570S i5-2380P i5-2450P i5-3470 i5-2500K i5-3550 i5-2500 i5-3570 i5-3570K i5-2550K i7-3770T i7-2600S i7-3770S i7-2600K i7-2600 i7-3770 i7-3770K i7-2700K G620T G630T G640T G2020T G645T G2100T G2030T G622 G860T G620 G632 G2120T G630 G640 G2010 G840 G2020 G850 G645 G2030 G860 G2120 G870 G2130 G2140 E3-1220L E3-1220L E3-1260L E3-1265L E3-1220 E3-1225 E3-1220 E3-1235 E3-1225 E3-1230 E3-1230 E3-1240 E3-1245 E3-1270 E3-1275 E3-1240 E3-1245 E3-1270 E3-1280 E3-1275 E3-1290 E3-1280 E3-1290'\n};\n\nfunction getSocketTypesByName(str) {\n let result = '';\n for (const key in socketTypesByName) {\n const names = socketTypesByName[key].split(' ');\n for (let i = 0; i < names.length; i++) {\n if (str.indexOf(names[i]) >= 0) {\n result = key;\n }\n }\n }\n return result;\n}\n\nfunction cpuManufacturer(str) {\n let result = str;\n str = str.toLowerCase();\n\n if (str.indexOf('intel') >= 0) { result = 'Intel'; }\n if (str.indexOf('amd') >= 0) { result = 'AMD'; }\n if (str.indexOf('qemu') >= 0) { result = 'QEMU'; }\n if (str.indexOf('hygon') >= 0) { result = 'Hygon'; }\n if (str.indexOf('centaur') >= 0) { result = 'WinChip/Via'; }\n if (str.indexOf('vmware') >= 0) { result = 'VMware'; }\n if (str.indexOf('Xen') >= 0) { result = 'Xen Hypervisor'; }\n if (str.indexOf('tcg') >= 0) { result = 'QEMU'; }\n if (str.indexOf('apple') >= 0) { result = 'Apple'; }\n\n return result;\n}\n\nfunction cpuBrandManufacturer(res) {\n res.brand = res.brand.replace(/\\(R\\)+/g, '®').replace(/\\s+/g, ' ').trim();\n res.brand = res.brand.replace(/\\(TM\\)+/g, '™').replace(/\\s+/g, ' ').trim();\n res.brand = res.brand.replace(/\\(C\\)+/g, '©').replace(/\\s+/g, ' ').trim();\n res.brand = res.brand.replace(/CPU+/g, '').replace(/\\s+/g, ' ').trim();\n res.manufacturer = cpuManufacturer(res.brand);\n\n let parts = res.brand.split(' ');\n parts.shift();\n res.brand = parts.join(' ');\n return res;\n}\n\nfunction getAMDSpeed(brand) {\n let result = '0';\n for (let key in AMDBaseFrequencies) {\n if ({}.hasOwnProperty.call(AMDBaseFrequencies, key)) {\n let parts = key.split('|');\n let found = 0;\n parts.forEach(item => {\n if (brand.indexOf(item) > -1) {\n found++;\n }\n });\n if (found === parts.length) {\n result = AMDBaseFrequencies[key];\n }\n }\n }\n return parseFloat(result);\n}\n\n// --------------------------\n// CPU - brand, speed\n\nfunction getCpu() {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n const UNKNOWN = 'unknown';\n let result = {\n manufacturer: UNKNOWN,\n brand: UNKNOWN,\n vendor: '',\n family: '',\n model: '',\n stepping: '',\n revision: '',\n voltage: '',\n speed: 0,\n speedMin: 0,\n speedMax: 0,\n governor: '',\n cores: util.cores(),\n physicalCores: util.cores(),\n processors: 1,\n socket: '',\n flags: '',\n virtualization: false,\n cache: {}\n };\n cpuFlags().then(flags => {\n result.flags = flags;\n result.virtualization = flags.indexOf('vmx') > -1 || flags.indexOf('svm') > -1;\n // if (_windows) {\n // try {\n // const systeminfo = execSync('systeminfo', util.execOptsWin).toString();\n // result.virtualization = result.virtualization || (systeminfo.indexOf('Virtualization Enabled In Firmware: Yes') !== -1) || (systeminfo.indexOf('Virtualisierung in Firmware aktiviert: Ja') !== -1) || (systeminfo.indexOf('Virtualisation activée dans le microprogramme : Qiu') !== -1);\n // } catch (e) {\n // util.noop();\n // }\n // }\n if (_darwin) {\n exec('sysctl machdep.cpu hw.cpufrequency_max hw.cpufrequency_min hw.packages hw.physicalcpu_max hw.ncpu hw.tbfrequency hw.cpufamily hw.cpusubfamily', function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n const modelline = util.getValue(lines, 'machdep.cpu.brand_string');\n const modellineParts = modelline.split('@');\n result.brand = modellineParts[0].trim();\n const speed = modellineParts[1] ? modellineParts[1].trim() : '0';\n result.speed = parseFloat(speed.replace(/GHz+/g, ''));\n let tbFrequency = util.getValue(lines, 'hw.tbfrequency') / 1000000000.0;\n tbFrequency = tbFrequency < 0.1 ? tbFrequency * 100 : tbFrequency;\n result.speed = result.speed === 0 ? tbFrequency : result.speed;\n\n _cpu_speed = result.speed;\n result = cpuBrandManufacturer(result);\n result.speedMin = util.getValue(lines, 'hw.cpufrequency_min') ? (util.getValue(lines, 'hw.cpufrequency_min') / 1000000000.0) : result.speed;\n result.speedMax = util.getValue(lines, 'hw.cpufrequency_max') ? (util.getValue(lines, 'hw.cpufrequency_max') / 1000000000.0) : result.speed;\n result.vendor = util.getValue(lines, 'machdep.cpu.vendor') || 'Apple';\n result.family = util.getValue(lines, 'machdep.cpu.family') || util.getValue(lines, 'hw.cpufamily');\n result.model = util.getValue(lines, 'machdep.cpu.model');\n result.stepping = util.getValue(lines, 'machdep.cpu.stepping') || util.getValue(lines, 'hw.cpusubfamily');\n const countProcessors = util.getValue(lines, 'hw.packages');\n const countCores = util.getValue(lines, 'hw.physicalcpu_max');\n const countThreads = util.getValue(lines, 'hw.ncpu');\n if (os.arch() === 'arm64') {\n const clusters = execSync('ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type').toString().split('\\n');\n const efficiencyCores = clusters.filter(line => line.indexOf('\"E\"') >= 0).length;\n const performanceCores = clusters.filter(line => line.indexOf('\"P\"') >= 0).length;\n result.socket = 'SOC';\n result.efficiencyCores = efficiencyCores;\n result.performanceCores = performanceCores;\n }\n if (countProcessors) {\n result.processors = parseInt(countProcessors) || 1;\n }\n if (countCores && countThreads) {\n result.cores = parseInt(countThreads) || util.cores();\n result.physicalCores = parseInt(countCores) || util.cores();\n }\n cpuCache().then(res => {\n result.cache = res;\n resolve(result);\n });\n });\n }\n if (_linux) {\n let modelline = '';\n let lines = [];\n if (os.cpus()[0] && os.cpus()[0].model) { modelline = os.cpus()[0].model; }\n exec('export LC_ALL=C; lscpu; echo -n \"Governor: \"; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null; echo; unset LC_ALL', function (error, stdout) {\n if (!error) {\n lines = stdout.toString().split('\\n');\n }\n modelline = util.getValue(lines, 'model name') || modelline;\n const modellineParts = modelline.split('@');\n result.brand = modellineParts[0].trim();\n result.speed = modellineParts[1] ? parseFloat(modellineParts[1].trim()) : 0;\n if (result.speed === 0 && (result.brand.indexOf('AMD') > -1 || result.brand.toLowerCase().indexOf('ryzen') > -1)) {\n result.speed = getAMDSpeed(result.brand);\n }\n if (result.speed === 0) {\n const current = getCpuCurrentSpeedSync();\n if (current.avg !== 0) { result.speed = current.avg; }\n }\n _cpu_speed = result.speed;\n result.speedMin = Math.round(parseFloat(util.getValue(lines, 'cpu min mhz').replace(/,/g, '.')) / 10.0) / 100;\n result.speedMax = Math.round(parseFloat(util.getValue(lines, 'cpu max mhz').replace(/,/g, '.')) / 10.0) / 100;\n\n result = cpuBrandManufacturer(result);\n result.vendor = cpuManufacturer(util.getValue(lines, 'vendor id'));\n // if (!result.vendor) { result.vendor = util.getValue(lines, 'anbieterkennung'); }\n\n result.family = util.getValue(lines, 'cpu family');\n // if (!result.family) { result.family = util.getValue(lines, 'prozessorfamilie'); }\n result.model = util.getValue(lines, 'model:');\n // if (!result.model) { result.model = util.getValue(lines, 'modell:'); }\n result.stepping = util.getValue(lines, 'stepping');\n result.revision = util.getValue(lines, 'cpu revision');\n result.cache.l1d = util.getValue(lines, 'l1d cache');\n if (result.cache.l1d) { result.cache.l1d = parseInt(result.cache.l1d) * (result.cache.l1d.indexOf('M') !== -1 ? 1024 * 1024 : (result.cache.l1d.indexOf('K') !== -1 ? 1024 : 1)); }\n result.cache.l1i = util.getValue(lines, 'l1i cache');\n if (result.cache.l1i) { result.cache.l1i = parseInt(result.cache.l1i) * (result.cache.l1i.indexOf('M') !== -1 ? 1024 * 1024 : (result.cache.l1i.indexOf('K') !== -1 ? 1024 : 1)); }\n result.cache.l2 = util.getValue(lines, 'l2 cache');\n if (result.cache.l2) { result.cache.l2 = parseInt(result.cache.l2) * (result.cache.l2.indexOf('M') !== -1 ? 1024 * 1024 : (result.cache.l2.indexOf('K') !== -1 ? 1024 : 1)); }\n result.cache.l3 = util.getValue(lines, 'l3 cache');\n if (result.cache.l3) { result.cache.l3 = parseInt(result.cache.l3) * (result.cache.l3.indexOf('M') !== -1 ? 1024 * 1024 : (result.cache.l3.indexOf('K') !== -1 ? 1024 : 1)); }\n\n const threadsPerCore = util.getValue(lines, 'thread(s) per core') || '1';\n // const coresPerSocketInt = parseInt(util.getValue(lines, 'cores(s) per socket') || '1', 10);\n const processors = util.getValue(lines, 'socket(s)') || '1';\n let threadsPerCoreInt = parseInt(threadsPerCore, 10);\n let processorsInt = parseInt(processors, 10);\n result.physicalCores = result.cores / threadsPerCoreInt;\n result.processors = processorsInt;\n result.governor = util.getValue(lines, 'governor') || '';\n\n // Test Raspberry\n if (result.vendor === 'ARM') {\n const linesRpi = fs.readFileSync('/proc/cpuinfo').toString().split('\\n');\n const rPIRevision = util.decodePiCpuinfo(linesRpi);\n if (rPIRevision.model.toLowerCase().indexOf('raspberry') >= 0) {\n result.family = result.manufacturer;\n result.manufacturer = rPIRevision.manufacturer;\n result.brand = rPIRevision.processor;\n result.revision = rPIRevision.revisionCode;\n result.socket = 'SOC';\n }\n }\n\n // socket type\n let lines2 = [];\n exec('export LC_ALL=C; dmidecode –t 4 2>/dev/null | grep \"Upgrade: Socket\"; unset LC_ALL', function (error2, stdout2) {\n lines2 = stdout2.toString().split('\\n');\n if (lines2 && lines2.length) {\n result.socket = util.getValue(lines2, 'Upgrade').replace('Socket', '').trim() || result.socket;\n }\n resolve(result);\n });\n });\n }\n if (_freebsd || _openbsd || _netbsd) {\n let modelline = '';\n let lines = [];\n if (os.cpus()[0] && os.cpus()[0].model) { modelline = os.cpus()[0].model; }\n exec('export LC_ALL=C; dmidecode -t 4; dmidecode -t 7 unset LC_ALL', function (error, stdout) {\n let cache = [];\n if (!error) {\n const data = stdout.toString().split('# dmidecode');\n const processor = data.length > 1 ? data[1] : '';\n cache = data.length > 2 ? data[2].split('Cache Information') : [];\n\n lines = processor.split('\\n');\n }\n result.brand = modelline.split('@')[0].trim();\n result.speed = modelline.split('@')[1] ? parseFloat(modelline.split('@')[1].trim()) : 0;\n if (result.speed === 0 && (result.brand.indexOf('AMD') > -1 || result.brand.toLowerCase().indexOf('ryzen') > -1)) {\n result.speed = getAMDSpeed(result.brand);\n }\n if (result.speed === 0) {\n const current = getCpuCurrentSpeedSync();\n if (current.avg !== 0) { result.speed = current.avg; }\n }\n _cpu_speed = result.speed;\n result.speedMin = result.speed;\n result.speedMax = Math.round(parseFloat(util.getValue(lines, 'max speed').replace(/Mhz/g, '')) / 10.0) / 100;\n\n result = cpuBrandManufacturer(result);\n result.vendor = cpuManufacturer(util.getValue(lines, 'manufacturer'));\n let sig = util.getValue(lines, 'signature');\n sig = sig.split(',');\n for (var i = 0; i < sig.length; i++) {\n sig[i] = sig[i].trim();\n }\n result.family = util.getValue(sig, 'Family', ' ', true);\n result.model = util.getValue(sig, 'Model', ' ', true);\n result.stepping = util.getValue(sig, 'Stepping', ' ', true);\n result.revision = '';\n const voltage = parseFloat(util.getValue(lines, 'voltage'));\n result.voltage = isNaN(voltage) ? '' : voltage.toFixed(2);\n for (let i = 0; i < cache.length; i++) {\n lines = cache[i].split('\\n');\n let cacheType = util.getValue(lines, 'Socket Designation').toLowerCase().replace(' ', '-').split('-');\n cacheType = cacheType.length ? cacheType[0] : '';\n const sizeParts = util.getValue(lines, 'Installed Size').split(' ');\n let size = parseInt(sizeParts[0], 10);\n const unit = sizeParts.length > 1 ? sizeParts[1] : 'kb';\n size = size * (unit === 'kb' ? 1024 : (unit === 'mb' ? 1024 * 1024 : (unit === 'gb' ? 1024 * 1024 * 1024 : 1)));\n if (cacheType) {\n if (cacheType === 'l1') {\n result.cache[cacheType + 'd'] = size / 2;\n result.cache[cacheType + 'i'] = size / 2;\n } else {\n result.cache[cacheType] = size;\n }\n }\n }\n // socket type\n result.socket = util.getValue(lines, 'Upgrade').replace('Socket', '').trim();\n // # threads / # cores\n const threadCount = util.getValue(lines, 'thread count').trim();\n const coreCount = util.getValue(lines, 'core count').trim();\n if (coreCount && threadCount) {\n result.cores = parseInt(threadCount, 10);\n result.physicalCores = parseInt(coreCount, 10);\n }\n resolve(result);\n });\n }\n if (_sunos) {\n resolve(result);\n }\n if (_windows) {\n try {\n const workload = [];\n workload.push(util.powerShell('Get-WmiObject Win32_processor | select Name, Revision, L2CacheSize, L3CacheSize, Manufacturer, MaxClockSpeed, Description, UpgradeMethod, Caption, NumberOfLogicalProcessors, NumberOfCores | fl'));\n workload.push(util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl'));\n // workload.push(util.powerShell('Get-ComputerInfo -property \"HyperV*\"'));\n workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));\n\n Promise.all(\n workload\n ).then(data => {\n let lines = data[0].split('\\r\\n');\n let name = util.getValue(lines, 'name', ':') || '';\n if (name.indexOf('@') >= 0) {\n result.brand = name.split('@')[0].trim();\n result.speed = name.split('@')[1] ? parseFloat(name.split('@')[1].trim()) : 0;\n _cpu_speed = result.speed;\n } else {\n result.brand = name.trim();\n result.speed = 0;\n }\n result = cpuBrandManufacturer(result);\n result.revision = util.getValue(lines, 'revision', ':');\n result.cache.l1d = 0;\n result.cache.l1i = 0;\n result.cache.l2 = util.getValue(lines, 'l2cachesize', ':');\n result.cache.l3 = util.getValue(lines, 'l3cachesize', ':');\n if (result.cache.l2) { result.cache.l2 = parseInt(result.cache.l2, 10) * 1024; }\n if (result.cache.l3) { result.cache.l3 = parseInt(result.cache.l3, 10) * 1024; }\n result.vendor = util.getValue(lines, 'manufacturer', ':');\n result.speedMax = Math.round(parseFloat(util.getValue(lines, 'maxclockspeed', ':').replace(/,/g, '.')) / 10.0) / 100;\n if (result.speed === 0 && (result.brand.indexOf('AMD') > -1 || result.brand.toLowerCase().indexOf('ryzen') > -1)) {\n result.speed = getAMDSpeed(result.brand);\n }\n if (result.speed === 0) {\n result.speed = result.speedMax;\n }\n result.speedMin = result.speed;\n\n let description = util.getValue(lines, 'description', ':').split(' ');\n for (let i = 0; i < description.length; i++) {\n if (description[i].toLowerCase().startsWith('family') && (i + 1) < description.length && description[i + 1]) {\n result.family = description[i + 1];\n }\n if (description[i].toLowerCase().startsWith('model') && (i + 1) < description.length && description[i + 1]) {\n result.model = description[i + 1];\n }\n if (description[i].toLowerCase().startsWith('stepping') && (i + 1) < description.length && description[i + 1]) {\n result.stepping = description[i + 1];\n }\n }\n // socket type\n const socketId = util.getValue(lines, 'UpgradeMethod', ':');\n if (socketTypes[socketId]) {\n result.socket = socketTypes[socketId];\n }\n const socketByName = getSocketTypesByName(name);\n if (socketByName) {\n result.socket = socketByName;\n }\n // # threads / # cores\n const countProcessors = util.countLines(lines, 'Caption');\n const countThreads = util.getValue(lines, 'NumberOfLogicalProcessors', ':');\n const countCores = util.getValue(lines, 'NumberOfCores', ':');\n if (countProcessors) {\n result.processors = parseInt(countProcessors) || 1;\n }\n if (countCores && countThreads) {\n result.cores = parseInt(countThreads) || util.cores();\n result.physicalCores = parseInt(countCores) || util.cores();\n }\n if (countProcessors > 1) {\n result.cores = result.cores * countProcessors;\n result.physicalCores = result.physicalCores * countProcessors;\n }\n const parts = data[1].split(/\\n\\s*\\n/);\n parts.forEach(function (part) {\n lines = part.split('\\r\\n');\n const cacheType = util.getValue(lines, 'CacheType');\n const level = util.getValue(lines, 'Level');\n const installedSize = util.getValue(lines, 'InstalledSize');\n // L1 Instructions\n if (level === '3' && cacheType === '3') {\n result.cache.l1i = parseInt(installedSize, 10);\n }\n // L1 Data\n if (level === '3' && cacheType === '4') {\n result.cache.l1d = parseInt(installedSize, 10);\n }\n // L1 all\n if (level === '3' && cacheType === '5' && !result.cache.l1i && !result.cache.l1d) {\n result.cache.l1i = parseInt(installedSize, 10) / 2;\n result.cache.l1d = parseInt(installedSize, 10) / 2;\n }\n });\n // lines = data[2].split('\\r\\n');\n // result.virtualization = (util.getValue(lines, 'HyperVRequirementVirtualizationFirmwareEnabled').toLowerCase() === 'true');\n // result.virtualization = (util.getValue(lines, 'HyperVisorPresent').toLowerCase() === 'true');\n const hyperv = data[2] ? data[2].toString().toLowerCase() : '';\n result.virtualization = hyperv.indexOf('true') !== -1;\n\n resolve(result);\n });\n } catch (e) {\n resolve(result);\n }\n }\n });\n });\n });\n}\n\n// --------------------------\n// CPU - Processor Data\n\nfunction cpu(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n getCpu().then(result => {\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n });\n}\n\nexports.cpu = cpu;\n\n// --------------------------\n// CPU - current speed - in GHz\n\nfunction getCpuCurrentSpeedSync() {\n\n let cpus = os.cpus();\n let minFreq = 999999999;\n let maxFreq = 0;\n let avgFreq = 0;\n let cores = [];\n\n if (cpus && cpus.length) {\n for (let i in cpus) {\n if ({}.hasOwnProperty.call(cpus, i)) {\n let freq = cpus[i].speed > 100 ? (cpus[i].speed + 1) / 1000 : cpus[i].speed / 10;\n avgFreq = avgFreq + freq;\n if (freq > maxFreq) { maxFreq = freq; }\n if (freq < minFreq) { minFreq = freq; }\n cores.push(parseFloat(freq.toFixed(2)));\n }\n }\n avgFreq = avgFreq / cpus.length;\n return {\n min: parseFloat(minFreq.toFixed(2)),\n max: parseFloat(maxFreq.toFixed(2)),\n avg: parseFloat((avgFreq).toFixed(2)),\n cores: cores\n };\n } else {\n return {\n min: 0,\n max: 0,\n avg: 0,\n cores: cores\n };\n }\n}\n\nfunction cpuCurrentSpeed(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = getCpuCurrentSpeedSync();\n if (result.avg === 0 && _cpu_speed !== 0) {\n const currCpuSpeed = parseFloat(_cpu_speed);\n result = {\n min: currCpuSpeed,\n max: currCpuSpeed,\n avg: currCpuSpeed,\n cores: []\n };\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n}\n\nexports.cpuCurrentSpeed = cpuCurrentSpeed;\n\n// --------------------------\n// CPU - temperature\n// if sensors are installed\n\nfunction cpuTemperature(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = {\n main: null,\n cores: [],\n max: null,\n socket: [],\n chipset: null\n };\n if (_linux) {\n // CPU Chipset, Socket\n try {\n const cmd = 'cat /sys/class/thermal/thermal_zone*/type 2>/dev/null; echo \"-----\"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;';\n const parts = execSync(cmd).toString().split('-----\\n');\n if (parts.length === 2) {\n const lines = parts[0].split('\\n');\n const lines2 = parts[1].split('\\n');\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i].trim();\n if (line.startsWith('acpi') && lines2[i]) {\n result.socket.push(Math.round(parseInt(lines2[i], 10) / 100) / 10);\n }\n if (line.startsWith('pch') && lines2[i]) {\n result.chipset = Math.round(parseInt(lines2[i], 10) / 100) / 10;\n }\n }\n }\n } catch (e) {\n util.noop();\n }\n\n const cmd = 'for mon in /sys/class/hwmon/hwmon*; do for label in \"$mon\"/temp*_label; do if [ -f $label ]; then value=$(echo $label | rev | cut -c 7- | rev)_input; if [ -f \"$value\" ]; then echo $(cat \"$label\")___$(cat \"$value\"); fi; fi; done; done;';\n try {\n exec(cmd, function (error, stdout) {\n stdout = stdout.toString();\n const tdiePos = stdout.toLowerCase().indexOf('tdie');\n if (tdiePos !== -1) {\n stdout = stdout.substring(tdiePos);\n }\n let lines = stdout.split('\\n');\n lines.forEach(line => {\n const parts = line.split('___');\n const label = parts[0];\n const value = parts.length > 1 && parts[1] ? parts[1] : '0';\n if (value && (label === undefined || (label && label.toLowerCase().startsWith('core')))) {\n result.cores.push(Math.round(parseInt(value, 10) / 100) / 10);\n } else if (value && label && result.main === null) {\n result.main = Math.round(parseInt(value, 10) / 100) / 10;\n }\n });\n\n if (result.cores.length > 0) {\n if (result.main === null) {\n result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);\n }\n let maxtmp = Math.max.apply(Math, result.cores);\n result.max = (maxtmp > result.main) ? maxtmp : result.main;\n }\n if (result.main !== null) {\n if (result.max === null) {\n result.max = result.main;\n }\n if (callback) { callback(result); }\n resolve(result);\n return;\n }\n exec('sensors', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n let tdieTemp = null;\n let newSectionStarts = true;\n let section = '';\n lines.forEach(function (line) {\n // determine section\n if (line.trim() === '') {\n newSectionStarts = true;\n } else if (newSectionStarts) {\n if (line.trim().toLowerCase().startsWith('acpi')) { section = 'acpi'; }\n if (line.trim().toLowerCase().startsWith('pch')) { section = 'pch'; }\n if (line.trim().toLowerCase().startsWith('core')) { section = 'core'; }\n newSectionStarts = false;\n }\n let regex = /[+-]([^°]*)/g;\n let temps = line.match(regex);\n let firstPart = line.split(':')[0].toUpperCase();\n if (section === 'acpi') {\n // socket temp\n if (firstPart.indexOf('TEMP') !== -1) {\n result.socket.push(parseFloat(temps));\n }\n } else if (section === 'pch') {\n // chipset temp\n if (firstPart.indexOf('TEMP') !== -1) {\n result.chipset = parseFloat(temps);\n }\n }\n // cpu temp\n if (firstPart.indexOf('PHYSICAL') !== -1 || firstPart.indexOf('PACKAGE') !== -1) {\n result.main = parseFloat(temps);\n }\n if (firstPart.indexOf('CORE ') !== -1) {\n result.cores.push(parseFloat(temps));\n }\n if (firstPart.indexOf('TDIE') !== -1 && tdieTemp === null) {\n tdieTemp = parseFloat(temps);\n }\n });\n if (result.cores.length > 0) {\n if (result.main === null) {\n result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);\n }\n let maxtmp = Math.max.apply(Math, result.cores);\n result.max = (maxtmp > result.main) ? maxtmp : result.main;\n } else {\n if (result.main === null && tdieTemp !== null) {\n result.main = tdieTemp;\n result.max = tdieTemp;\n }\n }\n if (result.main !== null || result.max !== null) {\n if (callback) { callback(result); }\n resolve(result);\n return;\n }\n }\n fs.stat('/sys/class/thermal/thermal_zone0/temp', function (err) {\n if (err === null) {\n fs.readFile('/sys/class/thermal/thermal_zone0/temp', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines.length > 0) {\n result.main = parseFloat(lines[0]) / 1000.0;\n result.max = result.main;\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n exec('/opt/vc/bin/vcgencmd measure_temp', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines.length > 0 && lines[0].indexOf('=')) {\n result.main = parseFloat(lines[0].split('=')[1]);\n result.max = result.main;\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n });\n });\n });\n } catch (er) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n exec('sysctl dev.cpu | grep temp', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n let sum = 0;\n lines.forEach(function (line) {\n const parts = line.split(':');\n if (parts.length > 1) {\n const temp = parseFloat(parts[1].replace(',', '.'));\n if (temp > result.max) { result.max = temp; }\n sum = sum + temp;\n result.cores.push(temp);\n }\n });\n if (result.cores.length) {\n result.main = Math.round(sum / result.cores.length * 100) / 100;\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_darwin) {\n let osxTemp = null;\n try {\n osxTemp = require('osx-temperature-sensor');\n } catch (er) {\n osxTemp = null;\n }\n if (osxTemp) {\n result = osxTemp.cpuTemperature();\n }\n\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n try {\n util.powerShell('Get-WmiObject MSAcpi_ThermalZoneTemperature -Namespace \"root/wmi\" | Select CurrentTemperature').then((stdout, error) => {\n if (!error) {\n let sum = 0;\n let lines = stdout.split('\\r\\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0);\n lines.forEach(function (line) {\n let value = (parseInt(line, 10) - 2732) / 10;\n if (!isNaN(value)) {\n sum = sum + value;\n if (value > result.max) { result.max = value; }\n result.cores.push(value);\n }\n });\n if (result.cores.length) {\n result.main = sum / result.cores.length;\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.cpuTemperature = cpuTemperature;\n\n// --------------------------\n// CPU Flags\n\nfunction cpuFlags(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = '';\n if (_windows) {\n try {\n exec('reg query \"HKEY_LOCAL_MACHINE\\\\HARDWARE\\\\DESCRIPTION\\\\System\\\\CentralProcessor\\\\0\" /v FeatureSet', util.execOptsWin, function (error, stdout) {\n if (!error) {\n let flag_hex = stdout.split('0x').pop().trim();\n let flag_bin_unpadded = parseInt(flag_hex, 16).toString(2);\n let flag_bin = '0'.repeat(32 - flag_bin_unpadded.length) + flag_bin_unpadded;\n // empty flags are the reserved fields in the CPUID feature bit list\n // as found on wikipedia:\n // https://en.wikipedia.org/wiki/CPUID\n let all_flags = [\n 'fpu', 'vme', 'de', 'pse', 'tsc', 'msr', 'pae', 'mce', 'cx8', 'apic',\n '', 'sep', 'mtrr', 'pge', 'mca', 'cmov', 'pat', 'pse-36', 'psn', 'clfsh',\n '', 'ds', 'acpi', 'mmx', 'fxsr', 'sse', 'sse2', 'ss', 'htt', 'tm', 'ia64', 'pbe'\n ];\n for (let f = 0; f < all_flags.length; f++) {\n if (flag_bin[f] === '1' && all_flags[f] !== '') {\n result += ' ' + all_flags[f];\n }\n }\n result = result.trim().toLowerCase();\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_linux) {\n try {\n\n exec('export LC_ALL=C; lscpu; unset LC_ALL', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n if (line.split(':')[0].toUpperCase().indexOf('FLAGS') !== -1) {\n result = line.split(':')[1].trim().toLowerCase();\n }\n });\n }\n if (!result) {\n fs.readFile('/proc/cpuinfo', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n result = util.getValue(lines, 'features', ':', true).toLowerCase();\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n exec('export LC_ALL=C; dmidecode -t 4 2>/dev/null; unset LC_ALL', function (error, stdout) {\n let flags = [];\n if (!error) {\n let parts = stdout.toString().split('\\tFlags:');\n const lines = parts.length > 1 ? parts[1].split('\\tVersion:')[0].split('\\n') : [];\n lines.forEach(function (line) {\n let flag = (line.indexOf('(') ? line.split('(')[0].toLowerCase() : '').trim().replace(/\\t/g, '');\n if (flag) {\n flags.push(flag);\n }\n });\n }\n result = flags.join(' ').trim().toLowerCase();\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_darwin) {\n exec('sysctl machdep.cpu.features', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines.length > 0 && lines[0].indexOf('machdep.cpu.features:') !== -1) {\n result = lines[0].split(':')[1].trim().toLowerCase();\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n}\n\nexports.cpuFlags = cpuFlags;\n\n// --------------------------\n// CPU Cache\n\nfunction cpuCache(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = {\n l1d: null,\n l1i: null,\n l2: null,\n l3: null,\n };\n if (_linux) {\n try {\n exec('export LC_ALL=C; lscpu; unset LC_ALL', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n let parts = line.split(':');\n if (parts[0].toUpperCase().indexOf('L1D CACHE') !== -1) {\n result.l1d = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : (parts[1].indexOf('K') !== -1 ? 1024 : 1));\n }\n if (parts[0].toUpperCase().indexOf('L1I CACHE') !== -1) {\n result.l1i = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : (parts[1].indexOf('K') !== -1 ? 1024 : 1));\n }\n if (parts[0].toUpperCase().indexOf('L2 CACHE') !== -1) {\n result.l2 = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : (parts[1].indexOf('K') !== -1 ? 1024 : 1));\n }\n if (parts[0].toUpperCase().indexOf('L3 CACHE') !== -1) {\n result.l3 = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : (parts[1].indexOf('K') !== -1 ? 1024 : 1));\n }\n });\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n exec('export LC_ALL=C; dmidecode -t 7 2>/dev/null; unset LC_ALL', function (error, stdout) {\n let cache = [];\n if (!error) {\n const data = stdout.toString();\n cache = data.split('Cache Information');\n cache.shift();\n }\n for (let i = 0; i < cache.length; i++) {\n const lines = cache[i].split('\\n');\n let cacheType = util.getValue(lines, 'Socket Designation').toLowerCase().replace(' ', '-').split('-');\n cacheType = cacheType.length ? cacheType[0] : '';\n const sizeParts = util.getValue(lines, 'Installed Size').split(' ');\n let size = parseInt(sizeParts[0], 10);\n const unit = sizeParts.length > 1 ? sizeParts[1] : 'kb';\n size = size * (unit === 'kb' ? 1024 : (unit === 'mb' ? 1024 * 1024 : (unit === 'gb' ? 1024 * 1024 * 1024 : 1)));\n if (cacheType) {\n if (cacheType === 'l1') {\n result.cache[cacheType + 'd'] = size / 2;\n result.cache[cacheType + 'i'] = size / 2;\n } else {\n result.cache[cacheType] = size;\n }\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_darwin) {\n exec('sysctl hw.l1icachesize hw.l1dcachesize hw.l2cachesize hw.l3cachesize', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n let parts = line.split(':');\n if (parts[0].toLowerCase().indexOf('hw.l1icachesize') !== -1) {\n result.l1d = parseInt(parts[1].trim()) * (parts[1].indexOf('K') !== -1 ? 1024 : 1);\n }\n if (parts[0].toLowerCase().indexOf('hw.l1dcachesize') !== -1) {\n result.l1i = parseInt(parts[1].trim()) * (parts[1].indexOf('K') !== -1 ? 1024 : 1);\n }\n if (parts[0].toLowerCase().indexOf('hw.l2cachesize') !== -1) {\n result.l2 = parseInt(parts[1].trim()) * (parts[1].indexOf('K') !== -1 ? 1024 : 1);\n }\n if (parts[0].toLowerCase().indexOf('hw.l3cachesize') !== -1) {\n result.l3 = parseInt(parts[1].trim()) * (parts[1].indexOf('K') !== -1 ? 1024 : 1);\n }\n });\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n try {\n util.powerShell('Get-WmiObject Win32_processor | select L2CacheSize, L3CacheSize | fl').then((stdout, error) => {\n if (!error) {\n let lines = stdout.split('\\r\\n');\n result.l1d = 0;\n result.l1i = 0;\n result.l2 = util.getValue(lines, 'l2cachesize', ':');\n result.l3 = util.getValue(lines, 'l3cachesize', ':');\n if (result.l2) { result.l2 = parseInt(result.l2, 10) * 1024; }\n if (result.l3) { result.l3 = parseInt(result.l3, 10) * 1024; }\n }\n util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl').then((stdout, error) => {\n if (!error) {\n const parts = stdout.split(/\\n\\s*\\n/);\n parts.forEach(function (part) {\n const lines = part.split('\\r\\n');\n const cacheType = util.getValue(lines, 'CacheType');\n const level = util.getValue(lines, 'Level');\n const installedSize = util.getValue(lines, 'InstalledSize');\n // L1 Instructions\n if (level === '3' && cacheType === '3') {\n result.l1i = parseInt(installedSize, 10);\n }\n // L1 Data\n if (level === '3' && cacheType === '4') {\n result.l1d = parseInt(installedSize, 10);\n }\n // L1 all\n if (level === '3' && cacheType === '5' && !result.l1i && !result.l1d) {\n result.l1i = parseInt(installedSize, 10) / 2;\n result.l1d = parseInt(installedSize, 10) / 2;\n }\n });\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.cpuCache = cpuCache;\n\n// --------------------------\n// CPU - current load - in %\n\nfunction getLoad() {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let loads = os.loadavg().map(function (x) { return x / util.cores(); });\n let avgLoad = parseFloat((Math.max.apply(Math, loads)).toFixed(2));\n let result = {};\n\n let now = Date.now() - _current_cpu.ms;\n if (now >= 200) {\n _current_cpu.ms = Date.now();\n const cpus = os.cpus();\n let totalUser = 0;\n let totalSystem = 0;\n let totalNice = 0;\n let totalIrq = 0;\n let totalIdle = 0;\n let cores = [];\n _corecount = (cpus && cpus.length) ? cpus.length : 0;\n\n for (let i = 0; i < _corecount; i++) {\n const cpu = cpus[i].times;\n totalUser += cpu.user;\n totalSystem += cpu.sys;\n totalNice += cpu.nice;\n totalIdle += cpu.idle;\n totalIrq += cpu.irq;\n let tmpTick = (_cpus && _cpus[i] && _cpus[i].totalTick ? _cpus[i].totalTick : 0);\n let tmpLoad = (_cpus && _cpus[i] && _cpus[i].totalLoad ? _cpus[i].totalLoad : 0);\n let tmpUser = (_cpus && _cpus[i] && _cpus[i].user ? _cpus[i].user : 0);\n let tmpSystem = (_cpus && _cpus[i] && _cpus[i].sys ? _cpus[i].sys : 0);\n let tmpNice = (_cpus && _cpus[i] && _cpus[i].nice ? _cpus[i].nice : 0);\n let tmpIdle = (_cpus && _cpus[i] && _cpus[i].idle ? _cpus[i].idle : 0);\n let tmpIrq = (_cpus && _cpus[i] && _cpus[i].irq ? _cpus[i].irq : 0);\n _cpus[i] = cpu;\n _cpus[i].totalTick = _cpus[i].user + _cpus[i].sys + _cpus[i].nice + _cpus[i].irq + _cpus[i].idle;\n _cpus[i].totalLoad = _cpus[i].user + _cpus[i].sys + _cpus[i].nice + _cpus[i].irq;\n _cpus[i].currentTick = _cpus[i].totalTick - tmpTick;\n _cpus[i].load = (_cpus[i].totalLoad - tmpLoad);\n _cpus[i].loadUser = (_cpus[i].user - tmpUser);\n _cpus[i].loadSystem = (_cpus[i].sys - tmpSystem);\n _cpus[i].loadNice = (_cpus[i].nice - tmpNice);\n _cpus[i].loadIdle = (_cpus[i].idle - tmpIdle);\n _cpus[i].loadIrq = (_cpus[i].irq - tmpIrq);\n cores[i] = {};\n cores[i].load = _cpus[i].load / _cpus[i].currentTick * 100;\n cores[i].loadUser = _cpus[i].loadUser / _cpus[i].currentTick * 100;\n cores[i].loadSystem = _cpus[i].loadSystem / _cpus[i].currentTick * 100;\n cores[i].loadNice = _cpus[i].loadNice / _cpus[i].currentTick * 100;\n cores[i].loadIdle = _cpus[i].loadIdle / _cpus[i].currentTick * 100;\n cores[i].loadIrq = _cpus[i].loadIrq / _cpus[i].currentTick * 100;\n cores[i].rawLoad = _cpus[i].load;\n cores[i].rawLoadUser = _cpus[i].loadUser;\n cores[i].rawLoadSystem = _cpus[i].loadSystem;\n cores[i].rawLoadNice = _cpus[i].loadNice;\n cores[i].rawLoadIdle = _cpus[i].loadIdle;\n cores[i].rawLoadIrq = _cpus[i].loadIrq;\n }\n let totalTick = totalUser + totalSystem + totalNice + totalIrq + totalIdle;\n let totalLoad = totalUser + totalSystem + totalNice + totalIrq;\n let currentTick = totalTick - _current_cpu.tick;\n result = {\n avgLoad: avgLoad,\n currentLoad: (totalLoad - _current_cpu.load) / currentTick * 100,\n currentLoadUser: (totalUser - _current_cpu.user) / currentTick * 100,\n currentLoadSystem: (totalSystem - _current_cpu.system) / currentTick * 100,\n currentLoadNice: (totalNice - _current_cpu.nice) / currentTick * 100,\n currentLoadIdle: (totalIdle - _current_cpu.idle) / currentTick * 100,\n currentLoadIrq: (totalIrq - _current_cpu.irq) / currentTick * 100,\n rawCurrentLoad: (totalLoad - _current_cpu.load),\n rawCurrentLoadUser: (totalUser - _current_cpu.user),\n rawCurrentLoadSystem: (totalSystem - _current_cpu.system),\n rawCurrentLoadNice: (totalNice - _current_cpu.nice),\n rawCurrentLoadIdle: (totalIdle - _current_cpu.idle),\n rawCurrentLoadIrq: (totalIrq - _current_cpu.irq),\n cpus: cores\n };\n _current_cpu = {\n user: totalUser,\n nice: totalNice,\n system: totalSystem,\n idle: totalIdle,\n irq: totalIrq,\n tick: totalTick,\n load: totalLoad,\n ms: _current_cpu.ms,\n currentLoad: result.currentLoad,\n currentLoadUser: result.currentLoadUser,\n currentLoadSystem: result.currentLoadSystem,\n currentLoadNice: result.currentLoadNice,\n currentLoadIdle: result.currentLoadIdle,\n currentLoadIrq: result.currentLoadIrq,\n rawCurrentLoad: result.rawCurrentLoad,\n rawCurrentLoadUser: result.rawCurrentLoadUser,\n rawCurrentLoadSystem: result.rawCurrentLoadSystem,\n rawCurrentLoadNice: result.rawCurrentLoadNice,\n rawCurrentLoadIdle: result.rawCurrentLoadIdle,\n rawCurrentLoadIrq: result.rawCurrentLoadIrq,\n };\n } else {\n let cores = [];\n for (let i = 0; i < _corecount; i++) {\n cores[i] = {};\n cores[i].load = _cpus[i].load / _cpus[i].currentTick * 100;\n cores[i].loadUser = _cpus[i].loadUser / _cpus[i].currentTick * 100;\n cores[i].loadSystem = _cpus[i].loadSystem / _cpus[i].currentTick * 100;\n cores[i].loadNice = _cpus[i].loadNice / _cpus[i].currentTick * 100;\n cores[i].loadIdle = _cpus[i].loadIdle / _cpus[i].currentTick * 100;\n cores[i].loadIrq = _cpus[i].loadIrq / _cpus[i].currentTick * 100;\n cores[i].rawLoad = _cpus[i].load;\n cores[i].rawLoadUser = _cpus[i].loadUser;\n cores[i].rawLoadSystem = _cpus[i].loadSystem;\n cores[i].rawLoadNice = _cpus[i].loadNice;\n cores[i].rawLoadIdle = _cpus[i].loadIdle;\n cores[i].rawLoadIrq = _cpus[i].loadIrq;\n }\n result = {\n avgLoad: avgLoad,\n currentLoad: _current_cpu.currentLoad,\n currentLoadUser: _current_cpu.currentLoadUser,\n currentLoadSystem: _current_cpu.currentLoadSystem,\n currentLoadNice: _current_cpu.currentLoadNice,\n currentLoadIdle: _current_cpu.currentLoadIdle,\n currentLoadIrq: _current_cpu.currentLoadIrq,\n rawCurrentLoad: _current_cpu.rawCurrentLoad,\n rawCurrentLoadUser: _current_cpu.rawCurrentLoadUser,\n rawCurrentLoadSystem: _current_cpu.rawCurrentLoadSystem,\n rawCurrentLoadNice: _current_cpu.rawCurrentLoadNice,\n rawCurrentLoadIdle: _current_cpu.rawCurrentLoadIdle,\n rawCurrentLoadIrq: _current_cpu.rawCurrentLoadIrq,\n cpus: cores\n };\n }\n resolve(result);\n });\n });\n}\n\nfunction currentLoad(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n getLoad().then(result => {\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n });\n}\n\nexports.currentLoad = currentLoad;\n\n// --------------------------\n// PS - full load\n// since bootup\n\nfunction getFullLoad() {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n const cpus = os.cpus();\n let totalUser = 0;\n let totalSystem = 0;\n let totalNice = 0;\n let totalIrq = 0;\n let totalIdle = 0;\n\n let result = 0;\n\n if (cpus && cpus.length) {\n for (let i = 0, len = cpus.length; i < len; i++) {\n const cpu = cpus[i].times;\n totalUser += cpu.user;\n totalSystem += cpu.sys;\n totalNice += cpu.nice;\n totalIrq += cpu.irq;\n totalIdle += cpu.idle;\n }\n let totalTicks = totalIdle + totalIrq + totalNice + totalSystem + totalUser;\n result = (totalTicks - totalIdle) / totalTicks * 100.0;\n\n } else {\n result = 0;\n }\n resolve(result);\n });\n });\n}\n\nfunction fullLoad(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n getFullLoad().then(result => {\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n });\n}\n\nexports.fullLoad = fullLoad;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// docker.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 13. Docker\n// ----------------------------------------------------------------------------------\n\nconst util = require('./util');\nconst DockerSocket = require('./dockerSocket');\n\nlet _platform = process.platform;\nconst _windows = (_platform === 'win32');\n\nlet _docker_container_stats = {};\nlet _docker_socket;\nlet _docker_last_read = 0;\n\n\n// --------------------------\n// get containers (parameter all: get also inactive/exited containers)\n\nfunction dockerInfo(callback) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n const result = {};\n\n _docker_socket.getInfo(data => {\n result.id = data.ID;\n result.containers = data.Containers;\n result.containersRunning = data.ContainersRunning;\n result.containersPaused = data.ContainersPaused;\n result.containersStopped = data.ContainersStopped;\n result.images = data.Images;\n result.driver = data.Driver;\n result.memoryLimit = data.MemoryLimit;\n result.swapLimit = data.SwapLimit;\n result.kernelMemory = data.KernelMemory;\n result.cpuCfsPeriod = data.CpuCfsPeriod;\n result.cpuCfsQuota = data.CpuCfsQuota;\n result.cpuShares = data.CPUShares;\n result.cpuSet = data.CPUSet;\n result.ipv4Forwarding = data.IPv4Forwarding;\n result.bridgeNfIptables = data.BridgeNfIptables;\n result.bridgeNfIp6tables = data.BridgeNfIp6tables;\n result.debug = data.Debug;\n result.nfd = data.NFd;\n result.oomKillDisable = data.OomKillDisable;\n result.ngoroutines = data.NGoroutines;\n result.systemTime = data.SystemTime;\n result.loggingDriver = data.LoggingDriver;\n result.cgroupDriver = data.CgroupDriver;\n result.nEventsListener = data.NEventsListener;\n result.kernelVersion = data.KernelVersion;\n result.operatingSystem = data.OperatingSystem;\n result.osType = data.OSType;\n result.architecture = data.Architecture;\n result.ncpu = data.NCPU;\n result.memTotal = data.MemTotal;\n result.dockerRootDir = data.DockerRootDir;\n result.httpProxy = data.HttpProxy;\n result.httpsProxy = data.HttpsProxy;\n result.noProxy = data.NoProxy;\n result.name = data.Name;\n result.labels = data.Labels;\n result.experimentalBuild = data.ExperimentalBuild;\n result.serverVersion = data.ServerVersion;\n result.clusterStore = data.ClusterStore;\n result.clusterAdvertise = data.ClusterAdvertise;\n result.defaultRuntime = data.DefaultRuntime;\n result.liveRestoreEnabled = data.LiveRestoreEnabled;\n result.isolation = data.Isolation;\n result.initBinary = data.InitBinary;\n result.productLicense = data.ProductLicense;\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n });\n}\n\nexports.dockerInfo = dockerInfo;\n\nfunction dockerImages(all, callback) {\n\n // fallback - if only callback is given\n if (util.isFunction(all) && !callback) {\n callback = all;\n all = false;\n }\n if (typeof all === 'string' && all === 'true') {\n all = true;\n }\n if (typeof all !== 'boolean' && all !== undefined) {\n all = false;\n }\n\n all = all || false;\n let result = [];\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n const workload = [];\n\n _docker_socket.listImages(all, data => {\n let dockerImages = {};\n try {\n dockerImages = data;\n if (dockerImages && Object.prototype.toString.call(dockerImages) === '[object Array]' && dockerImages.length > 0) {\n\n dockerImages.forEach(function (element) {\n\n if (element.Names && Object.prototype.toString.call(element.Names) === '[object Array]' && element.Names.length > 0) {\n element.Name = element.Names[0].replace(/^\\/|\\/$/g, '');\n }\n workload.push(dockerImagesInspect(element.Id.trim(), element));\n });\n if (workload.length) {\n Promise.all(\n workload\n ).then(data => {\n if (callback) { callback(data); }\n resolve(data);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } catch (err) {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n });\n}\n\n// --------------------------\n// container inspect (for one container)\n\nfunction dockerImagesInspect(imageID, payload) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n imageID = imageID || '';\n if (typeof imageID !== 'string') {\n return resolve();\n }\n const imageIDSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(imageID, true)).trim();\n if (imageIDSanitized) {\n\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n\n _docker_socket.inspectImage(imageIDSanitized.trim(), data => {\n try {\n resolve({\n id: payload.Id,\n container: data.Container,\n comment: data.Comment,\n os: data.Os,\n architecture: data.Architecture,\n parent: data.Parent,\n dockerVersion: data.DockerVersion,\n size: data.Size,\n sharedSize: payload.SharedSize,\n virtualSize: data.VirtualSize,\n author: data.Author,\n created: data.Created ? Math.round(new Date(data.Created).getTime() / 1000) : 0,\n containerConfig: data.ContainerConfig ? data.ContainerConfig : {},\n graphDriver: data.GraphDriver ? data.GraphDriver : {},\n repoDigests: data.RepoDigests ? data.RepoDigests : {},\n repoTags: data.RepoTags ? data.RepoTags : {},\n config: data.Config ? data.Config : {},\n rootFS: data.RootFS ? data.RootFS : {},\n });\n } catch (err) {\n resolve();\n }\n });\n } else {\n resolve();\n }\n });\n });\n}\n\nexports.dockerImages = dockerImages;\n\nfunction dockerContainers(all, callback) {\n\n function inContainers(containers, id) {\n let filtered = containers.filter(obj => {\n /**\n * @namespace\n * @property {string} Id\n */\n return (obj.Id && (obj.Id === id));\n });\n return (filtered.length > 0);\n }\n\n // fallback - if only callback is given\n if (util.isFunction(all) && !callback) {\n callback = all;\n all = false;\n }\n if (typeof all === 'string' && all === 'true') {\n all = true;\n }\n if (typeof all !== 'boolean' && all !== undefined) {\n all = false;\n }\n\n all = all || false;\n let result = [];\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n const workload = [];\n\n _docker_socket.listContainers(all, data => {\n let docker_containers = {};\n try {\n docker_containers = data;\n if (docker_containers && Object.prototype.toString.call(docker_containers) === '[object Array]' && docker_containers.length > 0) {\n // GC in _docker_container_stats\n for (let key in _docker_container_stats) {\n if ({}.hasOwnProperty.call(_docker_container_stats, key)) {\n if (!inContainers(docker_containers, key)) { delete _docker_container_stats[key]; }\n }\n }\n\n docker_containers.forEach(function (element) {\n\n if (element.Names && Object.prototype.toString.call(element.Names) === '[object Array]' && element.Names.length > 0) {\n element.Name = element.Names[0].replace(/^\\/|\\/$/g, '');\n }\n workload.push(dockerContainerInspect(element.Id.trim(), element));\n // result.push({\n // id: element.Id,\n // name: element.Name,\n // image: element.Image,\n // imageID: element.ImageID,\n // command: element.Command,\n // created: element.Created,\n // state: element.State,\n // ports: element.Ports,\n // mounts: element.Mounts,\n // // hostconfig: element.HostConfig,\n // // network: element.NetworkSettings\n // });\n });\n if (workload.length) {\n Promise.all(\n workload\n ).then(data => {\n if (callback) { callback(data); }\n resolve(data);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } catch (err) {\n // GC in _docker_container_stats\n for (let key in _docker_container_stats) {\n if ({}.hasOwnProperty.call(_docker_container_stats, key)) {\n if (!inContainers(docker_containers, key)) { delete _docker_container_stats[key]; }\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n });\n}\n\n// --------------------------\n// container inspect (for one container)\n\nfunction dockerContainerInspect(containerID, payload) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n containerID = containerID || '';\n if (typeof containerID !== 'string') {\n return resolve();\n }\n const containerIdSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerID, true)).trim();\n if (containerIdSanitized) {\n\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n\n _docker_socket.getInspect(containerIdSanitized.trim(), data => {\n try {\n resolve({\n id: payload.Id,\n name: payload.Name,\n image: payload.Image,\n imageID: payload.ImageID,\n command: payload.Command,\n created: payload.Created,\n started: data.State && data.State.StartedAt ? Math.round(new Date(data.State.StartedAt).getTime() / 1000) : 0,\n finished: data.State && data.State.FinishedAt && !data.State.FinishedAt.startsWith('0001-01-01') ? Math.round(new Date(data.State.FinishedAt).getTime() / 1000) : 0,\n createdAt: data.Created ? data.Created : '',\n startedAt: data.State && data.State.StartedAt ? data.State.StartedAt : '',\n finishedAt: data.State && data.State.FinishedAt && !data.State.FinishedAt.startsWith('0001-01-01') ? data.State.FinishedAt : '',\n state: payload.State,\n restartCount: data.RestartCount || 0,\n platform: data.Platform || '',\n driver: data.Driver || '',\n ports: payload.Ports,\n mounts: payload.Mounts,\n // hostconfig: payload.HostConfig,\n // network: payload.NetworkSettings\n });\n } catch (err) {\n resolve();\n }\n });\n } else {\n resolve();\n }\n });\n });\n}\n\nexports.dockerContainers = dockerContainers;\n\n// --------------------------\n// helper functions for calculation of docker stats\n\nfunction docker_calcCPUPercent(cpu_stats, precpu_stats) {\n /**\n * @namespace\n * @property {object} cpu_usage\n * @property {number} cpu_usage.total_usage\n * @property {number} system_cpu_usage\n * @property {object} cpu_usage\n * @property {Array} cpu_usage.percpu_usage\n */\n\n if (!_windows) {\n let cpuPercent = 0.0;\n // calculate the change for the cpu usage of the container in between readings\n let cpuDelta = cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage;\n // calculate the change for the entire system between readings\n let systemDelta = cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage;\n\n if (systemDelta > 0.0 && cpuDelta > 0.0) {\n // calculate the change for the cpu usage of the container in between readings\n cpuPercent = (cpuDelta / systemDelta) * cpu_stats.cpu_usage.percpu_usage.length * 100.0;\n }\n\n return cpuPercent;\n } else {\n let nanoSecNow = util.nanoSeconds();\n let cpuPercent = 0.0;\n if (_docker_last_read > 0) {\n let possIntervals = (nanoSecNow - _docker_last_read); // / 100 * os.cpus().length;\n let intervalsUsed = cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage;\n if (possIntervals > 0) {\n cpuPercent = 100.0 * intervalsUsed / possIntervals;\n }\n }\n _docker_last_read = nanoSecNow;\n return cpuPercent;\n }\n}\n\nfunction docker_calcNetworkIO(networks) {\n let rx;\n let wx;\n for (let key in networks) {\n // skip loop if the property is from prototype\n if (!{}.hasOwnProperty.call(networks, key)) { continue; }\n\n /**\n * @namespace\n * @property {number} rx_bytes\n * @property {number} tx_bytes\n */\n let obj = networks[key];\n rx = +obj.rx_bytes;\n wx = +obj.tx_bytes;\n }\n return {\n rx,\n wx\n };\n}\n\nfunction docker_calcBlockIO(blkio_stats) {\n let result = {\n r: 0,\n w: 0\n };\n\n /**\n * @namespace\n * @property {Array} io_service_bytes_recursive\n */\n if (blkio_stats && blkio_stats.io_service_bytes_recursive && Object.prototype.toString.call(blkio_stats.io_service_bytes_recursive) === '[object Array]' && blkio_stats.io_service_bytes_recursive.length > 0) {\n blkio_stats.io_service_bytes_recursive.forEach(function (element) {\n /**\n * @namespace\n * @property {string} op\n * @property {number} value\n */\n\n if (element.op && element.op.toLowerCase() === 'read' && element.value) {\n result.r += element.value;\n }\n if (element.op && element.op.toLowerCase() === 'write' && element.value) {\n result.w += element.value;\n }\n });\n }\n return result;\n}\n\nfunction dockerContainerStats(containerIDs, callback) {\n\n let containerArray = [];\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n // fallback - if only callback is given\n if (util.isFunction(containerIDs) && !callback) {\n callback = containerIDs;\n containerArray = ['*'];\n } else {\n containerIDs = containerIDs || '*';\n if (typeof containerIDs !== 'string') {\n if (callback) { callback([]); }\n return resolve([]);\n }\n let containerIDsSanitized = '';\n containerIDsSanitized.__proto__.toLowerCase = util.stringToLower;\n containerIDsSanitized.__proto__.replace = util.stringReplace;\n containerIDsSanitized.__proto__.trim = util.stringTrim;\n\n containerIDsSanitized = containerIDs;\n containerIDsSanitized = containerIDsSanitized.trim();\n if (containerIDsSanitized !== '*') {\n containerIDsSanitized = '';\n const s = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerIDs, true)).trim();\n for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {\n if (!(s[i] === undefined)) {\n s[i].__proto__.toLowerCase = util.stringToLower;\n const sl = s[i].toLowerCase();\n if (sl && sl[0] && !sl[1]) {\n containerIDsSanitized = containerIDsSanitized + sl[0];\n }\n }\n }\n }\n\n containerIDsSanitized = containerIDsSanitized.trim().toLowerCase().replace(/,+/g, '|');\n containerArray = containerIDsSanitized.split('|');\n }\n\n const result = [];\n\n const workload = [];\n if (containerArray.length && containerArray[0].trim() === '*') {\n containerArray = [];\n dockerContainers().then(allContainers => {\n for (let container of allContainers) {\n containerArray.push(container.id);\n }\n if (containerArray.length) {\n dockerContainerStats(containerArray.join(',')).then(result => {\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n } else {\n for (let containerID of containerArray) {\n workload.push(dockerContainerStatsSingle(containerID.trim()));\n }\n if (workload.length) {\n Promise.all(\n workload\n ).then(data => {\n if (callback) { callback(data); }\n resolve(data);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\n// --------------------------\n// container stats (for one container)\n\nfunction dockerContainerStatsSingle(containerID) {\n containerID = containerID || '';\n let result = {\n id: containerID,\n memUsage: 0,\n memLimit: 0,\n memPercent: 0,\n cpuPercent: 0,\n pids: 0,\n netIO: {\n rx: 0,\n wx: 0\n },\n blockIO: {\n r: 0,\n w: 0\n },\n restartCount: 0,\n cpuStats: {},\n precpuStats: {},\n memoryStats: {},\n networks: {},\n };\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (containerID) {\n\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n\n _docker_socket.getInspect(containerID, dataInspect => {\n try {\n _docker_socket.getStats(containerID, data => {\n try {\n let stats = data;\n\n if (!stats.message) {\n result.memUsage = (stats.memory_stats && stats.memory_stats.usage ? stats.memory_stats.usage : 0);\n result.memLimit = (stats.memory_stats && stats.memory_stats.limit ? stats.memory_stats.limit : 0);\n result.memPercent = (stats.memory_stats && stats.memory_stats.usage && stats.memory_stats.limit ? stats.memory_stats.usage / stats.memory_stats.limit * 100.0 : 0);\n result.cpuPercent = (stats.cpu_stats && stats.precpu_stats ? docker_calcCPUPercent(stats.cpu_stats, stats.precpu_stats) : 0);\n result.pids = (stats.pids_stats && stats.pids_stats.current ? stats.pids_stats.current : 0);\n result.restartCount = (dataInspect.RestartCount ? dataInspect.RestartCount : 0);\n if (stats.networks) { result.netIO = docker_calcNetworkIO(stats.networks); }\n if (stats.blkio_stats) { result.blockIO = docker_calcBlockIO(stats.blkio_stats); }\n result.cpuStats = (stats.cpu_stats ? stats.cpu_stats : {});\n result.precpuStats = (stats.precpu_stats ? stats.precpu_stats : {});\n result.memoryStats = (stats.memory_stats ? stats.memory_stats : {});\n result.networks = (stats.networks ? stats.networks : {});\n }\n } catch (err) {\n util.noop();\n }\n // }\n resolve(result);\n });\n } catch (err) {\n util.noop();\n }\n });\n } else {\n resolve(result);\n }\n });\n });\n}\n\nexports.dockerContainerStats = dockerContainerStats;\n\n// --------------------------\n// container processes (for one container)\n\nfunction dockerContainerProcesses(containerID, callback) {\n let result = [];\n return new Promise((resolve) => {\n process.nextTick(() => {\n containerID = containerID || '';\n if (typeof containerID !== 'string') {\n return resolve(result);\n }\n const containerIdSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerID, true)).trim();\n\n if (containerIdSanitized) {\n\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n\n _docker_socket.getProcesses(containerIdSanitized, data => {\n /**\n * @namespace\n * @property {Array} Titles\n * @property {Array} Processes\n **/\n try {\n if (data && data.Titles && data.Processes) {\n let titles = data.Titles.map(function (value) {\n return value.toUpperCase();\n });\n let pos_pid = titles.indexOf('PID');\n let pos_ppid = titles.indexOf('PPID');\n let pos_pgid = titles.indexOf('PGID');\n let pos_vsz = titles.indexOf('VSZ');\n let pos_time = titles.indexOf('TIME');\n let pos_elapsed = titles.indexOf('ELAPSED');\n let pos_ni = titles.indexOf('NI');\n let pos_ruser = titles.indexOf('RUSER');\n let pos_user = titles.indexOf('USER');\n let pos_rgroup = titles.indexOf('RGROUP');\n let pos_group = titles.indexOf('GROUP');\n let pos_stat = titles.indexOf('STAT');\n let pos_rss = titles.indexOf('RSS');\n let pos_command = titles.indexOf('COMMAND');\n\n data.Processes.forEach(process => {\n result.push({\n pidHost: (pos_pid >= 0 ? process[pos_pid] : ''),\n ppid: (pos_ppid >= 0 ? process[pos_ppid] : ''),\n pgid: (pos_pgid >= 0 ? process[pos_pgid] : ''),\n user: (pos_user >= 0 ? process[pos_user] : ''),\n ruser: (pos_ruser >= 0 ? process[pos_ruser] : ''),\n group: (pos_group >= 0 ? process[pos_group] : ''),\n rgroup: (pos_rgroup >= 0 ? process[pos_rgroup] : ''),\n stat: (pos_stat >= 0 ? process[pos_stat] : ''),\n time: (pos_time >= 0 ? process[pos_time] : ''),\n elapsed: (pos_elapsed >= 0 ? process[pos_elapsed] : ''),\n nice: (pos_ni >= 0 ? process[pos_ni] : ''),\n rss: (pos_rss >= 0 ? process[pos_rss] : ''),\n vsz: (pos_vsz >= 0 ? process[pos_vsz] : ''),\n command: (pos_command >= 0 ? process[pos_command] : '')\n });\n });\n }\n } catch (err) {\n util.noop();\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n}\n\nexports.dockerContainerProcesses = dockerContainerProcesses;\n\nfunction dockerVolumes(callback) {\n\n let result = [];\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n _docker_socket.listVolumes(data => {\n let dockerVolumes = {};\n try {\n dockerVolumes = data;\n if (dockerVolumes && dockerVolumes.Volumes && Object.prototype.toString.call(dockerVolumes.Volumes) === '[object Array]' && dockerVolumes.Volumes.length > 0) {\n\n dockerVolumes.Volumes.forEach(function (element) {\n\n result.push({\n name: element.Name,\n driver: element.Driver,\n labels: element.Labels,\n mountpoint: element.Mountpoint,\n options: element.Options,\n scope: element.Scope,\n created: element.CreatedAt ? Math.round(new Date(element.CreatedAt).getTime() / 1000) : 0,\n });\n });\n if (callback) { callback(result); }\n resolve(result);\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } catch (err) {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n });\n}\n\nexports.dockerVolumes = dockerVolumes;\nfunction dockerAll(callback) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n dockerContainers(true).then(result => {\n if (result && Object.prototype.toString.call(result) === '[object Array]' && result.length > 0) {\n let l = result.length;\n result.forEach(function (element) {\n dockerContainerStats(element.id).then(res => {\n // include stats in array\n element.memUsage = res[0].memUsage;\n element.memLimit = res[0].memLimit;\n element.memPercent = res[0].memPercent;\n element.cpuPercent = res[0].cpuPercent;\n element.pids = res[0].pids;\n element.netIO = res[0].netIO;\n element.blockIO = res[0].blockIO;\n element.cpuStats = res[0].cpuStats;\n element.precpuStats = res[0].precpuStats;\n element.memoryStats = res[0].memoryStats;\n element.networks = res[0].networks;\n\n dockerContainerProcesses(element.id).then(processes => {\n element.processes = processes;\n\n l -= 1;\n if (l === 0) {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n // all done??\n });\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n });\n}\n\nexports.dockerAll = dockerAll;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// dockerSockets.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 13. DockerSockets\n// ----------------------------------------------------------------------------------\n\nconst net = require('net');\nconst isWin = require('os').type() === 'Windows_NT';\nconst socketPath = isWin ? '//./pipe/docker_engine' : '/var/run/docker.sock';\n\nclass DockerSocket {\n\n getInfo(callback) {\n try {\n\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/info HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n }\n\n listImages(all, callback) {\n try {\n\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/images/json' + (all ? '?all=1' : '') + ' HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n }\n\n inspectImage(id, callback) {\n id = id || '';\n if (id) {\n try {\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/images/' + id + '/json?stream=0 HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n } else {\n callback({});\n }\n }\n\n listContainers(all, callback) {\n try {\n\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/containers/json' + (all ? '?all=1' : '') + ' HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n }\n\n getStats(id, callback) {\n id = id || '';\n if (id) {\n try {\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/containers/' + id + '/stats?stream=0 HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n } else {\n callback({});\n }\n }\n\n getInspect(id, callback) {\n id = id || '';\n if (id) {\n try {\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/containers/' + id + '/json?stream=0 HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n } else {\n callback({});\n }\n }\n\n getProcesses(id, callback) {\n id = id || '';\n if (id) {\n try {\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/containers/' + id + '/top?ps_args=-opid,ppid,pgid,vsz,time,etime,nice,ruser,user,rgroup,group,stat,rss,args HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n } else {\n callback({});\n }\n }\n\n listVolumes(callback) {\n try {\n\n let socket = net.createConnection({ path: socketPath });\n let alldata = '';\n let data;\n\n socket.on('connect', () => {\n socket.write('GET http:/volumes HTTP/1.0\\r\\n\\r\\n');\n });\n\n socket.on('data', data => {\n alldata = alldata + data.toString();\n });\n\n socket.on('error', () => {\n socket = false;\n callback({});\n });\n\n socket.on('end', () => {\n let startbody = alldata.indexOf('\\r\\n\\r\\n');\n alldata = alldata.substring(startbody + 4);\n socket = false;\n try {\n data = JSON.parse(alldata);\n callback(data);\n } catch (err) {\n callback({});\n }\n });\n } catch (err) {\n callback({});\n }\n }\n}\n\nmodule.exports = DockerSocket;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// filesystem.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 8. File System\n// ----------------------------------------------------------------------------------\n\nconst util = require('./util');\nconst fs = require('fs');\n\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst execPromiseSave = util.promisifySave(require('child_process').exec);\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nlet _fs_speed = {};\nlet _disk_io = {};\n\n// --------------------------\n// FS - mounted file systems\n\nfunction fsSize(callback) {\n\n let macOsDisks = [];\n\n function getmacOsFsType(fs) {\n if (!fs.startsWith('/')) { return 'NFS'; }\n const parts = fs.split('/');\n const fsShort = parts[parts.length - 1];\n const macOsDisksSingle = macOsDisks.filter(item => item.indexOf(fsShort) >= 0);\n if (macOsDisksSingle.length === 1 && macOsDisksSingle[0].indexOf('APFS') >= 0) { return 'APFS'; }\n return 'HFS';\n }\n\n function parseDf(lines) {\n let data = [];\n lines.forEach(function (line) {\n if (line !== '') {\n line = line.replace(/ +/g, ' ').split(' ');\n if (line && ((line[0].startsWith('/')) || (line[6] && line[6] === '/') || (line[0].indexOf('/') > 0) || (line[0].indexOf(':') === 1))) {\n const fs = line[0];\n const fsType = ((_linux || _freebsd || _openbsd || _netbsd) ? line[1] : getmacOsFsType(line[0]));\n const size = parseInt(((_linux || _freebsd || _openbsd || _netbsd) ? line[2] : line[1])) * 1024;\n const used = parseInt(((_linux || _freebsd || _openbsd || _netbsd) ? line[3] : line[2])) * 1024;\n const available = parseInt(((_linux || _freebsd || _openbsd || _netbsd) ? line[4] : line[3])) * 1024;\n const use = parseFloat((100.0 * (used / (used + available))).toFixed(2));\n line.splice(0, (_linux || _freebsd || _openbsd || _netbsd) ? 6 : 5);\n const mount = line.join(' ');\n // const mount = line[line.length - 1];\n if (!data.find(el => (el.fs === fs && el.type === fsType))) {\n data.push({\n fs,\n type: fsType,\n size,\n used,\n available,\n use,\n mount\n });\n }\n }\n }\n });\n return data;\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let data = [];\n if (_linux || _freebsd || _openbsd || _netbsd || _darwin) {\n let cmd = '';\n if (_darwin) {\n cmd = 'df -kP';\n try {\n macOsDisks = execSync('diskutil list').toString().split('\\n').filter(line => {\n return !line.startsWith('/') && line.indexOf(':') > 0;\n });\n } catch (e) {\n macOsDisks = [];\n }\n }\n if (_linux) { cmd = 'df -lkPTx squashfs | grep -E \"^/|^.\\\\:\"'; }\n if (_freebsd || _openbsd || _netbsd) { cmd = 'df -lkPT'; }\n exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n data = parseDf(lines);\n if (callback) {\n callback(data);\n }\n resolve(data);\n } else {\n exec('df -kPT', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n data = parseDf(lines);\n }\n if (callback) {\n callback(data);\n }\n resolve(data);\n });\n }\n });\n }\n if (_sunos) {\n if (callback) { callback(data); }\n resolve(data);\n }\n if (_windows) {\n try {\n // util.wmic('logicaldisk get Caption,FileSystem,FreeSpace,Size').then((stdout) => {\n util.powerShell('Get-WmiObject Win32_logicaldisk | select Caption,FileSystem,FreeSpace,Size | fl').then((stdout, error) => {\n if (!error) {\n let devices = stdout.toString().split(/\\n\\s*\\n/);\n devices.forEach(function (device) {\n let lines = device.split('\\r\\n');\n const size = util.toInt(util.getValue(lines, 'size', ':'));\n const free = util.toInt(util.getValue(lines, 'freespace', ':'));\n const caption = util.getValue(lines, 'caption', ':');\n if (size) {\n data.push({\n fs: caption,\n type: util.getValue(lines, 'filesystem', ':'),\n size,\n used: size - free,\n available: free,\n use: parseFloat(((100.0 * (size - free)) / size).toFixed(2)),\n mount: caption\n });\n }\n });\n }\n if (callback) {\n callback(data);\n }\n resolve(data);\n });\n } catch (e) {\n if (callback) { callback(data); }\n resolve(data);\n }\n }\n });\n });\n}\n\nexports.fsSize = fsSize;\n\n// --------------------------\n// FS - open files count\n\nfunction fsOpenFiles(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n const result = {\n max: null,\n allocated: null,\n available: null\n };\n if (_freebsd || _openbsd || _netbsd || _darwin) {\n let cmd = 'sysctl -i kern.maxfiles kern.num_files kern.open_files';\n exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n result.max = parseInt(util.getValue(lines, 'kern.maxfiles', ':'), 10);\n result.allocated = parseInt(util.getValue(lines, 'kern.num_files', ':'), 10) || parseInt(util.getValue(lines, 'kern.open_files', ':'), 10);\n result.available = result.max - result.allocated;\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_linux) {\n fs.readFile('/proc/sys/fs/file-nr', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines[0]) {\n const parts = lines[0].replace(/\\s+/g, ' ').split(' ');\n if (parts.length === 3) {\n result.allocated = parseInt(parts[0], 10);\n result.available = parseInt(parts[1], 10);\n result.max = parseInt(parts[2], 10);\n if (!result.available) { result.available = result.max - result.allocated; }\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n } else {\n fs.readFile('/proc/sys/fs/file-max', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines[0]) {\n result.max = parseInt(lines[0], 10);\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n });\n }\n if (_sunos) {\n if (callback) { callback(null); }\n resolve(null);\n }\n if (_windows) {\n if (callback) { callback(null); }\n resolve(null);\n }\n });\n });\n}\n\nexports.fsOpenFiles = fsOpenFiles;\n\n// --------------------------\n// disks\n\nfunction parseBytes(s) {\n return parseInt(s.substr(s.indexOf(' (') + 2, s.indexOf(' Bytes)') - 10));\n}\n\nfunction parseDevices(lines) {\n let devices = [];\n let i = 0;\n lines.forEach(line => {\n if (line.length > 0) {\n if (line[0] === '*') {\n i++;\n } else {\n let parts = line.split(':');\n if (parts.length > 1) {\n if (!devices[i]) {\n devices[i] = {\n name: '',\n identifier: '',\n type: 'disk',\n fsType: '',\n mount: '',\n size: 0,\n physical: 'HDD',\n uuid: '',\n label: '',\n model: '',\n serial: '',\n removable: false,\n protocol: ''\n };\n }\n parts[0] = parts[0].trim().toUpperCase().replace(/ +/g, '');\n parts[1] = parts[1].trim();\n if ('DEVICEIDENTIFIER' === parts[0]) { devices[i].identifier = parts[1]; }\n if ('DEVICENODE' === parts[0]) { devices[i].name = parts[1]; }\n if ('VOLUMENAME' === parts[0]) {\n if (parts[1].indexOf('Not applicable') === -1) { devices[i].label = parts[1]; }\n }\n if ('PROTOCOL' === parts[0]) { devices[i].protocol = parts[1]; }\n if ('DISKSIZE' === parts[0]) { devices[i].size = parseBytes(parts[1]); }\n if ('FILESYSTEMPERSONALITY' === parts[0]) { devices[i].fsType = parts[1]; }\n if ('MOUNTPOINT' === parts[0]) { devices[i].mount = parts[1]; }\n if ('VOLUMEUUID' === parts[0]) { devices[i].uuid = parts[1]; }\n if ('READ-ONLYMEDIA' === parts[0] && parts[1] === 'Yes') { devices[i].physical = 'CD/DVD'; }\n if ('SOLIDSTATE' === parts[0] && parts[1] === 'Yes') { devices[i].physical = 'SSD'; }\n if ('VIRTUAL' === parts[0]) { devices[i].type = 'virtual'; }\n if ('REMOVABLEMEDIA' === parts[0]) { devices[i].removable = (parts[1] === 'Removable'); }\n if ('PARTITIONTYPE' === parts[0]) { devices[i].type = 'part'; }\n if ('DEVICE/MEDIANAME' === parts[0]) { devices[i].model = parts[1]; }\n }\n }\n }\n });\n return devices;\n}\n\nfunction parseBlk(lines) {\n let data = [];\n\n lines.filter(line => line !== '').forEach((line) => {\n try {\n line = decodeURIComponent(line.replace(/\\\\x/g, '%'));\n line = line.replace(/\\\\/g, '\\\\\\\\');\n let disk = JSON.parse(line);\n data.push({\n 'name': disk.name,\n 'type': disk.type,\n 'fsType': disk.fsType,\n 'mount': disk.mountpoint,\n 'size': parseInt(disk.size),\n 'physical': (disk.type === 'disk' ? (disk.rota === '0' ? 'SSD' : 'HDD') : (disk.type === 'rom' ? 'CD/DVD' : '')),\n 'uuid': disk.uuid,\n 'label': disk.label,\n 'model': disk.model,\n 'serial': disk.serial,\n 'removable': disk.rm === '1',\n 'protocol': disk.tran,\n 'group': disk.group,\n });\n } catch (e) {\n util.noop();\n }\n });\n data = util.unique(data);\n data = util.sortByKey(data, ['type', 'name']);\n return data;\n}\n\nfunction blkStdoutToObject(stdout) {\n return stdout.toString()\n .replace(/NAME=/g, '{\"name\":')\n .replace(/FSTYPE=/g, ',\"fsType\":')\n .replace(/TYPE=/g, ',\"type\":')\n .replace(/SIZE=/g, ',\"size\":')\n .replace(/MOUNTPOINT=/g, ',\"mountpoint\":')\n .replace(/UUID=/g, ',\"uuid\":')\n .replace(/ROTA=/g, ',\"rota\":')\n .replace(/RO=/g, ',\"ro\":')\n .replace(/RM=/g, ',\"rm\":')\n .replace(/TRAN=/g, ',\"tran\":')\n .replace(/SERIAL=/g, ',\"serial\":')\n .replace(/LABEL=/g, ',\"label\":')\n .replace(/MODEL=/g, ',\"model\":')\n .replace(/OWNER=/g, ',\"owner\":')\n .replace(/GROUP=/g, ',\"group\":')\n .replace(/\\n/g, '}\\n');\n}\n\nfunction blockDevices(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let data = [];\n if (_linux) {\n // see https://wiki.ubuntuusers.de/lsblk/\n // exec(\"lsblk -bo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,TRAN,SERIAL,LABEL,MODEL,OWNER,GROUP,MODE,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,SCHED,RQ-SIZE,RA,WSAME\", function (error, stdout) {\n exec('lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,TRAN,SERIAL,LABEL,MODEL,OWNER 2>/dev/null', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = blkStdoutToObject(stdout).split('\\n');\n data = parseBlk(lines);\n if (callback) {\n callback(data);\n }\n resolve(data);\n } else {\n exec('lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER 2>/dev/null', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = blkStdoutToObject(stdout).split('\\n');\n data = parseBlk(lines);\n }\n if (callback) {\n callback(data);\n }\n resolve(data);\n });\n }\n });\n }\n if (_darwin) {\n exec('diskutil info -all', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n // parse lines into temp array of devices\n data = parseDevices(lines);\n }\n if (callback) {\n callback(data);\n }\n resolve(data);\n });\n }\n if (_sunos) {\n if (callback) { callback(data); }\n resolve(data);\n }\n if (_windows) {\n let drivetypes = ['Unknown', 'NoRoot', 'Removable', 'Local', 'Network', 'CD/DVD', 'RAM'];\n try {\n // util.wmic('logicaldisk get Caption,Description,DeviceID,DriveType,FileSystem,FreeSpace,Name,Size,VolumeName,VolumeSerialNumber /value').then((stdout, error) => {\n // util.powerShell('Get-WmiObject Win32_logicaldisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl').then((stdout, error) => {\n util.powerShell('Get-CimInstance -ClassName Win32_LogicalDisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl').then((stdout, error) => {\n if (!error) {\n let devices = stdout.toString().split(/\\n\\s*\\n/);\n devices.forEach(function (device) {\n let lines = device.split('\\r\\n');\n let drivetype = util.getValue(lines, 'drivetype', ':');\n if (drivetype) {\n data.push({\n name: util.getValue(lines, 'name', ':'),\n identifier: util.getValue(lines, 'caption', ':'),\n type: 'disk',\n fsType: util.getValue(lines, 'filesystem', ':').toLowerCase(),\n mount: util.getValue(lines, 'caption', ':'),\n size: util.getValue(lines, 'size', ':'),\n physical: (drivetype >= 0 && drivetype <= 6) ? drivetypes[drivetype] : drivetypes[0],\n uuid: util.getValue(lines, 'volumeserialnumber', ':'),\n label: util.getValue(lines, 'volumename', ':'),\n model: '',\n serial: util.getValue(lines, 'volumeserialnumber', ':'),\n removable: drivetype === '2',\n protocol: ''\n });\n }\n });\n }\n if (callback) {\n callback(data);\n }\n resolve(data);\n });\n } catch (e) {\n if (callback) { callback(data); }\n resolve(data);\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n // will follow\n if (callback) { callback(null); }\n resolve(null);\n }\n\n });\n });\n}\n\nexports.blockDevices = blockDevices;\n\n// --------------------------\n// FS - speed\n\nfunction calcFsSpeed(rx, wx) {\n let result = {\n rx: 0,\n wx: 0,\n tx: 0,\n rx_sec: null,\n wx_sec: null,\n tx_sec: null,\n ms: 0\n };\n\n if (_fs_speed && _fs_speed.ms) {\n result.rx = rx;\n result.wx = wx;\n result.tx = result.rx + result.wx;\n result.ms = Date.now() - _fs_speed.ms;\n result.rx_sec = (result.rx - _fs_speed.bytes_read) / (result.ms / 1000);\n result.wx_sec = (result.wx - _fs_speed.bytes_write) / (result.ms / 1000);\n result.tx_sec = result.rx_sec + result.wx_sec;\n _fs_speed.rx_sec = result.rx_sec;\n _fs_speed.wx_sec = result.wx_sec;\n _fs_speed.tx_sec = result.tx_sec;\n _fs_speed.bytes_read = result.rx;\n _fs_speed.bytes_write = result.wx;\n _fs_speed.bytes_overall = result.rx + result.wx;\n _fs_speed.ms = Date.now();\n _fs_speed.last_ms = result.ms;\n } else {\n result.rx = rx;\n result.wx = wx;\n result.tx = result.rx + result.wx;\n _fs_speed.rx_sec = null;\n _fs_speed.wx_sec = null;\n _fs_speed.tx_sec = null;\n _fs_speed.bytes_read = result.rx;\n _fs_speed.bytes_write = result.wx;\n _fs_speed.bytes_overall = result.rx + result.wx;\n _fs_speed.ms = Date.now();\n _fs_speed.last_ms = 0;\n }\n return result;\n}\n\nfunction fsStats(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (_windows || _freebsd || _openbsd || _netbsd || _sunos) {\n return resolve(null);\n }\n\n let result = {\n rx: 0,\n wx: 0,\n tx: 0,\n rx_sec: null,\n wx_sec: null,\n tx_sec: null,\n ms: 0\n };\n\n let rx = 0;\n let wx = 0;\n if ((_fs_speed && !_fs_speed.ms) || (_fs_speed && _fs_speed.ms && Date.now() - _fs_speed.ms >= 500)) {\n if (_linux) {\n // exec(\"df -k | grep /dev/\", function(error, stdout) {\n exec('lsblk -r 2>/dev/null | grep /', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n let fs_filter = [];\n lines.forEach(function (line) {\n if (line !== '') {\n line = line.trim().split(' ');\n if (fs_filter.indexOf(line[0]) === -1) { fs_filter.push(line[0]); }\n }\n });\n\n let output = fs_filter.join('|');\n exec('cat /proc/diskstats | egrep \"' + output + '\"', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n line = line.trim();\n if (line !== '') {\n line = line.replace(/ +/g, ' ').split(' ');\n\n rx += parseInt(line[5]) * 512;\n wx += parseInt(line[9]) * 512;\n }\n });\n result = calcFsSpeed(rx, wx);\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n }\n if (_darwin) {\n exec('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n \"/IOBlockStorageDriver/,/Statistics/p\" | grep \"Statistics\" | tr -cd \"01234567890,\\n\"', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n line = line.trim();\n if (line !== '') {\n line = line.split(',');\n\n rx += parseInt(line[2]);\n wx += parseInt(line[9]);\n }\n });\n result = calcFsSpeed(rx, wx);\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n } else {\n result.ms = _fs_speed.last_ms;\n result.rx = _fs_speed.bytes_read;\n result.wx = _fs_speed.bytes_write;\n result.tx = _fs_speed.bytes_read + _fs_speed.bytes_write;\n result.rx_sec = _fs_speed.rx_sec;\n result.wx_sec = _fs_speed.wx_sec;\n result.tx_sec = _fs_speed.tx_sec;\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n });\n}\n\nexports.fsStats = fsStats;\n\nfunction calcDiskIO(rIO, wIO, rWaitTime, wWaitTime, tWaitTime) {\n let result = {\n rIO: 0,\n wIO: 0,\n tIO: 0,\n rIO_sec: null,\n wIO_sec: null,\n tIO_sec: null,\n rWaitTime: 0,\n wWaitTime: 0,\n tWaitTime: 0,\n rWaitPercent: null,\n wWaitPercent: null,\n tWaitPercent: null,\n ms: 0\n };\n if (_disk_io && _disk_io.ms) {\n result.rIO = rIO;\n result.wIO = wIO;\n result.tIO = rIO + wIO;\n result.ms = Date.now() - _disk_io.ms;\n result.rIO_sec = (result.rIO - _disk_io.rIO) / (result.ms / 1000);\n result.wIO_sec = (result.wIO - _disk_io.wIO) / (result.ms / 1000);\n result.tIO_sec = result.rIO_sec + result.wIO_sec;\n result.rWaitTime = rWaitTime;\n result.wWaitTime = wWaitTime;\n result.tWaitTime = tWaitTime;\n result.rWaitPercent = (result.rWaitTime - _disk_io.rWaitTime) * 100 / (result.ms);\n result.wWaitPercent = (result.wWaitTime - _disk_io.wWaitTime) * 100 / (result.ms);\n result.tWaitPercent = (result.tWaitTime - _disk_io.tWaitTime) * 100 / (result.ms);\n _disk_io.rIO = rIO;\n _disk_io.wIO = wIO;\n _disk_io.rIO_sec = result.rIO_sec;\n _disk_io.wIO_sec = result.wIO_sec;\n _disk_io.tIO_sec = result.tIO_sec;\n _disk_io.rWaitTime = rWaitTime;\n _disk_io.wWaitTime = wWaitTime;\n _disk_io.tWaitTime = tWaitTime;\n _disk_io.rWaitPercent = result.rWaitPercent;\n _disk_io.wWaitPercent = result.wWaitPercent;\n _disk_io.tWaitPercent = result.tWaitPercent;\n _disk_io.last_ms = result.ms;\n _disk_io.ms = Date.now();\n } else {\n result.rIO = rIO;\n result.wIO = wIO;\n result.tIO = rIO + wIO;\n result.rWaitTime = rWaitTime;\n result.wWaitTime = wWaitTime;\n result.tWaitTime = tWaitTime;\n _disk_io.rIO = rIO;\n _disk_io.wIO = wIO;\n _disk_io.rIO_sec = null;\n _disk_io.wIO_sec = null;\n _disk_io.tIO_sec = null;\n _disk_io.rWaitTime = rWaitTime;\n _disk_io.wWaitTime = wWaitTime;\n _disk_io.tWaitTime = tWaitTime;\n _disk_io.rWaitPercent = null;\n _disk_io.wWaitPercent = null;\n _disk_io.tWaitPercent = null;\n _disk_io.last_ms = 0;\n _disk_io.ms = Date.now();\n }\n return result;\n}\n\nfunction disksIO(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (_windows) {\n return resolve(null);\n }\n if (_sunos) {\n return resolve(null);\n }\n\n let result = {\n rIO: 0,\n wIO: 0,\n tIO: 0,\n rIO_sec: null,\n wIO_sec: null,\n tIO_sec: null,\n rWaitTime: 0,\n wWaitTime: 0,\n tWaitTime: 0,\n rWaitPercent: null,\n wWaitPercent: null,\n tWaitPercent: null,\n ms: 0\n };\n let rIO = 0;\n let wIO = 0;\n let rWaitTime = 0;\n let wWaitTime = 0;\n let tWaitTime = 0;\n\n if ((_disk_io && !_disk_io.ms) || (_disk_io && _disk_io.ms && Date.now() - _disk_io.ms >= 500)) {\n if (_linux || _freebsd || _openbsd || _netbsd) {\n // prints Block layer statistics for all mounted volumes\n // var cmd = \"for mount in `lsblk | grep / | sed -r 's/│ └─//' | cut -d ' ' -f 1`; do cat /sys/block/$mount/stat | sed -r 's/ +/;/g' | sed -r 's/^;//'; done\";\n // var cmd = \"for mount in `lsblk | grep / | sed 's/[│└─├]//g' | awk '{$1=$1};1' | cut -d ' ' -f 1 | sort -u`; do cat /sys/block/$mount/stat | sed -r 's/ +/;/g' | sed -r 's/^;//'; done\";\n let cmd = 'for mount in `lsblk 2>/dev/null | grep \" disk \" | sed \"s/[│└─├]//g\" | awk \\'{$1=$1};1\\' | cut -d \" \" -f 1 | sort -u`; do cat /sys/block/$mount/stat | sed -r \"s/ +/;/g\" | sed -r \"s/^;//\"; done';\n\n exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.split('\\n');\n lines.forEach(function (line) {\n // ignore empty lines\n if (!line) { return; }\n\n // sum r/wIO of all disks to compute all disks IO\n let stats = line.split(';');\n rIO += parseInt(stats[0]);\n wIO += parseInt(stats[4]);\n rWaitTime += parseInt(stats[3]);\n wWaitTime += parseInt(stats[7]);\n tWaitTime += parseInt(stats[10]);\n });\n result = calcDiskIO(rIO, wIO, rWaitTime, wWaitTime, tWaitTime);\n\n if (callback) {\n callback(result);\n }\n resolve(result);\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n }\n if (_darwin) {\n exec('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n \"/IOBlockStorageDriver/,/Statistics/p\" | grep \"Statistics\" | tr -cd \"01234567890,\\n\"', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n line = line.trim();\n if (line !== '') {\n line = line.split(',');\n\n rIO += parseInt(line[10]);\n wIO += parseInt(line[0]);\n }\n });\n result = calcDiskIO(rIO, wIO, rWaitTime, wWaitTime, tWaitTime);\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n } else {\n result.rIO = _disk_io.rIO;\n result.wIO = _disk_io.wIO;\n result.tIO = _disk_io.rIO + _disk_io.wIO;\n result.ms = _disk_io.last_ms;\n result.rIO_sec = _disk_io.rIO_sec;\n result.wIO_sec = _disk_io.wIO_sec;\n result.tIO_sec = _disk_io.tIO_sec;\n result.rWaitTime = _disk_io.rWaitTime;\n result.wWaitTime = _disk_io.wWaitTime;\n result.tWaitTime = _disk_io.tWaitTime;\n result.rWaitPercent = _disk_io.rWaitPercent;\n result.wWaitPercent = _disk_io.wWaitPercent;\n result.tWaitPercent = _disk_io.tWaitPercent;\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n });\n}\n\nexports.disksIO = disksIO;\n\nfunction diskLayout(callback) {\n\n function getVendorFromModel(model) {\n const diskManufacturers = [\n { pattern: 'WESTERN.*', manufacturer: 'Western Digital' },\n { pattern: '^WDC.*', manufacturer: 'Western Digital' },\n { pattern: 'WD.*', manufacturer: 'Western Digital' },\n { pattern: 'TOSHIBA.*', manufacturer: 'Toshiba' },\n { pattern: 'HITACHI.*', manufacturer: 'Hitachi' },\n { pattern: '^IC.*', manufacturer: 'Hitachi' },\n { pattern: '^HTS.*', manufacturer: 'Hitachi' },\n { pattern: 'SANDISK.*', manufacturer: 'SanDisk' },\n { pattern: 'KINGSTON.*', manufacturer: 'Kingston Technology' },\n { pattern: '^SONY.*', manufacturer: 'Sony' },\n { pattern: 'TRANSCEND.*', manufacturer: 'Transcend' },\n { pattern: 'SAMSUNG.*', manufacturer: 'Samsung' },\n { pattern: '^ST(?!I\\\\ ).*', manufacturer: 'Seagate' },\n { pattern: '^STI\\\\ .*', manufacturer: 'SimpleTech' },\n { pattern: '^D...-.*', manufacturer: 'IBM' },\n { pattern: '^IBM.*', manufacturer: 'IBM' },\n { pattern: '^FUJITSU.*', manufacturer: 'Fujitsu' },\n { pattern: '^MP.*', manufacturer: 'Fujitsu' },\n { pattern: '^MK.*', manufacturer: 'Toshiba' },\n { pattern: 'MAXTO.*', manufacturer: 'Maxtor' },\n { pattern: 'PIONEER.*', manufacturer: 'Pioneer' },\n { pattern: 'PHILIPS.*', manufacturer: 'Philips' },\n { pattern: 'QUANTUM.*', manufacturer: 'Quantum Technology' },\n { pattern: 'FIREBALL.*', manufacturer: 'Quantum Technology' },\n { pattern: '^VBOX.*', manufacturer: 'VirtualBox' },\n { pattern: 'CORSAIR.*', manufacturer: 'Corsair Components' },\n { pattern: 'CRUCIAL.*', manufacturer: 'Crucial' },\n { pattern: 'ECM.*', manufacturer: 'ECM' },\n { pattern: 'INTEL.*', manufacturer: 'INTEL' },\n { pattern: 'EVO.*', manufacturer: 'Samsung' },\n { pattern: 'APPLE.*', manufacturer: 'Apple' },\n ];\n\n let result = '';\n if (model) {\n model = model.toUpperCase();\n diskManufacturers.forEach((manufacturer) => {\n const re = RegExp(manufacturer.pattern);\n if (re.test(model)) { result = manufacturer.manufacturer; }\n });\n }\n return result;\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n const commitResult = res => {\n for (let i = 0; i < res.length; i++) {\n delete res[i].BSDName;\n }\n if (callback) {\n callback(res);\n }\n resolve(res);\n };\n\n let result = [];\n let cmd = '';\n\n if (_linux) {\n let cmdFullSmart = '';\n\n exec('export LC_ALL=C; lsblk -ablJO 2>/dev/null; unset LC_ALL', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n try {\n const out = stdout.toString().trim();\n let devices = [];\n try {\n const outJSON = JSON.parse(out);\n if (outJSON && {}.hasOwnProperty.call(outJSON, 'blockdevices')) {\n devices = outJSON.blockdevices.filter(item => { return (item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fsType === null && item.parttype === null)); });\n }\n } catch (e) {\n // fallback to older version of lsblk\n const out2 = execSync('export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL').toString();\n let lines = blkStdoutToObject(out2).split('\\n');\n const data = parseBlk(lines);\n devices = data.filter(item => { return (item.type === 'disk') && item.size > 0 && ((item.model !== null && item.model !== '') || (item.mount === '' && item.label === '' && item.fsType === '')); });\n }\n devices.forEach((device) => {\n let mediumType = '';\n const BSDName = '/dev/' + device.name;\n const logical = device.name;\n try {\n mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational 2>/dev/null').toString().split('\\n')[0];\n } catch (e) {\n util.noop();\n }\n let interfaceType = device.tran ? device.tran.toUpperCase().trim() : '';\n if (interfaceType === 'NVME') {\n mediumType = '2';\n interfaceType = 'PCIe';\n }\n result.push({\n device: BSDName,\n type: (mediumType === '0' ? 'SSD' : (mediumType === '1' ? 'HD' : (mediumType === '2' ? 'NVMe' : (device.model && device.model.indexOf('SSD') > -1 ? 'SSD' : (device.model && device.model.indexOf('NVM') > -1 ? 'NVMe' : 'HD'))))),\n name: device.model || '',\n vendor: getVendorFromModel(device.model) || (device.vendor ? device.vendor.trim() : ''),\n size: device.size || 0,\n bytesPerSector: null,\n totalCylinders: null,\n totalHeads: null,\n totalSectors: null,\n totalTracks: null,\n tracksPerCylinder: null,\n sectorsPerTrack: null,\n firmwareRevision: device.rev ? device.rev.trim() : '',\n serialNum: device.serial ? device.serial.trim() : '',\n interfaceType: interfaceType,\n smartStatus: 'unknown',\n temperature: null,\n BSDName: BSDName\n });\n cmd += `printf \"\\n${BSDName}|\"; smartctl -H ${BSDName} | grep overall;`;\n cmdFullSmart += `${cmdFullSmart ? 'printf \",\";' : ''}smartctl -a -j ${BSDName};`;\n });\n } catch (e) {\n util.noop();\n }\n }\n // check S.M.A.R.T. status\n if (cmdFullSmart) {\n exec(cmdFullSmart, { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n try {\n const data = JSON.parse(`[${stdout}]`);\n data.forEach(disk => {\n const diskBSDName = disk.smartctl.argv[disk.smartctl.argv.length - 1];\n\n for (let i = 0; i < result.length; i++) {\n if (result[i].BSDName === diskBSDName) {\n result[i].smartStatus = (disk.smart_status.passed ? 'Ok' : (disk.smart_status.passed === false ? 'Predicted Failure' : 'unknown'));\n if (disk.temperature && disk.temperature.current) {\n result[i].temperature = disk.temperature.current;\n }\n result[i].smartData = disk;\n }\n }\n });\n commitResult(result);\n } catch (e) {\n if (cmd) {\n cmd = cmd + 'printf \"\\n\"';\n exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(line => {\n if (line) {\n let parts = line.split('|');\n if (parts.length === 2) {\n let BSDName = parts[0];\n parts[1] = parts[1].trim();\n let parts2 = parts[1].split(':');\n if (parts2.length === 2) {\n parts2[1] = parts2[1].trim();\n let status = parts2[1].toLowerCase();\n for (let i = 0; i < result.length; i++) {\n if (result[i].BSDName === BSDName) {\n result[i].smartStatus = (status === 'passed' ? 'Ok' : (status === 'failed!' ? 'Predicted Failure' : 'unknown'));\n }\n }\n }\n }\n }\n });\n commitResult(result);\n });\n } else {\n commitResult(result);\n }\n }\n });\n } else {\n commitResult(result);\n }\n });\n }\n if (_freebsd || _openbsd || _netbsd) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_darwin) {\n exec('system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType', { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n if (!error) {\n // split by type:\n let lines = stdout.toString().split('\\n');\n let linesSATA = [];\n let linesNVMe = [];\n let linesUSB = [];\n let dataType = 'SATA';\n lines.forEach(line => {\n if (line === 'NVMExpress:') { dataType = 'NVMe'; }\n else if (line === 'USB:') { dataType = 'USB'; }\n else if (line === 'SATA/SATA Express:') { dataType = 'SATA'; }\n else if (dataType === 'SATA') { linesSATA.push(line); }\n else if (dataType === 'NVMe') { linesNVMe.push(line); }\n else if (dataType === 'USB') { linesUSB.push(line); }\n });\n try {\n // Serial ATA Drives\n let devices = linesSATA.join('\\n').split(' Physical Interconnect: ');\n devices.shift();\n devices.forEach(function (device) {\n device = 'InterfaceType: ' + device;\n let lines = device.split('\\n');\n const mediumType = util.getValue(lines, 'Medium Type', ':', true).trim();\n const sizeStr = util.getValue(lines, 'capacity', ':', true).trim();\n const BSDName = util.getValue(lines, 'BSD Name', ':', true).trim();\n if (sizeStr) {\n let sizeValue = 0;\n if (sizeStr.indexOf('(') >= 0) {\n sizeValue = parseInt(sizeStr.match(/\\(([^)]+)\\)/)[1].replace(/\\./g, '').replace(/,/g, '').replace(/\\s/g, ''));\n }\n if (!sizeValue) {\n sizeValue = parseInt(sizeStr);\n }\n if (sizeValue) {\n const smartStatusString = util.getValue(lines, 'S.M.A.R.T. status', ':', true).trim().toLowerCase();\n result.push({\n device: BSDName,\n type: mediumType.startsWith('Solid') ? 'SSD' : 'HD',\n name: util.getValue(lines, 'Model', ':', true).trim(),\n vendor: getVendorFromModel(util.getValue(lines, 'Model', ':', true).trim()) || util.getValue(lines, 'Manufacturer', ':', true),\n size: sizeValue,\n bytesPerSector: null,\n totalCylinders: null,\n totalHeads: null,\n totalSectors: null,\n totalTracks: null,\n tracksPerCylinder: null,\n sectorsPerTrack: null,\n firmwareRevision: util.getValue(lines, 'Revision', ':', true).trim(),\n serialNum: util.getValue(lines, 'Serial Number', ':', true).trim(),\n interfaceType: util.getValue(lines, 'InterfaceType', ':', true).trim(),\n smartStatus: smartStatusString === 'verified' ? 'OK' : smartStatusString || 'unknown',\n temperature: null,\n BSDName: BSDName\n });\n cmd = cmd + 'printf \"\\n' + BSDName + '|\"; diskutil info /dev/' + BSDName + ' | grep SMART;';\n }\n }\n });\n } catch (e) {\n util.noop();\n }\n\n // NVME Drives\n try {\n let devices = linesNVMe.join('\\n').split('\\n\\n Capacity:');\n devices.shift();\n devices.forEach(function (device) {\n device = '!Capacity: ' + device;\n let lines = device.split('\\n');\n const linkWidth = util.getValue(lines, 'link width', ':', true).trim();\n const sizeStr = util.getValue(lines, '!capacity', ':', true).trim();\n const BSDName = util.getValue(lines, 'BSD Name', ':', true).trim();\n if (sizeStr) {\n let sizeValue = 0;\n if (sizeStr.indexOf('(') >= 0) {\n sizeValue = parseInt(sizeStr.match(/\\(([^)]+)\\)/)[1].replace(/\\./g, '').replace(/,/g, '').replace(/\\s/g, ''));\n }\n if (!sizeValue) {\n sizeValue = parseInt(sizeStr);\n }\n if (sizeValue) {\n const smartStatusString = util.getValue(lines, 'S.M.A.R.T. status', ':', true).trim().toLowerCase();\n result.push({\n device: BSDName,\n type: 'NVMe',\n name: util.getValue(lines, 'Model', ':', true).trim(),\n vendor: getVendorFromModel(util.getValue(lines, 'Model', ':', true).trim()),\n size: sizeValue,\n bytesPerSector: null,\n totalCylinders: null,\n totalHeads: null,\n totalSectors: null,\n totalTracks: null,\n tracksPerCylinder: null,\n sectorsPerTrack: null,\n firmwareRevision: util.getValue(lines, 'Revision', ':', true).trim(),\n serialNum: util.getValue(lines, 'Serial Number', ':', true).trim(),\n interfaceType: ('PCIe ' + linkWidth).trim(),\n smartStatus: smartStatusString === 'verified' ? 'OK' : smartStatusString || 'unknown',\n temperature: null,\n BSDName: BSDName\n });\n cmd = cmd + 'printf \"\\n' + BSDName + '|\"; diskutil info /dev/' + BSDName + ' | grep SMART;';\n }\n }\n });\n } catch (e) {\n util.noop();\n }\n // USB Drives\n try {\n let devices = linesUSB.join('\\n').replaceAll('Media:\\n ', 'Model:').split('\\n\\n Product ID:');\n devices.shift();\n devices.forEach(function (device) {\n let lines = device.split('\\n');\n const sizeStr = util.getValue(lines, 'Capacity', ':', true).trim();\n const BSDName = util.getValue(lines, 'BSD Name', ':', true).trim();\n if (sizeStr) {\n let sizeValue = 0;\n if (sizeStr.indexOf('(') >= 0) {\n sizeValue = parseInt(sizeStr.match(/\\(([^)]+)\\)/)[1].replace(/\\./g, '').replace(/,/g, '').replace(/\\s/g, ''));\n }\n if (!sizeValue) {\n sizeValue = parseInt(sizeStr);\n }\n if (sizeValue) {\n const smartStatusString = util.getValue(lines, 'S.M.A.R.T. status', ':', true).trim().toLowerCase();\n result.push({\n device: BSDName,\n type: 'USB',\n name: util.getValue(lines, 'Model', ':', true).trim().replaceAll(':', ''),\n vendor: getVendorFromModel(util.getValue(lines, 'Model', ':', true).trim()),\n size: sizeValue,\n bytesPerSector: null,\n totalCylinders: null,\n totalHeads: null,\n totalSectors: null,\n totalTracks: null,\n tracksPerCylinder: null,\n sectorsPerTrack: null,\n firmwareRevision: util.getValue(lines, 'Revision', ':', true).trim(),\n serialNum: util.getValue(lines, 'Serial Number', ':', true).trim(),\n interfaceType: 'USB',\n smartStatus: smartStatusString === 'verified' ? 'OK' : smartStatusString || 'unknown',\n temperature: null,\n BSDName: BSDName\n });\n cmd = cmd + 'printf \"\\n' + BSDName + '|\"; diskutil info /dev/' + BSDName + ' | grep SMART;';\n }\n }\n });\n } catch (e) {\n util.noop();\n }\n if (cmd) {\n cmd = cmd + 'printf \"\\n\"';\n exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(line => {\n if (line) {\n let parts = line.split('|');\n if (parts.length === 2) {\n let BSDName = parts[0];\n parts[1] = parts[1].trim();\n let parts2 = parts[1].split(':');\n if (parts2.length === 2) {\n parts2[1] = parts2[1].trim();\n let status = parts2[1].toLowerCase();\n for (let i = 0; i < result.length; i++) {\n if (result[i].BSDName === BSDName) {\n result[i].smartStatus = (status === 'not supported' ? 'not supported' : (status === 'verified' ? 'Ok' : (status === 'failing' ? 'Predicted Failure' : 'unknown')));\n }\n }\n }\n }\n }\n });\n for (let i = 0; i < result.length; i++) {\n delete result[i].BSDName;\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else {\n for (let i = 0; i < result.length; i++) {\n delete result[i].BSDName;\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n }\n });\n }\n if (_windows) {\n try {\n const workload = [];\n workload.push(util.powerShell('Get-WmiObject Win32_DiskDrive | select Caption,Size,Status,PNPDeviceId,BytesPerSector,TotalCylinders,TotalHeads,TotalSectors,TotalTracks,TracksPerCylinder,SectorsPerTrack,FirmwareRevision,SerialNumber,InterfaceType | fl'));\n workload.push(util.powerShell('Get-PhysicalDisk | select BusType,MediaType,FriendlyName,Model,SerialNumber,Size | fl'));\n if (util.smartMonToolsInstalled()) {\n try {\n const smartDev = JSON.parse(execSync('smartctl --scan -j'));\n if (smartDev && smartDev.devices && smartDev.devices.length > 0) {\n smartDev.devices.forEach((dev) => {\n workload.push(execPromiseSave(`smartctl -j -a ${dev.name}`, util.execOptsWin));\n });\n }\n } catch (e) {\n util.noop();\n }\n }\n util.promiseAll(\n workload\n ).then(data => {\n let devices = data.results[0].toString().split(/\\n\\s*\\n/);\n devices.forEach(function (device) {\n let lines = device.split('\\r\\n');\n const size = util.getValue(lines, 'Size', ':').trim();\n const status = util.getValue(lines, 'Status', ':').trim().toLowerCase();\n if (size) {\n result.push({\n device: util.getValue(lines, 'PNPDeviceId', ':'),\n type: device.indexOf('SSD') > -1 ? 'SSD' : 'HD', // just a starting point ... better: MSFT_PhysicalDisk - Media Type ... see below\n name: util.getValue(lines, 'Caption', ':'),\n vendor: getVendorFromModel(util.getValue(lines, 'Caption', ':', true).trim()),\n size: parseInt(size),\n bytesPerSector: parseInt(util.getValue(lines, 'BytesPerSector', ':')),\n totalCylinders: parseInt(util.getValue(lines, 'TotalCylinders', ':')),\n totalHeads: parseInt(util.getValue(lines, 'TotalHeads', ':')),\n totalSectors: parseInt(util.getValue(lines, 'TotalSectors', ':')),\n totalTracks: parseInt(util.getValue(lines, 'TotalTracks', ':')),\n tracksPerCylinder: parseInt(util.getValue(lines, 'TracksPerCylinder', ':')),\n sectorsPerTrack: parseInt(util.getValue(lines, 'SectorsPerTrack', ':')),\n firmwareRevision: util.getValue(lines, 'FirmwareRevision', ':').trim(),\n serialNum: util.getValue(lines, 'SerialNumber', ':').trim(),\n interfaceType: util.getValue(lines, 'InterfaceType', ':').trim(),\n smartStatus: (status === 'ok' ? 'Ok' : (status === 'degraded' ? 'Degraded' : (status === 'pred fail' ? 'Predicted Failure' : 'Unknown'))),\n temperature: null,\n });\n }\n });\n devices = data.results[1].split(/\\n\\s*\\n/);\n devices.forEach(function (device) {\n let lines = device.split('\\r\\n');\n const serialNum = util.getValue(lines, 'SerialNumber', ':').trim();\n const name = util.getValue(lines, 'FriendlyName', ':').trim().replace('Msft ', 'Microsoft');\n const size = util.getValue(lines, 'Size', ':').trim();\n const model = util.getValue(lines, 'Model', ':').trim();\n const interfaceType = util.getValue(lines, 'BusType', ':').trim();\n let mediaType = util.getValue(lines, 'MediaType', ':').trim();\n if (mediaType === '3' || mediaType === 'HDD') { mediaType = 'HD'; }\n if (mediaType === '4') { mediaType = 'SSD'; }\n if (mediaType === '5') { mediaType = 'SCM'; }\n if (mediaType === 'Unspecified' && (model.toLowerCase().indexOf('virtual') > -1 || model.toLowerCase().indexOf('vbox') > -1)) { mediaType = 'Virtual'; }\n if (size) {\n let i = util.findObjectByKey(result, 'serialNum', serialNum);\n if (i === -1 || serialNum === '') {\n i = util.findObjectByKey(result, 'name', name);\n }\n if (i != -1) {\n result[i].type = mediaType;\n result[i].interfaceType = interfaceType;\n }\n }\n });\n // S.M.A.R.T\n data.results.shift();\n data.results.shift();\n if (data.results.length) {\n data.results.forEach((smartStr) => {\n try {\n const smartData = JSON.parse(smartStr);\n if (smartData.serial_number) {\n const serialNum = smartData.serial_number;\n let i = util.findObjectByKey(result, 'serialNum', serialNum);\n if (i != -1) {\n result[i].smartStatus = (smartData.smart_status && smartData.smart_status.passed ? 'Ok' : (smartData.smart_status && smartData.smart_status.passed === false ? 'Predicted Failure' : 'unknown'));\n if (smartData.temperature && smartData.temperature.current) {\n result[i].temperature = smartData.temperature.current;\n }\n result[i].smartData = smartData;\n }\n }\n } catch (e) {\n util.noop();\n }\n });\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.diskLayout = diskLayout;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// graphics.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 7. Graphics (controller, display)\n// ----------------------------------------------------------------------------------\n\nconst fs = require('fs');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst util = require('./util');\n\nlet _platform = process.platform;\nlet _nvidiaSmiPath = '';\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nlet _resolutionX = 0;\nlet _resolutionY = 0;\nlet _pixelDepth = 0;\nlet _refreshRate = 0;\n\nconst videoTypes = {\n '-2': 'UNINITIALIZED',\n '-1': 'OTHER',\n '0': 'HD15',\n '1': 'SVIDEO',\n '2': 'Composite video',\n '3': 'Component video',\n '4': 'DVI',\n '5': 'HDMI',\n '6': 'LVDS',\n '8': 'D_JPN',\n '9': 'SDI',\n '10': 'DP',\n '11': 'DP embedded',\n '12': 'UDI',\n '13': 'UDI embedded',\n '14': 'SDTVDONGLE',\n '15': 'MIRACAST',\n '2147483648': 'INTERNAL'\n};\n\nfunction getVendorFromModel(model) {\n const manufacturers = [\n { pattern: '^LG.+', manufacturer: 'LG' },\n { pattern: '^BENQ.+', manufacturer: 'BenQ' },\n { pattern: '^ASUS.+', manufacturer: 'Asus' },\n { pattern: '^DELL.+', manufacturer: 'Dell' },\n { pattern: '^SAMSUNG.+', manufacturer: 'Samsung' },\n { pattern: '^VIEWSON.+', manufacturer: 'ViewSonic' },\n { pattern: '^SONY.+', manufacturer: 'Sony' },\n { pattern: '^ACER.+', manufacturer: 'Acer' },\n { pattern: '^AOC.+', manufacturer: 'AOC Monitors' },\n { pattern: '^HP.+', manufacturer: 'HP' },\n { pattern: '^EIZO.?', manufacturer: 'Eizo' },\n { pattern: '^PHILIPS.?', manufacturer: 'Philips' },\n { pattern: '^IIYAMA.?', manufacturer: 'Iiyama' },\n { pattern: '^SHARP.?', manufacturer: 'Sharp' },\n { pattern: '^NEC.?', manufacturer: 'NEC' },\n { pattern: '^LENOVO.?', manufacturer: 'Lenovo' },\n { pattern: 'COMPAQ.?', manufacturer: 'Compaq' },\n { pattern: 'APPLE.?', manufacturer: 'Apple' },\n { pattern: 'INTEL.?', manufacturer: 'Intel' },\n { pattern: 'AMD.?', manufacturer: 'AMD' },\n { pattern: 'NVIDIA.?', manufacturer: 'NVDIA' },\n ];\n\n let result = '';\n if (model) {\n model = model.toUpperCase();\n manufacturers.forEach((manufacturer) => {\n const re = RegExp(manufacturer.pattern);\n if (re.test(model)) { result = manufacturer.manufacturer; }\n });\n }\n return result;\n}\n\nfunction getVendorFromId(id) {\n const vendors = {\n '610': 'Apple',\n '1e6d': 'LG',\n '10ac': 'DELL',\n '4dd9': 'Sony',\n '38a3': 'NEC',\n };\n return vendors[id] || '';\n}\n\nfunction vendorToId(str) {\n let result = '';\n str = (str || '').toLowerCase();\n if (str.indexOf('apple') >= 0) { result = '0x05ac'; }\n else if (str.indexOf('nvidia') >= 0) { result = '0x10de'; }\n else if (str.indexOf('intel') >= 0) { result = '0x8086'; }\n else if (str.indexOf('ati') >= 0 || str.indexOf('amd') >= 0) { result = '0x1002'; }\n\n return result;\n}\n\nfunction getMetalVersion(id) {\n const families = {\n 'spdisplays_mtlgpufamilymac1': 'mac1',\n 'spdisplays_mtlgpufamilymac2': 'mac2',\n 'spdisplays_mtlgpufamilyapple1': 'apple1',\n 'spdisplays_mtlgpufamilyapple2': 'apple2',\n 'spdisplays_mtlgpufamilyapple3': 'apple3',\n 'spdisplays_mtlgpufamilyapple4': 'apple4',\n 'spdisplays_mtlgpufamilyapple5': 'apple5',\n 'spdisplays_mtlgpufamilyapple6': 'apple6',\n 'spdisplays_mtlgpufamilyapple7': 'apple7',\n 'spdisplays_metalfeaturesetfamily11': 'family1_v1',\n 'spdisplays_metalfeaturesetfamily12': 'family1_v2',\n 'spdisplays_metalfeaturesetfamily13': 'family1_v3',\n 'spdisplays_metalfeaturesetfamily14': 'family1_v4',\n 'spdisplays_metalfeaturesetfamily21': 'family2_v1'\n };\n return families[id] || '';\n}\n\nfunction graphics(callback) {\n\n function parseLinesDarwin(graphicsArr) {\n const res = {\n controllers: [],\n displays: []\n };\n try {\n graphicsArr.forEach(function (item) {\n // controllers\n const bus = ((item.sppci_bus || '').indexOf('builtin') > -1 ? 'Built-In' : ((item.sppci_bus || '').indexOf('pcie') > -1 ? 'PCIe' : ''));\n const vram = (parseInt((item.spdisplays_vram || ''), 10) || 0) * (((item.spdisplays_vram || '').indexOf('GB') > -1) ? 1024 : 1);\n const vramDyn = (parseInt((item.spdisplays_vram_shared || ''), 10) || 0) * (((item.spdisplays_vram_shared || '').indexOf('GB') > -1) ? 1024 : 1);\n let metalVersion = getMetalVersion(item.spdisplays_metal || item.spdisplays_metalfamily || '');\n res.controllers.push({\n vendor: getVendorFromModel(item.spdisplays_vendor || '') || item.spdisplays_vendor || '',\n model: item.sppci_model || '',\n bus,\n vramDynamic: bus === 'Built-In',\n vram: vram || vramDyn || null,\n deviceId: item['spdisplays_device-id'] || '',\n vendorId: item['spdisplays_vendor-id'] || vendorToId((item['spdisplays_vendor'] || '') + (item.sppci_model || '')),\n external: (item.sppci_device_type === 'spdisplays_egpu'),\n cores: item['sppci_cores'] || null,\n metalVersion\n });\n\n // displays\n if (item.spdisplays_ndrvs && item.spdisplays_ndrvs.length) {\n item.spdisplays_ndrvs.forEach(function (displayItem) {\n const connectionType = displayItem['spdisplays_connection_type'] || '';\n const currentResolutionParts = (displayItem['_spdisplays_resolution'] || '').split('@');\n const currentResolution = currentResolutionParts[0].split('x');\n const pixelParts = (displayItem['_spdisplays_pixels'] || '').split('x');\n const pixelDepthString = displayItem['spdisplays_depth'] || '';\n const serial = displayItem['_spdisplays_display-serial-number'] || displayItem['_spdisplays_display-serial-number2'] || null;\n res.displays.push({\n vendor: getVendorFromId(displayItem['_spdisplays_display-vendor-id'] || '') || getVendorFromModel(displayItem['_name'] || ''),\n vendorId: displayItem['_spdisplays_display-vendor-id'] || '',\n model: displayItem['_name'] || '',\n productionYear: displayItem['_spdisplays_display-year'] || null,\n serial: serial !== '0' ? serial : null,\n displayId: displayItem['_spdisplays_displayID'] || null,\n main: displayItem['spdisplays_main'] ? displayItem['spdisplays_main'] === 'spdisplays_yes' : false,\n builtin: (displayItem['spdisplays_display_type'] || '').indexOf('built-in') > -1,\n connection: ((connectionType.indexOf('_internal') > -1) ? 'Internal' : ((connectionType.indexOf('_displayport') > -1) ? 'Display Port' : ((connectionType.indexOf('_hdmi') > -1) ? 'HDMI' : null))),\n sizeX: null,\n sizeY: null,\n pixelDepth: (pixelDepthString === 'CGSThirtyBitColor' ? 30 : (pixelDepthString === 'CGSThirtytwoBitColor' ? 32 : (pixelDepthString === 'CGSTwentyfourBitColor' ? 24 : null))),\n resolutionX: pixelParts.length > 1 ? parseInt(pixelParts[0], 10) : null,\n resolutionY: pixelParts.length > 1 ? parseInt(pixelParts[1], 10) : null,\n currentResX: currentResolution.length > 1 ? parseInt(currentResolution[0], 10) : null,\n currentResY: currentResolution.length > 1 ? parseInt(currentResolution[1], 10) : null,\n positionX: 0,\n positionY: 0,\n currentRefreshRate: currentResolutionParts.length > 1 ? parseInt(currentResolutionParts[1], 10) : null,\n\n });\n });\n }\n });\n return res;\n } catch (e) {\n return res;\n }\n }\n\n function parseLinesLinuxControllers(lines) {\n let controllers = [];\n let currentController = {\n vendor: '',\n model: '',\n bus: '',\n busAddress: '',\n vram: null,\n vramDynamic: false,\n pciID: ''\n };\n let isGraphicsController = false;\n // PCI bus IDs\n let pciIDs = [];\n try {\n pciIDs = execSync('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep \"Bus Address: \"').toString().split('\\n');\n for (let i = 0; i < pciIDs.length; i++) {\n pciIDs[i] = pciIDs[i].replace('Bus Address:', '').replace('0000:', '').trim();\n }\n pciIDs = pciIDs.filter(function (el) {\n return el != null && el;\n });\n } catch (e) {\n util.noop();\n }\n for (let i = 0; i < lines.length; i++) {\n if ('' !== lines[i].trim()) {\n if (' ' !== lines[i][0] && '\\t' !== lines[i][0]) { // first line of new entry\n let isExternal = (pciIDs.indexOf(lines[i].split(' ')[0]) >= 0);\n let vgapos = lines[i].toLowerCase().indexOf(' vga ');\n let _3dcontrollerpos = lines[i].toLowerCase().indexOf('3d controller');\n if (vgapos !== -1 || _3dcontrollerpos !== -1) { // VGA\n if (_3dcontrollerpos !== -1 && vgapos === -1) {\n vgapos = _3dcontrollerpos;\n }\n if (currentController.vendor || currentController.model || currentController.bus || currentController.vram !== null || currentController.vramDynamic) { // already a controller found\n controllers.push(currentController);\n currentController = {\n vendor: '',\n model: '',\n bus: '',\n busAddress: '',\n vram: null,\n vramDynamic: false,\n };\n }\n\n const pciIDCandidate = lines[i].split(' ')[0];\n if (/[\\da-fA-F]{2}:[\\da-fA-F]{2}\\.[\\da-fA-F]/.test(pciIDCandidate)) {\n currentController.busAddress = pciIDCandidate;\n }\n isGraphicsController = true;\n let endpos = lines[i].search(/\\[[0-9a-f]{4}:[0-9a-f]{4}]|$/);\n let parts = lines[i].substr(vgapos, endpos - vgapos).split(':');\n currentController.busAddress = lines[i].substr(0, vgapos).trim();\n if (parts.length > 1) {\n parts[1] = parts[1].trim();\n if (parts[1].toLowerCase().indexOf('corporation') >= 0) {\n currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf('corporation') + 11).trim();\n currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf('corporation') + 11, 200).trim().split('(')[0];\n currentController.bus = (pciIDs.length > 0 && isExternal) ? 'PCIe' : 'Onboard';\n currentController.vram = null;\n currentController.vramDynamic = false;\n } else if (parts[1].toLowerCase().indexOf(' inc.') >= 0) {\n if ((parts[1].match(new RegExp(']', 'g')) || []).length > 1) {\n currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf(']') + 1).trim();\n currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(']') + 1, 200).trim().split('(')[0].trim();\n } else {\n currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf(' inc.') + 5).trim();\n currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(' inc.') + 5, 200).trim().split('(')[0].trim();\n }\n currentController.bus = (pciIDs.length > 0 && isExternal) ? 'PCIe' : 'Onboard';\n currentController.vram = null;\n currentController.vramDynamic = false;\n } else if (parts[1].toLowerCase().indexOf(' ltd.') >= 0) {\n if ((parts[1].match(new RegExp(']', 'g')) || []).length > 1) {\n currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf(']') + 1).trim();\n currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(']') + 1, 200).trim().split('(')[0].trim();\n } else {\n currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf(' ltd.') + 5).trim();\n currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(' ltd.') + 5, 200).trim().split('(')[0].trim();\n }\n }\n }\n\n } else {\n isGraphicsController = false;\n }\n }\n if (isGraphicsController) { // within VGA details\n let parts = lines[i].split(':');\n if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('devicename') !== -1 && parts[1].toLowerCase().indexOf('onboard') !== -1) { currentController.bus = 'Onboard'; }\n if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('region') !== -1 && parts[1].toLowerCase().indexOf('memory') !== -1) {\n let memparts = parts[1].split('=');\n if (memparts.length > 1) {\n currentController.vram = parseInt(memparts[1]);\n }\n }\n }\n }\n }\n if (currentController.vendor || currentController.model || currentController.bus || currentController.busAddress || currentController.vram !== null || currentController.vramDynamic) { // already a controller found\n controllers.push(currentController);\n }\n return (controllers);\n }\n\n function parseLinesLinuxClinfo(controllers, lines) {\n const fieldPattern = /\\[([^\\]]+)\\]\\s+(\\w+)\\s+(.*)/;\n const devices = lines.reduce((devices, line) => {\n const field = fieldPattern.exec(line.trim());\n if (field) {\n if (!devices[field[1]]) {\n devices[field[1]] = {};\n }\n devices[field[1]][field[2]] = field[3];\n }\n return devices;\n }, {});\n for (let deviceId in devices) {\n const device = devices[deviceId];\n if (device['CL_DEVICE_TYPE'] === 'CL_DEVICE_TYPE_GPU') {\n let busAddress;\n if (device['CL_DEVICE_TOPOLOGY_AMD']) {\n const bdf = device['CL_DEVICE_TOPOLOGY_AMD'].match(/[a-zA-Z0-9]+:\\d+\\.\\d+/);\n if (bdf) {\n busAddress = bdf[0];\n }\n } else if (device['CL_DEVICE_PCI_BUS_ID_NV'] && device['CL_DEVICE_PCI_SLOT_ID_NV']) {\n const bus = parseInt(device['CL_DEVICE_PCI_BUS_ID_NV']);\n const slot = parseInt(device['CL_DEVICE_PCI_SLOT_ID_NV']);\n if (!isNaN(bus) && !isNaN(slot)) {\n const b = bus & 0xff;\n const d = (slot >> 3) & 0xff;\n const f = slot & 0x07;\n busAddress = `${b.toString().padStart(2, '0')}:${d.toString().padStart(2, '0')}.${f}`;\n }\n }\n if (busAddress) {\n let controller = controllers.find(controller => controller.busAddress === busAddress);\n if (!controller) {\n controller = {\n vendor: '',\n model: '',\n bus: '',\n busAddress,\n vram: null,\n vramDynamic: false\n };\n controllers.push(controller);\n }\n controller.vendor = device['CL_DEVICE_VENDOR'];\n if (device['CL_DEVICE_BOARD_NAME_AMD']) {\n controller.model = device['CL_DEVICE_BOARD_NAME_AMD'];\n } else {\n controller.model = device['CL_DEVICE_NAME'];\n }\n const memory = parseInt(device['CL_DEVICE_GLOBAL_MEM_SIZE']);\n if (!isNaN(memory)) {\n controller.vram = Math.round(memory / 1024 / 1024);\n }\n }\n }\n }\n return controllers;\n }\n\n function getNvidiaSmi() {\n if (_nvidiaSmiPath) {\n return _nvidiaSmiPath;\n }\n\n if (_windows) {\n try {\n const basePath = util.WINDIR + '\\\\System32\\\\DriverStore\\\\FileRepository';\n // find all directories that have an nvidia-smi.exe file\n const candidateDirs = fs.readdirSync(basePath).filter(dir => {\n return fs.readdirSync([basePath, dir].join('/')).includes('nvidia-smi.exe');\n });\n // use the directory with the most recently created nvidia-smi.exe file\n const targetDir = candidateDirs.reduce((prevDir, currentDir) => {\n const previousNvidiaSmi = fs.statSync([basePath, prevDir, 'nvidia-smi.exe'].join('/'));\n const currentNvidiaSmi = fs.statSync([basePath, currentDir, 'nvidia-smi.exe'].join('/'));\n return (previousNvidiaSmi.ctimeMs > currentNvidiaSmi.ctimeMs) ? prevDir : currentDir;\n });\n\n if (targetDir) {\n _nvidiaSmiPath = [basePath, targetDir, 'nvidia-smi.exe'].join('/');\n }\n } catch (e) {\n util.noop();\n }\n } else if (_linux) {\n _nvidiaSmiPath = 'nvidia-smi';\n }\n return _nvidiaSmiPath;\n }\n\n function nvidiaSmi(options) {\n const nvidiaSmiExe = getNvidiaSmi();\n options = options || util.execOptsWin;\n if (nvidiaSmiExe) {\n const nvidiaSmiOpts = '--query-gpu=driver_version,pci.sub_device_id,name,pci.bus_id,fan.speed,memory.total,memory.used,memory.free,utilization.gpu,utilization.memory,temperature.gpu,temperature.memory,power.draw,power.limit,clocks.gr,clocks.mem --format=csv,noheader,nounits';\n const cmd = nvidiaSmiExe + ' ' + nvidiaSmiOpts + (_linux ? ' 2>/dev/null' : '');\n try {\n const res = execSync(cmd, options).toString();\n return res;\n } catch (e) {\n util.noop();\n }\n }\n return '';\n }\n\n function nvidiaDevices() {\n\n function safeParseNumber(value) {\n if ([null, undefined].includes(value)) {\n return value;\n }\n return parseFloat(value);\n }\n\n const stdout = nvidiaSmi();\n if (!stdout) {\n return [];\n }\n\n const gpus = stdout.split('\\n').filter(Boolean);\n const results = gpus.map(gpu => {\n const splittedData = gpu.split(', ').map(value => value.includes('N/A') ? undefined : value);\n if (splittedData.length === 16) {\n return {\n driverVersion: splittedData[0],\n subDeviceId: splittedData[1],\n name: splittedData[2],\n pciBus: splittedData[3],\n fanSpeed: safeParseNumber(splittedData[4]),\n memoryTotal: safeParseNumber(splittedData[5]),\n memoryUsed: safeParseNumber(splittedData[6]),\n memoryFree: safeParseNumber(splittedData[7]),\n utilizationGpu: safeParseNumber(splittedData[8]),\n utilizationMemory: safeParseNumber(splittedData[9]),\n temperatureGpu: safeParseNumber(splittedData[10]),\n temperatureMemory: safeParseNumber(splittedData[11]),\n powerDraw: safeParseNumber(splittedData[12]),\n powerLimit: safeParseNumber(splittedData[13]),\n clockCore: safeParseNumber(splittedData[14]),\n clockMemory: safeParseNumber(splittedData[15]),\n };\n }\n });\n\n return results;\n }\n\n function mergeControllerNvidia(controller, nvidia) {\n if (nvidia.driverVersion) { controller.driverVersion = nvidia.driverVersion; }\n if (nvidia.subDeviceId) { controller.subDeviceId = nvidia.subDeviceId; }\n if (nvidia.name) { controller.name = nvidia.name; }\n if (nvidia.pciBus) { controller.pciBus = nvidia.pciBus; }\n if (nvidia.fanSpeed) { controller.fanSpeed = nvidia.fanSpeed; }\n if (nvidia.memoryTotal) {\n controller.memoryTotal = nvidia.memoryTotal;\n controller.vram = nvidia.memoryTotal;\n controller.vramDynamic = false;\n }\n if (nvidia.memoryUsed) { controller.memoryUsed = nvidia.memoryUsed; }\n if (nvidia.memoryFree) { controller.memoryFree = nvidia.memoryFree; }\n if (nvidia.utilizationGpu) { controller.utilizationGpu = nvidia.utilizationGpu; }\n if (nvidia.utilizationMemory) { controller.utilizationMemory = nvidia.utilizationMemory; }\n if (nvidia.temperatureGpu) { controller.temperatureGpu = nvidia.temperatureGpu; }\n if (nvidia.temperatureMemory) { controller.temperatureMemory = nvidia.temperatureMemory; }\n if (nvidia.powerDraw) { controller.powerDraw = nvidia.powerDraw; }\n if (nvidia.powerLimit) { controller.powerLimit = nvidia.powerLimit; }\n if (nvidia.clockCore) { controller.clockCore = nvidia.clockCore; }\n if (nvidia.clockMemory) { controller.clockMemory = nvidia.clockMemory; }\n return controller;\n }\n\n function parseLinesLinuxEdid(edid) {\n // parsen EDID\n // --> model\n // --> resolutionx\n // --> resolutiony\n // --> builtin = false\n // --> pixeldepth (?)\n // --> sizex\n // --> sizey\n let result = {\n vendor: '',\n model: '',\n deviceName: '',\n main: false,\n builtin: false,\n connection: '',\n sizeX: null,\n sizeY: null,\n pixelDepth: null,\n resolutionX: null,\n resolutionY: null,\n currentResX: null,\n currentResY: null,\n positionX: 0,\n positionY: 0,\n currentRefreshRate: null\n };\n // find first \"Detailed Timing Description\"\n let start = 108;\n if (edid.substr(start, 6) === '000000') {\n start += 36;\n }\n if (edid.substr(start, 6) === '000000') {\n start += 36;\n }\n if (edid.substr(start, 6) === '000000') {\n start += 36;\n }\n if (edid.substr(start, 6) === '000000') {\n start += 36;\n }\n result.resolutionX = parseInt('0x0' + edid.substr(start + 8, 1) + edid.substr(start + 4, 2));\n result.resolutionY = parseInt('0x0' + edid.substr(start + 14, 1) + edid.substr(start + 10, 2));\n result.sizeX = parseInt('0x0' + edid.substr(start + 28, 1) + edid.substr(start + 24, 2));\n result.sizeY = parseInt('0x0' + edid.substr(start + 29, 1) + edid.substr(start + 26, 2));\n // monitor name\n start = edid.indexOf('000000fc00'); // find first \"Monitor Description Data\"\n if (start >= 0) {\n let model_raw = edid.substr(start + 10, 26);\n if (model_raw.indexOf('0a') !== -1) {\n model_raw = model_raw.substr(0, model_raw.indexOf('0a'));\n }\n try {\n if (model_raw.length > 2) {\n result.model = model_raw.match(/.{1,2}/g).map(function (v) {\n return String.fromCharCode(parseInt(v, 16));\n }).join('');\n }\n } catch (e) {\n util.noop();\n }\n } else {\n result.model = '';\n }\n return result;\n }\n\n function parseLinesLinuxDisplays(lines, depth) {\n let displays = [];\n let currentDisplay = {\n vendor: '',\n model: '',\n deviceName: '',\n main: false,\n builtin: false,\n connection: '',\n sizeX: null,\n sizeY: null,\n pixelDepth: null,\n resolutionX: null,\n resolutionY: null,\n currentResX: null,\n currentResY: null,\n positionX: 0,\n positionY: 0,\n currentRefreshRate: null\n };\n let is_edid = false;\n let is_current = false;\n let edid_raw = '';\n let start = 0;\n for (let i = 1; i < lines.length; i++) { // start with second line\n if ('' !== lines[i].trim()) {\n if (' ' !== lines[i][0] && '\\t' !== lines[i][0] && lines[i].toLowerCase().indexOf(' connected ') !== -1) { // first line of new entry\n if (currentDisplay.model || currentDisplay.main || currentDisplay.builtin || currentDisplay.connection || currentDisplay.sizeX !== null || currentDisplay.pixelDepth !== null || currentDisplay.resolutionX !== null) { // push last display to array\n displays.push(currentDisplay);\n currentDisplay = {\n vendor: '',\n model: '',\n main: false,\n builtin: false,\n connection: '',\n sizeX: null,\n sizeY: null,\n pixelDepth: null,\n resolutionX: null,\n resolutionY: null,\n currentResX: null,\n currentResY: null,\n positionX: 0,\n positionY: 0,\n currentRefreshRate: null\n };\n }\n let parts = lines[i].split(' ');\n currentDisplay.connection = parts[0];\n currentDisplay.main = lines[i].toLowerCase().indexOf(' primary ') >= 0;\n currentDisplay.builtin = (parts[0].toLowerCase().indexOf('edp') >= 0);\n }\n\n // try to read EDID information\n if (is_edid) {\n if (lines[i].search(/\\S|$/) > start) {\n edid_raw += lines[i].toLowerCase().trim();\n } else {\n // parsen EDID\n let edid_decoded = parseLinesLinuxEdid(edid_raw);\n currentDisplay.vendor = edid_decoded.vendor;\n currentDisplay.model = edid_decoded.model;\n currentDisplay.resolutionX = edid_decoded.resolutionX;\n currentDisplay.resolutionY = edid_decoded.resolutionY;\n currentDisplay.sizeX = edid_decoded.sizeX;\n currentDisplay.sizeY = edid_decoded.sizeY;\n currentDisplay.pixelDepth = depth;\n is_edid = false;\n }\n }\n if (lines[i].toLowerCase().indexOf('edid:') >= 0) {\n is_edid = true;\n start = lines[i].search(/\\S|$/);\n }\n if (lines[i].toLowerCase().indexOf('*current') >= 0) {\n const parts1 = lines[i].split('(');\n if (parts1 && parts1.length > 1 && parts1[0].indexOf('x') >= 0) {\n const resParts = parts1[0].trim().split('x');\n currentDisplay.currentResX = util.toInt(resParts[0]);\n currentDisplay.currentResY = util.toInt(resParts[1]);\n }\n is_current = true;\n }\n if (is_current && lines[i].toLowerCase().indexOf('clock') >= 0 && lines[i].toLowerCase().indexOf('hz') >= 0 && lines[i].toLowerCase().indexOf('v: height') >= 0) {\n const parts1 = lines[i].split('clock');\n if (parts1 && parts1.length > 1 && parts1[1].toLowerCase().indexOf('hz') >= 0) {\n currentDisplay.currentRefreshRate = util.toInt(parts1[1]);\n }\n is_current = false;\n }\n }\n }\n\n // pushen displays\n if (currentDisplay.model || currentDisplay.main || currentDisplay.builtin || currentDisplay.connection || currentDisplay.sizeX !== null || currentDisplay.pixelDepth !== null || currentDisplay.resolutionX !== null) { // still information there\n displays.push(currentDisplay);\n }\n return displays;\n }\n\n // function starts here\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = {\n controllers: [],\n displays: []\n };\n if (_darwin) {\n let cmd = 'system_profiler -xml -detailLevel full SPDisplaysDataType';\n exec(cmd, function (error, stdout) {\n if (!error) {\n try {\n let output = stdout.toString();\n result = parseLinesDarwin(util.plistParser(output)[0]._items);\n } catch (e) {\n util.noop();\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_linux) {\n // Raspberry: https://elinux.org/RPI_vcgencmd_usage\n if (util.isRaspberry() && util.isRaspbian()) {\n let cmd = 'fbset -s | grep \\'mode \"\\'; vcgencmd get_mem gpu; tvservice -s; tvservice -n;';\n exec(cmd, function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n if (lines.length > 3 && lines[0].indexOf('mode \"') >= -1 && lines[2].indexOf('0x12000a') > -1) {\n const parts = lines[0].replace('mode', '').replace(/\"/g, '').trim().split('x');\n if (parts.length === 2) {\n result.displays.push({\n vendor: '',\n model: util.getValue(lines, 'device_name', '='),\n main: true,\n builtin: false,\n connection: 'HDMI',\n sizeX: null,\n sizeY: null,\n pixelDepth: null,\n resolutionX: parseInt(parts[0], 10),\n resolutionY: parseInt(parts[1], 10),\n currentResX: null,\n currentResY: null,\n positionX: 0,\n positionY: 0,\n currentRefreshRate: null\n });\n }\n }\n if (lines.length > 1 && stdout.toString().indexOf('gpu=') >= -1) {\n result.controllers.push({\n vendor: 'Broadcom',\n model: 'VideoCore IV',\n bus: '',\n vram: util.getValue(lines, 'gpu', '=').replace('M', ''),\n vramDynamic: true\n });\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else {\n let cmd = 'lspci -vvv 2>/dev/null';\n exec(cmd, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n result.controllers = parseLinesLinuxControllers(lines);\n const nvidiaData = nvidiaDevices();\n // needs to be rewritten ... using no spread operators\n result.controllers = result.controllers.map((controller) => { // match by busAddress\n return mergeControllerNvidia(controller, nvidiaData.find((contr) => contr.pciBus.toLowerCase().endsWith(controller.busAddress.toLowerCase())) || {});\n });\n }\n let cmd = 'clinfo --raw';\n exec(cmd, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n result.controllers = parseLinesLinuxClinfo(result.controllers, lines);\n }\n let cmd = 'xdpyinfo 2>/dev/null | grep \\'depth of root window\\' | awk \\'{ print $5 }\\'';\n exec(cmd, function (error, stdout) {\n let depth = 0;\n if (!error) {\n let lines = stdout.toString().split('\\n');\n depth = parseInt(lines[0]) || 0;\n }\n let cmd = 'xrandr --verbose 2>/dev/null';\n exec(cmd, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n result.displays = parseLinesLinuxDisplays(lines, depth);\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n });\n });\n });\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n if (callback) { callback(null); }\n resolve(null);\n }\n if (_sunos) {\n if (callback) { callback(null); }\n resolve(null);\n }\n if (_windows) {\n\n // https://blogs.technet.microsoft.com/heyscriptingguy/2013/10/03/use-powershell-to-discover-multi-monitor-information/\n // https://devblogs.microsoft.com/scripting/use-powershell-to-discover-multi-monitor-information/\n try {\n const workload = [];\n workload.push(util.powerShell('Get-WmiObject win32_VideoController | fl *'));\n workload.push(util.powerShell('gp \"HKLM:\\\\SYSTEM\\\\ControlSet001\\\\Control\\\\Class\\\\{4d36e968-e325-11ce-bfc1-08002be10318}\\\\*\" -ErrorAction SilentlyContinue | where MatchingDeviceId $null -NE | select MatchingDeviceId,HardwareInformation.qwMemorySize | fl'));\n workload.push(util.powerShell('Get-WmiObject win32_desktopmonitor | fl *'));\n workload.push(util.powerShell('Get-CimInstance -Namespace root\\\\wmi -ClassName WmiMonitorBasicDisplayParams | fl'));\n workload.push(util.powerShell('Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Screen]::AllScreens'));\n workload.push(util.powerShell('Get-CimInstance -Namespace root\\\\wmi -ClassName WmiMonitorConnectionParams | fl'));\n workload.push(util.powerShell('gwmi WmiMonitorID -Namespace root\\\\wmi | ForEach-Object {(($_.ManufacturerName -notmatch 0 | foreach {[char]$_}) -join \"\") + \"|\" + (($_.ProductCodeID -notmatch 0 | foreach {[char]$_}) -join \"\") + \"|\" + (($_.UserFriendlyName -notmatch 0 | foreach {[char]$_}) -join \"\") + \"|\" + (($_.SerialNumberID -notmatch 0 | foreach {[char]$_}) -join \"\") + \"|\" + $_.InstanceName}'));\n\n const nvidiaData = nvidiaDevices();\n\n Promise.all(\n workload\n ).then(data => {\n // controller + vram\n let csections = data[0].replace(/\\r/g, '').split(/\\n\\s*\\n/);\n let vsections = data[1].replace(/\\r/g, '').split(/\\n\\s*\\n/);\n result.controllers = parseLinesWindowsControllers(csections, vsections);\n result.controllers = result.controllers.map((controller) => { // match by subDeviceId\n if (controller.vendor.toLowerCase() === 'nvidia') {\n return mergeControllerNvidia(controller, nvidiaData.find(device => {\n let windowsSubDeviceId = (controller.subDeviceId || '').toLowerCase();\n const nvidiaSubDeviceIdParts = device.subDeviceId.split('x');\n let nvidiaSubDeviceId = nvidiaSubDeviceIdParts.length > 1 ? nvidiaSubDeviceIdParts[1].toLowerCase() : nvidiaSubDeviceIdParts[0].toLowerCase();\n const lengthDifference = Math.abs(windowsSubDeviceId.length - nvidiaSubDeviceId.length);\n if (windowsSubDeviceId.length > nvidiaSubDeviceId.length) {\n for (let i = 0; i < lengthDifference; i++) {\n nvidiaSubDeviceId = '0' + nvidiaSubDeviceId;\n }\n } else if (windowsSubDeviceId.length < nvidiaSubDeviceId.length) {\n for (let i = 0; i < lengthDifference; i++) {\n windowsSubDeviceId = '0' + windowsSubDeviceId;\n }\n }\n return windowsSubDeviceId === nvidiaSubDeviceId;\n }) || {});\n } else {\n return controller;\n }\n });\n\n // displays\n let dsections = data[2].replace(/\\r/g, '').split(/\\n\\s*\\n/);\n // result.displays = parseLinesWindowsDisplays(dsections);\n if (dsections[0].trim() === '') { dsections.shift(); }\n if (dsections.length && dsections[dsections.length - 1].trim() === '') { dsections.pop(); }\n\n // monitor (powershell)\n let msections = data[3].replace(/\\r/g, '').split('Active ');\n msections.shift();\n\n // forms.screens (powershell)\n let ssections = data[4].replace(/\\r/g, '').split('BitsPerPixel ');\n ssections.shift();\n\n // connection params (powershell) - video type\n let tsections = data[5].replace(/\\r/g, '').split(/\\n\\s*\\n/);\n tsections.shift();\n\n // monitor ID (powershell) - model / vendor\n const res = data[6].replace(/\\r/g, '').split(/\\n/);\n let isections = [];\n res.forEach(element => {\n const parts = element.split('|');\n if (parts.length === 5) {\n isections.push({\n vendor: parts[0],\n code: parts[1],\n model: parts[2],\n serial: parts[3],\n instanceId: parts[4]\n });\n }\n });\n\n result.displays = parseLinesWindowsDisplaysPowershell(ssections, msections, dsections, tsections, isections);\n\n if (result.displays.length === 1) {\n if (_resolutionX) {\n result.displays[0].resolutionX = _resolutionX;\n if (!result.displays[0].currentResX) {\n result.displays[0].currentResX = _resolutionX;\n }\n }\n if (_resolutionY) {\n result.displays[0].resolutionY = _resolutionY;\n if (result.displays[0].currentResY === 0) {\n result.displays[0].currentResY = _resolutionY;\n }\n }\n if (_pixelDepth) {\n result.displays[0].pixelDepth = _pixelDepth;\n }\n if (_refreshRate && !result.displays[0].currentRefreshRate) {\n result.displays[0].currentRefreshRate = _refreshRate;\n }\n }\n\n if (callback) {\n callback(result);\n }\n resolve(result);\n })\n .catch(() => {\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n\n function parseLinesWindowsControllers(sections, vections) {\n const memorySizes = {};\n for (const i in vections) {\n if ({}.hasOwnProperty.call(vections, i)) {\n if (vections[i].trim() !== '') {\n const lines = vections[i].trim().split('\\n');\n const matchingDeviceId = util.getValue(lines, 'MatchingDeviceId').match(/PCI\\\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i);\n if (matchingDeviceId) {\n const quadWordmemorySize = parseInt(util.getValue(lines, 'HardwareInformation.qwMemorySize'));\n if (!isNaN(quadWordmemorySize)) {\n let deviceId = matchingDeviceId[1].toUpperCase() + '&' + matchingDeviceId[2].toUpperCase();\n if (matchingDeviceId[3]) {\n deviceId += '&' + matchingDeviceId[3].toUpperCase();\n }\n if (matchingDeviceId[4]) {\n deviceId += '&' + matchingDeviceId[4].toUpperCase();\n }\n memorySizes[deviceId] = quadWordmemorySize;\n }\n }\n }\n }\n }\n\n let controllers = [];\n for (let i in sections) {\n if ({}.hasOwnProperty.call(sections, i)) {\n if (sections[i].trim() !== '') {\n let lines = sections[i].trim().split('\\n');\n let pnpDeviceId = util.getValue(lines, 'PNPDeviceID', ':').match(/PCI\\\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i);\n let subDeviceId = null;\n let memorySize = null;\n if (pnpDeviceId) {\n subDeviceId = pnpDeviceId[3] || '';\n if (subDeviceId) {\n subDeviceId = subDeviceId.split('_')[1];\n }\n\n // Match PCI device identifier (there's an order of increasing generality):\n // https://docs.microsoft.com/en-us/windows-hardware/drivers/install/identifiers-for-pci-devices\n\n // PCI\\VEN_v(4)&DEV_d(4)&SUBSYS_s(4)n(4)&REV_r(2)\n if (memorySize == null && pnpDeviceId[3] && pnpDeviceId[4]) {\n const deviceId = pnpDeviceId[1].toUpperCase() + '&' + pnpDeviceId[2].toUpperCase() + '&' + pnpDeviceId[3].toUpperCase() + '&' + pnpDeviceId[4].toUpperCase();\n if ({}.hasOwnProperty.call(memorySizes, deviceId)) {\n memorySize = memorySizes[deviceId];\n }\n }\n\n // PCI\\VEN_v(4)&DEV_d(4)&SUBSYS_s(4)n(4)\n if (memorySize == null && pnpDeviceId[3]) {\n const deviceId = pnpDeviceId[1].toUpperCase() + '&' + pnpDeviceId[2].toUpperCase() + '&' + pnpDeviceId[3].toUpperCase();\n if ({}.hasOwnProperty.call(memorySizes, deviceId)) {\n memorySize = memorySizes[deviceId];\n }\n }\n\n // PCI\\VEN_v(4)&DEV_d(4)&REV_r(2)\n if (memorySize == null && pnpDeviceId[4]) {\n const deviceId = pnpDeviceId[1].toUpperCase() + '&' + pnpDeviceId[2].toUpperCase() + '&' + pnpDeviceId[4].toUpperCase();\n if ({}.hasOwnProperty.call(memorySizes, deviceId)) {\n memorySize = memorySizes[deviceId];\n }\n }\n\n // PCI\\VEN_v(4)&DEV_d(4)\n if (memorySize == null) {\n const deviceId = pnpDeviceId[1].toUpperCase() + '&' + pnpDeviceId[2].toUpperCase();\n if ({}.hasOwnProperty.call(memorySizes, deviceId)) {\n memorySize = memorySizes[deviceId];\n }\n }\n }\n\n controllers.push({\n vendor: util.getValue(lines, 'AdapterCompatibility', ':'),\n model: util.getValue(lines, 'name', ':'),\n bus: util.getValue(lines, 'PNPDeviceID', ':').startsWith('PCI') ? 'PCI' : '',\n vram: (memorySize == null ? util.toInt(util.getValue(lines, 'AdapterRAM', ':')) : memorySize) / 1024 / 1024,\n vramDynamic: (util.getValue(lines, 'VideoMemoryType', ':') === '2'),\n subDeviceId\n });\n _resolutionX = util.toInt(util.getValue(lines, 'CurrentHorizontalResolution', ':')) || _resolutionX;\n _resolutionY = util.toInt(util.getValue(lines, 'CurrentVerticalResolution', ':')) || _resolutionY;\n _refreshRate = util.toInt(util.getValue(lines, 'CurrentRefreshRate', ':')) || _refreshRate;\n _pixelDepth = util.toInt(util.getValue(lines, 'CurrentBitsPerPixel', ':')) || _pixelDepth;\n }\n }\n }\n return controllers;\n }\n\n function parseLinesWindowsDisplaysPowershell(ssections, msections, dsections, tsections, isections) {\n let displays = [];\n let vendor = '';\n let model = '';\n let deviceID = '';\n let resolutionX = 0;\n let resolutionY = 0;\n if (dsections && dsections.length) {\n let linesDisplay = dsections[0].split('\\n');\n vendor = util.getValue(linesDisplay, 'MonitorManufacturer', ':');\n model = util.getValue(linesDisplay, 'Name', ':');\n deviceID = util.getValue(linesDisplay, 'PNPDeviceID', ':').replace(/&/g, '&').toLowerCase();\n resolutionX = util.toInt(util.getValue(linesDisplay, 'ScreenWidth', ':'));\n resolutionY = util.toInt(util.getValue(linesDisplay, 'ScreenHeight', ':'));\n }\n for (let i = 0; i < ssections.length; i++) {\n if (ssections[i].trim() !== '') {\n ssections[i] = 'BitsPerPixel ' + ssections[i];\n msections[i] = 'Active ' + msections[i];\n // tsections can be empty OR undefined on earlier versions of powershell (<=2.0)\n // Tag connection type as UNKNOWN by default if this information is missing\n if (tsections.length === 0 || tsections[i] === undefined) {\n tsections[i] = 'Unknown';\n }\n let linesScreen = ssections[i].split('\\n');\n let linesMonitor = msections[i].split('\\n');\n\n let linesConnection = tsections[i].split('\\n');\n const bitsPerPixel = util.getValue(linesScreen, 'BitsPerPixel');\n const bounds = util.getValue(linesScreen, 'Bounds').replace('{', '').replace('}', '').replace(/=/g, ':').split(',');\n const primary = util.getValue(linesScreen, 'Primary');\n const sizeX = util.getValue(linesMonitor, 'MaxHorizontalImageSize');\n const sizeY = util.getValue(linesMonitor, 'MaxVerticalImageSize');\n const instanceName = util.getValue(linesMonitor, 'InstanceName').toLowerCase();\n const videoOutputTechnology = util.getValue(linesConnection, 'VideoOutputTechnology');\n const deviceName = util.getValue(linesScreen, 'DeviceName');\n let displayVendor = '';\n let displayModel = '';\n isections.forEach(element => {\n if (element.instanceId.toLowerCase().startsWith(instanceName) && vendor.startsWith('(') && model.startsWith('PnP')) {\n displayVendor = element.vendor;\n displayModel = element.model;\n }\n });\n displays.push({\n vendor: instanceName.startsWith(deviceID) && displayVendor === '' ? vendor : displayVendor,\n model: instanceName.startsWith(deviceID) && displayModel === '' ? model : displayModel,\n deviceName,\n main: primary.toLowerCase() === 'true',\n builtin: videoOutputTechnology === '2147483648',\n connection: videoOutputTechnology && videoTypes[videoOutputTechnology] ? videoTypes[videoOutputTechnology] : '',\n resolutionX: util.toInt(util.getValue(bounds, 'Width', ':')),\n resolutionY: util.toInt(util.getValue(bounds, 'Height', ':')),\n sizeX: sizeX ? parseInt(sizeX, 10) : null,\n sizeY: sizeY ? parseInt(sizeY, 10) : null,\n pixelDepth: bitsPerPixel,\n currentResX: util.toInt(util.getValue(bounds, 'Width', ':')),\n currentResY: util.toInt(util.getValue(bounds, 'Height', ':')),\n positionX: util.toInt(util.getValue(bounds, 'X', ':')),\n positionY: util.toInt(util.getValue(bounds, 'Y', ':')),\n });\n }\n }\n if (ssections.length === 0) {\n displays.push({\n vendor,\n model,\n main: true,\n sizeX: null,\n sizeY: null,\n resolutionX,\n resolutionY,\n pixelDepth: null,\n currentResX: resolutionX,\n currentResY: resolutionY,\n positionX: 0,\n positionY: 0\n });\n }\n return displays;\n }\n}\n\nexports.graphics = graphics;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// index.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// Contributors: Guillaume Legrain (https://github.com/glegrain)\n// Riccardo Novaglia (https://github.com/richy24)\n// Quentin Busuttil (https://github.com/Buzut)\n// Lapsio (https://github.com/lapsio)\n// csy (https://github.com/csy1983)\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n\n// ----------------------------------------------------------------------------------\n// Dependencies\n// ----------------------------------------------------------------------------------\n\nconst lib_version = require('../package.json').version;\nconst util = require('./util');\nconst system = require('./system');\nconst osInfo = require('./osinfo');\nconst cpu = require('./cpu');\nconst memory = require('./memory');\nconst battery = require('./battery');\nconst graphics = require('./graphics');\nconst filesystem = require('./filesystem');\nconst network = require('./network');\nconst wifi = require('./wifi');\nconst processes = require('./processes');\nconst users = require('./users');\nconst internet = require('./internet');\nconst docker = require('./docker');\nconst vbox = require('./virtualbox');\nconst printer = require('./printer');\nconst usb = require('./usb');\nconst audio = require('./audio');\nconst bluetooth = require('./bluetooth');\n\nlet _platform = process.platform;\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\n// ----------------------------------------------------------------------------------\n// init\n// ----------------------------------------------------------------------------------\n\nif (_windows) {\n util.getCodepage();\n}\n\n// ----------------------------------------------------------------------------------\n// General\n// ----------------------------------------------------------------------------------\n\nfunction version() {\n return lib_version;\n}\n\n// ----------------------------------------------------------------------------------\n// Get static and dynamic data (all)\n// ----------------------------------------------------------------------------------\n\n// --------------------------\n// get static data - they should not change until restarted\n\nfunction getStaticData(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let data = {};\n\n data.version = version();\n\n Promise.all([\n system.system(),\n system.bios(),\n system.baseboard(),\n system.chassis(),\n osInfo.osInfo(),\n osInfo.uuid(),\n osInfo.versions(),\n cpu.cpu(),\n cpu.cpuFlags(),\n graphics.graphics(),\n network.networkInterfaces(),\n memory.memLayout(),\n filesystem.diskLayout()\n ]).then(res => {\n data.system = res[0];\n data.bios = res[1];\n data.baseboard = res[2];\n data.chassis = res[3];\n data.os = res[4];\n data.uuid = res[5];\n data.versions = res[6];\n data.cpu = res[7];\n data.cpu.flags = res[8];\n data.graphics = res[9];\n data.net = res[10];\n data.memLayout = res[11];\n data.diskLayout = res[12];\n if (callback) { callback(data); }\n resolve(data);\n });\n });\n });\n}\n\n\n// --------------------------\n// get all dynamic data - e.g. for monitoring agents\n// may take some seconds to get all data\n// --------------------------\n// 2 additional parameters needed\n// - srv: \t\tcomma separated list of services to monitor e.g. \"mysql, apache, postgresql\"\n// - iface:\tdefine network interface for which you like to monitor network speed e.g. \"eth0\"\n\nfunction getDynamicData(srv, iface, callback) {\n\n if (util.isFunction(iface)) {\n callback = iface;\n iface = '';\n }\n if (util.isFunction(srv)) {\n callback = srv;\n srv = '';\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n iface = iface || network.getDefaultNetworkInterface();\n srv = srv || '';\n\n // use closure to track ƒ completion\n let functionProcessed = (function () {\n let totalFunctions = 15;\n if (_windows) { totalFunctions = 13; }\n if (_freebsd || _openbsd || _netbsd) { totalFunctions = 11; }\n if (_sunos) { totalFunctions = 6; }\n\n return function () {\n if (--totalFunctions === 0) {\n if (callback) {\n callback(data);\n }\n resolve(data);\n }\n };\n })();\n\n // var totalFunctions = 14;\n // function functionProcessed() {\n // if (--totalFunctions === 0) {\n // if (callback) { callback(data) }\n // resolve(data);\n // }\n // }\n\n let data = {};\n\n // get time\n data.time = osInfo.time();\n\n /**\n * @namespace\n * @property {Object} versions\n * @property {string} versions.node\n * @property {string} versions.v8\n */\n data.node = process.versions.node;\n data.v8 = process.versions.v8;\n\n cpu.cpuCurrentSpeed().then(res => {\n data.cpuCurrentSpeed = res;\n functionProcessed();\n });\n\n users.users().then(res => {\n data.users = res;\n functionProcessed();\n });\n\n processes.processes().then(res => {\n data.processes = res;\n functionProcessed();\n });\n\n cpu.currentLoad().then(res => {\n data.currentLoad = res;\n functionProcessed();\n });\n\n if (!_sunos) {\n cpu.cpuTemperature().then(res => {\n data.temp = res;\n functionProcessed();\n });\n }\n\n if (!_openbsd && !_freebsd && !_netbsd && !_sunos) {\n network.networkStats(iface).then(res => {\n data.networkStats = res;\n functionProcessed();\n });\n }\n\n if (!_sunos) {\n network.networkConnections().then(res => {\n data.networkConnections = res;\n functionProcessed();\n });\n }\n\n memory.mem().then(res => {\n data.mem = res;\n functionProcessed();\n });\n\n if (!_sunos) {\n battery().then(res => {\n data.battery = res;\n functionProcessed();\n });\n }\n\n if (!_sunos) {\n processes.services(srv).then(res => {\n data.services = res;\n functionProcessed();\n });\n }\n\n if (!_sunos) {\n filesystem.fsSize().then(res => {\n data.fsSize = res;\n functionProcessed();\n });\n }\n\n if (!_windows && !_openbsd && !_freebsd && !_netbsd && !_sunos) {\n filesystem.fsStats().then(res => {\n data.fsStats = res;\n functionProcessed();\n });\n }\n\n if (!_windows && !_openbsd && !_freebsd && !_netbsd && !_sunos) {\n filesystem.disksIO().then(res => {\n data.disksIO = res;\n functionProcessed();\n });\n }\n\n if (!_openbsd && !_freebsd && !_netbsd && !_sunos) {\n wifi.wifiNetworks().then(res => {\n data.wifiNetworks = res;\n functionProcessed();\n });\n }\n\n internet.inetLatency().then(res => {\n data.inetLatency = res;\n functionProcessed();\n });\n });\n });\n}\n\n// --------------------------\n// get all data at once\n// --------------------------\n// 2 additional parameters needed\n// - srv: \t\tcomma separated list of services to monitor e.g. \"mysql, apache, postgresql\"\n// - iface:\tdefine network interface for which you like to monitor network speed e.g. \"eth0\"\n\nfunction getAllData(srv, iface, callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let data = {};\n\n if (iface && util.isFunction(iface) && !callback) {\n callback = iface;\n iface = '';\n }\n\n if (srv && util.isFunction(srv) && !iface && !callback) {\n callback = srv;\n srv = '';\n iface = '';\n }\n\n getStaticData().then(res => {\n data = res;\n getDynamicData(srv, iface).then(res => {\n for (let key in res) {\n if ({}.hasOwnProperty.call(res, key)) {\n data[key] = res[key];\n }\n }\n if (callback) { callback(data); }\n resolve(data);\n });\n });\n });\n });\n}\n\nfunction get(valueObject, callback) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n const allPromises = Object.keys(valueObject)\n .filter(func => ({}.hasOwnProperty.call(exports, func)))\n .map(func => {\n const params = valueObject[func].substring(valueObject[func].lastIndexOf('(') + 1, valueObject[func].lastIndexOf(')'));\n let funcWithoutParams = func.indexOf(')') >= 0 ? func.split(')')[1].trim() : func;\n funcWithoutParams = func.indexOf('|') >= 0 ? func.split('|')[0].trim() : funcWithoutParams;\n if (params) {\n return exports[funcWithoutParams](params);\n } else {\n return exports[funcWithoutParams]('');\n }\n });\n\n Promise.all(allPromises).then(data => {\n const result = {};\n let i = 0;\n for (let key in valueObject) {\n if ({}.hasOwnProperty.call(valueObject, key) && {}.hasOwnProperty.call(exports, key) && data.length > i) {\n if (valueObject[key] === '*' || valueObject[key] === 'all') {\n result[key] = data[i];\n } else {\n let keys = valueObject[key];\n // let params = '';\n let filter = '';\n let filterParts = [];\n // remove params\n if (keys.indexOf(')') >= 0) {\n keys = keys.split(')')[1].trim();\n }\n // extract filter and remove it from keys\n if (keys.indexOf('|') >= 0) {\n filter = keys.split('|')[1].trim();\n filterParts = filter.split(':');\n\n keys = keys.split('|')[0].trim();\n }\n keys = keys.replace(/,/g, ' ').replace(/ +/g, ' ').split(' ');\n if (data[i]) {\n if (Array.isArray(data[i])) {\n // result is in an array, go through all elements of array and pick only the right ones\n const partialArray = [];\n data[i].forEach(element => {\n let partialRes = {};\n if (keys.length === 1 && (keys[0] === '*' || keys[0] === 'all')) {\n partialRes = element;\n } else {\n keys.forEach(k => {\n if ({}.hasOwnProperty.call(element, k)) {\n partialRes[k] = element[k];\n }\n });\n }\n // if there is a filter, then just take those elements\n if (filter && filterParts.length === 2) {\n if ({}.hasOwnProperty.call(partialRes, filterParts[0].trim())) {\n const val = partialRes[filterParts[0].trim()];\n if (typeof val == 'number') {\n if (val === parseFloat(filterParts[1].trim())) {\n partialArray.push(partialRes);\n }\n } else if (typeof val == 'string') {\n if (val.toLowerCase() === filterParts[1].trim().toLowerCase()) {\n partialArray.push(partialRes);\n }\n }\n }\n } else {\n partialArray.push(partialRes);\n }\n\n });\n result[key] = partialArray;\n } else {\n const partialRes = {};\n keys.forEach(k => {\n if ({}.hasOwnProperty.call(data[i], k)) {\n partialRes[k] = data[i][k];\n }\n });\n result[key] = partialRes;\n }\n } else {\n result[key] = {};\n }\n }\n i++;\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n });\n}\n\nfunction observe(valueObject, interval, callback) {\n let _data = null;\n\n const result = setInterval(() => {\n get(valueObject).then(data => {\n if (JSON.stringify(_data) !== JSON.stringify(data)) {\n _data = Object.assign({}, data);\n callback(data);\n }\n });\n }, interval);\n return result;\n}\n\n// ----------------------------------------------------------------------------------\n// export all libs\n// ----------------------------------------------------------------------------------\n\nexports.version = version;\nexports.system = system.system;\nexports.bios = system.bios;\nexports.baseboard = system.baseboard;\nexports.chassis = system.chassis;\n\nexports.time = osInfo.time;\nexports.osInfo = osInfo.osInfo;\nexports.versions = osInfo.versions;\nexports.shell = osInfo.shell;\nexports.uuid = osInfo.uuid;\n\nexports.cpu = cpu.cpu;\nexports.cpuFlags = cpu.cpuFlags;\nexports.cpuCache = cpu.cpuCache;\nexports.cpuCurrentSpeed = cpu.cpuCurrentSpeed;\nexports.cpuTemperature = cpu.cpuTemperature;\nexports.currentLoad = cpu.currentLoad;\nexports.fullLoad = cpu.fullLoad;\n\nexports.mem = memory.mem;\nexports.memLayout = memory.memLayout;\n\nexports.battery = battery;\n\nexports.graphics = graphics.graphics;\n\nexports.fsSize = filesystem.fsSize;\nexports.fsOpenFiles = filesystem.fsOpenFiles;\nexports.blockDevices = filesystem.blockDevices;\nexports.fsStats = filesystem.fsStats;\nexports.disksIO = filesystem.disksIO;\nexports.diskLayout = filesystem.diskLayout;\n\nexports.networkInterfaceDefault = network.networkInterfaceDefault;\nexports.networkGatewayDefault = network.networkGatewayDefault;\nexports.networkInterfaces = network.networkInterfaces;\nexports.networkStats = network.networkStats;\nexports.networkConnections = network.networkConnections;\n\nexports.wifiNetworks = wifi.wifiNetworks;\nexports.wifiInterfaces = wifi.wifiInterfaces;\nexports.wifiConnections = wifi.wifiConnections;\n\nexports.services = processes.services;\nexports.processes = processes.processes;\nexports.processLoad = processes.processLoad;\n\nexports.users = users.users;\n\nexports.inetChecksite = internet.inetChecksite;\nexports.inetLatency = internet.inetLatency;\n\nexports.dockerInfo = docker.dockerInfo;\nexports.dockerImages = docker.dockerImages;\nexports.dockerContainers = docker.dockerContainers;\nexports.dockerContainerStats = docker.dockerContainerStats;\nexports.dockerContainerProcesses = docker.dockerContainerProcesses;\nexports.dockerVolumes = docker.dockerVolumes;\nexports.dockerAll = docker.dockerAll;\n\nexports.vboxInfo = vbox.vboxInfo;\n\nexports.printer = printer.printer;\n\nexports.usb = usb.usb;\n\nexports.audio = audio.audio;\nexports.bluetoothDevices = bluetooth.bluetoothDevices;\n\nexports.getStaticData = getStaticData;\nexports.getDynamicData = getDynamicData;\nexports.getAllData = getAllData;\nexports.get = get;\nexports.observe = observe;\n\nexports.powerShellStart = util.powerShellStart;\nexports.powerShellRelease = util.powerShellRelease;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// internet.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 12. Internet\n// ----------------------------------------------------------------------------------\n\n// const exec = require('child_process').exec;\nconst util = require('./util');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\n// --------------------------\n// check if external site is available\n\nfunction inetChecksite(url, callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = {\n url: url,\n ok: false,\n status: 404,\n ms: null\n };\n if (typeof url !== 'string') {\n if (callback) { callback(result); }\n return resolve(result);\n }\n let urlSanitized = '';\n const s = util.sanitizeShellString(url, true);\n for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {\n if (!(s[i] === undefined)) {\n s[i].__proto__.toLowerCase = util.stringToLower;\n const sl = s[i].toLowerCase();\n if (sl && sl[0] && !sl[1] && sl[0].length === 1) {\n urlSanitized = urlSanitized + sl[0];\n }\n }\n }\n result.url = urlSanitized;\n try {\n if (urlSanitized && !util.isPrototypePolluted()) {\n urlSanitized.__proto__.startsWith = util.stringStartWith;\n if (urlSanitized.startsWith('file:') || urlSanitized.startsWith('gopher:') || urlSanitized.startsWith('telnet:') || urlSanitized.startsWith('mailto:') || urlSanitized.startsWith('news:') || urlSanitized.startsWith('nntp:')) {\n if (callback) { callback(result); }\n return resolve(result);\n }\n let t = Date.now();\n if (_linux || _freebsd || _openbsd || _netbsd || _darwin || _sunos) {\n let args = ['-I', '--connect-timeout', '5', '-m', '5'];\n args.push(urlSanitized);\n let cmd = 'curl';\n util.execSafe(cmd, args).then((stdout) => {\n const lines = stdout.split('\\n');\n let statusCode = lines[0] && lines[0].indexOf(' ') >= 0 ? parseInt(lines[0].split(' ')[1], 10) : 404;\n result.status = statusCode || 404;\n result.ok = (statusCode === 200 || statusCode === 301 || statusCode === 302 || statusCode === 304);\n result.ms = (result.ok ? Date.now() - t : null);\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_windows) { // if this is stable, this can be used for all OS types\n const http = (urlSanitized.startsWith('https:') ? require('https') : require('http'));\n try {\n http.get(urlSanitized, (res) => {\n const statusCode = res.statusCode;\n\n result.status = statusCode || 404;\n result.ok = (statusCode === 200 || statusCode === 301 || statusCode === 302 || statusCode === 304);\n\n if (statusCode !== 200) {\n res.resume();\n result.ms = (result.ok ? Date.now() - t : null);\n if (callback) { callback(result); }\n resolve(result);\n } else {\n res.on('data', () => { });\n res.on('end', () => {\n result.ms = (result.ok ? Date.now() - t : null);\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n }).on('error', () => {\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (err) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } catch (err) {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n}\n\nexports.inetChecksite = inetChecksite;\n\n// --------------------------\n// check inet latency\n\nfunction inetLatency(host, callback) {\n\n // fallback - if only callback is given\n if (util.isFunction(host) && !callback) {\n callback = host;\n host = '';\n }\n\n host = host || '8.8.8.8';\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (typeof host !== 'string') {\n if (callback) { callback(null); }\n return resolve(null);\n }\n let hostSanitized = '';\n const s = (util.isPrototypePolluted() ? '8.8.8.8' : util.sanitizeShellString(host, true)).trim();\n for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {\n if (!(s[i] === undefined)) {\n s[i].__proto__.toLowerCase = util.stringToLower;\n const sl = s[i].toLowerCase();\n if (sl && sl[0] && !sl[1]) {\n hostSanitized = hostSanitized + sl[0];\n }\n }\n }\n hostSanitized.__proto__.startsWith = util.stringStartWith;\n if (hostSanitized.startsWith('file:') || hostSanitized.startsWith('gopher:') || hostSanitized.startsWith('telnet:') || hostSanitized.startsWith('mailto:') || hostSanitized.startsWith('news:') || hostSanitized.startsWith('nntp:')) {\n if (callback) { callback(null); }\n return resolve(null);\n }\n let params;\n let filt;\n if (_linux || _freebsd || _openbsd || _netbsd || _darwin) {\n if (_linux) {\n params = ['-c', '2', '-w', '3', hostSanitized];\n filt = 'rtt';\n }\n if (_freebsd || _openbsd || _netbsd) {\n params = ['-c', '2', '-t', '3', hostSanitized];\n filt = 'round-trip';\n }\n if (_darwin) {\n params = ['-c2', '-t3', hostSanitized];\n filt = 'avg';\n }\n util.execSafe('ping', params).then((stdout) => {\n let result = null;\n if (stdout) {\n const lines = stdout.split('\\n').filter(line => line.indexOf(filt) >= 0).join('\\n');\n\n const line = lines.split('=');\n if (line.length > 1) {\n const parts = line[1].split('/');\n if (parts.length > 1) {\n result = parseFloat(parts[1]);\n }\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n const params = ['-s', '-a', hostSanitized, '56', '2'];\n const filt = 'avg';\n util.execSafe('ping', params, { timeout: 3000 }).then((stdout) => {\n let result = null;\n if (stdout) {\n const lines = stdout.split('\\n').filter(line => line.indexOf(filt) >= 0).join('\\n');\n const line = lines.split('=');\n if (line.length > 1) {\n const parts = line[1].split('/');\n if (parts.length > 1) {\n result = parseFloat(parts[1].replace(',', '.'));\n }\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_windows) {\n let result = null;\n try {\n const params = [hostSanitized, '-n', '1'];\n util.execSafe('ping', params, util.execOptsWin).then((stdout) => {\n if (stdout) {\n let lines = stdout.split('\\r\\n');\n lines.shift();\n lines.forEach(function (line) {\n if ((line.toLowerCase().match(/ms/g) || []).length === 3) {\n let l = line.replace(/ +/g, ' ').split(' ');\n if (l.length > 6) {\n result = parseFloat(l[l.length - 1]);\n }\n }\n });\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.inetLatency = inetLatency;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// memory.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 5. Memory\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst util = require('./util');\nconst fs = require('fs');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nconst OSX_RAM_manufacturers = {\n '0x014F': 'Transcend Information',\n '0x2C00': 'Micron Technology Inc.',\n '0x802C': 'Micron Technology Inc.',\n '0x80AD': 'Hynix Semiconductor Inc.',\n '0x80CE': 'Samsung Electronics Inc.',\n '0xAD00': 'Hynix Semiconductor Inc.',\n '0xCE00': 'Samsung Electronics Inc.',\n '0x02FE': 'Elpida',\n '0x5105': 'Qimonda AG i. In.',\n '0x8551': 'Qimonda AG i. In.',\n '0x859B': 'Crucial',\n '0x04CD': 'G-Skill'\n};\n\nconst LINUX_RAM_manufacturers = {\n '017A': 'Apacer',\n '0198': 'HyperX',\n '029E': 'Corsair',\n '04CB': 'A-DATA',\n '04CD': 'G-Skill',\n '059B': 'Crucial',\n '00CE': 'Samsung',\n '1315': 'Crutial',\n '014F': 'Transcend Information',\n '2C00': 'Micron Technology Inc.',\n '802C': 'Micron Technology Inc.',\n '80AD': 'Hynix Semiconductor Inc.',\n '80CE': 'Samsung Electronics Inc.',\n 'AD00': 'Hynix Semiconductor Inc.',\n 'CE00': 'Samsung Electronics Inc.',\n '02FE': 'Elpida',\n '5105': 'Qimonda AG i. In.',\n '8551': 'Qimonda AG i. In.',\n '859B': 'Crucial'\n};\n\n// _______________________________________________________________________________________\n// | R A M | H D |\n// |______________________|_________________________| | |\n// | active buffers/cache | | |\n// |________________________________________________|___________|_________|______________|\n// | used free | used free |\n// |____________________________________________________________|________________________|\n// | total | swap |\n// |____________________________________________________________|________________________|\n\n// free (older versions)\n// ----------------------------------\n// # free\n// total used free shared buffers cached\n// Mem: 16038 (1) 15653 (2) 384 (3) 0 (4) 236 (5) 14788 (6)\n// -/+ buffers/cache: 628 (7) 15409 (8)\n// Swap: 16371 83 16288\n//\n// |------------------------------------------------------------|\n// | R A M |\n// |______________________|_____________________________________|\n// | active (2-(5+6) = 7) | available (3+5+6 = 8) |\n// |______________________|_________________________|___________|\n// | active | buffers/cache (5+6) | |\n// |________________________________________________|___________|\n// | used (2) | free (3) |\n// |____________________________________________________________|\n// | total (1) |\n// |____________________________________________________________|\n\n//\n// free (since free von procps-ng 3.3.10)\n// ----------------------------------\n// # free\n// total used free shared buffers/cache available\n// Mem: 16038 (1) 628 (2) 386 (3) 0 (4) 15024 (5) 14788 (6)\n// Swap: 16371 83 16288\n//\n// |------------------------------------------------------------|\n// | R A M |\n// |______________________|_____________________________________|\n// | | available (6) estimated |\n// |______________________|_________________________|___________|\n// | active (2) | buffers/cache (5) | free (3) |\n// |________________________________________________|___________|\n// | total (1) |\n// |____________________________________________________________|\n//\n// Reference: http://www.software-architect.net/blog/article/date/2015/06/12/-826c6e5052.html\n\n// /procs/meminfo - sample (all in kB)\n//\n// MemTotal: 32806380 kB\n// MemFree: 17977744 kB\n// MemAvailable: 19768972 kB\n// Buffers: 517028 kB\n// Cached: 2161876 kB\n// SwapCached: 456 kB\n// Active: 12081176 kB\n// Inactive: 2164616 kB\n// Active(anon): 10832884 kB\n// Inactive(anon): 1477272 kB\n// Active(file): 1248292 kB\n// Inactive(file): 687344 kB\n// Unevictable: 0 kB\n// Mlocked: 0 kB\n// SwapTotal: 16768892 kB\n// SwapFree: 16768304 kB\n// Dirty: 268 kB\n// Writeback: 0 kB\n// AnonPages: 11568832 kB\n// Mapped: 719992 kB\n// Shmem: 743272 kB\n// Slab: 335716 kB\n// SReclaimable: 256364 kB\n// SUnreclaim: 79352 kB\n\nfunction mem(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = {\n total: os.totalmem(),\n free: os.freemem(),\n used: os.totalmem() - os.freemem(),\n\n active: os.totalmem() - os.freemem(), // temporarily (fallback)\n available: os.freemem(), // temporarily (fallback)\n buffers: 0,\n cached: 0,\n slab: 0,\n buffcache: 0,\n\n swaptotal: 0,\n swapused: 0,\n swapfree: 0\n };\n\n if (_linux) {\n fs.readFile('/proc/meminfo', function (error, stdout) {\n if (!error) {\n const lines = stdout.toString().split('\\n');\n result.total = parseInt(util.getValue(lines, 'memtotal'), 10);\n result.total = result.total ? result.total * 1024 : os.totalmem();\n result.free = parseInt(util.getValue(lines, 'memfree'), 10);\n result.free = result.free ? result.free * 1024 : os.freemem();\n result.used = result.total - result.free;\n\n result.buffers = parseInt(util.getValue(lines, 'buffers'), 10);\n result.buffers = result.buffers ? result.buffers * 1024 : 0;\n result.cached = parseInt(util.getValue(lines, 'cached'), 10);\n result.cached = result.cached ? result.cached * 1024 : 0;\n result.slab = parseInt(util.getValue(lines, 'slab'), 10);\n result.slab = result.slab ? result.slab * 1024 : 0;\n result.buffcache = result.buffers + result.cached + result.slab;\n\n let available = parseInt(util.getValue(lines, 'memavailable'), 10);\n result.available = available ? available * 1024 : result.free + result.buffcache;\n result.active = result.total - result.available;\n\n result.swaptotal = parseInt(util.getValue(lines, 'swaptotal'), 10);\n result.swaptotal = result.swaptotal ? result.swaptotal * 1024 : 0;\n result.swapfree = parseInt(util.getValue(lines, 'swapfree'), 10);\n result.swapfree = result.swapfree ? result.swapfree * 1024 : 0;\n result.swapused = result.swaptotal - result.swapfree;\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_freebsd || _openbsd || _netbsd) {\n exec('/sbin/sysctl hw.realmem hw.physmem vm.stats.vm.v_page_count vm.stats.vm.v_wire_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count vm.stats.vm.v_page_size', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n const pagesize = parseInt(util.getValue(lines, 'vm.stats.vm.v_page_size'), 10);\n const inactive = parseInt(util.getValue(lines, 'vm.stats.vm.v_inactive_count'), 10) * pagesize;\n const cache = parseInt(util.getValue(lines, 'vm.stats.vm.v_cache_count'), 10) * pagesize;\n\n result.total = parseInt(util.getValue(lines, 'hw.realmem'), 10);\n if (isNaN(result.total)) { result.total = parseInt(util.getValue(lines, 'hw.physmem'), 10); }\n result.free = parseInt(util.getValue(lines, 'vm.stats.vm.v_free_count'), 10) * pagesize;\n result.buffcache = inactive + cache;\n result.available = result.buffcache + result.free;\n result.active = result.total - result.free - result.buffcache;\n\n result.swaptotal = 0;\n result.swapfree = 0;\n result.swapused = 0;\n\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_darwin) {\n let pageSize = 4096;\n try {\n let sysPpageSize = util.toInt(execSync('sysctl -n vm.pagesize').toString());\n pageSize = sysPpageSize || pageSize;\n } catch (e) {\n util.noop();\n }\n exec('vm_stat 2>/dev/null | grep \"Pages active\"', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n\n result.active = parseInt(lines[0].split(':')[1], 10) * pageSize;\n result.buffcache = result.used - result.active;\n result.available = result.free + result.buffcache;\n }\n exec('sysctl -n vm.swapusage 2>/dev/null', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines.length > 0) {\n let line = lines[0].replace(/,/g, '.').replace(/M/g, '');\n line = line.trim().split(' ');\n for (let i = 0; i < line.length; i++) {\n if (line[i].toLowerCase().indexOf('total') !== -1) { result.swaptotal = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024; }\n if (line[i].toLowerCase().indexOf('used') !== -1) { result.swapused = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024; }\n if (line[i].toLowerCase().indexOf('free') !== -1) { result.swapfree = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024; }\n }\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n }\n if (_windows) {\n let swaptotal = 0;\n let swapused = 0;\n try {\n util.powerShell('Get-CimInstance Win32_PageFileUsage | Select AllocatedBaseSize, CurrentUsage').then((stdout, error) => {\n if (!error) {\n let lines = stdout.split('\\r\\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0);\n lines.forEach(function (line) {\n if (line !== '') {\n line = line.trim().split(/\\s\\s+/);\n swaptotal = swaptotal + (parseInt(line[0], 10) || 0);\n swapused = swapused + (parseInt(line[1], 10) || 0);\n }\n });\n }\n result.swaptotal = swaptotal * 1024 * 1024;\n result.swapused = swapused * 1024 * 1024;\n result.swapfree = result.swaptotal - result.swapused;\n\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.mem = mem;\n\nfunction memLayout(callback) {\n\n function getManufacturerDarwin(manId) {\n if ({}.hasOwnProperty.call(OSX_RAM_manufacturers, manId)) {\n return (OSX_RAM_manufacturers[manId]);\n }\n return manId;\n }\n\n function getManufacturerLinux(manId) {\n const manIdSearch = manId.replace('0x', '').toUpperCase();\n if (manIdSearch.length === 4 && {}.hasOwnProperty.call(LINUX_RAM_manufacturers, manIdSearch)) {\n return (LINUX_RAM_manufacturers[manIdSearch]);\n }\n return manId;\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = [];\n\n if (_linux || _freebsd || _openbsd || _netbsd) {\n exec('export LC_ALL=C; dmidecode -t memory 2>/dev/null | grep -iE \"Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number\"; unset LC_ALL', function (error, stdout) {\n if (!error) {\n let devices = stdout.toString().split('Memory Device');\n devices.shift();\n devices.forEach(function (device) {\n let lines = device.split('\\n');\n const sizeString = util.getValue(lines, 'Size');\n const size = sizeString.indexOf('GB') >= 0 ? parseInt(sizeString, 10) * 1024 * 1024 * 1024 : parseInt(sizeString, 10) * 1024 * 1024;\n if (parseInt(util.getValue(lines, 'Size'), 10) > 0) {\n const totalWidth = util.toInt(util.getValue(lines, 'Total Width'));\n const dataWidth = util.toInt(util.getValue(lines, 'Data Width'));\n result.push({\n size,\n bank: util.getValue(lines, 'Bank Locator'),\n type: util.getValue(lines, 'Type:'),\n ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,\n clockSpeed: (util.getValue(lines, 'Configured Clock Speed:') ? parseInt(util.getValue(lines, 'Configured Clock Speed:'), 10) : (util.getValue(lines, 'Speed:') ? parseInt(util.getValue(lines, 'Speed:'), 10) : null)),\n formFactor: util.getValue(lines, 'Form Factor:'),\n manufacturer: getManufacturerLinux(util.getValue(lines, 'Manufacturer:')),\n partNum: util.getValue(lines, 'Part Number:'),\n serialNum: util.getValue(lines, 'Serial Number:'),\n voltageConfigured: parseFloat(util.getValue(lines, 'Configured Voltage:')) || null,\n voltageMin: parseFloat(util.getValue(lines, 'Minimum Voltage:')) || null,\n voltageMax: parseFloat(util.getValue(lines, 'Maximum Voltage:')) || null,\n });\n } else {\n result.push({\n size: 0,\n bank: util.getValue(lines, 'Bank Locator'),\n type: 'Empty',\n ecc: null,\n clockSpeed: 0,\n formFactor: util.getValue(lines, 'Form Factor:'),\n partNum: '',\n serialNum: '',\n voltageConfigured: null,\n voltageMin: null,\n voltageMax: null,\n });\n }\n });\n }\n if (!result.length) {\n result.push({\n size: os.totalmem(),\n bank: '',\n type: '',\n ecc: null,\n clockSpeed: 0,\n formFactor: '',\n partNum: '',\n serialNum: '',\n voltageConfigured: null,\n voltageMin: null,\n voltageMax: null,\n });\n\n // Try Raspberry PI\n try {\n let stdout = execSync('cat /proc/cpuinfo 2>/dev/null');\n let lines = stdout.toString().split('\\n');\n let model = util.getValue(lines, 'hardware', ':', true).toUpperCase();\n let version = util.getValue(lines, 'revision', ':', true).toLowerCase();\n\n if (model === 'BCM2835' || model === 'BCM2708' || model === 'BCM2709' || model === 'BCM2835' || model === 'BCM2837') {\n\n const clockSpeed = {\n '0': 400,\n '1': 450,\n '2': 450,\n '3': 3200\n };\n result[0].type = 'LPDDR2';\n result[0].type = version && version[2] && version[2] === '3' ? 'LPDDR4' : result[0].type;\n result[0].ecc = false;\n result[0].clockSpeed = version && version[2] && clockSpeed[version[2]] || 400;\n result[0].clockSpeed = version && version[4] && version[4] === 'd' ? 500 : result[0].clockSpeed;\n result[0].formFactor = 'SoC';\n\n stdout = execSync('vcgencmd get_config sdram_freq 2>/dev/null');\n lines = stdout.toString().split('\\n');\n let freq = parseInt(util.getValue(lines, 'sdram_freq', '=', true), 10) || 0;\n if (freq) {\n result[0].clockSpeed = freq;\n }\n\n stdout = execSync('vcgencmd measure_volts sdram_p 2>/dev/null');\n lines = stdout.toString().split('\\n');\n let voltage = parseFloat(util.getValue(lines, 'volt', '=', true)) || 0;\n if (voltage) {\n result[0].voltageConfigured = voltage;\n result[0].voltageMin = voltage;\n result[0].voltageMax = voltage;\n }\n }\n } catch (e) {\n util.noop();\n }\n\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n\n if (_darwin) {\n exec('system_profiler SPMemoryDataType', function (error, stdout) {\n if (!error) {\n const allLines = stdout.toString().split('\\n');\n const eccStatus = util.getValue(allLines, 'ecc', ':', true).toLowerCase();\n let devices = stdout.toString().split(' BANK ');\n let hasBank = true;\n if (devices.length === 1) {\n devices = stdout.toString().split(' DIMM');\n hasBank = false;\n }\n devices.shift();\n devices.forEach(function (device) {\n let lines = device.split('\\n');\n const bank = (hasBank ? 'BANK ' : 'DIMM') + lines[0].trim().split('/')[0];\n const size = parseInt(util.getValue(lines, ' Size'));\n if (size) {\n result.push({\n size: size * 1024 * 1024 * 1024,\n bank: bank,\n type: util.getValue(lines, ' Type:'),\n ecc: eccStatus ? eccStatus === 'enabled' : null,\n clockSpeed: parseInt(util.getValue(lines, ' Speed:'), 10),\n formFactor: '',\n manufacturer: getManufacturerDarwin(util.getValue(lines, ' Manufacturer:')),\n partNum: util.getValue(lines, ' Part Number:'),\n serialNum: util.getValue(lines, ' Serial Number:'),\n voltageConfigured: null,\n voltageMin: null,\n voltageMax: null,\n });\n } else {\n result.push({\n size: 0,\n bank: bank,\n type: 'Empty',\n ecc: null,\n clockSpeed: 0,\n formFactor: '',\n manufacturer: '',\n partNum: '',\n serialNum: '',\n voltageConfigured: null,\n voltageMin: null,\n voltageMax: null,\n });\n }\n });\n }\n if (!result.length) {\n const lines = stdout.toString().split('\\n');\n const size = parseInt(util.getValue(lines, ' Memory:'));\n const type = util.getValue(lines, ' Type:');\n if (size && type) {\n result.push({\n size: size * 1024 * 1024 * 1024,\n bank: '0',\n type,\n ecc: false,\n clockSpeed: 0,\n formFactor: '',\n manufacturer: 'Apple',\n partNum: '',\n serialNum: '',\n voltageConfigured: null,\n voltageMin: null,\n voltageMax: null,\n });\n\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n const memoryTypes = 'Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4'.split('|');\n const FormFactors = 'Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA'.split('|');\n\n try {\n util.powerShell('Get-WmiObject Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage | fl').then((stdout, error) => {\n if (!error) {\n let devices = stdout.toString().split(/\\n\\s*\\n/);\n devices.shift();\n devices.forEach(function (device) {\n let lines = device.split('\\r\\n');\n const dataWidth = util.toInt(util.getValue(lines, 'DataWidth', ':'));\n const totalWidth = util.toInt(util.getValue(lines, 'TotalWidth', ':'));\n const size = parseInt(util.getValue(lines, 'Capacity', ':'), 10) || 0;\n if (size) {\n result.push({\n size,\n bank: util.getValue(lines, 'BankLabel', ':'), // BankLabel\n type: memoryTypes[parseInt(util.getValue(lines, 'MemoryType', ':'), 10) || parseInt(util.getValue(lines, 'SMBIOSMemoryType', ':'), 10)],\n ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,\n clockSpeed: parseInt(util.getValue(lines, 'ConfiguredClockSpeed', ':'), 10) || parseInt(util.getValue(lines, 'Speed', ':'), 10) || 0,\n formFactor: FormFactors[parseInt(util.getValue(lines, 'FormFactor', ':'), 10) || 0],\n manufacturer: util.getValue(lines, 'Manufacturer', ':'),\n partNum: util.getValue(lines, 'PartNumber', ':'),\n serialNum: util.getValue(lines, 'SerialNumber', ':'),\n voltageConfigured: (parseInt(util.getValue(lines, 'ConfiguredVoltage', ':'), 10) || 0) / 1000.0,\n voltageMin: (parseInt(util.getValue(lines, 'MinVoltage', ':'), 10) || 0) / 1000.0,\n voltageMax: (parseInt(util.getValue(lines, 'MaxVoltage', ':'), 10) || 0) / 1000.0,\n });\n }\n });\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.memLayout = memLayout;\n\n","'use strict';\n// @ts-check\n// ==================================================================================\n// network.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 9. Network\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst fs = require('fs');\nconst util = require('./util');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nlet _network = {};\nlet _default_iface = '';\nlet _ifaces = {};\nlet _dhcpNics = [];\nlet _networkInterfaces = [];\nlet _mac = {};\nlet pathToIp;\n\nfunction getDefaultNetworkInterface() {\n\n let ifacename = '';\n let ifacenameFirst = '';\n try {\n let ifaces = os.networkInterfaces();\n\n let scopeid = 9999;\n\n // fallback - \"first\" external interface (sorted by scopeid)\n for (let dev in ifaces) {\n if ({}.hasOwnProperty.call(ifaces, dev)) {\n ifaces[dev].forEach(function (details) {\n if (details && details.internal === false) {\n ifacenameFirst = ifacenameFirst || dev; // fallback if no scopeid\n if (details.scopeid && details.scopeid < scopeid) {\n ifacename = dev;\n scopeid = details.scopeid;\n }\n }\n });\n }\n }\n ifacename = ifacename || ifacenameFirst || '';\n\n if (_windows) {\n // https://www.inetdaemon.com/tutorials/internet/ip/routing/default_route.shtml\n let defaultIp = '';\n const cmd = 'netstat -r';\n const result = execSync(cmd, util.execOptsWin);\n const lines = result.toString().split(os.EOL);\n lines.forEach(line => {\n line = line.replace(/\\s+/g, ' ').trim();\n if (line.indexOf('0.0.0.0 0.0.0.0') > -1 && !(/[a-zA-Z]/.test(line))) {\n const parts = line.split(' ');\n if (parts.length >= 5) {\n defaultIp = parts[parts.length - 2];\n }\n }\n });\n if (defaultIp) {\n for (let dev in ifaces) {\n if ({}.hasOwnProperty.call(ifaces, dev)) {\n ifaces[dev].forEach(function (details) {\n if (details && details.address && details.address === defaultIp) {\n ifacename = dev;\n }\n });\n }\n }\n }\n }\n if (_linux) {\n let cmd = 'ip route 2> /dev/null | grep default';\n let result = execSync(cmd);\n let parts = result.toString().split('\\n')[0].split(/\\s+/);\n if (parts[0] === 'none' && parts[5]) {\n ifacename = parts[5];\n } else if (parts[4]) {\n ifacename = parts[4];\n }\n\n if (ifacename.indexOf(':') > -1) {\n ifacename = ifacename.split(':')[1].trim();\n }\n }\n if (_darwin || _freebsd || _openbsd || _netbsd || _sunos) {\n let cmd = '';\n if (_linux) { cmd = 'ip route 2> /dev/null | grep default | awk \\'{print $5}\\''; }\n if (_darwin) { cmd = 'route -n get default 2>/dev/null | grep interface: | awk \\'{print $2}\\''; }\n if (_freebsd || _openbsd || _netbsd || _sunos) { cmd = 'route get 0.0.0.0 | grep interface:'; }\n // console.log('SYNC - default darwin 3');\n let result = execSync(cmd);\n ifacename = result.toString().split('\\n')[0];\n if (ifacename.indexOf(':') > -1) {\n ifacename = ifacename.split(':')[1].trim();\n }\n }\n } catch (e) {\n util.noop();\n }\n if (ifacename) { _default_iface = ifacename; }\n return _default_iface;\n}\n\nexports.getDefaultNetworkInterface = getDefaultNetworkInterface;\n\nfunction getMacAddresses() {\n let iface = '';\n let mac = '';\n let result = {};\n if (_linux || _freebsd || _openbsd || _netbsd) {\n if (typeof pathToIp === 'undefined') {\n try {\n const lines = execSync('which ip').toString().split('\\n');\n if (lines.length && lines[0].indexOf(':') === -1 && lines[0].indexOf('/') === 0) {\n pathToIp = lines[0];\n } else {\n pathToIp = '';\n }\n } catch (e) {\n pathToIp = '';\n }\n }\n try {\n const cmd = 'export LC_ALL=C; ' + ((pathToIp) ? pathToIp + ' link show up' : '/sbin/ifconfig') + '; unset LC_ALL';\n let res = execSync(cmd);\n const lines = res.toString().split('\\n');\n for (let i = 0; i < lines.length; i++) {\n if (lines[i] && lines[i][0] !== ' ') {\n if (pathToIp) {\n let nextline = lines[i + 1].trim().split(' ');\n if (nextline[0] === 'link/ether') {\n iface = lines[i].split(' ')[1];\n iface = iface.slice(0, iface.length - 1);\n mac = nextline[1];\n }\n } else {\n iface = lines[i].split(' ')[0];\n mac = lines[i].split('HWaddr ')[1];\n }\n\n if (iface && mac) {\n result[iface] = mac.trim();\n iface = '';\n mac = '';\n }\n }\n }\n } catch (e) {\n util.noop();\n }\n }\n if (_darwin) {\n try {\n const cmd = '/sbin/ifconfig';\n // console.log('SYNC - macAde darwin 6');\n let res = execSync(cmd);\n const lines = res.toString().split('\\n');\n for (let i = 0; i < lines.length; i++) {\n if (lines[i] && lines[i][0] !== '\\t' && lines[i].indexOf(':') > 0) {\n iface = lines[i].split(':')[0];\n } else if (lines[i].indexOf('\\tether ') === 0) {\n mac = lines[i].split('\\tether ')[1];\n if (iface && mac) {\n result[iface] = mac.trim();\n iface = '';\n mac = '';\n }\n }\n }\n } catch (e) {\n util.noop();\n }\n }\n return result;\n}\n\nfunction networkInterfaceDefault(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = getDefaultNetworkInterface();\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n}\n\nexports.networkInterfaceDefault = networkInterfaceDefault;\n\n// --------------------------\n// NET - interfaces\n\nfunction parseLinesWindowsNics(sections, nconfigsections) {\n let nics = [];\n for (let i in sections) {\n if ({}.hasOwnProperty.call(sections, i)) {\n\n if (sections[i].trim() !== '') {\n\n let lines = sections[i].trim().split('\\r\\n');\n let linesNicConfig = nconfigsections && nconfigsections[i] ? nconfigsections[i].trim().split('\\r\\n') : [];\n let netEnabled = util.getValue(lines, 'NetEnabled', ':');\n let adapterType = util.getValue(lines, 'AdapterTypeID', ':') === '9' ? 'wireless' : 'wired';\n let ifacename = util.getValue(lines, 'Name', ':').replace(/\\]/g, ')').replace(/\\[/g, '(');\n let iface = util.getValue(lines, 'NetConnectionID', ':').replace(/\\]/g, ')').replace(/\\[/g, '(');\n if (ifacename.toLowerCase().indexOf('wi-fi') >= 0 || ifacename.toLowerCase().indexOf('wireless') >= 0) {\n adapterType = 'wireless';\n }\n if (netEnabled !== '') {\n const speed = parseInt(util.getValue(lines, 'speed', ':').trim(), 10) / 1000000;\n nics.push({\n mac: util.getValue(lines, 'MACAddress', ':').toLowerCase(),\n dhcp: util.getValue(linesNicConfig, 'dhcpEnabled', ':').toLowerCase() === 'true',\n name: ifacename,\n iface,\n netEnabled: netEnabled === 'TRUE',\n speed: isNaN(speed) ? null : speed,\n operstate: util.getValue(lines, 'NetConnectionStatus', ':') === '2' ? 'up' : 'down',\n type: adapterType\n });\n }\n }\n }\n }\n return nics;\n}\n\nfunction getWindowsNics() {\n // const cmd = util.getWmic() + ' nic get /value';\n // const cmdnicconfig = util.getWmic() + ' nicconfig get dhcpEnabled /value';\n return new Promise((resolve) => {\n process.nextTick(() => {\n let cmd = 'Get-WmiObject Win32_NetworkAdapter | fl *' + '; echo \\'#-#-#-#\\';';\n cmd += 'Get-WmiObject Win32_NetworkAdapterConfiguration | fl DHCPEnabled' + '';\n try {\n util.powerShell(cmd).then(data => {\n data = data.split('#-#-#-#');\n const nsections = (data[0] || '').split(/\\n\\s*\\n/);\n const nconfigsections = (data[1] || '').split(/\\n\\s*\\n/);\n resolve(parseLinesWindowsNics(nsections, nconfigsections));\n });\n } catch (e) {\n resolve([]);\n }\n });\n });\n}\n\nfunction getWindowsDNSsuffixes() {\n\n let iface = {};\n\n let dnsSuffixes = {\n primaryDNS: '',\n exitCode: 0,\n ifaces: [],\n };\n\n try {\n const ipconfig = execSync('ipconfig /all', util.execOptsWin);\n const ipconfigArray = ipconfig.split('\\r\\n\\r\\n');\n\n ipconfigArray.forEach((element, index) => {\n\n if (index == 1) {\n const longPrimaryDNS = element.split('\\r\\n').filter((element) => {\n return element.toUpperCase().includes('DNS');\n });\n const primaryDNS = longPrimaryDNS[0].substring(longPrimaryDNS[0].lastIndexOf(':') + 1);\n dnsSuffixes.primaryDNS = primaryDNS.trim();\n if (!dnsSuffixes.primaryDNS) { dnsSuffixes.primaryDNS = 'Not defined'; }\n }\n if (index > 1) {\n if (index % 2 == 0) {\n const name = element.substring(element.lastIndexOf(' ') + 1).replace(':', '');\n iface.name = name;\n } else {\n const connectionSpecificDNS = element.split('\\r\\n').filter((element) => {\n return element.toUpperCase().includes('DNS');\n });\n const dnsSuffix = connectionSpecificDNS[0].substring(connectionSpecificDNS[0].lastIndexOf(':') + 1);\n iface.dnsSuffix = dnsSuffix.trim();\n dnsSuffixes.ifaces.push(iface);\n iface = {};\n }\n }\n });\n\n return dnsSuffixes;\n } catch (error) {\n // console.log('An error occurred trying to bring the Connection-specific DNS suffix', error.message);\n return {\n primaryDNS: '',\n exitCode: 0,\n ifaces: [],\n };\n }\n}\n\nfunction getWindowsIfaceDNSsuffix(ifaces, ifacename) {\n let dnsSuffix = '';\n // Adding (.) to ensure ifacename compatibility when duplicated iface-names\n const interfaceName = ifacename + '.';\n try {\n const connectionDnsSuffix = ifaces.filter((iface) => {\n return interfaceName.includes(iface.name + '.');\n }).map((iface) => iface.dnsSuffix);\n if (connectionDnsSuffix[0]) {\n dnsSuffix = connectionDnsSuffix[0];\n }\n if (!dnsSuffix) { dnsSuffix = ''; }\n return dnsSuffix;\n } catch (error) {\n // console.log('Error getting Connection-specific DNS suffix: ', error.message);\n return 'Unknown';\n }\n}\n\nfunction getWindowsWiredProfilesInformation() {\n try {\n const result = execSync('netsh lan show profiles', util.execOptsWin);\n const profileList = result.split('\\r\\nProfile on interface');\n return profileList;\n } catch (error) {\n if (error.status === 1 && error.stdout.includes('AutoConfig')) {\n return 'Disabled';\n }\n return [];\n }\n}\n\nfunction getWindowsWirelessIfaceSSID(interfaceName) {\n try {\n const result = execSync(`netsh wlan show interface name=\"${interfaceName}\" | findstr \"SSID\"`, util.execOptsWin);\n const SSID = result.split('\\r\\n').shift();\n const parseSSID = SSID.split(':').pop();\n return parseSSID;\n } catch (error) {\n return 'Unknown';\n }\n}\nfunction getWindowsIEEE8021x(connectionType, iface, ifaces) {\n let i8021x = {\n state: 'Unknown',\n protocol: 'Unknown',\n };\n\n if (ifaces === 'Disabled') {\n i8021x.state = 'Disabled';\n i8021x.protocol = 'Not defined';\n return i8021x;\n }\n\n if (connectionType == 'wired' && ifaces.length > 0) {\n try {\n // Get 802.1x information by interface name\n const iface8021xInfo = ifaces.find((element) => {\n return element.includes(iface + '\\r\\n');\n });\n const arrayIface8021xInfo = iface8021xInfo.split('\\r\\n');\n const state8021x = arrayIface8021xInfo.find((element) => {\n return element.includes('802.1x');\n });\n\n if (state8021x.includes('Disabled')) {\n i8021x.state = 'Disabled';\n i8021x.protocol = 'Not defined';\n } else if (state8021x.includes('Enabled')) {\n const protocol8021x = arrayIface8021xInfo.find((element) => {\n return element.includes('EAP');\n });\n i8021x.protocol = protocol8021x.split(':').pop();\n i8021x.state = 'Enabled';\n }\n } catch (error) {\n // console.log('Error getting wired information:', error);\n return i8021x;\n }\n } else if (connectionType == 'wireless') {\n\n let i8021xState = '';\n let i8021xProtocol = '';\n\n\n\n try {\n const SSID = getWindowsWirelessIfaceSSID(iface);\n if (SSID !== 'Unknown') {\n i8021xState = execSync(`netsh wlan show profiles \"${SSID}\" | findstr \"802.1X\"`, util.execOptsWin);\n i8021xProtocol = execSync(`netsh wlan show profiles \"${SSID}\" | findstr \"EAP\"`, util.execOptsWin);\n }\n\n if (i8021xState.includes(':') && i8021xProtocol.includes(':')) {\n i8021x.state = i8021xState.split(':').pop();\n i8021x.protocol = i8021xProtocol.split(':').pop();\n }\n } catch (error) {\n // console.log('Error getting wireless information:', error);\n if (error.status === 1 && error.stdout.includes('AutoConfig')) {\n i8021x.state = 'Disabled';\n i8021x.protocol = 'Not defined';\n }\n return i8021x;\n }\n }\n\n return i8021x;\n}\n\nfunction splitSectionsNics(lines) {\n const result = [];\n let section = [];\n lines.forEach(function (line) {\n if (!line.startsWith('\\t') && !line.startsWith(' ')) {\n if (section.length) {\n result.push(section);\n section = [];\n }\n }\n section.push(line);\n });\n if (section.length) {\n result.push(section);\n }\n return result;\n}\n\nfunction parseLinesDarwinNics(sections) {\n let nics = [];\n sections.forEach(section => {\n let nic = {\n iface: '',\n mtu: null,\n mac: '',\n ip6: '',\n ip4: '',\n speed: null,\n type: '',\n operstate: '',\n duplex: '',\n internal: false\n };\n const first = section[0];\n nic.iface = first.split(':')[0].trim();\n let parts = first.split('> mtu');\n nic.mtu = parts.length > 1 ? parseInt(parts[1], 10) : null;\n if (isNaN(nic.mtu)) {\n nic.mtu = null;\n }\n nic.internal = parts[0].toLowerCase().indexOf('loopback') > -1;\n section.forEach(line => {\n if (line.trim().startsWith('ether ')) {\n nic.mac = line.split('ether ')[1].toLowerCase().trim();\n }\n if (line.trim().startsWith('inet6 ') && !nic.ip6) {\n nic.ip6 = line.split('inet6 ')[1].toLowerCase().split('%')[0].split(' ')[0];\n }\n if (line.trim().startsWith('inet ') && !nic.ip4) {\n nic.ip4 = line.split('inet ')[1].toLowerCase().split(' ')[0];\n }\n });\n let speed = util.getValue(section, 'link rate');\n nic.speed = speed ? parseFloat(speed) : null;\n if (nic.speed === null) {\n speed = util.getValue(section, 'uplink rate');\n nic.speed = speed ? parseFloat(speed) : null;\n if (nic.speed !== null && speed.toLowerCase().indexOf('gbps') >= 0) {\n nic.speed = nic.speed * 1000;\n }\n } else {\n if (speed.toLowerCase().indexOf('gbps') >= 0) {\n nic.speed = nic.speed * 1000;\n }\n }\n nic.type = util.getValue(section, 'type').toLowerCase().indexOf('wi-fi') > -1 ? 'wireless' : 'wired';\n nic.operstate = util.getValue(section, 'status').toLowerCase().indexOf('active') > -1 ? 'up' : 'down';\n nic.duplex = util.getValue(section, 'media').toLowerCase().indexOf('half-duplex') > -1 ? 'half' : 'full';\n if (nic.ip6 || nic.ip4 || nic.mac) {\n nics.push(nic);\n }\n });\n return nics;\n}\n\nfunction getDarwinNics() {\n const cmd = '/sbin/ifconfig -v';\n try {\n // console.log('SYNC - Nics darwin 12');\n const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\\n');\n const nsections = splitSectionsNics(lines);\n return (parseLinesDarwinNics(nsections));\n } catch (e) {\n return [];\n }\n}\n\nfunction getLinuxIfaceConnectionName(interfaceName) {\n const cmd = `nmcli device status 2>/dev/null | grep ${interfaceName}`;\n\n try {\n const result = execSync(cmd).toString();\n const resultFormat = result.replace(/\\s+/g, ' ').trim();\n const connectionNameLines = resultFormat.split(' ').slice(3);\n const connectionName = connectionNameLines.join(' ');\n return connectionName != '--' ? connectionName : '';\n } catch (e) {\n return '';\n }\n}\n\nfunction checkLinuxDCHPInterfaces(file) {\n let result = [];\n try {\n let cmd = `cat ${file} 2> /dev/null | grep 'iface\\\\|source'`;\n const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\\n');\n\n lines.forEach(line => {\n const parts = line.replace(/\\s+/g, ' ').trim().split(' ');\n if (parts.length >= 4) {\n if (line.toLowerCase().indexOf(' inet ') >= 0 && line.toLowerCase().indexOf('dhcp') >= 0) {\n result.push(parts[1]);\n }\n }\n if (line.toLowerCase().includes('source')) {\n let file = line.split(' ')[1];\n result = result.concat(checkLinuxDCHPInterfaces(file));\n }\n });\n } catch (e) {\n util.noop();\n }\n return result;\n}\n\nfunction getLinuxDHCPNics() {\n // alternate methods getting interfaces using DHCP\n let cmd = 'ip a 2> /dev/null';\n let result = [];\n try {\n const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\\n');\n const nsections = splitSectionsNics(lines);\n result = (parseLinuxDHCPNics(nsections));\n } catch (e) {\n util.noop();\n }\n try {\n result = checkLinuxDCHPInterfaces('/etc/network/interfaces');\n } catch (e) {\n util.noop();\n }\n return result;\n}\n\nfunction parseLinuxDHCPNics(sections) {\n const result = [];\n if (sections && sections.length) {\n sections.forEach(lines => {\n if (lines && lines.length) {\n const parts = lines[0].split(':');\n if (parts.length > 2) {\n for (let line of lines) {\n if (line.indexOf(' inet ') >= 0 && line.indexOf(' dynamic ') >= 0) {\n const parts2 = line.split(' ');\n const nic = parts2[parts2.length - 1].trim();\n result.push(nic);\n break;\n }\n }\n }\n }\n });\n }\n return result;\n}\n\nfunction getLinuxIfaceDHCPstatus(iface, connectionName, DHCPNics) {\n let result = false;\n if (connectionName) {\n const cmd = `nmcli connection show \"${connectionName}\" 2>/dev/null | grep ipv4.method;`;\n try {\n const lines = execSync(cmd).toString();\n const resultFormat = lines.replace(/\\s+/g, ' ').trim();\n\n let dhcStatus = resultFormat.split(' ').slice(1).toString();\n switch (dhcStatus) {\n case 'auto':\n result = true;\n break;\n\n default:\n result = false;\n break;\n }\n return result;\n } catch (e) {\n return (DHCPNics.indexOf(iface) >= 0);\n }\n } else {\n return (DHCPNics.indexOf(iface) >= 0);\n }\n}\n\nfunction getDarwinIfaceDHCPstatus(iface) {\n let result = false;\n const cmd = `ipconfig getpacket \"${iface}\" 2>/dev/null | grep lease_time;`;\n try {\n // console.log('SYNC - DHCP status darwin 17');\n const lines = execSync(cmd).toString().split('\\n');\n if (lines.length && lines[0].startsWith('lease_time')) {\n result = true;\n }\n } catch (e) {\n util.noop();\n }\n return result;\n}\n\nfunction getLinuxIfaceDNSsuffix(connectionName) {\n if (connectionName) {\n const cmd = `nmcli connection show \"${connectionName}\" 2>/dev/null | grep ipv4.dns-search;`;\n try {\n const result = execSync(cmd).toString();\n const resultFormat = result.replace(/\\s+/g, ' ').trim();\n const dnsSuffix = resultFormat.split(' ').slice(1).toString();\n return dnsSuffix == '--' ? 'Not defined' : dnsSuffix;\n } catch (e) {\n return 'Unknown';\n }\n } else {\n return 'Unknown';\n }\n}\n\nfunction getLinuxIfaceIEEE8021xAuth(connectionName) {\n if (connectionName) {\n const cmd = `nmcli connection show \"${connectionName}\" 2>/dev/null | grep 802-1x.eap;`;\n try {\n const result = execSync(cmd).toString();\n const resultFormat = result.replace(/\\s+/g, ' ').trim();\n const authenticationProtocol = resultFormat.split(' ').slice(1).toString();\n\n\n return authenticationProtocol == '--' ? '' : authenticationProtocol;\n } catch (e) {\n return 'Not defined';\n }\n } else {\n return 'Not defined';\n }\n}\n\nfunction getLinuxIfaceIEEE8021xState(authenticationProtocol) {\n if (authenticationProtocol) {\n if (authenticationProtocol == 'Not defined') {\n return 'Disabled';\n }\n return 'Enabled';\n } else {\n return 'Unknown';\n }\n}\n\nfunction testVirtualNic(iface, ifaceName, mac) {\n const virtualMacs = ['00:00:00:00:00:00', '00:03:FF', '00:05:69', '00:0C:29', '00:0F:4B', '00:0F:4B', '00:13:07', '00:13:BE', '00:15:5d', '00:16:3E', '00:1C:42', '00:21:F6', '00:21:F6', '00:24:0B', '00:24:0B', '00:50:56', '00:A0:B1', '00:E0:C8', '08:00:27', '0A:00:27', '18:92:2C', '16:DF:49', '3C:F3:92', '54:52:00', 'FC:15:97'];\n if (mac) {\n return virtualMacs.filter(item => { return mac.toUpperCase().toUpperCase().startsWith(item.substr(0, mac.length)); }).length > 0 ||\n iface.toLowerCase().indexOf(' virtual ') > -1 ||\n ifaceName.toLowerCase().indexOf(' virtual ') > -1 ||\n iface.toLowerCase().indexOf('vethernet ') > -1 ||\n ifaceName.toLowerCase().indexOf('vethernet ') > -1 ||\n iface.toLowerCase().startsWith('veth') ||\n ifaceName.toLowerCase().startsWith('veth') ||\n iface.toLowerCase().startsWith('vboxnet') ||\n ifaceName.toLowerCase().startsWith('vboxnet');\n } else { return false; }\n}\n\nfunction networkInterfaces(callback, rescan, defaultString) {\n\n if (typeof callback === 'string') {\n defaultString = callback;\n rescan = true;\n callback = null;\n }\n\n if (typeof callback === 'boolean') {\n rescan = callback;\n callback = null;\n defaultString = '';\n }\n if (typeof rescan === 'undefined') {\n rescan = true;\n }\n defaultString = defaultString || '';\n defaultString = '' + defaultString;\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let ifaces = os.networkInterfaces();\n\n let result = [];\n let nics = [];\n let dnsSuffixes = [];\n let nics8021xInfo = [];\n // seperate handling in OSX\n if (_darwin || _freebsd || _openbsd || _netbsd) {\n if ((JSON.stringify(ifaces) === JSON.stringify(_ifaces)) && !rescan) {\n // no changes - just return object\n result = _networkInterfaces;\n\n if (callback) { callback(result); }\n resolve(result);\n } else {\n const defaultInterface = getDefaultNetworkInterface();\n _ifaces = JSON.parse(JSON.stringify(ifaces));\n\n nics = getDarwinNics();\n\n\n nics.forEach(nic => {\n\n if ({}.hasOwnProperty.call(ifaces, nic.iface)) {\n ifaces[nic.iface].forEach(function (details) {\n if (details.family === 'IPv4' || details.family === 4) {\n nic.ip4subnet = details.netmask;\n }\n if (details.family === 'IPv6' || details.family === 6) {\n nic.ip6subnet = details.netmask;\n }\n });\n }\n\n result.push({\n iface: nic.iface,\n ifaceName: nic.iface,\n default: nic.iface === defaultInterface,\n ip4: nic.ip4,\n ip4subnet: nic.ip4subnet || '',\n ip6: nic.ip6,\n ip6subnet: nic.ip6subnet || '',\n mac: nic.mac,\n internal: nic.internal,\n virtual: nic.internal ? false : testVirtualNic(nic.iface, nic.iface, nic.mac),\n operstate: nic.operstate,\n type: nic.type,\n duplex: nic.duplex,\n mtu: nic.mtu,\n speed: nic.speed,\n dhcp: getDarwinIfaceDHCPstatus(nic.iface),\n dnsSuffix: '',\n ieee8021xAuth: '',\n ieee8021xState: '',\n carrierChanges: 0\n });\n });\n _networkInterfaces = result;\n if (defaultString.toLowerCase().indexOf('default') >= 0) {\n result = result.filter(item => item.default);\n if (result.length > 0) {\n result = result[0];\n } else {\n result = [];\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_linux) {\n if ((JSON.stringify(ifaces) === JSON.stringify(_ifaces)) && !rescan) {\n // no changes - just return object\n result = _networkInterfaces;\n\n if (callback) { callback(result); }\n resolve(result);\n } else {\n _ifaces = JSON.parse(JSON.stringify(ifaces));\n _dhcpNics = getLinuxDHCPNics();\n const defaultInterface = getDefaultNetworkInterface();\n for (let dev in ifaces) {\n let ip4 = '';\n let ip4subnet = '';\n let ip6 = '';\n let ip6subnet = '';\n let mac = '';\n let duplex = '';\n let mtu = '';\n let speed = null;\n let carrierChanges = 0;\n let dhcp = false;\n let dnsSuffix = '';\n let ieee8021xAuth = '';\n let ieee8021xState = '';\n let type = '';\n\n if ({}.hasOwnProperty.call(ifaces, dev)) {\n let ifaceName = dev;\n ifaces[dev].forEach(function (details) {\n if (details.family === 'IPv4' || details.family === 4) {\n ip4 = details.address;\n ip4subnet = details.netmask;\n }\n if (details.family === 'IPv6' || details.family === 6) {\n if (!ip6 || ip6.match(/^fe80::/i)) {\n ip6 = details.address;\n ip6subnet = details.netmask;\n }\n }\n mac = details.mac;\n // fallback due to https://github.com/nodejs/node/issues/13581 (node 8.1 - node 8.2)\n const nodeMainVersion = parseInt(process.versions.node.split('.'), 10);\n if (mac.indexOf('00:00:0') > -1 && (_linux || _darwin) && (!details.internal) && nodeMainVersion >= 8 && nodeMainVersion <= 11) {\n if (Object.keys(_mac).length === 0) {\n _mac = getMacAddresses();\n }\n mac = _mac[dev] || '';\n }\n });\n let iface = dev.split(':')[0].trim().toLowerCase();\n const cmd = `echo -n \"addr_assign_type: \"; cat /sys/class/net/${iface}/addr_assign_type 2>/dev/null; echo;\n echo -n \"address: \"; cat /sys/class/net/${iface}/address 2>/dev/null; echo;\n echo -n \"addr_len: \"; cat /sys/class/net/${iface}/addr_len 2>/dev/null; echo;\n echo -n \"broadcast: \"; cat /sys/class/net/${iface}/broadcast 2>/dev/null; echo;\n echo -n \"carrier: \"; cat /sys/class/net/${iface}/carrier 2>/dev/null; echo;\n echo -n \"carrier_changes: \"; cat /sys/class/net/${iface}/carrier_changes 2>/dev/null; echo;\n echo -n \"dev_id: \"; cat /sys/class/net/${iface}/dev_id 2>/dev/null; echo;\n echo -n \"dev_port: \"; cat /sys/class/net/${iface}/dev_port 2>/dev/null; echo;\n echo -n \"dormant: \"; cat /sys/class/net/${iface}/dormant 2>/dev/null; echo;\n echo -n \"duplex: \"; cat /sys/class/net/${iface}/duplex 2>/dev/null; echo;\n echo -n \"flags: \"; cat /sys/class/net/${iface}/flags 2>/dev/null; echo;\n echo -n \"gro_flush_timeout: \"; cat /sys/class/net/${iface}/gro_flush_timeout 2>/dev/null; echo;\n echo -n \"ifalias: \"; cat /sys/class/net/${iface}/ifalias 2>/dev/null; echo;\n echo -n \"ifindex: \"; cat /sys/class/net/${iface}/ifindex 2>/dev/null; echo;\n echo -n \"iflink: \"; cat /sys/class/net/${iface}/iflink 2>/dev/null; echo;\n echo -n \"link_mode: \"; cat /sys/class/net/${iface}/link_mode 2>/dev/null; echo;\n echo -n \"mtu: \"; cat /sys/class/net/${iface}/mtu 2>/dev/null; echo;\n echo -n \"netdev_group: \"; cat /sys/class/net/${iface}/netdev_group 2>/dev/null; echo;\n echo -n \"operstate: \"; cat /sys/class/net/${iface}/operstate 2>/dev/null; echo;\n echo -n \"proto_down: \"; cat /sys/class/net/${iface}/proto_down 2>/dev/null; echo;\n echo -n \"speed: \"; cat /sys/class/net/${iface}/speed 2>/dev/null; echo;\n echo -n \"tx_queue_len: \"; cat /sys/class/net/${iface}/tx_queue_len 2>/dev/null; echo;\n echo -n \"type: \"; cat /sys/class/net/${iface}/type 2>/dev/null; echo;\n echo -n \"wireless: \"; cat /proc/net/wireless 2>/dev/null | grep ${iface}; echo;\n echo -n \"wirelessspeed: \"; iw dev ${iface} link 2>&1 | grep bitrate; echo;`;\n\n let lines = [];\n try {\n lines = execSync(cmd).toString().split('\\n');\n const connectionName = getLinuxIfaceConnectionName(iface);\n dhcp = getLinuxIfaceDHCPstatus(iface, connectionName, _dhcpNics);\n dnsSuffix = getLinuxIfaceDNSsuffix(connectionName);\n ieee8021xAuth = getLinuxIfaceIEEE8021xAuth(connectionName);\n ieee8021xState = getLinuxIfaceIEEE8021xState(ieee8021xAuth);\n } catch (e) {\n util.noop();\n }\n duplex = util.getValue(lines, 'duplex');\n duplex = duplex.startsWith('cat') ? '' : duplex;\n mtu = parseInt(util.getValue(lines, 'mtu'), 10);\n let myspeed = parseInt(util.getValue(lines, 'speed'), 10);\n speed = isNaN(myspeed) ? null : myspeed;\n let wirelessspeed = util.getValue(lines, 'wirelessspeed').split('tx bitrate: ');\n if (speed === null && wirelessspeed.length === 2) {\n myspeed = parseFloat(wirelessspeed[1]);\n speed = isNaN(myspeed) ? null : myspeed;\n }\n carrierChanges = parseInt(util.getValue(lines, 'carrier_changes'), 10);\n const operstate = util.getValue(lines, 'operstate');\n type = operstate === 'up' ? (util.getValue(lines, 'wireless').trim() ? 'wireless' : 'wired') : 'unknown';\n if (iface === 'lo' || iface.startsWith('bond')) { type = 'virtual'; }\n\n let internal = (ifaces[dev] && ifaces[dev][0]) ? ifaces[dev][0].internal : false;\n if (dev.toLowerCase().indexOf('loopback') > -1 || ifaceName.toLowerCase().indexOf('loopback') > -1) {\n internal = true;\n }\n const virtual = internal ? false : testVirtualNic(dev, ifaceName, mac);\n result.push({\n iface,\n ifaceName,\n default: iface === defaultInterface,\n ip4,\n ip4subnet,\n ip6,\n ip6subnet,\n mac,\n internal,\n virtual,\n operstate,\n type,\n duplex,\n mtu,\n speed,\n dhcp,\n dnsSuffix,\n ieee8021xAuth,\n ieee8021xState,\n carrierChanges,\n });\n }\n }\n _networkInterfaces = result;\n if (defaultString.toLowerCase().indexOf('default') >= 0) {\n result = result.filter(item => item.default);\n if (result.length > 0) {\n result = result[0];\n } else {\n result = [];\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_windows) {\n if ((JSON.stringify(ifaces) === JSON.stringify(_ifaces)) && !rescan) {\n // no changes - just return object\n result = _networkInterfaces;\n\n if (callback) { callback(result); }\n resolve(result);\n } else {\n _ifaces = JSON.parse(JSON.stringify(ifaces));\n const defaultInterface = getDefaultNetworkInterface();\n\n getWindowsNics().then(function (nics) {\n nics.forEach(nic => {\n let found = false;\n Object.keys(ifaces).forEach(key => {\n if (!found) {\n ifaces[key].forEach(value => {\n if (Object.keys(value).indexOf('mac') >= 0) {\n found = value['mac'] === nic.mac;\n }\n });\n }\n });\n\n if (!found) {\n ifaces[nic.name] = [{ mac: nic.mac }];\n }\n });\n nics8021xInfo = getWindowsWiredProfilesInformation();\n dnsSuffixes = getWindowsDNSsuffixes();\n for (let dev in ifaces) {\n let iface = dev;\n let ip4 = '';\n let ip4subnet = '';\n let ip6 = '';\n let ip6subnet = '';\n let mac = '';\n let duplex = '';\n let mtu = '';\n let speed = null;\n let carrierChanges = 0;\n let operstate = 'down';\n let dhcp = false;\n let dnsSuffix = '';\n let ieee8021xAuth = '';\n let ieee8021xState = '';\n let type = '';\n\n if ({}.hasOwnProperty.call(ifaces, dev)) {\n let ifaceName = dev;\n ifaces[dev].forEach(function (details) {\n if (details.family === 'IPv4' || details.family === 4) {\n ip4 = details.address;\n ip4subnet = details.netmask;\n }\n if (details.family === 'IPv6' || details.family === 6) {\n if (!ip6 || ip6.match(/^fe80::/i)) {\n ip6 = details.address;\n ip6subnet = details.netmask;\n }\n }\n mac = details.mac;\n // fallback due to https://github.com/nodejs/node/issues/13581 (node 8.1 - node 8.2)\n const nodeMainVersion = parseInt(process.versions.node.split('.'), 10);\n if (mac.indexOf('00:00:0') > -1 && (_linux || _darwin) && (!details.internal) && nodeMainVersion >= 8 && nodeMainVersion <= 11) {\n if (Object.keys(_mac).length === 0) {\n _mac = getMacAddresses();\n }\n mac = _mac[dev] || '';\n }\n });\n\n\n\n dnsSuffix = getWindowsIfaceDNSsuffix(dnsSuffixes.ifaces, dev);\n let foundFirst = false;\n nics.forEach(detail => {\n if (detail.mac === mac && !foundFirst) {\n iface = detail.iface || iface;\n ifaceName = detail.name;\n dhcp = detail.dhcp;\n operstate = detail.operstate;\n speed = detail.speed;\n type = detail.type;\n foundFirst = true;\n }\n });\n\n if (dev.toLowerCase().indexOf('wlan') >= 0 || ifaceName.toLowerCase().indexOf('wlan') >= 0 || ifaceName.toLowerCase().indexOf('802.11n') >= 0 || ifaceName.toLowerCase().indexOf('wireless') >= 0 || ifaceName.toLowerCase().indexOf('wi-fi') >= 0 || ifaceName.toLowerCase().indexOf('wifi') >= 0) {\n type = 'wireless';\n }\n\n const IEEE8021x = getWindowsIEEE8021x(type, dev, nics8021xInfo);\n ieee8021xAuth = IEEE8021x.protocol;\n ieee8021xState = IEEE8021x.state;\n let internal = (ifaces[dev] && ifaces[dev][0]) ? ifaces[dev][0].internal : false;\n if (dev.toLowerCase().indexOf('loopback') > -1 || ifaceName.toLowerCase().indexOf('loopback') > -1) {\n internal = true;\n }\n const virtual = internal ? false : testVirtualNic(dev, ifaceName, mac);\n result.push({\n iface,\n ifaceName,\n default: iface === defaultInterface,\n ip4,\n ip4subnet,\n ip6,\n ip6subnet,\n mac,\n internal,\n virtual,\n operstate,\n type,\n duplex,\n mtu,\n speed,\n dhcp,\n dnsSuffix,\n ieee8021xAuth,\n ieee8021xState,\n carrierChanges,\n });\n }\n }\n _networkInterfaces = result;\n if (defaultString.toLowerCase().indexOf('default') >= 0) {\n result = result.filter(item => item.default);\n if (result.length > 0) {\n result = result[0];\n } else {\n result = [];\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n }\n });\n });\n}\n\nexports.networkInterfaces = networkInterfaces;\n\n// --------------------------\n// NET - Speed\n\nfunction calcNetworkSpeed(iface, rx_bytes, tx_bytes, operstate, rx_dropped, rx_errors, tx_dropped, tx_errors) {\n let result = {\n iface,\n operstate,\n rx_bytes,\n rx_dropped,\n rx_errors,\n tx_bytes,\n tx_dropped,\n tx_errors,\n rx_sec: null,\n tx_sec: null,\n ms: 0\n };\n\n if (_network[iface] && _network[iface].ms) {\n result.ms = Date.now() - _network[iface].ms;\n result.rx_sec = (rx_bytes - _network[iface].rx_bytes) >= 0 ? (rx_bytes - _network[iface].rx_bytes) / (result.ms / 1000) : 0;\n result.tx_sec = (tx_bytes - _network[iface].tx_bytes) >= 0 ? (tx_bytes - _network[iface].tx_bytes) / (result.ms / 1000) : 0;\n _network[iface].rx_bytes = rx_bytes;\n _network[iface].tx_bytes = tx_bytes;\n _network[iface].rx_sec = result.rx_sec;\n _network[iface].tx_sec = result.tx_sec;\n _network[iface].ms = Date.now();\n _network[iface].last_ms = result.ms;\n _network[iface].operstate = operstate;\n } else {\n if (!_network[iface]) { _network[iface] = {}; }\n _network[iface].rx_bytes = rx_bytes;\n _network[iface].tx_bytes = tx_bytes;\n _network[iface].rx_sec = null;\n _network[iface].tx_sec = null;\n _network[iface].ms = Date.now();\n _network[iface].last_ms = 0;\n _network[iface].operstate = operstate;\n }\n return result;\n}\n\nfunction networkStats(ifaces, callback) {\n\n let ifacesArray = [];\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n // fallback - if only callback is given\n if (util.isFunction(ifaces) && !callback) {\n callback = ifaces;\n ifacesArray = [getDefaultNetworkInterface()];\n } else {\n if (typeof ifaces !== 'string' && ifaces !== undefined) {\n if (callback) { callback([]); }\n return resolve([]);\n }\n ifaces = ifaces || getDefaultNetworkInterface();\n\n ifaces.__proto__.toLowerCase = util.stringToLower;\n ifaces.__proto__.replace = util.stringReplace;\n ifaces.__proto__.trim = util.stringTrim;\n\n ifaces = ifaces.trim().toLowerCase().replace(/,+/g, '|');\n ifacesArray = ifaces.split('|');\n }\n\n const result = [];\n\n const workload = [];\n if (ifacesArray.length && ifacesArray[0].trim() === '*') {\n ifacesArray = [];\n networkInterfaces(false).then(allIFaces => {\n for (let iface of allIFaces) {\n ifacesArray.push(iface.iface);\n }\n networkStats(ifacesArray.join(',')).then(result => {\n if (callback) { callback(result); }\n resolve(result);\n });\n });\n } else {\n for (let iface of ifacesArray) {\n workload.push(networkStatsSingle(iface.trim()));\n }\n if (workload.length) {\n Promise.all(\n workload\n ).then(data => {\n if (callback) { callback(data); }\n resolve(data);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nfunction networkStatsSingle(iface) {\n\n function parseLinesWindowsPerfData(sections) {\n let perfData = [];\n for (let i in sections) {\n if ({}.hasOwnProperty.call(sections, i)) {\n if (sections[i].trim() !== '') {\n let lines = sections[i].trim().split('\\r\\n');\n perfData.push({\n name: util.getValue(lines, 'Name', ':').replace(/[()[\\] ]+/g, '').replace('#', '_').toLowerCase(),\n rx_bytes: parseInt(util.getValue(lines, 'BytesReceivedPersec', ':'), 10),\n rx_errors: parseInt(util.getValue(lines, 'PacketsReceivedErrors', ':'), 10),\n rx_dropped: parseInt(util.getValue(lines, 'PacketsReceivedDiscarded', ':'), 10),\n tx_bytes: parseInt(util.getValue(lines, 'BytesSentPersec', ':'), 10),\n tx_errors: parseInt(util.getValue(lines, 'PacketsOutboundErrors', ':'), 10),\n tx_dropped: parseInt(util.getValue(lines, 'PacketsOutboundDiscarded', ':'), 10)\n });\n }\n }\n }\n return perfData;\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let ifaceSanitized = '';\n const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);\n for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {\n if (!(s[i] === undefined)) {\n ifaceSanitized = ifaceSanitized + s[i];\n }\n }\n\n let result = {\n iface: ifaceSanitized,\n operstate: 'unknown',\n rx_bytes: 0,\n rx_dropped: 0,\n rx_errors: 0,\n tx_bytes: 0,\n tx_dropped: 0,\n tx_errors: 0,\n rx_sec: null,\n tx_sec: null,\n ms: 0\n };\n\n let operstate = 'unknown';\n let rx_bytes = 0;\n let tx_bytes = 0;\n let rx_dropped = 0;\n let rx_errors = 0;\n let tx_dropped = 0;\n let tx_errors = 0;\n\n let cmd, lines, stats;\n if (!_network[ifaceSanitized] || (_network[ifaceSanitized] && !_network[ifaceSanitized].ms) || (_network[ifaceSanitized] && _network[ifaceSanitized].ms && Date.now() - _network[ifaceSanitized].ms >= 500)) {\n if (_linux) {\n if (fs.existsSync('/sys/class/net/' + ifaceSanitized)) {\n cmd =\n 'cat /sys/class/net/' + ifaceSanitized + '/operstate; ' +\n 'cat /sys/class/net/' + ifaceSanitized + '/statistics/rx_bytes; ' +\n 'cat /sys/class/net/' + ifaceSanitized + '/statistics/tx_bytes; ' +\n 'cat /sys/class/net/' + ifaceSanitized + '/statistics/rx_dropped; ' +\n 'cat /sys/class/net/' + ifaceSanitized + '/statistics/rx_errors; ' +\n 'cat /sys/class/net/' + ifaceSanitized + '/statistics/tx_dropped; ' +\n 'cat /sys/class/net/' + ifaceSanitized + '/statistics/tx_errors; ';\n exec(cmd, function (error, stdout) {\n if (!error) {\n lines = stdout.toString().split('\\n');\n operstate = lines[0].trim();\n rx_bytes = parseInt(lines[1], 10);\n tx_bytes = parseInt(lines[2], 10);\n rx_dropped = parseInt(lines[3], 10);\n rx_errors = parseInt(lines[4], 10);\n tx_dropped = parseInt(lines[5], 10);\n tx_errors = parseInt(lines[6], 10);\n\n result = calcNetworkSpeed(ifaceSanitized, rx_bytes, tx_bytes, operstate, rx_dropped, rx_errors, tx_dropped, tx_errors);\n\n }\n resolve(result);\n });\n } else {\n resolve(result);\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n cmd = 'netstat -ibndI ' + ifaceSanitized; // lgtm [js/shell-command-constructed-from-input]\n exec(cmd, function (error, stdout) {\n if (!error) {\n lines = stdout.toString().split('\\n');\n for (let i = 1; i < lines.length; i++) {\n const line = lines[i].replace(/ +/g, ' ').split(' ');\n if (line && line[0] && line[7] && line[10]) {\n rx_bytes = rx_bytes + parseInt(line[7]);\n if (line[6].trim() !== '-') { rx_dropped = rx_dropped + parseInt(line[6]); }\n if (line[5].trim() !== '-') { rx_errors = rx_errors + parseInt(line[5]); }\n tx_bytes = tx_bytes + parseInt(line[10]);\n if (line[12].trim() !== '-') { tx_dropped = tx_dropped + parseInt(line[12]); }\n if (line[9].trim() !== '-') { tx_errors = tx_errors + parseInt(line[9]); }\n operstate = 'up';\n }\n }\n result = calcNetworkSpeed(ifaceSanitized, rx_bytes, tx_bytes, operstate, rx_dropped, rx_errors, tx_dropped, tx_errors);\n }\n resolve(result);\n });\n }\n if (_darwin) {\n cmd = 'ifconfig ' + ifaceSanitized + ' | grep \"status\"'; // lgtm [js/shell-command-constructed-from-input]\n exec(cmd, function (error, stdout) {\n result.operstate = (stdout.toString().split(':')[1] || '').trim();\n result.operstate = (result.operstate || '').toLowerCase();\n result.operstate = (result.operstate === 'active' ? 'up' : (result.operstate === 'inactive' ? 'down' : 'unknown'));\n cmd = 'netstat -bdI ' + ifaceSanitized; // lgtm [js/shell-command-constructed-from-input]\n exec(cmd, function (error, stdout) {\n if (!error) {\n lines = stdout.toString().split('\\n');\n // if there is less than 2 lines, no information for this interface was found\n if (lines.length > 1 && lines[1].trim() !== '') {\n // skip header line\n // use the second line because it is tied to the NIC instead of the ipv4 or ipv6 address\n stats = lines[1].replace(/ +/g, ' ').split(' ');\n const offset = stats.length > 11 ? 1 : 0;\n rx_bytes = parseInt(stats[offset + 5]);\n rx_dropped = parseInt(stats[offset + 10]);\n rx_errors = parseInt(stats[offset + 4]);\n tx_bytes = parseInt(stats[offset + 8]);\n tx_dropped = parseInt(stats[offset + 10]);\n tx_errors = parseInt(stats[offset + 7]);\n result = calcNetworkSpeed(ifaceSanitized, rx_bytes, tx_bytes, result.operstate, rx_dropped, rx_errors, tx_dropped, tx_errors);\n }\n }\n resolve(result);\n });\n });\n }\n if (_windows) {\n let perfData = [];\n let ifaceName = ifaceSanitized;\n\n // Performance Data\n util.powerShell('Get-WmiObject Win32_PerfRawData_Tcpip_NetworkInterface | select Name,BytesReceivedPersec,PacketsReceivedErrors,PacketsReceivedDiscarded,BytesSentPersec,PacketsOutboundErrors,PacketsOutboundDiscarded | fl').then((stdout, error) => {\n if (!error) {\n const psections = stdout.toString().split(/\\n\\s*\\n/);\n perfData = parseLinesWindowsPerfData(psections);\n }\n\n // Network Interfaces\n networkInterfaces(false).then(interfaces => {\n // get bytes sent, received from perfData by name\n rx_bytes = 0;\n tx_bytes = 0;\n perfData.forEach(detail => {\n interfaces.forEach(det => {\n if ((det.iface.toLowerCase() === ifaceSanitized.toLowerCase() ||\n det.mac.toLowerCase() === ifaceSanitized.toLowerCase() ||\n det.ip4.toLowerCase() === ifaceSanitized.toLowerCase() ||\n det.ip6.toLowerCase() === ifaceSanitized.toLowerCase() ||\n det.ifaceName.replace(/[()[\\] ]+/g, '').replace('#', '_').toLowerCase() === ifaceSanitized.replace(/[()[\\] ]+/g, '').replace('#', '_').toLowerCase()) &&\n (det.ifaceName.replace(/[()[\\] ]+/g, '').replace('#', '_').toLowerCase() === detail.name)) {\n ifaceName = det.iface;\n rx_bytes = detail.rx_bytes;\n rx_dropped = detail.rx_dropped;\n rx_errors = detail.rx_errors;\n tx_bytes = detail.tx_bytes;\n tx_dropped = detail.tx_dropped;\n tx_errors = detail.tx_errors;\n operstate = det.operstate;\n }\n });\n });\n if (rx_bytes && tx_bytes) {\n result = calcNetworkSpeed(ifaceName, parseInt(rx_bytes), parseInt(tx_bytes), operstate, rx_dropped, rx_errors, tx_dropped, tx_errors);\n }\n resolve(result);\n });\n });\n }\n } else {\n result.rx_bytes = _network[ifaceSanitized].rx_bytes;\n result.tx_bytes = _network[ifaceSanitized].tx_bytes;\n result.rx_sec = _network[ifaceSanitized].rx_sec;\n result.tx_sec = _network[ifaceSanitized].tx_sec;\n result.ms = _network[ifaceSanitized].last_ms;\n result.operstate = _network[ifaceSanitized].operstate;\n resolve(result);\n }\n });\n });\n}\n\nexports.networkStats = networkStats;\n\n// --------------------------\n// NET - connections (sockets)\n\nfunction networkConnections(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = [];\n if (_linux || _freebsd || _openbsd || _netbsd) {\n let cmd = 'export LC_ALL=C; netstat -tunap | grep \"ESTABLISHED\\\\|SYN_SENT\\\\|SYN_RECV\\\\|FIN_WAIT1\\\\|FIN_WAIT2\\\\|TIME_WAIT\\\\|CLOSE\\\\|CLOSE_WAIT\\\\|LAST_ACK\\\\|LISTEN\\\\|CLOSING\\\\|UNKNOWN\"; unset LC_ALL';\n if (_freebsd || _openbsd || _netbsd) { cmd = 'export LC_ALL=C; netstat -na | grep \"ESTABLISHED\\\\|SYN_SENT\\\\|SYN_RECV\\\\|FIN_WAIT1\\\\|FIN_WAIT2\\\\|TIME_WAIT\\\\|CLOSE\\\\|CLOSE_WAIT\\\\|LAST_ACK\\\\|LISTEN\\\\|CLOSING\\\\|UNKNOWN\"; unset LC_ALL'; }\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n if (!error && (lines.length > 1 || lines[0] != '')) {\n lines.forEach(function (line) {\n line = line.replace(/ +/g, ' ').split(' ');\n if (line.length >= 7) {\n let localip = line[3];\n let localport = '';\n let localaddress = line[3].split(':');\n if (localaddress.length > 1) {\n localport = localaddress[localaddress.length - 1];\n localaddress.pop();\n localip = localaddress.join(':');\n }\n let peerip = line[4];\n let peerport = '';\n let peeraddress = line[4].split(':');\n if (peeraddress.length > 1) {\n peerport = peeraddress[peeraddress.length - 1];\n peeraddress.pop();\n peerip = peeraddress.join(':');\n }\n let connstate = line[5];\n // if (connstate === 'VERBUNDEN') connstate = 'ESTABLISHED';\n let proc = line[6].split('/');\n\n if (connstate) {\n result.push({\n protocol: line[0],\n localAddress: localip,\n localPort: localport,\n peerAddress: peerip,\n peerPort: peerport,\n state: connstate,\n pid: proc[0] && proc[0] !== '-' ? parseInt(proc[0], 10) : null,\n process: proc[1] ? proc[1].split(' ')[0] : ''\n });\n }\n }\n });\n if (callback) {\n callback(result);\n }\n resolve(result);\n } else {\n cmd = 'ss -tunap | grep \"ESTAB\\\\|SYN-SENT\\\\|SYN-RECV\\\\|FIN-WAIT1\\\\|FIN-WAIT2\\\\|TIME-WAIT\\\\|CLOSE\\\\|CLOSE-WAIT\\\\|LAST-ACK\\\\|LISTEN\\\\|CLOSING\"';\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n line = line.replace(/ +/g, ' ').split(' ');\n if (line.length >= 6) {\n let localip = line[4];\n let localport = '';\n let localaddress = line[4].split(':');\n if (localaddress.length > 1) {\n localport = localaddress[localaddress.length - 1];\n localaddress.pop();\n localip = localaddress.join(':');\n }\n let peerip = line[5];\n let peerport = '';\n let peeraddress = line[5].split(':');\n if (peeraddress.length > 1) {\n peerport = peeraddress[peeraddress.length - 1];\n peeraddress.pop();\n peerip = peeraddress.join(':');\n }\n let connstate = line[1];\n if (connstate === 'ESTAB') { connstate = 'ESTABLISHED'; }\n if (connstate === 'TIME-WAIT') { connstate = 'TIME_WAIT'; }\n let pid = null;\n let process = '';\n if (line.length >= 7 && line[6].indexOf('users:') > -1) {\n let proc = line[6].replace('users:((\"', '').replace(/\"/g, '').split(',');\n if (proc.length > 2) {\n process = proc[0].split(' ')[0];\n pid = parseInt(proc[1], 10);\n }\n }\n if (connstate) {\n result.push({\n protocol: line[0],\n localAddress: localip,\n localPort: localport,\n peerAddress: peerip,\n peerPort: peerport,\n state: connstate,\n pid,\n process\n });\n }\n }\n });\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n });\n }\n if (_darwin) {\n let cmd = 'netstat -natv | grep \"ESTABLISHED\\\\|SYN_SENT\\\\|SYN_RECV\\\\|FIN_WAIT1\\\\|FIN_WAIT2\\\\|TIME_WAIT\\\\|CLOSE\\\\|CLOSE_WAIT\\\\|LAST_ACK\\\\|LISTEN\\\\|CLOSING\\\\|UNKNOWN\"';\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n if (!error) {\n\n let lines = stdout.toString().split('\\n');\n\n lines.forEach(function (line) {\n line = line.replace(/ +/g, ' ').split(' ');\n if (line.length >= 8) {\n let localip = line[3];\n let localport = '';\n let localaddress = line[3].split('.');\n if (localaddress.length > 1) {\n localport = localaddress[localaddress.length - 1];\n localaddress.pop();\n localip = localaddress.join('.');\n }\n let peerip = line[4];\n let peerport = '';\n let peeraddress = line[4].split('.');\n if (peeraddress.length > 1) {\n peerport = peeraddress[peeraddress.length - 1];\n peeraddress.pop();\n peerip = peeraddress.join('.');\n }\n let connstate = line[5];\n let pid = parseInt(line[8], 10);\n if (connstate) {\n result.push({\n protocol: line[0],\n localAddress: localip,\n localPort: localport,\n peerAddress: peerip,\n peerPort: peerport,\n state: connstate,\n pid: pid,\n process: ''\n });\n }\n }\n });\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n }\n if (_windows) {\n let cmd = 'netstat -nao';\n try {\n exec(cmd, util.execOptsWin, function (error, stdout) {\n if (!error) {\n\n let lines = stdout.toString().split('\\r\\n');\n\n lines.forEach(function (line) {\n line = line.trim().replace(/ +/g, ' ').split(' ');\n if (line.length >= 4) {\n let localip = line[1];\n let localport = '';\n let localaddress = line[1].split(':');\n if (localaddress.length > 1) {\n localport = localaddress[localaddress.length - 1];\n localaddress.pop();\n localip = localaddress.join(':');\n }\n let peerip = line[2];\n let peerport = '';\n let peeraddress = line[2].split(':');\n if (peeraddress.length > 1) {\n peerport = peeraddress[peeraddress.length - 1];\n peeraddress.pop();\n peerip = peeraddress.join(':');\n }\n let pid = util.toInt(line[4]);\n let connstate = line[3];\n if (connstate === 'HERGESTELLT') { connstate = 'ESTABLISHED'; }\n if (connstate.startsWith('ABH')) { connstate = 'LISTEN'; }\n if (connstate === 'SCHLIESSEN_WARTEN') { connstate = 'CLOSE_WAIT'; }\n if (connstate === 'WARTEND') { connstate = 'TIME_WAIT'; }\n if (connstate === 'SYN_GESENDET') { connstate = 'SYN_SENT'; }\n\n if (connstate === 'LISTENING') { connstate = 'LISTEN'; }\n if (connstate === 'SYN_RECEIVED') { connstate = 'SYN_RECV'; }\n if (connstate === 'FIN_WAIT_1') { connstate = 'FIN_WAIT1'; }\n if (connstate === 'FIN_WAIT_2') { connstate = 'FIN_WAIT2'; }\n if (connstate) {\n result.push({\n protocol: line[0].toLowerCase(),\n localAddress: localip,\n localPort: localport,\n peerAddress: peerip,\n peerPort: peerport,\n state: connstate,\n pid,\n process: ''\n });\n }\n }\n });\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.networkConnections = networkConnections;\n\nfunction networkGatewayDefault(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = '';\n if (_linux || _freebsd || _openbsd || _netbsd) {\n let cmd = 'ip route get 1';\n try {\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n const line = lines && lines[0] ? lines[0] : '';\n let parts = line.split(' via ');\n if (parts && parts[1]) {\n parts = parts[1].split(' ');\n result = parts[0];\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_darwin) {\n let cmd = 'route -n get default';\n try {\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n if (!error) {\n const lines = stdout.toString().split('\\n').map(line => line.trim());\n result = util.getValue(lines, 'gateway');\n }\n if (!result) {\n cmd = 'netstat -rn | awk \\'/default/ {print $2}\\'';\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n const lines = stdout.toString().split('\\n').map(line => line.trim());\n result = lines.find(line => (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(line)));\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_windows) {\n try {\n exec('netstat -r', util.execOptsWin, function (error, stdout) {\n const lines = stdout.toString().split(os.EOL);\n lines.forEach(line => {\n line = line.replace(/\\s+/g, ' ').trim();\n if (line.indexOf('0.0.0.0 0.0.0.0') > -1 && !(/[a-zA-Z]/.test(line))) {\n const parts = line.split(' ');\n if (parts.length >= 5 && (parts[parts.length - 3]).indexOf('.') > -1) {\n result = parts[parts.length - 3];\n }\n }\n });\n if (!result) {\n util.powerShell('Get-CimInstance -ClassName Win32_IP4RouteTable | Where-Object { $_.Destination -eq \\'0.0.0.0\\' -and $_.Mask -eq \\'0.0.0.0\\' }')\n .then(data => {\n let lines = data.toString().split('\\r\\n');\n if (lines.length > 1 && !result) {\n result = util.getValue(lines, 'NextHop');\n if (callback) {\n callback(result);\n }\n resolve(result);\n // } else {\n // exec('ipconfig', util.execOptsWin, function (error, stdout) {\n // let lines = stdout.toString().split('\\r\\n');\n // lines.forEach(function (line) {\n // line = line.trim().replace(/\\. /g, '');\n // line = line.trim().replace(/ +/g, '');\n // const parts = line.split(':');\n // if ((parts[0].toLowerCase().startsWith('standardgate') || parts[0].toLowerCase().indexOf('gateway') > -1 || parts[0].toLowerCase().indexOf('enlace') > -1) && parts[1]) {\n // result = parts[1];\n // }\n // });\n // if (callback) { callback(result); }\n // resolve(result);\n // });\n }\n });\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.networkGatewayDefault = networkGatewayDefault;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// osinfo.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 3. Operating System\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst fs = require('fs');\nconst util = require('./util');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\n// const execPromise = util.promisify(require('child_process').exec);\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\n// --------------------------\n// Get current time and OS uptime\n\nfunction time() {\n let t = new Date().toString().split(' ');\n return {\n current: Date.now(),\n uptime: os.uptime(),\n timezone: (t.length >= 7) ? t[5] : '',\n timezoneName: Intl ? Intl.DateTimeFormat().resolvedOptions().timeZone : (t.length >= 7) ? t.slice(6).join(' ').replace(/\\(/g, '').replace(/\\)/g, '') : ''\n };\n}\n\nexports.time = time;\n\n// --------------------------\n// Get logo filename of OS distribution\n\nfunction getLogoFile(distro) {\n distro = distro || '';\n distro = distro.toLowerCase();\n let result = _platform;\n if (_windows) {\n result = 'windows';\n }\n else if (distro.indexOf('mac os') !== -1) {\n result = 'apple';\n }\n else if (distro.indexOf('arch') !== -1) {\n result = 'arch';\n }\n else if (distro.indexOf('centos') !== -1) {\n result = 'centos';\n }\n else if (distro.indexOf('coreos') !== -1) {\n result = 'coreos';\n }\n else if (distro.indexOf('debian') !== -1) {\n result = 'debian';\n }\n else if (distro.indexOf('deepin') !== -1) {\n result = 'deepin';\n }\n else if (distro.indexOf('elementary') !== -1) {\n result = 'elementary';\n }\n else if (distro.indexOf('fedora') !== -1) {\n result = 'fedora';\n }\n else if (distro.indexOf('gentoo') !== -1) {\n result = 'gentoo';\n }\n else if (distro.indexOf('mageia') !== -1) {\n result = 'mageia';\n }\n else if (distro.indexOf('mandriva') !== -1) {\n result = 'mandriva';\n }\n else if (distro.indexOf('manjaro') !== -1) {\n result = 'manjaro';\n }\n else if (distro.indexOf('mint') !== -1) {\n result = 'mint';\n }\n else if (distro.indexOf('mx') !== -1) {\n result = 'mx';\n }\n else if (distro.indexOf('openbsd') !== -1) {\n result = 'openbsd';\n }\n else if (distro.indexOf('freebsd') !== -1) {\n result = 'freebsd';\n }\n else if (distro.indexOf('opensuse') !== -1) {\n result = 'opensuse';\n }\n else if (distro.indexOf('pclinuxos') !== -1) {\n result = 'pclinuxos';\n }\n else if (distro.indexOf('puppy') !== -1) {\n result = 'puppy';\n }\n else if (distro.indexOf('raspbian') !== -1) {\n result = 'raspbian';\n }\n else if (distro.indexOf('reactos') !== -1) {\n result = 'reactos';\n }\n else if (distro.indexOf('redhat') !== -1) {\n result = 'redhat';\n }\n else if (distro.indexOf('slackware') !== -1) {\n result = 'slackware';\n }\n else if (distro.indexOf('sugar') !== -1) {\n result = 'sugar';\n }\n else if (distro.indexOf('steam') !== -1) {\n result = 'steam';\n }\n else if (distro.indexOf('suse') !== -1) {\n result = 'suse';\n }\n else if (distro.indexOf('mate') !== -1) {\n result = 'ubuntu-mate';\n }\n else if (distro.indexOf('lubuntu') !== -1) {\n result = 'lubuntu';\n }\n else if (distro.indexOf('xubuntu') !== -1) {\n result = 'xubuntu';\n }\n else if (distro.indexOf('ubuntu') !== -1) {\n result = 'ubuntu';\n }\n else if (distro.indexOf('solaris') !== -1) {\n result = 'solaris';\n }\n else if (distro.indexOf('tails') !== -1) {\n result = 'tails';\n }\n else if (distro.indexOf('feren') !== -1) {\n result = 'ferenos';\n }\n else if (distro.indexOf('robolinux') !== -1) {\n result = 'robolinux';\n } else if (_linux && distro) {\n result = distro.toLowerCase().trim().replace(/\\s+/g, '-');\n }\n return result;\n}\n\n// --------------------------\n// FQDN\n\nfunction getFQDN() {\n let fqdn = os.hostname;\n if (_linux || _darwin) {\n try {\n const stdout = execSync('hostname -f');\n fqdn = stdout.toString().split(os.EOL)[0];\n } catch (e) {\n util.noop();\n }\n }\n if (_freebsd || _openbsd || _netbsd) {\n try {\n const stdout = execSync('hostname');\n fqdn = stdout.toString().split(os.EOL)[0];\n } catch (e) {\n util.noop();\n }\n }\n if (_windows) {\n try {\n const stdout = execSync('echo %COMPUTERNAME%.%USERDNSDOMAIN%', util.execOptsWin);\n fqdn = stdout.toString().replace('.%USERDNSDOMAIN%', '').split(os.EOL)[0];\n } catch (e) {\n util.noop();\n }\n }\n return fqdn;\n}\n\n// --------------------------\n// OS Information\n\nfunction osInfo(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = {\n\n platform: (_platform === 'win32' ? 'Windows' : _platform),\n distro: 'unknown',\n release: 'unknown',\n codename: '',\n kernel: os.release(),\n arch: os.arch(),\n hostname: os.hostname(),\n fqdn: getFQDN(),\n codepage: '',\n logofile: '',\n serial: '',\n build: '',\n servicepack: '',\n uefi: false\n };\n\n if (_linux) {\n\n exec('cat /etc/*-release; cat /usr/lib/os-release; cat /etc/openwrt_release', function (error, stdout) {\n //if (!error) {\n /**\n * @namespace\n * @property {string} DISTRIB_ID\n * @property {string} NAME\n * @property {string} DISTRIB_RELEASE\n * @property {string} VERSION_ID\n * @property {string} DISTRIB_CODENAME\n */\n let release = {};\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n if (line.indexOf('=') !== -1) {\n release[line.split('=')[0].trim().toUpperCase()] = line.split('=')[1].trim();\n }\n });\n let releaseVersion = (release.VERSION || '').replace(/\"/g, '');\n let codename = (release.DISTRIB_CODENAME || release.VERSION_CODENAME || '').replace(/\"/g, '');\n if (releaseVersion.indexOf('(') >= 0) {\n codename = releaseVersion.split('(')[1].replace(/[()]/g, '').trim();\n releaseVersion = releaseVersion.split('(')[0].trim();\n }\n result.distro = (release.DISTRIB_ID || release.NAME || 'unknown').replace(/\"/g, '');\n result.logofile = getLogoFile(result.distro);\n result.release = (releaseVersion || release.DISTRIB_RELEASE || release.VERSION_ID || 'unknown').replace(/\"/g, '');\n result.codename = codename;\n result.codepage = util.getCodepage();\n result.build = (release.BUILD_ID || '').replace(/\"/g, '').trim();\n isUefiLinux().then(uefi => {\n result.uefi = uefi;\n uuid().then(data => {\n result.serial = data.os;\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n });\n //}\n });\n }\n if (_freebsd || _openbsd || _netbsd) {\n\n exec('sysctl kern.ostype kern.osrelease kern.osrevision kern.hostuuid machdep.bootmethod', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n result.distro = util.getValue(lines, 'kern.ostype');\n result.logofile = getLogoFile(result.distro);\n result.release = util.getValue(lines, 'kern.osrelease').split('-')[0];\n result.serial = util.getValue(lines, 'kern.uuid');\n result.codename = '';\n result.codepage = util.getCodepage();\n result.uefi = util.getValue(lines, 'machdep.bootmethod').toLowerCase().indexOf('uefi') >= 0;\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_darwin) {\n exec('sw_vers; sysctl kern.ostype kern.osrelease kern.osrevision kern.uuid', function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n result.serial = util.getValue(lines, 'kern.uuid');\n result.distro = util.getValue(lines, 'ProductName');\n result.release = util.getValue(lines, 'ProductVersion');\n result.build = util.getValue(lines, 'BuildVersion');\n result.logofile = getLogoFile(result.distro);\n result.codename = 'macOS';\n result.codename = (result.release.indexOf('10.4') > -1 ? 'Mac OS X Tiger' : result.codename);\n result.codename = (result.release.indexOf('10.4') > -1 ? 'Mac OS X Tiger' : result.codename);\n result.codename = (result.release.indexOf('10.4') > -1 ? 'Mac OS X Tiger' : result.codename);\n result.codename = (result.release.indexOf('10.5') > -1 ? 'Mac OS X Leopard' : result.codename);\n result.codename = (result.release.indexOf('10.6') > -1 ? 'Mac OS X Snow Leopard' : result.codename);\n result.codename = (result.release.indexOf('10.7') > -1 ? 'Mac OS X Lion' : result.codename);\n result.codename = (result.release.indexOf('10.8') > -1 ? 'OS X Mountain Lion' : result.codename);\n result.codename = (result.release.indexOf('10.9') > -1 ? 'OS X Mavericks' : result.codename);\n result.codename = (result.release.indexOf('10.10') > -1 ? 'OS X Yosemite' : result.codename);\n result.codename = (result.release.indexOf('10.11') > -1 ? 'OS X El Capitan' : result.codename);\n result.codename = (result.release.indexOf('10.12') > -1 ? 'macOS Sierra' : result.codename);\n result.codename = (result.release.indexOf('10.13') > -1 ? 'macOS High Sierra' : result.codename);\n result.codename = (result.release.indexOf('10.14') > -1 ? 'macOS Mojave' : result.codename);\n result.codename = (result.release.indexOf('10.15') > -1 ? 'macOS Catalina' : result.codename);\n result.codename = (result.release.startsWith('11.') ? 'macOS Big Sur' : result.codename);\n result.codename = (result.release.startsWith('12.') ? 'macOS Monterey' : result.codename);\n result.uefi = true;\n result.codepage = util.getCodepage();\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_sunos) {\n result.release = result.kernel;\n exec('uname -o', function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n result.distro = lines[0];\n result.logofile = getLogoFile(result.distro);\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_windows) {\n result.logofile = getLogoFile();\n result.release = result.kernel;\n try {\n const workload = [];\n workload.push(util.powerShell('Get-WmiObject Win32_OperatingSystem | select Caption,SerialNumber,BuildNumber,ServicePackMajorVersion,ServicePackMinorVersion | fl'));\n // workload.push(execPromise('systeminfo', util.execOptsWin));\n // workload.push(util.powerShell('Get-ComputerInfo -property \"HyperV*\"'));\n workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));\n workload.push(util.powerShell('Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession'));\n util.promiseAll(\n workload\n ).then(data => {\n let lines = data.results[0] ? data.results[0].toString().split('\\r\\n') : [''];\n result.distro = util.getValue(lines, 'Caption', ':').trim();\n result.serial = util.getValue(lines, 'SerialNumber', ':').trim();\n result.build = util.getValue(lines, 'BuildNumber', ':').trim();\n result.servicepack = util.getValue(lines, 'ServicePackMajorVersion', ':').trim() + '.' + util.getValue(lines, 'ServicePackMinorVersion', ':').trim();\n result.codepage = util.getCodepage();\n // const systeminfo = data.results[1] ? data.results[1].toString() : '';\n // result.hypervisor = (systeminfo.indexOf('hypervisor has been detected') !== -1) || (systeminfo.indexOf('ein Hypervisor erkannt') !== -1) || (systeminfo.indexOf('Un hyperviseur a ') !== -1);\n // const hyperv = data.results[1] ? data.results[1].toString().split('\\r\\n') : [];\n // result.hypervisor = (util.getValue(hyperv, 'HyperVisorPresent').toLowerCase() === 'true');\n const hyperv = data.results[1] ? data.results[1].toString().toLowerCase() : '';\n result.hypervisor = hyperv.indexOf('true') !== -1;\n const term = data.results[2] ? data.results[2].toString() : '';\n result.remoteSession = (term.toString().toLowerCase().indexOf('true') >= 0);\n isUefiWindows().then(uefi => {\n result.uefi = uefi;\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.osInfo = osInfo;\n\nfunction isUefiLinux() {\n return new Promise((resolve) => {\n process.nextTick(() => {\n fs.stat('/sys/firmware/efi', function (err) {\n if (!err) {\n return resolve(true);\n } else {\n exec('dmesg | grep -E \"EFI v\"', function (error, stdout) {\n if (!error) {\n const lines = stdout.toString().split('\\n');\n return resolve(lines.length > 0);\n }\n return resolve(false);\n });\n }\n });\n });\n });\n}\n\nfunction isUefiWindows() {\n return new Promise((resolve) => {\n process.nextTick(() => {\n try {\n exec('findstr /C:\"Detected boot environment\" \"%windir%\\\\Panther\\\\setupact.log\"', util.execOptsWin, function (error, stdout) {\n if (!error) {\n const line = stdout.toString().split('\\n\\r')[0];\n return resolve(line.toLowerCase().indexOf('efi') >= 0);\n } else {\n exec('echo %firmware_type%', util.execOptsWin, function (error, stdout) {\n if (!error) {\n const line = stdout.toString() || '';\n return resolve(line.toLowerCase().indexOf('efi') >= 0);\n } else {\n return resolve(false);\n }\n });\n }\n });\n } catch (e) {\n return resolve(false);\n }\n });\n });\n}\n\nfunction versions(apps, callback) {\n let versionObject = {\n kernel: os.release(),\n openssl: '',\n systemOpenssl: '',\n systemOpensslLib: '',\n node: process.versions.node,\n v8: process.versions.v8,\n npm: '',\n yarn: '',\n pm2: '',\n gulp: '',\n grunt: '',\n git: '',\n tsc: '',\n mysql: '',\n redis: '',\n mongodb: '',\n apache: '',\n nginx: '',\n php: '',\n docker: '',\n postfix: '',\n postgresql: '',\n perl: '',\n python: '',\n python3: '',\n pip: '',\n pip3: '',\n java: '',\n gcc: '',\n virtualbox: '',\n bash: '',\n zsh: '',\n fish: '',\n powershell: '',\n dotnet: ''\n };\n\n function checkVersionParam(apps) {\n if (apps === '*') {\n return {\n versions: versionObject,\n counter: 30\n };\n }\n if (!Array.isArray(apps)) {\n apps = apps.trim().toLowerCase().replace(/,+/g, '|').replace(/ /g, '|');\n apps = apps.split('|');\n const result = {\n versions: {},\n counter: 0\n };\n apps.forEach(el => {\n if (el) {\n for (let key in versionObject) {\n if ({}.hasOwnProperty.call(versionObject, key)) {\n if (key.toLowerCase() === el.toLowerCase() && !{}.hasOwnProperty.call(result.versions, key)) {\n result.versions[key] = versionObject[key];\n if (key === 'openssl') {\n result.versions.systemOpenssl = '';\n result.versions.systemOpensslLib = '';\n }\n\n if (!result.versions[key]) { result.counter++; }\n }\n }\n }\n }\n });\n return result;\n }\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (util.isFunction(apps) && !callback) {\n callback = apps;\n apps = '*';\n } else {\n apps = apps || '*';\n if (typeof apps !== 'string') {\n if (callback) { callback({}); }\n return resolve({});\n }\n }\n const appsObj = checkVersionParam(apps);\n let totalFunctions = appsObj.counter;\n\n let functionProcessed = (function () {\n return function () {\n if (--totalFunctions === 0) {\n if (callback) {\n callback(appsObj.versions);\n }\n resolve(appsObj.versions);\n }\n };\n })();\n\n let cmd = '';\n try {\n if ({}.hasOwnProperty.call(appsObj.versions, 'openssl')) {\n appsObj.versions.openssl = process.versions.openssl;\n exec('openssl version', function (error, stdout) {\n if (!error) {\n let openssl_string = stdout.toString().split('\\n')[0].trim();\n let openssl = openssl_string.split(' ');\n appsObj.versions.systemOpenssl = openssl.length > 0 ? openssl[1] : openssl[0];\n appsObj.versions.systemOpensslLib = openssl.length > 0 ? openssl[0] : 'openssl';\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'npm')) {\n exec('npm -v', function (error, stdout) {\n if (!error) {\n appsObj.versions.npm = stdout.toString().split('\\n')[0];\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'pm2')) {\n cmd = 'pm2';\n if (_windows) {\n cmd += '.cmd';\n }\n exec(`${cmd} -v`, function (error, stdout) {\n if (!error) {\n let pm2 = stdout.toString().split('\\n')[0].trim();\n if (!pm2.startsWith('[PM2]')) {\n appsObj.versions.pm2 = pm2;\n }\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'yarn')) {\n exec('yarn --version', function (error, stdout) {\n if (!error) {\n appsObj.versions.yarn = stdout.toString().split('\\n')[0];\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'gulp')) {\n cmd = 'gulp';\n if (_windows) {\n cmd += '.cmd';\n }\n exec(`${cmd} --version`, function (error, stdout) {\n if (!error) {\n const gulp = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.gulp = (gulp.toLowerCase().split('version')[1] || '').trim();\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'tsc')) {\n cmd = 'tsc';\n if (_windows) {\n cmd += '.cmd';\n }\n exec(`${cmd} --version`, function (error, stdout) {\n if (!error) {\n const tsc = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.tsc = (tsc.toLowerCase().split('version')[1] || '').trim();\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'grunt')) {\n cmd = 'grunt';\n if (_windows) {\n cmd += '.cmd';\n }\n exec(`${cmd} --version`, function (error, stdout) {\n if (!error) {\n const grunt = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.grunt = (grunt.toLowerCase().split('cli v')[1] || '').trim();\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'git')) {\n if (_darwin) {\n const gitHomebrewExists = fs.existsSync('/usr/local/Cellar/git') || fs.existsSync('/opt/homebrew/bin/git');\n if (util.darwinXcodeExists() || gitHomebrewExists) {\n exec('git --version', function (error, stdout) {\n if (!error) {\n let git = stdout.toString().split('\\n')[0] || '';\n git = (git.toLowerCase().split('version')[1] || '').trim();\n appsObj.versions.git = (git.split(' ')[0] || '').trim();\n }\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n } else {\n exec('git --version', function (error, stdout) {\n if (!error) {\n let git = stdout.toString().split('\\n')[0] || '';\n git = (git.toLowerCase().split('version')[1] || '').trim();\n appsObj.versions.git = (git.split(' ')[0] || '').trim();\n }\n functionProcessed();\n });\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'apache')) {\n exec('apachectl -v 2>&1', function (error, stdout) {\n if (!error) {\n const apache = (stdout.toString().split('\\n')[0] || '').split(':');\n appsObj.versions.apache = (apache.length > 1 ? apache[1].replace('Apache', '').replace('/', '').split('(')[0].trim() : '');\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'nginx')) {\n exec('nginx -v 2>&1', function (error, stdout) {\n if (!error) {\n const nginx = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.nginx = (nginx.toLowerCase().split('/')[1] || '').trim();\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'mysql')) {\n exec('mysql -V', function (error, stdout) {\n if (!error) {\n let mysql = stdout.toString().split('\\n')[0] || '';\n mysql = mysql.toLowerCase();\n if (mysql.indexOf(',') > -1) {\n mysql = (mysql.split(',')[0] || '').trim();\n const parts = mysql.split(' ');\n appsObj.versions.mysql = (parts[parts.length - 1] || '').trim();\n } else {\n if (mysql.indexOf(' ver ') > -1) {\n mysql = mysql.split(' ver ')[1];\n appsObj.versions.mysql = mysql.split(' ')[0];\n }\n }\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'php')) {\n exec('php -v', function (error, stdout) {\n if (!error) {\n const php = stdout.toString().split('\\n')[0] || '';\n let parts = php.split('(');\n if (parts[0].indexOf('-')) {\n parts = parts[0].split('-');\n }\n appsObj.versions.php = parts[0].replace(/[^0-9.]/g, '');\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'redis')) {\n exec('redis-server --version', function (error, stdout) {\n if (!error) {\n const redis = stdout.toString().split('\\n')[0] || '';\n const parts = redis.split(' ');\n appsObj.versions.redis = util.getValue(parts, 'v', '=', true);\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'docker')) {\n exec('docker --version', function (error, stdout) {\n if (!error) {\n const docker = stdout.toString().split('\\n')[0] || '';\n const parts = docker.split(' ');\n appsObj.versions.docker = parts.length > 2 && parts[2].endsWith(',') ? parts[2].slice(0, -1) : '';\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'postfix')) {\n exec('postconf -d | grep mail_version', function (error, stdout) {\n if (!error) {\n const postfix = stdout.toString().split('\\n') || [];\n appsObj.versions.postfix = util.getValue(postfix, 'mail_version', '=', true);\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'mongodb')) {\n exec('mongod --version', function (error, stdout) {\n if (!error) {\n const mongodb = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.mongodb = (mongodb.toLowerCase().split(',')[0] || '').replace(/[^0-9.]/g, '');\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'postgresql')) {\n if (_linux) {\n exec('locate bin/postgres', function (error, stdout) {\n if (!error) {\n const postgresqlBin = stdout.toString().split('\\n').sort();\n if (postgresqlBin.length) {\n exec(postgresqlBin[postgresqlBin.length - 1] + ' -V', function (error, stdout) {\n if (!error) {\n const postgresql = stdout.toString().split('\\n')[0].split(' ') || [];\n appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';\n }\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n } else {\n exec('psql -V', function (error, stdout) {\n if (!error) {\n const postgresql = stdout.toString().split('\\n')[0].split(' ') || [];\n appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';\n appsObj.versions.postgresql = appsObj.versions.postgresql.split('-')[0];\n }\n functionProcessed();\n });\n functionProcessed();\n }\n });\n } else {\n if (_windows) {\n util.powerShell('Get-WmiObject Win32_Service | select caption | fl').then((stdout) => {\n let serviceSections = stdout.split(/\\n\\s*\\n/);\n for (let i = 0; i < serviceSections.length; i++) {\n if (serviceSections[i].trim() !== '') {\n let lines = serviceSections[i].trim().split('\\r\\n');\n let srvCaption = util.getValue(lines, 'caption', ':', true).toLowerCase();\n if (srvCaption.indexOf('postgresql') > -1) {\n const parts = srvCaption.split(' server ');\n if (parts.length > 1) {\n appsObj.versions.postgresql = parts[1];\n }\n }\n }\n }\n functionProcessed();\n });\n } else {\n exec('postgres -V', function (error, stdout) {\n if (!error) {\n const postgresql = stdout.toString().split('\\n')[0].split(' ') || [];\n appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';\n }\n functionProcessed();\n });\n }\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'perl')) {\n exec('perl -v', function (error, stdout) {\n if (!error) {\n const perl = stdout.toString().split('\\n') || '';\n while (perl.length > 0 && perl[0].trim() === '') {\n perl.shift();\n }\n if (perl.length > 0) {\n appsObj.versions.perl = perl[0].split('(').pop().split(')')[0].replace('v', '');\n }\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'python')) {\n if (_darwin) {\n const stdout = execSync('sw_vers');\n const lines = stdout.toString().split('\\n');\n const osVersion = util.getValue(lines, 'ProductVersion', ':');\n const gitHomebrewExists1 = fs.existsSync('/usr/local/Cellar/python');\n const gitHomebrewExists2 = fs.existsSync('/opt/homebrew/bin/python');\n if ((util.darwinXcodeExists() && util.semverCompare('12.0.1', osVersion) < 0) || gitHomebrewExists1 || gitHomebrewExists2) {\n const cmd = gitHomebrewExists1 ? '/usr/local/Cellar/python -V 2>&1' : (gitHomebrewExists2 ? '/opt/homebrew/bin/python -V 2>&1' : 'python -V 2>&1');\n exec(cmd, function (error, stdout) {\n if (!error) {\n const python = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.python = python.toLowerCase().replace('python', '').trim();\n }\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n } else {\n exec('python -V 2>&1', function (error, stdout) {\n if (!error) {\n const python = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.python = python.toLowerCase().replace('python', '').trim();\n }\n functionProcessed();\n });\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'python3')) {\n if (_darwin) {\n const gitHomebrewExists = fs.existsSync('/usr/local/Cellar/python3') || fs.existsSync('/opt/homebrew/bin/python3');\n if (util.darwinXcodeExists() || gitHomebrewExists) {\n exec('python3 -V 2>&1', function (error, stdout) {\n if (!error) {\n const python = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.python3 = python.toLowerCase().replace('python', '').trim();\n }\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n } else {\n exec('python3 -V 2>&1', function (error, stdout) {\n if (!error) {\n const python = stdout.toString().split('\\n')[0] || '';\n appsObj.versions.python3 = python.toLowerCase().replace('python', '').trim();\n }\n functionProcessed();\n });\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'pip')) {\n if (_darwin) {\n const gitHomebrewExists = fs.existsSync('/usr/local/Cellar/pip') || fs.existsSync('/opt/homebrew/bin/pip');\n if (util.darwinXcodeExists() || gitHomebrewExists) {\n exec('pip -V 2>&1', function (error, stdout) {\n if (!error) {\n const pip = stdout.toString().split('\\n')[0] || '';\n const parts = pip.split(' ');\n appsObj.versions.pip = parts.length >= 2 ? parts[1] : '';\n }\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n } else {\n exec('pip -V 2>&1', function (error, stdout) {\n if (!error) {\n const pip = stdout.toString().split('\\n')[0] || '';\n const parts = pip.split(' ');\n appsObj.versions.pip = parts.length >= 2 ? parts[1] : '';\n }\n functionProcessed();\n });\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'pip3')) {\n if (_darwin) {\n const gitHomebrewExists = fs.existsSync('/usr/local/Cellar/pip3') || fs.existsSync('/opt/homebrew/bin/pip3');\n if (util.darwinXcodeExists() || gitHomebrewExists) {\n exec('pip3 -V 2>&1', function (error, stdout) {\n if (!error) {\n const pip = stdout.toString().split('\\n')[0] || '';\n const parts = pip.split(' ');\n appsObj.versions.pip3 = parts.length >= 2 ? parts[1] : '';\n }\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n } else {\n exec('pip3 -V 2>&1', function (error, stdout) {\n if (!error) {\n const pip = stdout.toString().split('\\n')[0] || '';\n const parts = pip.split(' ');\n appsObj.versions.pip3 = parts.length >= 2 ? parts[1] : '';\n }\n functionProcessed();\n });\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'java')) {\n if (_darwin) {\n // check if any JVM is installed but avoid dialog box that Java needs to be installed\n exec('/usr/libexec/java_home -V 2>&1', function (error, stdout) {\n if (!error && stdout.toString().toLowerCase().indexOf('no java runtime') === -1) {\n // now this can be done savely\n exec('java -version 2>&1', function (error, stdout) {\n if (!error) {\n const java = stdout.toString().split('\\n')[0] || '';\n const parts = java.split('\"');\n appsObj.versions.java = parts.length === 3 ? parts[1].trim() : '';\n }\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n });\n } else {\n exec('java -version 2>&1', function (error, stdout) {\n if (!error) {\n const java = stdout.toString().split('\\n')[0] || '';\n const parts = java.split('\"');\n appsObj.versions.java = parts.length === 3 ? parts[1].trim() : '';\n }\n functionProcessed();\n });\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'gcc')) {\n if ((_darwin && util.darwinXcodeExists()) || !_darwin) {\n exec('gcc -dumpversion', function (error, stdout) {\n if (!error) {\n appsObj.versions.gcc = stdout.toString().split('\\n')[0].trim() || '';\n }\n if (appsObj.versions.gcc.indexOf('.') > -1) {\n functionProcessed();\n } else {\n exec('gcc --version', function (error, stdout) {\n if (!error) {\n const gcc = stdout.toString().split('\\n')[0].trim();\n if (gcc.indexOf('gcc') > -1 && gcc.indexOf(')') > -1) {\n const parts = gcc.split(')');\n appsObj.versions.gcc = parts[1].trim() || appsObj.versions.gcc;\n }\n }\n functionProcessed();\n });\n }\n });\n } else {\n functionProcessed();\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'virtualbox')) {\n exec(util.getVboxmanage() + ' -v 2>&1', function (error, stdout) {\n if (!error) {\n const vbox = stdout.toString().split('\\n')[0] || '';\n const parts = vbox.split('r');\n appsObj.versions.virtualbox = parts[0];\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'bash')) {\n exec('bash --version', function (error, stdout) {\n if (!error) {\n const line = stdout.toString().split('\\n')[0];\n const parts = line.split(' version ');\n if (parts.length > 1) {\n appsObj.versions.bash = parts[1].split(' ')[0].split('(')[0];\n }\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'zsh')) {\n exec('zsh --version', function (error, stdout) {\n if (!error) {\n const line = stdout.toString().split('\\n')[0];\n const parts = line.split('zsh ');\n if (parts.length > 1) {\n appsObj.versions.zsh = parts[1].split(' ')[0];\n }\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'fish')) {\n exec('fish --version', function (error, stdout) {\n if (!error) {\n const line = stdout.toString().split('\\n')[0];\n const parts = line.split(' version ');\n if (parts.length > 1) {\n appsObj.versions.fish = parts[1].split(' ')[0];\n }\n }\n functionProcessed();\n });\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'powershell')) {\n if (_windows) {\n util.powerShell('$PSVersionTable').then(stdout => {\n const lines = stdout.toString().split('\\n').map(line => line.replace(/ +/g, ' ').replace(/ +/g, ':'));\n appsObj.versions.powershell = util.getValue(lines, 'psversion');\n functionProcessed();\n });\n } else {\n functionProcessed();\n }\n }\n if ({}.hasOwnProperty.call(appsObj.versions, 'dotnet')) {\n util.powerShell('gci \"HKLM:\\\\SOFTWARE\\\\Microsoft\\\\NET Framework Setup\\\\NDP\" -recurse | gp -name Version,Release -EA 0 | where { $_.PSChildName -match \"^(?!S)\\\\p{L}\"} | select PSChildName, Version, Release').then(stdout => {\n const lines = stdout.toString().split('\\r\\n');\n let dotnet = '';\n lines.forEach(line => {\n line = line.replace(/ +/g, ' ');\n const parts = line.split(' ');\n dotnet = dotnet || ((parts[0].toLowerCase().startsWith('client') && parts.length > 2 ? parts[1].trim() : (parts[0].toLowerCase().startsWith('full') && parts.length > 2 ? parts[1].trim() : '')));\n });\n appsObj.versions.dotnet = dotnet.trim();\n functionProcessed();\n });\n }\n } catch (e) {\n if (callback) { callback(appsObj.versions); }\n resolve(appsObj.versions);\n }\n });\n });\n}\n\nexports.versions = versions;\n\nfunction shell(callback) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (_windows) {\n resolve('cmd');\n } else {\n let result = '';\n exec('echo $SHELL', function (error, stdout) {\n if (!error) {\n result = stdout.toString().split('\\n')[0];\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n });\n });\n}\n\nexports.shell = shell;\n\nfunction getUniqueMacAdresses() {\n const ifaces = os.networkInterfaces();\n let macs = [];\n for (let dev in ifaces) {\n if ({}.hasOwnProperty.call(ifaces, dev)) {\n ifaces[dev].forEach(function (details) {\n if (details && details.mac && details.mac !== '00:00:00:00:00:00') {\n const mac = details.mac.toLowerCase();\n if (macs.indexOf(mac) === -1) {\n macs.push(mac);\n }\n }\n });\n }\n }\n macs = macs.sort(function (a, b) {\n if (a < b) { return -1; }\n if (a > b) { return 1; }\n return 0;\n });\n return macs;\n}\n\nfunction uuid(callback) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = {\n os: '',\n hardware: '',\n macs: getUniqueMacAdresses()\n };\n let parts;\n\n if (_darwin) {\n exec('system_profiler SPHardwareDataType -json', function (error, stdout) {\n if (!error) {\n try {\n const jsonObj = JSON.parse(stdout.toString());\n if (jsonObj.SPHardwareDataType && jsonObj.SPHardwareDataType.length > 0) {\n const spHardware = jsonObj.SPHardwareDataType[0];\n // result.os = parts.length > 1 ? parts[1].trim().toLowerCase() : '';\n result.os = spHardware.platform_UUID.toLowerCase();\n result.hardware = spHardware.serial_number;\n }\n } catch (e) {\n util.noop();\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_linux) {\n const cmd = `echo -n \"os: \"; cat /var/lib/dbus/machine-id 2> /dev/null; echo;\necho -n \"os: \"; cat /etc/machine-id 2> /dev/null; echo;\necho -n \"hardware: \"; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`;\n exec(cmd, function (error, stdout) {\n const lines = stdout.toString().split('\\n');\n result.os = util.getValue(lines, 'os').toLowerCase();\n result.hardware = util.getValue(lines, 'hardware').toLowerCase();\n if (!result.hardware) {\n const lines = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' }).toString().split('\\n');\n const serial = util.getValue(lines, 'serial');\n result.hardware = serial || '';\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_freebsd || _openbsd || _netbsd) {\n exec('sysctl -i kern.hostid kern.hostuuid', function (error, stdout) {\n const lines = stdout.toString().split('\\n');\n result.os = util.getValue(lines, 'kern.hostid', ':').toLowerCase();\n result.hardware = util.getValue(lines, 'kern.hostuuid', ':').toLowerCase();\n if (result.os.indexOf('unknown') >= 0) { result.os = ''; }\n if (result.hardware.indexOf('unknown') >= 0) { result.hardware = ''; }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_windows) {\n let sysdir = '%windir%\\\\System32';\n if (process.arch === 'ia32' && Object.prototype.hasOwnProperty.call(process.env, 'PROCESSOR_ARCHITEW6432')) {\n sysdir = '%windir%\\\\sysnative\\\\cmd.exe /c %windir%\\\\System32';\n }\n util.powerShell('Get-WmiObject Win32_ComputerSystemProduct | select UUID | fl').then((stdout) => {\n // let lines = stdout.split('\\r\\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0)[0].trim().split(/\\s\\s+/);\n let lines = stdout.split('\\r\\n');\n result.hardware = util.getValue(lines, 'uuid', ':').toLowerCase();\n exec(`${sysdir}\\\\reg query \"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Cryptography\" /v MachineGuid`, util.execOptsWin, function (error, stdout) {\n parts = stdout.toString().split('\\n\\r')[0].split('REG_SZ');\n result.os = parts.length > 1 ? parts[1].replace(/\\r+|\\n+|\\s+/ig, '').toLowerCase() : '';\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n });\n }\n });\n });\n}\n\nexports.uuid = uuid;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// printers.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 15. printers\n// ----------------------------------------------------------------------------------\n\nconst exec = require('child_process').exec;\n// const execSync = require('child_process').execSync;\nconst util = require('./util');\n// const fs = require('fs');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nconst winPrinterStatus = {\n 1: 'Other',\n 2: 'Unknown',\n 3: 'Idle',\n 4: 'Printing',\n 5: 'Warmup',\n 6: 'Stopped Printing',\n 7: 'Offline',\n};\n\nfunction parseLinuxCupsHeader(lines) {\n const result = {};\n if (lines && lines.length) {\n if (lines[0].indexOf(' CUPS v') > 0) {\n const parts = lines[0].split(' CUPS v');\n result.cupsVersion = parts[1];\n }\n }\n return result;\n}\n\nfunction parseLinuxCupsPrinter(lines) {\n const result = {};\n const printerId = util.getValue(lines, 'PrinterId', ' ');\n result.id = printerId ? parseInt(printerId, 10) : null;\n result.name = util.getValue(lines, 'Info', ' ');\n result.model = lines.length > 0 && lines[0] ? lines[0].split(' ')[0] : '';\n result.uri = util.getValue(lines, 'DeviceURI', ' ');\n result.uuid = util.getValue(lines, 'UUID', ' ');\n result.status = util.getValue(lines, 'State', ' ');\n result.local = util.getValue(lines, 'Location', ' ').toLowerCase().startsWith('local');\n result.default = null;\n result.shared = util.getValue(lines, 'Shared', ' ').toLowerCase().startsWith('yes');\n\n return result;\n}\n\nfunction parseLinuxLpstatPrinter(lines, id) {\n const result = {};\n result.id = id;\n result.name = util.getValue(lines, 'Description', ':', true);\n result.model = lines.length > 0 && lines[0] ? lines[0].split(' ')[0] : '';\n result.uri = null;\n result.uuid = null;\n result.status = lines.length > 0 && lines[0] ? (lines[0].indexOf(' idle') > 0 ? 'idle' : (lines[0].indexOf(' printing') > 0 ? 'printing' : 'unknown')) : null;\n result.local = util.getValue(lines, 'Location', ':', true).toLowerCase().startsWith('local');\n result.default = null;\n result.shared = util.getValue(lines, 'Shared', ' ').toLowerCase().startsWith('yes');\n\n return result;\n}\n\nfunction parseDarwinPrinters(printerObject, id) {\n const result = {};\n const uriParts = printerObject.uri.split('/');\n result.id = id;\n result.name = printerObject._name;\n result.model = uriParts.length ? uriParts[uriParts.length - 1] : '';\n result.uri = printerObject.uri;\n result.uuid = null;\n result.status = printerObject.status;\n result.local = printerObject.printserver === 'local';\n result.default = printerObject.default === 'yes';\n result.shared = printerObject.shared === 'yes';\n\n return result;\n}\n\nfunction parseWindowsPrinters(lines, id) {\n const result = {};\n const status = parseInt(util.getValue(lines, 'PrinterStatus', ':'), 10);\n\n result.id = id;\n result.name = util.getValue(lines, 'name', ':');\n result.model = util.getValue(lines, 'DriverName', ':');\n result.uri = null;\n result.uuid = null;\n result.status = winPrinterStatus[status] ? winPrinterStatus[status] : null;\n result.local = util.getValue(lines, 'Local', ':').toUpperCase() === 'TRUE';\n result.default = util.getValue(lines, 'Default', ':').toUpperCase() === 'TRUE';\n result.shared = util.getValue(lines, 'Shared', ':').toUpperCase() === 'TRUE';\n\n return result;\n}\n\nfunction printer(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = [];\n if (_linux || _freebsd || _openbsd || _netbsd) {\n let cmd = 'cat /etc/cups/printers.conf 2>/dev/null';\n exec(cmd, function (error, stdout) {\n // printers.conf\n if (!error) {\n const parts = stdout.toString().split(' {\n if (!error) {\n const parts = stdout.toString().split(/\\n\\s*\\n/);\n for (let i = 0; i < parts.length; i++) {\n const printer = parseWindowsPrinters(parts[i].split('\\n'), i);\n if (printer.name || printer.model) {\n result.push(parseWindowsPrinters(parts[i].split('\\n'), i));\n }\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_sunos) {\n resolve(null);\n }\n });\n });\n}\n\nexports.printer = printer;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// processes.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 10. Processes\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst fs = require('fs');\nconst path = require('path');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\n\nconst util = require('./util');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nconst _processes_cpu = {\n all: 0,\n all_utime: 0,\n all_stime: 0,\n list: {},\n ms: 0,\n result: {}\n};\nconst _services_cpu = {\n all: 0,\n all_utime: 0,\n all_stime: 0,\n list: {},\n ms: 0,\n result: {}\n};\nconst _process_cpu = {\n all: 0,\n all_utime: 0,\n all_stime: 0,\n list: {},\n ms: 0,\n result: {}\n};\n\nconst _winStatusValues = {\n '0': 'unknown',\n '1': 'other',\n '2': 'ready',\n '3': 'running',\n '4': 'blocked',\n '5': 'suspended blocked',\n '6': 'suspended ready',\n '7': 'terminated',\n '8': 'stopped',\n '9': 'growing',\n};\n\n\nfunction parseTimeWin(time) {\n time = time || '';\n if (time) {\n return (time.substr(0, 4) + '-' + time.substr(4, 2) + '-' + time.substr(6, 2) + ' ' + time.substr(8, 2) + ':' + time.substr(10, 2) + ':' + time.substr(12, 2));\n } else {\n return '';\n }\n}\n\nfunction parseTimeUnix(time) {\n let result = time;\n let parts = time.replace(/ +/g, ' ').split(' ');\n if (parts.length === 5) {\n result = parts[4] + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(parts[1].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + parts[2]).slice(-2) + ' ' + parts[3];\n }\n return result;\n}\n\n// --------------------------\n// PS - services\n// pass a comma separated string with services to check (mysql, apache, postgresql, ...)\n// this function gives an array back, if the services are running.\n\nfunction services(srv, callback) {\n\n // fallback - if only callback is given\n if (util.isFunction(srv) && !callback) {\n callback = srv;\n srv = '';\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (typeof srv !== 'string') {\n if (callback) { callback([]); }\n return resolve([]);\n }\n\n if (srv) {\n let srvString = '';\n srvString.__proto__.toLowerCase = util.stringToLower;\n srvString.__proto__.replace = util.stringReplace;\n srvString.__proto__.trim = util.stringTrim;\n\n const s = util.sanitizeShellString(srv);\n for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {\n if (!(s[i] === undefined)) {\n srvString = srvString + s[i];\n }\n }\n\n srvString = srvString.trim().toLowerCase().replace(/, /g, '|').replace(/,+/g, '|');\n if (srvString === '') {\n srvString = '*';\n }\n if (util.isPrototypePolluted() && srvString !== '*') {\n srvString = '------';\n }\n let srvs = srvString.split('|');\n let result = [];\n let dataSrv = [];\n // let allSrv = [];\n\n if (_linux || _freebsd || _openbsd || _netbsd || _darwin) {\n if ((_linux || _freebsd || _openbsd || _netbsd) && srvString === '*') {\n try {\n const tmpsrv = execSync('systemctl --type=service --no-legend 2> /dev/null').toString().split('\\n');\n srvs = [];\n for (const s of tmpsrv) {\n const name = s.split('.service')[0];\n if (name) {\n srvs.push(name);\n }\n }\n srvString = srvs.join('|');\n } catch (d) {\n try {\n srvString = '';\n const tmpsrv = execSync('service --status-all 2> /dev/null').toString().split('\\n');\n for (const s of tmpsrv) {\n const parts = s.split(']');\n if (parts.length === 2) {\n srvString += (srvString !== '' ? '|' : '') + parts[1].trim();\n // allSrv.push({ name: parts[1].trim(), running: parts[0].indexOf('+') > 0 });\n }\n }\n srvs = srvString.split('|');\n } catch (e) {\n try {\n const srvStr = execSync('ls /etc/init.d/ -m 2> /dev/null').toString().split('\\n').join('');\n srvString = '';\n if (srvStr) {\n const tmpsrv = srvStr.split(',');\n for (const s of tmpsrv) {\n const name = s.trim();\n if (name) {\n srvString += (srvString !== '' ? '|' : '') + name;\n // allSrv.push({ name: name, running: null });\n }\n }\n srvs = srvString.split('|');\n }\n } catch (f) {\n // allSrv = [];\n srvString = '';\n srvs = [];\n }\n }\n }\n }\n if ((_darwin) && srvString === '*') { // service enumeration not yet suported on mac OS\n if (callback) { callback(result); }\n resolve(result);\n }\n let args = (_darwin) ? ['-caxo', 'pcpu,pmem,pid,command'] : ['-axo', 'pcpu,pmem,pid,command'];\n if (srvString !== '' && srvs.length > 0) {\n util.execSafe('ps', args).then((stdout) => {\n if (stdout) {\n let lines = stdout.replace(/ +/g, ' ').replace(/,+/g, '.').split('\\n');\n srvs.forEach(function (srv) {\n let ps;\n if (_darwin) {\n ps = lines.filter(function (e) {\n return (e.toLowerCase().indexOf(srv) !== -1);\n });\n\n } else {\n ps = lines.filter(function (e) {\n return (e.toLowerCase().indexOf(' ' + srv + ':') !== -1) || (e.toLowerCase().indexOf('/' + srv) !== -1);\n });\n }\n // let singleSrv = allSrv.filter(item => { return item.name === srv; });\n const pids = [];\n for (const p of ps) {\n const pid = p.trim().split(' ')[2];\n if (pid) {\n pids.push(parseInt(pid, 10));\n }\n }\n result.push({\n name: srv,\n // running: (allSrv.length && singleSrv.length && singleSrv[0].running !== null ? singleSrv[0].running : ps.length > 0),\n running: ps.length > 0,\n startmode: '',\n pids: pids,\n cpu: parseFloat((ps.reduce(function (pv, cv) {\n return pv + parseFloat(cv.trim().split(' ')[0]);\n }, 0)).toFixed(2)),\n mem: parseFloat((ps.reduce(function (pv, cv) {\n return pv + parseFloat(cv.trim().split(' ')[1]);\n }, 0)).toFixed(2))\n });\n });\n if (_linux) {\n // calc process_cpu - ps is not accurate in linux!\n let cmd = 'cat /proc/stat | grep \"cpu \"';\n for (let i in result) {\n for (let j in result[i].pids) {\n cmd += (';cat /proc/' + result[i].pids[j] + '/stat');\n }\n }\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n let curr_processes = stdout.toString().split('\\n');\n\n // first line (all - /proc/stat)\n let all = parseProcStat(curr_processes.shift());\n\n // process\n let list_new = {};\n let resultProcess = {};\n for (let i = 0; i < curr_processes.length; i++) {\n resultProcess = calcProcStatLinux(curr_processes[i], all, _services_cpu);\n\n if (resultProcess.pid) {\n let listPos = -1;\n for (let i in result) {\n for (let j in result[i].pids) {\n if (parseInt(result[i].pids[j]) === parseInt(resultProcess.pid)) {\n listPos = i;\n }\n }\n }\n if (listPos >= 0) {\n result[listPos].cpu += resultProcess.cpuu + resultProcess.cpus;\n }\n\n // save new values\n list_new[resultProcess.pid] = {\n cpuu: resultProcess.cpuu,\n cpus: resultProcess.cpus,\n utime: resultProcess.utime,\n stime: resultProcess.stime,\n cutime: resultProcess.cutime,\n cstime: resultProcess.cstime\n };\n }\n }\n\n // store old values\n _services_cpu.all = all;\n // _services_cpu.list = list_new;\n _services_cpu.list = Object.assign({}, list_new);\n _services_cpu.ms = Date.now() - _services_cpu.ms;\n // _services_cpu.result = result;\n _services_cpu.result = Object.assign({}, result);\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n args = ['-o', 'comm'];\n util.execSafe('ps', args).then((stdout) => {\n if (stdout) {\n let lines = stdout.replace(/ +/g, ' ').replace(/,+/g, '.').split('\\n');\n srvs.forEach(function (srv) {\n let ps = lines.filter(function (e) {\n return e.indexOf(srv) !== -1;\n });\n result.push({\n name: srv,\n running: ps.length > 0,\n startmode: '',\n cpu: 0,\n mem: 0\n });\n });\n if (callback) { callback(result); }\n resolve(result);\n } else {\n srvs.forEach(function (srv) {\n result.push({\n name: srv,\n running: false,\n startmode: '',\n cpu: 0,\n mem: 0\n });\n });\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n }\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n if (_windows) {\n try {\n let wincommand = 'Get-WmiObject Win32_Service';\n if (srvs[0] !== '*') {\n wincommand += ' -Filter \"';\n for (let i = 0; i < srvs.length; i++) {\n wincommand += `Name='${srvs[i]}' or `;\n }\n wincommand = `${wincommand.slice(0, -4)}\"`;\n }\n wincommand += ' | select Name,Caption,Started,StartMode,ProcessId | fl';\n util.powerShell(wincommand).then((stdout, error) => {\n if (!error) {\n let serviceSections = stdout.split(/\\n\\s*\\n/);\n for (let i = 0; i < serviceSections.length; i++) {\n if (serviceSections[i].trim() !== '') {\n let lines = serviceSections[i].trim().split('\\r\\n');\n let srvName = util.getValue(lines, 'Name', ':', true).toLowerCase();\n let srvCaption = util.getValue(lines, 'Caption', ':', true).toLowerCase();\n let started = util.getValue(lines, 'Started', ':', true);\n let startMode = util.getValue(lines, 'StartMode', ':', true);\n let pid = util.getValue(lines, 'ProcessId', ':', true);\n if (srvString === '*' || srvs.indexOf(srvName) >= 0 || srvs.indexOf(srvCaption) >= 0) {\n result.push({\n name: srvName,\n running: (started.toLowerCase() === 'true'),\n startmode: startMode,\n pids: [pid],\n cpu: 0,\n mem: 0\n });\n dataSrv.push(srvName);\n dataSrv.push(srvCaption);\n }\n }\n }\n if (srvString !== '*') {\n let srvsMissing = srvs.filter(function (e) {\n return dataSrv.indexOf(e) === -1;\n });\n srvsMissing.forEach(function (srvName) {\n result.push({\n name: srvName,\n running: false,\n startmode: '',\n pids: [],\n cpu: 0,\n mem: 0\n });\n });\n }\n if (callback) { callback(result); }\n resolve(result);\n } else {\n srvs.forEach(function (srvName) {\n result.push({\n name: srvName,\n running: false,\n startmode: '',\n cpu: 0,\n mem: 0\n });\n });\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n } else {\n if (callback) { callback([]); }\n resolve([]);\n }\n });\n });\n}\n\nexports.services = services;\n\nfunction parseProcStat(line) {\n let parts = line.replace(/ +/g, ' ').split(' ');\n let user = (parts.length >= 2 ? parseInt(parts[1]) : 0);\n let nice = (parts.length >= 3 ? parseInt(parts[2]) : 0);\n let system = (parts.length >= 4 ? parseInt(parts[3]) : 0);\n let idle = (parts.length >= 5 ? parseInt(parts[4]) : 0);\n let iowait = (parts.length >= 6 ? parseInt(parts[5]) : 0);\n let irq = (parts.length >= 7 ? parseInt(parts[6]) : 0);\n let softirq = (parts.length >= 8 ? parseInt(parts[7]) : 0);\n let steal = (parts.length >= 9 ? parseInt(parts[8]) : 0);\n let guest = (parts.length >= 10 ? parseInt(parts[9]) : 0);\n let guest_nice = (parts.length >= 11 ? parseInt(parts[10]) : 0);\n return user + nice + system + idle + iowait + irq + softirq + steal + guest + guest_nice;\n}\n\nfunction calcProcStatLinux(line, all, _cpu_old) {\n let statparts = line.replace(/ +/g, ' ').split(')');\n if (statparts.length >= 2) {\n let parts = statparts[1].split(' ');\n if (parts.length >= 16) {\n let pid = parseInt(statparts[0].split(' ')[0]);\n let utime = parseInt(parts[12]);\n let stime = parseInt(parts[13]);\n let cutime = parseInt(parts[14]);\n let cstime = parseInt(parts[15]);\n\n // calc\n let cpuu = 0;\n let cpus = 0;\n if (_cpu_old.all > 0 && _cpu_old.list[pid]) {\n cpuu = (utime + cutime - _cpu_old.list[pid].utime - _cpu_old.list[pid].cutime) / (all - _cpu_old.all) * 100; // user\n cpus = (stime + cstime - _cpu_old.list[pid].stime - _cpu_old.list[pid].cstime) / (all - _cpu_old.all) * 100; // system\n } else {\n cpuu = (utime + cutime) / (all) * 100; // user\n cpus = (stime + cstime) / (all) * 100; // system\n }\n return {\n pid: pid,\n utime: utime,\n stime: stime,\n cutime: cutime,\n cstime: cstime,\n cpuu: cpuu,\n cpus: cpus\n };\n } else {\n return {\n pid: 0,\n utime: 0,\n stime: 0,\n cutime: 0,\n cstime: 0,\n cpuu: 0,\n cpus: 0\n };\n }\n } else {\n return {\n pid: 0,\n utime: 0,\n stime: 0,\n cutime: 0,\n cstime: 0,\n cpuu: 0,\n cpus: 0\n };\n }\n}\n\nfunction calcProcStatWin(procStat, all, _cpu_old) {\n // calc\n let cpuu = 0;\n let cpus = 0;\n if (_cpu_old.all > 0 && _cpu_old.list[procStat.pid]) {\n cpuu = (procStat.utime - _cpu_old.list[procStat.pid].utime) / (all - _cpu_old.all) * 100; // user\n cpus = (procStat.stime - _cpu_old.list[procStat.pid].stime) / (all - _cpu_old.all) * 100; // system\n } else {\n cpuu = (procStat.utime) / (all) * 100; // user\n cpus = (procStat.stime) / (all) * 100; // system\n }\n return {\n pid: procStat.pid,\n utime: cpuu > 0 ? procStat.utime : 0,\n stime: cpus > 0 ? procStat.stime : 0,\n cpuu: cpuu > 0 ? cpuu : 0,\n cpus: cpus > 0 ? cpus : 0\n };\n}\n\n\n\n// --------------------------\n// running processes\n\nfunction processes(callback) {\n\n let parsedhead = [];\n\n function getName(command) {\n command = command || '';\n let result = command.split(' ')[0];\n if (result.substr(-1) === ':') {\n result = result.substr(0, result.length - 1);\n }\n if (result.substr(0, 1) !== '[') {\n let parts = result.split('/');\n if (isNaN(parseInt(parts[parts.length - 1]))) {\n result = parts[parts.length - 1];\n } else {\n result = parts[0];\n }\n }\n return result;\n }\n\n function parseLine(line) {\n\n let offset = 0;\n let offset2 = 0;\n\n function checkColumn(i) {\n offset = offset2;\n if (parsedhead[i]) {\n offset2 = line.substring(parsedhead[i].to + offset, 10000).indexOf(' ');\n } else {\n offset2 = 10000;\n }\n }\n\n checkColumn(0);\n const pid = parseInt(line.substring(parsedhead[0].from + offset, parsedhead[0].to + offset2));\n checkColumn(1);\n const ppid = parseInt(line.substring(parsedhead[1].from + offset, parsedhead[1].to + offset2));\n checkColumn(2);\n const cpu = parseFloat(line.substring(parsedhead[2].from + offset, parsedhead[2].to + offset2).replace(/,/g, '.'));\n checkColumn(3);\n const mem = parseFloat(line.substring(parsedhead[3].from + offset, parsedhead[3].to + offset2).replace(/,/g, '.'));\n checkColumn(4);\n const priority = parseInt(line.substring(parsedhead[4].from + offset, parsedhead[4].to + offset2));\n checkColumn(5);\n const vsz = parseInt(line.substring(parsedhead[5].from + offset, parsedhead[5].to + offset2));\n checkColumn(6);\n const rss = parseInt(line.substring(parsedhead[6].from + offset, parsedhead[6].to + offset2));\n checkColumn(7);\n const nice = parseInt(line.substring(parsedhead[7].from + offset, parsedhead[7].to + offset2)) || 0;\n checkColumn(8);\n const started = parseTimeUnix(line.substring(parsedhead[8].from + offset, parsedhead[8].to + offset2).trim());\n checkColumn(9);\n let state = line.substring(parsedhead[9].from + offset, parsedhead[9].to + offset2).trim();\n state = (state[0] === 'R' ? 'running' : (state[0] === 'S' ? 'sleeping' : (state[0] === 'T' ? 'stopped' : (state[0] === 'W' ? 'paging' : (state[0] === 'X' ? 'dead' : (state[0] === 'Z' ? 'zombie' : ((state[0] === 'D' || state[0] === 'U') ? 'blocked' : 'unknown')))))));\n checkColumn(10);\n let tty = line.substring(parsedhead[10].from + offset, parsedhead[10].to + offset2).trim();\n if (tty === '?' || tty === '??') { tty = ''; }\n checkColumn(11);\n const user = line.substring(parsedhead[11].from + offset, parsedhead[11].to + offset2).trim();\n checkColumn(12);\n let cmdPath = '';\n let command = '';\n let params = '';\n let fullcommand = line.substring(parsedhead[12].from + offset, parsedhead[12].to + offset2).trim();\n if (fullcommand.substr(fullcommand.length - 1) === ']') { fullcommand = fullcommand.slice(0, -1); }\n if (fullcommand.substr(0, 1) === '[') { command = fullcommand.substring(1); }\n else {\n // try to figure out where parameter starts\n let firstParamPos = fullcommand.indexOf(' -');\n let firstParamPathPos = fullcommand.indexOf(' /');\n firstParamPos = (firstParamPos >= 0 ? firstParamPos : 10000);\n firstParamPathPos = (firstParamPathPos >= 0 ? firstParamPathPos : 10000);\n const firstPos = Math.min(firstParamPos, firstParamPathPos);\n let tmpCommand = fullcommand.substr(0, firstPos);\n const tmpParams = fullcommand.substr(firstPos);\n const lastSlashPos = tmpCommand.lastIndexOf('/');\n if (lastSlashPos >= 0) {\n cmdPath = tmpCommand.substr(0, lastSlashPos);\n tmpCommand = tmpCommand.substr(lastSlashPos + 1);\n }\n\n if (firstPos === 10000 && tmpCommand.indexOf(' ') > -1) {\n const parts = tmpCommand.split(' ');\n if (fs.existsSync(path.join(cmdPath, parts[0]))) {\n command = parts.shift();\n params = (parts.join(' ') + ' ' + tmpParams).trim();\n } else {\n command = tmpCommand.trim();\n params = tmpParams.trim();\n }\n } else {\n command = tmpCommand.trim();\n params = tmpParams.trim();\n }\n }\n\n return ({\n pid: pid,\n parentPid: ppid,\n name: _linux ? getName(command) : command,\n cpu: cpu,\n cpuu: 0,\n cpus: 0,\n mem: mem,\n priority: priority,\n memVsz: vsz,\n memRss: rss,\n nice: nice,\n started: started,\n state: state,\n tty: tty,\n user: user,\n command: command,\n params: params,\n path: cmdPath\n });\n }\n\n function parseProcesses(lines) {\n let result = [];\n if (lines.length > 1) {\n let head = lines[0];\n parsedhead = util.parseHead(head, 8);\n lines.shift();\n lines.forEach(function (line) {\n if (line.trim() !== '') {\n result.push(parseLine(line));\n }\n });\n }\n return result;\n }\n function parseProcesses2(lines) {\n\n function formatDateTime(time) {\n const month = ('0' + (time.getMonth() + 1).toString()).substr(-2);\n const year = time.getFullYear().toString();\n const day = ('0' + time.getDay().toString()).substr(-2);\n const hours = time.getHours().toString();\n const mins = time.getMinutes().toString();\n const secs = ('0' + time.getSeconds().toString()).substr(-2);\n\n return (year + '-' + month + '-' + day + ' ' + hours + ':' + mins + ':' + secs);\n }\n\n let result = [];\n lines.forEach(function (line) {\n if (line.trim() !== '') {\n line = line.trim().replace(/ +/g, ' ').replace(/,+/g, '.');\n const parts = line.split(' ');\n const command = parts.slice(9).join(' ');\n const pmem = parseFloat((1.0 * parseInt(parts[3]) * 1024 / os.totalmem()).toFixed(1));\n const elapsed_parts = parts[5].split(':');\n const started = formatDateTime(new Date(Date.now() - (elapsed_parts.length > 1 ? (elapsed_parts[0] * 60 + elapsed_parts[1]) * 1000 : elapsed_parts[0] * 1000)));\n\n result.push({\n pid: parseInt(parts[0]),\n parentPid: parseInt(parts[1]),\n name: getName(command),\n cpu: 0,\n cpuu: 0,\n cpus: 0,\n mem: pmem,\n priority: 0,\n memVsz: parseInt(parts[2]),\n memRss: parseInt(parts[3]),\n nice: parseInt(parts[4]),\n started: started,\n state: (parts[6] === 'R' ? 'running' : (parts[6] === 'S' ? 'sleeping' : (parts[6] === 'T' ? 'stopped' : (parts[6] === 'W' ? 'paging' : (parts[6] === 'X' ? 'dead' : (parts[6] === 'Z' ? 'zombie' : ((parts[6] === 'D' || parts[6] === 'U') ? 'blocked' : 'unknown'))))))),\n tty: parts[7],\n user: parts[8],\n command: command\n });\n }\n });\n return result;\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = {\n all: 0,\n running: 0,\n blocked: 0,\n sleeping: 0,\n unknown: 0,\n list: []\n };\n\n let cmd = '';\n\n if ((_processes_cpu.ms && Date.now() - _processes_cpu.ms >= 500) || _processes_cpu.ms === 0) {\n if (_linux || _freebsd || _openbsd || _netbsd || _darwin || _sunos) {\n if (_linux) { cmd = 'export LC_ALL=C; ps -axo pid:11,ppid:11,pcpu:6,pmem:6,pri:5,vsz:11,rss:11,ni:5,lstart:30,state:5,tty:15,user:20,command; unset LC_ALL'; }\n if (_freebsd || _openbsd || _netbsd) { cmd = 'export LC_ALL=C; ps -axo pid,ppid,pcpu,pmem,pri,vsz,rss,ni,lstart,state,tty,user,command; unset LC_ALL'; }\n if (_darwin) { cmd = 'ps -axo pid,ppid,pcpu,pmem,pri,vsz=xxx_fake_title,rss=fake_title2,nice,lstart,state,tty,user,command -r'; }\n if (_sunos) { cmd = 'ps -Ao pid,ppid,pcpu,pmem,pri,vsz,rss,nice,stime,s,tty,user,comm'; }\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n if (!error && stdout.toString().trim()) {\n result.list = (parseProcesses(stdout.toString().split('\\n'))).slice();\n result.all = result.list.length;\n result.running = result.list.filter(function (e) {\n return e.state === 'running';\n }).length;\n result.blocked = result.list.filter(function (e) {\n return e.state === 'blocked';\n }).length;\n result.sleeping = result.list.filter(function (e) {\n return e.state === 'sleeping';\n }).length;\n\n if (_linux) {\n // calc process_cpu - ps is not accurate in linux!\n cmd = 'cat /proc/stat | grep \"cpu \"';\n for (let i = 0; i < result.list.length; i++) {\n cmd += (';cat /proc/' + result.list[i].pid + '/stat');\n }\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n let curr_processes = stdout.toString().split('\\n');\n\n // first line (all - /proc/stat)\n let all = parseProcStat(curr_processes.shift());\n\n // process\n let list_new = {};\n let resultProcess = {};\n for (let i = 0; i < curr_processes.length; i++) {\n resultProcess = calcProcStatLinux(curr_processes[i], all, _processes_cpu);\n\n if (resultProcess.pid) {\n\n // store pcpu in outer array\n let listPos = result.list.map(function (e) { return e.pid; }).indexOf(resultProcess.pid);\n if (listPos >= 0) {\n result.list[listPos].cpu = resultProcess.cpuu + resultProcess.cpus;\n result.list[listPos].cpuu = resultProcess.cpuu;\n result.list[listPos].cpus = resultProcess.cpus;\n }\n\n // save new values\n list_new[resultProcess.pid] = {\n cpuu: resultProcess.cpuu,\n cpus: resultProcess.cpus,\n utime: resultProcess.utime,\n stime: resultProcess.stime,\n cutime: resultProcess.cutime,\n cstime: resultProcess.cstime\n };\n }\n }\n\n // store old values\n _processes_cpu.all = all;\n // _processes_cpu.list = list_new;\n _processes_cpu.list = Object.assign({}, list_new);\n _processes_cpu.ms = Date.now() - _processes_cpu.ms;\n // _processes_cpu.result = result;\n _processes_cpu.result = Object.assign({}, result);\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n cmd = 'ps -o pid,ppid,vsz,rss,nice,etime,stat,tty,user,comm';\n if (_sunos) {\n cmd = 'ps -o pid,ppid,vsz,rss,nice,etime,s,tty,user,comm';\n }\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.shift();\n\n result.list = parseProcesses2(lines).slice();\n result.all = result.list.length;\n result.running = result.list.filter(function (e) {\n return e.state === 'running';\n }).length;\n result.blocked = result.list.filter(function (e) {\n return e.state === 'blocked';\n }).length;\n result.sleeping = result.list.filter(function (e) {\n return e.state === 'sleeping';\n }).length;\n if (callback) { callback(result); }\n resolve(result);\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n }\n });\n } else if (_windows) {\n try {\n util.powerShell('Get-WmiObject Win32_Process | select ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage,CreationDate | fl').then((stdout, error) => {\n if (!error) {\n let processSections = stdout.split(/\\n\\s*\\n/);\n let procs = [];\n let procStats = [];\n let list_new = {};\n let allcpuu = 0;\n let allcpus = 0;\n // let allcpuu = _processes_cpu.all_utime;\n // let allcpus = _processes_cpu.all_stime;\n for (let i = 0; i < processSections.length; i++) {\n if (processSections[i].trim() !== '') {\n let lines = processSections[i].trim().split('\\r\\n');\n let pid = parseInt(util.getValue(lines, 'ProcessId', ':', true), 10);\n let parentPid = parseInt(util.getValue(lines, 'ParentProcessId', ':', true), 10);\n let statusValue = util.getValue(lines, 'ExecutionState', ':');\n let name = util.getValue(lines, 'Caption', ':', true);\n let commandLine = util.getValue(lines, 'CommandLine', ':', true);\n let commandPath = util.getValue(lines, 'ExecutablePath', ':', true);\n let utime = parseInt(util.getValue(lines, 'UserModeTime', ':', true), 10);\n let stime = parseInt(util.getValue(lines, 'KernelModeTime', ':', true), 10);\n let memw = parseInt(util.getValue(lines, 'WorkingSetSize', ':', true), 10);\n allcpuu = allcpuu + utime;\n allcpus = allcpus + stime;\n // allcpuu += utime - (_processes_cpu.list[pid] ? _processes_cpu.list[pid].utime : 0);\n // allcpus += stime - (_processes_cpu.list[pid] ? _processes_cpu.list[pid].stime : 0);\n result.all++;\n if (!statusValue) { result.unknown++; }\n if (statusValue === '3') { result.running++; }\n if (statusValue === '4' || statusValue === '5') { result.blocked++; }\n\n procStats.push({\n pid: pid,\n utime: utime,\n stime: stime,\n cpu: 0,\n cpuu: 0,\n cpus: 0,\n });\n procs.push({\n pid: pid,\n parentPid: parentPid,\n name: name,\n cpu: 0,\n cpuu: 0,\n cpus: 0,\n mem: memw / os.totalmem() * 100,\n priority: parseInt(util.getValue(lines, 'Priority', ':', true), 10),\n memVsz: parseInt(util.getValue(lines, 'PageFileUsage', ':', true), 10),\n memRss: Math.floor(parseInt(util.getValue(lines, 'WorkingSetSize', ':', true), 10) / 1024),\n nice: 0,\n started: parseTimeWin(util.getValue(lines, 'CreationDate', ':', true)),\n state: (!statusValue ? _winStatusValues[0] : _winStatusValues[statusValue]),\n tty: '',\n user: '',\n command: commandLine || name,\n path: commandPath,\n params: ''\n });\n }\n }\n result.sleeping = result.all - result.running - result.blocked - result.unknown;\n result.list = procs;\n for (let i = 0; i < procStats.length; i++) {\n let resultProcess = calcProcStatWin(procStats[i], allcpuu + allcpus, _processes_cpu);\n\n // store pcpu in outer array\n let listPos = result.list.map(function (e) { return e.pid; }).indexOf(resultProcess.pid);\n if (listPos >= 0) {\n result.list[listPos].cpu = resultProcess.cpuu + resultProcess.cpus;\n result.list[listPos].cpuu = resultProcess.cpuu;\n result.list[listPos].cpus = resultProcess.cpus;\n }\n\n // save new values\n list_new[resultProcess.pid] = {\n cpuu: resultProcess.cpuu,\n cpus: resultProcess.cpus,\n utime: resultProcess.utime,\n stime: resultProcess.stime\n };\n }\n // store old values\n _processes_cpu.all = allcpuu + allcpus;\n _processes_cpu.all_utime = allcpuu;\n _processes_cpu.all_stime = allcpus;\n // _processes_cpu.list = list_new;\n _processes_cpu.list = Object.assign({}, list_new);\n _processes_cpu.ms = Date.now() - _processes_cpu.ms;\n // _processes_cpu.result = result;\n _processes_cpu.result = Object.assign({}, result);\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n if (callback) { callback(_processes_cpu.result); }\n resolve(_processes_cpu.result);\n }\n });\n });\n}\n\nexports.processes = processes;\n\n// --------------------------\n// PS - process load\n// get detailed information about a certain process\n// (PID, CPU-Usage %, Mem-Usage %)\n\nfunction processLoad(proc, callback) {\n\n // fallback - if only callback is given\n if (util.isFunction(proc) && !callback) {\n callback = proc;\n proc = '';\n }\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n proc = proc || '';\n\n if (typeof proc !== 'string') {\n if (callback) { callback([]); }\n return resolve([]);\n }\n\n let processesString = '';\n processesString.__proto__.toLowerCase = util.stringToLower;\n processesString.__proto__.replace = util.stringReplace;\n processesString.__proto__.trim = util.stringTrim;\n\n const s = util.sanitizeShellString(proc);\n for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {\n if (!(s[i] === undefined)) {\n processesString = processesString + s[i];\n }\n }\n\n processesString = processesString.trim().toLowerCase().replace(/, /g, '|').replace(/,+/g, '|');\n if (processesString === '') {\n processesString = '*';\n }\n if (util.isPrototypePolluted() && processesString !== '*') {\n processesString = '------';\n }\n let processes = processesString.split('|');\n let result = [];\n\n const procSanitized = util.isPrototypePolluted() ? '' : util.sanitizeShellString(proc);\n\n // from here new\n // let result = {\n // 'proc': procSanitized,\n // 'pid': null,\n // 'cpu': 0,\n // 'mem': 0\n // };\n if (procSanitized && processes.length && processes[0] !== '------') {\n if (_windows) {\n try {\n util.powerShell('Get-WmiObject Win32_Process | select ProcessId,Caption,UserModeTime,KernelModeTime,WorkingSetSize | fl').then((stdout, error) => {\n if (!error) {\n let processSections = stdout.split(/\\n\\s*\\n/);\n let procStats = [];\n let list_new = {};\n let allcpuu = 0;\n let allcpus = 0;\n // let allcpuu = _process_cpu.all_utime;\n // let allcpus = _process_cpu.all_stime;\n\n // go through all processes\n for (let i = 0; i < processSections.length; i++) {\n if (processSections[i].trim() !== '') {\n let lines = processSections[i].trim().split('\\r\\n');\n let pid = parseInt(util.getValue(lines, 'ProcessId', ':', true), 10);\n let name = util.getValue(lines, 'Caption', ':', true);\n let utime = parseInt(util.getValue(lines, 'UserModeTime', ':', true), 10);\n let stime = parseInt(util.getValue(lines, 'KernelModeTime', ':', true), 10);\n let mem = parseInt(util.getValue(lines, 'WorkingSetSize', ':', true), 10);\n allcpuu = allcpuu + utime;\n allcpus = allcpus + stime;\n // allcpuu += utime - (_process_cpu.list[pid] ? _process_cpu.list[pid].utime : 0);\n // allcpus += stime - (_process_cpu.list[pid] ? _process_cpu.list[pid].stime : 0);\n\n procStats.push({\n pid: pid,\n name,\n utime: utime,\n stime: stime,\n cpu: 0,\n cpuu: 0,\n cpus: 0,\n mem\n });\n let pname = '';\n let inList = false;\n processes.forEach(function (proc) {\n // console.log(proc)\n // console.log(item)\n // inList = inList || item.name.toLowerCase() === proc.toLowerCase();\n if (name.toLowerCase().indexOf(proc.toLowerCase()) >= 0 && !inList) {\n inList = true;\n pname = proc;\n }\n });\n\n if (processesString === '*' || inList) {\n let processFound = false;\n result.forEach(function (item) {\n if (item.proc.toLowerCase() === pname.toLowerCase()) {\n item.pids.push(pid);\n item.mem += mem / os.totalmem() * 100;\n processFound = true;\n }\n });\n if (!processFound) {\n result.push({\n proc: pname,\n pid: pid,\n pids: [pid],\n cpu: 0,\n mem: mem / os.totalmem() * 100\n });\n }\n }\n }\n }\n // add missing processes\n if (processesString !== '*') {\n let processesMissing = processes.filter(function (name) {\n // return procStats.filter(function(item) { return item.name.toLowerCase() === name }).length === 0;\n return procStats.filter(function (item) { return item.name.toLowerCase().indexOf(name) >= 0; }).length === 0;\n\n });\n processesMissing.forEach(function (procName) {\n result.push({\n proc: procName,\n pid: null,\n pids: [],\n cpu: 0,\n mem: 0\n });\n });\n }\n\n // calculate proc stats for each proc\n for (let i = 0; i < procStats.length; i++) {\n let resultProcess = calcProcStatWin(procStats[i], allcpuu + allcpus, _process_cpu);\n\n let listPos = -1;\n for (let j = 0; j < result.length; j++) {\n if (result[j].pid === resultProcess.pid || result[j].pids.indexOf(resultProcess.pid) >= 0) { listPos = j; }\n }\n if (listPos >= 0) {\n result[listPos].cpu += resultProcess.cpuu + resultProcess.cpus;\n }\n\n // save new values\n list_new[resultProcess.pid] = {\n cpuu: resultProcess.cpuu,\n cpus: resultProcess.cpus,\n utime: resultProcess.utime,\n stime: resultProcess.stime\n };\n }\n // store old values\n _process_cpu.all = allcpuu + allcpus;\n _process_cpu.all_utime = allcpuu;\n _process_cpu.all_stime = allcpus;\n // _process_cpu.list = list_new;\n _process_cpu.list = Object.assign({}, list_new);\n _process_cpu.ms = Date.now() - _process_cpu.ms;\n _process_cpu.result = JSON.parse(JSON.stringify(result));\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n\n if (_darwin || _linux || _freebsd || _openbsd || _netbsd) {\n const params = ['-axo', 'pid,pcpu,pmem,comm'];\n util.execSafe('ps', params).then((stdout) => {\n if (stdout) {\n let procStats = [];\n let lines = stdout.toString().split('\\n').filter(function (line) {\n if (processesString === '*') { return true; }\n if (line.toLowerCase().indexOf('grep') !== -1) { return false; } // remove this??\n let found = false;\n processes.forEach(function (item) {\n found = found || (line.toLowerCase().indexOf(item.toLowerCase()) >= 0);\n });\n return found;\n });\n\n lines.forEach(function (line) {\n let data = line.trim().replace(/ +/g, ' ').split(' ');\n if (data.length > 3) {\n procStats.push({\n name: data[3].substring(data[3].lastIndexOf('/') + 1),\n pid: parseInt(data[0]) || 0,\n cpu: parseFloat(data[1].replace(',', '.')),\n mem: parseFloat(data[2].replace(',', '.'))\n });\n }\n });\n\n procStats.forEach(function (item) {\n let listPos = -1;\n let inList = false;\n let name = '';\n for (let j = 0; j < result.length; j++) {\n // if (result[j].proc.toLowerCase() === item.name.toLowerCase()) {\n // if (result[j].proc.toLowerCase().indexOf(item.name.toLowerCase()) >= 0) {\n if (item.name.toLowerCase().indexOf(result[j].proc.toLowerCase()) >= 0) {\n listPos = j;\n }\n }\n // console.log(listPos);\n processes.forEach(function (proc) {\n // console.log(proc)\n // console.log(item)\n // inList = inList || item.name.toLowerCase() === proc.toLowerCase();\n if (item.name.toLowerCase().indexOf(proc.toLowerCase()) >= 0 && !inList) {\n inList = true;\n name = proc;\n }\n });\n // console.log(item);\n // console.log(listPos);\n if ((processesString === '*') || inList) {\n if (listPos < 0) {\n result.push({\n proc: name,\n pid: item.pid,\n pids: [item.pid],\n cpu: item.cpu,\n mem: item.mem\n });\n } else {\n result[listPos].pids.push(item.pid);\n result[listPos].cpu += item.cpu;\n result[listPos].mem += item.mem;\n }\n }\n });\n\n if (processesString !== '*') {\n // add missing processes\n let processesMissing = processes.filter(function (name) {\n return procStats.filter(function (item) { return item.name.toLowerCase().indexOf(name) >= 0; }).length === 0;\n });\n processesMissing.forEach(function (procName) {\n result.push({\n proc: procName,\n pid: null,\n pids: [],\n cpu: 0,\n mem: 0\n });\n });\n }\n if (_linux) {\n // calc process_cpu - ps is not accurate in linux!\n result.forEach(function (item) {\n item.cpu = 0;\n });\n let cmd = 'cat /proc/stat | grep \"cpu \"';\n for (let i in result) {\n for (let j in result[i].pids) {\n cmd += (';cat /proc/' + result[i].pids[j] + '/stat');\n }\n }\n exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {\n let curr_processes = stdout.toString().split('\\n');\n\n // first line (all - /proc/stat)\n let all = parseProcStat(curr_processes.shift());\n\n // process\n let list_new = {};\n let resultProcess = {};\n\n for (let i = 0; i < curr_processes.length; i++) {\n resultProcess = calcProcStatLinux(curr_processes[i], all, _process_cpu);\n\n if (resultProcess.pid) {\n\n // find result item\n let resultItemId = -1;\n for (let i in result) {\n if (result[i].pids.indexOf(resultProcess.pid) >= 0) {\n resultItemId = i;\n }\n }\n // store pcpu in outer result\n if (resultItemId >= 0) {\n result[resultItemId].cpu += resultProcess.cpuu + resultProcess.cpus;\n }\n\n // save new values\n list_new[resultProcess.pid] = {\n cpuu: resultProcess.cpuu,\n cpus: resultProcess.cpus,\n utime: resultProcess.utime,\n stime: resultProcess.stime,\n cutime: resultProcess.cutime,\n cstime: resultProcess.cstime\n };\n }\n }\n\n result.forEach(function (item) {\n item.cpu = Math.round(item.cpu * 100) / 100;\n });\n\n _process_cpu.all = all;\n // _process_cpu.list = list_new;\n _process_cpu.list = Object.assign({}, list_new);\n _process_cpu.ms = Date.now() - _process_cpu.ms;\n // _process_cpu.result = result;\n _process_cpu.result = Object.assign({}, result);\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n }\n }\n });\n });\n}\n\nexports.processLoad = processLoad;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// system.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 2. System (Hardware, BIOS, Base Board)\n// ----------------------------------------------------------------------------------\n\nconst fs = require('fs');\nconst os = require('os');\nconst util = require('./util');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst execPromise = util.promisify(require('child_process').exec);\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nfunction system(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = {\n manufacturer: '',\n model: 'Computer',\n version: '',\n serial: '-',\n uuid: '-',\n sku: '-',\n virtual: false\n };\n\n if (_linux || _freebsd || _openbsd || _netbsd) {\n exec('export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL', function (error, stdout) {\n // if (!error) {\n let lines = stdout.toString().split('\\n');\n result.manufacturer = util.getValue(lines, 'manufacturer');\n result.model = util.getValue(lines, 'product name');\n result.version = util.getValue(lines, 'version');\n result.serial = util.getValue(lines, 'serial number');\n result.uuid = util.getValue(lines, 'uuid').toLowerCase();\n result.sku = util.getValue(lines, 'sku number');\n // }\n // Non-Root values\n const cmd = `echo -n \"product_name: \"; cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null; echo;\n echo -n \"product_serial: \"; cat /sys/devices/virtual/dmi/id/product_serial 2>/dev/null; echo;\n echo -n \"product_uuid: \"; cat /sys/devices/virtual/dmi/id/product_uuid 2>/dev/null; echo;\n echo -n \"product_version: \"; cat /sys/devices/virtual/dmi/id/product_version 2>/dev/null; echo;\n echo -n \"sys_vendor: \"; cat /sys/devices/virtual/dmi/id/sys_vendor 2>/dev/null; echo;`;\n try {\n lines = execSync(cmd).toString().split('\\n');\n result.manufacturer = result.manufacturer === '' ? util.getValue(lines, 'sys_vendor') : result.manufacturer;\n result.model = result.model === '' ? util.getValue(lines, 'product_name') : result.model;\n result.version = result.version === '' ? util.getValue(lines, 'product_version') : result.version;\n result.serial = result.serial === '' ? util.getValue(lines, 'product_serial') : result.serial;\n result.uuid = result.uuid === '' ? util.getValue(lines, 'product_uuid').toLowerCase() : result.uuid;\n } catch (e) {\n util.noop();\n }\n if (!result.serial || result.serial.toLowerCase().indexOf('o.e.m.') !== -1) { result.serial = '-'; }\n if (!result.manufacturer || result.manufacturer.toLowerCase().indexOf('o.e.m.') !== -1) { result.manufacturer = ''; }\n if (!result.model || result.model.toLowerCase().indexOf('o.e.m.') !== -1) { result.model = 'Computer'; }\n if (!result.version || result.version.toLowerCase().indexOf('o.e.m.') !== -1) { result.version = ''; }\n if (!result.sku || result.sku.toLowerCase().indexOf('o.e.m.') !== -1) { result.sku = '-'; }\n\n // detect virtual (1)\n if (result.model.toLowerCase() === 'virtualbox' || result.model.toLowerCase() === 'kvm' || result.model.toLowerCase() === 'virtual machine' || result.model.toLowerCase() === 'bochs' || result.model.toLowerCase().startsWith('vmware') || result.model.toLowerCase().startsWith('droplet')) {\n result.virtual = true;\n switch (result.model.toLowerCase()) {\n case 'virtualbox':\n result.virtualHost = 'VirtualBox';\n break;\n case 'vmware':\n result.virtualHost = 'VMware';\n break;\n case 'kvm':\n result.virtualHost = 'KVM';\n break;\n case 'bochs':\n result.virtualHost = 'bochs';\n break;\n }\n }\n if (result.manufacturer.toLowerCase().startsWith('vmware') || result.manufacturer.toLowerCase() === 'xen') {\n result.virtual = true;\n switch (result.manufacturer.toLowerCase()) {\n case 'vmware':\n result.virtualHost = 'VMware';\n break;\n case 'xen':\n result.virtualHost = 'Xen';\n break;\n }\n }\n if (!result.virtual) {\n try {\n const disksById = execSync('ls -1 /dev/disk/by-id/ 2>/dev/null').toString();\n if (disksById.indexOf('_QEMU_') >= 0) {\n result.virtual = true;\n result.virtualHost = 'QEMU';\n }\n if (disksById.indexOf('_VBOX_') >= 0) {\n result.virtual = true;\n result.virtualHost = 'VirtualBox';\n }\n } catch (e) {\n util.noop();\n }\n }\n if (!result.virtual && (os.release().toLowerCase().indexOf('microsoft') >= 0 || os.release().toLowerCase().endsWith('wsl2'))) {\n const kernelVersion = parseFloat(os.release().toLowerCase());\n result.virtual = true;\n result.manufacturer = 'Microsoft';\n result.model = 'WSL';\n result.version = kernelVersion < 4.19 ? '1' : '2';\n }\n if ((_freebsd || _openbsd || _netbsd) && !result.virtualHost) {\n try {\n const procInfo = execSync('dmidecode -t 4');\n const procLines = procInfo.toString().split('\\n');\n const procManufacturer = util.getValue(procLines, 'manufacturer', ':', true);\n switch (procManufacturer.toLowerCase()) {\n case 'virtualbox':\n result.virtualHost = 'VirtualBox';\n break;\n case 'vmware':\n result.virtualHost = 'VMware';\n break;\n case 'kvm':\n result.virtualHost = 'KVM';\n break;\n case 'bochs':\n result.virtualHost = 'bochs';\n break;\n }\n } catch (e) {\n util.noop();\n }\n }\n // detect docker\n if (fs.existsSync('/.dockerenv') || fs.existsSync('/.dockerinit')) {\n result.model = 'Docker Container';\n }\n try {\n const stdout = execSync('dmesg 2>/dev/null | grep -iE \"virtual|hypervisor\" | grep -iE \"vmware|qemu|kvm|xen\" | grep -viE \"Nested Virtualization|/virtual/\"');\n // detect virtual machines\n let lines = stdout.toString().split('\\n');\n if (lines.length > 0) {\n if (result.model === 'Computer') { result.model = 'Virtual machine'; }\n result.virtual = true;\n if (stdout.toString().toLowerCase().indexOf('vmware') >= 0 && !result.virtualHost) {\n result.virtualHost = 'VMware';\n }\n if (stdout.toString().toLowerCase().indexOf('qemu') >= 0 && !result.virtualHost) {\n result.virtualHost = 'QEMU';\n }\n if (stdout.toString().toLowerCase().indexOf('xen') >= 0 && !result.virtualHost) {\n result.virtualHost = 'Xen';\n }\n if (stdout.toString().toLowerCase().indexOf('kvm') >= 0 && !result.virtualHost) {\n result.virtualHost = 'KVM';\n }\n }\n } catch (e) {\n util.noop();\n }\n\n if (result.manufacturer === '' && result.model === 'Computer' && result.version === '') {\n // Check Raspberry Pi\n fs.readFile('/proc/cpuinfo', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n result.model = util.getValue(lines, 'hardware', ':', true).toUpperCase();\n result.version = util.getValue(lines, 'revision', ':', true).toLowerCase();\n result.serial = util.getValue(lines, 'serial', ':', true);\n const model = util.getValue(lines, 'model:', ':', true);\n // reference values: https://elinux.org/RPi_HardwareHistory\n // https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md\n if ((result.model === 'BCM2835' || result.model === 'BCM2708' || result.model === 'BCM2709' || result.model === 'BCM2710' || result.model === 'BCM2711' || result.model === 'BCM2836' || result.model === 'BCM2837') && model.toLowerCase().indexOf('raspberry') >= 0) {\n const rPIRevision = util.decodePiCpuinfo(lines);\n result.model = rPIRevision.model;\n result.version = rPIRevision.revisionCode;\n result.manufacturer = 'Raspberry Pi Foundation';\n result.raspberry = {\n manufacturer: rPIRevision.manufacturer,\n processor: rPIRevision.processor,\n type: rPIRevision.type,\n revision: rPIRevision.revision\n };\n }\n\n // if (result.model === 'BCM2835' || result.model === 'BCM2708' || result.model === 'BCM2709' || result.model === 'BCM2835' || result.model === 'BCM2837') {\n\n\n // // Pi 4\n // if (['d03114'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 4 Model B';\n // result.version = result.version + ' - Rev. 1.4';\n // }\n // if (['b03112', 'c03112'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 4 Model B';\n // result.version = result.version + ' - Rev. 1.2';\n // }\n // if (['a03111', 'b03111', 'c03111'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 4 Model B';\n // result.version = result.version + ' - Rev. 1.1';\n // }\n // // Pi 3\n // if (['a02082', 'a22082', 'a32082', 'a52082'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 3 Model B';\n // result.version = result.version + ' - Rev. 1.2';\n // }\n // if (['a22083'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 3 Model B';\n // result.version = result.version + ' - Rev. 1.3';\n // }\n // if (['a020d3'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 3 Model B+';\n // result.version = result.version + ' - Rev. 1.3';\n // }\n // if (['9020e0'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 3 Model A+';\n // result.version = result.version + ' - Rev. 1.3';\n // }\n // // Pi 2 Model B\n // if (['a01040'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 2 Model B';\n // result.version = result.version + ' - Rev. 1.0';\n // }\n // if (['a01041', 'a21041'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 2 Model B';\n // result.version = result.version + ' - Rev. 1.1';\n // }\n // if (['a22042', 'a02042'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi 2 Model B';\n // result.version = result.version + ' - Rev. 1.2';\n // }\n\n // // Compute Model\n // if (['a02100'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi CM3+';\n // result.version = result.version + ' - Rev 1.0';\n // }\n // if (['a020a0', 'a220a0'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi CM3';\n // result.version = result.version + ' - Rev 1.0';\n // }\n // if (['900061'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi CM';\n // result.version = result.version + ' - Rev 1.1';\n // }\n\n // // Pi Zero\n // if (['900092', '920092'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Zero';\n // result.version = result.version + ' - Rev 1.2';\n // }\n // if (['900093', '920093'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Zero';\n // result.version = result.version + ' - Rev 1.3';\n // }\n // if (['9000c1'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Zero W';\n // result.version = result.version + ' - Rev 1.1';\n // }\n\n // // A, B, A+ B+\n // if (['0002', '0003'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Model B';\n // result.version = result.version + ' - Rev 1.0';\n // }\n // if (['0004', '0005', '0006', '000d', '000e', '000f'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Model B';\n // result.version = result.version + ' - Rev 2.0';\n // }\n // if (['0007', '0008', '0009'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Model A';\n // result.version = result.version + ' - Rev 2.0';\n // }\n // if (['0010'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Model B+';\n // result.version = result.version + ' - Rev 1.0';\n // }\n // if (['0012'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Model A+';\n // result.version = result.version + ' - Rev 1.0';\n // }\n // if (['0013', '900032'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Model B+';\n // result.version = result.version + ' - Rev 1.2';\n // }\n // if (['0015', '900021'].indexOf(result.version) >= 0) {\n // result.model = result.model + ' - Pi Model A+';\n // result.version = result.version + ' - Rev 1.1';\n // }\n // if (result.model.indexOf('Pi') !== -1 && result.version) { // Pi, Pi Zero\n // result.manufacturer = 'Raspberry Pi Foundation';\n // }\n // }\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n }\n if (_darwin) {\n exec('ioreg -c IOPlatformExpertDevice -d 2', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().replace(/[<>\"]/g, '').split('\\n');\n result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);\n result.model = util.getValue(lines, 'model', '=', true);\n result.version = util.getValue(lines, 'version', '=', true);\n result.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true);\n result.uuid = util.getValue(lines, 'ioplatformuuid', '=', true).toLowerCase();\n result.sku = util.getValue(lines, 'board-id', '=', true);\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n try {\n util.powerShell('Get-WmiObject Win32_ComputerSystemProduct | select Name,Vendor,Version,IdentifyingNumber,UUID | fl').then((stdout, error) => {\n if (!error) {\n // let lines = stdout.split('\\r\\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0)[0].trim().split(/\\s\\s+/);\n let lines = stdout.split('\\r\\n');\n result.manufacturer = util.getValue(lines, 'vendor', ':');\n result.model = util.getValue(lines, 'name', ':');\n result.version = util.getValue(lines, 'version', ':');\n result.serial = util.getValue(lines, 'identifyingnumber', ':');\n result.uuid = util.getValue(lines, 'uuid', ':').toLowerCase();\n // detect virtual (1)\n const model = result.model.toLowerCase();\n if (model === 'virtualbox' || model === 'kvm' || model === 'virtual machine' || model === 'bochs' || model.startsWith('vmware') || model.startsWith('qemu')) {\n result.virtual = true;\n if (model.startsWith('virtualbox')) { result.virtualHost = 'VirtualBox'; }\n if (model.startsWith('vmware')) { result.virtualHost = 'VMware'; }\n if (model.startsWith('kvm')) { result.virtualHost = 'KVM'; }\n if (model.startsWith('bochs')) { result.virtualHost = 'bochs'; }\n if (model.startsWith('qemu')) { result.virtualHost = 'KVM'; }\n }\n const manufacturer = result.manufacturer.toLowerCase();\n if (manufacturer.startsWith('vmware') || manufacturer.startsWith('qemu') || manufacturer === 'xen') {\n result.virtual = true;\n if (manufacturer.startsWith('vmware')) { result.virtualHost = 'VMware'; }\n if (manufacturer.startsWith('xen')) { result.virtualHost = 'Xen'; }\n if (manufacturer.startsWith('qemu')) { result.virtualHost = 'KVM'; }\n }\n util.powerShell('Get-WmiObject MS_Systeminformation -Namespace \"root/wmi\" | select systemsku | fl ').then((stdout, error) => {\n if (!error) {\n let lines = stdout.split('\\r\\n');\n result.sku = util.getValue(lines, 'systemsku', ':');\n }\n if (!result.virtual) {\n util.powerShell('Get-WmiObject Win32_bios | select Version, SerialNumber, SMBIOSBIOSVersion').then((stdout, error) => {\n if (!error) {\n let lines = stdout.toString();\n if (lines.indexOf('VRTUAL') >= 0 || lines.indexOf('A M I ') >= 0 || lines.indexOf('VirtualBox') >= 0 || lines.indexOf('VMWare') >= 0 || lines.indexOf('Xen') >= 0) {\n result.virtual = true;\n if (lines.indexOf('VirtualBox') >= 0 && !result.virtualHost) {\n result.virtualHost = 'VirtualBox';\n }\n if (lines.indexOf('VMware') >= 0 && !result.virtualHost) {\n result.virtualHost = 'VMware';\n }\n if (lines.indexOf('Xen') >= 0 && !result.virtualHost) {\n result.virtualHost = 'Xen';\n }\n if (lines.indexOf('VRTUAL') >= 0 && !result.virtualHost) {\n result.virtualHost = 'Hyper-V';\n }\n if (lines.indexOf('A M I') >= 0 && !result.virtualHost) {\n result.virtualHost = 'Virtual PC';\n }\n }\n if (callback) { callback(result); }\n resolve(result);\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.system = system;\n\nfunction bios(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = {\n vendor: '',\n version: '',\n releaseDate: '',\n revision: '',\n };\n let cmd = '';\n if (_linux || _freebsd || _openbsd || _netbsd) {\n if (process.arch === 'arm') {\n cmd = 'cat /proc/cpuinfo | grep Serial';\n } else {\n cmd = 'export LC_ALL=C; dmidecode -t bios 2>/dev/null; unset LC_ALL';\n }\n exec(cmd, function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n result.vendor = util.getValue(lines, 'Vendor');\n result.version = util.getValue(lines, 'Version');\n let datetime = util.getValue(lines, 'Release Date');\n result.releaseDate = util.parseDateTime(datetime).date;\n result.revision = util.getValue(lines, 'BIOS Revision');\n result.serial = util.getValue(lines, 'SerialNumber');\n let language = util.getValue(lines, 'Currently Installed Language').split('|')[0];\n if (language) {\n result.language = language;\n }\n if (lines.length && stdout.toString().indexOf('Characteristics:') >= 0) {\n const features = [];\n lines.forEach(line => {\n if (line.indexOf(' is supported') >= 0) {\n const feature = line.split(' is supported')[0].trim();\n features.push(feature);\n }\n });\n result.features = features;\n }\n // Non-Root values\n const cmd = `echo -n \"bios_date: \"; cat /sys/devices/virtual/dmi/id/bios_date 2>/dev/null; echo;\n echo -n \"bios_vendor: \"; cat /sys/devices/virtual/dmi/id/bios_vendor 2>/dev/null; echo;\n echo -n \"bios_version: \"; cat /sys/devices/virtual/dmi/id/bios_version 2>/dev/null; echo;`;\n try {\n lines = execSync(cmd).toString().split('\\n');\n result.vendor = !result.vendor ? util.getValue(lines, 'bios_vendor') : result.vendor;\n result.version = !result.version ? util.getValue(lines, 'bios_version') : result.version;\n datetime = util.getValue(lines, 'bios_date');\n result.releaseDate = !result.releaseDate ? util.parseDateTime(datetime).date : result.releaseDate;\n } catch (e) {\n util.noop();\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_darwin) {\n result.vendor = 'Apple Inc.';\n exec(\n 'system_profiler SPHardwareDataType -json', function (error, stdout) {\n try {\n const hardwareData = JSON.parse(stdout.toString());\n if (hardwareData && hardwareData.SPHardwareDataType && hardwareData.SPHardwareDataType.length) {\n let bootRomVersion = hardwareData.SPHardwareDataType[0].boot_rom_version;\n bootRomVersion = bootRomVersion ? bootRomVersion.split('(')[0].trim() : null;\n result.version = bootRomVersion;\n }\n } catch (e) {\n util.noop();\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n result.vendor = 'Sun Microsystems';\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n try {\n util.powerShell('Get-WmiObject Win32_bios | select Description,Version,Manufacturer,ReleaseDate,BuildNumber,SerialNumber | fl').then((stdout, error) => {\n if (!error) {\n let lines = stdout.toString().split('\\r\\n');\n const description = util.getValue(lines, 'description', ':');\n if (description.indexOf(' Version ') !== -1) {\n // ... Phoenix ROM BIOS PLUS Version 1.10 A04\n result.vendor = description.split(' Version ')[0].trim();\n result.version = description.split(' Version ')[1].trim();\n } else if (description.indexOf(' Ver: ') !== -1) {\n // ... BIOS Date: 06/27/16 17:50:16 Ver: 1.4.5\n result.vendor = util.getValue(lines, 'manufacturer', ':');\n result.version = description.split(' Ver: ')[1].trim();\n } else {\n result.vendor = util.getValue(lines, 'manufacturer', ':');\n result.version = util.getValue(lines, 'version', ':');\n }\n result.releaseDate = util.getValue(lines, 'releasedate', ':');\n if (result.releaseDate.length >= 10) {\n result.releaseDate = result.releaseDate.substr(0, 4) + '-' + result.releaseDate.substr(4, 2) + '-' + result.releaseDate.substr(6, 2);\n }\n result.revision = util.getValue(lines, 'buildnumber', ':');\n result.serial = util.getValue(lines, 'serialnumber', ':');\n }\n\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.bios = bios;\n\nfunction baseboard(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = {\n manufacturer: '',\n model: '',\n version: '',\n serial: '-',\n assetTag: '-',\n memMax: null,\n memSlots: null\n };\n let cmd = '';\n if (_linux || _freebsd || _openbsd || _netbsd) {\n if (process.arch === 'arm') {\n cmd = 'cat /proc/cpuinfo | grep Serial';\n // 'BCM2709', 'BCM2835', 'BCM2708' -->\n } else {\n cmd = 'export LC_ALL=C; dmidecode -t 2 2>/dev/null; unset LC_ALL';\n }\n const workload = [];\n workload.push(execPromise(cmd));\n workload.push(execPromise('export LC_ALL=C; dmidecode -t memory 2>/dev/null'));\n util.promiseAll(\n workload\n ).then(data => {\n let lines = data.results[0] ? data.results[0].toString().split('\\n') : [''];\n result.manufacturer = util.getValue(lines, 'Manufacturer');\n result.model = util.getValue(lines, 'Product Name');\n result.version = util.getValue(lines, 'Version');\n result.serial = util.getValue(lines, 'Serial Number');\n result.assetTag = util.getValue(lines, 'Asset Tag');\n // Non-Root values\n const cmd = `echo -n \"board_asset_tag: \"; cat /sys/devices/virtual/dmi/id/board_asset_tag 2>/dev/null; echo;\n echo -n \"board_name: \"; cat /sys/devices/virtual/dmi/id/board_name 2>/dev/null; echo;\n echo -n \"board_serial: \"; cat /sys/devices/virtual/dmi/id/board_serial 2>/dev/null; echo;\n echo -n \"board_vendor: \"; cat /sys/devices/virtual/dmi/id/board_vendor 2>/dev/null; echo;\n echo -n \"board_version: \"; cat /sys/devices/virtual/dmi/id/board_version 2>/dev/null; echo;`;\n try {\n lines = execSync(cmd).toString().split('\\n');\n result.manufacturer = !result.manufacturer ? util.getValue(lines, 'board_vendor') : result.manufacturer;\n result.model = !result.model ? util.getValue(lines, 'board_name') : result.model;\n result.version = !result.version ? util.getValue(lines, 'board_version') : result.version;\n result.serial = !result.serial ? util.getValue(lines, 'board_serial') : result.serial;\n result.assetTag = !result.assetTag ? util.getValue(lines, 'board_asset_tag') : result.assetTag;\n } catch (e) {\n util.noop();\n }\n if (result.serial.toLowerCase().indexOf('o.e.m.') !== -1) { result.serial = '-'; }\n if (result.assetTag.toLowerCase().indexOf('o.e.m.') !== -1) { result.assetTag = '-'; }\n\n // mem\n lines = data.results[1] ? data.results[1].toString().split('\\n') : [''];\n result.memMax = util.toInt(util.getValue(lines, 'Maximum Capacity')) * 1024 * 1024 * 1024 || null;\n result.memSlots = util.toInt(util.getValue(lines, 'Number Of Devices')) || null;\n\n // raspberry\n let linesRpi = '';\n try {\n linesRpi = fs.readFileSync('/proc/cpuinfo').toString().split('\\n');\n } catch (e) {\n util.noop();\n }\n const hardware = util.getValue(linesRpi, 'hardware');\n if (hardware.startsWith('BCM')) {\n const rpi = util.decodePiCpuinfo(linesRpi);\n result.manufacturer = rpi.manufacturer;\n result.model = 'Raspberry Pi';\n result.serial = rpi.serial;\n result.version = rpi.type + ' - ' + rpi.revision;\n result.memMax = os.totalmem();\n result.memSlots = 0;\n }\n\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_darwin) {\n const workload = [];\n workload.push(execPromise('ioreg -c IOPlatformExpertDevice -d 2'));\n workload.push(execPromise('system_profiler SPMemoryDataType'));\n util.promiseAll(\n workload\n ).then(data => {\n let lines = data.results[0] ? data.results[0].toString().replace(/[<>\"]/g, '').split('\\n') : [''];\n result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);\n result.model = util.getValue(lines, 'model', '=', true);\n result.version = util.getValue(lines, 'version', '=', true);\n result.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true);\n result.assetTag = util.getValue(lines, 'board-id', '=', true);\n\n // mem\n let devices = data.results[1] ? data.results[1].toString().split(' BANK ') : [''];\n if (devices.length === 1) {\n devices = data.results[1] ? data.results[1].toString().split(' DIMM') : [''];\n }\n devices.shift();\n result.memSlots = devices.length;\n\n if (os.arch() === 'arm64') {\n result.memSlots = 0;\n result.memMax = os.totalmem();\n }\n\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n try {\n const workload = [];\n workload.push(util.powerShell('Get-WmiObject Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl'));\n workload.push(util.powerShell('Get-WmiObject Win32_physicalmemoryarray | select MaxCapacity, MemoryDevices | fl'));\n util.promiseAll(\n workload\n ).then(data => {\n let lines = data.results[0] ? data.results[0].toString().split('\\r\\n') : [''];\n\n result.manufacturer = util.getValue(lines, 'manufacturer', ':');\n result.model = util.getValue(lines, 'model', ':');\n if (!result.model) {\n result.model = util.getValue(lines, 'product', ':');\n }\n result.version = util.getValue(lines, 'version', ':');\n result.serial = util.getValue(lines, 'serialnumber', ':');\n result.assetTag = util.getValue(lines, 'partnumber', ':');\n if (!result.assetTag) {\n result.assetTag = util.getValue(lines, 'sku', ':');\n }\n\n // memphysical\n lines = data.results[1] ? data.results[1].toString().split('\\r\\n') : [''];\n result.memMax = util.toInt(util.getValue(lines, 'MaxCapacity', ':')) || null;\n result.memSlots = util.toInt(util.getValue(lines, 'MemoryDevices', ':')) || null;\n\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.baseboard = baseboard;\n\nfunction chassis(callback) {\n const chassisTypes = ['Other',\n 'Unknown',\n 'Desktop',\n 'Low Profile Desktop',\n 'Pizza Box',\n 'Mini Tower',\n 'Tower',\n 'Portable',\n 'Laptop',\n 'Notebook',\n 'Hand Held',\n 'Docking Station',\n 'All in One',\n 'Sub Notebook',\n 'Space-Saving',\n 'Lunch Box',\n 'Main System Chassis',\n 'Expansion Chassis',\n 'SubChassis',\n 'Bus Expansion Chassis',\n 'Peripheral Chassis',\n 'Storage Chassis',\n 'Rack Mount Chassis',\n 'Sealed-Case PC',\n 'Multi-System Chassis',\n 'Compact PCI',\n 'Advanced TCA',\n 'Blade',\n 'Blade Enclosure',\n 'Tablet',\n 'Convertible',\n 'Detachable',\n 'IoT Gateway ',\n 'Embedded PC',\n 'Mini PC',\n 'Stick PC',\n ];\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n\n let result = {\n manufacturer: '',\n model: '',\n type: '',\n version: '',\n serial: '-',\n assetTag: '-',\n sku: '',\n };\n if (_linux || _freebsd || _openbsd || _netbsd) {\n const cmd = `echo -n \"chassis_asset_tag: \"; cat /sys/devices/virtual/dmi/id/chassis_asset_tag 2>/dev/null; echo;\n echo -n \"chassis_serial: \"; cat /sys/devices/virtual/dmi/id/chassis_serial 2>/dev/null; echo;\n echo -n \"chassis_type: \"; cat /sys/devices/virtual/dmi/id/chassis_type 2>/dev/null; echo;\n echo -n \"chassis_vendor: \"; cat /sys/devices/virtual/dmi/id/chassis_vendor 2>/dev/null; echo;\n echo -n \"chassis_version: \"; cat /sys/devices/virtual/dmi/id/chassis_version 2>/dev/null; echo;`;\n exec(cmd, function (error, stdout) {\n let lines = stdout.toString().split('\\n');\n result.manufacturer = util.getValue(lines, 'chassis_vendor');\n const ctype = parseInt(util.getValue(lines, 'chassis_type').replace(/\\D/g, ''));\n result.type = (ctype && !isNaN(ctype) && ctype < chassisTypes.length) ? chassisTypes[ctype - 1] : '';\n result.version = util.getValue(lines, 'chassis_version');\n result.serial = util.getValue(lines, 'chassis_serial');\n result.assetTag = util.getValue(lines, 'chassis_asset_tag');\n if (result.manufacturer.toLowerCase().indexOf('o.e.m.') !== -1) { result.manufacturer = '-'; }\n if (result.version.toLowerCase().indexOf('o.e.m.') !== -1) { result.version = '-'; }\n if (result.serial.toLowerCase().indexOf('o.e.m.') !== -1) { result.serial = '-'; }\n if (result.assetTag.toLowerCase().indexOf('o.e.m.') !== -1) { result.assetTag = '-'; }\n\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_darwin) {\n exec('ioreg -c IOPlatformExpertDevice -d 2', function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().replace(/[<>\"]/g, '').split('\\n');\n result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);\n result.model = util.getValue(lines, 'model', '=', true);\n result.version = util.getValue(lines, 'version', '=', true);\n result.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true);\n result.assetTag = util.getValue(lines, 'board-id', '=', true);\n }\n\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n if (callback) { callback(result); }\n resolve(result);\n }\n if (_windows) {\n try {\n util.powerShell('Get-WmiObject Win32_SystemEnclosure | select Model,Manufacturer,ChassisTypes,Version,SerialNumber,PartNumber,SKU | fl').then((stdout, error) => {\n if (!error) {\n let lines = stdout.toString().split('\\r\\n');\n\n result.manufacturer = util.getValue(lines, 'manufacturer', ':');\n result.model = util.getValue(lines, 'model', ':');\n const ctype = parseInt(util.getValue(lines, 'ChassisTypes', ':').replace(/\\D/g, ''));\n result.type = (ctype && !isNaN(ctype) && ctype < chassisTypes.length) ? chassisTypes[ctype - 1] : '';\n result.version = util.getValue(lines, 'version', ':');\n result.serial = util.getValue(lines, 'serialnumber', ':');\n result.assetTag = util.getValue(lines, 'partnumber', ':');\n result.sku = util.getValue(lines, 'sku', ':');\n if (result.manufacturer.toLowerCase().indexOf('o.e.m.') !== -1) { result.manufacturer = '-'; }\n if (result.version.toLowerCase().indexOf('o.e.m.') !== -1) { result.version = '-'; }\n if (result.serial.toLowerCase().indexOf('o.e.m.') !== -1) { result.serial = '-'; }\n if (result.assetTag.toLowerCase().indexOf('o.e.m.') !== -1) { result.assetTag = '-'; }\n }\n\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n });\n });\n}\n\nexports.chassis = chassis;\n\n","'use strict';\n// @ts-check\n// ==================================================================================\n// usb.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 16. usb\n// ----------------------------------------------------------------------------------\n\nconst exec = require('child_process').exec;\n// const execSync = require('child_process').execSync;\nconst util = require('./util');\n// const fs = require('fs');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\nfunction getLinuxUsbType(type, name) {\n let result = type;\n const str = (name + ' ' + type).toLowerCase();\n if (str.indexOf('camera') >= 0) { result = 'Camera'; }\n else if (str.indexOf('hub') >= 0) { result = 'Hub'; }\n else if (str.indexOf('keybrd') >= 0) { result = 'Keyboard'; }\n else if (str.indexOf('keyboard') >= 0) { result = 'Keyboard'; }\n else if (str.indexOf('mouse') >= 0) { result = 'Mouse'; }\n else if (str.indexOf('stora') >= 0) { result = 'Storage'; }\n else if (str.indexOf('mic') >= 0) { result = 'Microphone'; }\n else if (str.indexOf('headset') >= 0) { result = 'Audio'; }\n else if (str.indexOf('audio') >= 0) { result = 'Audio'; }\n\n return result;\n}\n\nfunction parseLinuxUsb(usb) {\n const result = {};\n const lines = usb.split('\\n');\n if (lines && lines.length && lines[0].indexOf('Device') >= 0) {\n const parts = lines[0].split(' ');\n result.bus = parseInt(parts[0], 10);\n if (parts[2]) {\n result.deviceId = parseInt(parts[2], 10);\n } else {\n result.deviceId = null;\n }\n } else {\n result.bus = null;\n result.deviceId = null;\n }\n const idVendor = util.getValue(lines, 'idVendor', ' ', true).trim();\n let vendorParts = idVendor.split(' ');\n vendorParts.shift();\n const vendor = vendorParts.join(' ');\n\n const idProduct = util.getValue(lines, 'idProduct', ' ', true).trim();\n let productParts = idProduct.split(' ');\n productParts.shift();\n const product = productParts.join(' ');\n\n const interfaceClass = util.getValue(lines, 'bInterfaceClass', ' ', true).trim();\n let interfaceClassParts = interfaceClass.split(' ');\n interfaceClassParts.shift();\n const usbType = interfaceClassParts.join(' ');\n\n const iManufacturer = util.getValue(lines, 'iManufacturer', ' ', true).trim();\n let iManufacturerParts = iManufacturer.split(' ');\n iManufacturerParts.shift();\n const manufacturer = iManufacturerParts.join(' ');\n\n result.id = (idVendor.startsWith('0x') ? idVendor.split(' ')[0].substr(2, 10) : '') + ':' + (idProduct.startsWith('0x') ? idProduct.split(' ')[0].substr(2, 10) : '');\n result.name = product;\n result.type = getLinuxUsbType(usbType, product);\n result.removable = null;\n result.vendor = vendor;\n result.manufacturer = manufacturer;\n result.maxPower = util.getValue(lines, 'MaxPower', ' ', true);\n result.serialNumber = null;\n\n return result;\n}\n\n// bus\n// deviceId\n// id\n// name(product)\n// type(bInterfaceClass)\n// removable / hotplug\n// vendor\n// manufacturer\n// maxpower(linux)\n\nfunction getDarwinUsbType(name) {\n let result = '';\n if (name.indexOf('camera') >= 0) { result = 'Camera'; }\n else if (name.indexOf('touch bar') >= 0) { result = 'Touch Bar'; }\n else if (name.indexOf('controller') >= 0) { result = 'Controller'; }\n else if (name.indexOf('headset') >= 0) { result = 'Audio'; }\n else if (name.indexOf('keyboard') >= 0) { result = 'Keyboard'; }\n else if (name.indexOf('trackpad') >= 0) { result = 'Trackpad'; }\n else if (name.indexOf('sensor') >= 0) { result = 'Sensor'; }\n else if (name.indexOf('bthusb') >= 0) { result = 'Bluetooth'; }\n else if (name.indexOf('bth') >= 0) { result = 'Bluetooth'; }\n else if (name.indexOf('rfcomm') >= 0) { result = 'Bluetooth'; }\n else if (name.indexOf('usbhub') >= 0) { result = 'Hub'; }\n else if (name.indexOf(' hub') >= 0) { result = 'Hub'; }\n else if (name.indexOf('mouse') >= 0) { result = 'Mouse'; }\n else if (name.indexOf('mic') >= 0) { result = 'Microphone'; }\n else if (name.indexOf('removable') >= 0) { result = 'Storage'; }\n return result;\n}\n\n\nfunction parseDarwinUsb(usb, id) {\n const result = {};\n result.id = id;\n\n usb = usb.replace(/ \\|/g, '');\n usb = usb.trim();\n let lines = usb.split('\\n');\n lines.shift();\n try {\n for (let i = 0; i < lines.length; i++) {\n lines[i] = lines[i].trim();\n lines[i] = lines[i].replace(/=/g, ':');\n if (lines[i] !== '{' && lines[i] !== '}' && lines[i + 1] && lines[i + 1].trim() !== '}') {\n lines[i] = lines[i] + ',';\n }\n lines[i] = lines[i].replace(': Yes,', ': \"Yes\",');\n lines[i] = lines[i].replace(': No,', ': \"No\",');\n }\n const usbObj = JSON.parse(lines.join('\\n'));\n const removableDrive = usbObj['Built-In'].toLowerCase() !== 'yes' && usbObj['non-removable'].toLowerCase() === 'no';\n\n result.bus = null;\n result.deviceId = null;\n result.id = usbObj['USB Address'] || null;\n result.name = usbObj['kUSBProductString'] || usbObj['USB Product Name'] || null;\n result.type = getDarwinUsbType((usbObj['kUSBProductString'] || usbObj['USB Product Name'] || '').toLowerCase() + (removableDrive ? ' removable' : ''));\n result.removable = usbObj['non-removable'].toLowerCase() === 'no';\n result.vendor = usbObj['kUSBVendorString'] || usbObj['USB Vendor Name'] || null;\n result.manufacturer = usbObj['kUSBVendorString'] || usbObj['USB Vendor Name'] || null;\n result.maxPower = null;\n result.serialNumber = usbObj['kUSBSerialNumberString'] || null;\n\n if (result.name) {\n return result;\n } else {\n return null;\n }\n } catch (e) {\n return null;\n }\n}\n\n// function getWindowsUsbType(service) {\n// let result = ''\n// if (service.indexOf('usbhub3') >= 0) { result = 'Hub'; }\n// else if (service.indexOf('usbstor') >= 0) { result = 'Storage'; }\n// else if (service.indexOf('hidusb') >= 0) { result = 'Input'; }\n// else if (service.indexOf('usbccgp') >= 0) { result = 'Controller'; }\n// else if (service.indexOf('usbxhci') >= 0) { result = 'Controller'; }\n// else if (service.indexOf('usbehci') >= 0) { result = 'Controller'; }\n// else if (service.indexOf('kbdhid') >= 0) { result = 'Keyboard'; }\n// else if (service.indexOf('keyboard') >= 0) { result = 'Keyboard'; }\n// else if (service.indexOf('pointing') >= 0) { result = 'Mouse'; }\n// else if (service.indexOf('disk') >= 0) { result = 'Storage'; }\n// else if (service.indexOf('usbhub') >= 0) { result = 'Hub'; }\n// else if (service.indexOf('bthusb') >= 0) { result = ''; }\n// else if (service.indexOf('bth') >= 0) { result = ''; }\n// else if (service.indexOf('rfcomm') >= 0) { result = ''; }\n// return result;\n// }\n\nfunction getWindowsUsbTypeCreation(creationclass, name) {\n let result = '';\n if (name.indexOf('storage') >= 0) { result = 'Storage'; }\n else if (name.indexOf('speicher') >= 0) { result = 'Storage'; }\n else if (creationclass.indexOf('usbhub') >= 0) { result = 'Hub'; }\n else if (creationclass.indexOf('storage') >= 0) { result = 'Storage'; }\n else if (creationclass.indexOf('usbcontroller') >= 0) { result = 'Controller'; }\n else if (creationclass.indexOf('keyboard') >= 0) { result = 'Keyboard'; }\n else if (creationclass.indexOf('pointing') >= 0) { result = 'Mouse'; }\n else if (creationclass.indexOf('disk') >= 0) { result = 'Storage'; }\n return result;\n}\n\nfunction parseWindowsUsb(lines, id) {\n const usbType = getWindowsUsbTypeCreation(util.getValue(lines, 'CreationClassName', ':').toLowerCase(), util.getValue(lines, 'name', ':').toLowerCase());\n\n if (usbType) {\n const result = {};\n result.bus = null;\n result.deviceId = util.getValue(lines, 'deviceid', ':');\n result.id = id;\n result.name = util.getValue(lines, 'name', ':');\n result.type = usbType;\n result.removable = null;\n result.vendor = null;\n result.manufacturer = util.getValue(lines, 'Manufacturer', ':');\n result.maxPower = null;\n result.serialNumber = null;\n\n return result;\n } else {\n return null;\n }\n\n}\n\nfunction usb(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = [];\n if (_linux) {\n const cmd = 'export LC_ALL=C; lsusb -v 2>/dev/null; unset LC_ALL';\n exec(cmd, { maxBuffer: 1024 * 1024 * 128 }, function (error, stdout) {\n if (!error) {\n const parts = ('\\n\\n' + stdout.toString()).split('\\n\\nBus ');\n for (let i = 1; i < parts.length; i++) {\n const usb = parseLinuxUsb(parts[i]);\n result.push(usb);\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_darwin) {\n let cmd = 'ioreg -p IOUSB -c AppleUSBRootHubDevice -w0 -l';\n exec(cmd, { maxBuffer: 1024 * 1024 * 128 }, function (error, stdout) {\n if (!error) {\n const parts = (stdout.toString()).split(' +-o ');\n for (let i = 1; i < parts.length; i++) {\n const usb = parseDarwinUsb(parts[i]);\n if (usb) {\n result.push(usb);\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n if (_windows) {\n util.powerShell('Get-WmiObject CIM_LogicalDevice | where { $_.Description -match \"USB\"} | select Name,CreationClassName,DeviceId,Manufacturer | fl').then((stdout, error) => {\n if (!error) {\n const parts = stdout.toString().split(/\\n\\s*\\n/);\n for (let i = 0; i < parts.length; i++) {\n const usb = parseWindowsUsb(parts[i].split('\\n'), i);\n if (usb) {\n result.push(usb);\n }\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n\n // util.powerShell(\"gwmi Win32_USBControllerDevice |\\%{[wmi]($_.Dependent)}\").then(data => {\n\n // const parts = data.toString().split(/\\n\\s*\\n/);\n // for (let i = 0; i < parts.length; i++) {\n // const usb = parseWindowsUsb(parts[i].split('\\n'), i)\n // if (usb) {\n // result.push(usb)\n // }\n // }\n // if (callback) {\n // callback(result);\n // }\n // resolve(result);\n // });\n }\n if (_sunos || _freebsd || _openbsd || _netbsd) {\n resolve(null);\n }\n });\n });\n}\n\nexports.usb = usb;\n\n","'use strict';\n// @ts-check\n// ==================================================================================\n// users.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 11. Users/Sessions\n// ----------------------------------------------------------------------------------\n\nconst exec = require('child_process').exec;\nconst util = require('./util');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\nconst _sunos = (_platform === 'sunos');\n\n// let _winDateFormat = {\n// dateFormat: '',\n// dateSeperator: '',\n// timeFormat: '',\n// timeSeperator: '',\n// amDesignator: '',\n// pmDesignator: ''\n// };\n\n// --------------------------\n// array of users online = sessions\n\n// function getWinCulture() {\n// return new Promise((resolve) => {\n// process.nextTick(() => {\n// if (!_winDateFormat.dateFormat) {\n// util.powerShell('(get-culture).DateTimeFormat')\n// .then(data => {\n// let lines = data.toString().split('\\r\\n');\n// _winDateFormat.dateFormat = util.getValue(lines, 'ShortDatePattern', ':');\n// _winDateFormat.dateSeperator = util.getValue(lines, 'DateSeparator', ':');\n// _winDateFormat.timeFormat = util.getValue(lines, 'ShortTimePattern', ':');\n// _winDateFormat.timeSeperator = util.getValue(lines, 'TimeSeparator', ':');\n// _winDateFormat.amDesignator = util.getValue(lines, 'AMDesignator', ':');\n// _winDateFormat.pmDesignator = util.getValue(lines, 'PMDesignator', ':');\n\n// resolve(_winDateFormat);\n// })\n// .catch(() => {\n// resolve(_winDateFormat);\n// });\n// } else {\n// resolve(_winDateFormat);\n// }\n// });\n// });\n// }\n\nfunction parseUsersLinux(lines, phase) {\n let result = [];\n let result_who = [];\n let result_w = {};\n let w_first = true;\n let w_header = [];\n let w_pos = [];\n let who_line = {};\n\n let is_whopart = true;\n lines.forEach(function (line) {\n if (line === '---') {\n is_whopart = false;\n } else {\n let l = line.replace(/ +/g, ' ').split(' ');\n\n // who part\n if (is_whopart) {\n result_who.push({\n user: l[0],\n tty: l[1],\n date: l[2],\n time: l[3],\n ip: (l && l.length > 4) ? l[4].replace(/\\(/g, '').replace(/\\)/g, '') : ''\n });\n } else {\n // w part\n if (w_first) { // header\n w_header = l;\n w_header.forEach(function (item) {\n w_pos.push(line.indexOf(item));\n });\n w_first = false;\n } else {\n // split by w_pos\n result_w.user = line.substring(w_pos[0], w_pos[1] - 1).trim();\n result_w.tty = line.substring(w_pos[1], w_pos[2] - 1).trim();\n result_w.ip = line.substring(w_pos[2], w_pos[3] - 1).replace(/\\(/g, '').replace(/\\)/g, '').trim();\n result_w.command = line.substring(w_pos[7], 1000).trim();\n // find corresponding 'who' line\n who_line = result_who.filter(function (obj) {\n return (obj.user.substring(0, 8).trim() === result_w.user && obj.tty === result_w.tty);\n });\n if (who_line.length === 1) {\n result.push({\n user: who_line[0].user,\n tty: who_line[0].tty,\n date: who_line[0].date,\n time: who_line[0].time,\n ip: who_line[0].ip,\n command: result_w.command\n });\n }\n }\n }\n }\n });\n if (result.length === 0 && phase === 2) {\n return result_who;\n } else {\n return result;\n }\n}\n\nfunction parseUsersDarwin(lines) {\n let result = [];\n let result_who = [];\n let result_w = {};\n let who_line = {};\n\n let is_whopart = true;\n lines.forEach(function (line) {\n if (line === '---') {\n is_whopart = false;\n } else {\n let l = line.replace(/ +/g, ' ').split(' ');\n\n // who part\n if (is_whopart) {\n result_who.push({\n user: l[0],\n tty: l[1],\n date: ('' + new Date().getFullYear()) + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2),\n time: l[4],\n });\n } else {\n // w part\n // split by w_pos\n result_w.user = l[0];\n result_w.tty = l[1];\n result_w.ip = (l[2] !== '-') ? l[2] : '';\n result_w.command = l.slice(5, 1000).join(' ');\n // find corresponding 'who' line\n who_line = result_who.filter(function (obj) {\n return (obj.user === result_w.user && (obj.tty.substring(3, 1000) === result_w.tty || obj.tty === result_w.tty));\n });\n if (who_line.length === 1) {\n result.push({\n user: who_line[0].user,\n tty: who_line[0].tty,\n date: who_line[0].date,\n time: who_line[0].time,\n ip: result_w.ip,\n command: result_w.command\n });\n }\n }\n }\n });\n return result;\n}\n\nfunction users(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = [];\n\n // linux\n if (_linux) {\n exec('who --ips; echo \"---\"; w | tail -n +2', function (error, stdout) {\n if (!error) {\n // lines / split\n let lines = stdout.toString().split('\\n');\n result = parseUsersLinux(lines, 1);\n if (result.length === 0) {\n exec('who; echo \"---\"; w | tail -n +2', function (error, stdout) {\n if (!error) {\n // lines / split\n lines = stdout.toString().split('\\n');\n result = parseUsersLinux(lines, 2);\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n } else {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n }\n if (_freebsd || _openbsd || _netbsd) {\n exec('who; echo \"---\"; w -ih', function (error, stdout) {\n if (!error) {\n // lines / split\n let lines = stdout.toString().split('\\n');\n result = parseUsersDarwin(lines);\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_sunos) {\n exec('who; echo \"---\"; w -h', function (error, stdout) {\n if (!error) {\n // lines / split\n let lines = stdout.toString().split('\\n');\n result = parseUsersDarwin(lines);\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n\n if (_darwin) {\n exec('who; echo \"---\"; w -ih', function (error, stdout) {\n if (!error) {\n // lines / split\n let lines = stdout.toString().split('\\n');\n result = parseUsersDarwin(lines);\n }\n if (callback) { callback(result); }\n resolve(result);\n });\n }\n if (_windows) {\n try {\n // const workload = [];\n // // workload.push(util.powerShell('Get-CimInstance -ClassName Win32_Account | fl *'));\n // workload.push(util.powerShell('Get-WmiObject Win32_LogonSession | fl *'));\n // workload.push(util.powerShell('Get-WmiObject Win32_LoggedOnUser | fl *'));\n // workload.push(util.powerShell('Get-WmiObject Win32_Process -Filter \"name=\\'explorer.exe\\'\" | Select @{Name=\"domain\";Expression={$_.GetOwner().Domain}}, @{Name=\"username\";Expression={$_.GetOwner().User}} | fl'));\n // Promise.all(\n // workload\n // ).then(data => {\n let cmd = 'Get-WmiObject Win32_LogonSession | select LogonId,StartTime | fl' + '; echo \\'#-#-#-#\\';';\n cmd += 'Get-WmiObject Win32_LoggedOnUser | select antecedent,dependent | fl ' + '; echo \\'#-#-#-#\\';';\n cmd += 'Get-WmiObject Win32_Process -Filter \"name=\\'explorer.exe\\'\" | Select @{Name=\"sessionid\";Expression={$_.SessionId}}, @{Name=\"domain\";Expression={$_.GetOwner().Domain}}, @{Name=\"username\";Expression={$_.GetOwner().User}} | fl' + '; echo \\'#-#-#-#\\';';\n cmd += 'query user';\n util.powerShell(cmd).then(data => {\n // controller + vram\n // let accounts = parseWinAccounts(data[0].split(/\\n\\s*\\n/));\n if (data) {\n data = data.split('#-#-#-#');\n let sessions = parseWinSessions((data[0] || '').split(/\\n\\s*\\n/));\n let loggedons = parseWinLoggedOn((data[1] || '').split(/\\n\\s*\\n/));\n let queryUser = parseWinUsersQuery((data[3] || '').split('\\r\\n'));\n let users = parseWinUsers((data[2] || '').split(/\\n\\s*\\n/), queryUser);\n for (let id in loggedons) {\n if ({}.hasOwnProperty.call(loggedons, id)) {\n loggedons[id].dateTime = {}.hasOwnProperty.call(sessions, id) ? sessions[id] : '';\n }\n }\n users.forEach(user => {\n let dateTime = '';\n for (let id in loggedons) {\n if ({}.hasOwnProperty.call(loggedons, id)) {\n if (loggedons[id].user === user.user && (!dateTime || dateTime < loggedons[id].dateTime)) {\n dateTime = loggedons[id].dateTime;\n }\n }\n }\n\n result.push({\n user: user.user,\n tty: user.tty,\n date: `${dateTime.substr(0, 4)}-${dateTime.substr(4, 2)}-${dateTime.substr(6, 2)}`,\n time: `${dateTime.substr(8, 2)}:${dateTime.substr(10, 2)}`,\n ip: '',\n command: ''\n });\n });\n }\n if (callback) { callback(result); }\n resolve(result);\n\n });\n // util.powerShell('query user').then(stdout => {\n // if (stdout) {\n // // lines / split\n // let lines = stdout.toString().split('\\r\\n');\n // getWinCulture()\n // .then(culture => {\n // result = parseUsersWin(lines, culture);\n // if (callback) { callback(result); }\n // resolve(result);\n // });\n // } else {\n // if (callback) { callback(result); }\n // resolve(result);\n // }\n // });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n }\n\n });\n });\n}\n\n// function parseWinAccounts(accountParts) {\n// const accounts = [];\n// accountParts.forEach(account => {\n// const lines = account.split('\\r\\n');\n// const name = util.getValue(lines, 'name', ':', true);\n// const domain = util.getValue(lines, 'domain', ':', true);\n// accounts.push(`${domain}\\${name}`);\n// });\n// return accounts;\n// }\n\nfunction parseWinSessions(sessionParts) {\n const sessions = {};\n sessionParts.forEach(session => {\n const lines = session.split('\\r\\n');\n const id = util.getValue(lines, 'LogonId');\n const starttime = util.getValue(lines, 'starttime');\n if (id) {\n sessions[id] = starttime;\n }\n });\n return sessions;\n}\n\nfunction fuzzyMatch(name1, name2) {\n name1 = name1.toLowerCase();\n name2 = name2.toLowerCase();\n let eq = 0;\n let len = name1.length;\n if (name2.length > len) { len = name2.length; }\n\n for (let i = 0; i < len; i++) {\n const c1 = name1[i] || '';\n const c2 = name2[i] || '';\n if (c1 === c2) { eq++; }\n }\n return (len > 10 ? eq / len > 0.9 : (len > 0 ? eq / len > 0.8 : false));\n}\n\nfunction parseWinUsers(userParts, userQuery) {\n const users = [];\n userParts.forEach(user => {\n const lines = user.split('\\r\\n');\n\n const domain = util.getValue(lines, 'domain', ':', true);\n const username = util.getValue(lines, 'username', ':', true);\n const sessionid = util.getValue(lines, 'sessionid', ':', true);\n\n if (username) {\n const quser = userQuery.filter(item => fuzzyMatch(item.user, username));\n users.push({\n domain,\n user: username,\n tty: quser && quser[0] && quser[0].tty ? quser[0].tty : sessionid\n });\n }\n });\n return users;\n}\n\nfunction parseWinLoggedOn(loggedonParts) {\n const loggedons = {};\n loggedonParts.forEach(loggedon => {\n const lines = loggedon.split('\\r\\n');\n\n const antecendent = util.getValue(lines, 'antecedent', ':', true);\n let parts = antecendent.split(',');\n const domainParts = parts.length > 1 ? parts[0].split('=') : [];\n const nameParts = parts.length > 1 ? parts[1].split('=') : [];\n const domain = domainParts.length > 1 ? domainParts[1].replace(/\"/g, '') : '';\n const name = nameParts.length > 1 ? nameParts[1].replace(/\"/g, '') : '';\n const dependent = util.getValue(lines, 'dependent', ':', true);\n parts = dependent.split('=');\n const id = parts.length > 1 ? parts[1].replace(/\"/g, '') : '';\n if (id) {\n loggedons[id] = {\n domain,\n user: name\n };\n }\n });\n return loggedons;\n}\n\nfunction parseWinUsersQuery(lines) {\n lines = lines.filter(item => item);\n let result = [];\n const header = lines[0];\n const headerDelimiter = [];\n if (header) {\n const start = (header[0] === ' ') ? 1 : 0;\n headerDelimiter.push(start - 1);\n let nextSpace = 0;\n for (let i = start + 1; i < header.length; i++) {\n if (header[i] === ' ' && ((header[i - 1] === ' ') || (header[i - 1] === '.'))) {\n nextSpace = i;\n } else {\n if (nextSpace) {\n headerDelimiter.push(nextSpace);\n nextSpace = 0;\n }\n }\n }\n for (let i = 1; i < lines.length; i++) {\n if (lines[i].trim()) {\n const user = lines[i].substring(headerDelimiter[0] + 1, headerDelimiter[1]).trim() || '';\n const tty = lines[i].substring(headerDelimiter[1] + 1, headerDelimiter[2] - 2).trim() || '';\n // const dateTime = util.parseDateTime(lines[i].substring(headerDelimiter[5] + 1, 2000).trim(), culture) || '';\n result.push({\n user: user,\n tty: tty,\n });\n }\n }\n }\n return result;\n}\n\nexports.users = users;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// utils.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 0. helper functions\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst fs = require('fs');\nconst path = require('path');\nconst spawn = require('child_process').spawn;\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst util = require('util');\n\nlet _platform = process.platform;\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\nconst _freebsd = (_platform === 'freebsd');\nconst _openbsd = (_platform === 'openbsd');\nconst _netbsd = (_platform === 'netbsd');\n// const _sunos = (_platform === 'sunos');\n\nlet _cores = 0;\nlet wmicPath = '';\nlet codepage = '';\nlet _smartMonToolsInstalled = null;\n\nconst WINDIR = process.env.WINDIR || 'C:\\\\Windows';\n\n// powerShell\nlet _psChild;\nlet _psResult = '';\nlet _psCmds = [];\nlet _psPersistent = false;\nconst _psToUTF8 = '$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 ; ';\nconst _psCmdStart = '--###START###--';\nconst _psError = '--ERROR--';\nconst _psCmdSeperator = '--###ENDCMD###--';\nconst _psIdSeperator = '--##ID##--';\n\nconst execOptsWin = {\n windowsHide: true,\n maxBuffer: 1024 * 20000,\n encoding: 'UTF-8',\n env: util._extend({}, process.env, { LANG: 'en_US.UTF-8' })\n};\n\nfunction toInt(value) {\n let result = parseInt(value, 10);\n if (isNaN(result)) {\n result = 0;\n }\n return result;\n}\n\n\nconst stringReplace = new String().replace;\nconst stringToLower = new String().toLowerCase;\nconst stringToString = new String().toString;\nconst stringSubstr = new String().substr;\nconst stringTrim = new String().trim;\nconst stringStartWith = new String().startsWith;\nconst mathMin = Math.min;\n\nfunction isFunction(functionToCheck) {\n let getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n}\n\nfunction unique(obj) {\n let uniques = [];\n let stringify = {};\n for (let i = 0; i < obj.length; i++) {\n let keys = Object.keys(obj[i]);\n keys.sort(function (a, b) { return a - b; });\n let str = '';\n for (let j = 0; j < keys.length; j++) {\n str += JSON.stringify(keys[j]);\n str += JSON.stringify(obj[i][keys[j]]);\n }\n if (!{}.hasOwnProperty.call(stringify, str)) {\n uniques.push(obj[i]);\n stringify[str] = true;\n }\n }\n return uniques;\n}\n\nfunction sortByKey(array, keys) {\n return array.sort(function (a, b) {\n let x = '';\n let y = '';\n keys.forEach(function (key) {\n x = x + a[key]; y = y + b[key];\n });\n return ((x < y) ? -1 : ((x > y) ? 1 : 0));\n });\n}\n\nfunction cores() {\n if (_cores === 0) {\n _cores = os.cpus().length;\n }\n return _cores;\n}\n\nfunction getValue(lines, property, separator, trimmed, lineMatch) {\n separator = separator || ':';\n property = property.toLowerCase();\n trimmed = trimmed || false;\n lineMatch = lineMatch || false;\n for (let i = 0; i < lines.length; i++) {\n let line = lines[i].toLowerCase().replace(/\\t/g, '');\n if (trimmed) {\n line = line.trim();\n }\n if (line.startsWith(property) && (lineMatch ? (line.match(property + separator)) : true)) {\n const parts = trimmed ? lines[i].trim().split(separator) : lines[i].split(separator);\n if (parts.length >= 2) {\n parts.shift();\n return parts.join(separator).trim();\n } else {\n return '';\n }\n }\n }\n return '';\n}\n\nfunction decodeEscapeSequence(str, base) {\n base = base || 16;\n return str.replace(/\\\\x([0-9A-Fa-f]{2})/g, function () {\n return String.fromCharCode(parseInt(arguments[1], base));\n });\n}\n\nfunction detectSplit(str) {\n let seperator = '';\n let part = 0;\n str.split('').forEach(element => {\n if (element >= '0' && element <= '9') {\n if (part === 1) { part++; }\n } else {\n if (part === 0) { part++; }\n if (part === 1) {\n seperator += element;\n }\n }\n });\n return seperator;\n}\n\nfunction parseTime(t, pmDesignator) {\n pmDesignator = pmDesignator || '';\n t = t.toUpperCase();\n let hour = 0;\n let min = 0;\n let splitter = detectSplit(t);\n let parts = t.split(splitter);\n if (parts.length >= 2) {\n if (parts[2]) {\n parts[1] += parts[2];\n }\n let isPM = (parts[1] && (parts[1].toLowerCase().indexOf('pm') > -1) || (parts[1].toLowerCase().indexOf('p.m.') > -1) || (parts[1].toLowerCase().indexOf('p. m.') > -1) || (parts[1].toLowerCase().indexOf('n') > -1) || (parts[1].toLowerCase().indexOf('ch') > -1) || (parts[1].toLowerCase().indexOf('ös') > -1) || (pmDesignator && parts[1].toLowerCase().indexOf(pmDesignator) > -1));\n hour = parseInt(parts[0], 10);\n min = parseInt(parts[1], 10);\n hour = isPM && hour < 12 ? hour + 12 : hour;\n return ('0' + hour).substr(-2) + ':' + ('0' + min).substr(-2);\n }\n}\n\nfunction parseDateTime(dt, culture) {\n const result = {\n date: '',\n time: ''\n };\n culture = culture || {};\n let dateFormat = (culture.dateFormat || '').toLowerCase();\n let pmDesignator = (culture.pmDesignator || '');\n\n const parts = dt.split(' ');\n if (parts[0]) {\n if (parts[0].indexOf('/') >= 0) {\n // Dateformat: mm/dd/yyyy or dd/mm/yyyy or dd/mm/yy or yyyy/mm/dd\n const dtparts = parts[0].split('/');\n if (dtparts.length === 3) {\n if (dtparts[0].length === 4) {\n // Dateformat: yyyy/mm/dd\n result.date = dtparts[0] + '-' + ('0' + dtparts[1]).substr(-2) + '-' + ('0' + dtparts[2]).substr(-2);\n } else if (dtparts[2].length === 2) {\n if ((dateFormat.indexOf('/d/') > -1 || dateFormat.indexOf('/dd/') > -1)) {\n // Dateformat: mm/dd/yy\n result.date = '20' + dtparts[2] + '-' + ('0' + dtparts[1]).substr(-2) + '-' + ('0' + dtparts[0]).substr(-2);\n } else {\n // Dateformat: dd/mm/yy\n result.date = '20' + dtparts[2] + '-' + ('0' + dtparts[1]).substr(-2) + '-' + ('0' + dtparts[0]).substr(-2);\n }\n } else {\n // Dateformat: mm/dd/yyyy or dd/mm/yyyy\n const isEN = ((dt.toLowerCase().indexOf('pm') > -1) || (dt.toLowerCase().indexOf('p.m.') > -1) || (dt.toLowerCase().indexOf('p. m.') > -1) || (dt.toLowerCase().indexOf('am') > -1) || (dt.toLowerCase().indexOf('a.m.') > -1) || (dt.toLowerCase().indexOf('a. m.') > -1));\n if ((isEN || dateFormat.indexOf('/d/') > -1 || dateFormat.indexOf('/dd/') > -1) && dateFormat.indexOf('dd/') !== 0) {\n // Dateformat: mm/dd/yyyy\n result.date = dtparts[2] + '-' + ('0' + dtparts[0]).substr(-2) + '-' + ('0' + dtparts[1]).substr(-2);\n } else {\n // Dateformat: dd/mm/yyyy\n result.date = dtparts[2] + '-' + ('0' + dtparts[1]).substr(-2) + '-' + ('0' + dtparts[0]).substr(-2);\n }\n }\n }\n }\n if (parts[0].indexOf('.') >= 0) {\n const dtparts = parts[0].split('.');\n if (dtparts.length === 3) {\n if (dateFormat.indexOf('.d.') > -1 || dateFormat.indexOf('.dd.') > -1) {\n // Dateformat: mm.dd.yyyy\n result.date = dtparts[2] + '-' + ('0' + dtparts[0]).substr(-2) + '-' + ('0' + dtparts[1]).substr(-2);\n } else {\n // Dateformat: dd.mm.yyyy\n result.date = dtparts[2] + '-' + ('0' + dtparts[1]).substr(-2) + '-' + ('0' + dtparts[0]).substr(-2);\n }\n }\n }\n if (parts[0].indexOf('-') >= 0) {\n // Dateformat: yyyy-mm-dd\n const dtparts = parts[0].split('-');\n if (dtparts.length === 3) {\n result.date = dtparts[0] + '-' + ('0' + dtparts[1]).substr(-2) + '-' + ('0' + dtparts[2]).substr(-2);\n }\n }\n }\n if (parts[1]) {\n parts.shift();\n let time = parts.join(' ');\n result.time = parseTime(time, pmDesignator);\n }\n return result;\n}\n\nfunction parseHead(head, rights) {\n let space = (rights > 0);\n let count = 1;\n let from = 0;\n let to = 0;\n let result = [];\n for (let i = 0; i < head.length; i++) {\n if (count <= rights) {\n // if (head[i] === ' ' && !space) {\n if (/\\s/.test(head[i]) && !space) {\n to = i - 1;\n result.push({\n from: from,\n to: to + 1,\n cap: head.substring(from, to + 1)\n });\n from = to + 2;\n count++;\n }\n space = head[i] === ' ';\n } else {\n if (!/\\s/.test(head[i]) && space) {\n to = i - 1;\n if (from < to) {\n result.push({\n from: from,\n to: to,\n cap: head.substring(from, to)\n });\n }\n from = to + 1;\n count++;\n }\n space = head[i] === ' ';\n }\n }\n to = 1000;\n result.push({\n from: from,\n to: to,\n cap: head.substring(from, to)\n });\n let len = result.length;\n for (var i = 0; i < len; i++) {\n if (result[i].cap.replace(/\\s/g, '').length === 0) {\n if (i + 1 < len) {\n result[i].to = result[i + 1].to;\n result[i].cap = result[i].cap + result[i + 1].cap;\n result.splice(i + 1, 1);\n len = len - 1;\n }\n }\n }\n return result;\n}\n\nfunction findObjectByKey(array, key, value) {\n for (let i = 0; i < array.length; i++) {\n if (array[i][key] === value) {\n return i;\n }\n }\n return -1;\n}\n\nfunction getWmic() {\n if (os.type() === 'Windows_NT' && !wmicPath) {\n wmicPath = WINDIR + '\\\\system32\\\\wbem\\\\wmic.exe';\n if (!fs.existsSync(wmicPath)) {\n try {\n const wmicPathArray = execSync('WHERE WMIC', execOptsWin).toString().split('\\r\\n');\n if (wmicPathArray && wmicPathArray.length) {\n wmicPath = wmicPathArray[0];\n } else {\n wmicPath = 'wmic';\n }\n } catch (e) {\n wmicPath = 'wmic';\n }\n }\n }\n return wmicPath;\n}\n\nfunction wmic(command) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n try {\n powerShell(getWmic() + ' ' + command).then(stdout => {\n resolve(stdout, '');\n });\n } catch (e) {\n resolve('', e);\n }\n });\n });\n}\n\n// function wmic(command, options) {\n// options = options || execOptsWin;\n// return new Promise((resolve) => {\n// process.nextTick(() => {\n// try {\n// exec(WINDIR + '\\\\system32\\\\chcp.com 65001 | ' + getWmic() + ' ' + command, options, function (error, stdout) {\n// resolve(stdout, error);\n// }).stdin.end();\n// } catch (e) {\n// resolve('', e);\n// }\n// });\n// });\n// }\n\nfunction getVboxmanage() {\n return _windows ? `\"${process.env.VBOX_INSTALL_PATH || process.env.VBOX_MSI_INSTALL_PATH}\\\\VBoxManage.exe\"` : 'vboxmanage';\n}\n\nfunction powerShellProceedResults(data) {\n let id = '';\n let parts;\n let res = '';\n // startID\n if (data.indexOf(_psCmdStart) >= 0) {\n parts = data.split(_psCmdStart);\n const parts2 = parts[1].split(_psIdSeperator);\n id = parts2[0];\n if (parts2.length > 1) {\n data = parts2.slice(1).join(_psIdSeperator);\n }\n }\n // result;\n if (data.indexOf(_psCmdSeperator) >= 0) {\n parts = data.split(_psCmdSeperator);\n res = parts[0];\n }\n let remove = -1;\n for (let i = 0; i < _psCmds.length; i++) {\n if (_psCmds[i].id === id) {\n remove = i;\n // console.log(`----- TIME : ${(new Date() - _psCmds[i].start) * 0.001} s`);\n\n _psCmds[i].callback(res);\n }\n }\n if (remove >= 0) {\n _psCmds.splice(remove, 1);\n }\n}\n\nfunction powerShellStart() {\n _psChild = spawn('powershell.exe', ['-NoLogo', '-InputFormat', 'Text', '-NoExit', '-Command', '-'], {\n stdio: 'pipe',\n windowsHide: true,\n maxBuffer: 1024 * 20000,\n encoding: 'UTF-8',\n env: util._extend({}, process.env, { LANG: 'en_US.UTF-8' })\n });\n if (_psChild && _psChild.pid) {\n _psPersistent = true;\n _psChild.stdout.on('data', function (data) {\n _psResult = _psResult + data.toString('utf8');\n if (data.indexOf(_psCmdSeperator) >= 0) {\n powerShellProceedResults(_psResult);\n _psResult = '';\n }\n });\n _psChild.stderr.on('data', function () {\n powerShellProceedResults(_psResult + _psError);\n });\n _psChild.on('error', function () {\n powerShellProceedResults(_psResult + _psError);\n });\n _psChild.on('close', function () {\n _psChild.kill();\n });\n }\n}\n\nfunction powerShellRelease() {\n try {\n _psChild.stdin.write('exit' + os.EOL);\n _psChild.stdin.end();\n _psPersistent = false;\n } catch (e) {\n _psChild.kill();\n }\n}\n\nfunction powerShell(cmd) {\n\n if (_psPersistent) {\n const id = Math.random().toString(36).substr(2, 10);\n return new Promise((resolve) => {\n process.nextTick(() => {\n function callback(data) {\n resolve(data);\n }\n _psCmds.push({\n id,\n cmd,\n callback,\n start: new Date()\n });\n try {\n if (_psChild && _psChild.pid) {\n _psChild.stdin.write(_psToUTF8 + 'echo ' + _psCmdStart + id + _psIdSeperator + '; ' + os.EOL + cmd + os.EOL + 'echo ' + _psCmdSeperator + os.EOL);\n }\n } catch (e) {\n resolve('');\n }\n });\n });\n\n } else {\n let result = '';\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n try {\n // const start = new Date();\n const child = spawn('powershell.exe', ['-NoLogo', '-InputFormat', 'Text', '-NoExit', '-ExecutionPolicy', 'Unrestricted', '-Command', '-'], {\n stdio: 'pipe',\n windowsHide: true,\n maxBuffer: 1024 * 20000,\n encoding: 'UTF-8',\n env: util._extend({}, process.env, { LANG: 'en_US.UTF-8' })\n });\n\n if (child && !child.pid) {\n child.on('error', function () {\n resolve(result);\n });\n }\n if (child && child.pid) {\n child.stdout.on('data', function (data) {\n result = result + data.toString('utf8');\n });\n child.stderr.on('data', function () {\n child.kill();\n resolve(result);\n });\n child.on('close', function () {\n child.kill();\n // console.log(`----- TIME : ${(new Date() - start) * 0.001} s`);\n\n resolve(result);\n });\n child.on('error', function () {\n child.kill();\n resolve(result);\n });\n try {\n child.stdin.write(_psToUTF8 + cmd + os.EOL);\n child.stdin.write('exit' + os.EOL);\n child.stdin.end();\n } catch (e) {\n child.kill();\n resolve(result);\n }\n } else {\n resolve(result);\n }\n } catch (e) {\n resolve(result);\n }\n });\n });\n }\n}\n\nfunction execSafe(cmd, args, options) {\n let result = '';\n options = options || {};\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n try {\n const child = spawn(cmd, args, options);\n\n if (child && !child.pid) {\n child.on('error', function () {\n resolve(result);\n });\n }\n if (child && child.pid) {\n child.stdout.on('data', function (data) {\n result += data.toString();\n });\n child.on('close', function () {\n child.kill();\n resolve(result);\n });\n child.on('error', function () {\n child.kill();\n resolve(result);\n });\n } else {\n resolve(result);\n }\n } catch (e) {\n resolve(result);\n }\n });\n });\n}\n\nfunction getCodepage() {\n if (_windows) {\n if (!codepage) {\n try {\n const stdout = execSync('chcp', execOptsWin);\n const lines = stdout.toString().split('\\r\\n');\n const parts = lines[0].split(':');\n codepage = parts.length > 1 ? parts[1].replace('.', '') : '';\n } catch (err) {\n codepage = '437';\n }\n }\n return codepage;\n }\n if (_linux || _darwin || _freebsd || _openbsd || _netbsd) {\n if (!codepage) {\n try {\n const stdout = execSync('echo $LANG');\n const lines = stdout.toString().split('\\r\\n');\n const parts = lines[0].split('.');\n codepage = parts.length > 1 ? parts[1].trim() : '';\n if (!codepage) {\n codepage = 'UTF-8';\n }\n } catch (err) {\n codepage = 'UTF-8';\n }\n }\n return codepage;\n }\n}\n\nfunction smartMonToolsInstalled() {\n if (_smartMonToolsInstalled !== null) {\n return _smartMonToolsInstalled;\n }\n _smartMonToolsInstalled = false;\n if (_windows) {\n try {\n const pathArray = execSync('WHERE smartctl 2>nul', execOptsWin).toString().split('\\r\\n');\n if (pathArray && pathArray.length) {\n _smartMonToolsInstalled = pathArray[0].indexOf(':\\\\') >= 0;\n } else {\n _smartMonToolsInstalled = false;\n }\n } catch (e) {\n _smartMonToolsInstalled = false;\n }\n }\n if (_linux || _darwin || _freebsd || _openbsd || _netbsd) {\n const pathArray = execSync('which smartctl 2>/dev/null', execOptsWin).toString().split('\\r\\n');\n _smartMonToolsInstalled = pathArray.length > 0;\n }\n return _smartMonToolsInstalled;\n}\n\nfunction isRaspberry() {\n const PI_MODEL_NO = [\n 'BCM2708',\n 'BCM2709',\n 'BCM2710',\n 'BCM2711',\n 'BCM2835',\n 'BCM2836',\n 'BCM2837',\n 'BCM2837B0'\n ];\n let cpuinfo = [];\n try {\n cpuinfo = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' }).toString().split('\\n');\n } catch (e) {\n return false;\n }\n const hardware = getValue(cpuinfo, 'hardware');\n return (hardware && PI_MODEL_NO.indexOf(hardware) > -1);\n}\n\nfunction isRaspbian() {\n let osrelease = [];\n try {\n osrelease = fs.readFileSync('/etc/os-release', { encoding: 'utf8' }).toString().split('\\n');\n } catch (e) {\n return false;\n }\n const id = getValue(osrelease, 'id', '=');\n return (id && id.indexOf('raspbian') > -1);\n}\n\nfunction execWin(cmd, opts, callback) {\n if (!callback) {\n callback = opts;\n opts = execOptsWin;\n }\n let newCmd = 'chcp 65001 > nul && cmd /C ' + cmd + ' && chcp ' + codepage + ' > nul';\n exec(newCmd, opts, function (error, stdout) {\n callback(error, stdout);\n });\n}\n\nfunction darwinXcodeExists() {\n const cmdLineToolsExists = fs.existsSync('/Library/Developer/CommandLineTools/usr/bin/');\n const xcodeAppExists = fs.existsSync('/Applications/Xcode.app/Contents/Developer/Tools');\n const xcodeExists = fs.existsSync('/Library/Developer/Xcode/');\n return (cmdLineToolsExists || xcodeExists || xcodeAppExists);\n}\n\nfunction nanoSeconds() {\n const time = process.hrtime();\n if (!Array.isArray(time) || time.length !== 2) {\n return 0;\n }\n return +time[0] * 1e9 + +time[1];\n}\n\nfunction countUniqueLines(lines, startingWith) {\n startingWith = startingWith || '';\n const uniqueLines = [];\n lines.forEach(line => {\n if (line.startsWith(startingWith)) {\n if (uniqueLines.indexOf(line) === -1) {\n uniqueLines.push(line);\n }\n }\n });\n return uniqueLines.length;\n}\n\nfunction countLines(lines, startingWith) {\n startingWith = startingWith || '';\n const uniqueLines = [];\n lines.forEach(line => {\n if (line.startsWith(startingWith)) {\n uniqueLines.push(line);\n }\n });\n return uniqueLines.length;\n}\n\nfunction sanitizeShellString(str, strict) {\n if (typeof strict === 'undefined') { strict = false; }\n const s = str || '';\n let result = '';\n for (let i = 0; i <= mathMin(s.length, 2000); i++) {\n if (!(s[i] === undefined ||\n s[i] === '>' ||\n s[i] === '<' ||\n s[i] === '*' ||\n s[i] === '?' ||\n s[i] === '[' ||\n s[i] === ']' ||\n s[i] === '|' ||\n s[i] === '˚' ||\n s[i] === '$' ||\n s[i] === ';' ||\n s[i] === '&' ||\n s[i] === '(' ||\n s[i] === ')' ||\n s[i] === ']' ||\n s[i] === '#' ||\n s[i] === '\\\\' ||\n s[i] === '\\t' ||\n s[i] === '\\n' ||\n s[i] === '\\'' ||\n s[i] === '`' ||\n s[i] === '\"' ||\n s[i].length > 1 ||\n (strict && s[i] === '@') ||\n (strict && s[i] === ' ') ||\n (strict && s[i] == '{') ||\n (strict && s[i] == ')'))) {\n result = result + s[i];\n }\n }\n return result;\n}\n\nfunction isPrototypePolluted() {\n const s = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n let notPolluted = true;\n let st = '';\n\n st.__proto__.replace = stringReplace;\n st.__proto__.toLowerCase = stringToLower;\n st.__proto__.toString = stringToString;\n st.__proto__.substr = stringSubstr;\n\n notPolluted = notPolluted || !(s.length === 62);\n const ms = Date.now();\n if (typeof ms === 'number' && ms > 1600000000000) {\n const l = ms % 100 + 15;\n for (let i = 0; i < l; i++) {\n const r = Math.random() * 61.99999999 + 1;\n const rs = parseInt(Math.floor(r).toString(), 10);\n const rs2 = parseInt(r.toString().split('.')[0], 10);\n const q = Math.random() * 61.99999999 + 1;\n const qs = parseInt(Math.floor(q).toString(), 10);\n const qs2 = parseInt(q.toString().split('.')[0], 10);\n notPolluted = notPolluted && !(r === q);\n notPolluted = notPolluted && rs === rs2 && qs === qs2;\n st += s[rs - 1];\n }\n notPolluted = notPolluted && st.length === l;\n // string manipulation\n let p = Math.random() * l * 0.9999999999;\n let stm = st.substr(0, p) + ' ' + st.substr(p, 2000);\n stm.__proto__.replace = stringReplace;\n let sto = stm.replace(/ /g, '');\n notPolluted = notPolluted && st === sto;\n p = Math.random() * l * 0.9999999999;\n stm = st.substr(0, p) + '{' + st.substr(p, 2000);\n sto = stm.replace(/{/g, '');\n notPolluted = notPolluted && st === sto;\n p = Math.random() * l * 0.9999999999;\n stm = st.substr(0, p) + '*' + st.substr(p, 2000);\n sto = stm.replace(/\\*/g, '');\n notPolluted = notPolluted && st === sto;\n p = Math.random() * l * 0.9999999999;\n stm = st.substr(0, p) + '$' + st.substr(p, 2000);\n sto = stm.replace(/\\$/g, '');\n notPolluted = notPolluted && st === sto;\n\n // lower\n const stl = st.toLowerCase();\n notPolluted = notPolluted && (stl.length === l) && stl[l - 1] && !(stl[l]);\n for (let i = 0; i < l; i++) {\n const s1 = st[i];\n s1.__proto__.toLowerCase = stringToLower;\n const s2 = stl ? stl[i] : '';\n const s1l = s1.toLowerCase();\n notPolluted = notPolluted && s1l[0] === s2 && s1l[0] && !(s1l[1]);\n }\n }\n return !notPolluted;\n}\n\nfunction hex2bin(hex) {\n return ('00000000' + (parseInt(hex, 16)).toString(2)).substr(-8);\n}\n\nfunction getFilesInPath(source) {\n const lstatSync = fs.lstatSync;\n const readdirSync = fs.readdirSync;\n const join = path.join;\n\n function isDirectory(source) {\n return lstatSync(source).isDirectory();\n }\n function isFile(source) { return lstatSync(source).isFile(); }\n\n function getDirectories(source) {\n return readdirSync(source).map(function (name) { return join(source, name); }).filter(isDirectory);\n }\n function getFiles(source) {\n return readdirSync(source).map(function (name) { return join(source, name); }).filter(isFile);\n }\n\n function getFilesRecursively(source) {\n try {\n let dirs = getDirectories(source);\n let files = dirs\n .map(function (dir) { return getFilesRecursively(dir); })\n .reduce(function (a, b) { return a.concat(b); }, []);\n return files.concat(getFiles(source));\n } catch (e) {\n return [];\n }\n }\n\n if (fs.existsSync(source)) {\n return getFilesRecursively(source);\n } else {\n return [];\n }\n}\n\nfunction decodePiCpuinfo(lines) {\n\n // https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md\n\n const oldRevisionCodes = {\n '0002': {\n type: 'B',\n revision: '1.0',\n memory: 256,\n manufacturer: 'Egoman',\n processor: 'BCM2835'\n },\n '0003': {\n type: 'B',\n revision: '1.0',\n memory: 256,\n manufacturer: 'Egoman',\n processor: 'BCM2835'\n },\n '0004': {\n type: 'B',\n revision: '2.0',\n memory: 256,\n manufacturer: 'Sony UK',\n processor: 'BCM2835'\n },\n '0005': {\n type: 'B',\n revision: '2.0',\n memory: 256,\n manufacturer: 'Qisda',\n processor: 'BCM2835'\n },\n '0006': {\n type: 'B',\n revision: '2.0',\n memory: 256,\n manufacturer: 'Egoman',\n processor: 'BCM2835'\n },\n '0007': {\n type: 'A',\n revision: '2.0',\n memory: 256,\n manufacturer: 'Egoman',\n processor: 'BCM2835'\n },\n '0008': {\n type: 'A',\n revision: '2.0',\n memory: 256,\n manufacturer: 'Sony UK',\n processor: 'BCM2835'\n },\n '0009': {\n type: 'A',\n revision: '2.0',\n memory: 256,\n manufacturer: 'Qisda',\n processor: 'BCM2835'\n },\n '000d': {\n type: 'B',\n revision: '2.0',\n memory: 512,\n manufacturer: 'Egoman',\n processor: 'BCM2835'\n },\n '000e': {\n type: 'B',\n revision: '2.0',\n memory: 512,\n manufacturer: 'Sony UK',\n processor: 'BCM2835'\n },\n '000f': {\n type: 'B',\n revision: '2.0',\n memory: 512,\n manufacturer: 'Egoman',\n processor: 'BCM2835'\n },\n '0010': {\n type: 'B+',\n revision: '1.2',\n memory: 512,\n manufacturer: 'Sony UK',\n processor: 'BCM2835'\n },\n '0011': {\n type: 'CM1',\n revision: '1.0',\n memory: 512,\n manufacturer: 'Sony UK',\n processor: 'BCM2835'\n },\n '0012': {\n type: 'A+',\n revision: '1.1',\n memory: 256,\n manufacturer: 'Sony UK',\n processor: 'BCM2835'\n },\n '0013': {\n type: 'B+',\n revision: '1.2',\n memory: 512,\n manufacturer: 'Embest',\n processor: 'BCM2835'\n },\n '0014': {\n type: 'CM1',\n revision: '1.0',\n memory: 512,\n manufacturer: 'Embest',\n processor: 'BCM2835'\n },\n '0015': {\n type: 'A+',\n revision: '1.1',\n memory: 256,\n manufacturer: '512MB\tEmbest',\n processor: 'BCM2835'\n }\n };\n\n const processorList = [\n 'BCM2835',\n 'BCM2836',\n 'BCM2837',\n 'BCM2711',\n ];\n const manufacturerList = [\n 'Sony UK',\n 'Egoman',\n 'Embest',\n 'Sony Japan',\n 'Embest',\n 'Stadium'\n ];\n const typeList = {\n '00': 'A',\n '01': 'B',\n '02': 'A+',\n '03': 'B+',\n '04': '2B',\n '05': 'Alpha (early prototype)',\n '06': 'CM1',\n '08': '3B',\n '09': 'Zero',\n '0a': 'CM3',\n '0c': 'Zero W',\n '0d': '3B+',\n '0e': '3A+',\n '0f': 'Internal use only',\n '10': 'CM3+',\n '11': '4B',\n '12': 'Zero 2 W',\n '13': '400',\n '14': 'CM4'\n };\n\n const revisionCode = getValue(lines, 'revision', ':', true);\n const model = getValue(lines, 'model:', ':', true);\n const serial = getValue(lines, 'serial', ':', true);\n\n let result = {};\n if ({}.hasOwnProperty.call(oldRevisionCodes, revisionCode)) {\n // old revision codes\n result = {\n model,\n serial,\n revisionCode,\n memory: oldRevisionCodes[revisionCode].memory,\n manufacturer: oldRevisionCodes[revisionCode].manufacturer,\n processor: oldRevisionCodes[revisionCode].processor,\n type: oldRevisionCodes[revisionCode].type,\n revision: oldRevisionCodes[revisionCode].revision,\n };\n\n } else {\n // new revision code\n const revision = ('00000000' + getValue(lines, 'revision', ':', true).toLowerCase()).substr(-8);\n // const revisionStyleNew = hex2bin(revision.substr(2, 1)).substr(4, 1) === '1';\n const memSizeCode = parseInt(hex2bin(revision.substr(2, 1)).substr(5, 3), 2) || 0;\n const manufacturer = manufacturerList[parseInt(revision.substr(3, 1), 10)];\n const processor = processorList[parseInt(revision.substr(4, 1), 10)];\n const typeCode = revision.substr(5, 2);\n\n\n result = {\n model,\n serial,\n revisionCode,\n memory: 256 * Math.pow(2, memSizeCode),\n manufacturer,\n processor,\n type: {}.hasOwnProperty.call(typeList, typeCode) ? typeList[typeCode] : '',\n revision: '1.' + revision.substr(7, 1),\n };\n }\n return result;\n}\n\nfunction promiseAll(promises) {\n const resolvingPromises = promises.map(function (promise) {\n return new Promise(function (resolve) {\n var payload = new Array(2);\n promise.then(function (result) {\n payload[0] = result;\n })\n .catch(function (error) {\n payload[1] = error;\n })\n .then(function () {\n // The wrapped Promise returns an array: 0 = result, 1 = error ... we resolve all\n resolve(payload);\n });\n });\n });\n var errors = [];\n var results = [];\n\n // Execute all wrapped Promises\n return Promise.all(resolvingPromises)\n .then(function (items) {\n items.forEach(function (payload) {\n if (payload[1]) {\n errors.push(payload[1]);\n results.push(null);\n } else {\n errors.push(null);\n results.push(payload[0]);\n }\n });\n\n return {\n errors: errors,\n results: results\n };\n });\n}\n\nfunction promisify(nodeStyleFunction) {\n return function () {\n var args = Array.prototype.slice.call(arguments);\n return new Promise(function (resolve, reject) {\n args.push(function (err, data) {\n if (err) {\n reject(err);\n } else {\n resolve(data);\n }\n });\n nodeStyleFunction.apply(null, args);\n });\n };\n}\n\nfunction promisifySave(nodeStyleFunction) {\n return function () {\n var args = Array.prototype.slice.call(arguments);\n return new Promise(function (resolve) {\n args.push(function (err, data) {\n resolve(data);\n });\n nodeStyleFunction.apply(null, args);\n });\n };\n}\n\nfunction linuxVersion() {\n let result = '';\n if (_linux) {\n try {\n result = execSync('uname -v').toString();\n } catch (e) {\n result = '';\n }\n }\n return result;\n}\n\nfunction plistParser(xmlStr) {\n const tags = ['array', 'dict', 'key', 'string', 'integer', 'date', 'real', 'data', 'boolean', 'arrayEmpty'];\n const startStr = '' && pos < len) {\n pos++;\n }\n\n let depth = 0;\n let inTagStart = false;\n let inTagContent = false;\n let inTagEnd = false;\n let metaData = [{ tagStart: '', tagEnd: '', tagContent: '', key: '', data: null }];\n let c = '';\n let cn = xmlStr[pos];\n\n while (pos < len) {\n c = cn;\n if (pos + 1 < len) { cn = xmlStr[pos + 1]; }\n if (c === '<') {\n inTagContent = false;\n if (cn === '/') { inTagEnd = true; }\n else if (metaData[depth].tagStart) {\n metaData[depth].tagContent = '';\n if (!metaData[depth].data) { metaData[depth].data = metaData[depth].tagStart === 'array' ? [] : {}; }\n depth++;\n metaData.push({ tagStart: '', tagEnd: '', tagContent: '', key: null, data: null });\n inTagStart = true;\n inTagContent = false;\n }\n else if (!inTagStart) { inTagStart = true; }\n } else if (c === '>') {\n if (metaData[depth].tagStart === 'true/') { inTagStart = false; inTagEnd = true; metaData[depth].tagStart = ''; metaData[depth].tagEnd = '/boolean'; metaData[depth].data = true; }\n if (metaData[depth].tagStart === 'false/') { inTagStart = false; inTagEnd = true; metaData[depth].tagStart = ''; metaData[depth].tagEnd = '/boolean'; metaData[depth].data = false; }\n if (metaData[depth].tagStart === 'array/') { inTagStart = false; inTagEnd = true; metaData[depth].tagStart = ''; metaData[depth].tagEnd = '/arrayEmpty'; metaData[depth].data = []; }\n if (inTagContent) { inTagContent = false; }\n if (inTagStart) {\n inTagStart = false;\n inTagContent = true;\n if (metaData[depth].tagStart === 'array') {\n metaData[depth].data = [];\n }\n if (metaData[depth].tagStart === 'dict') {\n metaData[depth].data = {};\n }\n }\n if (inTagEnd) {\n inTagEnd = false;\n if (metaData[depth].tagEnd && tags.indexOf(metaData[depth].tagEnd.substr(1)) >= 0) {\n if (metaData[depth].tagEnd === '/dict' || metaData[depth].tagEnd === '/array') {\n if (depth > 1 && metaData[depth - 2].tagStart === 'array') {\n metaData[depth - 2].data.push(metaData[depth - 1].data);\n }\n if (depth > 1 && metaData[depth - 2].tagStart === 'dict') {\n metaData[depth - 2].data[metaData[depth - 1].key] = metaData[depth - 1].data;\n }\n depth--;\n metaData.pop();\n metaData[depth].tagContent = '';\n metaData[depth].tagStart = '';\n metaData[depth].tagEnd = '';\n }\n else {\n if (metaData[depth].tagEnd === '/key' && metaData[depth].tagContent) {\n metaData[depth].key = metaData[depth].tagContent;\n } else {\n if (metaData[depth].tagEnd === '/real' && metaData[depth].tagContent) { metaData[depth].data = parseFloat(metaData[depth].tagContent) || 0; }\n if (metaData[depth].tagEnd === '/integer' && metaData[depth].tagContent) { metaData[depth].data = parseInt(metaData[depth].tagContent) || 0; }\n if (metaData[depth].tagEnd === '/string' && metaData[depth].tagContent) { metaData[depth].data = metaData[depth].tagContent || ''; }\n if (metaData[depth].tagEnd === '/boolean') { metaData[depth].data = metaData[depth].tagContent || false; }\n if (metaData[depth].tagEnd === '/arrayEmpty') { metaData[depth].data = metaData[depth].tagContent || []; }\n if (depth > 0 && metaData[depth - 1].tagStart === 'array') { metaData[depth - 1].data.push(metaData[depth].data); }\n if (depth > 0 && metaData[depth - 1].tagStart === 'dict') { metaData[depth - 1].data[metaData[depth].key] = metaData[depth].data; }\n }\n metaData[depth].tagContent = '';\n metaData[depth].tagStart = '';\n metaData[depth].tagEnd = '';\n }\n }\n metaData[depth].tagEnd = '';\n inTagStart = false;\n inTagContent = false;\n }\n } else {\n if (inTagStart) { metaData[depth].tagStart += c; }\n if (inTagEnd) { metaData[depth].tagEnd += c; }\n if (inTagContent) { metaData[depth].tagContent += c; }\n }\n pos++;\n }\n return metaData[0].data;\n}\n\nfunction semverCompare(v1, v2) {\n let res = 0;\n const parts1 = v1.split('.');\n const parts2 = v2.split('.');\n if (parts1[0] < parts2[0]) { res = 1; }\n else if (parts1[0] > parts2[0]) { res = -1; }\n else if (parts1[0] === parts2[0] && parts1.length >= 2 && parts2.length >= 2) {\n if (parts1[1] < parts2[1]) { res = 1; }\n else if (parts1[1] > parts2[1]) { res = -1; }\n else if (parts1[1] === parts2[1]) {\n if (parts1.length >= 3 && parts2.length >= 3) {\n if (parts1[2] < parts2[2]) { res = 1; }\n else if (parts1[2] > parts2[2]) { res = -1; }\n } else if (parts2.length >= 3) {\n res = 1;\n }\n }\n }\n return res;\n}\n\nfunction noop() { }\n\nexports.toInt = toInt;\nexports.execOptsWin = execOptsWin;\nexports.getCodepage = getCodepage;\nexports.execWin = execWin;\nexports.isFunction = isFunction;\nexports.unique = unique;\nexports.sortByKey = sortByKey;\nexports.cores = cores;\nexports.getValue = getValue;\nexports.decodeEscapeSequence = decodeEscapeSequence;\nexports.parseDateTime = parseDateTime;\nexports.parseHead = parseHead;\nexports.findObjectByKey = findObjectByKey;\nexports.getWmic = getWmic;\nexports.wmic = wmic;\nexports.darwinXcodeExists = darwinXcodeExists;\nexports.getVboxmanage = getVboxmanage;\nexports.powerShell = powerShell;\nexports.powerShellStart = powerShellStart;\nexports.powerShellRelease = powerShellRelease;\nexports.execSafe = execSafe;\nexports.nanoSeconds = nanoSeconds;\nexports.countUniqueLines = countUniqueLines;\nexports.countLines = countLines;\nexports.noop = noop;\nexports.isRaspberry = isRaspberry;\nexports.isRaspbian = isRaspbian;\nexports.sanitizeShellString = sanitizeShellString;\nexports.isPrototypePolluted = isPrototypePolluted;\nexports.decodePiCpuinfo = decodePiCpuinfo;\nexports.promiseAll = promiseAll;\nexports.promisify = promisify;\nexports.promisifySave = promisifySave;\nexports.smartMonToolsInstalled = smartMonToolsInstalled;\nexports.linuxVersion = linuxVersion;\nexports.plistParser = plistParser;\nexports.stringReplace = stringReplace;\nexports.stringToLower = stringToLower;\nexports.stringToString = stringToString;\nexports.stringSubstr = stringSubstr;\nexports.stringTrim = stringTrim;\nexports.stringStartWith = stringStartWith;\nexports.mathMin = mathMin;\nexports.WINDIR = WINDIR;\nexports.getFilesInPath = getFilesInPath;\nexports.semverCompare = semverCompare;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// virtualbox.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 14. Docker\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst exec = require('child_process').exec;\nconst util = require('./util');\n\nfunction vboxInfo(callback) {\n\n // fallback - if only callback is given\n let result = [];\n return new Promise((resolve) => {\n process.nextTick(() => {\n try {\n exec(util.getVboxmanage() + ' list vms --long', function (error, stdout) {\n let parts = (os.EOL + stdout.toString()).split(os.EOL + 'Name:');\n parts.shift();\n parts.forEach(part => {\n const lines = ('Name:' + part).split(os.EOL);\n const state = util.getValue(lines, 'State');\n const running = state.startsWith('running');\n const runningSinceString = running ? state.replace('running (since ', '').replace(')', '').trim() : '';\n let runningSince = 0;\n try {\n if (running) {\n const sinceDateObj = new Date(runningSinceString);\n const offset = sinceDateObj.getTimezoneOffset();\n runningSince = Math.round((Date.now() - Date.parse(sinceDateObj)) / 1000) + offset * 60;\n }\n } catch (e) {\n util.noop();\n }\n const stoppedSinceString = !running ? state.replace('powered off (since', '').replace(')', '').trim() : '';\n let stoppedSince = 0;\n try {\n if (!running) {\n const sinceDateObj = new Date(stoppedSinceString);\n const offset = sinceDateObj.getTimezoneOffset();\n stoppedSince = Math.round((Date.now() - Date.parse(sinceDateObj)) / 1000) + offset * 60;\n }\n } catch (e) {\n util.noop();\n }\n result.push({\n id: util.getValue(lines, 'UUID'),\n name: util.getValue(lines, 'Name'),\n running,\n started: runningSinceString,\n runningSince,\n stopped: stoppedSinceString,\n stoppedSince,\n guestOS: util.getValue(lines, 'Guest OS'),\n hardwareUUID: util.getValue(lines, 'Hardware UUID'),\n memory: parseInt(util.getValue(lines, 'Memory size', ' '), 10),\n vram: parseInt(util.getValue(lines, 'VRAM size'), 10),\n cpus: parseInt(util.getValue(lines, 'Number of CPUs'), 10),\n cpuExepCap: util.getValue(lines, 'CPU exec cap'),\n cpuProfile: util.getValue(lines, 'CPUProfile'),\n chipset: util.getValue(lines, 'Chipset'),\n firmware: util.getValue(lines, 'Firmware'),\n pageFusion: util.getValue(lines, 'Page Fusion') === 'enabled',\n configFile: util.getValue(lines, 'Config file'),\n snapshotFolder: util.getValue(lines, 'Snapshot folder'),\n logFolder: util.getValue(lines, 'Log folder'),\n hpet: util.getValue(lines, 'HPET') === 'enabled',\n pae: util.getValue(lines, 'PAE') === 'enabled',\n longMode: util.getValue(lines, 'Long Mode') === 'enabled',\n tripleFaultReset: util.getValue(lines, 'Triple Fault Reset') === 'enabled',\n apic: util.getValue(lines, 'APIC') === 'enabled',\n x2Apic: util.getValue(lines, 'X2APIC') === 'enabled',\n acpi: util.getValue(lines, 'ACPI') === 'enabled',\n ioApic: util.getValue(lines, 'IOAPIC') === 'enabled',\n biosApicMode: util.getValue(lines, 'BIOS APIC mode'),\n bootMenuMode: util.getValue(lines, 'Boot menu mode'),\n bootDevice1: util.getValue(lines, 'Boot Device 1'),\n bootDevice2: util.getValue(lines, 'Boot Device 2'),\n bootDevice3: util.getValue(lines, 'Boot Device 3'),\n bootDevice4: util.getValue(lines, 'Boot Device 4'),\n timeOffset: util.getValue(lines, 'Time offset'),\n rtc: util.getValue(lines, 'RTC'),\n });\n });\n\n if (callback) { callback(result); }\n resolve(result);\n });\n } catch (e) {\n if (callback) { callback(result); }\n resolve(result);\n }\n });\n });\n}\n\nexports.vboxInfo = vboxInfo;\n","'use strict';\n// @ts-check\n// ==================================================================================\n// wifi.js\n// ----------------------------------------------------------------------------------\n// Description: System Information - library\n// for Node.js\n// Copyright: (c) 2014 - 2022\n// Author: Sebastian Hildebrandt\n// ----------------------------------------------------------------------------------\n// License: MIT\n// ==================================================================================\n// 9. wifi\n// ----------------------------------------------------------------------------------\n\nconst os = require('os');\nconst exec = require('child_process').exec;\nconst execSync = require('child_process').execSync;\nconst util = require('./util');\n\nlet _platform = process.platform;\n\nconst _linux = (_platform === 'linux' || _platform === 'android');\nconst _darwin = (_platform === 'darwin');\nconst _windows = (_platform === 'win32');\n\nfunction wifiDBFromQuality(quality) {\n return (parseFloat(quality) / 2 - 100);\n}\n\nfunction wifiQualityFromDB(db) {\n const result = 2 * (parseFloat(db) + 100);\n return result <= 100 ? result : 100;\n}\n\nconst _wifi_frequencies = {\n 1: 2412,\n 2: 2417,\n 3: 2422,\n 4: 2427,\n 5: 2432,\n 6: 2437,\n 7: 2442,\n 8: 2447,\n 9: 2452,\n 10: 2457,\n 11: 2462,\n 12: 2467,\n 13: 2472,\n 14: 2484,\n 32: 5160,\n 34: 5170,\n 36: 5180,\n 38: 5190,\n 40: 5200,\n 42: 5210,\n 44: 5220,\n 46: 5230,\n 48: 5240,\n 50: 5250,\n 52: 5260,\n 54: 5270,\n 56: 5280,\n 58: 5290,\n 60: 5300,\n 62: 5310,\n 64: 5320,\n 68: 5340,\n 96: 5480,\n 100: 5500,\n 102: 5510,\n 104: 5520,\n 106: 5530,\n 108: 5540,\n 110: 5550,\n 112: 5560,\n 114: 5570,\n 116: 5580,\n 118: 5590,\n 120: 5600,\n 122: 5610,\n 124: 5620,\n 126: 5630,\n 128: 5640,\n 132: 5660,\n 134: 5670,\n 136: 5680,\n 138: 5690,\n 140: 5700,\n 142: 5710,\n 144: 5720,\n 149: 5745,\n 151: 5755,\n 153: 5765,\n 155: 5775,\n 157: 5785,\n 159: 5795,\n 161: 5805,\n 165: 5825,\n 169: 5845,\n 173: 5865,\n 183: 4915,\n 184: 4920,\n 185: 4925,\n 187: 4935,\n 188: 4940,\n 189: 4945,\n 192: 4960,\n 196: 4980\n};\n\nfunction wifiFrequencyFromChannel(channel) {\n return {}.hasOwnProperty.call(_wifi_frequencies, channel) ? _wifi_frequencies[channel] : null;\n}\n\nfunction wifiChannelFromFrequencs(frequency) {\n let channel = 0;\n for (let key in _wifi_frequencies) {\n if ({}.hasOwnProperty.call(_wifi_frequencies, key)) {\n if (_wifi_frequencies[key] === frequency) { channel = util.toInt(key); }\n }\n }\n return channel;\n}\n\nfunction ifaceListLinux() {\n const result = [];\n const cmd = 'iw dev';\n try {\n const all = execSync(cmd).toString().split('\\n').map(line => line.trim()).join('\\n');\n const parts = all.split('\\nInterface ');\n parts.shift();\n parts.forEach(ifaceDetails => {\n const lines = ifaceDetails.split('\\n');\n const iface = lines[0];\n const id = util.toInt(util.getValue(lines, 'ifindex', ' '));\n const mac = util.getValue(lines, 'addr', ' ');\n const channel = util.toInt(util.getValue(lines, 'channel', ' '));\n result.push({\n id,\n iface,\n mac,\n channel\n });\n });\n return result;\n } catch (e) {\n return [];\n }\n}\n\nfunction nmiDeviceLinux(iface) {\n const cmd = `nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${iface} 2>/dev/null`;\n try {\n const lines = execSync(cmd).toString().split('\\n');\n const ssid = util.getValue(lines, 'GENERAL.CONNECTION');\n return {\n iface,\n type: util.getValue(lines, 'GENERAL.TYPE'),\n vendor: util.getValue(lines, 'GENERAL.VENDOR'),\n product: util.getValue(lines, 'GENERAL.PRODUCT'),\n mac: util.getValue(lines, 'GENERAL.HWADDR').toLowerCase(),\n ssid: ssid !== '--' ? ssid : null\n };\n } catch (e) {\n return {};\n }\n}\n\nfunction nmiConnectionLinux(ssid) {\n const cmd = `nmcli -t --show-secrets connection show ${ssid} 2>/dev/null`;\n try {\n const lines = execSync(cmd).toString().split('\\n');\n const bssid = util.getValue(lines, '802-11-wireless.seen-bssids').toLowerCase();\n return {\n ssid: ssid !== '--' ? ssid : null,\n uuid: util.getValue(lines, 'connection.uuid'),\n type: util.getValue(lines, 'connection.type'),\n autoconnect: util.getValue(lines, 'connection.autoconnect') === 'yes',\n security: util.getValue(lines, '802-11-wireless-security.key-mgmt'),\n bssid: bssid !== '--' ? bssid : null\n };\n } catch (e) {\n return {};\n }\n}\n\nfunction wpaConnectionLinux(iface) {\n const cmd = `wpa_cli -i ${iface} status 2>&1`;\n try {\n const lines = execSync(cmd).toString().split('\\n');\n const freq = util.toInt(util.getValue(lines, 'freq', '='));\n return {\n ssid: util.getValue(lines, 'ssid', '='),\n uuid: util.getValue(lines, 'uuid', '='),\n security: util.getValue(lines, 'key_mgmt', '='),\n freq,\n channel: wifiChannelFromFrequencs(freq),\n bssid: util.getValue(lines, 'bssid', '=').toLowerCase()\n };\n } catch (e) {\n return {};\n }\n}\n\nfunction getWifiNetworkListNmi() {\n const result = [];\n const cmd = 'nmcli -t -m multiline --fields active,ssid,bssid,mode,chan,freq,signal,security,wpa-flags,rsn-flags device wifi list 2>/dev/null';\n try {\n const stdout = execSync(cmd, { maxBuffer: 1024 * 20000 });\n const parts = stdout.toString().split('ACTIVE:');\n parts.shift();\n parts.forEach(part => {\n part = 'ACTIVE:' + part;\n const lines = part.split(os.EOL);\n const channel = util.getValue(lines, 'CHAN');\n const frequency = util.getValue(lines, 'FREQ').toLowerCase().replace('mhz', '').trim();\n const security = util.getValue(lines, 'SECURITY').replace('(', '').replace(')', '');\n const wpaFlags = util.getValue(lines, 'WPA-FLAGS').replace('(', '').replace(')', '');\n const rsnFlags = util.getValue(lines, 'RSN-FLAGS').replace('(', '').replace(')', '');\n result.push({\n ssid: util.getValue(lines, 'SSID'),\n bssid: util.getValue(lines, 'BSSID').toLowerCase(),\n mode: util.getValue(lines, 'MODE'),\n channel: channel ? parseInt(channel, 10) : null,\n frequency: frequency ? parseInt(frequency, 10) : null,\n signalLevel: wifiDBFromQuality(util.getValue(lines, 'SIGNAL')),\n quality: parseFloat(util.getValue(lines, 'SIGNAL')),\n security: security && security !== 'none' ? security.split(' ') : [],\n wpaFlags: wpaFlags && wpaFlags !== 'none' ? wpaFlags.split(' ') : [],\n rsnFlags: rsnFlags && rsnFlags !== 'none' ? rsnFlags.split(' ') : []\n });\n });\n return result;\n } catch (e) {\n return [];\n }\n}\n\nfunction getWifiNetworkListIw(iface) {\n const result = [];\n try {\n let iwlistParts = execSync(`export LC_ALL=C; iwlist ${iface} scan 2>&1; unset LC_ALL`).toString().split(' Cell ');\n if (iwlistParts[0].indexOf('resource busy') >= 0) { return -1; }\n if (iwlistParts.length > 1) {\n iwlistParts.shift();\n for (let i = 0; i < iwlistParts.length; i++) {\n const lines = iwlistParts[i].split('\\n');\n const channel = util.getValue(lines, 'channel', ':', true);\n const address = (lines && lines.length && lines[0].indexOf('Address:') >= 0 ? lines[0].split('Address:')[1].trim().toLowerCase() : '');\n const mode = util.getValue(lines, 'mode', ':', true);\n const frequency = util.getValue(lines, 'frequency', ':', true);\n const qualityString = util.getValue(lines, 'Quality', '=', true);\n const dbParts = qualityString.toLowerCase().split('signal level=');\n const db = dbParts.length > 1 ? util.toInt(dbParts[1]) : 0;\n const quality = db ? wifiQualityFromDB(db) : 0;\n const ssid = util.getValue(lines, 'essid', ':', true);\n\n // security and wpa-flags\n const isWpa = iwlistParts[i].indexOf(' WPA ') >= 0;\n const isWpa2 = iwlistParts[i].indexOf('WPA2 ') >= 0;\n const security = [];\n if (isWpa) { security.push('WPA'); }\n if (isWpa2) { security.push('WPA2'); }\n const wpaFlags = [];\n let wpaFlag = '';\n lines.forEach(function (line) {\n const l = line.trim().toLowerCase();\n if (l.indexOf('group cipher') >= 0) {\n if (wpaFlag) {\n wpaFlags.push(wpaFlag);\n }\n const parts = l.split(':');\n if (parts.length > 1) {\n wpaFlag = parts[1].trim().toUpperCase();\n }\n }\n if (l.indexOf('pairwise cipher') >= 0) {\n const parts = l.split(':');\n if (parts.length > 1) {\n if (parts[1].indexOf('tkip')) { wpaFlag = (wpaFlag ? 'TKIP/' + wpaFlag : 'TKIP'); }\n else if (parts[1].indexOf('ccmp')) { wpaFlag = (wpaFlag ? 'CCMP/' + wpaFlag : 'CCMP'); }\n else if (parts[1].indexOf('proprietary')) { wpaFlag = (wpaFlag ? 'PROP/' + wpaFlag : 'PROP'); }\n }\n }\n if (l.indexOf('authentication suites') >= 0) {\n const parts = l.split(':');\n if (parts.length > 1) {\n if (parts[1].indexOf('802.1x')) { wpaFlag = (wpaFlag ? '802.1x/' + wpaFlag : '802.1x'); }\n else if (parts[1].indexOf('psk')) { wpaFlag = (wpaFlag ? 'PSK/' + wpaFlag : 'PSK'); }\n }\n }\n });\n if (wpaFlag) {\n wpaFlags.push(wpaFlag);\n }\n\n result.push({\n ssid,\n bssid: address,\n mode,\n channel: channel ? util.toInt(channel) : null,\n frequency: frequency ? util.toInt(frequency.replace('.', '')) : null,\n signalLevel: db,\n quality,\n security,\n wpaFlags,\n rsnFlags: []\n });\n }\n }\n return result;\n } catch (e) {\n return -1;\n }\n}\n\n/*\n ssid: line.substring(parsedhead[0].from, parsedhead[0].to).trim(),\n bssid: line.substring(parsedhead[1].from, parsedhead[1].to).trim().toLowerCase(),\n mode: '',\n channel,\n frequency: wifiFrequencyFromChannel(channel),\n signalLevel: signalLevel ? parseInt(signalLevel, 10) : null,\n quality: wifiQualityFromDB(signalLevel),\n security,\n wpaFlags,\n rsnFlags: []\n\n const securityAll = line.substring(parsedhead[6].from, 1000).trim().split(' ');\n let security = [];\n let wpaFlags = [];\n securityAll.forEach(securitySingle => {\n if (securitySingle.indexOf('(') > 0) {\n const parts = securitySingle.split('(');\n security.push(parts[0]);\n wpaFlags = wpaFlags.concat(parts[1].replace(')', '').split(','));\n }\n });\n\n*/\nfunction parseWifiDarwin(wifiObj) {\n const result = [];\n if (wifiObj) {\n wifiObj.forEach(function (wifiItem) {\n const signalLevel = wifiItem.RSSI;\n let security = [];\n let wpaFlags = [];\n if (wifiItem.WPA_IE) {\n security.push('WPA');\n if (wifiItem.WPA_IE.IE_KEY_WPA_UCIPHERS) {\n wifiItem.WPA_IE.IE_KEY_WPA_UCIPHERS.forEach(function (ciphers) {\n if (ciphers === 0 && wpaFlags.indexOf('unknown/TKIP') === -1) { wpaFlags.push('unknown/TKIP'); }\n if (ciphers === 2 && wpaFlags.indexOf('PSK/TKIP') === -1) { wpaFlags.push('PSK/TKIP'); }\n if (ciphers === 4 && wpaFlags.indexOf('PSK/AES') === -1) { wpaFlags.push('PSK/AES'); }\n });\n }\n }\n if (wifiItem.RSN_IE) {\n security.push('WPA2');\n if (wifiItem.RSN_IE.IE_KEY_RSN_UCIPHERS) {\n wifiItem.RSN_IE.IE_KEY_RSN_UCIPHERS.forEach(function (ciphers) {\n if (ciphers === 0 && wpaFlags.indexOf('unknown/TKIP') === -1) { wpaFlags.push('unknown/TKIP'); }\n if (ciphers === 2 && wpaFlags.indexOf('TKIP/TKIP') === -1) { wpaFlags.push('TKIP/TKIP'); }\n if (ciphers === 4 && wpaFlags.indexOf('PSK/AES') === -1) { wpaFlags.push('PSK/AES'); }\n });\n }\n }\n result.push({\n ssid: wifiItem.SSID_STR,\n bssid: wifiItem.BSSID,\n mode: '',\n channel: wifiItem.CHANNEL,\n frequency: wifiFrequencyFromChannel(wifiItem.CHANNEL),\n signalLevel: signalLevel ? parseInt(signalLevel, 10) : null,\n quality: wifiQualityFromDB(signalLevel),\n security,\n wpaFlags,\n rsnFlags: []\n });\n });\n }\n return result;\n}\nfunction wifiNetworks(callback) {\n return new Promise((resolve) => {\n process.nextTick(() => {\n let result = [];\n if (_linux) {\n result = getWifiNetworkListNmi();\n if (result.length === 0) {\n try {\n const iwconfigParts = execSync('export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL').toString().split('\\n\\n');\n let iface = '';\n for (let i = 0; i < iwconfigParts.length; i++) {\n if (iwconfigParts[i].indexOf('no wireless') === -1 && iwconfigParts[i].trim() !== '') {\n iface = iwconfigParts[i].split(' ')[0];\n }\n }\n if (iface) {\n const res = getWifiNetworkListIw(iface);\n if (res === -1) {\n // try again after 4 secs\n setTimeout(function (iface) {\n const res = getWifiNetworkListIw(iface);\n if (res != -1) { result = res; }\n if (callback) {\n callback(result);\n }\n resolve(result);\n }, 4000);\n } else {\n result = res;\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n } catch (e) {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n } else if (_darwin) {\n let cmd = '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s -x';\n exec(cmd, { maxBuffer: 1024 * 40000 }, function (error, stdout) {\n const output = stdout.toString();\n result = parseWifiDarwin(util.plistParser(output));\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else if (_windows) {\n let cmd = 'netsh wlan show networks mode=Bssid';\n util.powerShell(cmd).then((stdout) => {\n const ssidParts = stdout.toString('utf8').split(os.EOL + os.EOL + 'SSID ');\n ssidParts.shift();\n\n ssidParts.forEach(ssidPart => {\n const ssidLines = ssidPart.split(os.EOL);\n if (ssidLines && ssidLines.length >= 8 && ssidLines[0].indexOf(':') >= 0) {\n const bssidsParts = ssidPart.split(' BSSID');\n bssidsParts.shift();\n\n bssidsParts.forEach((bssidPart) => {\n const bssidLines = bssidPart.split(os.EOL);\n const bssidLine = bssidLines[0].split(':');\n bssidLine.shift();\n const bssid = bssidLine.join(':').trim().toLowerCase();\n const channel = bssidLines[3].split(':').pop().trim();\n const quality = bssidLines[1].split(':').pop().trim();\n\n result.push({\n ssid: ssidLines[0].split(':').pop().trim(),\n bssid,\n mode: '',\n channel: channel ? parseInt(channel, 10) : null,\n frequency: wifiFrequencyFromChannel(channel),\n signalLevel: wifiDBFromQuality(quality),\n quality: quality ? parseInt(quality, 10) : null,\n security: [ssidLines[2].split(':').pop().trim()],\n wpaFlags: [ssidLines[3].split(':').pop().trim()],\n rsnFlags: []\n });\n });\n }\n });\n\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n });\n}\n\nexports.wifiNetworks = wifiNetworks;\n\nfunction getVendor(model) {\n model = model.toLowerCase();\n let result = '';\n if (model.indexOf('intel') >= 0) { result = 'Intel'; }\n else if (model.indexOf('realtek') >= 0) { result = 'Realtek'; }\n else if (model.indexOf('qualcom') >= 0) { result = 'Qualcom'; }\n else if (model.indexOf('broadcom') >= 0) { result = 'Broadcom'; }\n else if (model.indexOf('cavium') >= 0) { result = 'Cavium'; }\n else if (model.indexOf('cisco') >= 0) { result = 'Cisco'; }\n else if (model.indexOf('marvel') >= 0) { result = 'Marvel'; }\n else if (model.indexOf('zyxel') >= 0) { result = 'Zyxel'; }\n else if (model.indexOf('melanox') >= 0) { result = 'Melanox'; }\n else if (model.indexOf('d-link') >= 0) { result = 'D-Link'; }\n else if (model.indexOf('tp-link') >= 0) { result = 'TP-Link'; }\n else if (model.indexOf('asus') >= 0) { result = 'Asus'; }\n else if (model.indexOf('linksys') >= 0) { result = 'Linksys'; }\n return result;\n}\n\nfunction wifiConnections(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n const result = [];\n\n if (_linux) {\n const ifaces = ifaceListLinux();\n const networkList = getWifiNetworkListNmi();\n ifaces.forEach(ifaceDetail => {\n const nmiDetails = nmiDeviceLinux(ifaceDetail.iface);\n const wpaDetails = wpaConnectionLinux(ifaceDetail.iface);\n const ssid = nmiDetails.ssid || wpaDetails.ssid;\n const network = networkList.filter(nw => nw.ssid === ssid);\n const nmiConnection = nmiConnectionLinux(ssid);\n const channel = network && network.length && network[0].channel ? network[0].channel : (wpaDetails.channel ? wpaDetails.channel : null);\n const bssid = network && network.length && network[0].bssid ? network[0].bssid : (wpaDetails.bssid ? wpaDetails.bssid : null);\n if (ssid && bssid) {\n result.push({\n id: ifaceDetail.id,\n iface: ifaceDetail.iface,\n model: nmiDetails.product,\n ssid,\n bssid: network && network.length && network[0].bssid ? network[0].bssid : (wpaDetails.bssid ? wpaDetails.bssid : null),\n channel,\n frequency: channel ? wifiFrequencyFromChannel(channel) : null,\n type: nmiConnection.type ? nmiConnection.type : '802.11',\n security: nmiConnection.security ? nmiConnection.security : (wpaDetails.security ? wpaDetails.security : null),\n signalLevel: network && network.length && network[0].signalLevel ? network[0].signalLevel : null,\n txRate: null\n });\n }\n });\n if (callback) {\n callback(result);\n }\n resolve(result);\n } else if (_darwin) {\n let cmd = 'system_profiler SPNetworkDataType';\n exec(cmd, function (error, stdout) {\n const parts1 = stdout.toString().split('\\n\\n Wi-Fi:\\n\\n');\n if (parts1.length > 1) {\n const lines = parts1[1].split('\\n\\n')[0].split('\\n');\n const iface = util.getValue(lines, 'BSD Device Name', ':', true);\n const model = util.getValue(lines, 'hardware', ':', true);\n cmd = '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I';\n exec(cmd, function (error, stdout) {\n const lines2 = stdout.toString().split('\\n');\n if (lines.length > 10) {\n const ssid = util.getValue(lines2, 'ssid', ':', true);\n const bssid = util.getValue(lines2, 'bssid', ':', true);\n const security = util.getValue(lines2, 'link auth', ':', true);\n const txRate = util.getValue(lines2, 'lastTxRate', ':', true);\n const channel = util.getValue(lines2, 'channel', ':', true).split(',')[0];\n const type = '802.11';\n const rssi = util.toInt(util.getValue(lines2, 'agrCtlRSSI', ':', true));\n const noise = util.toInt(util.getValue(lines2, 'agrCtlNoise', ':', true));\n const signalLevel = rssi - noise;\n // const signal = wifiQualityFromDB(signalLevel);\n if (ssid || bssid) {\n result.push({\n id: 'Wi-Fi',\n iface,\n model,\n ssid,\n bssid,\n channel: util.toInt(channel),\n frequency: channel ? wifiFrequencyFromChannel(channel) : null,\n type,\n security,\n signalLevel,\n txRate\n });\n\n }\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n }\n });\n } else if (_windows) {\n let cmd = 'netsh wlan show interfaces';\n util.powerShell(cmd).then(function (stdout) {\n const allLines = stdout.toString().split('\\r\\n');\n for (let i = 0; i < allLines.length; i++) {\n allLines[i] = allLines[i].trim();\n }\n const parts = allLines.join('\\r\\n').split(':\\r\\n\\r\\n');\n parts.shift();\n parts.forEach(part => {\n const lines = part.split('\\r\\n');\n if (lines.length >= 5) {\n const iface = lines[0].indexOf(':') >= 0 ? lines[0].split(':')[1].trim() : '';\n const model = lines[1].indexOf(':') >= 0 ? lines[1].split(':')[1].trim() : '';\n const id = lines[2].indexOf(':') >= 0 ? lines[2].split(':')[1].trim() : '';\n const ssid = util.getValue(lines, 'SSID', ':', true);\n const bssid = util.getValue(lines, 'BSSID', ':', true);\n const signalLevel = util.getValue(lines, 'Signal', ':', true);\n const type = util.getValue(lines, 'Radio type', ':', true) || util.getValue(lines, 'Type de radio', ':', true) || util.getValue(lines, 'Funktyp', ':', true) || null;\n const security = util.getValue(lines, 'authentication', ':', true) || util.getValue(lines, 'Authentification', ':', true) || util.getValue(lines, 'Authentifizierung', ':', true) || null;\n const channel = util.getValue(lines, 'Channel', ':', true) || util.getValue(lines, 'Canal', ':', true) || util.getValue(lines, 'Kanal', ':', true) || null;\n const txRate = util.getValue(lines, 'Transmit rate (mbps)', ':', true) || util.getValue(lines, 'Transmission (mbit/s)', ':', true) || util.getValue(lines, 'Empfangsrate (MBit/s)', ':', true) || null;\n if (model && id && ssid && bssid) {\n result.push({\n id,\n iface,\n model,\n ssid,\n bssid,\n channel: util.toInt(channel),\n frequency: channel ? wifiFrequencyFromChannel(channel) : null,\n type,\n security,\n signalLevel,\n txRate: util.toInt(txRate) || null\n });\n }\n }\n });\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n });\n}\n\nexports.wifiConnections = wifiConnections;\n\nfunction wifiInterfaces(callback) {\n\n return new Promise((resolve) => {\n process.nextTick(() => {\n const result = [];\n\n if (_linux) {\n const ifaces = ifaceListLinux();\n ifaces.forEach(ifaceDetail => {\n const nmiDetails = nmiDeviceLinux(ifaceDetail.iface);\n result.push({\n id: ifaceDetail.id,\n iface: ifaceDetail.iface,\n model: nmiDetails.product ? nmiDetails.product : null,\n vendor: nmiDetails.vendor ? nmiDetails.vendor : null,\n mac: ifaceDetail.mac,\n });\n });\n if (callback) {\n callback(result);\n }\n resolve(result);\n } else if (_darwin) {\n let cmd = 'system_profiler SPNetworkDataType';\n exec(cmd, function (error, stdout) {\n const parts1 = stdout.toString().split('\\n\\n Wi-Fi:\\n\\n');\n if (parts1.length > 1) {\n const lines = parts1[1].split('\\n\\n')[0].split('\\n');\n const iface = util.getValue(lines, 'BSD Device Name', ':', true);\n const mac = util.getValue(lines, 'MAC Address', ':', true);\n const model = util.getValue(lines, 'hardware', ':', true);\n result.push({\n id: 'Wi-Fi',\n iface,\n model,\n vendor: '',\n mac\n });\n }\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else if (_windows) {\n let cmd = 'netsh wlan show interfaces';\n util.powerShell(cmd).then(function (stdout) {\n const allLines = stdout.toString().split('\\r\\n');\n for (let i = 0; i < allLines.length; i++) {\n allLines[i] = allLines[i].trim();\n }\n const parts = allLines.join('\\r\\n').split(':\\r\\n\\r\\n');\n parts.shift();\n parts.forEach(part => {\n const lines = part.split('\\r\\n');\n if (lines.length >= 5) {\n const iface = lines[0].indexOf(':') >= 0 ? lines[0].split(':')[1].trim() : '';\n const model = lines[1].indexOf(':') >= 0 ? lines[1].split(':')[1].trim() : '';\n const id = lines[2].indexOf(':') >= 0 ? lines[2].split(':')[1].trim() : '';\n const macParts = lines[3].indexOf(':') >= 0 ? lines[3].split(':') : [];\n macParts.shift();\n const mac = macParts.join(':').trim();\n const vendor = getVendor(model);\n if (iface && model && id && mac) {\n result.push({\n id,\n iface,\n model,\n vendor,\n mac,\n });\n }\n }\n });\n if (callback) {\n callback(result);\n }\n resolve(result);\n });\n } else {\n if (callback) {\n callback(result);\n }\n resolve(result);\n }\n });\n });\n}\n\nexports.wifiInterfaces = wifiInterfaces;\n","\"use strict\";\n\nvar punycode = require(\"punycode\");\nvar mappingTable = require(\"./lib/mappingTable.json\");\n\nvar PROCESSING_OPTIONS = {\n TRANSITIONAL: 0,\n NONTRANSITIONAL: 1\n};\n\nfunction normalize(str) { // fix bug in v8\n return str.split('\\u0000').map(function (s) { return s.normalize('NFC'); }).join('\\u0000');\n}\n\nfunction findStatus(val) {\n var start = 0;\n var end = mappingTable.length - 1;\n\n while (start <= end) {\n var mid = Math.floor((start + end) / 2);\n\n var target = mappingTable[mid];\n if (target[0][0] <= val && target[0][1] >= val) {\n return target;\n } else if (target[0][0] > val) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n }\n\n return null;\n}\n\nvar regexAstralSymbols = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n\nfunction countSymbols(string) {\n return string\n // replace every surrogate pair with a BMP symbol\n .replace(regexAstralSymbols, '_')\n // then get the length\n .length;\n}\n\nfunction mapChars(domain_name, useSTD3, processing_option) {\n var hasError = false;\n var processed = \"\";\n\n var len = countSymbols(domain_name);\n for (var i = 0; i < len; ++i) {\n var codePoint = domain_name.codePointAt(i);\n var status = findStatus(codePoint);\n\n switch (status[1]) {\n case \"disallowed\":\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n break;\n case \"ignored\":\n break;\n case \"mapped\":\n processed += String.fromCodePoint.apply(String, status[2]);\n break;\n case \"deviation\":\n if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) {\n processed += String.fromCodePoint.apply(String, status[2]);\n } else {\n processed += String.fromCodePoint(codePoint);\n }\n break;\n case \"valid\":\n processed += String.fromCodePoint(codePoint);\n break;\n case \"disallowed_STD3_mapped\":\n if (useSTD3) {\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n } else {\n processed += String.fromCodePoint.apply(String, status[2]);\n }\n break;\n case \"disallowed_STD3_valid\":\n if (useSTD3) {\n hasError = true;\n }\n\n processed += String.fromCodePoint(codePoint);\n break;\n }\n }\n\n return {\n string: processed,\n error: hasError\n };\n}\n\nvar combiningMarksRegex = /[\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D01-\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1ABE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF8\\u1CF9\\u1DC0-\\u1DF5\\u1DFC-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2D]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDE2C-\\uDE37\\uDEDF-\\uDEEA\\uDF01-\\uDF03\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDE30-\\uDE40\\uDEAB-\\uDEB7]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD83A[\\uDCD0-\\uDCD6]|\\uDB40[\\uDD00-\\uDDEF]/;\n\nfunction validateLabel(label, processing_option) {\n if (label.substr(0, 4) === \"xn--\") {\n label = punycode.toUnicode(label);\n processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL;\n }\n\n var error = false;\n\n if (normalize(label) !== label ||\n (label[3] === \"-\" && label[4] === \"-\") ||\n label[0] === \"-\" || label[label.length - 1] === \"-\" ||\n label.indexOf(\".\") !== -1 ||\n label.search(combiningMarksRegex) === 0) {\n error = true;\n }\n\n var len = countSymbols(label);\n for (var i = 0; i < len; ++i) {\n var status = findStatus(label.codePointAt(i));\n if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== \"valid\") ||\n (processing === PROCESSING_OPTIONS.NONTRANSITIONAL &&\n status[1] !== \"valid\" && status[1] !== \"deviation\")) {\n error = true;\n break;\n }\n }\n\n return {\n label: label,\n error: error\n };\n}\n\nfunction processing(domain_name, useSTD3, processing_option) {\n var result = mapChars(domain_name, useSTD3, processing_option);\n result.string = normalize(result.string);\n\n var labels = result.string.split(\".\");\n for (var i = 0; i < labels.length; ++i) {\n try {\n var validation = validateLabel(labels[i]);\n labels[i] = validation.label;\n result.error = result.error || validation.error;\n } catch(e) {\n result.error = true;\n }\n }\n\n return {\n string: labels.join(\".\"),\n error: result.error\n };\n}\n\nmodule.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) {\n var result = processing(domain_name, useSTD3, processing_option);\n var labels = result.string.split(\".\");\n labels = labels.map(function(l) {\n try {\n return punycode.toASCII(l);\n } catch(e) {\n result.error = true;\n return l;\n }\n });\n\n if (verifyDnsLength) {\n var total = labels.slice(0, labels.length - 1).join(\".\").length;\n if (total.length > 253 || total.length === 0) {\n result.error = true;\n }\n\n for (var i=0; i < labels.length; ++i) {\n if (labels.length > 63 || labels.length === 0) {\n result.error = true;\n break;\n }\n }\n }\n\n if (result.error) return null;\n return labels.join(\".\");\n};\n\nmodule.exports.toUnicode = function(domain_name, useSTD3) {\n var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL);\n\n return {\n domain: result.string,\n error: result.error\n };\n};\n\nmodule.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS;\n","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction getUserAgent() {\n if (typeof navigator === \"object\" && \"userAgent\" in navigator) {\n return navigator.userAgent;\n }\n\n if (typeof process === \"object\" && \"version\" in process) {\n return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;\n }\n\n return \"\";\n}\n\nexports.getUserAgent = getUserAgent;\n//# sourceMappingURL=index.js.map\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto\");;","import crypto from 'crypto';\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\nexport default function rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n crypto.randomFillSync(rnds8Pool);\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js'; // **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || rng)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || stringify(b);\n}\n\nexport default v1;","import validate from './validate.js';\n\nfunction parse(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nexport default parse;","import stringify from './stringify.js';\nimport parse from './parse.js';\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nexport const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexport const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexport default function (name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = parse(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return stringify(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","import crypto from 'crypto';\n\nfunction md5(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return crypto.createHash('md5').update(bytes).digest();\n}\n\nexport default md5;","import v35 from './v35.js';\nimport md5 from './md5.js';\nconst v3 = v35('v3', 0x30, md5);\nexport default v3;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","import crypto from 'crypto';\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return crypto.createHash('sha1').update(bytes).digest();\n}\n\nexport default sha1;","import v35 from './v35.js';\nimport sha1 from './sha1.js';\nconst v5 = v35('v5', 0x50, sha1);\nexport default v5;","export default '00000000-0000-0000-0000-000000000000';","import validate from './validate.js';\n\nfunction version(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nexport default version;","export { default as v1 } from './v1.js';\nexport { default as v3 } from './v3.js';\nexport { default as v4 } from './v4.js';\nexport { default as v5 } from './v5.js';\nexport { default as NIL } from './nil.js';\nexport { default as version } from './version.js';\nexport { default as validate } from './validate.js';\nexport { default as stringify } from './stringify.js';\nexport { default as parse } from './parse.js';","\"use strict\";\n\nvar conversions = {};\nmodule.exports = conversions;\n\nfunction sign(x) {\n return x < 0 ? -1 : 1;\n}\n\nfunction evenRound(x) {\n // Round x to the nearest integer, choosing the even integer if it lies halfway between two.\n if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor)\n return Math.floor(x);\n } else {\n return Math.round(x);\n }\n}\n\nfunction createNumberConversion(bitLength, typeOpts) {\n if (!typeOpts.unsigned) {\n --bitLength;\n }\n const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);\n const upperBound = Math.pow(2, bitLength) - 1;\n\n const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);\n const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);\n\n return function(V, opts) {\n if (!opts) opts = {};\n\n let x = +V;\n\n if (opts.enforceRange) {\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite number\");\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(\"Argument is not in byte range\");\n }\n\n return x;\n }\n\n if (!isNaN(x) && opts.clamp) {\n x = evenRound(x);\n\n if (x < lowerBound) x = lowerBound;\n if (x > upperBound) x = upperBound;\n return x;\n }\n\n if (!Number.isFinite(x) || x === 0) {\n return 0;\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n x = x % moduloVal;\n\n if (!typeOpts.unsigned && x >= moduloBound) {\n return x - moduloVal;\n } else if (typeOpts.unsigned) {\n if (x < 0) {\n x += moduloVal;\n } else if (x === -0) { // don't return negative zero\n return 0;\n }\n }\n\n return x;\n }\n}\n\nconversions[\"void\"] = function () {\n return undefined;\n};\n\nconversions[\"boolean\"] = function (val) {\n return !!val;\n};\n\nconversions[\"byte\"] = createNumberConversion(8, { unsigned: false });\nconversions[\"octet\"] = createNumberConversion(8, { unsigned: true });\n\nconversions[\"short\"] = createNumberConversion(16, { unsigned: false });\nconversions[\"unsigned short\"] = createNumberConversion(16, { unsigned: true });\n\nconversions[\"long\"] = createNumberConversion(32, { unsigned: false });\nconversions[\"unsigned long\"] = createNumberConversion(32, { unsigned: true });\n\nconversions[\"long long\"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });\nconversions[\"unsigned long long\"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });\n\nconversions[\"double\"] = function (V) {\n const x = +V;\n\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite floating-point value\");\n }\n\n return x;\n};\n\nconversions[\"unrestricted double\"] = function (V) {\n const x = +V;\n\n if (isNaN(x)) {\n throw new TypeError(\"Argument is NaN\");\n }\n\n return x;\n};\n\n// not quite valid, but good enough for JS\nconversions[\"float\"] = conversions[\"double\"];\nconversions[\"unrestricted float\"] = conversions[\"unrestricted double\"];\n\nconversions[\"DOMString\"] = function (V, opts) {\n if (!opts) opts = {};\n\n if (opts.treatNullAsEmptyString && V === null) {\n return \"\";\n }\n\n return String(V);\n};\n\nconversions[\"ByteString\"] = function (V, opts) {\n const x = String(V);\n let c = undefined;\n for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {\n if (c > 255) {\n throw new TypeError(\"Argument is not a valid bytestring\");\n }\n }\n\n return x;\n};\n\nconversions[\"USVString\"] = function (V) {\n const S = String(V);\n const n = S.length;\n const U = [];\n for (let i = 0; i < n; ++i) {\n const c = S.charCodeAt(i);\n if (c < 0xD800 || c > 0xDFFF) {\n U.push(String.fromCodePoint(c));\n } else if (0xDC00 <= c && c <= 0xDFFF) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n if (i === n - 1) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n const d = S.charCodeAt(i + 1);\n if (0xDC00 <= d && d <= 0xDFFF) {\n const a = c & 0x3FF;\n const b = d & 0x3FF;\n U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b));\n ++i;\n } else {\n U.push(String.fromCodePoint(0xFFFD));\n }\n }\n }\n }\n\n return U.join('');\n};\n\nconversions[\"Date\"] = function (V, opts) {\n if (!(V instanceof Date)) {\n throw new TypeError(\"Argument is not a Date object\");\n }\n if (isNaN(V)) {\n return undefined;\n }\n\n return V;\n};\n\nconversions[\"RegExp\"] = function (V, opts) {\n if (!(V instanceof RegExp)) {\n V = new RegExp(V);\n }\n\n return V;\n};\n","\"use strict\";\nconst usm = require(\"./url-state-machine\");\n\nexports.implementation = class URLImpl {\n constructor(constructorArgs) {\n const url = constructorArgs[0];\n const base = constructorArgs[1];\n\n let parsedBase = null;\n if (base !== undefined) {\n parsedBase = usm.basicURLParse(base);\n if (parsedBase === \"failure\") {\n throw new TypeError(\"Invalid base URL\");\n }\n }\n\n const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n\n // TODO: query stuff\n }\n\n get href() {\n return usm.serializeURL(this._url);\n }\n\n set href(v) {\n const parsedURL = usm.basicURLParse(v);\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n }\n\n get origin() {\n return usm.serializeURLOrigin(this._url);\n }\n\n get protocol() {\n return this._url.scheme + \":\";\n }\n\n set protocol(v) {\n usm.basicURLParse(v + \":\", { url: this._url, stateOverride: \"scheme start\" });\n }\n\n get username() {\n return this._url.username;\n }\n\n set username(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setTheUsername(this._url, v);\n }\n\n get password() {\n return this._url.password;\n }\n\n set password(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setThePassword(this._url, v);\n }\n\n get host() {\n const url = this._url;\n\n if (url.host === null) {\n return \"\";\n }\n\n if (url.port === null) {\n return usm.serializeHost(url.host);\n }\n\n return usm.serializeHost(url.host) + \":\" + usm.serializeInteger(url.port);\n }\n\n set host(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"host\" });\n }\n\n get hostname() {\n if (this._url.host === null) {\n return \"\";\n }\n\n return usm.serializeHost(this._url.host);\n }\n\n set hostname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"hostname\" });\n }\n\n get port() {\n if (this._url.port === null) {\n return \"\";\n }\n\n return usm.serializeInteger(this._url.port);\n }\n\n set port(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n if (v === \"\") {\n this._url.port = null;\n } else {\n usm.basicURLParse(v, { url: this._url, stateOverride: \"port\" });\n }\n }\n\n get pathname() {\n if (this._url.cannotBeABaseURL) {\n return this._url.path[0];\n }\n\n if (this._url.path.length === 0) {\n return \"\";\n }\n\n return \"/\" + this._url.path.join(\"/\");\n }\n\n set pathname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n this._url.path = [];\n usm.basicURLParse(v, { url: this._url, stateOverride: \"path start\" });\n }\n\n get search() {\n if (this._url.query === null || this._url.query === \"\") {\n return \"\";\n }\n\n return \"?\" + this._url.query;\n }\n\n set search(v) {\n // TODO: query stuff\n\n const url = this._url;\n\n if (v === \"\") {\n url.query = null;\n return;\n }\n\n const input = v[0] === \"?\" ? v.substring(1) : v;\n url.query = \"\";\n usm.basicURLParse(input, { url, stateOverride: \"query\" });\n }\n\n get hash() {\n if (this._url.fragment === null || this._url.fragment === \"\") {\n return \"\";\n }\n\n return \"#\" + this._url.fragment;\n }\n\n set hash(v) {\n if (v === \"\") {\n this._url.fragment = null;\n return;\n }\n\n const input = v[0] === \"#\" ? v.substring(1) : v;\n this._url.fragment = \"\";\n usm.basicURLParse(input, { url: this._url, stateOverride: \"fragment\" });\n }\n\n toJSON() {\n return this.href;\n }\n};\n","\"use strict\";\n\nconst conversions = require(\"webidl-conversions\");\nconst utils = require(\"./utils.js\");\nconst Impl = require(\".//URL-impl.js\");\n\nconst impl = utils.implSymbol;\n\nfunction URL(url) {\n if (!this || this[impl] || !(this instanceof URL)) {\n throw new TypeError(\"Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.\");\n }\n if (arguments.length < 1) {\n throw new TypeError(\"Failed to construct 'URL': 1 argument required, but only \" + arguments.length + \" present.\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 2; ++i) {\n args[i] = arguments[i];\n }\n args[0] = conversions[\"USVString\"](args[0]);\n if (args[1] !== undefined) {\n args[1] = conversions[\"USVString\"](args[1]);\n }\n\n module.exports.setup(this, args);\n}\n\nURL.prototype.toJSON = function toJSON() {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 0; ++i) {\n args[i] = arguments[i];\n }\n return this[impl].toJSON.apply(this[impl], args);\n};\nObject.defineProperty(URL.prototype, \"href\", {\n get() {\n return this[impl].href;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].href = V;\n },\n enumerable: true,\n configurable: true\n});\n\nURL.prototype.toString = function () {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n return this.href;\n};\n\nObject.defineProperty(URL.prototype, \"origin\", {\n get() {\n return this[impl].origin;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"protocol\", {\n get() {\n return this[impl].protocol;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].protocol = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"username\", {\n get() {\n return this[impl].username;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].username = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"password\", {\n get() {\n return this[impl].password;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].password = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"host\", {\n get() {\n return this[impl].host;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].host = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hostname\", {\n get() {\n return this[impl].hostname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hostname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"port\", {\n get() {\n return this[impl].port;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].port = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"pathname\", {\n get() {\n return this[impl].pathname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].pathname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"search\", {\n get() {\n return this[impl].search;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].search = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hash\", {\n get() {\n return this[impl].hash;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hash = V;\n },\n enumerable: true,\n configurable: true\n});\n\n\nmodule.exports = {\n is(obj) {\n return !!obj && obj[impl] instanceof Impl.implementation;\n },\n create(constructorArgs, privateData) {\n let obj = Object.create(URL.prototype);\n this.setup(obj, constructorArgs, privateData);\n return obj;\n },\n setup(obj, constructorArgs, privateData) {\n if (!privateData) privateData = {};\n privateData.wrapper = obj;\n\n obj[impl] = new Impl.implementation(constructorArgs, privateData);\n obj[impl][utils.wrapperSymbol] = obj;\n },\n interface: URL,\n expose: {\n Window: { URL: URL },\n Worker: { URL: URL }\n }\n};\n\n","\"use strict\";\n\nexports.URL = require(\"./URL\").interface;\nexports.serializeURL = require(\"./url-state-machine\").serializeURL;\nexports.serializeURLOrigin = require(\"./url-state-machine\").serializeURLOrigin;\nexports.basicURLParse = require(\"./url-state-machine\").basicURLParse;\nexports.setTheUsername = require(\"./url-state-machine\").setTheUsername;\nexports.setThePassword = require(\"./url-state-machine\").setThePassword;\nexports.serializeHost = require(\"./url-state-machine\").serializeHost;\nexports.serializeInteger = require(\"./url-state-machine\").serializeInteger;\nexports.parseURL = require(\"./url-state-machine\").parseURL;\n","\"use strict\";\r\nconst punycode = require(\"punycode\");\r\nconst tr46 = require(\"tr46\");\r\n\r\nconst specialSchemes = {\r\n ftp: 21,\r\n file: null,\r\n gopher: 70,\r\n http: 80,\r\n https: 443,\r\n ws: 80,\r\n wss: 443\r\n};\r\n\r\nconst failure = Symbol(\"failure\");\r\n\r\nfunction countSymbols(str) {\r\n return punycode.ucs2.decode(str).length;\r\n}\r\n\r\nfunction at(input, idx) {\r\n const c = input[idx];\r\n return isNaN(c) ? undefined : String.fromCodePoint(c);\r\n}\r\n\r\nfunction isASCIIDigit(c) {\r\n return c >= 0x30 && c <= 0x39;\r\n}\r\n\r\nfunction isASCIIAlpha(c) {\r\n return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);\r\n}\r\n\r\nfunction isASCIIAlphanumeric(c) {\r\n return isASCIIAlpha(c) || isASCIIDigit(c);\r\n}\r\n\r\nfunction isASCIIHex(c) {\r\n return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);\r\n}\r\n\r\nfunction isSingleDot(buffer) {\r\n return buffer === \".\" || buffer.toLowerCase() === \"%2e\";\r\n}\r\n\r\nfunction isDoubleDot(buffer) {\r\n buffer = buffer.toLowerCase();\r\n return buffer === \"..\" || buffer === \"%2e.\" || buffer === \".%2e\" || buffer === \"%2e%2e\";\r\n}\r\n\r\nfunction isWindowsDriveLetterCodePoints(cp1, cp2) {\r\n return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124);\r\n}\r\n\r\nfunction isWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === \":\" || string[1] === \"|\");\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === \":\";\r\n}\r\n\r\nfunction containsForbiddenHostCodePoint(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|%|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction containsForbiddenHostCodePointExcludingPercent(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction isSpecialScheme(scheme) {\r\n return specialSchemes[scheme] !== undefined;\r\n}\r\n\r\nfunction isSpecial(url) {\r\n return isSpecialScheme(url.scheme);\r\n}\r\n\r\nfunction defaultPort(scheme) {\r\n return specialSchemes[scheme];\r\n}\r\n\r\nfunction percentEncode(c) {\r\n let hex = c.toString(16).toUpperCase();\r\n if (hex.length === 1) {\r\n hex = \"0\" + hex;\r\n }\r\n\r\n return \"%\" + hex;\r\n}\r\n\r\nfunction utf8PercentEncode(c) {\r\n const buf = new Buffer(c);\r\n\r\n let str = \"\";\r\n\r\n for (let i = 0; i < buf.length; ++i) {\r\n str += percentEncode(buf[i]);\r\n }\r\n\r\n return str;\r\n}\r\n\r\nfunction utf8PercentDecode(str) {\r\n const input = new Buffer(str);\r\n const output = [];\r\n for (let i = 0; i < input.length; ++i) {\r\n if (input[i] !== 37) {\r\n output.push(input[i]);\r\n } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) {\r\n output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));\r\n i += 2;\r\n } else {\r\n output.push(input[i]);\r\n }\r\n }\r\n return new Buffer(output).toString();\r\n}\r\n\r\nfunction isC0ControlPercentEncode(c) {\r\n return c <= 0x1F || c > 0x7E;\r\n}\r\n\r\nconst extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]);\r\nfunction isPathPercentEncode(c) {\r\n return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c);\r\n}\r\n\r\nconst extraUserinfoPercentEncodeSet =\r\n new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]);\r\nfunction isUserinfoPercentEncode(c) {\r\n return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c);\r\n}\r\n\r\nfunction percentEncodeChar(c, encodeSetPredicate) {\r\n const cStr = String.fromCodePoint(c);\r\n\r\n if (encodeSetPredicate(c)) {\r\n return utf8PercentEncode(cStr);\r\n }\r\n\r\n return cStr;\r\n}\r\n\r\nfunction parseIPv4Number(input) {\r\n let R = 10;\r\n\r\n if (input.length >= 2 && input.charAt(0) === \"0\" && input.charAt(1).toLowerCase() === \"x\") {\r\n input = input.substring(2);\r\n R = 16;\r\n } else if (input.length >= 2 && input.charAt(0) === \"0\") {\r\n input = input.substring(1);\r\n R = 8;\r\n }\r\n\r\n if (input === \"\") {\r\n return 0;\r\n }\r\n\r\n const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/);\r\n if (regex.test(input)) {\r\n return failure;\r\n }\r\n\r\n return parseInt(input, R);\r\n}\r\n\r\nfunction parseIPv4(input) {\r\n const parts = input.split(\".\");\r\n if (parts[parts.length - 1] === \"\") {\r\n if (parts.length > 1) {\r\n parts.pop();\r\n }\r\n }\r\n\r\n if (parts.length > 4) {\r\n return input;\r\n }\r\n\r\n const numbers = [];\r\n for (const part of parts) {\r\n if (part === \"\") {\r\n return input;\r\n }\r\n const n = parseIPv4Number(part);\r\n if (n === failure) {\r\n return input;\r\n }\r\n\r\n numbers.push(n);\r\n }\r\n\r\n for (let i = 0; i < numbers.length - 1; ++i) {\r\n if (numbers[i] > 255) {\r\n return failure;\r\n }\r\n }\r\n if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) {\r\n return failure;\r\n }\r\n\r\n let ipv4 = numbers.pop();\r\n let counter = 0;\r\n\r\n for (const n of numbers) {\r\n ipv4 += n * Math.pow(256, 3 - counter);\r\n ++counter;\r\n }\r\n\r\n return ipv4;\r\n}\r\n\r\nfunction serializeIPv4(address) {\r\n let output = \"\";\r\n let n = address;\r\n\r\n for (let i = 1; i <= 4; ++i) {\r\n output = String(n % 256) + output;\r\n if (i !== 4) {\r\n output = \".\" + output;\r\n }\r\n n = Math.floor(n / 256);\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseIPv6(input) {\r\n const address = [0, 0, 0, 0, 0, 0, 0, 0];\r\n let pieceIndex = 0;\r\n let compress = null;\r\n let pointer = 0;\r\n\r\n input = punycode.ucs2.decode(input);\r\n\r\n if (input[pointer] === 58) {\r\n if (input[pointer + 1] !== 58) {\r\n return failure;\r\n }\r\n\r\n pointer += 2;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n }\r\n\r\n while (pointer < input.length) {\r\n if (pieceIndex === 8) {\r\n return failure;\r\n }\r\n\r\n if (input[pointer] === 58) {\r\n if (compress !== null) {\r\n return failure;\r\n }\r\n ++pointer;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n continue;\r\n }\r\n\r\n let value = 0;\r\n let length = 0;\r\n\r\n while (length < 4 && isASCIIHex(input[pointer])) {\r\n value = value * 0x10 + parseInt(at(input, pointer), 16);\r\n ++pointer;\r\n ++length;\r\n }\r\n\r\n if (input[pointer] === 46) {\r\n if (length === 0) {\r\n return failure;\r\n }\r\n\r\n pointer -= length;\r\n\r\n if (pieceIndex > 6) {\r\n return failure;\r\n }\r\n\r\n let numbersSeen = 0;\r\n\r\n while (input[pointer] !== undefined) {\r\n let ipv4Piece = null;\r\n\r\n if (numbersSeen > 0) {\r\n if (input[pointer] === 46 && numbersSeen < 4) {\r\n ++pointer;\r\n } else {\r\n return failure;\r\n }\r\n }\r\n\r\n if (!isASCIIDigit(input[pointer])) {\r\n return failure;\r\n }\r\n\r\n while (isASCIIDigit(input[pointer])) {\r\n const number = parseInt(at(input, pointer));\r\n if (ipv4Piece === null) {\r\n ipv4Piece = number;\r\n } else if (ipv4Piece === 0) {\r\n return failure;\r\n } else {\r\n ipv4Piece = ipv4Piece * 10 + number;\r\n }\r\n if (ipv4Piece > 255) {\r\n return failure;\r\n }\r\n ++pointer;\r\n }\r\n\r\n address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece;\r\n\r\n ++numbersSeen;\r\n\r\n if (numbersSeen === 2 || numbersSeen === 4) {\r\n ++pieceIndex;\r\n }\r\n }\r\n\r\n if (numbersSeen !== 4) {\r\n return failure;\r\n }\r\n\r\n break;\r\n } else if (input[pointer] === 58) {\r\n ++pointer;\r\n if (input[pointer] === undefined) {\r\n return failure;\r\n }\r\n } else if (input[pointer] !== undefined) {\r\n return failure;\r\n }\r\n\r\n address[pieceIndex] = value;\r\n ++pieceIndex;\r\n }\r\n\r\n if (compress !== null) {\r\n let swaps = pieceIndex - compress;\r\n pieceIndex = 7;\r\n while (pieceIndex !== 0 && swaps > 0) {\r\n const temp = address[compress + swaps - 1];\r\n address[compress + swaps - 1] = address[pieceIndex];\r\n address[pieceIndex] = temp;\r\n --pieceIndex;\r\n --swaps;\r\n }\r\n } else if (compress === null && pieceIndex !== 8) {\r\n return failure;\r\n }\r\n\r\n return address;\r\n}\r\n\r\nfunction serializeIPv6(address) {\r\n let output = \"\";\r\n const seqResult = findLongestZeroSequence(address);\r\n const compress = seqResult.idx;\r\n let ignore0 = false;\r\n\r\n for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {\r\n if (ignore0 && address[pieceIndex] === 0) {\r\n continue;\r\n } else if (ignore0) {\r\n ignore0 = false;\r\n }\r\n\r\n if (compress === pieceIndex) {\r\n const separator = pieceIndex === 0 ? \"::\" : \":\";\r\n output += separator;\r\n ignore0 = true;\r\n continue;\r\n }\r\n\r\n output += address[pieceIndex].toString(16);\r\n\r\n if (pieceIndex !== 7) {\r\n output += \":\";\r\n }\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseHost(input, isSpecialArg) {\r\n if (input[0] === \"[\") {\r\n if (input[input.length - 1] !== \"]\") {\r\n return failure;\r\n }\r\n\r\n return parseIPv6(input.substring(1, input.length - 1));\r\n }\r\n\r\n if (!isSpecialArg) {\r\n return parseOpaqueHost(input);\r\n }\r\n\r\n const domain = utf8PercentDecode(input);\r\n const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);\r\n if (asciiDomain === null) {\r\n return failure;\r\n }\r\n\r\n if (containsForbiddenHostCodePoint(asciiDomain)) {\r\n return failure;\r\n }\r\n\r\n const ipv4Host = parseIPv4(asciiDomain);\r\n if (typeof ipv4Host === \"number\" || ipv4Host === failure) {\r\n return ipv4Host;\r\n }\r\n\r\n return asciiDomain;\r\n}\r\n\r\nfunction parseOpaqueHost(input) {\r\n if (containsForbiddenHostCodePointExcludingPercent(input)) {\r\n return failure;\r\n }\r\n\r\n let output = \"\";\r\n const decoded = punycode.ucs2.decode(input);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n output += percentEncodeChar(decoded[i], isC0ControlPercentEncode);\r\n }\r\n return output;\r\n}\r\n\r\nfunction findLongestZeroSequence(arr) {\r\n let maxIdx = null;\r\n let maxLen = 1; // only find elements > 1\r\n let currStart = null;\r\n let currLen = 0;\r\n\r\n for (let i = 0; i < arr.length; ++i) {\r\n if (arr[i] !== 0) {\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n currStart = null;\r\n currLen = 0;\r\n } else {\r\n if (currStart === null) {\r\n currStart = i;\r\n }\r\n ++currLen;\r\n }\r\n }\r\n\r\n // if trailing zeros\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n return {\r\n idx: maxIdx,\r\n len: maxLen\r\n };\r\n}\r\n\r\nfunction serializeHost(host) {\r\n if (typeof host === \"number\") {\r\n return serializeIPv4(host);\r\n }\r\n\r\n // IPv6 serializer\r\n if (host instanceof Array) {\r\n return \"[\" + serializeIPv6(host) + \"]\";\r\n }\r\n\r\n return host;\r\n}\r\n\r\nfunction trimControlChars(url) {\r\n return url.replace(/^[\\u0000-\\u001F\\u0020]+|[\\u0000-\\u001F\\u0020]+$/g, \"\");\r\n}\r\n\r\nfunction trimTabAndNewline(url) {\r\n return url.replace(/\\u0009|\\u000A|\\u000D/g, \"\");\r\n}\r\n\r\nfunction shortenPath(url) {\r\n const path = url.path;\r\n if (path.length === 0) {\r\n return;\r\n }\r\n if (url.scheme === \"file\" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) {\r\n return;\r\n }\r\n\r\n path.pop();\r\n}\r\n\r\nfunction includesCredentials(url) {\r\n return url.username !== \"\" || url.password !== \"\";\r\n}\r\n\r\nfunction cannotHaveAUsernamePasswordPort(url) {\r\n return url.host === null || url.host === \"\" || url.cannotBeABaseURL || url.scheme === \"file\";\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetter(string) {\r\n return /^[A-Za-z]:$/.test(string);\r\n}\r\n\r\nfunction URLStateMachine(input, base, encodingOverride, url, stateOverride) {\r\n this.pointer = 0;\r\n this.input = input;\r\n this.base = base || null;\r\n this.encodingOverride = encodingOverride || \"utf-8\";\r\n this.stateOverride = stateOverride;\r\n this.url = url;\r\n this.failure = false;\r\n this.parseError = false;\r\n\r\n if (!this.url) {\r\n this.url = {\r\n scheme: \"\",\r\n username: \"\",\r\n password: \"\",\r\n host: null,\r\n port: null,\r\n path: [],\r\n query: null,\r\n fragment: null,\r\n\r\n cannotBeABaseURL: false\r\n };\r\n\r\n const res = trimControlChars(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n }\r\n\r\n const res = trimTabAndNewline(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n\r\n this.state = stateOverride || \"scheme start\";\r\n\r\n this.buffer = \"\";\r\n this.atFlag = false;\r\n this.arrFlag = false;\r\n this.passwordTokenSeenFlag = false;\r\n\r\n this.input = punycode.ucs2.decode(this.input);\r\n\r\n for (; this.pointer <= this.input.length; ++this.pointer) {\r\n const c = this.input[this.pointer];\r\n const cStr = isNaN(c) ? undefined : String.fromCodePoint(c);\r\n\r\n // exec state machine\r\n const ret = this[\"parse \" + this.state](c, cStr);\r\n if (!ret) {\r\n break; // terminate algorithm\r\n } else if (ret === failure) {\r\n this.failure = true;\r\n break;\r\n }\r\n }\r\n}\r\n\r\nURLStateMachine.prototype[\"parse scheme start\"] = function parseSchemeStart(c, cStr) {\r\n if (isASCIIAlpha(c)) {\r\n this.buffer += cStr.toLowerCase();\r\n this.state = \"scheme\";\r\n } else if (!this.stateOverride) {\r\n this.state = \"no scheme\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse scheme\"] = function parseScheme(c, cStr) {\r\n if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) {\r\n this.buffer += cStr.toLowerCase();\r\n } else if (c === 58) {\r\n if (this.stateOverride) {\r\n if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === \"file\") {\r\n return false;\r\n }\r\n\r\n if (this.url.scheme === \"file\" && (this.url.host === \"\" || this.url.host === null)) {\r\n return false;\r\n }\r\n }\r\n this.url.scheme = this.buffer;\r\n this.buffer = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n if (this.url.scheme === \"file\") {\r\n if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file\";\r\n } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) {\r\n this.state = \"special relative or authority\";\r\n } else if (isSpecial(this.url)) {\r\n this.state = \"special authority slashes\";\r\n } else if (this.input[this.pointer + 1] === 47) {\r\n this.state = \"path or authority\";\r\n ++this.pointer;\r\n } else {\r\n this.url.cannotBeABaseURL = true;\r\n this.url.path.push(\"\");\r\n this.state = \"cannot-be-a-base-URL path\";\r\n }\r\n } else if (!this.stateOverride) {\r\n this.buffer = \"\";\r\n this.state = \"no scheme\";\r\n this.pointer = -1;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse no scheme\"] = function parseNoScheme(c) {\r\n if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) {\r\n return failure;\r\n } else if (this.base.cannotBeABaseURL && c === 35) {\r\n this.url.scheme = this.base.scheme;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.url.cannotBeABaseURL = true;\r\n this.state = \"fragment\";\r\n } else if (this.base.scheme === \"file\") {\r\n this.state = \"file\";\r\n --this.pointer;\r\n } else {\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special relative or authority\"] = function parseSpecialRelativeOrAuthority(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path or authority\"] = function parsePathOrAuthority(c) {\r\n if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative\"] = function parseRelative(c) {\r\n this.url.scheme = this.base.scheme;\r\n if (isNaN(c)) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 47) {\r\n this.state = \"relative slash\";\r\n } else if (c === 63) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n this.state = \"relative slash\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice(0, this.base.path.length - 1);\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative slash\"] = function parseRelativeSlash(c) {\r\n if (isSpecial(this.url) && (c === 47 || c === 92)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"special authority ignore slashes\";\r\n } else if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority slashes\"] = function parseSpecialAuthoritySlashes(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"special authority ignore slashes\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority ignore slashes\"] = function parseSpecialAuthorityIgnoreSlashes(c) {\r\n if (c !== 47 && c !== 92) {\r\n this.state = \"authority\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse authority\"] = function parseAuthority(c, cStr) {\r\n if (c === 64) {\r\n this.parseError = true;\r\n if (this.atFlag) {\r\n this.buffer = \"%40\" + this.buffer;\r\n }\r\n this.atFlag = true;\r\n\r\n // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars\r\n const len = countSymbols(this.buffer);\r\n for (let pointer = 0; pointer < len; ++pointer) {\r\n const codePoint = this.buffer.codePointAt(pointer);\r\n\r\n if (codePoint === 58 && !this.passwordTokenSeenFlag) {\r\n this.passwordTokenSeenFlag = true;\r\n continue;\r\n }\r\n const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode);\r\n if (this.passwordTokenSeenFlag) {\r\n this.url.password += encodedCodePoints;\r\n } else {\r\n this.url.username += encodedCodePoints;\r\n }\r\n }\r\n this.buffer = \"\";\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n if (this.atFlag && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.pointer -= countSymbols(this.buffer) + 1;\r\n this.buffer = \"\";\r\n this.state = \"host\";\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse hostname\"] =\r\nURLStateMachine.prototype[\"parse host\"] = function parseHostName(c, cStr) {\r\n if (this.stateOverride && this.url.scheme === \"file\") {\r\n --this.pointer;\r\n this.state = \"file host\";\r\n } else if (c === 58 && !this.arrFlag) {\r\n if (this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"port\";\r\n if (this.stateOverride === \"hostname\") {\r\n return false;\r\n }\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n --this.pointer;\r\n if (isSpecial(this.url) && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n } else if (this.stateOverride && this.buffer === \"\" &&\r\n (includesCredentials(this.url) || this.url.port !== null)) {\r\n this.parseError = true;\r\n return false;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n } else {\r\n if (c === 91) {\r\n this.arrFlag = true;\r\n } else if (c === 93) {\r\n this.arrFlag = false;\r\n }\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse port\"] = function parsePort(c, cStr) {\r\n if (isASCIIDigit(c)) {\r\n this.buffer += cStr;\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92) ||\r\n this.stateOverride) {\r\n if (this.buffer !== \"\") {\r\n const port = parseInt(this.buffer);\r\n if (port > Math.pow(2, 16) - 1) {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.url.port = port === defaultPort(this.url.scheme) ? null : port;\r\n this.buffer = \"\";\r\n }\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst fileOtherwiseCodePoints = new Set([47, 92, 63, 35]);\r\n\r\nURLStateMachine.prototype[\"parse file\"] = function parseFile(c) {\r\n this.url.scheme = \"file\";\r\n\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file slash\";\r\n } else if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNaN(c)) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 63) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points\r\n !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) ||\r\n (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points\r\n !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n shortenPath(this.url);\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file slash\"] = function parseFileSlash(c) {\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file host\";\r\n } else {\r\n if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNormalizedWindowsDriveLetterString(this.base.path[0])) {\r\n this.url.path.push(this.base.path[0]);\r\n } else {\r\n this.url.host = this.base.host;\r\n }\r\n }\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file host\"] = function parseFileHost(c, cStr) {\r\n if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) {\r\n --this.pointer;\r\n if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) {\r\n this.parseError = true;\r\n this.state = \"path\";\r\n } else if (this.buffer === \"\") {\r\n this.url.host = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n } else {\r\n let host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n if (host === \"localhost\") {\r\n host = \"\";\r\n }\r\n this.url.host = host;\r\n\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n }\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path start\"] = function parsePathStart(c) {\r\n if (isSpecial(this.url)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"path\";\r\n\r\n if (c !== 47 && c !== 92) {\r\n --this.pointer;\r\n }\r\n } else if (!this.stateOverride && c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (!this.stateOverride && c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (c !== undefined) {\r\n this.state = \"path\";\r\n if (c !== 47) {\r\n --this.pointer;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path\"] = function parsePath(c) {\r\n if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) ||\r\n (!this.stateOverride && (c === 63 || c === 35))) {\r\n if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n }\r\n\r\n if (isDoubleDot(this.buffer)) {\r\n shortenPath(this.url);\r\n if (c !== 47 && !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n }\r\n } else if (isSingleDot(this.buffer) && c !== 47 &&\r\n !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n } else if (!isSingleDot(this.buffer)) {\r\n if (this.url.scheme === \"file\" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) {\r\n if (this.url.host !== \"\" && this.url.host !== null) {\r\n this.parseError = true;\r\n this.url.host = \"\";\r\n }\r\n this.buffer = this.buffer[0] + \":\";\r\n }\r\n this.url.path.push(this.buffer);\r\n }\r\n this.buffer = \"\";\r\n if (this.url.scheme === \"file\" && (c === undefined || c === 63 || c === 35)) {\r\n while (this.url.path.length > 1 && this.url.path[0] === \"\") {\r\n this.parseError = true;\r\n this.url.path.shift();\r\n }\r\n }\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n }\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += percentEncodeChar(c, isPathPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse cannot-be-a-base-URL path\"] = function parseCannotBeABaseURLPath(c) {\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n // TODO: Add: not a URL code point\r\n if (!isNaN(c) && c !== 37) {\r\n this.parseError = true;\r\n }\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n if (!isNaN(c)) {\r\n this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse query\"] = function parseQuery(c, cStr) {\r\n if (isNaN(c) || (!this.stateOverride && c === 35)) {\r\n if (!isSpecial(this.url) || this.url.scheme === \"ws\" || this.url.scheme === \"wss\") {\r\n this.encodingOverride = \"utf-8\";\r\n }\r\n\r\n const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead\r\n for (let i = 0; i < buffer.length; ++i) {\r\n if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 ||\r\n buffer[i] === 0x3C || buffer[i] === 0x3E) {\r\n this.url.query += percentEncode(buffer[i]);\r\n } else {\r\n this.url.query += String.fromCodePoint(buffer[i]);\r\n }\r\n }\r\n\r\n this.buffer = \"\";\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse fragment\"] = function parseFragment(c) {\r\n if (isNaN(c)) { // do nothing\r\n } else if (c === 0x0) {\r\n this.parseError = true;\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nfunction serializeURL(url, excludeFragment) {\r\n let output = url.scheme + \":\";\r\n if (url.host !== null) {\r\n output += \"//\";\r\n\r\n if (url.username !== \"\" || url.password !== \"\") {\r\n output += url.username;\r\n if (url.password !== \"\") {\r\n output += \":\" + url.password;\r\n }\r\n output += \"@\";\r\n }\r\n\r\n output += serializeHost(url.host);\r\n\r\n if (url.port !== null) {\r\n output += \":\" + url.port;\r\n }\r\n } else if (url.host === null && url.scheme === \"file\") {\r\n output += \"//\";\r\n }\r\n\r\n if (url.cannotBeABaseURL) {\r\n output += url.path[0];\r\n } else {\r\n for (const string of url.path) {\r\n output += \"/\" + string;\r\n }\r\n }\r\n\r\n if (url.query !== null) {\r\n output += \"?\" + url.query;\r\n }\r\n\r\n if (!excludeFragment && url.fragment !== null) {\r\n output += \"#\" + url.fragment;\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction serializeOrigin(tuple) {\r\n let result = tuple.scheme + \"://\";\r\n result += serializeHost(tuple.host);\r\n\r\n if (tuple.port !== null) {\r\n result += \":\" + tuple.port;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nmodule.exports.serializeURL = serializeURL;\r\n\r\nmodule.exports.serializeURLOrigin = function (url) {\r\n // https://url.spec.whatwg.org/#concept-url-origin\r\n switch (url.scheme) {\r\n case \"blob\":\r\n try {\r\n return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0]));\r\n } catch (e) {\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n case \"ftp\":\r\n case \"gopher\":\r\n case \"http\":\r\n case \"https\":\r\n case \"ws\":\r\n case \"wss\":\r\n return serializeOrigin({\r\n scheme: url.scheme,\r\n host: url.host,\r\n port: url.port\r\n });\r\n case \"file\":\r\n // spec says \"exercise to the reader\", chrome says \"file://\"\r\n return \"file://\";\r\n default:\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n};\r\n\r\nmodule.exports.basicURLParse = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride);\r\n if (usm.failure) {\r\n return \"failure\";\r\n }\r\n\r\n return usm.url;\r\n};\r\n\r\nmodule.exports.setTheUsername = function (url, username) {\r\n url.username = \"\";\r\n const decoded = punycode.ucs2.decode(username);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.setThePassword = function (url, password) {\r\n url.password = \"\";\r\n const decoded = punycode.ucs2.decode(password);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.serializeHost = serializeHost;\r\n\r\nmodule.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;\r\n\r\nmodule.exports.serializeInteger = function (integer) {\r\n return String(integer);\r\n};\r\n\r\nmodule.exports.parseURL = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n // We don't handle blobs, so this just delegates:\r\n return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });\r\n};\r\n","\"use strict\";\n\nmodule.exports.mixin = function mixin(target, source) {\n const keys = Object.getOwnPropertyNames(source);\n for (let i = 0; i < keys.length; ++i) {\n Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));\n }\n};\n\nmodule.exports.wrapperSymbol = Symbol(\"wrapper\");\nmodule.exports.implSymbol = Symbol(\"impl\");\n\nmodule.exports.wrapperForImpl = function (impl) {\n return impl[module.exports.wrapperSymbol];\n};\n\nmodule.exports.implForWrapper = function (wrapper) {\n return wrapper[module.exports.implSymbol];\n};\n\n","// Returns a wrapper function that returns a wrapped callback\n// The wrapper function should do some stuff, and return a\n// presumably different callback function.\n// This makes sure that own properties are retained, so that\n// decorations and such are not lost along the way.\nmodule.exports = wrappy\nfunction wrappy (fn, cb) {\n if (fn && cb) return wrappy(fn)(cb)\n\n if (typeof fn !== 'function')\n throw new TypeError('need wrapper function')\n\n Object.keys(fn).forEach(function (k) {\n wrapper[k] = fn[k]\n })\n\n return wrapper\n\n function wrapper() {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n var ret = fn.apply(this, args)\n var cb = args[args.length-1]\n if (typeof ret === 'function' && ret !== cb) {\n Object.keys(cb).forEach(function (k) {\n ret[k] = cb[k]\n })\n }\n return ret\n }\n}\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.error = exports.info = exports.debug = exports.isDebugEnabled = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst LOG_HEADER = '[Workflow Telemetry]';\nfunction isDebugEnabled() {\n return core.isDebug();\n}\nexports.isDebugEnabled = isDebugEnabled;\nfunction debug(msg) {\n core.debug(LOG_HEADER + ' ' + msg);\n}\nexports.debug = debug;\nfunction info(msg) {\n core.info(LOG_HEADER + ' ' + msg);\n}\nexports.info = info;\nfunction error(msg) {\n if (msg instanceof String || typeof msg === 'string') {\n core.error(LOG_HEADER + ' ' + msg);\n }\n else {\n core.error(LOG_HEADER + ' ' + msg.name);\n core.error(msg);\n }\n}\nexports.error = error;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getPrNumbers = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst github = __importStar(require(\"@actions/github\"));\nconst action_1 = require(\"@octokit/action\");\nconst stepTracer = __importStar(require(\"./stepTracer\"));\nconst statCollector = __importStar(require(\"./statCollector\"));\nconst processTracer = __importStar(require(\"./processTracer\"));\nconst logger = __importStar(require(\"./logger\"));\nconst { pull_request } = github.context.payload;\nconst { workflow, job, repo, runId, sha } = github.context;\nconst PAGE_SIZE = 100;\nconst octokit = new action_1.Octokit();\nfunction getCurrentJob() {\n return __awaiter(this, void 0, void 0, function* () {\n const _getCurrentJob = () => __awaiter(this, void 0, void 0, function* () {\n for (let page = 0;; page++) {\n const result = yield octokit.rest.actions.listJobsForWorkflowRun({\n owner: repo.owner,\n repo: repo.repo,\n run_id: runId,\n per_page: PAGE_SIZE,\n page\n });\n const jobs = result.data.jobs;\n // If there are no jobs, stop here\n if (!jobs || !jobs.length) {\n break;\n }\n const currentJobs = jobs.filter(it => it.status === 'in_progress' &&\n it.runner_name === process.env.RUNNER_NAME);\n if (currentJobs && currentJobs.length) {\n return currentJobs[0];\n }\n // Since returning job count is less than page size, this means that there are no other jobs.\n // So no need to make another request for the next page.\n if (jobs.length < PAGE_SIZE) {\n break;\n }\n }\n return null;\n });\n try {\n for (let i = 0; i < 10; i++) {\n const currentJob = yield _getCurrentJob();\n if (currentJob && currentJob.id) {\n return currentJob;\n }\n yield new Promise(r => setTimeout(r, 1000));\n }\n }\n catch (error) {\n logger.error(`Unable to get current workflow job info. ` +\n `Please sure that your workflow have \"actions:read\" permission!`);\n }\n return null;\n });\n}\nfunction reportAll(currentJob, content) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Reporting all content ...`);\n logger.debug(`Workflow - Job: ${workflow} - ${job}`);\n const jobUrl = `https://github.com/${repo.owner}/${repo.repo}/runs/${currentJob.id}?check_suite_focus=true`;\n logger.debug(`Job url: ${jobUrl}`);\n const title = `## Workflow Telemetry - ${workflow} / ${currentJob.name}`;\n logger.debug(`Title: ${title}`);\n const commit = (pull_request && pull_request.head && pull_request.head.sha) || sha;\n logger.debug(`Commit: ${commit}`);\n const commitUrl = `https://github.com/${repo.owner}/${repo.repo}/commit/${commit}`;\n logger.debug(`Commit url: ${commitUrl}`);\n const info = `Workflow telemetry for commit [${commit}](${commitUrl})\\n` +\n `You can access workflow job details [here](${jobUrl})`;\n const postContent = [title, info, content].join('\\n');\n const jobSummary = core.getInput('job_summary');\n if ('true' === jobSummary) {\n core.summary.addRaw(postContent);\n yield core.summary.write();\n }\n const commentOnPR = core.getInput('comment_on_pr');\n if ('true' === commentOnPR) {\n const prNumbers = yield getPrNumbers();\n if (prNumbers) {\n if (logger.isDebugEnabled()) {\n logger.debug(`Found Pull Request: ${JSON.stringify(prNumbers)}`);\n }\n for (let prNumber of prNumbers) {\n yield octokit.rest.issues.createComment(Object.assign(Object.assign({}, github.context.repo), { issue_number: prNumber, body: postContent }));\n }\n }\n else {\n logger.debug(`Couldn't find Pull Request`);\n }\n }\n else {\n logger.debug(`commentOnPR is false`);\n }\n logger.info(`Reporting all content completed`);\n });\n}\nfunction getPrNumbers() {\n return __awaiter(this, void 0, void 0, function* () {\n if (pull_request) {\n return [pull_request.number];\n }\n const { data: pullRequests } = yield octokit.repos.listPullRequestsAssociatedWithCommit({\n owner: repo.owner,\n repo: repo.repo,\n commit_sha: sha,\n });\n return pullRequests.filter((pr) => pr.state === \"open\").map((pr) => pr.number).slice(0, 10);\n });\n}\nexports.getPrNumbers = getPrNumbers;\nfunction run() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n logger.info(`Finishing ...`);\n const currentJob = yield getCurrentJob();\n if (!currentJob) {\n logger.error(`Couldn't find current job. So action will not report any data.`);\n return;\n }\n logger.debug(`Current job: ${JSON.stringify(currentJob)}`);\n // Finish step tracer\n yield stepTracer.finish(currentJob);\n // Finish stat collector\n yield statCollector.finish(currentJob);\n // Finish process tracer\n yield processTracer.finish(currentJob);\n // Report step tracer\n const stepTracerContent = yield stepTracer.report(currentJob);\n // Report stat collector\n const stepCollectorContent = yield statCollector.report(currentJob);\n // Report process tracer\n const procTracerContent = yield processTracer.report(currentJob);\n let allContent = '';\n if (stepTracerContent) {\n allContent = allContent.concat(stepTracerContent, '\\n');\n }\n if (stepCollectorContent) {\n allContent = allContent.concat(stepCollectorContent, '\\n');\n }\n if (procTracerContent) {\n allContent = allContent.concat(procTracerContent, '\\n');\n }\n yield reportAll(currentJob, allContent);\n logger.info(`Finish completed`);\n }\n catch (error) {\n logger.error(error.message);\n }\n });\n}\nrun();\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parse = void 0;\nconst fs = __importStar(require(\"fs\"));\nconst readline = __importStar(require(\"readline\"));\nconst logger = __importStar(require(\"./logger\"));\nconst SYS_PROCS_TO_BE_IGNORED = new Set([\n 'awk',\n 'basename',\n 'cat',\n 'cut',\n 'date',\n 'echo',\n 'envsubst',\n 'expr',\n 'dirname',\n 'grep',\n 'head',\n 'id',\n 'ip',\n 'ln',\n 'ls',\n 'lsblk',\n 'mkdir',\n 'mktemp',\n 'mv',\n 'ps',\n 'readlink',\n 'rm',\n 'sed',\n 'seq',\n 'sh',\n 'uname',\n 'whoami'\n]);\nfunction parse(filePath, procEventParseOptions) {\n var e_1, _a;\n return __awaiter(this, void 0, void 0, function* () {\n const minDuration = (procEventParseOptions && procEventParseOptions.minDuration) || -1;\n const traceSystemProcesses = (procEventParseOptions && procEventParseOptions.traceSystemProcesses) ||\n false;\n const fileStream = fs.createReadStream(filePath);\n const rl = readline.createInterface({\n input: fileStream,\n crlfDelay: Infinity\n });\n // Note: we use the crlfDelay option to recognize all instances of CR LF\n // ('\\r\\n') in input file as a single line break.\n const activeCommands = new Map();\n const replacedCommands = new Map();\n const completedCommands = [];\n let commandOrder = 0;\n try {\n for (var rl_1 = __asyncValues(rl), rl_1_1; rl_1_1 = yield rl_1.next(), !rl_1_1.done;) {\n let line = rl_1_1.value;\n line = line.trim();\n if (!line || !line.length) {\n continue;\n }\n try {\n if (logger.isDebugEnabled()) {\n logger.debug(`Parsing trace process event: ${line}`);\n }\n const event = JSON.parse(line);\n event.order = ++commandOrder;\n if (!traceSystemProcesses && SYS_PROCS_TO_BE_IGNORED.has(event.name)) {\n continue;\n }\n if ('EXEC' === event.event) {\n const existingCommand = activeCommands.get(event.pid);\n activeCommands.set(event.pid, event);\n if (existingCommand) {\n replacedCommands.set(event.pid, existingCommand);\n }\n }\n else if ('EXIT' === event.event) {\n let activeCommandCompleted = false;\n let replacedCommandCompleted = false;\n // Process active command\n const activeCommand = activeCommands.get(event.pid);\n activeCommands.delete(event.pid);\n if (activeCommand) {\n for (let key of Object.keys(event)) {\n if (!activeCommand.hasOwnProperty(key)) {\n activeCommand[key] = event[key];\n }\n }\n activeCommandCompleted = true;\n }\n // Process replaced command if there is\n const replacedCommand = replacedCommands.get(event.pid);\n replacedCommands.delete(event.pid);\n if (replacedCommand && activeCommandCompleted) {\n for (let key of Object.keys(event)) {\n if (!replacedCommand.hasOwnProperty(key)) {\n replacedCommand[key] = event[key];\n }\n }\n const finishTime = activeCommand.startTime + activeCommand.duration;\n replacedCommand.duration = finishTime - replacedCommand.startTime;\n replacedCommandCompleted = true;\n }\n // Complete the replaced command first if there is\n if (replacedCommandCompleted &&\n replacedCommand.duration > minDuration) {\n completedCommands.push(replacedCommand);\n }\n // Then complete the actual command\n if (activeCommandCompleted && activeCommand.duration > minDuration) {\n completedCommands.push(activeCommand);\n }\n }\n else {\n if (logger.isDebugEnabled()) {\n logger.debug(`Unknown trace process event: ${line}`);\n }\n }\n }\n catch (error) {\n logger.debug(`Unable to parse process trace event (${error}): ${line}`);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (rl_1_1 && !rl_1_1.done && (_a = rl_1.return)) yield _a.call(rl_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n completedCommands.sort((a, b) => {\n return a.startTime - b.startTime;\n });\n if (logger.isDebugEnabled()) {\n logger.debug(`Completed commands: ${JSON.stringify(completedCommands)}`);\n }\n return completedCommands;\n });\n}\nexports.parse = parse;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.report = exports.finish = exports.start = void 0;\nconst child_process_1 = require(\"child_process\");\nconst path_1 = __importDefault(require(\"path\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst systeminformation_1 = __importDefault(require(\"systeminformation\"));\nconst sprintf_js_1 = require(\"sprintf-js\");\nconst procTraceParser_1 = require(\"./procTraceParser\");\nconst logger = __importStar(require(\"./logger\"));\nconst PROC_TRACER_PID_KEY = 'PROC_TRACER_PID';\nconst PROC_TRACER_OUTPUT_FILE_NAME = 'proc-trace.out';\nconst PROC_TRACER_BINARY_NAME_UBUNTU_20 = 'proc_tracer_ubuntu-20';\nconst PROC_TRACER_BINARY_NAME_UBUNTU_22 = 'proc_tracer_ubuntu-22';\nconst DEFAULT_PROC_TRACE_CHART_MAX_COUNT = 100;\nconst GHA_FILE_NAME_PREFIX = '/home/runner/work/_actions/';\nlet finished = false;\nfunction getProcessTracerBinaryName() {\n return __awaiter(this, void 0, void 0, function* () {\n const osInfo = yield systeminformation_1.default.osInfo();\n if (osInfo) {\n // Check whether we are running on Ubuntu\n if (osInfo.distro === 'Ubuntu') {\n const majorVersion = parseInt(osInfo.release.split('.')[0]);\n if (majorVersion === 20) {\n logger.info(`Using ${PROC_TRACER_BINARY_NAME_UBUNTU_20}`);\n return PROC_TRACER_BINARY_NAME_UBUNTU_20;\n }\n if (majorVersion === 22) {\n logger.info(`Using ${PROC_TRACER_BINARY_NAME_UBUNTU_22}`);\n return PROC_TRACER_BINARY_NAME_UBUNTU_22;\n }\n }\n }\n logger.info(`Process tracing disabled because of unsupported OS: ${JSON.stringify(osInfo)}`);\n return null;\n });\n}\nfunction getExtraProcessInfo(command) {\n // Check whether this is node process with args\n if (command.name === 'node' && command.args.length > 1) {\n const arg1 = command.args[1];\n // Check whether this is Node.js GHA process\n if (arg1.startsWith(GHA_FILE_NAME_PREFIX)) {\n const actionFile = arg1.substring(GHA_FILE_NAME_PREFIX.length);\n const idx1 = actionFile.indexOf('/');\n const idx2 = actionFile.indexOf('/', idx1 + 1);\n if (idx1 >= 0 && idx2 > idx1) {\n // If we could find a valid GHA name, use it as extra info\n return actionFile.substring(idx1 + 1, idx2);\n }\n }\n }\n return null;\n}\n///////////////////////////\nfunction start() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Starting process tracer ...`);\n try {\n const procTracerBinaryName = yield getProcessTracerBinaryName();\n if (procTracerBinaryName) {\n const procTraceOutFilePath = path_1.default.join(__dirname, '../proc-tracer', PROC_TRACER_OUTPUT_FILE_NAME);\n const child = (0, child_process_1.spawn)('sudo', [\n path_1.default.join(__dirname, `../proc-tracer/${procTracerBinaryName}`),\n '-f',\n 'json',\n '-o',\n procTraceOutFilePath\n ], {\n detached: true,\n stdio: 'ignore',\n env: Object.assign({}, process.env)\n });\n child.unref();\n core.saveState(PROC_TRACER_PID_KEY, (_a = child.pid) === null || _a === void 0 ? void 0 : _a.toString());\n logger.info(`Started process tracer`);\n return true;\n }\n else {\n return false;\n }\n }\n catch (error) {\n logger.error('Unable to start process tracer');\n logger.error(error);\n return false;\n }\n });\n}\nexports.start = start;\nfunction finish(currentJob) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Finishing process tracer ...`);\n const procTracePID = core.getState(PROC_TRACER_PID_KEY);\n if (!procTracePID) {\n logger.info(`Skipped finishing process tracer since process tracer didn't started`);\n return false;\n }\n try {\n logger.debug(`Interrupting process tracer with pid ${procTracePID} to stop gracefully ...`);\n (0, child_process_1.exec)(`sudo kill -s INT ${procTracePID}`);\n finished = true;\n logger.info(`Finished process tracer`);\n return true;\n }\n catch (error) {\n logger.error('Unable to finish process tracer');\n logger.error(error);\n return false;\n }\n });\n}\nexports.finish = finish;\nfunction report(currentJob) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Reporting process tracer result ...`);\n if (!finished) {\n logger.info(`Skipped reporting process tracer since process tracer didn't finished`);\n return null;\n }\n try {\n const procTraceOutFilePath = path_1.default.join(__dirname, '../proc-tracer', PROC_TRACER_OUTPUT_FILE_NAME);\n logger.info(`Getting process tracer result from file ${procTraceOutFilePath} ...`);\n let procTraceMinDuration = -1;\n const procTraceMinDurationInput = core.getInput('proc_trace_min_duration');\n if (procTraceMinDurationInput) {\n const minProcDurationVal = parseInt(procTraceMinDurationInput);\n if (Number.isInteger(minProcDurationVal)) {\n procTraceMinDuration = minProcDurationVal;\n }\n }\n const procTraceSysEnable = core.getInput('proc_trace_sys_enable') === 'true';\n const procTraceChartShow = core.getInput('proc_trace_chart_show') === 'true';\n const procTraceChartMaxCountInput = parseInt(core.getInput('proc_trace_chart_max_count'));\n const procTraceChartMaxCount = Number.isInteger(procTraceChartMaxCountInput)\n ? procTraceChartMaxCountInput\n : DEFAULT_PROC_TRACE_CHART_MAX_COUNT;\n const procTraceTableShow = core.getInput('proc_trace_table_show') === 'true';\n const completedCommands = yield (0, procTraceParser_1.parse)(procTraceOutFilePath, {\n minDuration: procTraceMinDuration,\n traceSystemProcesses: procTraceSysEnable\n });\n ///////////////////////////////////////////////////////////////////////////\n let chartContent = '';\n if (procTraceChartShow) {\n chartContent = chartContent.concat('gantt', '\\n');\n chartContent = chartContent.concat('\\t', `title ${currentJob.name}`, '\\n');\n chartContent = chartContent.concat('\\t', `dateFormat x`, '\\n');\n chartContent = chartContent.concat('\\t', `axisFormat %H:%M:%S`, '\\n');\n const filteredCommands = [...completedCommands]\n .sort((a, b) => {\n return -(a.duration - b.duration);\n })\n .slice(0, procTraceChartMaxCount)\n .sort((a, b) => {\n let result = a.startTime - b.startTime;\n if (result === 0 && a.order && b.order) {\n result = a.order - b.order;\n }\n return result;\n });\n for (const command of filteredCommands) {\n const extraProcessInfo = getExtraProcessInfo(command);\n if (extraProcessInfo) {\n chartContent = chartContent.concat('\\t', `${command.name} (${extraProcessInfo}) : `);\n }\n else {\n chartContent = chartContent.concat('\\t', `${command.name} : `);\n }\n if (command.exitCode !== 0) {\n // to show red\n chartContent = chartContent.concat('crit, ');\n }\n const startTime = command.startTime;\n const finishTime = command.startTime + command.duration;\n chartContent = chartContent.concat(`${Math.min(startTime, finishTime)}, ${finishTime}`, '\\n');\n }\n }\n ///////////////////////////////////////////////////////////////////////////\n let tableContent = '';\n if (procTraceTableShow) {\n const commandInfos = [];\n commandInfos.push((0, sprintf_js_1.sprintf)('%-12s %-16s %7s %7s %7s %15s %15s %10s %-20s', 'TIME', 'NAME', 'UID', 'PID', 'PPID', 'START TIME', 'DURATION (ms)', 'EXIT CODE', 'FILE NAME + ARGS'));\n for (const command of completedCommands) {\n commandInfos.push((0, sprintf_js_1.sprintf)('%-12s %-16s %7d %7d %7d %15d %15d %10d %s %s', command.ts, command.name, command.uid, command.pid, command.ppid, command.startTime, command.duration, command.exitCode, command.fileName, command.args.join(' ')));\n }\n tableContent = commandInfos.join('\\n');\n }\n ///////////////////////////////////////////////////////////////////////////\n const postContentItems = ['', '### Process Trace'];\n if (procTraceChartShow) {\n postContentItems.push('', `#### Top ${procTraceChartMaxCount} processes with highest duration`, '', '```mermaid' + '\\n' + chartContent + '\\n' + '```');\n }\n if (procTraceTableShow) {\n postContentItems.push('', `#### All processes with detail`, '', '```' + '\\n' + tableContent + '\\n' + '```');\n }\n const postContent = postContentItems.join('\\n');\n logger.info(`Reported process tracer result`);\n return postContent;\n }\n catch (error) {\n logger.error('Unable to report process tracer result');\n logger.error(error);\n return null;\n }\n });\n}\nexports.report = report;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.report = exports.finish = exports.start = void 0;\nconst child_process_1 = require(\"child_process\");\nconst path_1 = __importDefault(require(\"path\"));\nconst axios_1 = __importDefault(require(\"axios\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst logger = __importStar(require(\"./logger\"));\nconst STAT_SERVER_PORT = 7777;\nconst BLACK = '#000000';\nconst WHITE = '#FFFFFF';\nfunction triggerStatCollect() {\n return __awaiter(this, void 0, void 0, function* () {\n logger.debug('Triggering stat collect ...');\n const response = yield axios_1.default.post(`http://localhost:${STAT_SERVER_PORT}/collect`);\n if (logger.isDebugEnabled()) {\n logger.debug(`Triggered stat collect: ${JSON.stringify(response.data)}`);\n }\n });\n}\nfunction reportWorkflowMetrics() {\n return __awaiter(this, void 0, void 0, function* () {\n const theme = core.getInput('theme', { required: false });\n let axisColor = BLACK;\n switch (theme) {\n case 'light':\n axisColor = BLACK;\n break;\n case 'dark':\n axisColor = WHITE;\n break;\n default:\n core.warning(`Invalid theme: ${theme}`);\n }\n const { userLoadX, systemLoadX } = yield getCPUStats();\n const { activeMemoryX, availableMemoryX } = yield getMemoryStats();\n const { networkReadX, networkWriteX } = yield getNetworkStats();\n const { diskReadX, diskWriteX } = yield getDiskStats();\n const cpuLoad = userLoadX && userLoadX.length && systemLoadX && systemLoadX.length\n ? yield getStackedAreaGraph({\n label: 'CPU Load (%)',\n axisColor,\n areas: [\n {\n label: 'User Load',\n color: '#e41a1c99',\n points: userLoadX\n },\n {\n label: 'System Load',\n color: '#ff7f0099',\n points: systemLoadX\n }\n ]\n })\n : null;\n const memoryUsage = activeMemoryX &&\n activeMemoryX.length &&\n availableMemoryX &&\n availableMemoryX.length\n ? yield getStackedAreaGraph({\n label: 'Memory Usage (MB)',\n axisColor,\n areas: [\n {\n label: 'Used',\n color: '#377eb899',\n points: activeMemoryX\n },\n {\n label: 'Free',\n color: '#4daf4a99',\n points: availableMemoryX\n }\n ]\n })\n : null;\n const networkIORead = networkReadX && networkReadX.length\n ? yield getLineGraph({\n label: 'Network I/O Read (MB)',\n axisColor,\n line: {\n label: 'Read',\n color: '#be4d25',\n points: networkReadX\n }\n })\n : null;\n const networkIOWrite = networkWriteX && networkWriteX.length\n ? yield getLineGraph({\n label: 'Network I/O Write (MB)',\n axisColor,\n line: {\n label: 'Write',\n color: '#6c25be',\n points: networkWriteX\n }\n })\n : null;\n const diskIORead = diskReadX && diskReadX.length\n ? yield getLineGraph({\n label: 'Disk I/O Read (MB)',\n axisColor,\n line: {\n label: 'Read',\n color: '#be4d25',\n points: diskReadX\n }\n })\n : null;\n const diskIOWrite = diskWriteX && diskWriteX.length\n ? yield getLineGraph({\n label: 'Disk I/O Write (MB)',\n axisColor,\n line: {\n label: 'Write',\n color: '#6c25be',\n points: diskWriteX\n }\n })\n : null;\n const postContentItems = [];\n if (cpuLoad) {\n postContentItems.push('### CPU Metrics', `![${cpuLoad.id}](${cpuLoad.url})`, '');\n }\n if (memoryUsage) {\n postContentItems.push('### Memory Metrics', `![${memoryUsage.id}](${memoryUsage.url})`, '');\n }\n if ((networkIORead && networkIOWrite) || (diskIORead && diskIOWrite)) {\n postContentItems.push('### IO Metrics', '| | Read | Write |', '|--- |--- |--- |');\n }\n if (networkIORead && networkIOWrite) {\n postContentItems.push(`| Network I/O | ![${networkIORead.id}](${networkIORead.url}) | ![${networkIOWrite.id}](${networkIOWrite.url}) |`);\n }\n if (diskIORead && diskIOWrite) {\n postContentItems.push(`| Disk I/O | ![${diskIORead.id}](${diskIORead.url}) | ![${diskIOWrite.id}](${diskIOWrite.url}) |`);\n }\n return postContentItems.join('\\n');\n });\n}\nfunction getCPUStats() {\n return __awaiter(this, void 0, void 0, function* () {\n const userLoadX = [];\n const systemLoadX = [];\n logger.debug('Getting CPU stats ...');\n const response = yield axios_1.default.get(`http://localhost:${STAT_SERVER_PORT}/cpu`);\n if (logger.isDebugEnabled()) {\n logger.debug(`Got CPU stats: ${JSON.stringify(response.data)}`);\n }\n response.data.forEach((element) => {\n userLoadX.push({\n x: element.time,\n y: element.userLoad && element.userLoad > 0 ? element.userLoad : 0\n });\n systemLoadX.push({\n x: element.time,\n y: element.systemLoad && element.systemLoad > 0 ? element.systemLoad : 0\n });\n });\n return { userLoadX, systemLoadX };\n });\n}\nfunction getMemoryStats() {\n return __awaiter(this, void 0, void 0, function* () {\n const activeMemoryX = [];\n const availableMemoryX = [];\n logger.debug('Getting memory stats ...');\n const response = yield axios_1.default.get(`http://localhost:${STAT_SERVER_PORT}/memory`);\n if (logger.isDebugEnabled()) {\n logger.debug(`Got memory stats: ${JSON.stringify(response.data)}`);\n }\n response.data.forEach((element) => {\n activeMemoryX.push({\n x: element.time,\n y: element.activeMemoryMb && element.activeMemoryMb > 0\n ? element.activeMemoryMb\n : 0\n });\n availableMemoryX.push({\n x: element.time,\n y: element.availableMemoryMb && element.availableMemoryMb > 0\n ? element.availableMemoryMb\n : 0\n });\n });\n return { activeMemoryX, availableMemoryX };\n });\n}\nfunction getNetworkStats() {\n return __awaiter(this, void 0, void 0, function* () {\n const networkReadX = [];\n const networkWriteX = [];\n logger.debug('Getting network stats ...');\n const response = yield axios_1.default.get(`http://localhost:${STAT_SERVER_PORT}/network`);\n if (logger.isDebugEnabled()) {\n logger.debug(`Got network stats: ${JSON.stringify(response.data)}`);\n }\n response.data.forEach((element) => {\n networkReadX.push({\n x: element.time,\n y: element.rxMb && element.rxMb > 0 ? element.rxMb : 0\n });\n networkWriteX.push({\n x: element.time,\n y: element.txMb && element.txMb > 0 ? element.txMb : 0\n });\n });\n return { networkReadX, networkWriteX };\n });\n}\nfunction getDiskStats() {\n return __awaiter(this, void 0, void 0, function* () {\n const diskReadX = [];\n const diskWriteX = [];\n logger.debug('Getting disk stats ...');\n const response = yield axios_1.default.get(`http://localhost:${STAT_SERVER_PORT}/disk`);\n if (logger.isDebugEnabled()) {\n logger.debug(`Got disk stats: ${JSON.stringify(response.data)}`);\n }\n response.data.forEach((element) => {\n diskReadX.push({\n x: element.time,\n y: element.rxMb && element.rxMb > 0 ? element.rxMb : 0\n });\n diskWriteX.push({\n x: element.time,\n y: element.wxMb && element.wxMb > 0 ? element.wxMb : 0\n });\n });\n return { diskReadX, diskWriteX };\n });\n}\nfunction getLineGraph(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const payload = {\n options: {\n width: 1000,\n height: 500,\n xAxis: {\n label: 'Time'\n },\n yAxis: {\n label: options.label\n },\n timeTicks: {\n unit: 'auto'\n }\n },\n lines: [options.line]\n };\n let response = null;\n try {\n response = yield axios_1.default.put('https://api.globadge.com/v1/chartgen/line/time', payload);\n }\n catch (error) {\n logger.error(error);\n logger.error(`getLineGraph ${JSON.stringify(payload)}`);\n }\n return response === null || response === void 0 ? void 0 : response.data;\n });\n}\nfunction getStackedAreaGraph(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const payload = {\n options: {\n width: 1000,\n height: 500,\n xAxis: {\n label: 'Time'\n },\n yAxis: {\n label: options.label\n },\n timeTicks: {\n unit: 'auto'\n }\n },\n areas: options.areas\n };\n let response = null;\n try {\n response = yield axios_1.default.put('https://api.globadge.com/v1/chartgen/stacked-area/time', payload);\n }\n catch (error) {\n logger.error(error);\n logger.error(`getStackedAreaGraph ${JSON.stringify(payload)}`);\n }\n return response === null || response === void 0 ? void 0 : response.data;\n });\n}\n///////////////////////////\nfunction start() {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Starting stat collector ...`);\n try {\n let metricFrequency = 0;\n const metricFrequencyInput = core.getInput('metric_frequency');\n if (metricFrequencyInput) {\n const metricFrequencyVal = parseInt(metricFrequencyInput);\n if (Number.isInteger(metricFrequencyVal)) {\n metricFrequency = metricFrequencyVal * 1000;\n }\n }\n const child = (0, child_process_1.spawn)(process.argv[0], [path_1.default.join(__dirname, '../scw/index.js')], {\n detached: true,\n stdio: 'ignore',\n env: Object.assign(Object.assign({}, process.env), { WORKFLOW_TELEMETRY_STAT_FREQ: metricFrequency\n ? `${metricFrequency}`\n : undefined })\n });\n child.unref();\n logger.info(`Started stat collector`);\n return true;\n }\n catch (error) {\n logger.error('Unable to start stat collector');\n logger.error(error);\n return false;\n }\n });\n}\nexports.start = start;\nfunction finish(currentJob) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Finishing stat collector ...`);\n try {\n // Trigger stat collect, so we will have remaining stats since the latest schedule\n yield triggerStatCollect();\n logger.info(`Finished stat collector`);\n return true;\n }\n catch (error) {\n logger.error('Unable to finish stat collector');\n logger.error(error);\n return false;\n }\n });\n}\nexports.finish = finish;\nfunction report(currentJob) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Reporting stat collector result ...`);\n try {\n const postContent = yield reportWorkflowMetrics();\n logger.info(`Reported stat collector result`);\n return postContent;\n }\n catch (error) {\n logger.error('Unable to report stat collector result');\n logger.error(error);\n return null;\n }\n });\n}\nexports.report = report;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.report = exports.finish = exports.start = void 0;\nconst logger = __importStar(require(\"./logger\"));\nfunction generateTraceChartForSteps(job) {\n let chartContent = '';\n /**\n gantt\n title Build\n dateFormat x\n axisFormat %H:%M:%S\n Set up job : milestone, 1658073446000, 1658073450000\n Collect Workflow Telemetry : 1658073450000, 1658073450000\n Run actions/checkout@v2 : 1658073451000, 1658073453000\n Set up JDK 8 : 1658073453000, 1658073458000\n Build with Maven : 1658073459000, 1658073654000\n Run invalid command : crit, 1658073655000, 1658073654000\n Archive test results : done, 1658073655000, 1658073654000\n Post Set up JDK 8 : 1658073655000, 1658073654000\n Post Run actions/checkout@v2 : 1658073655000, 1658073655000\n */\n chartContent = chartContent.concat('gantt', '\\n');\n chartContent = chartContent.concat('\\t', `title ${job.name}`, '\\n');\n chartContent = chartContent.concat('\\t', `dateFormat x`, '\\n');\n chartContent = chartContent.concat('\\t', `axisFormat %H:%M:%S`, '\\n');\n for (const step of job.steps || []) {\n if (!step.started_at || !step.completed_at) {\n continue;\n }\n chartContent = chartContent.concat('\\t', `${step.name.replace(/:/g, '-')} : `);\n if (step.name === 'Set up job' && step.number === 1) {\n chartContent = chartContent.concat('milestone, ');\n }\n if (step.conclusion === 'failure') {\n // to show red\n chartContent = chartContent.concat('crit, ');\n }\n else if (step.conclusion === 'skipped') {\n // to show grey\n chartContent = chartContent.concat('done, ');\n }\n const startTime = new Date(step.started_at).getTime();\n const finishTime = new Date(step.completed_at).getTime();\n chartContent = chartContent.concat(`${Math.min(startTime, finishTime)}, ${finishTime}`, '\\n');\n }\n const postContentItems = [\n '',\n '### Step Trace',\n '',\n '```mermaid' + '\\n' + chartContent + '\\n' + '```'\n ];\n return postContentItems.join('\\n');\n}\n///////////////////////////\nfunction start() {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Starting step tracer ...`);\n try {\n logger.info(`Started step tracer`);\n return true;\n }\n catch (error) {\n logger.error('Unable to start step tracer');\n logger.error(error);\n return false;\n }\n });\n}\nexports.start = start;\nfunction finish(currentJob) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Finishing step tracer ...`);\n try {\n logger.info(`Finished step tracer`);\n return true;\n }\n catch (error) {\n logger.error('Unable to finish step tracer');\n logger.error(error);\n return false;\n }\n });\n}\nexports.finish = finish;\nfunction report(currentJob) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.info(`Reporting step tracer result ...`);\n if (!currentJob) {\n return null;\n }\n try {\n const postContent = generateTraceChartForSteps(currentJob);\n logger.info(`Reported step tracer result`);\n return postContent;\n }\n catch (error) {\n logger.error('Unable to report step tracer result');\n logger.error(error);\n return null;\n }\n });\n}\nexports.report = report;\n",null,"// Axios v1.1.3 Copyright (c) 2022 Matt Zabriskie and contributors\n'use strict';\n\nconst FormData$1 = require('form-data');\nconst url = require('url');\nconst proxyFromEnv = require('proxy-from-env');\nconst http = require('http');\nconst https = require('https');\nconst followRedirects = require('follow-redirects');\nconst zlib = require('zlib');\nconst stream = require('stream');\nconst EventEmitter = require('events');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nconst FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1);\nconst url__default = /*#__PURE__*/_interopDefaultLegacy(url);\nconst http__default = /*#__PURE__*/_interopDefaultLegacy(http);\nconst https__default = /*#__PURE__*/_interopDefaultLegacy(https);\nconst followRedirects__default = /*#__PURE__*/_interopDefaultLegacy(followRedirects);\nconst zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib);\nconst stream__default = /*#__PURE__*/_interopDefaultLegacy(stream);\nconst EventEmitter__default = /*#__PURE__*/_interopDefaultLegacy(EventEmitter);\n\nfunction bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n};\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n};\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n const pattern = '[object FormData]';\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) ||\n toString.call(thing) === pattern ||\n (isFunction(thing.toString) && thing.toString() === pattern)\n );\n};\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {void}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const result = {};\n const assignValue = (val, key) => {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n };\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n};\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n};\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n};\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n};\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n};\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n};\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n};\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n};\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[_-\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n if (reducer(descriptor, name, obj) !== false) {\n reducedDescriptors[name] = descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n};\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not read-only method \\'' + name + '\\'');\n };\n }\n });\n};\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n };\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n};\n\nconst noop = () => {};\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n};\n\nconst utils = {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber\n};\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype$1 = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype$1, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype$1);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliant(thing) {\n return thing && utils.isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator];\n}\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (FormData__default[\"default\"] || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && isSpecCompliant(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n (utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode$1(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode$1);\n } : encode$1;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nfunction buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nconst transitionalDefaults = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n\nconst URLSearchParams = url__default[\"default\"].URLSearchParams;\n\nconst platform = {\n isNode: true,\n classes: {\n URLSearchParams,\n FormData: FormData__default[\"default\"],\n Blob: typeof Blob !== 'undefined' && Blob || null\n },\n protocols: [ 'http', 'https', 'file', 'data' ]\n};\n\nfunction toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nfunction settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nfunction isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nfunction combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nfunction buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n\nconst VERSION = \"1.1.3\";\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nfunction parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n\nconst DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\\s\\S]*)$/;\n\n/**\n * Parse data uri to a Buffer or Blob\n *\n * @param {String} uri\n * @param {?Boolean} asBlob\n * @param {?Object} options\n * @param {?Function} options.Blob\n *\n * @returns {Buffer|Blob}\n */\nfunction fromDataURI(uri, asBlob, options) {\n const _Blob = options && options.Blob || platform.classes.Blob;\n const protocol = parseProtocol(uri);\n\n if (asBlob === undefined && _Blob) {\n asBlob = true;\n }\n\n if (protocol === 'data') {\n uri = protocol.length ? uri.slice(protocol.length + 1) : uri;\n\n const match = DATA_URL_PATTERN.exec(uri);\n\n if (!match) {\n throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);\n }\n\n const mime = match[1];\n const isBase64 = match[2];\n const body = match[3];\n const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8');\n\n if (asBlob) {\n if (!_Blob) {\n throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);\n }\n\n return new _Blob([buffer], {type: mime});\n }\n\n return buffer;\n }\n\n throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);\n}\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nconst parseHeaders = rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n\nconst $internals = Symbol('internals');\nconst $defaults = Symbol('defaults');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nfunction matchHeaderValue(context, value, header, filter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nfunction AxiosHeaders(headers, defaults) {\n headers && this.set(headers);\n this[$defaults] = defaults || null;\n}\n\nObject.assign(AxiosHeaders.prototype, {\n set: function(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = findKey(self, lHeader);\n\n if (key && _rewrite !== true && (self[key] === false || _rewrite === false)) {\n return;\n }\n\n self[key || _header] = normalizeValue(_value);\n }\n\n if (utils.isPlainObject(header)) {\n utils.forEach(header, (_value, _header) => {\n setHeader(_value, _header, valueOrRewrite);\n });\n } else {\n setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n },\n\n get: function(header, parser) {\n header = normalizeHeader(header);\n\n if (!header) return undefined;\n\n const key = findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n },\n\n has: function(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = findKey(this, header);\n\n return !!(key && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n },\n\n delete: function(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n },\n\n clear: function() {\n return Object.keys(this).forEach(this.delete.bind(this));\n },\n\n normalize: function(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n },\n\n toJSON: function(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(Object.assign({}, this[$defaults] || null, this),\n (value, header) => {\n if (value == null || value === false) return;\n obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value;\n });\n\n return obj;\n }\n});\n\nObject.assign(AxiosHeaders, {\n from: function(thing) {\n if (utils.isString(thing)) {\n return new this(parseHeaders(thing));\n }\n return thing instanceof this ? thing : new this(thing);\n },\n\n accessor: function(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n});\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent']);\n\nutils.freezeMethods(AxiosHeaders.prototype);\nutils.freezeMethods(AxiosHeaders);\n\n/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n const threshold = 1000 / freq;\n let timer = null;\n return function throttled(force, args) {\n const now = Date.now();\n if (force || now - timestamp > threshold) {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n timestamp = now;\n return fn.apply(null, args);\n }\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n timestamp = Date.now();\n return fn.apply(null, args);\n }, threshold - (now - timestamp));\n }\n };\n}\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nconst kInternals = Symbol('internals');\n\nclass AxiosTransformStream extends stream__default[\"default\"].Transform{\n constructor(options) {\n options = utils.toFlatObject(options, {\n maxRate: 0,\n chunkSize: 64 * 1024,\n minChunkSize: 100,\n timeWindow: 500,\n ticksRate: 2,\n samplesCount: 15\n }, null, (prop, source) => {\n return !utils.isUndefined(source[prop]);\n });\n\n super({\n readableHighWaterMark: options.chunkSize\n });\n\n const self = this;\n\n const internals = this[kInternals] = {\n length: options.length,\n timeWindow: options.timeWindow,\n ticksRate: options.ticksRate,\n chunkSize: options.chunkSize,\n maxRate: options.maxRate,\n minChunkSize: options.minChunkSize,\n bytesSeen: 0,\n isCaptured: false,\n notifiedBytesLoaded: 0,\n ts: Date.now(),\n bytes: 0,\n onReadCallback: null\n };\n\n const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);\n\n this.on('newListener', event => {\n if (event === 'progress') {\n if (!internals.isCaptured) {\n internals.isCaptured = true;\n }\n }\n });\n\n let bytesNotified = 0;\n\n internals.updateProgress = throttle(function throttledHandler() {\n const totalBytes = internals.length;\n const bytesTransferred = internals.bytesSeen;\n const progressBytes = bytesTransferred - bytesNotified;\n if (!progressBytes || self.destroyed) return;\n\n const rate = _speedometer(progressBytes);\n\n bytesNotified = bytesTransferred;\n\n process.nextTick(() => {\n self.emit('progress', {\n 'loaded': bytesTransferred,\n 'total': totalBytes,\n 'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined,\n 'bytes': progressBytes,\n 'rate': rate ? rate : undefined,\n 'estimated': rate && totalBytes && bytesTransferred <= totalBytes ?\n (totalBytes - bytesTransferred) / rate : undefined\n });\n });\n }, internals.ticksRate);\n\n const onFinish = () => {\n internals.updateProgress(true);\n };\n\n this.once('end', onFinish);\n this.once('error', onFinish);\n }\n\n _read(size) {\n const internals = this[kInternals];\n\n if (internals.onReadCallback) {\n internals.onReadCallback();\n }\n\n return super._read(size);\n }\n\n _transform(chunk, encoding, callback) {\n const self = this;\n const internals = this[kInternals];\n const maxRate = internals.maxRate;\n\n const readableHighWaterMark = this.readableHighWaterMark;\n\n const timeWindow = internals.timeWindow;\n\n const divider = 1000 / timeWindow;\n const bytesThreshold = (maxRate / divider);\n const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;\n\n function pushChunk(_chunk, _callback) {\n const bytes = Buffer.byteLength(_chunk);\n internals.bytesSeen += bytes;\n internals.bytes += bytes;\n\n if (internals.isCaptured) {\n internals.updateProgress();\n }\n\n if (self.push(_chunk)) {\n process.nextTick(_callback);\n } else {\n internals.onReadCallback = () => {\n internals.onReadCallback = null;\n process.nextTick(_callback);\n };\n }\n }\n\n const transformChunk = (_chunk, _callback) => {\n const chunkSize = Buffer.byteLength(_chunk);\n let chunkRemainder = null;\n let maxChunkSize = readableHighWaterMark;\n let bytesLeft;\n let passed = 0;\n\n if (maxRate) {\n const now = Date.now();\n\n if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) {\n internals.ts = now;\n bytesLeft = bytesThreshold - internals.bytes;\n internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;\n passed = 0;\n }\n\n bytesLeft = bytesThreshold - internals.bytes;\n }\n\n if (maxRate) {\n if (bytesLeft <= 0) {\n // next time window\n return setTimeout(() => {\n _callback(null, _chunk);\n }, timeWindow - passed);\n }\n\n if (bytesLeft < maxChunkSize) {\n maxChunkSize = bytesLeft;\n }\n }\n\n if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) {\n chunkRemainder = _chunk.subarray(maxChunkSize);\n _chunk = _chunk.subarray(0, maxChunkSize);\n }\n\n pushChunk(_chunk, chunkRemainder ? () => {\n process.nextTick(_callback, null, chunkRemainder);\n } : _callback);\n };\n\n transformChunk(chunk, function transformNextChunk(err, _chunk) {\n if (err) {\n return callback(err);\n }\n\n if (_chunk) {\n transformChunk(_chunk, transformNextChunk);\n } else {\n callback(null);\n }\n });\n }\n\n setLength(length) {\n this[kInternals].length = +length;\n return this;\n }\n}\n\nconst isBrotliSupported = utils.isFunction(zlib__default[\"default\"].createBrotliDecompress);\n\nconst {http: httpFollow, https: httpsFollow} = followRedirects__default[\"default\"];\n\nconst isHttps = /https:?/;\n\nconst supportedProtocols = platform.protocols.map(protocol => {\n return protocol + ':';\n});\n\n/**\n * If the proxy or config beforeRedirects functions are defined, call them with the options\n * object.\n *\n * @param {Object} options - The options object that was passed to the request.\n *\n * @returns {Object}\n */\nfunction dispatchBeforeRedirect(options) {\n if (options.beforeRedirects.proxy) {\n options.beforeRedirects.proxy(options);\n }\n if (options.beforeRedirects.config) {\n options.beforeRedirects.config(options);\n }\n}\n\n/**\n * If the proxy or config afterRedirects functions are defined, call them with the options\n *\n * @param {http.ClientRequestArgs} options\n * @param {AxiosProxyConfig} configProxy configuration from Axios options object\n * @param {string} location\n *\n * @returns {http.ClientRequestArgs}\n */\nfunction setProxy(options, configProxy, location) {\n let proxy = configProxy;\n if (!proxy && proxy !== false) {\n const proxyUrl = proxyFromEnv.getProxyForUrl(location);\n if (proxyUrl) {\n proxy = new URL(proxyUrl);\n }\n }\n if (proxy) {\n // Basic proxy authorization\n if (proxy.username) {\n proxy.auth = (proxy.username || '') + ':' + (proxy.password || '');\n }\n\n if (proxy.auth) {\n // Support proxy auth object form\n if (proxy.auth.username || proxy.auth.password) {\n proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');\n }\n const base64 = Buffer\n .from(proxy.auth, 'utf8')\n .toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n\n options.headers.host = options.hostname + (options.port ? ':' + options.port : '');\n const proxyHost = proxy.hostname || proxy.host;\n options.hostname = proxyHost;\n // Replace 'host' since options is not a URL object\n options.host = proxyHost;\n options.port = proxy.port;\n options.path = location;\n if (proxy.protocol) {\n options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`;\n }\n }\n\n options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {\n // Configure proxy for redirected request, passing the original config proxy to apply\n // the exact same logic as if the redirected request was performed by axios directly.\n setProxy(redirectOptions, configProxy, redirectOptions.href);\n };\n}\n\n/*eslint consistent-return:0*/\nfunction httpAdapter(config) {\n return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {\n let data = config.data;\n const responseType = config.responseType;\n const responseEncoding = config.responseEncoding;\n const method = config.method.toUpperCase();\n let isFinished;\n let isDone;\n let rejected = false;\n let req;\n\n // temporary internal emitter until the AxiosRequest class will be implemented\n const emitter = new EventEmitter__default[\"default\"]();\n\n function onFinished() {\n if (isFinished) return;\n isFinished = true;\n\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(abort);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', abort);\n }\n\n emitter.removeAllListeners();\n }\n\n function done(value, isRejected) {\n if (isDone) return;\n\n isDone = true;\n\n if (isRejected) {\n rejected = true;\n onFinished();\n }\n\n isRejected ? rejectPromise(value) : resolvePromise(value);\n }\n\n const resolve = function resolve(value) {\n done(value);\n };\n\n const reject = function reject(value) {\n done(value, true);\n };\n\n function abort(reason) {\n emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);\n }\n\n emitter.once('abort', reject);\n\n if (config.cancelToken || config.signal) {\n config.cancelToken && config.cancelToken.subscribe(abort);\n if (config.signal) {\n config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);\n }\n }\n\n // Parse url\n const fullPath = buildFullPath(config.baseURL, config.url);\n const parsed = new URL(fullPath);\n const protocol = parsed.protocol || supportedProtocols[0];\n\n if (protocol === 'data:') {\n let convertedData;\n\n if (method !== 'GET') {\n return settle(resolve, reject, {\n status: 405,\n statusText: 'method not allowed',\n headers: {},\n config\n });\n }\n\n try {\n convertedData = fromDataURI(config.url, responseType === 'blob', {\n Blob: config.env && config.env.Blob\n });\n } catch (err) {\n throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);\n }\n\n if (responseType === 'text') {\n convertedData = convertedData.toString(responseEncoding);\n\n if (!responseEncoding || responseEncoding === 'utf8') {\n data = utils.stripBOM(convertedData);\n }\n } else if (responseType === 'stream') {\n convertedData = stream__default[\"default\"].Readable.from(convertedData);\n }\n\n return settle(resolve, reject, {\n data: convertedData,\n status: 200,\n statusText: 'OK',\n headers: {},\n config\n });\n }\n\n if (supportedProtocols.indexOf(protocol) === -1) {\n return reject(new AxiosError(\n 'Unsupported protocol ' + protocol,\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n\n const headers = AxiosHeaders.from(config.headers).normalize();\n\n // Set User-Agent (required by some servers)\n // See https://github.com/axios/axios/issues/69\n // User-Agent is specified; handle case where no UA header is desired\n // Only set header if it hasn't been set in config\n headers.set('User-Agent', 'axios/' + VERSION, false);\n\n const onDownloadProgress = config.onDownloadProgress;\n const onUploadProgress = config.onUploadProgress;\n const maxRate = config.maxRate;\n let maxUploadRate = undefined;\n let maxDownloadRate = undefined;\n\n // support for https://www.npmjs.com/package/form-data api\n if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {\n headers.set(data.getHeaders());\n } else if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) ; else if (utils.isArrayBuffer(data)) {\n data = Buffer.from(new Uint8Array(data));\n } else if (utils.isString(data)) {\n data = Buffer.from(data, 'utf-8');\n } else {\n return reject(new AxiosError(\n 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n\n // Add Content-Length header if data exists\n headers.set('Content-Length', data.length, false);\n\n if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {\n return reject(new AxiosError(\n 'Request body larger than maxBodyLength limit',\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n }\n\n const contentLength = +headers.getContentLength();\n\n if (utils.isArray(maxRate)) {\n maxUploadRate = maxRate[0];\n maxDownloadRate = maxRate[1];\n } else {\n maxUploadRate = maxDownloadRate = maxRate;\n }\n\n if (data && (onUploadProgress || maxUploadRate)) {\n if (!utils.isStream(data)) {\n data = stream__default[\"default\"].Readable.from(data, {objectMode: false});\n }\n\n data = stream__default[\"default\"].pipeline([data, new AxiosTransformStream({\n length: utils.toFiniteNumber(contentLength),\n maxRate: utils.toFiniteNumber(maxUploadRate)\n })], utils.noop);\n\n onUploadProgress && data.on('progress', progress => {\n onUploadProgress(Object.assign(progress, {\n upload: true\n }));\n });\n }\n\n // HTTP basic authentication\n let auth = undefined;\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n if (!auth && parsed.username) {\n const urlUsername = parsed.username;\n const urlPassword = parsed.password;\n auth = urlUsername + ':' + urlPassword;\n }\n\n auth && headers.delete('authorization');\n\n let path;\n\n try {\n path = buildURL(\n parsed.pathname + parsed.search,\n config.params,\n config.paramsSerializer\n ).replace(/^\\?/, '');\n } catch (err) {\n const customErr = new Error(err.message);\n customErr.config = config;\n customErr.url = config.url;\n customErr.exists = true;\n return reject(customErr);\n }\n\n headers.set('Accept-Encoding', 'gzip, deflate, br', false);\n\n const options = {\n path,\n method: method,\n headers: headers.toJSON(),\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth,\n protocol,\n beforeRedirect: dispatchBeforeRedirect,\n beforeRedirects: {}\n };\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);\n }\n\n let transport;\n const isHttpsRequest = isHttps.test(options.protocol);\n options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsRequest ? https__default[\"default\"] : http__default[\"default\"];\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n if (config.beforeRedirect) {\n options.beforeRedirects.config = config.beforeRedirect;\n }\n transport = isHttpsRequest ? httpsFollow : httpFollow;\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n } else {\n // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited\n options.maxBodyLength = Infinity;\n }\n\n if (config.insecureHTTPParser) {\n options.insecureHTTPParser = config.insecureHTTPParser;\n }\n\n // Create the request\n req = transport.request(options, function handleResponse(res) {\n if (req.destroyed) return;\n\n const streams = [res];\n\n // uncompress the response body transparently if required\n let responseStream = res;\n\n // return the last request in case of redirects\n const lastRequest = res.req || req;\n\n // if decompress disabled we should not decompress\n if (config.decompress !== false) {\n // if no content, but headers still say that it is encoded,\n // remove the header not confuse downstream operations\n if (data && data.length === 0 && res.headers['content-encoding']) {\n delete res.headers['content-encoding'];\n }\n\n switch (res.headers['content-encoding']) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'compress':\n case 'deflate':\n // add the unzipper to the body stream processing pipeline\n streams.push(zlib__default[\"default\"].createUnzip());\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n case 'br':\n if (isBrotliSupported) {\n streams.push(zlib__default[\"default\"].createBrotliDecompress());\n delete res.headers['content-encoding'];\n }\n }\n }\n\n if (onDownloadProgress) {\n const responseLength = +res.headers['content-length'];\n\n const transformStream = new AxiosTransformStream({\n length: utils.toFiniteNumber(responseLength),\n maxRate: utils.toFiniteNumber(maxDownloadRate)\n });\n\n onDownloadProgress && transformStream.on('progress', progress => {\n onDownloadProgress(Object.assign(progress, {\n download: true\n }));\n });\n\n streams.push(transformStream);\n }\n\n responseStream = streams.length > 1 ? stream__default[\"default\"].pipeline(streams, utils.noop) : streams[0];\n\n const offListeners = stream__default[\"default\"].finished(responseStream, () => {\n offListeners();\n onFinished();\n });\n\n const response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: new AxiosHeaders(res.headers),\n config,\n request: lastRequest\n };\n\n if (responseType === 'stream') {\n response.data = responseStream;\n settle(resolve, reject, response);\n } else {\n const responseBuffer = [];\n let totalResponseBytes = 0;\n\n responseStream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n totalResponseBytes += chunk.length;\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {\n // stream.destroy() emit aborted event before calling reject() on Node.js v16\n rejected = true;\n responseStream.destroy();\n reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE, config, lastRequest));\n }\n });\n\n responseStream.on('aborted', function handlerStreamAborted() {\n if (rejected) {\n return;\n }\n\n const err = new AxiosError(\n 'maxContentLength size of ' + config.maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n lastRequest\n );\n responseStream.destroy(err);\n reject(err);\n });\n\n responseStream.on('error', function handleStreamError(err) {\n if (req.destroyed) return;\n reject(AxiosError.from(err, null, config, lastRequest));\n });\n\n responseStream.on('end', function handleStreamEnd() {\n try {\n let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);\n if (responseType !== 'arraybuffer') {\n responseData = responseData.toString(responseEncoding);\n if (!responseEncoding || responseEncoding === 'utf8') {\n responseData = utils.stripBOM(responseData);\n }\n }\n response.data = responseData;\n } catch (err) {\n reject(AxiosError.from(err, null, config, response.request, response));\n }\n settle(resolve, reject, response);\n });\n }\n\n emitter.once('abort', err => {\n if (!responseStream.destroyed) {\n responseStream.emit('error', err);\n responseStream.destroy();\n }\n });\n });\n\n emitter.once('abort', err => {\n reject(err);\n req.destroy(err);\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n // @todo remove\n // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;\n reject(AxiosError.from(err, null, config, req));\n });\n\n // set tcp keep alive to prevent drop connection by peer\n req.on('socket', function handleRequestSocket(socket) {\n // default interval of sending ack packet is 1 minute\n socket.setKeepAlive(true, 1000 * 60);\n });\n\n // Handle request timeout\n if (config.timeout) {\n // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.\n const timeout = parseInt(config.timeout, 10);\n\n if (isNaN(timeout)) {\n reject(new AxiosError(\n 'error trying to parse `config.timeout` to int',\n AxiosError.ERR_BAD_OPTION_VALUE,\n config,\n req\n ));\n\n return;\n }\n\n // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.\n // And timer callback will be fired, and abort() will be invoked before connection, then get \"socket hang up\" and code ECONNRESET.\n // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.\n // And then these socket which be hang up will devouring CPU little by little.\n // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.\n req.setTimeout(timeout, function handleRequestTimeout() {\n if (isDone) return;\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n req\n ));\n abort();\n });\n }\n\n\n // Send the request\n if (utils.isStream(data)) {\n let ended = false;\n let errored = false;\n\n data.on('end', () => {\n ended = true;\n });\n\n data.once('error', err => {\n errored = true;\n req.destroy(err);\n });\n\n data.on('close', () => {\n if (!ended && !errored) {\n abort(new CanceledError('Request stream has been aborted', config, req));\n }\n });\n\n data.pipe(req);\n } else {\n req.end(data);\n }\n });\n}\n\nconst cookies = platform.isStandardBrowserEnv ?\n\n// Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n const cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n// Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })();\n\nconst isURLSameOrigin = platform.isStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nfunction xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n const responseType = config.responseType;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData) && platform.isStandardBrowserEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (platform.isStandardBrowserEnv) {\n // Add xsrf header\n const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))\n && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n\nconst adapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n};\n\nconst adapters$1 = {\n getAdapter: (nameOrAdapter) => {\n if(utils.isString(nameOrAdapter)){\n const adapter = adapters[nameOrAdapter];\n\n if (!nameOrAdapter) {\n throw Error(\n utils.hasOwnProp(nameOrAdapter) ?\n `Adapter '${nameOrAdapter}' is not available in the build` :\n `Can not resolve adapter '${nameOrAdapter}'`\n );\n }\n\n return adapter\n }\n\n if (!utils.isFunction(nameOrAdapter)) {\n throw new TypeError('adapter is not a function');\n }\n\n return nameOrAdapter;\n },\n adapters\n};\n\nconst DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\n/**\n * If the browser has an XMLHttpRequest object, use the XHR adapter, otherwise use the HTTP\n * adapter\n *\n * @returns {Function}\n */\nfunction getDefaultAdapter() {\n let adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = adapters$1.getAdapter('xhr');\n } else if (typeof process !== 'undefined' && utils.kindOf(process) === 'process') {\n // For node use HTTP adapter\n adapter = adapters$1.getAdapter('http');\n }\n return adapter;\n}\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n if (!hasJSONContentType) {\n return data;\n }\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nfunction transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n\nfunction isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nfunction dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n const adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nfunction mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n const mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'beforeRedirect': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n\nconst validators$1 = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators$1[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators$1.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nconst validator = {\n assertOptions,\n validators: validators$1\n};\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer !== undefined) {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n const defaultHeaders = config.headers && utils.merge(\n config.headers.common,\n config.headers[config.method]\n );\n\n defaultHeaders && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n config.headers = new AxiosHeaders(config.headers, defaultHeaders);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nfunction spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nfunction isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\naxios.formToJSON = thing => {\n return formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n};\n\nmodule.exports = axios;\n//# sourceMappingURL=axios.cjs.map\n","module.exports = require(\"assert\");;","module.exports = require(\"child_process\");;","module.exports = require(\"events\");;","module.exports = require(\"fs\");;","module.exports = require(\"http\");;","module.exports = require(\"https\");;","module.exports = require(\"net\");;","module.exports = require(\"os\");;","module.exports = require(\"path\");;","module.exports = require(\"punycode\");;","module.exports = require(\"readline\");;","module.exports = require(\"stream\");;","module.exports = require(\"tls\");;","module.exports = require(\"tty\");;","module.exports = require(\"url\");;","module.exports = require(\"util\");;","module.exports = require(\"zlib\");;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => module['default'] :\n\t\t() => module;\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\n__webpack_require__.ab = __dirname + \"/\";","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(7051);\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AChVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACljCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClgCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACjNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC9QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACnRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACxQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACvlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACtfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC7LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACnKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AClqDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC3qDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7vBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACxUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7vCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACviCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACjPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClsDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1oCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1uCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC9zBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC1bA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC7vCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5uBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;AClMA;AACA;AACA;A;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACzQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;;;;;;;;;;;;;;;;ACnBA;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;;ACHA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC9LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACtPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACxIA;AACA;AACA;A;;;;;AAFA;AACA;AACA;A;;;;;AAFA;AACA;AACA;A;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;;;A;;;;;;;;A;;;;;;;;A;;;;;;ACrrHA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;;;ACDA;AACA;A;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACNA;AACA;ACDA;AACA;AACA;AACA;;A","sourceRoot":""} \ No newline at end of file diff --git a/src/post.ts b/src/post.ts index 654975a7..8aadcbba 100644 --- a/src/post.ts +++ b/src/post.ts @@ -94,23 +94,44 @@ async function reportAll( } const commentOnPR: string = core.getInput('comment_on_pr') - if (pull_request && 'true' === commentOnPR) { - if (logger.isDebugEnabled()) { - logger.debug(`Found Pull Request: ${JSON.stringify(pull_request)}`) - } + if ('true' === commentOnPR) { + const prNumbers = await getPrNumbers(); + if (prNumbers) { + if (logger.isDebugEnabled()) { + logger.debug(`Found Pull Request: ${JSON.stringify(prNumbers)}`) + } - await octokit.rest.issues.createComment({ - ...github.context.repo, - issue_number: Number(github.context.payload.pull_request?.number), - body: postContent - }) + for (let prNumber of prNumbers) { + await octokit.rest.issues.createComment({ + ...github.context.repo, + issue_number: prNumber, + body: postContent + }) + } + } else { + logger.debug(`Couldn't find Pull Request`) + } } else { - logger.debug(`Couldn't find Pull Request`) + logger.debug(`commentOnPR is false`) } logger.info(`Reporting all content completed`) } +export async function getPrNumbers(): Promise { + if (pull_request) { + return [pull_request.number] + } + + const { data: pullRequests } = await octokit.repos.listPullRequestsAssociatedWithCommit({ + owner: repo.owner, + repo: repo.repo, + commit_sha: sha, + }); + + return pullRequests.filter((pr) => pr.state === "open").map((pr) => pr.number).slice(0, 10); +} + async function run(): Promise { try { logger.info(`Finishing ...`)