From 8464823410592a9c183e728103f0affd623594ea Mon Sep 17 00:00:00 2001 From: gokhan721 <33860737+gokhan721@users.noreply.github.com> Date: Thu, 1 Sep 2022 06:01:06 +0300 Subject: [PATCH] check metric values greater than zero (#21) --- dist/scw/index.js | 20 ++++++++++---------- dist/scw/index.js.map | 2 +- src/statCollectorWorker.ts | 20 ++++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/dist/scw/index.js b/dist/scw/index.js index d364ddb..15c5c17 100644 --- a/dist/scw/index.js +++ b/dist/scw/index.js @@ -37181,19 +37181,19 @@ function collectCPUStats(statTime, timeInterval) { unit: "Percentage", description: "CPU Load Total", name: "cpu.load.total", - value: (data.currentLoad || 0) + value: (data.currentLoad && data.currentLoad > 0 ? data.currentLoad : 0) }, { unit: "Percentage", description: "CPU Load User", name: "cpu.load.user", - value: (data.currentLoadUser || 0) + value: (data.currentLoadUser && data.currentLoadUser > 0 ? data.currentLoadUser : 0) }, { unit: "Percentage", description: "CPU Load System", name: "cpu.load.system", - value: (data.currentLoadSystem || 0) + value: (data.currentLoadSystem && data.currentLoadSystem > 0 ? data.currentLoadSystem : 0) } ]; const cpuStats = { @@ -37220,19 +37220,19 @@ function collectMemoryStats(statTime, timeInterval) { unit: "Mb", description: "Memory Usage Total", name: "memory.usage.total", - value: (data.total || 0) / 1024 / 1024 + value: (data.total && data.total > 0 ? data.total : 0) / 1024 / 1024 }, { unit: "Mb", description: "Memory Usage Active", name: "memory.usage.active", - value: (data.active || 0) / 1024 / 1024 + value: (data.active && data.active > 0 ? data.active : 0) / 1024 / 1024 }, { unit: "Mb", description: "Memory Usage Available", name: "memory.usage.available", - value: (data.available || 0) / 1024 / 1024 + value: (data.available && data.available > 0 ? data.available : 0) / 1024 / 1024 } ]; const memoryStats = { @@ -37256,8 +37256,8 @@ function collectNetworkStats(statTime, timeInterval) { .then((data) => { let totalRxSec = 0, totalTxSec = 0; for (let nsd of data) { - totalRxSec += nsd.rx_sec || 0; - totalTxSec += nsd.tx_sec || 0; + totalRxSec += nsd.rx_sec && nsd.rx_sec > 0 ? nsd.rx_sec : 0; + totalTxSec += nsd.tx_sec && nsd.tx_sec > 0 ? nsd.tx_sec : 0; } const points = [ { @@ -37292,8 +37292,8 @@ function collectDiskStats(statTime, timeInterval) { return systeminformation_1.default .fsStats() .then((data) => { - let rxSec = data.rx_sec ? data.rx_sec : 0; - let wxSec = data.wx_sec ? data.wx_sec : 0; + let rxSec = data.rx_sec && data.rx_sec > 0 ? data.rx_sec : 0; + let wxSec = data.wx_sec && data.wx_sec > 0 ? data.wx_sec : 0; const points = [ { unit: "Mb", diff --git a/dist/scw/index.js.map b/dist/scw/index.js.map index 8d1b781..4992101 100644 --- a/dist/scw/index.js.map +++ b/dist/scw/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../webpack://foresight-workflow-kit-action/./node_modules/@actions/core/lib/command.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/core/lib/core.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/core/lib/file-command.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/core/lib/summary.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/core/lib/utils.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/github/lib/context.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/github/lib/github.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/github/lib/internal/utils.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/github/lib/utils.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/http-client/lib/auth.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/http-client/lib/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/http-client/lib/proxy.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/auth-token/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/core/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/endpoint/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/graphql/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/request-error/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/request/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/async/dist/async.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/index.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/lib/abort.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/lib/async.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/lib/defer.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/lib/iterate.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/lib/state.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/lib/terminator.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/parallel.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/serial.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/serialOrdered.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/index.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/adapters/http.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/adapters/xhr.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/axios.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/cancel/CancelToken.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/cancel/CanceledError.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/cancel/isCancel.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/Axios.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/AxiosError.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/InterceptorManager.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/buildFullPath.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/dispatchRequest.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/mergeConfig.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/settle.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/transformData.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/defaults/env/FormData.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/defaults/index.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/defaults/transitional.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/env/data.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/bind.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/buildURL.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/combineURLs.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/cookies.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/isAbsoluteURL.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/isAxiosError.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/isURLSameOrigin.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/normalizeHeaderName.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/parseHeaders.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/parseProtocol.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/spread.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/toFormData.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/validator.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/utils.js","../webpack://foresight-workflow-kit-action/./node_modules/before-after-hook/index.js","../webpack://foresight-workflow-kit-action/./node_modules/before-after-hook/lib/add.js","../webpack://foresight-workflow-kit-action/./node_modules/before-after-hook/lib/register.js","../webpack://foresight-workflow-kit-action/./node_modules/before-after-hook/lib/remove.js","../webpack://foresight-workflow-kit-action/./node_modules/combined-stream/lib/combined_stream.js","../webpack://foresight-workflow-kit-action/./node_modules/debug/src/browser.js","../webpack://foresight-workflow-kit-action/./node_modules/debug/src/common.js","../webpack://foresight-workflow-kit-action/./node_modules/debug/src/index.js","../webpack://foresight-workflow-kit-action/./node_modules/debug/src/node.js","../webpack://foresight-workflow-kit-action/./node_modules/delayed-stream/lib/delayed_stream.js","../webpack://foresight-workflow-kit-action/./node_modules/deprecation/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/follow-redirects/debug.js","../webpack://foresight-workflow-kit-action/./node_modules/follow-redirects/index.js","../webpack://foresight-workflow-kit-action/./node_modules/form-data/lib/form_data.js","../webpack://foresight-workflow-kit-action/./node_modules/form-data/lib/populate.js","../webpack://foresight-workflow-kit-action/./node_modules/has-flag/index.js","../webpack://foresight-workflow-kit-action/./node_modules/is-plain-object/dist/is-plain-object.js","../webpack://foresight-workflow-kit-action/./node_modules/mime-db/index.js","../webpack://foresight-workflow-kit-action/./node_modules/mime-types/index.js","../webpack://foresight-workflow-kit-action/./node_modules/mkdirp/index.js","../webpack://foresight-workflow-kit-action/./node_modules/ms/index.js","../webpack://foresight-workflow-kit-action/./node_modules/node-fetch/lib/index.js","../webpack://foresight-workflow-kit-action/./node_modules/once/once.js","../webpack://foresight-workflow-kit-action/./node_modules/portfinder/lib/portfinder.js","../webpack://foresight-workflow-kit-action/./node_modules/portfinder/node_modules/debug/src/browser.js","../webpack://foresight-workflow-kit-action/./node_modules/portfinder/node_modules/debug/src/common.js","../webpack://foresight-workflow-kit-action/./node_modules/portfinder/node_modules/debug/src/index.js","../webpack://foresight-workflow-kit-action/./node_modules/portfinder/node_modules/debug/src/node.js","../webpack://foresight-workflow-kit-action/./node_modules/supports-color/index.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/audio.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/battery.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/bluetooth.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/cpu.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/docker.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/dockerSocket.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/filesystem.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/graphics.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/index.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/internet.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/memory.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/network.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/osinfo.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/printer.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/processes.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/system.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/usb.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/users.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/util.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/virtualbox.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/wifi.js","../webpack://foresight-workflow-kit-action/./node_modules/tr46/index.js","../webpack://foresight-workflow-kit-action/./node_modules/tunnel/index.js","../webpack://foresight-workflow-kit-action/./node_modules/tunnel/lib/tunnel.js","../webpack://foresight-workflow-kit-action/./node_modules/universal-user-agent/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/webidl-conversions/lib/index.js","../webpack://foresight-workflow-kit-action/./node_modules/whatwg-url/lib/URL-impl.js","../webpack://foresight-workflow-kit-action/./node_modules/whatwg-url/lib/URL.js","../webpack://foresight-workflow-kit-action/./node_modules/whatwg-url/lib/public-api.js","../webpack://foresight-workflow-kit-action/./node_modules/whatwg-url/lib/url-state-machine.js","../webpack://foresight-workflow-kit-action/./node_modules/whatwg-url/lib/utils.js","../webpack://foresight-workflow-kit-action/./node_modules/wrappy/wrappy.js","../webpack://foresight-workflow-kit-action/./src/logger.ts","../webpack://foresight-workflow-kit-action/./src/statCollectorWorker.ts","../webpack://foresight-workflow-kit-action/./src/utils.ts","../webpack://foresight-workflow-kit-action/./node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack://foresight-workflow-kit-action/external \"assert\"","../webpack://foresight-workflow-kit-action/external \"child_process\"","../webpack://foresight-workflow-kit-action/external \"events\"","../webpack://foresight-workflow-kit-action/external \"fs\"","../webpack://foresight-workflow-kit-action/external \"http\"","../webpack://foresight-workflow-kit-action/external \"https\"","../webpack://foresight-workflow-kit-action/external \"net\"","../webpack://foresight-workflow-kit-action/external \"os\"","../webpack://foresight-workflow-kit-action/external \"path\"","../webpack://foresight-workflow-kit-action/external \"punycode\"","../webpack://foresight-workflow-kit-action/external \"stream\"","../webpack://foresight-workflow-kit-action/external \"tls\"","../webpack://foresight-workflow-kit-action/external \"tty\"","../webpack://foresight-workflow-kit-action/external \"url\"","../webpack://foresight-workflow-kit-action/external \"util\"","../webpack://foresight-workflow-kit-action/external \"zlib\"","../webpack://foresight-workflow-kit-action/webpack/bootstrap","../webpack://foresight-workflow-kit-action/webpack/runtime/node module decorator","../webpack://foresight-workflow-kit-action/webpack/runtime/compat","../webpack://foresight-workflow-kit-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 const delimiter = '_GitHubActionsFileCommandDelimeter_';\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\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.issueCommand('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 return inputs;\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 process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, 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 command_1.issueCommand('save-state', { name }, 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//# 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.issueCommand = 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 utils_1 = require(\"./utils\");\nfunction issueCommand(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.issueCommand = issueCommand;\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 __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) {\n return new utils_1.GitHub(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.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();\nconst 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(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\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","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (factory((global.async = global.async || {})));\n}(this, (function (exports) { 'use strict';\n\nfunction slice(arrayLike, start) {\n start = start|0;\n var newLen = Math.max(arrayLike.length - start, 0);\n var newArr = Array(newLen);\n for(var idx = 0; idx < newLen; idx++) {\n newArr[idx] = arrayLike[start + idx];\n }\n return newArr;\n}\n\n/**\n * Creates a continuation function with some arguments already applied.\n *\n * Useful as a shorthand when combined with other control flow functions. Any\n * arguments passed to the returned function are added to the arguments\n * originally passed to apply.\n *\n * @name apply\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {Function} fn - The function you want to eventually apply all\n * arguments to. Invokes with (arguments...).\n * @param {...*} arguments... - Any number of arguments to automatically apply\n * when the continuation is called.\n * @returns {Function} the partially-applied function\n * @example\n *\n * // using apply\n * async.parallel([\n * async.apply(fs.writeFile, 'testfile1', 'test1'),\n * async.apply(fs.writeFile, 'testfile2', 'test2')\n * ]);\n *\n *\n * // the same process without using apply\n * async.parallel([\n * function(callback) {\n * fs.writeFile('testfile1', 'test1', callback);\n * },\n * function(callback) {\n * fs.writeFile('testfile2', 'test2', callback);\n * }\n * ]);\n *\n * // It's possible to pass any number of additional arguments when calling the\n * // continuation:\n *\n * node> var fn = async.apply(sys.puts, 'one');\n * node> fn('two', 'three');\n * one\n * two\n * three\n */\nvar apply = function(fn/*, ...args*/) {\n var args = slice(arguments, 1);\n return function(/*callArgs*/) {\n var callArgs = slice(arguments);\n return fn.apply(null, args.concat(callArgs));\n };\n};\n\nvar initialParams = function (fn) {\n return function (/*...args, callback*/) {\n var args = slice(arguments);\n var callback = args.pop();\n fn.call(this, args, callback);\n };\n};\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nvar hasSetImmediate = typeof setImmediate === 'function' && setImmediate;\nvar hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';\n\nfunction fallback(fn) {\n setTimeout(fn, 0);\n}\n\nfunction wrap(defer) {\n return function (fn/*, ...args*/) {\n var args = slice(arguments, 1);\n defer(function () {\n fn.apply(null, args);\n });\n };\n}\n\nvar _defer;\n\nif (hasSetImmediate) {\n _defer = setImmediate;\n} else if (hasNextTick) {\n _defer = process.nextTick;\n} else {\n _defer = fallback;\n}\n\nvar setImmediate$1 = wrap(_defer);\n\n/**\n * Take a sync function and make it async, passing its return value to a\n * callback. This is useful for plugging sync functions into a waterfall,\n * series, or other async functions. Any arguments passed to the generated\n * function will be passed to the wrapped function (except for the final\n * callback argument). Errors thrown will be passed to the callback.\n *\n * If the function passed to `asyncify` returns a Promise, that promises's\n * resolved/rejected state will be used to call the callback, rather than simply\n * the synchronous return value.\n *\n * This also means you can asyncify ES2017 `async` functions.\n *\n * @name asyncify\n * @static\n * @memberOf module:Utils\n * @method\n * @alias wrapSync\n * @category Util\n * @param {Function} func - The synchronous function, or Promise-returning\n * function to convert to an {@link AsyncFunction}.\n * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be\n * invoked with `(args..., callback)`.\n * @example\n *\n * // passing a regular synchronous function\n * async.waterfall([\n * async.apply(fs.readFile, filename, \"utf8\"),\n * async.asyncify(JSON.parse),\n * function (data, next) {\n * // data is the result of parsing the text.\n * // If there was a parsing error, it would have been caught.\n * }\n * ], callback);\n *\n * // passing a function returning a promise\n * async.waterfall([\n * async.apply(fs.readFile, filename, \"utf8\"),\n * async.asyncify(function (contents) {\n * return db.model.create(contents);\n * }),\n * function (model, next) {\n * // `model` is the instantiated model object.\n * // If there was an error, this function would be skipped.\n * }\n * ], callback);\n *\n * // es2017 example, though `asyncify` is not needed if your JS environment\n * // supports async functions out of the box\n * var q = async.queue(async.asyncify(async function(file) {\n * var intermediateStep = await processFile(file);\n * return await somePromise(intermediateStep)\n * }));\n *\n * q.push(files);\n */\nfunction asyncify(func) {\n return initialParams(function (args, callback) {\n var result;\n try {\n result = func.apply(this, args);\n } catch (e) {\n return callback(e);\n }\n // if result is Promise object\n if (isObject(result) && typeof result.then === 'function') {\n result.then(function(value) {\n invokeCallback(callback, null, value);\n }, function(err) {\n invokeCallback(callback, err.message ? err : new Error(err));\n });\n } else {\n callback(null, result);\n }\n });\n}\n\nfunction invokeCallback(callback, error, value) {\n try {\n callback(error, value);\n } catch (e) {\n setImmediate$1(rethrow, e);\n }\n}\n\nfunction rethrow(error) {\n throw error;\n}\n\nvar supportsSymbol = typeof Symbol === 'function';\n\nfunction isAsync(fn) {\n return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction';\n}\n\nfunction wrapAsync(asyncFn) {\n return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn;\n}\n\nfunction applyEach$1(eachfn) {\n return function(fns/*, ...args*/) {\n var args = slice(arguments, 1);\n var go = initialParams(function(args, callback) {\n var that = this;\n return eachfn(fns, function (fn, cb) {\n wrapAsync(fn).apply(that, args.concat(cb));\n }, callback);\n });\n if (args.length) {\n return go.apply(this, args);\n }\n else {\n return go;\n }\n };\n}\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Built-in value references. */\nvar Symbol$1 = root.Symbol;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag$1),\n tag = value[symToStringTag$1];\n\n try {\n value[symToStringTag$1] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag$1] = tag;\n } else {\n delete value[symToStringTag$1];\n }\n }\n return result;\n}\n\n/** Used for built-in method references. */\nvar objectProto$1 = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString$1 = objectProto$1.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString$1.call(value);\n}\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]';\nvar undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]';\nvar funcTag = '[object Function]';\nvar genTag = '[object GeneratorFunction]';\nvar proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n// A temporary value used to identify if the loop should be broken.\n// See #1064, #1293\nvar breakLoop = {};\n\n/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nfunction once(fn) {\n return function () {\n if (fn === null) return;\n var callFn = fn;\n fn = null;\n callFn.apply(this, arguments);\n };\n}\n\nvar iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator;\n\nvar getIterator = function (coll) {\n return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol]();\n};\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/** Used for built-in method references. */\nvar objectProto$3 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty$2 = objectProto$3.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto$3.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER$1 = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER$1 : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/** `Object#toString` result references. */\nvar argsTag$1 = '[object Arguments]';\nvar arrayTag = '[object Array]';\nvar boolTag = '[object Boolean]';\nvar dateTag = '[object Date]';\nvar errorTag = '[object Error]';\nvar funcTag$1 = '[object Function]';\nvar mapTag = '[object Map]';\nvar numberTag = '[object Number]';\nvar objectTag = '[object Object]';\nvar regexpTag = '[object RegExp]';\nvar setTag = '[object Set]';\nvar stringTag = '[object String]';\nvar weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]';\nvar dataViewTag = '[object DataView]';\nvar float32Tag = '[object Float32Array]';\nvar float64Tag = '[object Float64Array]';\nvar int8Tag = '[object Int8Array]';\nvar int16Tag = '[object Int16Array]';\nvar int32Tag = '[object Int32Array]';\nvar uint8Tag = '[object Uint8Array]';\nvar uint8ClampedTag = '[object Uint8ClampedArray]';\nvar uint16Tag = '[object Uint16Array]';\nvar uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag$1] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/** Detect free variable `exports`. */\nvar freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports$1 && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/** Used for built-in method references. */\nvar objectProto$2 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty$1 = objectProto$2.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty$1.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/** Used for built-in method references. */\nvar objectProto$5 = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;\n\n return value === proto;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/** Used for built-in method references. */\nvar objectProto$4 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty$3 = objectProto$4.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty$3.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nfunction createArrayIterator(coll) {\n var i = -1;\n var len = coll.length;\n return function next() {\n return ++i < len ? {value: coll[i], key: i} : null;\n }\n}\n\nfunction createES2015Iterator(iterator) {\n var i = -1;\n return function next() {\n var item = iterator.next();\n if (item.done)\n return null;\n i++;\n return {value: item.value, key: i};\n }\n}\n\nfunction createObjectIterator(obj) {\n var okeys = keys(obj);\n var i = -1;\n var len = okeys.length;\n return function next() {\n var key = okeys[++i];\n if (key === '__proto__') {\n return next();\n }\n return i < len ? {value: obj[key], key: key} : null;\n };\n}\n\nfunction iterator(coll) {\n if (isArrayLike(coll)) {\n return createArrayIterator(coll);\n }\n\n var iterator = getIterator(coll);\n return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);\n}\n\nfunction onlyOnce(fn) {\n return function() {\n if (fn === null) throw new Error(\"Callback was already called.\");\n var callFn = fn;\n fn = null;\n callFn.apply(this, arguments);\n };\n}\n\nfunction _eachOfLimit(limit) {\n return function (obj, iteratee, callback) {\n callback = once(callback || noop);\n if (limit <= 0 || !obj) {\n return callback(null);\n }\n var nextElem = iterator(obj);\n var done = false;\n var running = 0;\n var looping = false;\n\n function iterateeCallback(err, value) {\n running -= 1;\n if (err) {\n done = true;\n callback(err);\n }\n else if (value === breakLoop || (done && running <= 0)) {\n done = true;\n return callback(null);\n }\n else if (!looping) {\n replenish();\n }\n }\n\n function replenish () {\n looping = true;\n while (running < limit && !done) {\n var elem = nextElem();\n if (elem === null) {\n done = true;\n if (running <= 0) {\n callback(null);\n }\n return;\n }\n running += 1;\n iteratee(elem.value, elem.key, onlyOnce(iterateeCallback));\n }\n looping = false;\n }\n\n replenish();\n };\n}\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name eachOfLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`. The `key` is the item's key, or index in the case of an\n * array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nfunction eachOfLimit(coll, limit, iteratee, callback) {\n _eachOfLimit(limit)(coll, wrapAsync(iteratee), callback);\n}\n\nfunction doLimit(fn, limit) {\n return function (iterable, iteratee, callback) {\n return fn(iterable, limit, iteratee, callback);\n };\n}\n\n// eachOf implementation optimized for array-likes\nfunction eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback || noop);\n var index = 0,\n completed = 0,\n length = coll.length;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err) {\n callback(err);\n } else if ((++completed === length) || value === breakLoop) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback));\n }\n}\n\n// a generic version of eachOf which can handle array, object, and iterator cases.\nvar eachOfGeneric = doLimit(eachOfLimit, Infinity);\n\n/**\n * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument\n * to the iteratee.\n *\n * @name eachOf\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEachOf\n * @category Collection\n * @see [async.each]{@link module:Collections.each}\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each\n * item in `coll`.\n * The `key` is the item's key, or index in the case of an array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @example\n *\n * var obj = {dev: \"/dev.json\", test: \"/test.json\", prod: \"/prod.json\"};\n * var configs = {};\n *\n * async.forEachOf(obj, function (value, key, callback) {\n * fs.readFile(__dirname + value, \"utf8\", function (err, data) {\n * if (err) return callback(err);\n * try {\n * configs[key] = JSON.parse(data);\n * } catch (e) {\n * return callback(e);\n * }\n * callback();\n * });\n * }, function (err) {\n * if (err) console.error(err.message);\n * // configs is now a map of JSON data\n * doSomethingWith(configs);\n * });\n */\nvar eachOf = function(coll, iteratee, callback) {\n var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric;\n eachOfImplementation(coll, wrapAsync(iteratee), callback);\n};\n\nfunction doParallel(fn) {\n return function (obj, iteratee, callback) {\n return fn(eachOf, obj, wrapAsync(iteratee), callback);\n };\n}\n\nfunction _asyncMap(eachfn, arr, iteratee, callback) {\n callback = callback || noop;\n arr = arr || [];\n var results = [];\n var counter = 0;\n var _iteratee = wrapAsync(iteratee);\n\n eachfn(arr, function (value, _, callback) {\n var index = counter++;\n _iteratee(value, function (err, v) {\n results[index] = v;\n callback(err);\n });\n }, function (err) {\n callback(err, results);\n });\n}\n\n/**\n * Produces a new collection of values by mapping each value in `coll` through\n * the `iteratee` function. The `iteratee` is called with an item from `coll`\n * and a callback for when it has finished processing. Each of these callback\n * takes 2 arguments: an `error`, and the transformed item from `coll`. If\n * `iteratee` passes an error to its callback, the main `callback` (for the\n * `map` function) is immediately called with the error.\n *\n * Note, that since this function applies the `iteratee` to each item in\n * parallel, there is no guarantee that the `iteratee` functions will complete\n * in order. However, the results array will be in the same order as the\n * original `coll`.\n *\n * If `map` is passed an Object, the results will be an Array. The results\n * will roughly be in the order of the original Objects' keys (but this can\n * vary across JavaScript engines).\n *\n * @name map\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an Array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @example\n *\n * async.map(['file1','file2','file3'], fs.stat, function(err, results) {\n * // results is now an array of stats for each file\n * });\n */\nvar map = doParallel(_asyncMap);\n\n/**\n * Applies the provided arguments to each function in the array, calling\n * `callback` after all functions have completed. If you only provide the first\n * argument, `fns`, then it will return a function which lets you pass in the\n * arguments as if it were a single function call. If more arguments are\n * provided, `callback` is required while `args` is still optional.\n *\n * @name applyEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s\n * to all call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {Function} - If only the first argument, `fns`, is provided, it will\n * return a function which lets you pass in the arguments as if it were a single\n * function call. The signature is `(..args, callback)`. If invoked with any\n * arguments, `callback` is required.\n * @example\n *\n * async.applyEach([enableSearch, updateSchema], 'bucket', callback);\n *\n * // partial application example:\n * async.each(\n * buckets,\n * async.applyEach([enableSearch, updateSchema]),\n * callback\n * );\n */\nvar applyEach = applyEach$1(map);\n\nfunction doParallelLimit(fn) {\n return function (obj, limit, iteratee, callback) {\n return fn(_eachOfLimit(limit), obj, wrapAsync(iteratee), callback);\n };\n}\n\n/**\n * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time.\n *\n * @name mapLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the `coll`. Invoked with (err, results).\n */\nvar mapLimit = doParallelLimit(_asyncMap);\n\n/**\n * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time.\n *\n * @name mapSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the `coll`. Invoked with (err, results).\n */\nvar mapSeries = doLimit(mapLimit, 1);\n\n/**\n * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.\n *\n * @name applyEachSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.applyEach]{@link module:ControlFlow.applyEach}\n * @category Control Flow\n * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all\n * call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {Function} - If only the first argument is provided, it will return\n * a function which lets you pass in the arguments as if it were a single\n * function call.\n */\nvar applyEachSeries = applyEach$1(mapSeries);\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\n/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\n/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\n/**\n * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on\n * their requirements. Each function can optionally depend on other functions\n * being completed first, and each function is run as soon as its requirements\n * are satisfied.\n *\n * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence\n * will stop. Further tasks will not execute (so any other functions depending\n * on it will not run), and the main `callback` is immediately called with the\n * error.\n *\n * {@link AsyncFunction}s also receive an object containing the results of functions which\n * have completed so far as the first argument, if they have dependencies. If a\n * task function has no dependencies, it will only be passed a callback.\n *\n * @name auto\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Object} tasks - An object. Each of its properties is either a\n * function or an array of requirements, with the {@link AsyncFunction} itself the last item\n * in the array. The object's key of a property serves as the name of the task\n * defined by that property, i.e. can be used when specifying requirements for\n * other tasks. The function receives one or two arguments:\n * * a `results` object, containing the results of the previously executed\n * functions, only passed if the task has any dependencies,\n * * a `callback(err, result)` function, which must be called when finished,\n * passing an `error` (which can be `null`) and the result of the function's\n * execution.\n * @param {number} [concurrency=Infinity] - An optional `integer` for\n * determining the maximum number of tasks that can be run in parallel. By\n * default, as many as possible.\n * @param {Function} [callback] - An optional callback which is called when all\n * the tasks have been completed. It receives the `err` argument if any `tasks`\n * pass an error to their callback. Results are always returned; however, if an\n * error occurs, no further `tasks` will be performed, and the results object\n * will only contain partial results. Invoked with (err, results).\n * @returns undefined\n * @example\n *\n * async.auto({\n * // this function will just be passed a callback\n * readData: async.apply(fs.readFile, 'data.txt', 'utf-8'),\n * showData: ['readData', function(results, cb) {\n * // results.readData is the file's contents\n * // ...\n * }]\n * }, callback);\n *\n * async.auto({\n * get_data: function(callback) {\n * console.log('in get_data');\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * console.log('in make_folder');\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: ['get_data', 'make_folder', function(results, callback) {\n * console.log('in write_file', JSON.stringify(results));\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(results, callback) {\n * console.log('in email_link', JSON.stringify(results));\n * // once the file is written let's email a link to it...\n * // results.write_file contains the filename returned by write_file.\n * callback(null, {'file':results.write_file, 'email':'user@example.com'});\n * }]\n * }, function(err, results) {\n * console.log('err = ', err);\n * console.log('results = ', results);\n * });\n */\nvar auto = function (tasks, concurrency, callback) {\n if (typeof concurrency === 'function') {\n // concurrency is optional, shift the args.\n callback = concurrency;\n concurrency = null;\n }\n callback = once(callback || noop);\n var keys$$1 = keys(tasks);\n var numTasks = keys$$1.length;\n if (!numTasks) {\n return callback(null);\n }\n if (!concurrency) {\n concurrency = numTasks;\n }\n\n var results = {};\n var runningTasks = 0;\n var hasError = false;\n\n var listeners = Object.create(null);\n\n var readyTasks = [];\n\n // for cycle detection:\n var readyToCheck = []; // tasks that have been identified as reachable\n // without the possibility of returning to an ancestor task\n var uncheckedDependencies = {};\n\n baseForOwn(tasks, function (task, key) {\n if (!isArray(task)) {\n // no dependencies\n enqueueTask(key, [task]);\n readyToCheck.push(key);\n return;\n }\n\n var dependencies = task.slice(0, task.length - 1);\n var remainingDependencies = dependencies.length;\n if (remainingDependencies === 0) {\n enqueueTask(key, task);\n readyToCheck.push(key);\n return;\n }\n uncheckedDependencies[key] = remainingDependencies;\n\n arrayEach(dependencies, function (dependencyName) {\n if (!tasks[dependencyName]) {\n throw new Error('async.auto task `' + key +\n '` has a non-existent dependency `' +\n dependencyName + '` in ' +\n dependencies.join(', '));\n }\n addListener(dependencyName, function () {\n remainingDependencies--;\n if (remainingDependencies === 0) {\n enqueueTask(key, task);\n }\n });\n });\n });\n\n checkForDeadlocks();\n processQueue();\n\n function enqueueTask(key, task) {\n readyTasks.push(function () {\n runTask(key, task);\n });\n }\n\n function processQueue() {\n if (readyTasks.length === 0 && runningTasks === 0) {\n return callback(null, results);\n }\n while(readyTasks.length && runningTasks < concurrency) {\n var run = readyTasks.shift();\n run();\n }\n\n }\n\n function addListener(taskName, fn) {\n var taskListeners = listeners[taskName];\n if (!taskListeners) {\n taskListeners = listeners[taskName] = [];\n }\n\n taskListeners.push(fn);\n }\n\n function taskComplete(taskName) {\n var taskListeners = listeners[taskName] || [];\n arrayEach(taskListeners, function (fn) {\n fn();\n });\n processQueue();\n }\n\n\n function runTask(key, task) {\n if (hasError) return;\n\n var taskCallback = onlyOnce(function(err, result) {\n runningTasks--;\n if (arguments.length > 2) {\n result = slice(arguments, 1);\n }\n if (err) {\n var safeResults = {};\n baseForOwn(results, function(val, rkey) {\n safeResults[rkey] = val;\n });\n safeResults[key] = result;\n hasError = true;\n listeners = Object.create(null);\n\n callback(err, safeResults);\n } else {\n results[key] = result;\n taskComplete(key);\n }\n });\n\n runningTasks++;\n var taskFn = wrapAsync(task[task.length - 1]);\n if (task.length > 1) {\n taskFn(results, taskCallback);\n } else {\n taskFn(taskCallback);\n }\n }\n\n function checkForDeadlocks() {\n // Kahn's algorithm\n // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm\n // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html\n var currentTask;\n var counter = 0;\n while (readyToCheck.length) {\n currentTask = readyToCheck.pop();\n counter++;\n arrayEach(getDependents(currentTask), function (dependent) {\n if (--uncheckedDependencies[dependent] === 0) {\n readyToCheck.push(dependent);\n }\n });\n }\n\n if (counter !== numTasks) {\n throw new Error(\n 'async.auto cannot execute tasks due to a recursive dependency'\n );\n }\n }\n\n function getDependents(taskName) {\n var result = [];\n baseForOwn(tasks, function (task, key) {\n if (isArray(task) && baseIndexOf(task, taskName, 0) >= 0) {\n result.push(key);\n }\n });\n return result;\n }\n};\n\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol$1 ? Symbol$1.prototype : undefined;\nvar symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\nfunction charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n}\n\n/**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\nfunction charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n}\n\n/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\n/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff';\nvar rsComboMarksRange = '\\\\u0300-\\\\u036f';\nvar reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f';\nvar rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff';\nvar rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;\nvar rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\n/** Used to compose unicode character classes. */\nvar rsAstralRange$1 = '\\\\ud800-\\\\udfff';\nvar rsComboMarksRange$1 = '\\\\u0300-\\\\u036f';\nvar reComboHalfMarksRange$1 = '\\\\ufe20-\\\\ufe2f';\nvar rsComboSymbolsRange$1 = '\\\\u20d0-\\\\u20ff';\nvar rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;\nvar rsVarRange$1 = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange$1 + ']';\nvar rsCombo = '[' + rsComboRange$1 + ']';\nvar rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]';\nvar rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')';\nvar rsNonAstral = '[^' + rsAstralRange$1 + ']';\nvar rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}';\nvar rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]';\nvar rsZWJ$1 = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?';\nvar rsOptVar = '[' + rsVarRange$1 + ']?';\nvar rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*';\nvar rsSeq = rsOptVar + reOptMod + rsOptJoin;\nvar rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/**\n * Removes leading and trailing whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trim(' abc ');\n * // => 'abc'\n *\n * _.trim('-_-abc-_-', '_-');\n * // => 'abc'\n *\n * _.map([' foo ', ' bar '], _.trim);\n * // => ['foo', 'bar']\n */\nfunction trim(string, chars, guard) {\n string = toString(string);\n if (string && (guard || chars === undefined)) {\n return string.replace(reTrim, '');\n }\n if (!string || !(chars = baseToString(chars))) {\n return string;\n }\n var strSymbols = stringToArray(string),\n chrSymbols = stringToArray(chars),\n start = charsStartIndex(strSymbols, chrSymbols),\n end = charsEndIndex(strSymbols, chrSymbols) + 1;\n\n return castSlice(strSymbols, start, end).join('');\n}\n\nvar FN_ARGS = /^(?:async\\s+)?(function)?\\s*[^\\(]*\\(\\s*([^\\)]*)\\)/m;\nvar FN_ARG_SPLIT = /,/;\nvar FN_ARG = /(=.+)?(\\s*)$/;\nvar STRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/mg;\n\nfunction parseParams(func) {\n func = func.toString().replace(STRIP_COMMENTS, '');\n func = func.match(FN_ARGS)[2].replace(' ', '');\n func = func ? func.split(FN_ARG_SPLIT) : [];\n func = func.map(function (arg){\n return trim(arg.replace(FN_ARG, ''));\n });\n return func;\n}\n\n/**\n * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent\n * tasks are specified as parameters to the function, after the usual callback\n * parameter, with the parameter names matching the names of the tasks it\n * depends on. This can provide even more readable task graphs which can be\n * easier to maintain.\n *\n * If a final callback is specified, the task results are similarly injected,\n * specified as named parameters after the initial error parameter.\n *\n * The autoInject function is purely syntactic sugar and its semantics are\n * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.\n *\n * @name autoInject\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.auto]{@link module:ControlFlow.auto}\n * @category Control Flow\n * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of\n * the form 'func([dependencies...], callback). The object's key of a property\n * serves as the name of the task defined by that property, i.e. can be used\n * when specifying requirements for other tasks.\n * * The `callback` parameter is a `callback(err, result)` which must be called\n * when finished, passing an `error` (which can be `null`) and the result of\n * the function's execution. The remaining parameters name other tasks on\n * which the task is dependent, and the results from those tasks are the\n * arguments of those parameters.\n * @param {Function} [callback] - An optional callback which is called when all\n * the tasks have been completed. It receives the `err` argument if any `tasks`\n * pass an error to their callback, and a `results` object with any completed\n * task results, similar to `auto`.\n * @example\n *\n * // The example from `auto` can be rewritten as follows:\n * async.autoInject({\n * get_data: function(callback) {\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: function(get_data, make_folder, callback) {\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * },\n * email_link: function(write_file, callback) {\n * // once the file is written let's email a link to it...\n * // write_file contains the filename returned by write_file.\n * callback(null, {'file':write_file, 'email':'user@example.com'});\n * }\n * }, function(err, results) {\n * console.log('err = ', err);\n * console.log('email_link = ', results.email_link);\n * });\n *\n * // If you are using a JS minifier that mangles parameter names, `autoInject`\n * // will not work with plain functions, since the parameter names will be\n * // collapsed to a single letter identifier. To work around this, you can\n * // explicitly specify the names of the parameters your task function needs\n * // in an array, similar to Angular.js dependency injection.\n *\n * // This still has an advantage over plain `auto`, since the results a task\n * // depends on are still spread into arguments.\n * async.autoInject({\n * //...\n * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(write_file, callback) {\n * callback(null, {'file':write_file, 'email':'user@example.com'});\n * }]\n * //...\n * }, function(err, results) {\n * console.log('err = ', err);\n * console.log('email_link = ', results.email_link);\n * });\n */\nfunction autoInject(tasks, callback) {\n var newTasks = {};\n\n baseForOwn(tasks, function (taskFn, key) {\n var params;\n var fnIsAsync = isAsync(taskFn);\n var hasNoDeps =\n (!fnIsAsync && taskFn.length === 1) ||\n (fnIsAsync && taskFn.length === 0);\n\n if (isArray(taskFn)) {\n params = taskFn.slice(0, -1);\n taskFn = taskFn[taskFn.length - 1];\n\n newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);\n } else if (hasNoDeps) {\n // no dependencies, use the function as-is\n newTasks[key] = taskFn;\n } else {\n params = parseParams(taskFn);\n if (taskFn.length === 0 && !fnIsAsync && params.length === 0) {\n throw new Error(\"autoInject task functions require explicit parameters.\");\n }\n\n // remove callback param\n if (!fnIsAsync) params.pop();\n\n newTasks[key] = params.concat(newTask);\n }\n\n function newTask(results, taskCb) {\n var newArgs = arrayMap(params, function (name) {\n return results[name];\n });\n newArgs.push(taskCb);\n wrapAsync(taskFn).apply(null, newArgs);\n }\n });\n\n auto(newTasks, callback);\n}\n\n// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation\n// used for queues. This implementation assumes that the node provided by the user can be modified\n// to adjust the next and last properties. We implement only the minimal functionality\n// for queue support.\nfunction DLL() {\n this.head = this.tail = null;\n this.length = 0;\n}\n\nfunction setInitial(dll, node) {\n dll.length = 1;\n dll.head = dll.tail = node;\n}\n\nDLL.prototype.removeLink = function(node) {\n if (node.prev) node.prev.next = node.next;\n else this.head = node.next;\n if (node.next) node.next.prev = node.prev;\n else this.tail = node.prev;\n\n node.prev = node.next = null;\n this.length -= 1;\n return node;\n};\n\nDLL.prototype.empty = function () {\n while(this.head) this.shift();\n return this;\n};\n\nDLL.prototype.insertAfter = function(node, newNode) {\n newNode.prev = node;\n newNode.next = node.next;\n if (node.next) node.next.prev = newNode;\n else this.tail = newNode;\n node.next = newNode;\n this.length += 1;\n};\n\nDLL.prototype.insertBefore = function(node, newNode) {\n newNode.prev = node.prev;\n newNode.next = node;\n if (node.prev) node.prev.next = newNode;\n else this.head = newNode;\n node.prev = newNode;\n this.length += 1;\n};\n\nDLL.prototype.unshift = function(node) {\n if (this.head) this.insertBefore(this.head, node);\n else setInitial(this, node);\n};\n\nDLL.prototype.push = function(node) {\n if (this.tail) this.insertAfter(this.tail, node);\n else setInitial(this, node);\n};\n\nDLL.prototype.shift = function() {\n return this.head && this.removeLink(this.head);\n};\n\nDLL.prototype.pop = function() {\n return this.tail && this.removeLink(this.tail);\n};\n\nDLL.prototype.toArray = function () {\n var arr = Array(this.length);\n var curr = this.head;\n for(var idx = 0; idx < this.length; idx++) {\n arr[idx] = curr.data;\n curr = curr.next;\n }\n return arr;\n};\n\nDLL.prototype.remove = function (testFn) {\n var curr = this.head;\n while(!!curr) {\n var next = curr.next;\n if (testFn(curr)) {\n this.removeLink(curr);\n }\n curr = next;\n }\n return this;\n};\n\nfunction queue(worker, concurrency, payload) {\n if (concurrency == null) {\n concurrency = 1;\n }\n else if(concurrency === 0) {\n throw new Error('Concurrency must not be zero');\n }\n\n var _worker = wrapAsync(worker);\n var numRunning = 0;\n var workersList = [];\n\n var processingScheduled = false;\n function _insert(data, insertAtFront, callback) {\n if (callback != null && typeof callback !== 'function') {\n throw new Error('task callback must be a function');\n }\n q.started = true;\n if (!isArray(data)) {\n data = [data];\n }\n if (data.length === 0 && q.idle()) {\n // call drain immediately if there are no tasks\n return setImmediate$1(function() {\n q.drain();\n });\n }\n\n for (var i = 0, l = data.length; i < l; i++) {\n var item = {\n data: data[i],\n callback: callback || noop\n };\n\n if (insertAtFront) {\n q._tasks.unshift(item);\n } else {\n q._tasks.push(item);\n }\n }\n\n if (!processingScheduled) {\n processingScheduled = true;\n setImmediate$1(function() {\n processingScheduled = false;\n q.process();\n });\n }\n }\n\n function _next(tasks) {\n return function(err){\n numRunning -= 1;\n\n for (var i = 0, l = tasks.length; i < l; i++) {\n var task = tasks[i];\n\n var index = baseIndexOf(workersList, task, 0);\n if (index === 0) {\n workersList.shift();\n } else if (index > 0) {\n workersList.splice(index, 1);\n }\n\n task.callback.apply(task, arguments);\n\n if (err != null) {\n q.error(err, task.data);\n }\n }\n\n if (numRunning <= (q.concurrency - q.buffer) ) {\n q.unsaturated();\n }\n\n if (q.idle()) {\n q.drain();\n }\n q.process();\n };\n }\n\n var isProcessing = false;\n var q = {\n _tasks: new DLL(),\n concurrency: concurrency,\n payload: payload,\n saturated: noop,\n unsaturated:noop,\n buffer: concurrency / 4,\n empty: noop,\n drain: noop,\n error: noop,\n started: false,\n paused: false,\n push: function (data, callback) {\n _insert(data, false, callback);\n },\n kill: function () {\n q.drain = noop;\n q._tasks.empty();\n },\n unshift: function (data, callback) {\n _insert(data, true, callback);\n },\n remove: function (testFn) {\n q._tasks.remove(testFn);\n },\n process: function () {\n // Avoid trying to start too many processing operations. This can occur\n // when callbacks resolve synchronously (#1267).\n if (isProcessing) {\n return;\n }\n isProcessing = true;\n while(!q.paused && numRunning < q.concurrency && q._tasks.length){\n var tasks = [], data = [];\n var l = q._tasks.length;\n if (q.payload) l = Math.min(l, q.payload);\n for (var i = 0; i < l; i++) {\n var node = q._tasks.shift();\n tasks.push(node);\n workersList.push(node);\n data.push(node.data);\n }\n\n numRunning += 1;\n\n if (q._tasks.length === 0) {\n q.empty();\n }\n\n if (numRunning === q.concurrency) {\n q.saturated();\n }\n\n var cb = onlyOnce(_next(tasks));\n _worker(data, cb);\n }\n isProcessing = false;\n },\n length: function () {\n return q._tasks.length;\n },\n running: function () {\n return numRunning;\n },\n workersList: function () {\n return workersList;\n },\n idle: function() {\n return q._tasks.length + numRunning === 0;\n },\n pause: function () {\n q.paused = true;\n },\n resume: function () {\n if (q.paused === false) { return; }\n q.paused = false;\n setImmediate$1(q.process);\n }\n };\n return q;\n}\n\n/**\n * A cargo of tasks for the worker function to complete. Cargo inherits all of\n * the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}.\n * @typedef {Object} CargoObject\n * @memberOf module:ControlFlow\n * @property {Function} length - A function returning the number of items\n * waiting to be processed. Invoke like `cargo.length()`.\n * @property {number} payload - An `integer` for determining how many tasks\n * should be process per round. This property can be changed after a `cargo` is\n * created to alter the payload on-the-fly.\n * @property {Function} push - Adds `task` to the `queue`. The callback is\n * called once the `worker` has finished processing the task. Instead of a\n * single task, an array of `tasks` can be submitted. The respective callback is\n * used for every task in the list. Invoke like `cargo.push(task, [callback])`.\n * @property {Function} saturated - A callback that is called when the\n * `queue.length()` hits the concurrency and further tasks will be queued.\n * @property {Function} empty - A callback that is called when the last item\n * from the `queue` is given to a `worker`.\n * @property {Function} drain - A callback that is called when the last item\n * from the `queue` has returned from the `worker`.\n * @property {Function} idle - a function returning false if there are items\n * waiting or being processed, or true if not. Invoke like `cargo.idle()`.\n * @property {Function} pause - a function that pauses the processing of tasks\n * until `resume()` is called. Invoke like `cargo.pause()`.\n * @property {Function} resume - a function that resumes the processing of\n * queued tasks when the queue is paused. Invoke like `cargo.resume()`.\n * @property {Function} kill - a function that removes the `drain` callback and\n * empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`.\n */\n\n/**\n * Creates a `cargo` object with the specified payload. Tasks added to the\n * cargo will be processed altogether (up to the `payload` limit). If the\n * `worker` is in progress, the task is queued until it becomes available. Once\n * the `worker` has completed some tasks, each callback of those tasks is\n * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)\n * for how `cargo` and `queue` work.\n *\n * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers\n * at a time, cargo passes an array of tasks to a single worker, repeating\n * when the worker is finished.\n *\n * @name cargo\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @category Control Flow\n * @param {AsyncFunction} worker - An asynchronous function for processing an array\n * of queued tasks. Invoked with `(tasks, callback)`.\n * @param {number} [payload=Infinity] - An optional `integer` for determining\n * how many tasks should be processed per round; if omitted, the default is\n * unlimited.\n * @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can\n * attached as certain properties to listen for specific events during the\n * lifecycle of the cargo and inner queue.\n * @example\n *\n * // create a cargo object with payload 2\n * var cargo = async.cargo(function(tasks, callback) {\n * for (var i=0; i true\n */\nfunction identity(value) {\n return value;\n}\n\nfunction _createTester(check, getResult) {\n return function(eachfn, arr, iteratee, cb) {\n cb = cb || noop;\n var testPassed = false;\n var testResult;\n eachfn(arr, function(value, _, callback) {\n iteratee(value, function(err, result) {\n if (err) {\n callback(err);\n } else if (check(result) && !testResult) {\n testPassed = true;\n testResult = getResult(true, value);\n callback(null, breakLoop);\n } else {\n callback();\n }\n });\n }, function(err) {\n if (err) {\n cb(err);\n } else {\n cb(null, testPassed ? testResult : getResult(false));\n }\n });\n };\n}\n\nfunction _findGetResult(v, x) {\n return x;\n}\n\n/**\n * Returns the first value in `coll` that passes an async truth test. The\n * `iteratee` is applied in parallel, meaning the first iteratee to return\n * `true` will fire the detect `callback` with that result. That means the\n * result might not be the first item in the original `coll` (in terms of order)\n * that passes the test.\n\n * If order within the original `coll` is important, then look at\n * [`detectSeries`]{@link module:Collections.detectSeries}.\n *\n * @name detect\n * @static\n * @memberOf module:Collections\n * @method\n * @alias find\n * @category Collections\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n * @example\n *\n * async.detect(['file1','file2','file3'], function(filePath, callback) {\n * fs.access(filePath, function(err) {\n * callback(null, !err)\n * });\n * }, function(err, result) {\n * // result now equals the first file in the list that exists\n * });\n */\nvar detect = doParallel(_createTester(identity, _findGetResult));\n\n/**\n * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name detectLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.detect]{@link module:Collections.detect}\n * @alias findLimit\n * @category Collections\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n */\nvar detectLimit = doParallelLimit(_createTester(identity, _findGetResult));\n\n/**\n * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.\n *\n * @name detectSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.detect]{@link module:Collections.detect}\n * @alias findSeries\n * @category Collections\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n */\nvar detectSeries = doLimit(detectLimit, 1);\n\nfunction consoleFunc(name) {\n return function (fn/*, ...args*/) {\n var args = slice(arguments, 1);\n args.push(function (err/*, ...args*/) {\n var args = slice(arguments, 1);\n if (typeof console === 'object') {\n if (err) {\n if (console.error) {\n console.error(err);\n }\n } else if (console[name]) {\n arrayEach(args, function (x) {\n console[name](x);\n });\n }\n }\n });\n wrapAsync(fn).apply(null, args);\n };\n}\n\n/**\n * Logs the result of an [`async` function]{@link AsyncFunction} to the\n * `console` using `console.dir` to display the properties of the resulting object.\n * Only works in Node.js or in browsers that support `console.dir` and\n * `console.error` (such as FF and Chrome).\n * If multiple arguments are returned from the async function,\n * `console.dir` is called on each argument in order.\n *\n * @name dir\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} function - The function you want to eventually apply\n * all arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n * setTimeout(function() {\n * callback(null, {hello: name});\n * }, 1000);\n * };\n *\n * // in the node repl\n * node> async.dir(hello, 'world');\n * {hello: 'world'}\n */\nvar dir = consoleFunc('dir');\n\n/**\n * The post-check version of [`during`]{@link module:ControlFlow.during}. To reflect the difference in\n * the order of operations, the arguments `test` and `fn` are switched.\n *\n * Also a version of [`doWhilst`]{@link module:ControlFlow.doWhilst} with asynchronous `test` function.\n * @name doDuring\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.during]{@link module:ControlFlow.during}\n * @category Control Flow\n * @param {AsyncFunction} fn - An async function which is called each time\n * `test` passes. Invoked with (callback).\n * @param {AsyncFunction} test - asynchronous truth test to perform before each\n * execution of `fn`. Invoked with (...args, callback), where `...args` are the\n * non-error args from the previous callback of `fn`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `fn` has stopped. `callback`\n * will be passed an error if one occurred, otherwise `null`.\n */\nfunction doDuring(fn, test, callback) {\n callback = onlyOnce(callback || noop);\n var _fn = wrapAsync(fn);\n var _test = wrapAsync(test);\n\n function next(err/*, ...args*/) {\n if (err) return callback(err);\n var args = slice(arguments, 1);\n args.push(check);\n _test.apply(this, args);\n }\n\n function check(err, truth) {\n if (err) return callback(err);\n if (!truth) return callback(null);\n _fn(next);\n }\n\n check(null, true);\n\n}\n\n/**\n * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in\n * the order of operations, the arguments `test` and `iteratee` are switched.\n *\n * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n *\n * @name doWhilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - A function which is called each time `test`\n * passes. Invoked with (callback).\n * @param {Function} test - synchronous truth test to perform after each\n * execution of `iteratee`. Invoked with any non-error callback results of\n * `iteratee`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped.\n * `callback` will be passed an error and any arguments passed to the final\n * `iteratee`'s callback. Invoked with (err, [results]);\n */\nfunction doWhilst(iteratee, test, callback) {\n callback = onlyOnce(callback || noop);\n var _iteratee = wrapAsync(iteratee);\n var next = function(err/*, ...args*/) {\n if (err) return callback(err);\n var args = slice(arguments, 1);\n if (test.apply(this, args)) return _iteratee(next);\n callback.apply(null, [null].concat(args));\n };\n _iteratee(next);\n}\n\n/**\n * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the\n * argument ordering differs from `until`.\n *\n * @name doUntil\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.doWhilst]{@link module:ControlFlow.doWhilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` fails. Invoked with (callback).\n * @param {Function} test - synchronous truth test to perform after each\n * execution of `iteratee`. Invoked with any non-error callback results of\n * `iteratee`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n */\nfunction doUntil(iteratee, test, callback) {\n doWhilst(iteratee, function() {\n return !test.apply(this, arguments);\n }, callback);\n}\n\n/**\n * Like [`whilst`]{@link module:ControlFlow.whilst}, except the `test` is an asynchronous function that\n * is passed a callback in the form of `function (err, truth)`. If error is\n * passed to `test` or `fn`, the main callback is immediately called with the\n * value of the error.\n *\n * @name during\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} test - asynchronous truth test to perform before each\n * execution of `fn`. Invoked with (callback).\n * @param {AsyncFunction} fn - An async function which is called each time\n * `test` passes. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `fn` has stopped. `callback`\n * will be passed an error, if one occurred, otherwise `null`.\n * @example\n *\n * var count = 0;\n *\n * async.during(\n * function (callback) {\n * return callback(null, count < 5);\n * },\n * function (callback) {\n * count++;\n * setTimeout(callback, 1000);\n * },\n * function (err) {\n * // 5 seconds have passed\n * }\n * );\n */\nfunction during(test, fn, callback) {\n callback = onlyOnce(callback || noop);\n var _fn = wrapAsync(fn);\n var _test = wrapAsync(test);\n\n function next(err) {\n if (err) return callback(err);\n _test(check);\n }\n\n function check(err, truth) {\n if (err) return callback(err);\n if (!truth) return callback(null);\n _fn(next);\n }\n\n _test(check);\n}\n\nfunction _withoutIndex(iteratee) {\n return function (value, index, callback) {\n return iteratee(value, callback);\n };\n}\n\n/**\n * Applies the function `iteratee` to each item in `coll`, in parallel.\n * The `iteratee` is called with an item from the list, and a callback for when\n * it has finished. If the `iteratee` passes an error to its `callback`, the\n * main `callback` (for the `each` function) is immediately called with the\n * error.\n *\n * Note, that since this function applies `iteratee` to each item in parallel,\n * there is no guarantee that the iteratee functions will complete in order.\n *\n * @name each\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEach\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to\n * each item in `coll`. Invoked with (item, callback).\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOf`.\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @example\n *\n * // assuming openFiles is an array of file names and saveFile is a function\n * // to save the modified contents of that file:\n *\n * async.each(openFiles, saveFile, function(err){\n * // if any of the saves produced an error, err would equal that error\n * });\n *\n * // assuming openFiles is an array of file names\n * async.each(openFiles, function(file, callback) {\n *\n * // Perform operation on file here.\n * console.log('Processing file ' + file);\n *\n * if( file.length > 32 ) {\n * console.log('This file name is too long');\n * callback('File name too long');\n * } else {\n * // Do work to process file here\n * console.log('File processed');\n * callback();\n * }\n * }, function(err) {\n * // if any of the file processing produced an error, err would equal that error\n * if( err ) {\n * // One of the iterations produced an error.\n * // All processing will now stop.\n * console.log('A file failed to process');\n * } else {\n * console.log('All files have been processed successfully');\n * }\n * });\n */\nfunction eachLimit(coll, iteratee, callback) {\n eachOf(coll, _withoutIndex(wrapAsync(iteratee)), callback);\n}\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.\n *\n * @name eachLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfLimit`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nfunction eachLimit$1(coll, limit, iteratee, callback) {\n _eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback);\n}\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.\n *\n * @name eachSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachSeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfSeries`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nvar eachSeries = doLimit(eachLimit$1, 1);\n\n/**\n * Wrap an async function and ensure it calls its callback on a later tick of\n * the event loop. If the function already calls its callback on a next tick,\n * no extra deferral is added. This is useful for preventing stack overflows\n * (`RangeError: Maximum call stack size exceeded`) and generally keeping\n * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)\n * contained. ES2017 `async` functions are returned as-is -- they are immune\n * to Zalgo's corrupting influences, as they always resolve on a later tick.\n *\n * @name ensureAsync\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - an async function, one that expects a node-style\n * callback as its last argument.\n * @returns {AsyncFunction} Returns a wrapped function with the exact same call\n * signature as the function passed in.\n * @example\n *\n * function sometimesAsync(arg, callback) {\n * if (cache[arg]) {\n * return callback(null, cache[arg]); // this would be synchronous!!\n * } else {\n * doSomeIO(arg, callback); // this IO would be asynchronous\n * }\n * }\n *\n * // this has a risk of stack overflows if many results are cached in a row\n * async.mapSeries(args, sometimesAsync, done);\n *\n * // this will defer sometimesAsync's callback if necessary,\n * // preventing stack overflows\n * async.mapSeries(args, async.ensureAsync(sometimesAsync), done);\n */\nfunction ensureAsync(fn) {\n if (isAsync(fn)) return fn;\n return initialParams(function (args, callback) {\n var sync = true;\n args.push(function () {\n var innerArgs = arguments;\n if (sync) {\n setImmediate$1(function () {\n callback.apply(null, innerArgs);\n });\n } else {\n callback.apply(null, innerArgs);\n }\n });\n fn.apply(this, args);\n sync = false;\n });\n}\n\nfunction notId(v) {\n return !v;\n}\n\n/**\n * Returns `true` if every element in `coll` satisfies an async test. If any\n * iteratee call returns `false`, the main `callback` is immediately called.\n *\n * @name every\n * @static\n * @memberOf module:Collections\n * @method\n * @alias all\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n * @example\n *\n * async.every(['file1','file2','file3'], function(filePath, callback) {\n * fs.access(filePath, function(err) {\n * callback(null, !err)\n * });\n * }, function(err, result) {\n * // if result is true then every file exists\n * });\n */\nvar every = doParallel(_createTester(notId, notId));\n\n/**\n * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.\n *\n * @name everyLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.every]{@link module:Collections.every}\n * @alias allLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n */\nvar everyLimit = doParallelLimit(_createTester(notId, notId));\n\n/**\n * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.\n *\n * @name everySeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.every]{@link module:Collections.every}\n * @alias allSeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in series.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n */\nvar everySeries = doLimit(everyLimit, 1);\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nfunction filterArray(eachfn, arr, iteratee, callback) {\n var truthValues = new Array(arr.length);\n eachfn(arr, function (x, index, callback) {\n iteratee(x, function (err, v) {\n truthValues[index] = !!v;\n callback(err);\n });\n }, function (err) {\n if (err) return callback(err);\n var results = [];\n for (var i = 0; i < arr.length; i++) {\n if (truthValues[i]) results.push(arr[i]);\n }\n callback(null, results);\n });\n}\n\nfunction filterGeneric(eachfn, coll, iteratee, callback) {\n var results = [];\n eachfn(coll, function (x, index, callback) {\n iteratee(x, function (err, v) {\n if (err) {\n callback(err);\n } else {\n if (v) {\n results.push({index: index, value: x});\n }\n callback();\n }\n });\n }, function (err) {\n if (err) {\n callback(err);\n } else {\n callback(null, arrayMap(results.sort(function (a, b) {\n return a.index - b.index;\n }), baseProperty('value')));\n }\n });\n}\n\nfunction _filter(eachfn, coll, iteratee, callback) {\n var filter = isArrayLike(coll) ? filterArray : filterGeneric;\n filter(eachfn, coll, wrapAsync(iteratee), callback || noop);\n}\n\n/**\n * Returns a new array of all the values in `coll` which pass an async truth\n * test. This operation is performed in parallel, but the results array will be\n * in the same order as the original.\n *\n * @name filter\n * @static\n * @memberOf module:Collections\n * @method\n * @alias select\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @example\n *\n * async.filter(['file1','file2','file3'], function(filePath, callback) {\n * fs.access(filePath, function(err) {\n * callback(null, !err)\n * });\n * }, function(err, results) {\n * // results now equals an array of the existing files\n * });\n */\nvar filter = doParallel(_filter);\n\n/**\n * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name filterLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @alias selectLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n */\nvar filterLimit = doParallelLimit(_filter);\n\n/**\n * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.\n *\n * @name filterSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @alias selectSeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results)\n */\nvar filterSeries = doLimit(filterLimit, 1);\n\n/**\n * Calls the asynchronous function `fn` with a callback parameter that allows it\n * to call itself again, in series, indefinitely.\n\n * If an error is passed to the callback then `errback` is called with the\n * error, and execution stops, otherwise it will never be called.\n *\n * @name forever\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} fn - an async function to call repeatedly.\n * Invoked with (next).\n * @param {Function} [errback] - when `fn` passes an error to it's callback,\n * this function will be called, and execution stops. Invoked with (err).\n * @example\n *\n * async.forever(\n * function(next) {\n * // next is suitable for passing to things that need a callback(err [, whatever]);\n * // it will result in this function being called again.\n * },\n * function(err) {\n * // if next is called with a value in its first parameter, it will appear\n * // in here as 'err', and execution will stop.\n * }\n * );\n */\nfunction forever(fn, errback) {\n var done = onlyOnce(errback || noop);\n var task = wrapAsync(ensureAsync(fn));\n\n function next(err) {\n if (err) return done(err);\n task(next);\n }\n next();\n}\n\n/**\n * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time.\n *\n * @name groupByLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.groupBy]{@link module:Collections.groupBy}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n */\nvar groupByLimit = function(coll, limit, iteratee, callback) {\n callback = callback || noop;\n var _iteratee = wrapAsync(iteratee);\n mapLimit(coll, limit, function(val, callback) {\n _iteratee(val, function(err, key) {\n if (err) return callback(err);\n return callback(null, {key: key, val: val});\n });\n }, function(err, mapResults) {\n var result = {};\n // from MDN, handle object having an `hasOwnProperty` prop\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n\n for (var i = 0; i < mapResults.length; i++) {\n if (mapResults[i]) {\n var key = mapResults[i].key;\n var val = mapResults[i].val;\n\n if (hasOwnProperty.call(result, key)) {\n result[key].push(val);\n } else {\n result[key] = [val];\n }\n }\n }\n\n return callback(err, result);\n });\n};\n\n/**\n * Returns a new object, where each value corresponds to an array of items, from\n * `coll`, that returned the corresponding key. That is, the keys of the object\n * correspond to the values passed to the `iteratee` callback.\n *\n * Note: Since this function applies the `iteratee` to each item in parallel,\n * there is no guarantee that the `iteratee` functions will complete in order.\n * However, the values for each key in the `result` will be in the same order as\n * the original `coll`. For Objects, the values will roughly be in the order of\n * the original Objects' keys (but this can vary across JavaScript engines).\n *\n * @name groupBy\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n * @example\n *\n * async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) {\n * db.findById(userId, function(err, user) {\n * if (err) return callback(err);\n * return callback(null, user.age);\n * });\n * }, function(err, result) {\n * // result is object containing the userIds grouped by age\n * // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']};\n * });\n */\nvar groupBy = doLimit(groupByLimit, Infinity);\n\n/**\n * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time.\n *\n * @name groupBySeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.groupBy]{@link module:Collections.groupBy}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n */\nvar groupBySeries = doLimit(groupByLimit, 1);\n\n/**\n * Logs the result of an `async` function to the `console`. Only works in\n * Node.js or in browsers that support `console.log` and `console.error` (such\n * as FF and Chrome). If multiple arguments are returned from the async\n * function, `console.log` is called on each argument in order.\n *\n * @name log\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} function - The function you want to eventually apply\n * all arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n * setTimeout(function() {\n * callback(null, 'hello ' + name);\n * }, 1000);\n * };\n *\n * // in the node repl\n * node> async.log(hello, 'world');\n * 'hello world'\n */\nvar log = consoleFunc('log');\n\n/**\n * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name mapValuesLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.mapValues]{@link module:Collections.mapValues}\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n */\nfunction mapValuesLimit(obj, limit, iteratee, callback) {\n callback = once(callback || noop);\n var newObj = {};\n var _iteratee = wrapAsync(iteratee);\n eachOfLimit(obj, limit, function(val, key, next) {\n _iteratee(val, key, function (err, result) {\n if (err) return next(err);\n newObj[key] = result;\n next();\n });\n }, function (err) {\n callback(err, newObj);\n });\n}\n\n/**\n * A relative of [`map`]{@link module:Collections.map}, designed for use with objects.\n *\n * Produces a new Object by mapping each value of `obj` through the `iteratee`\n * function. The `iteratee` is called each `value` and `key` from `obj` and a\n * callback for when it has finished processing. Each of these callbacks takes\n * two arguments: an `error`, and the transformed item from `obj`. If `iteratee`\n * passes an error to its callback, the main `callback` (for the `mapValues`\n * function) is immediately called with the error.\n *\n * Note, the order of the keys in the result is not guaranteed. The keys will\n * be roughly in the order they complete, (but this is very engine-specific)\n *\n * @name mapValues\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @example\n *\n * async.mapValues({\n * f1: 'file1',\n * f2: 'file2',\n * f3: 'file3'\n * }, function (file, key, callback) {\n * fs.stat(file, callback);\n * }, function(err, result) {\n * // result is now a map of stats for each file, e.g.\n * // {\n * // f1: [stats for file1],\n * // f2: [stats for file2],\n * // f3: [stats for file3]\n * // }\n * });\n */\n\nvar mapValues = doLimit(mapValuesLimit, Infinity);\n\n/**\n * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time.\n *\n * @name mapValuesSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.mapValues]{@link module:Collections.mapValues}\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n */\nvar mapValuesSeries = doLimit(mapValuesLimit, 1);\n\nfunction has(obj, key) {\n return key in obj;\n}\n\n/**\n * Caches the results of an async function. When creating a hash to store\n * function results against, the callback is omitted from the hash and an\n * optional hash function can be used.\n *\n * If no hash function is specified, the first argument is used as a hash key,\n * which may work reasonably if it is a string or a data type that converts to a\n * distinct string. Note that objects and arrays will not behave reasonably.\n * Neither will cases where the other arguments are significant. In such cases,\n * specify your own hash function.\n *\n * The cache of results is exposed as the `memo` property of the function\n * returned by `memoize`.\n *\n * @name memoize\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - The async function to proxy and cache results from.\n * @param {Function} hasher - An optional function for generating a custom hash\n * for storing results. It has all the arguments applied to it apart from the\n * callback, and must be synchronous.\n * @returns {AsyncFunction} a memoized version of `fn`\n * @example\n *\n * var slow_fn = function(name, callback) {\n * // do something\n * callback(null, result);\n * };\n * var fn = async.memoize(slow_fn);\n *\n * // fn can now be used as if it were slow_fn\n * fn('some name', function() {\n * // callback\n * });\n */\nfunction memoize(fn, hasher) {\n var memo = Object.create(null);\n var queues = Object.create(null);\n hasher = hasher || identity;\n var _fn = wrapAsync(fn);\n var memoized = initialParams(function memoized(args, callback) {\n var key = hasher.apply(null, args);\n if (has(memo, key)) {\n setImmediate$1(function() {\n callback.apply(null, memo[key]);\n });\n } else if (has(queues, key)) {\n queues[key].push(callback);\n } else {\n queues[key] = [callback];\n _fn.apply(null, args.concat(function(/*args*/) {\n var args = slice(arguments);\n memo[key] = args;\n var q = queues[key];\n delete queues[key];\n for (var i = 0, l = q.length; i < l; i++) {\n q[i].apply(null, args);\n }\n }));\n }\n });\n memoized.memo = memo;\n memoized.unmemoized = fn;\n return memoized;\n}\n\n/**\n * Calls `callback` on a later loop around the event loop. In Node.js this just\n * calls `process.nextTick`. In the browser it will use `setImmediate` if\n * available, otherwise `setTimeout(callback, 0)`, which means other higher\n * priority events may precede the execution of `callback`.\n *\n * This is used internally for browser-compatibility purposes.\n *\n * @name nextTick\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.setImmediate]{@link module:Utils.setImmediate}\n * @category Util\n * @param {Function} callback - The function to call on a later loop around\n * the event loop. Invoked with (args...).\n * @param {...*} args... - any number of additional arguments to pass to the\n * callback on the next tick.\n * @example\n *\n * var call_order = [];\n * async.nextTick(function() {\n * call_order.push('two');\n * // call_order now equals ['one','two']\n * });\n * call_order.push('one');\n *\n * async.setImmediate(function (a, b, c) {\n * // a, b, and c equal 1, 2, and 3\n * }, 1, 2, 3);\n */\nvar _defer$1;\n\nif (hasNextTick) {\n _defer$1 = process.nextTick;\n} else if (hasSetImmediate) {\n _defer$1 = setImmediate;\n} else {\n _defer$1 = fallback;\n}\n\nvar nextTick = wrap(_defer$1);\n\nfunction _parallel(eachfn, tasks, callback) {\n callback = callback || noop;\n var results = isArrayLike(tasks) ? [] : {};\n\n eachfn(tasks, function (task, key, callback) {\n wrapAsync(task)(function (err, result) {\n if (arguments.length > 2) {\n result = slice(arguments, 1);\n }\n results[key] = result;\n callback(err);\n });\n }, function (err) {\n callback(err, results);\n });\n}\n\n/**\n * Run the `tasks` collection of functions in parallel, without waiting until\n * the previous function has completed. If any of the functions pass an error to\n * its callback, the main `callback` is immediately called with the value of the\n * error. Once the `tasks` have completed, the results are passed to the final\n * `callback` as an array.\n *\n * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about\n * parallel execution of code. If your tasks do not use any timers or perform\n * any I/O, they will actually be executed in series. Any synchronous setup\n * sections for each task will happen one after the other. JavaScript remains\n * single-threaded.\n *\n * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the\n * execution of other tasks when a task fails.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function and the results will be passed to the final `callback`\n * as an object instead of an array. This can be a more readable way of handling\n * results from {@link async.parallel}.\n *\n * @name parallel\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional `result` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n *\n * @example\n * async.parallel([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ],\n * // optional callback\n * function(err, results) {\n * // the results array will equal ['one','two'] even though\n * // the second function had a shorter timeout.\n * });\n *\n * // an example using an object instead of an array\n * async.parallel({\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * callback(null, 2);\n * }, 100);\n * }\n * }, function(err, results) {\n * // results is now equals to: {one: 1, two: 2}\n * });\n */\nfunction parallelLimit(tasks, callback) {\n _parallel(eachOf, tasks, callback);\n}\n\n/**\n * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name parallelLimit\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.parallel]{@link module:ControlFlow.parallel}\n * @category Control Flow\n * @param {Array|Iterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional `result` values.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n */\nfunction parallelLimit$1(tasks, limit, callback) {\n _parallel(_eachOfLimit(limit), tasks, callback);\n}\n\n/**\n * A queue of tasks for the worker function to complete.\n * @typedef {Object} QueueObject\n * @memberOf module:ControlFlow\n * @property {Function} length - a function returning the number of items\n * waiting to be processed. Invoke with `queue.length()`.\n * @property {boolean} started - a boolean indicating whether or not any\n * items have been pushed and processed by the queue.\n * @property {Function} running - a function returning the number of items\n * currently being processed. Invoke with `queue.running()`.\n * @property {Function} workersList - a function returning the array of items\n * currently being processed. Invoke with `queue.workersList()`.\n * @property {Function} idle - a function returning false if there are items\n * waiting or being processed, or true if not. Invoke with `queue.idle()`.\n * @property {number} concurrency - an integer for determining how many `worker`\n * functions should be run in parallel. This property can be changed after a\n * `queue` is created to alter the concurrency on-the-fly.\n * @property {Function} push - add a new task to the `queue`. Calls `callback`\n * once the `worker` has finished processing the task. Instead of a single task,\n * a `tasks` array can be submitted. The respective callback is used for every\n * task in the list. Invoke with `queue.push(task, [callback])`,\n * @property {Function} unshift - add a new task to the front of the `queue`.\n * Invoke with `queue.unshift(task, [callback])`.\n * @property {Function} remove - remove items from the queue that match a test\n * function. The test function will be passed an object with a `data` property,\n * and a `priority` property, if this is a\n * [priorityQueue]{@link module:ControlFlow.priorityQueue} object.\n * Invoked with `queue.remove(testFn)`, where `testFn` is of the form\n * `function ({data, priority}) {}` and returns a Boolean.\n * @property {Function} saturated - a callback that is called when the number of\n * running workers hits the `concurrency` limit, and further tasks will be\n * queued.\n * @property {Function} unsaturated - a callback that is called when the number\n * of running workers is less than the `concurrency` & `buffer` limits, and\n * further tasks will not be queued.\n * @property {number} buffer - A minimum threshold buffer in order to say that\n * the `queue` is `unsaturated`.\n * @property {Function} empty - a callback that is called when the last item\n * from the `queue` is given to a `worker`.\n * @property {Function} drain - a callback that is called when the last item\n * from the `queue` has returned from the `worker`.\n * @property {Function} error - a callback that is called when a task errors.\n * Has the signature `function(error, task)`.\n * @property {boolean} paused - a boolean for determining whether the queue is\n * in a paused state.\n * @property {Function} pause - a function that pauses the processing of tasks\n * until `resume()` is called. Invoke with `queue.pause()`.\n * @property {Function} resume - a function that resumes the processing of\n * queued tasks when the queue is paused. Invoke with `queue.resume()`.\n * @property {Function} kill - a function that removes the `drain` callback and\n * empties remaining tasks from the queue forcing it to go idle. No more tasks\n * should be pushed to the queue after calling this function. Invoke with `queue.kill()`.\n */\n\n/**\n * Creates a `queue` object with the specified `concurrency`. Tasks added to the\n * `queue` are processed in parallel (up to the `concurrency` limit). If all\n * `worker`s are in progress, the task is queued until one becomes available.\n * Once a `worker` completes a `task`, that `task`'s callback is called.\n *\n * @name queue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * `q.push()`. Invoked with (task, callback).\n * @param {number} [concurrency=1] - An `integer` for determining how many\n * `worker` functions should be run in parallel. If omitted, the concurrency\n * defaults to `1`. If the concurrency is `0`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can\n * attached as certain properties to listen for specific events during the\n * lifecycle of the queue.\n * @example\n *\n * // create a queue object with concurrency 2\n * var q = async.queue(function(task, callback) {\n * console.log('hello ' + task.name);\n * callback();\n * }, 2);\n *\n * // assign a callback\n * q.drain = function() {\n * console.log('all items have been processed');\n * };\n *\n * // add some items to the queue\n * q.push({name: 'foo'}, function(err) {\n * console.log('finished processing foo');\n * });\n * q.push({name: 'bar'}, function (err) {\n * console.log('finished processing bar');\n * });\n *\n * // add some items to the queue (batch-wise)\n * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {\n * console.log('finished processing item');\n * });\n *\n * // add some items to the front of the queue\n * q.unshift({name: 'bar'}, function (err) {\n * console.log('finished processing bar');\n * });\n */\nvar queue$1 = function (worker, concurrency) {\n var _worker = wrapAsync(worker);\n return queue(function (items, cb) {\n _worker(items[0], cb);\n }, concurrency, 1);\n};\n\n/**\n * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and\n * completed in ascending priority order.\n *\n * @name priorityQueue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * `q.push()`.\n * Invoked with (task, callback).\n * @param {number} concurrency - An `integer` for determining how many `worker`\n * functions should be run in parallel. If omitted, the concurrency defaults to\n * `1`. If the concurrency is `0`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two\n * differences between `queue` and `priorityQueue` objects:\n * * `push(task, priority, [callback])` - `priority` should be a number. If an\n * array of `tasks` is given, all tasks will be assigned the same priority.\n * * The `unshift` method was removed.\n */\nvar priorityQueue = function(worker, concurrency) {\n // Start with a normal queue\n var q = queue$1(worker, concurrency);\n\n // Override push to accept second parameter representing priority\n q.push = function(data, priority, callback) {\n if (callback == null) callback = noop;\n if (typeof callback !== 'function') {\n throw new Error('task callback must be a function');\n }\n q.started = true;\n if (!isArray(data)) {\n data = [data];\n }\n if (data.length === 0) {\n // call drain immediately if there are no tasks\n return setImmediate$1(function() {\n q.drain();\n });\n }\n\n priority = priority || 0;\n var nextNode = q._tasks.head;\n while (nextNode && priority >= nextNode.priority) {\n nextNode = nextNode.next;\n }\n\n for (var i = 0, l = data.length; i < l; i++) {\n var item = {\n data: data[i],\n priority: priority,\n callback: callback\n };\n\n if (nextNode) {\n q._tasks.insertBefore(nextNode, item);\n } else {\n q._tasks.push(item);\n }\n }\n setImmediate$1(q.process);\n };\n\n // Remove unshift function\n delete q.unshift;\n\n return q;\n};\n\n/**\n * Runs the `tasks` array of functions in parallel, without waiting until the\n * previous function has completed. Once any of the `tasks` complete or pass an\n * error to its callback, the main `callback` is immediately called. It's\n * equivalent to `Promise.race()`.\n *\n * @name race\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction}\n * to run. Each function can complete with an optional `result` value.\n * @param {Function} callback - A callback to run once any of the functions have\n * completed. This function gets an error or result from the first function that\n * completed. Invoked with (err, result).\n * @returns undefined\n * @example\n *\n * async.race([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ],\n * // main callback\n * function(err, result) {\n * // the result will be equal to 'two' as it finishes earlier\n * });\n */\nfunction race(tasks, callback) {\n callback = once(callback || noop);\n if (!isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));\n if (!tasks.length) return callback();\n for (var i = 0, l = tasks.length; i < l; i++) {\n wrapAsync(tasks[i])(callback);\n }\n}\n\n/**\n * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.\n *\n * @name reduceRight\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reduce]{@link module:Collections.reduce}\n * @alias foldr\n * @category Collection\n * @param {Array} array - A collection to iterate over.\n * @param {*} memo - The initial state of the reduction.\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * array to produce the next step in the reduction.\n * The `iteratee` should complete with the next state of the reduction.\n * If the iteratee complete with an error, the reduction is stopped and the\n * main `callback` is immediately called with the error.\n * Invoked with (memo, item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the reduced value. Invoked with\n * (err, result).\n */\nfunction reduceRight (array, memo, iteratee, callback) {\n var reversed = slice(array).reverse();\n reduce(reversed, memo, iteratee, callback);\n}\n\n/**\n * Wraps the async function in another function that always completes with a\n * result object, even when it errors.\n *\n * The result object has either the property `error` or `value`.\n *\n * @name reflect\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - The async function you want to wrap\n * @returns {Function} - A function that always passes null to it's callback as\n * the error. The second argument to the callback will be an `object` with\n * either an `error` or a `value` property.\n * @example\n *\n * async.parallel([\n * async.reflect(function(callback) {\n * // do some stuff ...\n * callback(null, 'one');\n * }),\n * async.reflect(function(callback) {\n * // do some more stuff but error ...\n * callback('bad stuff happened');\n * }),\n * async.reflect(function(callback) {\n * // do some more stuff ...\n * callback(null, 'two');\n * })\n * ],\n * // optional callback\n * function(err, results) {\n * // values\n * // results[0].value = 'one'\n * // results[1].error = 'bad stuff happened'\n * // results[2].value = 'two'\n * });\n */\nfunction reflect(fn) {\n var _fn = wrapAsync(fn);\n return initialParams(function reflectOn(args, reflectCallback) {\n args.push(function callback(error, cbArg) {\n if (error) {\n reflectCallback(null, { error: error });\n } else {\n var value;\n if (arguments.length <= 2) {\n value = cbArg;\n } else {\n value = slice(arguments, 1);\n }\n reflectCallback(null, { value: value });\n }\n });\n\n return _fn.apply(this, args);\n });\n}\n\n/**\n * A helper function that wraps an array or an object of functions with `reflect`.\n *\n * @name reflectAll\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.reflect]{@link module:Utils.reflect}\n * @category Util\n * @param {Array|Object|Iterable} tasks - The collection of\n * [async functions]{@link AsyncFunction} to wrap in `async.reflect`.\n * @returns {Array} Returns an array of async functions, each wrapped in\n * `async.reflect`\n * @example\n *\n * let tasks = [\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * // do some more stuff but error ...\n * callback(new Error('bad stuff happened'));\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ];\n *\n * async.parallel(async.reflectAll(tasks),\n * // optional callback\n * function(err, results) {\n * // values\n * // results[0].value = 'one'\n * // results[1].error = Error('bad stuff happened')\n * // results[2].value = 'two'\n * });\n *\n * // an example using an object instead of an array\n * let tasks = {\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * two: function(callback) {\n * callback('two');\n * },\n * three: function(callback) {\n * setTimeout(function() {\n * callback(null, 'three');\n * }, 100);\n * }\n * };\n *\n * async.parallel(async.reflectAll(tasks),\n * // optional callback\n * function(err, results) {\n * // values\n * // results.one.value = 'one'\n * // results.two.error = 'two'\n * // results.three.value = 'three'\n * });\n */\nfunction reflectAll(tasks) {\n var results;\n if (isArray(tasks)) {\n results = arrayMap(tasks, reflect);\n } else {\n results = {};\n baseForOwn(tasks, function(task, key) {\n results[key] = reflect.call(this, task);\n });\n }\n return results;\n}\n\nfunction reject$1(eachfn, arr, iteratee, callback) {\n _filter(eachfn, arr, function(value, cb) {\n iteratee(value, function(err, v) {\n cb(err, !v);\n });\n }, callback);\n}\n\n/**\n * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test.\n *\n * @name reject\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @example\n *\n * async.reject(['file1','file2','file3'], function(filePath, callback) {\n * fs.access(filePath, function(err) {\n * callback(null, !err)\n * });\n * }, function(err, results) {\n * // results now equals an array of missing files\n * createFiles(results);\n * });\n */\nvar reject = doParallel(reject$1);\n\n/**\n * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name rejectLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reject]{@link module:Collections.reject}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n */\nvar rejectLimit = doParallelLimit(reject$1);\n\n/**\n * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time.\n *\n * @name rejectSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reject]{@link module:Collections.reject}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n */\nvar rejectSeries = doLimit(rejectLimit, 1);\n\n/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant$1(value) {\n return function() {\n return value;\n };\n}\n\n/**\n * Attempts to get a successful response from `task` no more than `times` times\n * before returning an error. If the task is successful, the `callback` will be\n * passed the result of the successful task. If all attempts fail, the callback\n * will be passed the error and result (if any) of the final attempt.\n *\n * @name retry\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @see [async.retryable]{@link module:ControlFlow.retryable}\n * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an\n * object with `times` and `interval` or a number.\n * * `times` - The number of attempts to make before giving up. The default\n * is `5`.\n * * `interval` - The time to wait between retries, in milliseconds. The\n * default is `0`. The interval may also be specified as a function of the\n * retry count (see example).\n * * `errorFilter` - An optional synchronous function that is invoked on\n * erroneous result. If it returns `true` the retry attempts will continue;\n * if the function returns `false` the retry flow is aborted with the current\n * attempt's error and result being returned to the final callback.\n * Invoked with (err).\n * * If `opts` is a number, the number specifies the number of times to retry,\n * with the default interval of `0`.\n * @param {AsyncFunction} task - An async function to retry.\n * Invoked with (callback).\n * @param {Function} [callback] - An optional callback which is called when the\n * task has succeeded, or after the final failed attempt. It receives the `err`\n * and `result` arguments of the last attempt at completing the `task`. Invoked\n * with (err, results).\n *\n * @example\n *\n * // The `retry` function can be used as a stand-alone control flow by passing\n * // a callback, as shown below:\n *\n * // try calling apiMethod 3 times\n * async.retry(3, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod 3 times, waiting 200 ms between each retry\n * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod 10 times with exponential backoff\n * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds)\n * async.retry({\n * times: 10,\n * interval: function(retryCount) {\n * return 50 * Math.pow(2, retryCount);\n * }\n * }, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod the default 5 times no delay between each retry\n * async.retry(apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod only when error condition satisfies, all other\n * // errors will abort the retry control flow and return to final callback\n * async.retry({\n * errorFilter: function(err) {\n * return err.message === 'Temporary error'; // only retry on a specific error\n * }\n * }, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // to retry individual methods that are not as reliable within other\n * // control flow functions, use the `retryable` wrapper:\n * async.auto({\n * users: api.getUsers.bind(api),\n * payments: async.retryable(3, api.getPayments.bind(api))\n * }, function(err, results) {\n * // do something with the results\n * });\n *\n */\nfunction retry(opts, task, callback) {\n var DEFAULT_TIMES = 5;\n var DEFAULT_INTERVAL = 0;\n\n var options = {\n times: DEFAULT_TIMES,\n intervalFunc: constant$1(DEFAULT_INTERVAL)\n };\n\n function parseTimes(acc, t) {\n if (typeof t === 'object') {\n acc.times = +t.times || DEFAULT_TIMES;\n\n acc.intervalFunc = typeof t.interval === 'function' ?\n t.interval :\n constant$1(+t.interval || DEFAULT_INTERVAL);\n\n acc.errorFilter = t.errorFilter;\n } else if (typeof t === 'number' || typeof t === 'string') {\n acc.times = +t || DEFAULT_TIMES;\n } else {\n throw new Error(\"Invalid arguments for async.retry\");\n }\n }\n\n if (arguments.length < 3 && typeof opts === 'function') {\n callback = task || noop;\n task = opts;\n } else {\n parseTimes(options, opts);\n callback = callback || noop;\n }\n\n if (typeof task !== 'function') {\n throw new Error(\"Invalid arguments for async.retry\");\n }\n\n var _task = wrapAsync(task);\n\n var attempt = 1;\n function retryAttempt() {\n _task(function(err) {\n if (err && attempt++ < options.times &&\n (typeof options.errorFilter != 'function' ||\n options.errorFilter(err))) {\n setTimeout(retryAttempt, options.intervalFunc(attempt));\n } else {\n callback.apply(null, arguments);\n }\n });\n }\n\n retryAttempt();\n}\n\n/**\n * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method\n * wraps a task and makes it retryable, rather than immediately calling it\n * with retries.\n *\n * @name retryable\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.retry]{@link module:ControlFlow.retry}\n * @category Control Flow\n * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional\n * options, exactly the same as from `retry`\n * @param {AsyncFunction} task - the asynchronous function to wrap.\n * This function will be passed any arguments passed to the returned wrapper.\n * Invoked with (...args, callback).\n * @returns {AsyncFunction} The wrapped function, which when invoked, will\n * retry on an error, based on the parameters specified in `opts`.\n * This function will accept the same parameters as `task`.\n * @example\n *\n * async.auto({\n * dep1: async.retryable(3, getFromFlakyService),\n * process: [\"dep1\", async.retryable(3, function (results, cb) {\n * maybeProcessData(results.dep1, cb);\n * })]\n * }, callback);\n */\nvar retryable = function (opts, task) {\n if (!task) {\n task = opts;\n opts = null;\n }\n var _task = wrapAsync(task);\n return initialParams(function (args, callback) {\n function taskFn(cb) {\n _task.apply(null, args.concat(cb));\n }\n\n if (opts) retry(opts, taskFn, callback);\n else retry(taskFn, callback);\n\n });\n};\n\n/**\n * Run the functions in the `tasks` collection in series, each one running once\n * the previous function has completed. If any functions in the series pass an\n * error to its callback, no more functions are run, and `callback` is\n * immediately called with the value of the error. Otherwise, `callback`\n * receives an array of results when `tasks` have completed.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function, and the results will be passed to the final `callback`\n * as an object instead of an array. This can be a more readable way of handling\n * results from {@link async.series}.\n *\n * **Note** that while many implementations preserve the order of object\n * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)\n * explicitly states that\n *\n * > The mechanics and order of enumerating the properties is not specified.\n *\n * So if you rely on the order in which your series of functions are executed,\n * and want this to work on all platforms, consider using an array.\n *\n * @name series\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} tasks - A collection containing\n * [async functions]{@link AsyncFunction} to run in series.\n * Each function can complete with any number of optional `result` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This function gets a results array (or object)\n * containing all the result arguments passed to the `task` callbacks. Invoked\n * with (err, result).\n * @example\n * async.series([\n * function(callback) {\n * // do some stuff ...\n * callback(null, 'one');\n * },\n * function(callback) {\n * // do some more stuff ...\n * callback(null, 'two');\n * }\n * ],\n * // optional callback\n * function(err, results) {\n * // results is now equal to ['one', 'two']\n * });\n *\n * async.series({\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback){\n * setTimeout(function() {\n * callback(null, 2);\n * }, 100);\n * }\n * }, function(err, results) {\n * // results is now equal to: {one: 1, two: 2}\n * });\n */\nfunction series(tasks, callback) {\n _parallel(eachOfSeries, tasks, callback);\n}\n\n/**\n * Returns `true` if at least one element in the `coll` satisfies an async test.\n * If any iteratee call returns `true`, the main `callback` is immediately\n * called.\n *\n * @name some\n * @static\n * @memberOf module:Collections\n * @method\n * @alias any\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n * @example\n *\n * async.some(['file1','file2','file3'], function(filePath, callback) {\n * fs.access(filePath, function(err) {\n * callback(null, !err)\n * });\n * }, function(err, result) {\n * // if result is true then at least one of the files exists\n * });\n */\nvar some = doParallel(_createTester(Boolean, identity));\n\n/**\n * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.\n *\n * @name someLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.some]{@link module:Collections.some}\n * @alias anyLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n */\nvar someLimit = doParallelLimit(_createTester(Boolean, identity));\n\n/**\n * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.\n *\n * @name someSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.some]{@link module:Collections.some}\n * @alias anySeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in series.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n */\nvar someSeries = doLimit(someLimit, 1);\n\n/**\n * Sorts a list by the results of running each `coll` value through an async\n * `iteratee`.\n *\n * @name sortBy\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a value to use as the sort criteria as\n * its `result`.\n * Invoked with (item, callback).\n * @param {Function} callback - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is the items\n * from the original `coll` sorted by the values returned by the `iteratee`\n * calls. Invoked with (err, results).\n * @example\n *\n * async.sortBy(['file1','file2','file3'], function(file, callback) {\n * fs.stat(file, function(err, stats) {\n * callback(err, stats.mtime);\n * });\n * }, function(err, results) {\n * // results is now the original array of files sorted by\n * // modified date\n * });\n *\n * // By modifying the callback parameter the\n * // sorting order can be influenced:\n *\n * // ascending order\n * async.sortBy([1,9,3,5], function(x, callback) {\n * callback(null, x);\n * }, function(err,result) {\n * // result callback\n * });\n *\n * // descending order\n * async.sortBy([1,9,3,5], function(x, callback) {\n * callback(null, x*-1); //<- x*-1 instead of x, turns the order around\n * }, function(err,result) {\n * // result callback\n * });\n */\nfunction sortBy (coll, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n map(coll, function (x, callback) {\n _iteratee(x, function (err, criteria) {\n if (err) return callback(err);\n callback(null, {value: x, criteria: criteria});\n });\n }, function (err, results) {\n if (err) return callback(err);\n callback(null, arrayMap(results.sort(comparator), baseProperty('value')));\n });\n\n function comparator(left, right) {\n var a = left.criteria, b = right.criteria;\n return a < b ? -1 : a > b ? 1 : 0;\n }\n}\n\n/**\n * Sets a time limit on an asynchronous function. If the function does not call\n * its callback within the specified milliseconds, it will be called with a\n * timeout error. The code property for the error object will be `'ETIMEDOUT'`.\n *\n * @name timeout\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} asyncFn - The async function to limit in time.\n * @param {number} milliseconds - The specified time limit.\n * @param {*} [info] - Any variable you want attached (`string`, `object`, etc)\n * to timeout Error for more information..\n * @returns {AsyncFunction} Returns a wrapped function that can be used with any\n * of the control flow functions.\n * Invoke this function with the same parameters as you would `asyncFunc`.\n * @example\n *\n * function myFunction(foo, callback) {\n * doAsyncTask(foo, function(err, data) {\n * // handle errors\n * if (err) return callback(err);\n *\n * // do some stuff ...\n *\n * // return processed data\n * return callback(null, data);\n * });\n * }\n *\n * var wrapped = async.timeout(myFunction, 1000);\n *\n * // call `wrapped` as you would `myFunction`\n * wrapped({ bar: 'bar' }, function(err, data) {\n * // if `myFunction` takes < 1000 ms to execute, `err`\n * // and `data` will have their expected values\n *\n * // else `err` will be an Error with the code 'ETIMEDOUT'\n * });\n */\nfunction timeout(asyncFn, milliseconds, info) {\n var fn = wrapAsync(asyncFn);\n\n return initialParams(function (args, callback) {\n var timedOut = false;\n var timer;\n\n function timeoutCallback() {\n var name = asyncFn.name || 'anonymous';\n var error = new Error('Callback function \"' + name + '\" timed out.');\n error.code = 'ETIMEDOUT';\n if (info) {\n error.info = info;\n }\n timedOut = true;\n callback(error);\n }\n\n args.push(function () {\n if (!timedOut) {\n callback.apply(null, arguments);\n clearTimeout(timer);\n }\n });\n\n // setup timer and call original function\n timer = setTimeout(timeoutCallback, milliseconds);\n fn.apply(null, args);\n });\n}\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil;\nvar nativeMax = Math.max;\n\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\nfunction baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n}\n\n/**\n * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name timesLimit\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.times]{@link module:ControlFlow.times}\n * @category Control Flow\n * @param {number} count - The number of times to run the function.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see [async.map]{@link module:Collections.map}.\n */\nfunction timeLimit(count, limit, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n mapLimit(baseRange(0, count, 1), limit, _iteratee, callback);\n}\n\n/**\n * Calls the `iteratee` function `n` times, and accumulates results in the same\n * manner you would use with [map]{@link module:Collections.map}.\n *\n * @name times\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Control Flow\n * @param {number} n - The number of times to run the function.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see {@link module:Collections.map}.\n * @example\n *\n * // Pretend this is some complicated async factory\n * var createUser = function(id, callback) {\n * callback(null, {\n * id: 'user' + id\n * });\n * };\n *\n * // generate 5 users\n * async.times(5, function(n, next) {\n * createUser(n, function(err, user) {\n * next(err, user);\n * });\n * }, function(err, users) {\n * // we should now have 5 users\n * });\n */\nvar times = doLimit(timeLimit, Infinity);\n\n/**\n * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time.\n *\n * @name timesSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.times]{@link module:ControlFlow.times}\n * @category Control Flow\n * @param {number} n - The number of times to run the function.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see {@link module:Collections.map}.\n */\nvar timesSeries = doLimit(timeLimit, 1);\n\n/**\n * A relative of `reduce`. Takes an Object or Array, and iterates over each\n * element in series, each step potentially mutating an `accumulator` value.\n * The type of the accumulator defaults to the type of collection passed in.\n *\n * @name transform\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {*} [accumulator] - The initial state of the transform. If omitted,\n * it will default to an empty Object or Array, depending on the type of `coll`\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * collection that potentially modifies the accumulator.\n * Invoked with (accumulator, item, key, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the transformed accumulator.\n * Invoked with (err, result).\n * @example\n *\n * async.transform([1,2,3], function(acc, item, index, callback) {\n * // pointless async:\n * process.nextTick(function() {\n * acc.push(item * 2)\n * callback(null)\n * });\n * }, function(err, result) {\n * // result is now equal to [2, 4, 6]\n * });\n *\n * @example\n *\n * async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) {\n * setImmediate(function () {\n * obj[key] = val * 2;\n * callback();\n * })\n * }, function (err, result) {\n * // result is equal to {a: 2, b: 4, c: 6}\n * })\n */\nfunction transform (coll, accumulator, iteratee, callback) {\n if (arguments.length <= 3) {\n callback = iteratee;\n iteratee = accumulator;\n accumulator = isArray(coll) ? [] : {};\n }\n callback = once(callback || noop);\n var _iteratee = wrapAsync(iteratee);\n\n eachOf(coll, function(v, k, cb) {\n _iteratee(accumulator, v, k, cb);\n }, function(err) {\n callback(err, accumulator);\n });\n}\n\n/**\n * It runs each task in series but stops whenever any of the functions were\n * successful. If one of the tasks were successful, the `callback` will be\n * passed the result of the successful task. If all tasks fail, the callback\n * will be passed the error and result (if any) of the final attempt.\n *\n * @name tryEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} tasks - A collection containing functions to\n * run, each function is passed a `callback(err, result)` it must call on\n * completion with an error `err` (which can be `null`) and an optional `result`\n * value.\n * @param {Function} [callback] - An optional callback which is called when one\n * of the tasks has succeeded, or all have failed. It receives the `err` and\n * `result` arguments of the last attempt at completing the `task`. Invoked with\n * (err, results).\n * @example\n * async.tryEach([\n * function getDataFromFirstWebsite(callback) {\n * // Try getting the data from the first website\n * callback(err, data);\n * },\n * function getDataFromSecondWebsite(callback) {\n * // First website failed,\n * // Try getting the data from the backup website\n * callback(err, data);\n * }\n * ],\n * // optional callback\n * function(err, results) {\n * Now do something with the data.\n * });\n *\n */\nfunction tryEach(tasks, callback) {\n var error = null;\n var result;\n callback = callback || noop;\n eachSeries(tasks, function(task, callback) {\n wrapAsync(task)(function (err, res/*, ...args*/) {\n if (arguments.length > 2) {\n result = slice(arguments, 1);\n } else {\n result = res;\n }\n error = err;\n callback(!err);\n });\n }, function () {\n callback(error, result);\n });\n}\n\n/**\n * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original,\n * unmemoized form. Handy for testing.\n *\n * @name unmemoize\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.memoize]{@link module:Utils.memoize}\n * @category Util\n * @param {AsyncFunction} fn - the memoized function\n * @returns {AsyncFunction} a function that calls the original unmemoized function\n */\nfunction unmemoize(fn) {\n return function () {\n return (fn.unmemoized || fn).apply(null, arguments);\n };\n}\n\n/**\n * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when\n * stopped, or an error occurs.\n *\n * @name whilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Function} test - synchronous truth test to perform before each\n * execution of `iteratee`. Invoked with ().\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` passes. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n * @returns undefined\n * @example\n *\n * var count = 0;\n * async.whilst(\n * function() { return count < 5; },\n * function(callback) {\n * count++;\n * setTimeout(function() {\n * callback(null, count);\n * }, 1000);\n * },\n * function (err, n) {\n * // 5 seconds have passed, n = 5\n * }\n * );\n */\nfunction whilst(test, iteratee, callback) {\n callback = onlyOnce(callback || noop);\n var _iteratee = wrapAsync(iteratee);\n if (!test()) return callback(null);\n var next = function(err/*, ...args*/) {\n if (err) return callback(err);\n if (test()) return _iteratee(next);\n var args = slice(arguments, 1);\n callback.apply(null, [null].concat(args));\n };\n _iteratee(next);\n}\n\n/**\n * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when\n * stopped, or an error occurs. `callback` will be passed an error and any\n * arguments passed to the final `iteratee`'s callback.\n *\n * The inverse of [whilst]{@link module:ControlFlow.whilst}.\n *\n * @name until\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {Function} test - synchronous truth test to perform before each\n * execution of `iteratee`. Invoked with ().\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` fails. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n */\nfunction until(test, iteratee, callback) {\n whilst(function() {\n return !test.apply(this, arguments);\n }, iteratee, callback);\n}\n\n/**\n * Runs the `tasks` array of functions in series, each passing their results to\n * the next in the array. However, if any of the `tasks` pass an error to their\n * own callback, the next function is not executed, and the main `callback` is\n * immediately called with the error.\n *\n * @name waterfall\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array of [async functions]{@link AsyncFunction}\n * to run.\n * Each function should complete with any number of `result` values.\n * The `result` values will be passed as arguments, in order, to the next task.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This will be passed the results of the last task's\n * callback. Invoked with (err, [results]).\n * @returns undefined\n * @example\n *\n * async.waterfall([\n * function(callback) {\n * callback(null, 'one', 'two');\n * },\n * function(arg1, arg2, callback) {\n * // arg1 now equals 'one' and arg2 now equals 'two'\n * callback(null, 'three');\n * },\n * function(arg1, callback) {\n * // arg1 now equals 'three'\n * callback(null, 'done');\n * }\n * ], function (err, result) {\n * // result now equals 'done'\n * });\n *\n * // Or, with named functions:\n * async.waterfall([\n * myFirstFunction,\n * mySecondFunction,\n * myLastFunction,\n * ], function (err, result) {\n * // result now equals 'done'\n * });\n * function myFirstFunction(callback) {\n * callback(null, 'one', 'two');\n * }\n * function mySecondFunction(arg1, arg2, callback) {\n * // arg1 now equals 'one' and arg2 now equals 'two'\n * callback(null, 'three');\n * }\n * function myLastFunction(arg1, callback) {\n * // arg1 now equals 'three'\n * callback(null, 'done');\n * }\n */\nvar waterfall = function(tasks, callback) {\n callback = once(callback || noop);\n if (!isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));\n if (!tasks.length) return callback();\n var taskIndex = 0;\n\n function nextTask(args) {\n var task = wrapAsync(tasks[taskIndex++]);\n args.push(onlyOnce(next));\n task.apply(null, args);\n }\n\n function next(err/*, ...args*/) {\n if (err || taskIndex === tasks.length) {\n return callback.apply(null, arguments);\n }\n nextTask(slice(arguments, 1));\n }\n\n nextTask([]);\n};\n\n/**\n * An \"async function\" in the context of Async is an asynchronous function with\n * a variable number of parameters, with the final parameter being a callback.\n * (`function (arg1, arg2, ..., callback) {}`)\n * The final callback is of the form `callback(err, results...)`, which must be\n * called once the function is completed. The callback should be called with a\n * Error as its first argument to signal that an error occurred.\n * Otherwise, if no error occurred, it should be called with `null` as the first\n * argument, and any additional `result` arguments that may apply, to signal\n * successful completion.\n * The callback must be called exactly once, ideally on a later tick of the\n * JavaScript event loop.\n *\n * This type of function is also referred to as a \"Node-style async function\",\n * or a \"continuation passing-style function\" (CPS). Most of the methods of this\n * library are themselves CPS/Node-style async functions, or functions that\n * return CPS/Node-style async functions.\n *\n * Wherever we accept a Node-style async function, we also directly accept an\n * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}.\n * In this case, the `async` function will not be passed a final callback\n * argument, and any thrown error will be used as the `err` argument of the\n * implicit callback, and the return value will be used as the `result` value.\n * (i.e. a `rejected` of the returned Promise becomes the `err` callback\n * argument, and a `resolved` value becomes the `result`.)\n *\n * Note, due to JavaScript limitations, we can only detect native `async`\n * functions and not transpilied implementations.\n * Your environment must have `async`/`await` support for this to work.\n * (e.g. Node > v7.6, or a recent version of a modern browser).\n * If you are using `async` functions through a transpiler (e.g. Babel), you\n * must still wrap the function with [asyncify]{@link module:Utils.asyncify},\n * because the `async function` will be compiled to an ordinary function that\n * returns a promise.\n *\n * @typedef {Function} AsyncFunction\n * @static\n */\n\n/**\n * Async is a utility module which provides straight-forward, powerful functions\n * for working with asynchronous JavaScript. Although originally designed for\n * use with [Node.js](http://nodejs.org) and installable via\n * `npm install --save async`, it can also be used directly in the browser.\n * @module async\n * @see AsyncFunction\n */\n\n\n/**\n * A collection of `async` functions for manipulating collections, such as\n * arrays and objects.\n * @module Collections\n */\n\n/**\n * A collection of `async` functions for controlling the flow through a script.\n * @module ControlFlow\n */\n\n/**\n * A collection of `async` utility functions.\n * @module Utils\n */\n\nvar index = {\n apply: apply,\n applyEach: applyEach,\n applyEachSeries: applyEachSeries,\n asyncify: asyncify,\n auto: auto,\n autoInject: autoInject,\n cargo: cargo,\n compose: compose,\n concat: concat,\n concatLimit: concatLimit,\n concatSeries: concatSeries,\n constant: constant,\n detect: detect,\n detectLimit: detectLimit,\n detectSeries: detectSeries,\n dir: dir,\n doDuring: doDuring,\n doUntil: doUntil,\n doWhilst: doWhilst,\n during: during,\n each: eachLimit,\n eachLimit: eachLimit$1,\n eachOf: eachOf,\n eachOfLimit: eachOfLimit,\n eachOfSeries: eachOfSeries,\n eachSeries: eachSeries,\n ensureAsync: ensureAsync,\n every: every,\n everyLimit: everyLimit,\n everySeries: everySeries,\n filter: filter,\n filterLimit: filterLimit,\n filterSeries: filterSeries,\n forever: forever,\n groupBy: groupBy,\n groupByLimit: groupByLimit,\n groupBySeries: groupBySeries,\n log: log,\n map: map,\n mapLimit: mapLimit,\n mapSeries: mapSeries,\n mapValues: mapValues,\n mapValuesLimit: mapValuesLimit,\n mapValuesSeries: mapValuesSeries,\n memoize: memoize,\n nextTick: nextTick,\n parallel: parallelLimit,\n parallelLimit: parallelLimit$1,\n priorityQueue: priorityQueue,\n queue: queue$1,\n race: race,\n reduce: reduce,\n reduceRight: reduceRight,\n reflect: reflect,\n reflectAll: reflectAll,\n reject: reject,\n rejectLimit: rejectLimit,\n rejectSeries: rejectSeries,\n retry: retry,\n retryable: retryable,\n seq: seq,\n series: series,\n setImmediate: setImmediate$1,\n some: some,\n someLimit: someLimit,\n someSeries: someSeries,\n sortBy: sortBy,\n timeout: timeout,\n times: times,\n timesLimit: timeLimit,\n timesSeries: timesSeries,\n transform: transform,\n tryEach: tryEach,\n unmemoize: unmemoize,\n until: until,\n waterfall: waterfall,\n whilst: whilst,\n\n // aliases\n all: every,\n allLimit: everyLimit,\n allSeries: everySeries,\n any: some,\n anyLimit: someLimit,\n anySeries: someSeries,\n find: detect,\n findLimit: detectLimit,\n findSeries: detectSeries,\n forEach: eachLimit,\n forEachSeries: eachSeries,\n forEachLimit: eachLimit$1,\n forEachOf: eachOf,\n forEachOfSeries: eachOfSeries,\n forEachOfLimit: eachOfLimit,\n inject: reduce,\n foldl: reduce,\n foldr: reduceRight,\n select: filter,\n selectLimit: filterLimit,\n selectSeries: filterSeries,\n wrapSync: asyncify\n};\n\nexports['default'] = index;\nexports.apply = apply;\nexports.applyEach = applyEach;\nexports.applyEachSeries = applyEachSeries;\nexports.asyncify = asyncify;\nexports.auto = auto;\nexports.autoInject = autoInject;\nexports.cargo = cargo;\nexports.compose = compose;\nexports.concat = concat;\nexports.concatLimit = concatLimit;\nexports.concatSeries = concatSeries;\nexports.constant = constant;\nexports.detect = detect;\nexports.detectLimit = detectLimit;\nexports.detectSeries = detectSeries;\nexports.dir = dir;\nexports.doDuring = doDuring;\nexports.doUntil = doUntil;\nexports.doWhilst = doWhilst;\nexports.during = during;\nexports.each = eachLimit;\nexports.eachLimit = eachLimit$1;\nexports.eachOf = eachOf;\nexports.eachOfLimit = eachOfLimit;\nexports.eachOfSeries = eachOfSeries;\nexports.eachSeries = eachSeries;\nexports.ensureAsync = ensureAsync;\nexports.every = every;\nexports.everyLimit = everyLimit;\nexports.everySeries = everySeries;\nexports.filter = filter;\nexports.filterLimit = filterLimit;\nexports.filterSeries = filterSeries;\nexports.forever = forever;\nexports.groupBy = groupBy;\nexports.groupByLimit = groupByLimit;\nexports.groupBySeries = groupBySeries;\nexports.log = log;\nexports.map = map;\nexports.mapLimit = mapLimit;\nexports.mapSeries = mapSeries;\nexports.mapValues = mapValues;\nexports.mapValuesLimit = mapValuesLimit;\nexports.mapValuesSeries = mapValuesSeries;\nexports.memoize = memoize;\nexports.nextTick = nextTick;\nexports.parallel = parallelLimit;\nexports.parallelLimit = parallelLimit$1;\nexports.priorityQueue = priorityQueue;\nexports.queue = queue$1;\nexports.race = race;\nexports.reduce = reduce;\nexports.reduceRight = reduceRight;\nexports.reflect = reflect;\nexports.reflectAll = reflectAll;\nexports.reject = reject;\nexports.rejectLimit = rejectLimit;\nexports.rejectSeries = rejectSeries;\nexports.retry = retry;\nexports.retryable = retryable;\nexports.seq = seq;\nexports.series = series;\nexports.setImmediate = setImmediate$1;\nexports.some = some;\nexports.someLimit = someLimit;\nexports.someSeries = someSeries;\nexports.sortBy = sortBy;\nexports.timeout = timeout;\nexports.times = times;\nexports.timesLimit = timeLimit;\nexports.timesSeries = timesSeries;\nexports.transform = transform;\nexports.tryEach = tryEach;\nexports.unmemoize = unmemoize;\nexports.until = until;\nexports.waterfall = waterfall;\nexports.whilst = whilst;\nexports.all = every;\nexports.allLimit = everyLimit;\nexports.allSeries = everySeries;\nexports.any = some;\nexports.anyLimit = someLimit;\nexports.anySeries = someSeries;\nexports.find = detect;\nexports.findLimit = detectLimit;\nexports.findSeries = detectSeries;\nexports.forEach = eachLimit;\nexports.forEachSeries = eachSeries;\nexports.forEachLimit = eachLimit$1;\nexports.forEachOf = eachOf;\nexports.forEachOfSeries = eachOfSeries;\nexports.forEachOfLimit = eachOfLimit;\nexports.inject = reduce;\nexports.foldl = reduce;\nexports.foldr = reduceRight;\nexports.select = filter;\nexports.selectLimit = filterLimit;\nexports.selectSeries = filterSeries;\nexports.wrapSync = asyncify;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","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","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildFullPath = require('../core/buildFullPath');\nvar buildURL = require('./../helpers/buildURL');\nvar http = require('http');\nvar https = require('https');\nvar httpFollow = require('follow-redirects').http;\nvar httpsFollow = require('follow-redirects').https;\nvar url = require('url');\nvar zlib = require('zlib');\nvar VERSION = require('./../env/data').version;\nvar transitionalDefaults = require('../defaults/transitional');\nvar AxiosError = require('../core/AxiosError');\nvar CanceledError = require('../cancel/CanceledError');\n\nvar isHttps = /https:?/;\n\nvar supportedProtocols = [ 'http:', 'https:', 'file:' ];\n\n/**\n *\n * @param {http.ClientRequestArgs} options\n * @param {AxiosProxyConfig} proxy\n * @param {string} location\n */\nfunction setProxy(options, proxy, location) {\n options.hostname = proxy.host;\n options.host = proxy.host;\n options.port = proxy.port;\n options.path = location;\n\n // Basic proxy authorization\n if (proxy.auth) {\n var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n\n // If a proxy is used, any redirects must also pass through the proxy\n options.beforeRedirect = function beforeRedirect(redirection) {\n redirection.headers.host = redirection.host;\n setProxy(redirection, proxy, redirection.href);\n };\n}\n\n/*eslint consistent-return:0*/\nmodule.exports = function httpAdapter(config) {\n return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {\n var 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 var resolve = function resolve(value) {\n done();\n resolvePromise(value);\n };\n var rejected = false;\n var reject = function reject(value) {\n done();\n rejected = true;\n rejectPromise(value);\n };\n var data = config.data;\n var headers = config.headers;\n var headerNames = {};\n\n Object.keys(headers).forEach(function storeLowerName(name) {\n headerNames[name.toLowerCase()] = name;\n });\n\n // Set User-Agent (required by some servers)\n // See https://github.com/axios/axios/issues/69\n if ('user-agent' in headerNames) {\n // User-Agent is specified; handle case where no UA header is desired\n if (!headers[headerNames['user-agent']]) {\n delete headers[headerNames['user-agent']];\n }\n // Otherwise, use specified value\n } else {\n // Only set header if it hasn't been set in config\n headers['User-Agent'] = 'axios/' + VERSION;\n }\n\n // support for https://www.npmjs.com/package/form-data api\n if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {\n Object.assign(headers, data.getHeaders());\n } else if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) {\n // Nothing to do...\n } 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 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 // Add Content-Length header if data exists\n if (!headerNames['content-length']) {\n headers['Content-Length'] = data.length;\n }\n }\n\n // HTTP basic authentication\n var auth = undefined;\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n // Parse url\n var fullPath = buildFullPath(config.baseURL, config.url);\n var parsed = url.parse(fullPath);\n var protocol = parsed.protocol || supportedProtocols[0];\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 if (!auth && parsed.auth) {\n var urlAuth = parsed.auth.split(':');\n var urlUsername = urlAuth[0] || '';\n var urlPassword = urlAuth[1] || '';\n auth = urlUsername + ':' + urlPassword;\n }\n\n if (auth && headerNames.authorization) {\n delete headers[headerNames.authorization];\n }\n\n var isHttpsRequest = isHttps.test(protocol);\n var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n\n try {\n buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, '');\n } catch (err) {\n var customErr = new Error(err.message);\n customErr.config = config;\n customErr.url = config.url;\n customErr.exists = true;\n reject(customErr);\n }\n\n var options = {\n path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, ''),\n method: config.method.toUpperCase(),\n headers: headers,\n agent: agent,\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth: auth\n };\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n }\n\n var proxy = config.proxy;\n if (!proxy && proxy !== false) {\n var proxyEnv = protocol.slice(0, -1) + '_proxy';\n var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];\n if (proxyUrl) {\n var parsedProxyUrl = url.parse(proxyUrl);\n var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;\n var shouldProxy = true;\n\n if (noProxyEnv) {\n var noProxy = noProxyEnv.split(',').map(function trim(s) {\n return s.trim();\n });\n\n shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {\n if (!proxyElement) {\n return false;\n }\n if (proxyElement === '*') {\n return true;\n }\n if (proxyElement[0] === '.' &&\n parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {\n return true;\n }\n\n return parsed.hostname === proxyElement;\n });\n }\n\n if (shouldProxy) {\n proxy = {\n host: parsedProxyUrl.hostname,\n port: parsedProxyUrl.port,\n protocol: parsedProxyUrl.protocol\n };\n\n if (parsedProxyUrl.auth) {\n var proxyUrlAuth = parsedProxyUrl.auth.split(':');\n proxy.auth = {\n username: proxyUrlAuth[0],\n password: proxyUrlAuth[1]\n };\n }\n }\n }\n }\n\n if (proxy) {\n options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');\n setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);\n }\n\n var transport;\n var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsProxy ? https : http;\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n if (config.beforeRedirect) {\n options.beforeRedirect = config.beforeRedirect;\n }\n transport = isHttpsProxy ? httpsFollow : httpFollow;\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n }\n\n if (config.insecureHTTPParser) {\n options.insecureHTTPParser = config.insecureHTTPParser;\n }\n\n // Create the request\n var req = transport.request(options, function handleResponse(res) {\n if (req.aborted) return;\n\n // uncompress the response body transparently if required\n var stream = res;\n\n // return the last request in case of redirects\n var lastRequest = res.req || req;\n\n\n // if no content, is HEAD request or decompress disabled we should not decompress\n if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) {\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 stream = stream.pipe(zlib.createUnzip());\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n }\n }\n\n var response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: res.headers,\n config: config,\n request: lastRequest\n };\n\n if (config.responseType === 'stream') {\n response.data = stream;\n settle(resolve, reject, response);\n } else {\n var responseBuffer = [];\n var totalResponseBytes = 0;\n stream.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.destoy() emit aborted event before calling reject() on Node.js v16\n rejected = true;\n stream.destroy();\n reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE, config, lastRequest));\n }\n });\n\n stream.on('aborted', function handlerStreamAborted() {\n if (rejected) {\n return;\n }\n stream.destroy();\n reject(new AxiosError(\n 'maxContentLength size of ' + config.maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n lastRequest\n ));\n });\n\n stream.on('error', function handleStreamError(err) {\n if (req.aborted) return;\n reject(AxiosError.from(err, null, config, lastRequest));\n });\n\n stream.on('end', function handleStreamEnd() {\n try {\n var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);\n if (config.responseType !== 'arraybuffer') {\n responseData = responseData.toString(config.responseEncoding);\n if (!config.responseEncoding || config.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\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 var 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 devoring 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 req.abort();\n var transitional = config.transitional || transitionalDefaults;\n reject(new AxiosError(\n 'timeout of ' + timeout + 'ms exceeded',\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n req\n ));\n });\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (req.aborted) return;\n\n req.abort();\n reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);\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\n // Send the request\n if (utils.isStream(data)) {\n data.on('error', function handleStreamError(err) {\n reject(AxiosError.from(err, config, null, req));\n }).pipe(req);\n } else {\n req.end(data);\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar transitionalDefaults = require('../defaults/transitional');\nvar AxiosError = require('../core/AxiosError');\nvar CanceledError = require('../cancel/CanceledError');\nvar parseProtocol = require('../helpers/parseProtocol');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var 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) && utils.isStandardBrowserEnv()) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var 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 var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: 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, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var 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 (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\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', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new CanceledError() : 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 if (!requestData) {\n requestData = null;\n }\n\n var protocol = parseProtocol(fullPath);\n\n if (protocol && [ 'http', 'https', 'file' ].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);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\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\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = require('./cancel/CanceledError');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\naxios.toFormData = require('./helpers/toFormData');\n\n// Expose AxiosError class\naxios.AxiosError = require('../lib/core/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};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar CanceledError = require('./CanceledError');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(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) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function 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\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var 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 */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nvar AxiosError = require('../core/AxiosError');\nvar utils = require('../utils');\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction CanceledError(message) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nmodule.exports = CanceledError;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar buildFullPath = require('./buildFullPath');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(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 {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function 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 // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\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 // filter out skipped interceptors\n var requestInterceptorChain = [];\n var 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 var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n var fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\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: method,\n url: 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: method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url: url,\n data: data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('../utils');\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 * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\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\nvar prototype = AxiosError.prototype;\nvar 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// eslint-disable-next-line func-names\n].forEach(function(code) {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = function(error, code, config, request, response, customProps) {\n var axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nmodule.exports = AxiosError;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\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 */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: 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 */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\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 */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\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 * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar CanceledError = require('../cancel/CanceledError');\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\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 * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var 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 response.data,\n response.headers,\n config.transformResponse\n );\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 reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('../utils');\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 * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var 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 var 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 var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","'use strict';\n\nvar AxiosError = require('./AxiosError');\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 */\nmodule.exports = function settle(resolve, reject, response) {\n var 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","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","// eslint-disable-next-line strict\nmodule.exports = require('form-data');\n","'use strict';\n\nvar utils = require('../utils');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\nvar AxiosError = require('../core/AxiosError');\nvar transitionalDefaults = require('./transitional');\nvar toFormData = require('../helpers/toFormData');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('../adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('../adapters/http');\n }\n return adapter;\n}\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\nvar defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n 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 setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n\n var isObjectPayload = utils.isObject(data);\n var contentType = headers && headers['Content-Type'];\n\n var isFileList;\n\n if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {\n var _FormData = this.env && this.env.FormData;\n return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData());\n } else if (isObjectPayload || contentType === 'application/json') {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\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: require('./env/FormData')\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\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","module.exports = {\n \"version\": \"0.27.2\"\n};","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\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 * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\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 * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.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 var 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 var 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);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function 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","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.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 var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var 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 var 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 var 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);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\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} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nmodule.exports = function parseProtocol(url) {\n var match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n};\n","'use strict';\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 * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Convert a data object to FormData\n * @param {Object} obj\n * @param {?Object} [formData]\n * @returns {Object}\n **/\n\nfunction toFormData(obj, formData) {\n // eslint-disable-next-line no-param-reassign\n formData = formData || new FormData();\n\n var stack = [];\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n function build(data, parentKey) {\n if (utils.isPlainObject(data) || utils.isArray(data)) {\n if (stack.indexOf(data) !== -1) {\n throw Error('Circular reference detected in ' + parentKey);\n }\n\n stack.push(data);\n\n utils.forEach(data, function each(value, key) {\n if (utils.isUndefined(value)) return;\n var fullKey = parentKey ? parentKey + '.' + key : key;\n var arr;\n\n if (value && !parentKey && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {\n // eslint-disable-next-line func-names\n arr.forEach(function(el) {\n !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));\n });\n return;\n }\n }\n\n build(value, fullKey);\n });\n\n stack.pop();\n } else {\n formData.append(parentKey, convertValue(data));\n }\n }\n\n build(obj);\n\n return formData;\n}\n\nmodule.exports = toFormData;\n","'use strict';\n\nvar VERSION = require('../env/data').version;\nvar AxiosError = require('../core/AxiosError');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\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 * @returns {function}\n */\nvalidators.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 function(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 * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\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 var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var 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\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n// eslint-disable-next-line func-names\nvar kindOf = (function(cache) {\n // eslint-disable-next-line func-names\n return function(thing) {\n var str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n };\n})(Object.create(null));\n\nfunction kindOfTest(type) {\n type = type.toLowerCase();\n return function isKindOf(thing) {\n return kindOf(thing) === type;\n };\n}\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\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 && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nvar isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var 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 {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nvar isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nvar isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nvar isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nvar isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} thing The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(thing) {\n var 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 * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nvar 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 * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\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 */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\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 (var 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 for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\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 * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function 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 (var i = 0, l = arguments.length; i < l; i++) {\n 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 * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\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 * @return {string} content value without BOM\n */\nfunction 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\nfunction inherits(constructor, superConstructor, props, descriptors) {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\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} [filter]\n * @returns {Object}\n */\n\nfunction toFlatObject(sourceObj, destObj, filter) {\n var props;\n var i;\n var prop;\n var merged = {};\n\n destObj = destObj || {};\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if (!merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = Object.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 * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n * @returns {boolean}\n */\nfunction 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 var lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object\n * @param {*} [thing]\n * @returns {Array}\n */\nfunction toArray(thing) {\n if (!thing) return null;\n var i = thing.length;\n if (isUndefined(i)) return null;\n var arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n// eslint-disable-next-line func-names\nvar isTypedArray = (function(TypedArray) {\n // eslint-disable-next-line func-names\n return function(thing) {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM,\n inherits: inherits,\n toFlatObject: toFlatObject,\n kindOf: kindOf,\n kindOfTest: kindOfTest,\n endsWith: endsWith,\n toArray: toArray,\n isTypedArray: isTypedArray,\n isFileList: isFileList\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';\nmodule.exports = (flag, argv) => {\n\targv = argv || process.argv;\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst pos = argv.indexOf(prefix + flag);\n\tconst terminatorPos = argv.indexOf('--');\n\treturn pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);\n};\n","'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","var path = require('path');\nvar fs = require('fs');\nvar _0777 = parseInt('0777', 8);\n\nmodule.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;\n\nfunction mkdirP (p, opts, f, made) {\n if (typeof opts === 'function') {\n f = opts;\n opts = {};\n }\n else if (!opts || typeof opts !== 'object') {\n opts = { mode: opts };\n }\n \n var mode = opts.mode;\n var xfs = opts.fs || fs;\n \n if (mode === undefined) {\n mode = _0777\n }\n if (!made) made = null;\n \n var cb = f || /* istanbul ignore next */ function () {};\n p = path.resolve(p);\n \n xfs.mkdir(p, mode, function (er) {\n if (!er) {\n made = made || p;\n return cb(null, made);\n }\n switch (er.code) {\n case 'ENOENT':\n /* istanbul ignore if */\n if (path.dirname(p) === p) return cb(er);\n mkdirP(path.dirname(p), opts, function (er, made) {\n /* istanbul ignore if */\n if (er) cb(er, made);\n else mkdirP(p, opts, cb, made);\n });\n break;\n\n // In the case of any other error, just see if there's a dir\n // there already. If so, then hooray! If not, then something\n // is borked.\n default:\n xfs.stat(p, function (er2, stat) {\n // if the stat fails, then that's super weird.\n // let the original error be the failure reason.\n if (er2 || !stat.isDirectory()) cb(er, made)\n else cb(null, made);\n });\n break;\n }\n });\n}\n\nmkdirP.sync = function sync (p, opts, made) {\n if (!opts || typeof opts !== 'object') {\n opts = { mode: opts };\n }\n \n var mode = opts.mode;\n var xfs = opts.fs || fs;\n \n if (mode === undefined) {\n mode = _0777\n }\n if (!made) made = null;\n\n p = path.resolve(p);\n\n try {\n xfs.mkdirSync(p, mode);\n made = made || p;\n }\n catch (err0) {\n switch (err0.code) {\n case 'ENOENT' :\n made = sync(path.dirname(p), opts, made);\n sync(p, opts, made);\n break;\n\n // In the case of any other error, just see if there's a dir\n // there already. If so, then hooray! If not, then something\n // is borked.\n default:\n var stat;\n try {\n stat = xfs.statSync(p);\n }\n catch (err1) /* istanbul ignore next */ {\n throw err0;\n }\n /* istanbul ignore if */\n if (!stat.isDirectory()) throw err0;\n break;\n }\n }\n\n return made;\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","/*\n * portfinder.js: A simple tool to find an open port on the current machine.\n *\n * (C) 2011, Charlie Robbins\n *\n */\n\n\"use strict\";\n\nvar fs = require('fs'),\n os = require('os'),\n net = require('net'),\n path = require('path'),\n _async = require('async'),\n debug = require('debug'),\n mkdirp = require('mkdirp').mkdirp;\n\nvar debugTestPort = debug('portfinder:testPort'),\n debugGetPort = debug('portfinder:getPort'),\n debugDefaultHosts = debug('portfinder:defaultHosts');\n\nvar internals = {};\n\ninternals.testPort = function(options, callback) {\n if (!callback) {\n callback = options;\n options = {};\n }\n\n options.server = options.server || net.createServer(function () {\n //\n // Create an empty listener for the port testing server.\n //\n });\n\n debugTestPort(\"entered testPort(): trying\", options.host, \"port\", options.port);\n\n function onListen () {\n debugTestPort(\"done w/ testPort(): OK\", options.host, \"port\", options.port);\n\n options.server.removeListener('error', onError);\n options.server.close();\n callback(null, options.port);\n }\n\n function onError (err) {\n debugTestPort(\"done w/ testPort(): failed\", options.host, \"w/ port\", options.port, \"with error\", err.code);\n\n options.server.removeListener('listening', onListen);\n\n if (!(err.code == 'EADDRINUSE' || err.code == 'EACCES')) {\n return callback(err);\n }\n\n var nextPort = exports.nextPort(options.port);\n\n if (nextPort > exports.highestPort) {\n return callback(new Error('No open ports available'));\n }\n\n internals.testPort({\n port: nextPort,\n host: options.host,\n server: options.server\n }, callback);\n }\n\n options.server.once('error', onError);\n options.server.once('listening', onListen);\n\n if (options.host) {\n options.server.listen(options.port, options.host);\n } else {\n /*\n Judgement of service without host\n example:\n express().listen(options.port)\n */\n options.server.listen(options.port);\n }\n};\n\n//\n// ### @basePort {Number}\n// The lowest port to begin any port search from\n//\nexports.basePort = 8000;\n\n//\n// ### @highestPort {Number}\n// Largest port number is an unsigned short 2**16 -1=65335\n//\nexports.highestPort = 65535;\n\n//\n// ### @basePath {string}\n// Default path to begin any socket search from\n//\nexports.basePath = '/tmp/portfinder'\n\n//\n// ### function getPort (options, callback)\n// #### @options {Object} Settings to use when finding the necessary port\n// #### @callback {function} Continuation to respond to when complete.\n// Responds with a unbound port on the current machine.\n//\nexports.getPort = function (options, callback) {\n if (!callback) {\n callback = options;\n options = {};\n\n }\n\n options.port = Number(options.port) || Number(exports.basePort);\n options.host = options.host || null;\n options.stopPort = Number(options.stopPort) || Number(exports.highestPort);\n\n if(!options.startPort) {\n options.startPort = Number(options.port);\n if(options.startPort < 0) {\n throw Error('Provided options.startPort(' + options.startPort + ') is less than 0, which are cannot be bound.');\n }\n if(options.stopPort < options.startPort) {\n throw Error('Provided options.stopPort(' + options.stopPort + 'is less than options.startPort (' + options.startPort + ')');\n }\n }\n\n if (options.host) {\n\n var hasUserGivenHost;\n for (var i = 0; i < exports._defaultHosts.length; i++) {\n if (exports._defaultHosts[i] === options.host) {\n hasUserGivenHost = true;\n break;\n }\n }\n\n if (!hasUserGivenHost) {\n exports._defaultHosts.push(options.host);\n }\n\n }\n\n var openPorts = [], currentHost;\n return _async.eachSeries(exports._defaultHosts, function(host, next) {\n debugGetPort(\"in eachSeries() iteration callback: host is\", host);\n\n return internals.testPort({ host: host, port: options.port }, function(err, port) {\n if (err) {\n debugGetPort(\"in eachSeries() iteration callback testPort() callback\", \"with an err:\", err.code);\n currentHost = host;\n return next(err);\n } else {\n debugGetPort(\"in eachSeries() iteration callback testPort() callback\",\n \"with a success for port\", port);\n openPorts.push(port);\n return next();\n }\n });\n }, function(err) {\n\n if (err) {\n debugGetPort(\"in eachSeries() result callback: err is\", err);\n // If we get EADDRNOTAVAIL it means the host is not bindable, so remove it\n // from exports._defaultHosts and start over. For ubuntu, we use EINVAL for the same\n if (err.code === 'EADDRNOTAVAIL' || err.code === 'EINVAL') {\n if (options.host === currentHost) {\n // if bad address matches host given by user, tell them\n //\n // NOTE: We may need to one day handle `my-non-existent-host.local` if users\n // report frustration with passing in hostnames that DONT map to bindable\n // hosts, without showing them a good error.\n var msg = 'Provided host ' + options.host + ' could NOT be bound. Please provide a different host address or hostname';\n return callback(Error(msg));\n } else {\n var idx = exports._defaultHosts.indexOf(currentHost);\n exports._defaultHosts.splice(idx, 1);\n return exports.getPort(options, callback);\n }\n } else {\n // error is not accounted for, file ticket, handle special case\n return callback(err);\n }\n }\n\n // sort so we can compare first host to last host\n openPorts.sort(function(a, b) {\n return a - b;\n });\n\n debugGetPort(\"in eachSeries() result callback: openPorts is\", openPorts);\n\n if (openPorts[0] === openPorts[openPorts.length-1]) {\n // if first === last, we found an open port\n if(openPorts[0] <= options.stopPort) {\n return callback(null, openPorts[0]);\n }\n else {\n var msg = 'No open ports found in between '+ options.startPort + ' and ' + options.stopPort;\n return callback(Error(msg));\n }\n } else {\n // otherwise, try again, using sorted port, aka, highest open for >= 1 host\n return exports.getPort({ port: openPorts.pop(), host: options.host, startPort: options.startPort, stopPort: options.stopPort }, callback);\n }\n\n });\n};\n\n//\n// ### function getPortPromise (options)\n// #### @options {Object} Settings to use when finding the necessary port\n// Responds a promise to an unbound port on the current machine.\n//\nexports.getPortPromise = function (options) {\n if (typeof Promise !== 'function') {\n throw Error('Native promise support is not available in this version of node.' +\n 'Please install a polyfill and assign Promise to global.Promise before calling this method');\n }\n if (!options) {\n options = {};\n }\n return new Promise(function(resolve, reject) {\n exports.getPort(options, function(err, port) {\n if (err) {\n return reject(err);\n }\n resolve(port);\n });\n });\n}\n\n//\n// ### function getPorts (count, options, callback)\n// #### @count {Number} The number of ports to find\n// #### @options {Object} Settings to use when finding the necessary port\n// #### @callback {function} Continuation to respond to when complete.\n// Responds with an array of unbound ports on the current machine.\n//\nexports.getPorts = function (count, options, callback) {\n if (!callback) {\n callback = options;\n options = {};\n }\n\n var lastPort = null;\n _async.timesSeries(count, function(index, asyncCallback) {\n if (lastPort) {\n options.port = exports.nextPort(lastPort);\n }\n\n exports.getPort(options, function (err, port) {\n if (err) {\n asyncCallback(err);\n } else {\n lastPort = port;\n asyncCallback(null, port);\n }\n });\n }, callback);\n};\n\n//\n// ### function getSocket (options, callback)\n// #### @options {Object} Settings to use when finding the necessary port\n// #### @callback {function} Continuation to respond to when complete.\n// Responds with a unbound socket using the specified directory and base\n// name on the current machine.\n//\nexports.getSocket = function (options, callback) {\n if (!callback) {\n callback = options;\n options = {};\n }\n\n options.mod = options.mod || parseInt(755, 8);\n options.path = options.path || exports.basePath + '.sock';\n\n //\n // Tests the specified socket\n //\n function testSocket () {\n fs.stat(options.path, function (err) {\n //\n // If file we're checking doesn't exist (thus, stating it emits ENOENT),\n // we should be OK with listening on this socket.\n //\n if (err) {\n if (err.code == 'ENOENT') {\n callback(null, options.path);\n }\n else {\n callback(err);\n }\n }\n else {\n //\n // This file exists, so it isn't possible to listen on it. Lets try\n // next socket.\n //\n options.path = exports.nextSocket(options.path);\n exports.getSocket(options, callback);\n }\n });\n }\n\n //\n // Create the target `dir` then test connection\n // against the socket.\n //\n function createAndTestSocket (dir) {\n mkdirp(dir, options.mod, function (err) {\n if (err) {\n return callback(err);\n }\n\n options.exists = true;\n testSocket();\n });\n }\n\n //\n // Check if the parent directory of the target\n // socket path exists. If it does, test connection\n // against the socket. Otherwise, create the directory\n // then test connection.\n //\n function checkAndTestSocket () {\n var dir = path.dirname(options.path);\n\n fs.stat(dir, function (err, stats) {\n if (err || !stats.isDirectory()) {\n return createAndTestSocket(dir);\n }\n\n options.exists = true;\n testSocket();\n });\n }\n\n //\n // If it has been explicitly stated that the\n // target `options.path` already exists, then\n // simply test the socket.\n //\n return options.exists\n ? testSocket()\n : checkAndTestSocket();\n};\n\n//\n// ### function nextPort (port)\n// #### @port {Number} Port to increment from.\n// Gets the next port in sequence from the\n// specified `port`.\n//\nexports.nextPort = function (port) {\n return port + 1;\n};\n\n//\n// ### function nextSocket (socketPath)\n// #### @socketPath {string} Path to increment from\n// Gets the next socket path in sequence from the\n// specified `socketPath`.\n//\nexports.nextSocket = function (socketPath) {\n var dir = path.dirname(socketPath),\n name = path.basename(socketPath, '.sock'),\n match = name.match(/^([a-zA-z]+)(\\d*)$/i),\n index = parseInt(match[2]),\n base = match[1];\n if (isNaN(index)) {\n index = 0;\n }\n\n index += 1;\n return path.join(dir, base + index + '.sock');\n};\n\n/**\n * @desc List of internal hostnames provided by your machine. A user\n * provided hostname may also be provided when calling portfinder.getPort,\n * which would then be added to the default hosts we lookup and return here.\n *\n * @return {array}\n *\n * Long Form Explantion:\n *\n * - Input: (os.networkInterfaces() w/ MacOS 10.11.5+ and running a VM)\n *\n * { lo0:\n * [ { address: '::1',\n * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',\n * family: 'IPv6',\n * mac: '00:00:00:00:00:00',\n * scopeid: 0,\n * internal: true },\n * { address: '127.0.0.1',\n * netmask: '255.0.0.0',\n * family: 'IPv4',\n * mac: '00:00:00:00:00:00',\n * internal: true },\n * { address: 'fe80::1',\n * netmask: 'ffff:ffff:ffff:ffff::',\n * family: 'IPv6',\n * mac: '00:00:00:00:00:00',\n * scopeid: 1,\n * internal: true } ],\n * en0:\n * [ { address: 'fe80::a299:9bff:fe17:766d',\n * netmask: 'ffff:ffff:ffff:ffff::',\n * family: 'IPv6',\n * mac: 'a0:99:9b:17:76:6d',\n * scopeid: 4,\n * internal: false },\n * { address: '10.0.1.22',\n * netmask: '255.255.255.0',\n * family: 'IPv4',\n * mac: 'a0:99:9b:17:76:6d',\n * internal: false } ],\n * awdl0:\n * [ { address: 'fe80::48a8:37ff:fe34:aaef',\n * netmask: 'ffff:ffff:ffff:ffff::',\n * family: 'IPv6',\n * mac: '4a:a8:37:34:aa:ef',\n * scopeid: 8,\n * internal: false } ],\n * vnic0:\n * [ { address: '10.211.55.2',\n * netmask: '255.255.255.0',\n * family: 'IPv4',\n * mac: '00:1c:42:00:00:08',\n * internal: false } ],\n * vnic1:\n * [ { address: '10.37.129.2',\n * netmask: '255.255.255.0',\n * family: 'IPv4',\n * mac: '00:1c:42:00:00:09',\n * internal: false } ] }\n *\n * - Output:\n *\n * [\n * '0.0.0.0',\n * '::1',\n * '127.0.0.1',\n * 'fe80::1',\n * '10.0.1.22',\n * 'fe80::48a8:37ff:fe34:aaef',\n * '10.211.55.2',\n * '10.37.129.2'\n * ]\n *\n * Note we export this so we can use it in our tests, otherwise this API is private\n */\nexports._defaultHosts = (function() {\n var interfaces = {};\n try{\n interfaces = os.networkInterfaces();\n }\n catch(e) {\n // As of October 2016, Windows Subsystem for Linux (WSL) does not support\n // the os.networkInterfaces() call and throws instead. For this platform,\n // assume 0.0.0.0 as the only address\n //\n // - https://github.com/Microsoft/BashOnWindows/issues/468\n //\n // - Workaround is a mix of good work from the community:\n // - https://github.com/http-party/node-portfinder/commit/8d7e30a648ff5034186551fa8a6652669dec2f2f\n // - https://github.com/yarnpkg/yarn/pull/772/files\n if (e.syscall === 'uv_interface_addresses') {\n // swallow error because we're just going to use defaults\n // documented @ https://github.com/nodejs/node/blob/4b65a65e75f48ff447cabd5500ce115fb5ad4c57/doc/api/net.md#L231\n } else {\n throw e;\n }\n }\n\n var interfaceNames = Object.keys(interfaces),\n hiddenButImportantHost = '0.0.0.0', // !important - dont remove, hence the naming :)\n results = [hiddenButImportantHost];\n for (var i = 0; i < interfaceNames.length; i++) {\n var _interface = interfaces[interfaceNames[i]];\n for (var j = 0; j < _interface.length; j++) {\n var curr = _interface[j];\n results.push(curr.address);\n }\n }\n\n // add null value, For createServer function, do not use host.\n results.push(null);\n\n debugDefaultHosts(\"exports._defaultHosts is: %o\", results);\n\n return results;\n}());\n","\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n/**\n * Colors.\n */\n\nexports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];\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// eslint-disable-next-line complexity\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n return true;\n } // Internet Explorer and Edge do not support colors.\n\n\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n } // Is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\n\n return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773\n typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);\n}\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\n\nfunction formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function (match) {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\n\nfunction log() {\n var _console;\n\n // This hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return (typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);\n}\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\n\nfunction save(namespaces) {\n try {\n if (namespaces) {\n exports.storage.setItem('debug', namespaces);\n } else {\n exports.storage.removeItem('debug');\n }\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\n\nfunction load() {\n var r;\n\n try {\n r = exports.storage.getItem('debug');\n } catch (error) {} // Swallow\n // XXX (@Qix-) should we be logging these?\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\n\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\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\n\nfunction localstorage() {\n try {\n // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n // The Browser also has localStorage in the global context.\n return localStorage;\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n\nmodule.exports = require('./common')(exports);\nvar formatters = module.exports.formatters;\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n try {\n return JSON.stringify(v);\n } catch (error) {\n return '[UnexpectedJSONParseError]: ' + error.message;\n }\n};\n\n","\"use strict\";\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\nfunction setup(env) {\n createDebug.debug = createDebug;\n createDebug.default = createDebug;\n createDebug.coerce = coerce;\n createDebug.disable = disable;\n createDebug.enable = enable;\n createDebug.enabled = enabled;\n createDebug.humanize = require('ms');\n Object.keys(env).forEach(function (key) {\n createDebug[key] = env[key];\n });\n /**\n * Active `debug` instances.\n */\n\n createDebug.instances = [];\n /**\n * The currently active debug mode names, and names to skip.\n */\n\n createDebug.names = [];\n createDebug.skips = [];\n /**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\n createDebug.formatters = {};\n /**\n * Selects a color for a debug namespace\n * @param {String} namespace The namespace string for the for the debug instance to be colored\n * @return {Number|String} An ANSI color code for the given namespace\n * @api private\n */\n\n function selectColor(namespace) {\n var hash = 0;\n\n for (var i = 0; i < namespace.length; i++) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n }\n\n createDebug.selectColor = selectColor;\n /**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n function createDebug(namespace) {\n var prevTime;\n\n function debug() {\n // Disabled?\n if (!debug.enabled) {\n return;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var self = debug; // Set `diff` timestamp\n\n var curr = Number(new Date());\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n args[0] = createDebug.coerce(args[0]);\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O');\n } // Apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // If we encounter an escaped % then don't increase the array index\n if (match === '%%') {\n return match;\n }\n\n index++;\n var formatter = createDebug.formatters[format];\n\n if (typeof formatter === 'function') {\n var val = args[index];\n match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // Apply env-specific formatting (colors, etc.)\n\n createDebug.formatArgs.call(self, args);\n var logFn = self.log || createDebug.log;\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = createDebug.enabled(namespace);\n debug.useColors = createDebug.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n debug.extend = extend; // Debug.formatArgs = formatArgs;\n // debug.rawLog = rawLog;\n // env-specific initialization logic for debug instances\n\n if (typeof createDebug.init === 'function') {\n createDebug.init(debug);\n }\n\n createDebug.instances.push(debug);\n return debug;\n }\n\n function destroy() {\n var index = createDebug.instances.indexOf(this);\n\n if (index !== -1) {\n createDebug.instances.splice(index, 1);\n return true;\n }\n\n return false;\n }\n\n function extend(namespace, delimiter) {\n return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n }\n /**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\n function enable(namespaces) {\n createDebug.save(namespaces);\n createDebug.names = [];\n createDebug.skips = [];\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) {\n // ignore empty strings\n continue;\n }\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n createDebug.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < createDebug.instances.length; i++) {\n var instance = createDebug.instances[i];\n instance.enabled = createDebug.enabled(instance.namespace);\n }\n }\n /**\n * Disable debug output.\n *\n * @api public\n */\n\n\n function disable() {\n createDebug.enable('');\n }\n /**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\n function enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n\n var i;\n var len;\n\n for (i = 0, len = createDebug.skips.length; i < len; i++) {\n if (createDebug.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = createDebug.names.length; i < len; i++) {\n if (createDebug.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\n function coerce(val) {\n if (val instanceof Error) {\n return val.stack || val.message;\n }\n\n return val;\n }\n\n createDebug.enable(createDebug.load());\n return createDebug;\n}\n\nmodule.exports = setup;\n\n","\"use strict\";\n\n/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n\n","\"use strict\";\n\n/**\n * Module dependencies.\n */\nvar tty = require('tty');\n\nvar util = require('util');\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n // eslint-disable-next-line import/no-extraneous-dependencies\n var supportsColor = require('supports-color');\n\n if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n exports.colors = [20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221];\n }\n} catch (error) {} // Swallow - we only care if `supports-color` is available; it doesn't have to be.\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\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // Camel-case\n var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) {\n return k.toUpperCase();\n }); // Coerce string value into JS value\n\n var val = process.env[key];\n\n if (/^(yes|on|true|enabled)$/i.test(val)) {\n val = true;\n } else if (/^(no|off|false|disabled)$/i.test(val)) {\n val = false;\n } else if (val === 'null') {\n val = null;\n } else {\n val = Number(val);\n }\n\n obj[prop] = val;\n return obj;\n}, {});\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\n\nfunction formatArgs(args) {\n var name = this.namespace,\n useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var colorCode = \"\\x1B[3\" + (c < 8 ? c : '8;5;' + c);\n var prefix = \" \".concat(colorCode, \";1m\").concat(name, \" \\x1B[0m\");\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + \"\\x1B[0m\");\n } else {\n args[0] = getDate() + name + ' ' + args[0];\n }\n}\n\nfunction getDate() {\n if (exports.inspectOpts.hideDate) {\n return '';\n }\n\n return new Date().toISOString() + ' ';\n}\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\n\nfunction log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\n\nfunction save(namespaces) {\n if (namespaces) {\n process.env.DEBUG = namespaces;\n } else {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n }\n}\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\n\nfunction load() {\n return process.env.DEBUG;\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\n\nfunction init(debug) {\n debug.inspectOpts = {};\n var keys = Object.keys(exports.inspectOpts);\n\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\nmodule.exports = require('./common')(exports);\nvar formatters = module.exports.formatters;\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n')\n .map(function (str) { return str.trim(); })\n .join(' ');\n};\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\n\nformatters.O = function (v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n","'use strict';\nconst os = require('os');\nconst hasFlag = require('has-flag');\n\nconst env = process.env;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false')) {\n\tforceColor = false;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = true;\n}\nif ('FORCE_COLOR' in env) {\n\tforceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(stream) {\n\tif (forceColor === false) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (stream && !stream.isTTY && forceColor !== true) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor ? 1 : 0;\n\n\tif (process.platform === 'win32') {\n\t\t// Node.js 7.5.0 is the first version of Node.js to include a patch to\n\t\t// libuv that enables 256 color output on Windows. Anything earlier and it\n\t\t// won't work. However, here we target Node.js 8 at minimum as it is an LTS\n\t\t// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows\n\t\t// release that supports 256 colors. Windows 10 build 14931 is the first release\n\t\t// that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(process.versions.node.split('.')[0]) >= 8 &&\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: getSupportLevel(process.stdout),\n\tstderr: getSupportLevel(process.stderr)\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// 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","\"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 = '[Foresight Workflow Kit]';\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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst http_1 = require(\"http\");\nconst systeminformation_1 = __importDefault(require(\"systeminformation\"));\nconst logger = __importStar(require(\"./logger\"));\nconst utils_1 = require(\"./utils\");\nconst STATS_FREQ = parseInt(process.env.WORKFLOW_TELEMETRY_STAT_FREQ || '') || 5000;\nconst SERVER_HOST = 'localhost';\nconst SERVER_PORT = parseInt(process.env.WORKFLOW_TELEMETRY_SERVER_PORT || '');\nlet expectedScheduleTime = 0;\nlet statCollectTime = 0;\nconst metricStatsData = [];\nconst metricTelemetryData = {\n \"type\": \"Metric\",\n \"version\": utils_1.WORKFLOW_TELEMETRY_VERSIONS.METRIC,\n \"data\": metricStatsData\n};\n///////////////////////////\n// CPU Stats //\n///////////////////////////\nfunction collectCPUStats(statTime, timeInterval) {\n return systeminformation_1.default\n .currentLoad()\n .then((data) => {\n const points = [\n {\n unit: \"Percentage\",\n description: \"CPU Load Total\",\n name: \"cpu.load.total\",\n value: (data.currentLoad || 0)\n },\n {\n unit: \"Percentage\",\n description: \"CPU Load User\",\n name: \"cpu.load.user\",\n value: (data.currentLoadUser || 0)\n },\n {\n unit: \"Percentage\",\n description: \"CPU Load System\",\n name: \"cpu.load.system\",\n value: (data.currentLoadSystem || 0)\n }\n ];\n const cpuStats = {\n domain: \"cpu\",\n group: \"cpu.load\",\n time: statTime,\n points: points\n };\n metricTelemetryData.data.push(cpuStats);\n })\n .catch((error) => {\n logger.error(error);\n });\n}\n///////////////////////////\n// Memory Stats //\n///////////////////////////\nfunction collectMemoryStats(statTime, timeInterval) {\n return systeminformation_1.default\n .mem()\n .then((data) => {\n const points = [\n {\n unit: \"Mb\",\n description: \"Memory Usage Total\",\n name: \"memory.usage.total\",\n value: (data.total || 0) / 1024 / 1024\n },\n {\n unit: \"Mb\",\n description: \"Memory Usage Active\",\n name: \"memory.usage.active\",\n value: (data.active || 0) / 1024 / 1024\n },\n {\n unit: \"Mb\",\n description: \"Memory Usage Available\",\n name: \"memory.usage.available\",\n value: (data.available || 0) / 1024 / 1024\n }\n ];\n const memoryStats = {\n domain: \"memory\",\n group: \"memory.usage\",\n time: statTime,\n points: points\n };\n metricTelemetryData.data.push(memoryStats);\n })\n .catch((error) => {\n logger.error(error);\n });\n}\n///////////////////////////\n// Network Stats //\n///////////////////////////\nfunction collectNetworkStats(statTime, timeInterval) {\n return systeminformation_1.default\n .networkStats()\n .then((data) => {\n let totalRxSec = 0, totalTxSec = 0;\n for (let nsd of data) {\n totalRxSec += nsd.rx_sec || 0;\n totalTxSec += nsd.tx_sec || 0;\n }\n const points = [\n {\n unit: \"Mb\",\n description: \"Network IO Receive\",\n name: \"network.io.rxMb\",\n value: Math.floor((totalRxSec * (timeInterval / 1000)) / 1024 / 1024)\n },\n {\n unit: \"Mb\",\n description: \"Network IO Transmit\",\n name: \"network.io.txMb\",\n value: Math.floor((totalTxSec * (timeInterval / 1000)) / 1024 / 1024)\n }\n ];\n const networkStats = {\n domain: \"network\",\n group: \"network.io\",\n time: statTime,\n points: points\n };\n metricTelemetryData.data.push(networkStats);\n })\n .catch((error) => {\n logger.error(error);\n });\n}\n///////////////////////////\n// Disk Stats //\n///////////////////////////\nfunction collectDiskStats(statTime, timeInterval) {\n return systeminformation_1.default\n .fsStats()\n .then((data) => {\n let rxSec = data.rx_sec ? data.rx_sec : 0;\n let wxSec = data.wx_sec ? data.wx_sec : 0;\n const points = [\n {\n unit: \"Mb\",\n description: \"Disk IO Read\",\n name: \"disk.io.rxMb\",\n value: Math.floor((rxSec * (timeInterval / 1000)) / 1024 / 1024)\n },\n {\n unit: \"Mb\",\n description: \"Disk IO Write\",\n name: \"disk.io.wxMb\",\n value: Math.floor((wxSec * (timeInterval / 1000)) / 1024 / 1024)\n }\n ];\n const diskStats = {\n domain: \"disk\",\n group: \"disk.io\",\n time: statTime,\n points: points\n };\n metricTelemetryData.data.push(diskStats);\n })\n .catch((error) => {\n logger.error(error);\n });\n}\n///////////////////////////\nfunction collectStats(triggeredFromScheduler = true) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const currentTime = Date.now();\n const timeInterval = statCollectTime\n ? currentTime - statCollectTime\n : 0;\n statCollectTime = currentTime;\n const promises = [];\n promises.push(collectCPUStats(statCollectTime, timeInterval));\n promises.push(collectMemoryStats(statCollectTime, timeInterval));\n promises.push(collectNetworkStats(statCollectTime, timeInterval));\n promises.push(collectDiskStats(statCollectTime, timeInterval));\n return promises;\n }\n finally {\n if (triggeredFromScheduler) {\n expectedScheduleTime += STATS_FREQ;\n setTimeout(collectStats, expectedScheduleTime - Date.now());\n }\n }\n });\n}\nfunction startHttpServer() {\n const server = (0, http_1.createServer)((request, response) => __awaiter(this, void 0, void 0, function* () {\n try {\n switch (request.url) {\n case '/collect': {\n if (request.method === 'POST') {\n yield collectStats(false);\n response.end();\n }\n else {\n response.statusCode = 405;\n response.end();\n }\n break;\n }\n case '/metrics': {\n if (request.method === 'GET') {\n response.end(JSON.stringify(metricTelemetryData));\n }\n else {\n response.statusCode = 405;\n response.end();\n }\n break;\n }\n default: {\n response.statusCode = 404;\n response.end();\n }\n }\n }\n catch (error) {\n logger.error(error);\n response.statusCode = 500;\n response.end(JSON.stringify({\n type: error.type,\n message: error.message\n }));\n }\n }));\n server.listen(SERVER_PORT, SERVER_HOST, () => {\n logger.info(`Stat server listening on port ${SERVER_PORT}`);\n });\n}\n// Init //\n///////////////////////////\nfunction init() {\n expectedScheduleTime = Date.now();\n logger.info('Starting stat collector ...');\n process.nextTick(collectStats);\n logger.info('Starting HTTP server ...');\n startHttpServer();\n}\ninit();\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};\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.sendData = exports.createCITelemetryData = exports.saveJobInfos = exports.setServerPort = exports.JOB_STATES_NAME = exports.WORKFLOW_TELEMETRY_ENDPOINTS = exports.WORKFLOW_TELEMETRY_VERSIONS = exports.WORKFLOW_TELEMETRY_SERVER_PORT = void 0;\nconst logger = __importStar(require(\"./logger\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst github = __importStar(require(\"@actions/github\"));\nconst axios_1 = __importDefault(require(\"axios\"));\nconst path = __importStar(require(\"path\"));\nexports.WORKFLOW_TELEMETRY_SERVER_PORT = \"WORKFLOW_TELEMETRY_SERVER_PORT\";\nexports.WORKFLOW_TELEMETRY_VERSIONS = {\n METRIC: \"v1\",\n PROCESS: \"v1\"\n};\nconst WORKFLOW_TELEMETRY_BASE_URL = `${process.env[\"WORKFLOW_TELEMETRY_BASE_URL\"] || \"https://foresight.service.thundra.io\"}`;\nexports.WORKFLOW_TELEMETRY_ENDPOINTS = {\n METRIC: new URL(path.join(\"api\", exports.WORKFLOW_TELEMETRY_VERSIONS.METRIC, \"telemetry/metrics\"), WORKFLOW_TELEMETRY_BASE_URL).toString(),\n PROCESS: new URL(path.join(\"api\", exports.WORKFLOW_TELEMETRY_VERSIONS.PROCESS, \"telemetry/processes\"), WORKFLOW_TELEMETRY_BASE_URL).toString()\n};\nexports.JOB_STATES_NAME = {\n FORESIGHT_WORKFLOW_JOB_ID: \"FORESIGHT_WORKFLOW_JOB_ID\",\n FORESIGHT_WORKFLOW_JOB_NAME: \"FORESIGHT_WORKFLOW_JOB_NAME\",\n FORESIGHT_WORKFLOW_JOB_RUN_ATTEMPT: \"FORESIGHT_WORKFLOW_JOB_RUN_ATTEMPT\"\n};\nfunction setServerPort() {\n return __awaiter(this, void 0, void 0, function* () {\n var portfinder = require('portfinder');\n portfinder.basePort = 10000;\n const port = parseInt(process.env.WORKFLOW_TELEMETRY_SERVER_PORT || '');\n if (!port) {\n process.env[\"WORKFLOW_TELEMETRY_SERVER_PORT\"] = yield portfinder.getPortPromise();\n }\n core.saveState(exports.WORKFLOW_TELEMETRY_SERVER_PORT, process.env.WORKFLOW_TELEMETRY_SERVER_PORT);\n logger.info(`Workflow telemetry server port is: ${process.env.WORKFLOW_TELEMETRY_SERVER_PORT}`);\n });\n}\nexports.setServerPort = setServerPort;\nfunction saveJobInfos(jobInfo) {\n core.exportVariable(exports.JOB_STATES_NAME.FORESIGHT_WORKFLOW_JOB_ID, jobInfo.id);\n core.exportVariable(exports.JOB_STATES_NAME.FORESIGHT_WORKFLOW_JOB_NAME, jobInfo.name);\n}\nexports.saveJobInfos = saveJobInfos;\nfunction getJobInfo() {\n const jobInfo = {\n id: parseInt(process.env[exports.JOB_STATES_NAME.FORESIGHT_WORKFLOW_JOB_ID] || ''),\n name: process.env[exports.JOB_STATES_NAME.FORESIGHT_WORKFLOW_JOB_NAME],\n };\n return jobInfo;\n}\nfunction getMetaData() {\n const { repo, runId } = github.context;\n const jobInfo = getJobInfo();\n const metaData = {\n ciProvider: \"GITHUB\",\n runId: runId,\n repoName: repo.repo,\n repoOwner: repo.owner,\n runAttempt: process.env.GITHUB_RUN_ATTEMPT,\n runnerName: process.env.RUNNER_NAME,\n jobId: jobInfo.id,\n jobName: jobInfo.name,\n };\n return metaData;\n}\nfunction createCITelemetryData(telemetryData) {\n return {\n metaData: getMetaData(),\n telemetryData: telemetryData\n };\n}\nexports.createCITelemetryData = createCITelemetryData;\nfunction sendData(url, ciTelemetryData) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.debug(`Sending data (api key=${core.getInput(\"api_key\")}) to url: ${url}`);\n try {\n const { data } = yield axios_1.default.post(url, ciTelemetryData, {\n headers: {\n 'Content-type': 'application/json; charset=utf-8',\n 'Authorization': `ApiKey ${core.getInput(\"api_key\")}`\n },\n });\n if (logger.isDebugEnabled()) {\n logger.debug(JSON.stringify(data, null, 4));\n }\n }\n catch (error) {\n if (axios_1.default.isAxiosError(error)) {\n logger.error(error.message);\n }\n else {\n logger.error(`unexpected error: ${error}`);\n }\n }\n });\n}\nexports.sendData = sendData;\n",null,"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(\"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\tid: moduleId,\n\t\tloaded: false,\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// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\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__(5914);\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;A;;;;;;AClUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;A;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;AC7+KA;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACzaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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/NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACjKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACvDA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACrGA;AACA;AACA;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;A;;;;;ACvBA;AACA;AACA;AACA;A;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACnJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACRA;AACA;AACA;AACA;A;;;;;;ACHA;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;A;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;A;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACfA;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;AACA;AACA;AACA;A;;;;;;ACrEA;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;A;;;;;;ACtDA;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;ACvdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;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;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;A;;;;;ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;AClfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;AC1PA;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;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;A;;;;;;ACpIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;ACnIA;AACA;AACA;A;;;;;AAFA;AACA;AACA;A;;;;;;;;A;;;;;;;;A;;;;;;;;A;;;;;;ACFA;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;AACA;AACA;AACA;;;;AC/BA;AACA;AACA;AACA;AACA;;;;ACJA;AACA;ACDA;AACA;AACA;AACA;;A","sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../webpack://foresight-workflow-kit-action/./node_modules/@actions/core/lib/command.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/core/lib/core.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/core/lib/file-command.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/core/lib/summary.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/core/lib/utils.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/github/lib/context.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/github/lib/github.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/github/lib/internal/utils.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/github/lib/utils.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/http-client/lib/auth.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/http-client/lib/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@actions/http-client/lib/proxy.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/auth-token/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/core/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/endpoint/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/graphql/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/request-error/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/@octokit/request/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/async/dist/async.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/index.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/lib/abort.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/lib/async.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/lib/defer.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/lib/iterate.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/lib/state.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/lib/terminator.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/parallel.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/serial.js","../webpack://foresight-workflow-kit-action/./node_modules/asynckit/serialOrdered.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/index.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/adapters/http.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/adapters/xhr.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/axios.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/cancel/CancelToken.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/cancel/CanceledError.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/cancel/isCancel.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/Axios.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/AxiosError.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/InterceptorManager.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/buildFullPath.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/dispatchRequest.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/mergeConfig.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/settle.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/core/transformData.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/defaults/env/FormData.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/defaults/index.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/defaults/transitional.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/env/data.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/bind.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/buildURL.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/combineURLs.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/cookies.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/isAbsoluteURL.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/isAxiosError.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/isURLSameOrigin.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/normalizeHeaderName.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/parseHeaders.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/parseProtocol.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/spread.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/toFormData.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/helpers/validator.js","../webpack://foresight-workflow-kit-action/./node_modules/axios/lib/utils.js","../webpack://foresight-workflow-kit-action/./node_modules/before-after-hook/index.js","../webpack://foresight-workflow-kit-action/./node_modules/before-after-hook/lib/add.js","../webpack://foresight-workflow-kit-action/./node_modules/before-after-hook/lib/register.js","../webpack://foresight-workflow-kit-action/./node_modules/before-after-hook/lib/remove.js","../webpack://foresight-workflow-kit-action/./node_modules/combined-stream/lib/combined_stream.js","../webpack://foresight-workflow-kit-action/./node_modules/debug/src/browser.js","../webpack://foresight-workflow-kit-action/./node_modules/debug/src/common.js","../webpack://foresight-workflow-kit-action/./node_modules/debug/src/index.js","../webpack://foresight-workflow-kit-action/./node_modules/debug/src/node.js","../webpack://foresight-workflow-kit-action/./node_modules/delayed-stream/lib/delayed_stream.js","../webpack://foresight-workflow-kit-action/./node_modules/deprecation/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/follow-redirects/debug.js","../webpack://foresight-workflow-kit-action/./node_modules/follow-redirects/index.js","../webpack://foresight-workflow-kit-action/./node_modules/form-data/lib/form_data.js","../webpack://foresight-workflow-kit-action/./node_modules/form-data/lib/populate.js","../webpack://foresight-workflow-kit-action/./node_modules/has-flag/index.js","../webpack://foresight-workflow-kit-action/./node_modules/is-plain-object/dist/is-plain-object.js","../webpack://foresight-workflow-kit-action/./node_modules/mime-db/index.js","../webpack://foresight-workflow-kit-action/./node_modules/mime-types/index.js","../webpack://foresight-workflow-kit-action/./node_modules/mkdirp/index.js","../webpack://foresight-workflow-kit-action/./node_modules/ms/index.js","../webpack://foresight-workflow-kit-action/./node_modules/node-fetch/lib/index.js","../webpack://foresight-workflow-kit-action/./node_modules/once/once.js","../webpack://foresight-workflow-kit-action/./node_modules/portfinder/lib/portfinder.js","../webpack://foresight-workflow-kit-action/./node_modules/portfinder/node_modules/debug/src/browser.js","../webpack://foresight-workflow-kit-action/./node_modules/portfinder/node_modules/debug/src/common.js","../webpack://foresight-workflow-kit-action/./node_modules/portfinder/node_modules/debug/src/index.js","../webpack://foresight-workflow-kit-action/./node_modules/portfinder/node_modules/debug/src/node.js","../webpack://foresight-workflow-kit-action/./node_modules/supports-color/index.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/audio.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/battery.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/bluetooth.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/cpu.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/docker.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/dockerSocket.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/filesystem.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/graphics.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/index.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/internet.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/memory.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/network.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/osinfo.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/printer.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/processes.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/system.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/usb.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/users.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/util.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/virtualbox.js","../webpack://foresight-workflow-kit-action/./node_modules/systeminformation/lib/wifi.js","../webpack://foresight-workflow-kit-action/./node_modules/tr46/index.js","../webpack://foresight-workflow-kit-action/./node_modules/tunnel/index.js","../webpack://foresight-workflow-kit-action/./node_modules/tunnel/lib/tunnel.js","../webpack://foresight-workflow-kit-action/./node_modules/universal-user-agent/dist-node/index.js","../webpack://foresight-workflow-kit-action/./node_modules/webidl-conversions/lib/index.js","../webpack://foresight-workflow-kit-action/./node_modules/whatwg-url/lib/URL-impl.js","../webpack://foresight-workflow-kit-action/./node_modules/whatwg-url/lib/URL.js","../webpack://foresight-workflow-kit-action/./node_modules/whatwg-url/lib/public-api.js","../webpack://foresight-workflow-kit-action/./node_modules/whatwg-url/lib/url-state-machine.js","../webpack://foresight-workflow-kit-action/./node_modules/whatwg-url/lib/utils.js","../webpack://foresight-workflow-kit-action/./node_modules/wrappy/wrappy.js","../webpack://foresight-workflow-kit-action/./src/logger.ts","../webpack://foresight-workflow-kit-action/./src/statCollectorWorker.ts","../webpack://foresight-workflow-kit-action/./src/utils.ts","../webpack://foresight-workflow-kit-action/./node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack://foresight-workflow-kit-action/external \"assert\"","../webpack://foresight-workflow-kit-action/external \"child_process\"","../webpack://foresight-workflow-kit-action/external \"events\"","../webpack://foresight-workflow-kit-action/external \"fs\"","../webpack://foresight-workflow-kit-action/external \"http\"","../webpack://foresight-workflow-kit-action/external \"https\"","../webpack://foresight-workflow-kit-action/external \"net\"","../webpack://foresight-workflow-kit-action/external \"os\"","../webpack://foresight-workflow-kit-action/external \"path\"","../webpack://foresight-workflow-kit-action/external \"punycode\"","../webpack://foresight-workflow-kit-action/external \"stream\"","../webpack://foresight-workflow-kit-action/external \"tls\"","../webpack://foresight-workflow-kit-action/external \"tty\"","../webpack://foresight-workflow-kit-action/external \"url\"","../webpack://foresight-workflow-kit-action/external \"util\"","../webpack://foresight-workflow-kit-action/external \"zlib\"","../webpack://foresight-workflow-kit-action/webpack/bootstrap","../webpack://foresight-workflow-kit-action/webpack/runtime/node module decorator","../webpack://foresight-workflow-kit-action/webpack/runtime/compat","../webpack://foresight-workflow-kit-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 const delimiter = '_GitHubActionsFileCommandDelimeter_';\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\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.issueCommand('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 return inputs;\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 process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, 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 command_1.issueCommand('save-state', { name }, 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//# 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.issueCommand = 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 utils_1 = require(\"./utils\");\nfunction issueCommand(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.issueCommand = issueCommand;\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 __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) {\n return new utils_1.GitHub(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.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();\nconst 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(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\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","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (factory((global.async = global.async || {})));\n}(this, (function (exports) { 'use strict';\n\nfunction slice(arrayLike, start) {\n start = start|0;\n var newLen = Math.max(arrayLike.length - start, 0);\n var newArr = Array(newLen);\n for(var idx = 0; idx < newLen; idx++) {\n newArr[idx] = arrayLike[start + idx];\n }\n return newArr;\n}\n\n/**\n * Creates a continuation function with some arguments already applied.\n *\n * Useful as a shorthand when combined with other control flow functions. Any\n * arguments passed to the returned function are added to the arguments\n * originally passed to apply.\n *\n * @name apply\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {Function} fn - The function you want to eventually apply all\n * arguments to. Invokes with (arguments...).\n * @param {...*} arguments... - Any number of arguments to automatically apply\n * when the continuation is called.\n * @returns {Function} the partially-applied function\n * @example\n *\n * // using apply\n * async.parallel([\n * async.apply(fs.writeFile, 'testfile1', 'test1'),\n * async.apply(fs.writeFile, 'testfile2', 'test2')\n * ]);\n *\n *\n * // the same process without using apply\n * async.parallel([\n * function(callback) {\n * fs.writeFile('testfile1', 'test1', callback);\n * },\n * function(callback) {\n * fs.writeFile('testfile2', 'test2', callback);\n * }\n * ]);\n *\n * // It's possible to pass any number of additional arguments when calling the\n * // continuation:\n *\n * node> var fn = async.apply(sys.puts, 'one');\n * node> fn('two', 'three');\n * one\n * two\n * three\n */\nvar apply = function(fn/*, ...args*/) {\n var args = slice(arguments, 1);\n return function(/*callArgs*/) {\n var callArgs = slice(arguments);\n return fn.apply(null, args.concat(callArgs));\n };\n};\n\nvar initialParams = function (fn) {\n return function (/*...args, callback*/) {\n var args = slice(arguments);\n var callback = args.pop();\n fn.call(this, args, callback);\n };\n};\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nvar hasSetImmediate = typeof setImmediate === 'function' && setImmediate;\nvar hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';\n\nfunction fallback(fn) {\n setTimeout(fn, 0);\n}\n\nfunction wrap(defer) {\n return function (fn/*, ...args*/) {\n var args = slice(arguments, 1);\n defer(function () {\n fn.apply(null, args);\n });\n };\n}\n\nvar _defer;\n\nif (hasSetImmediate) {\n _defer = setImmediate;\n} else if (hasNextTick) {\n _defer = process.nextTick;\n} else {\n _defer = fallback;\n}\n\nvar setImmediate$1 = wrap(_defer);\n\n/**\n * Take a sync function and make it async, passing its return value to a\n * callback. This is useful for plugging sync functions into a waterfall,\n * series, or other async functions. Any arguments passed to the generated\n * function will be passed to the wrapped function (except for the final\n * callback argument). Errors thrown will be passed to the callback.\n *\n * If the function passed to `asyncify` returns a Promise, that promises's\n * resolved/rejected state will be used to call the callback, rather than simply\n * the synchronous return value.\n *\n * This also means you can asyncify ES2017 `async` functions.\n *\n * @name asyncify\n * @static\n * @memberOf module:Utils\n * @method\n * @alias wrapSync\n * @category Util\n * @param {Function} func - The synchronous function, or Promise-returning\n * function to convert to an {@link AsyncFunction}.\n * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be\n * invoked with `(args..., callback)`.\n * @example\n *\n * // passing a regular synchronous function\n * async.waterfall([\n * async.apply(fs.readFile, filename, \"utf8\"),\n * async.asyncify(JSON.parse),\n * function (data, next) {\n * // data is the result of parsing the text.\n * // If there was a parsing error, it would have been caught.\n * }\n * ], callback);\n *\n * // passing a function returning a promise\n * async.waterfall([\n * async.apply(fs.readFile, filename, \"utf8\"),\n * async.asyncify(function (contents) {\n * return db.model.create(contents);\n * }),\n * function (model, next) {\n * // `model` is the instantiated model object.\n * // If there was an error, this function would be skipped.\n * }\n * ], callback);\n *\n * // es2017 example, though `asyncify` is not needed if your JS environment\n * // supports async functions out of the box\n * var q = async.queue(async.asyncify(async function(file) {\n * var intermediateStep = await processFile(file);\n * return await somePromise(intermediateStep)\n * }));\n *\n * q.push(files);\n */\nfunction asyncify(func) {\n return initialParams(function (args, callback) {\n var result;\n try {\n result = func.apply(this, args);\n } catch (e) {\n return callback(e);\n }\n // if result is Promise object\n if (isObject(result) && typeof result.then === 'function') {\n result.then(function(value) {\n invokeCallback(callback, null, value);\n }, function(err) {\n invokeCallback(callback, err.message ? err : new Error(err));\n });\n } else {\n callback(null, result);\n }\n });\n}\n\nfunction invokeCallback(callback, error, value) {\n try {\n callback(error, value);\n } catch (e) {\n setImmediate$1(rethrow, e);\n }\n}\n\nfunction rethrow(error) {\n throw error;\n}\n\nvar supportsSymbol = typeof Symbol === 'function';\n\nfunction isAsync(fn) {\n return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction';\n}\n\nfunction wrapAsync(asyncFn) {\n return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn;\n}\n\nfunction applyEach$1(eachfn) {\n return function(fns/*, ...args*/) {\n var args = slice(arguments, 1);\n var go = initialParams(function(args, callback) {\n var that = this;\n return eachfn(fns, function (fn, cb) {\n wrapAsync(fn).apply(that, args.concat(cb));\n }, callback);\n });\n if (args.length) {\n return go.apply(this, args);\n }\n else {\n return go;\n }\n };\n}\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Built-in value references. */\nvar Symbol$1 = root.Symbol;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag$1),\n tag = value[symToStringTag$1];\n\n try {\n value[symToStringTag$1] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag$1] = tag;\n } else {\n delete value[symToStringTag$1];\n }\n }\n return result;\n}\n\n/** Used for built-in method references. */\nvar objectProto$1 = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString$1 = objectProto$1.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString$1.call(value);\n}\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]';\nvar undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]';\nvar funcTag = '[object Function]';\nvar genTag = '[object GeneratorFunction]';\nvar proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n// A temporary value used to identify if the loop should be broken.\n// See #1064, #1293\nvar breakLoop = {};\n\n/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nfunction once(fn) {\n return function () {\n if (fn === null) return;\n var callFn = fn;\n fn = null;\n callFn.apply(this, arguments);\n };\n}\n\nvar iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator;\n\nvar getIterator = function (coll) {\n return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol]();\n};\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/** Used for built-in method references. */\nvar objectProto$3 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty$2 = objectProto$3.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto$3.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER$1 = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER$1 : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/** `Object#toString` result references. */\nvar argsTag$1 = '[object Arguments]';\nvar arrayTag = '[object Array]';\nvar boolTag = '[object Boolean]';\nvar dateTag = '[object Date]';\nvar errorTag = '[object Error]';\nvar funcTag$1 = '[object Function]';\nvar mapTag = '[object Map]';\nvar numberTag = '[object Number]';\nvar objectTag = '[object Object]';\nvar regexpTag = '[object RegExp]';\nvar setTag = '[object Set]';\nvar stringTag = '[object String]';\nvar weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]';\nvar dataViewTag = '[object DataView]';\nvar float32Tag = '[object Float32Array]';\nvar float64Tag = '[object Float64Array]';\nvar int8Tag = '[object Int8Array]';\nvar int16Tag = '[object Int16Array]';\nvar int32Tag = '[object Int32Array]';\nvar uint8Tag = '[object Uint8Array]';\nvar uint8ClampedTag = '[object Uint8ClampedArray]';\nvar uint16Tag = '[object Uint16Array]';\nvar uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag$1] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/** Detect free variable `exports`. */\nvar freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports$1 && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/** Used for built-in method references. */\nvar objectProto$2 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty$1 = objectProto$2.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty$1.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/** Used for built-in method references. */\nvar objectProto$5 = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;\n\n return value === proto;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/** Used for built-in method references. */\nvar objectProto$4 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty$3 = objectProto$4.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty$3.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nfunction createArrayIterator(coll) {\n var i = -1;\n var len = coll.length;\n return function next() {\n return ++i < len ? {value: coll[i], key: i} : null;\n }\n}\n\nfunction createES2015Iterator(iterator) {\n var i = -1;\n return function next() {\n var item = iterator.next();\n if (item.done)\n return null;\n i++;\n return {value: item.value, key: i};\n }\n}\n\nfunction createObjectIterator(obj) {\n var okeys = keys(obj);\n var i = -1;\n var len = okeys.length;\n return function next() {\n var key = okeys[++i];\n if (key === '__proto__') {\n return next();\n }\n return i < len ? {value: obj[key], key: key} : null;\n };\n}\n\nfunction iterator(coll) {\n if (isArrayLike(coll)) {\n return createArrayIterator(coll);\n }\n\n var iterator = getIterator(coll);\n return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);\n}\n\nfunction onlyOnce(fn) {\n return function() {\n if (fn === null) throw new Error(\"Callback was already called.\");\n var callFn = fn;\n fn = null;\n callFn.apply(this, arguments);\n };\n}\n\nfunction _eachOfLimit(limit) {\n return function (obj, iteratee, callback) {\n callback = once(callback || noop);\n if (limit <= 0 || !obj) {\n return callback(null);\n }\n var nextElem = iterator(obj);\n var done = false;\n var running = 0;\n var looping = false;\n\n function iterateeCallback(err, value) {\n running -= 1;\n if (err) {\n done = true;\n callback(err);\n }\n else if (value === breakLoop || (done && running <= 0)) {\n done = true;\n return callback(null);\n }\n else if (!looping) {\n replenish();\n }\n }\n\n function replenish () {\n looping = true;\n while (running < limit && !done) {\n var elem = nextElem();\n if (elem === null) {\n done = true;\n if (running <= 0) {\n callback(null);\n }\n return;\n }\n running += 1;\n iteratee(elem.value, elem.key, onlyOnce(iterateeCallback));\n }\n looping = false;\n }\n\n replenish();\n };\n}\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name eachOfLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`. The `key` is the item's key, or index in the case of an\n * array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nfunction eachOfLimit(coll, limit, iteratee, callback) {\n _eachOfLimit(limit)(coll, wrapAsync(iteratee), callback);\n}\n\nfunction doLimit(fn, limit) {\n return function (iterable, iteratee, callback) {\n return fn(iterable, limit, iteratee, callback);\n };\n}\n\n// eachOf implementation optimized for array-likes\nfunction eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback || noop);\n var index = 0,\n completed = 0,\n length = coll.length;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err) {\n callback(err);\n } else if ((++completed === length) || value === breakLoop) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback));\n }\n}\n\n// a generic version of eachOf which can handle array, object, and iterator cases.\nvar eachOfGeneric = doLimit(eachOfLimit, Infinity);\n\n/**\n * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument\n * to the iteratee.\n *\n * @name eachOf\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEachOf\n * @category Collection\n * @see [async.each]{@link module:Collections.each}\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each\n * item in `coll`.\n * The `key` is the item's key, or index in the case of an array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @example\n *\n * var obj = {dev: \"/dev.json\", test: \"/test.json\", prod: \"/prod.json\"};\n * var configs = {};\n *\n * async.forEachOf(obj, function (value, key, callback) {\n * fs.readFile(__dirname + value, \"utf8\", function (err, data) {\n * if (err) return callback(err);\n * try {\n * configs[key] = JSON.parse(data);\n * } catch (e) {\n * return callback(e);\n * }\n * callback();\n * });\n * }, function (err) {\n * if (err) console.error(err.message);\n * // configs is now a map of JSON data\n * doSomethingWith(configs);\n * });\n */\nvar eachOf = function(coll, iteratee, callback) {\n var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric;\n eachOfImplementation(coll, wrapAsync(iteratee), callback);\n};\n\nfunction doParallel(fn) {\n return function (obj, iteratee, callback) {\n return fn(eachOf, obj, wrapAsync(iteratee), callback);\n };\n}\n\nfunction _asyncMap(eachfn, arr, iteratee, callback) {\n callback = callback || noop;\n arr = arr || [];\n var results = [];\n var counter = 0;\n var _iteratee = wrapAsync(iteratee);\n\n eachfn(arr, function (value, _, callback) {\n var index = counter++;\n _iteratee(value, function (err, v) {\n results[index] = v;\n callback(err);\n });\n }, function (err) {\n callback(err, results);\n });\n}\n\n/**\n * Produces a new collection of values by mapping each value in `coll` through\n * the `iteratee` function. The `iteratee` is called with an item from `coll`\n * and a callback for when it has finished processing. Each of these callback\n * takes 2 arguments: an `error`, and the transformed item from `coll`. If\n * `iteratee` passes an error to its callback, the main `callback` (for the\n * `map` function) is immediately called with the error.\n *\n * Note, that since this function applies the `iteratee` to each item in\n * parallel, there is no guarantee that the `iteratee` functions will complete\n * in order. However, the results array will be in the same order as the\n * original `coll`.\n *\n * If `map` is passed an Object, the results will be an Array. The results\n * will roughly be in the order of the original Objects' keys (but this can\n * vary across JavaScript engines).\n *\n * @name map\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an Array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @example\n *\n * async.map(['file1','file2','file3'], fs.stat, function(err, results) {\n * // results is now an array of stats for each file\n * });\n */\nvar map = doParallel(_asyncMap);\n\n/**\n * Applies the provided arguments to each function in the array, calling\n * `callback` after all functions have completed. If you only provide the first\n * argument, `fns`, then it will return a function which lets you pass in the\n * arguments as if it were a single function call. If more arguments are\n * provided, `callback` is required while `args` is still optional.\n *\n * @name applyEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s\n * to all call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {Function} - If only the first argument, `fns`, is provided, it will\n * return a function which lets you pass in the arguments as if it were a single\n * function call. The signature is `(..args, callback)`. If invoked with any\n * arguments, `callback` is required.\n * @example\n *\n * async.applyEach([enableSearch, updateSchema], 'bucket', callback);\n *\n * // partial application example:\n * async.each(\n * buckets,\n * async.applyEach([enableSearch, updateSchema]),\n * callback\n * );\n */\nvar applyEach = applyEach$1(map);\n\nfunction doParallelLimit(fn) {\n return function (obj, limit, iteratee, callback) {\n return fn(_eachOfLimit(limit), obj, wrapAsync(iteratee), callback);\n };\n}\n\n/**\n * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time.\n *\n * @name mapLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the `coll`. Invoked with (err, results).\n */\nvar mapLimit = doParallelLimit(_asyncMap);\n\n/**\n * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time.\n *\n * @name mapSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the `coll`. Invoked with (err, results).\n */\nvar mapSeries = doLimit(mapLimit, 1);\n\n/**\n * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.\n *\n * @name applyEachSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.applyEach]{@link module:ControlFlow.applyEach}\n * @category Control Flow\n * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all\n * call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {Function} - If only the first argument is provided, it will return\n * a function which lets you pass in the arguments as if it were a single\n * function call.\n */\nvar applyEachSeries = applyEach$1(mapSeries);\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\n/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\n/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\n/**\n * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on\n * their requirements. Each function can optionally depend on other functions\n * being completed first, and each function is run as soon as its requirements\n * are satisfied.\n *\n * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence\n * will stop. Further tasks will not execute (so any other functions depending\n * on it will not run), and the main `callback` is immediately called with the\n * error.\n *\n * {@link AsyncFunction}s also receive an object containing the results of functions which\n * have completed so far as the first argument, if they have dependencies. If a\n * task function has no dependencies, it will only be passed a callback.\n *\n * @name auto\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Object} tasks - An object. Each of its properties is either a\n * function or an array of requirements, with the {@link AsyncFunction} itself the last item\n * in the array. The object's key of a property serves as the name of the task\n * defined by that property, i.e. can be used when specifying requirements for\n * other tasks. The function receives one or two arguments:\n * * a `results` object, containing the results of the previously executed\n * functions, only passed if the task has any dependencies,\n * * a `callback(err, result)` function, which must be called when finished,\n * passing an `error` (which can be `null`) and the result of the function's\n * execution.\n * @param {number} [concurrency=Infinity] - An optional `integer` for\n * determining the maximum number of tasks that can be run in parallel. By\n * default, as many as possible.\n * @param {Function} [callback] - An optional callback which is called when all\n * the tasks have been completed. It receives the `err` argument if any `tasks`\n * pass an error to their callback. Results are always returned; however, if an\n * error occurs, no further `tasks` will be performed, and the results object\n * will only contain partial results. Invoked with (err, results).\n * @returns undefined\n * @example\n *\n * async.auto({\n * // this function will just be passed a callback\n * readData: async.apply(fs.readFile, 'data.txt', 'utf-8'),\n * showData: ['readData', function(results, cb) {\n * // results.readData is the file's contents\n * // ...\n * }]\n * }, callback);\n *\n * async.auto({\n * get_data: function(callback) {\n * console.log('in get_data');\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * console.log('in make_folder');\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: ['get_data', 'make_folder', function(results, callback) {\n * console.log('in write_file', JSON.stringify(results));\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(results, callback) {\n * console.log('in email_link', JSON.stringify(results));\n * // once the file is written let's email a link to it...\n * // results.write_file contains the filename returned by write_file.\n * callback(null, {'file':results.write_file, 'email':'user@example.com'});\n * }]\n * }, function(err, results) {\n * console.log('err = ', err);\n * console.log('results = ', results);\n * });\n */\nvar auto = function (tasks, concurrency, callback) {\n if (typeof concurrency === 'function') {\n // concurrency is optional, shift the args.\n callback = concurrency;\n concurrency = null;\n }\n callback = once(callback || noop);\n var keys$$1 = keys(tasks);\n var numTasks = keys$$1.length;\n if (!numTasks) {\n return callback(null);\n }\n if (!concurrency) {\n concurrency = numTasks;\n }\n\n var results = {};\n var runningTasks = 0;\n var hasError = false;\n\n var listeners = Object.create(null);\n\n var readyTasks = [];\n\n // for cycle detection:\n var readyToCheck = []; // tasks that have been identified as reachable\n // without the possibility of returning to an ancestor task\n var uncheckedDependencies = {};\n\n baseForOwn(tasks, function (task, key) {\n if (!isArray(task)) {\n // no dependencies\n enqueueTask(key, [task]);\n readyToCheck.push(key);\n return;\n }\n\n var dependencies = task.slice(0, task.length - 1);\n var remainingDependencies = dependencies.length;\n if (remainingDependencies === 0) {\n enqueueTask(key, task);\n readyToCheck.push(key);\n return;\n }\n uncheckedDependencies[key] = remainingDependencies;\n\n arrayEach(dependencies, function (dependencyName) {\n if (!tasks[dependencyName]) {\n throw new Error('async.auto task `' + key +\n '` has a non-existent dependency `' +\n dependencyName + '` in ' +\n dependencies.join(', '));\n }\n addListener(dependencyName, function () {\n remainingDependencies--;\n if (remainingDependencies === 0) {\n enqueueTask(key, task);\n }\n });\n });\n });\n\n checkForDeadlocks();\n processQueue();\n\n function enqueueTask(key, task) {\n readyTasks.push(function () {\n runTask(key, task);\n });\n }\n\n function processQueue() {\n if (readyTasks.length === 0 && runningTasks === 0) {\n return callback(null, results);\n }\n while(readyTasks.length && runningTasks < concurrency) {\n var run = readyTasks.shift();\n run();\n }\n\n }\n\n function addListener(taskName, fn) {\n var taskListeners = listeners[taskName];\n if (!taskListeners) {\n taskListeners = listeners[taskName] = [];\n }\n\n taskListeners.push(fn);\n }\n\n function taskComplete(taskName) {\n var taskListeners = listeners[taskName] || [];\n arrayEach(taskListeners, function (fn) {\n fn();\n });\n processQueue();\n }\n\n\n function runTask(key, task) {\n if (hasError) return;\n\n var taskCallback = onlyOnce(function(err, result) {\n runningTasks--;\n if (arguments.length > 2) {\n result = slice(arguments, 1);\n }\n if (err) {\n var safeResults = {};\n baseForOwn(results, function(val, rkey) {\n safeResults[rkey] = val;\n });\n safeResults[key] = result;\n hasError = true;\n listeners = Object.create(null);\n\n callback(err, safeResults);\n } else {\n results[key] = result;\n taskComplete(key);\n }\n });\n\n runningTasks++;\n var taskFn = wrapAsync(task[task.length - 1]);\n if (task.length > 1) {\n taskFn(results, taskCallback);\n } else {\n taskFn(taskCallback);\n }\n }\n\n function checkForDeadlocks() {\n // Kahn's algorithm\n // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm\n // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html\n var currentTask;\n var counter = 0;\n while (readyToCheck.length) {\n currentTask = readyToCheck.pop();\n counter++;\n arrayEach(getDependents(currentTask), function (dependent) {\n if (--uncheckedDependencies[dependent] === 0) {\n readyToCheck.push(dependent);\n }\n });\n }\n\n if (counter !== numTasks) {\n throw new Error(\n 'async.auto cannot execute tasks due to a recursive dependency'\n );\n }\n }\n\n function getDependents(taskName) {\n var result = [];\n baseForOwn(tasks, function (task, key) {\n if (isArray(task) && baseIndexOf(task, taskName, 0) >= 0) {\n result.push(key);\n }\n });\n return result;\n }\n};\n\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol$1 ? Symbol$1.prototype : undefined;\nvar symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\nfunction charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n}\n\n/**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\nfunction charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n}\n\n/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\n/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff';\nvar rsComboMarksRange = '\\\\u0300-\\\\u036f';\nvar reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f';\nvar rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff';\nvar rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;\nvar rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\n/** Used to compose unicode character classes. */\nvar rsAstralRange$1 = '\\\\ud800-\\\\udfff';\nvar rsComboMarksRange$1 = '\\\\u0300-\\\\u036f';\nvar reComboHalfMarksRange$1 = '\\\\ufe20-\\\\ufe2f';\nvar rsComboSymbolsRange$1 = '\\\\u20d0-\\\\u20ff';\nvar rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;\nvar rsVarRange$1 = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange$1 + ']';\nvar rsCombo = '[' + rsComboRange$1 + ']';\nvar rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]';\nvar rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')';\nvar rsNonAstral = '[^' + rsAstralRange$1 + ']';\nvar rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}';\nvar rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]';\nvar rsZWJ$1 = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?';\nvar rsOptVar = '[' + rsVarRange$1 + ']?';\nvar rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*';\nvar rsSeq = rsOptVar + reOptMod + rsOptJoin;\nvar rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/**\n * Removes leading and trailing whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trim(' abc ');\n * // => 'abc'\n *\n * _.trim('-_-abc-_-', '_-');\n * // => 'abc'\n *\n * _.map([' foo ', ' bar '], _.trim);\n * // => ['foo', 'bar']\n */\nfunction trim(string, chars, guard) {\n string = toString(string);\n if (string && (guard || chars === undefined)) {\n return string.replace(reTrim, '');\n }\n if (!string || !(chars = baseToString(chars))) {\n return string;\n }\n var strSymbols = stringToArray(string),\n chrSymbols = stringToArray(chars),\n start = charsStartIndex(strSymbols, chrSymbols),\n end = charsEndIndex(strSymbols, chrSymbols) + 1;\n\n return castSlice(strSymbols, start, end).join('');\n}\n\nvar FN_ARGS = /^(?:async\\s+)?(function)?\\s*[^\\(]*\\(\\s*([^\\)]*)\\)/m;\nvar FN_ARG_SPLIT = /,/;\nvar FN_ARG = /(=.+)?(\\s*)$/;\nvar STRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/mg;\n\nfunction parseParams(func) {\n func = func.toString().replace(STRIP_COMMENTS, '');\n func = func.match(FN_ARGS)[2].replace(' ', '');\n func = func ? func.split(FN_ARG_SPLIT) : [];\n func = func.map(function (arg){\n return trim(arg.replace(FN_ARG, ''));\n });\n return func;\n}\n\n/**\n * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent\n * tasks are specified as parameters to the function, after the usual callback\n * parameter, with the parameter names matching the names of the tasks it\n * depends on. This can provide even more readable task graphs which can be\n * easier to maintain.\n *\n * If a final callback is specified, the task results are similarly injected,\n * specified as named parameters after the initial error parameter.\n *\n * The autoInject function is purely syntactic sugar and its semantics are\n * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.\n *\n * @name autoInject\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.auto]{@link module:ControlFlow.auto}\n * @category Control Flow\n * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of\n * the form 'func([dependencies...], callback). The object's key of a property\n * serves as the name of the task defined by that property, i.e. can be used\n * when specifying requirements for other tasks.\n * * The `callback` parameter is a `callback(err, result)` which must be called\n * when finished, passing an `error` (which can be `null`) and the result of\n * the function's execution. The remaining parameters name other tasks on\n * which the task is dependent, and the results from those tasks are the\n * arguments of those parameters.\n * @param {Function} [callback] - An optional callback which is called when all\n * the tasks have been completed. It receives the `err` argument if any `tasks`\n * pass an error to their callback, and a `results` object with any completed\n * task results, similar to `auto`.\n * @example\n *\n * // The example from `auto` can be rewritten as follows:\n * async.autoInject({\n * get_data: function(callback) {\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: function(get_data, make_folder, callback) {\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * },\n * email_link: function(write_file, callback) {\n * // once the file is written let's email a link to it...\n * // write_file contains the filename returned by write_file.\n * callback(null, {'file':write_file, 'email':'user@example.com'});\n * }\n * }, function(err, results) {\n * console.log('err = ', err);\n * console.log('email_link = ', results.email_link);\n * });\n *\n * // If you are using a JS minifier that mangles parameter names, `autoInject`\n * // will not work with plain functions, since the parameter names will be\n * // collapsed to a single letter identifier. To work around this, you can\n * // explicitly specify the names of the parameters your task function needs\n * // in an array, similar to Angular.js dependency injection.\n *\n * // This still has an advantage over plain `auto`, since the results a task\n * // depends on are still spread into arguments.\n * async.autoInject({\n * //...\n * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(write_file, callback) {\n * callback(null, {'file':write_file, 'email':'user@example.com'});\n * }]\n * //...\n * }, function(err, results) {\n * console.log('err = ', err);\n * console.log('email_link = ', results.email_link);\n * });\n */\nfunction autoInject(tasks, callback) {\n var newTasks = {};\n\n baseForOwn(tasks, function (taskFn, key) {\n var params;\n var fnIsAsync = isAsync(taskFn);\n var hasNoDeps =\n (!fnIsAsync && taskFn.length === 1) ||\n (fnIsAsync && taskFn.length === 0);\n\n if (isArray(taskFn)) {\n params = taskFn.slice(0, -1);\n taskFn = taskFn[taskFn.length - 1];\n\n newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);\n } else if (hasNoDeps) {\n // no dependencies, use the function as-is\n newTasks[key] = taskFn;\n } else {\n params = parseParams(taskFn);\n if (taskFn.length === 0 && !fnIsAsync && params.length === 0) {\n throw new Error(\"autoInject task functions require explicit parameters.\");\n }\n\n // remove callback param\n if (!fnIsAsync) params.pop();\n\n newTasks[key] = params.concat(newTask);\n }\n\n function newTask(results, taskCb) {\n var newArgs = arrayMap(params, function (name) {\n return results[name];\n });\n newArgs.push(taskCb);\n wrapAsync(taskFn).apply(null, newArgs);\n }\n });\n\n auto(newTasks, callback);\n}\n\n// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation\n// used for queues. This implementation assumes that the node provided by the user can be modified\n// to adjust the next and last properties. We implement only the minimal functionality\n// for queue support.\nfunction DLL() {\n this.head = this.tail = null;\n this.length = 0;\n}\n\nfunction setInitial(dll, node) {\n dll.length = 1;\n dll.head = dll.tail = node;\n}\n\nDLL.prototype.removeLink = function(node) {\n if (node.prev) node.prev.next = node.next;\n else this.head = node.next;\n if (node.next) node.next.prev = node.prev;\n else this.tail = node.prev;\n\n node.prev = node.next = null;\n this.length -= 1;\n return node;\n};\n\nDLL.prototype.empty = function () {\n while(this.head) this.shift();\n return this;\n};\n\nDLL.prototype.insertAfter = function(node, newNode) {\n newNode.prev = node;\n newNode.next = node.next;\n if (node.next) node.next.prev = newNode;\n else this.tail = newNode;\n node.next = newNode;\n this.length += 1;\n};\n\nDLL.prototype.insertBefore = function(node, newNode) {\n newNode.prev = node.prev;\n newNode.next = node;\n if (node.prev) node.prev.next = newNode;\n else this.head = newNode;\n node.prev = newNode;\n this.length += 1;\n};\n\nDLL.prototype.unshift = function(node) {\n if (this.head) this.insertBefore(this.head, node);\n else setInitial(this, node);\n};\n\nDLL.prototype.push = function(node) {\n if (this.tail) this.insertAfter(this.tail, node);\n else setInitial(this, node);\n};\n\nDLL.prototype.shift = function() {\n return this.head && this.removeLink(this.head);\n};\n\nDLL.prototype.pop = function() {\n return this.tail && this.removeLink(this.tail);\n};\n\nDLL.prototype.toArray = function () {\n var arr = Array(this.length);\n var curr = this.head;\n for(var idx = 0; idx < this.length; idx++) {\n arr[idx] = curr.data;\n curr = curr.next;\n }\n return arr;\n};\n\nDLL.prototype.remove = function (testFn) {\n var curr = this.head;\n while(!!curr) {\n var next = curr.next;\n if (testFn(curr)) {\n this.removeLink(curr);\n }\n curr = next;\n }\n return this;\n};\n\nfunction queue(worker, concurrency, payload) {\n if (concurrency == null) {\n concurrency = 1;\n }\n else if(concurrency === 0) {\n throw new Error('Concurrency must not be zero');\n }\n\n var _worker = wrapAsync(worker);\n var numRunning = 0;\n var workersList = [];\n\n var processingScheduled = false;\n function _insert(data, insertAtFront, callback) {\n if (callback != null && typeof callback !== 'function') {\n throw new Error('task callback must be a function');\n }\n q.started = true;\n if (!isArray(data)) {\n data = [data];\n }\n if (data.length === 0 && q.idle()) {\n // call drain immediately if there are no tasks\n return setImmediate$1(function() {\n q.drain();\n });\n }\n\n for (var i = 0, l = data.length; i < l; i++) {\n var item = {\n data: data[i],\n callback: callback || noop\n };\n\n if (insertAtFront) {\n q._tasks.unshift(item);\n } else {\n q._tasks.push(item);\n }\n }\n\n if (!processingScheduled) {\n processingScheduled = true;\n setImmediate$1(function() {\n processingScheduled = false;\n q.process();\n });\n }\n }\n\n function _next(tasks) {\n return function(err){\n numRunning -= 1;\n\n for (var i = 0, l = tasks.length; i < l; i++) {\n var task = tasks[i];\n\n var index = baseIndexOf(workersList, task, 0);\n if (index === 0) {\n workersList.shift();\n } else if (index > 0) {\n workersList.splice(index, 1);\n }\n\n task.callback.apply(task, arguments);\n\n if (err != null) {\n q.error(err, task.data);\n }\n }\n\n if (numRunning <= (q.concurrency - q.buffer) ) {\n q.unsaturated();\n }\n\n if (q.idle()) {\n q.drain();\n }\n q.process();\n };\n }\n\n var isProcessing = false;\n var q = {\n _tasks: new DLL(),\n concurrency: concurrency,\n payload: payload,\n saturated: noop,\n unsaturated:noop,\n buffer: concurrency / 4,\n empty: noop,\n drain: noop,\n error: noop,\n started: false,\n paused: false,\n push: function (data, callback) {\n _insert(data, false, callback);\n },\n kill: function () {\n q.drain = noop;\n q._tasks.empty();\n },\n unshift: function (data, callback) {\n _insert(data, true, callback);\n },\n remove: function (testFn) {\n q._tasks.remove(testFn);\n },\n process: function () {\n // Avoid trying to start too many processing operations. This can occur\n // when callbacks resolve synchronously (#1267).\n if (isProcessing) {\n return;\n }\n isProcessing = true;\n while(!q.paused && numRunning < q.concurrency && q._tasks.length){\n var tasks = [], data = [];\n var l = q._tasks.length;\n if (q.payload) l = Math.min(l, q.payload);\n for (var i = 0; i < l; i++) {\n var node = q._tasks.shift();\n tasks.push(node);\n workersList.push(node);\n data.push(node.data);\n }\n\n numRunning += 1;\n\n if (q._tasks.length === 0) {\n q.empty();\n }\n\n if (numRunning === q.concurrency) {\n q.saturated();\n }\n\n var cb = onlyOnce(_next(tasks));\n _worker(data, cb);\n }\n isProcessing = false;\n },\n length: function () {\n return q._tasks.length;\n },\n running: function () {\n return numRunning;\n },\n workersList: function () {\n return workersList;\n },\n idle: function() {\n return q._tasks.length + numRunning === 0;\n },\n pause: function () {\n q.paused = true;\n },\n resume: function () {\n if (q.paused === false) { return; }\n q.paused = false;\n setImmediate$1(q.process);\n }\n };\n return q;\n}\n\n/**\n * A cargo of tasks for the worker function to complete. Cargo inherits all of\n * the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}.\n * @typedef {Object} CargoObject\n * @memberOf module:ControlFlow\n * @property {Function} length - A function returning the number of items\n * waiting to be processed. Invoke like `cargo.length()`.\n * @property {number} payload - An `integer` for determining how many tasks\n * should be process per round. This property can be changed after a `cargo` is\n * created to alter the payload on-the-fly.\n * @property {Function} push - Adds `task` to the `queue`. The callback is\n * called once the `worker` has finished processing the task. Instead of a\n * single task, an array of `tasks` can be submitted. The respective callback is\n * used for every task in the list. Invoke like `cargo.push(task, [callback])`.\n * @property {Function} saturated - A callback that is called when the\n * `queue.length()` hits the concurrency and further tasks will be queued.\n * @property {Function} empty - A callback that is called when the last item\n * from the `queue` is given to a `worker`.\n * @property {Function} drain - A callback that is called when the last item\n * from the `queue` has returned from the `worker`.\n * @property {Function} idle - a function returning false if there are items\n * waiting or being processed, or true if not. Invoke like `cargo.idle()`.\n * @property {Function} pause - a function that pauses the processing of tasks\n * until `resume()` is called. Invoke like `cargo.pause()`.\n * @property {Function} resume - a function that resumes the processing of\n * queued tasks when the queue is paused. Invoke like `cargo.resume()`.\n * @property {Function} kill - a function that removes the `drain` callback and\n * empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`.\n */\n\n/**\n * Creates a `cargo` object with the specified payload. Tasks added to the\n * cargo will be processed altogether (up to the `payload` limit). If the\n * `worker` is in progress, the task is queued until it becomes available. Once\n * the `worker` has completed some tasks, each callback of those tasks is\n * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)\n * for how `cargo` and `queue` work.\n *\n * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers\n * at a time, cargo passes an array of tasks to a single worker, repeating\n * when the worker is finished.\n *\n * @name cargo\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @category Control Flow\n * @param {AsyncFunction} worker - An asynchronous function for processing an array\n * of queued tasks. Invoked with `(tasks, callback)`.\n * @param {number} [payload=Infinity] - An optional `integer` for determining\n * how many tasks should be processed per round; if omitted, the default is\n * unlimited.\n * @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can\n * attached as certain properties to listen for specific events during the\n * lifecycle of the cargo and inner queue.\n * @example\n *\n * // create a cargo object with payload 2\n * var cargo = async.cargo(function(tasks, callback) {\n * for (var i=0; i true\n */\nfunction identity(value) {\n return value;\n}\n\nfunction _createTester(check, getResult) {\n return function(eachfn, arr, iteratee, cb) {\n cb = cb || noop;\n var testPassed = false;\n var testResult;\n eachfn(arr, function(value, _, callback) {\n iteratee(value, function(err, result) {\n if (err) {\n callback(err);\n } else if (check(result) && !testResult) {\n testPassed = true;\n testResult = getResult(true, value);\n callback(null, breakLoop);\n } else {\n callback();\n }\n });\n }, function(err) {\n if (err) {\n cb(err);\n } else {\n cb(null, testPassed ? testResult : getResult(false));\n }\n });\n };\n}\n\nfunction _findGetResult(v, x) {\n return x;\n}\n\n/**\n * Returns the first value in `coll` that passes an async truth test. The\n * `iteratee` is applied in parallel, meaning the first iteratee to return\n * `true` will fire the detect `callback` with that result. That means the\n * result might not be the first item in the original `coll` (in terms of order)\n * that passes the test.\n\n * If order within the original `coll` is important, then look at\n * [`detectSeries`]{@link module:Collections.detectSeries}.\n *\n * @name detect\n * @static\n * @memberOf module:Collections\n * @method\n * @alias find\n * @category Collections\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n * @example\n *\n * async.detect(['file1','file2','file3'], function(filePath, callback) {\n * fs.access(filePath, function(err) {\n * callback(null, !err)\n * });\n * }, function(err, result) {\n * // result now equals the first file in the list that exists\n * });\n */\nvar detect = doParallel(_createTester(identity, _findGetResult));\n\n/**\n * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name detectLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.detect]{@link module:Collections.detect}\n * @alias findLimit\n * @category Collections\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n */\nvar detectLimit = doParallelLimit(_createTester(identity, _findGetResult));\n\n/**\n * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.\n *\n * @name detectSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.detect]{@link module:Collections.detect}\n * @alias findSeries\n * @category Collections\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n */\nvar detectSeries = doLimit(detectLimit, 1);\n\nfunction consoleFunc(name) {\n return function (fn/*, ...args*/) {\n var args = slice(arguments, 1);\n args.push(function (err/*, ...args*/) {\n var args = slice(arguments, 1);\n if (typeof console === 'object') {\n if (err) {\n if (console.error) {\n console.error(err);\n }\n } else if (console[name]) {\n arrayEach(args, function (x) {\n console[name](x);\n });\n }\n }\n });\n wrapAsync(fn).apply(null, args);\n };\n}\n\n/**\n * Logs the result of an [`async` function]{@link AsyncFunction} to the\n * `console` using `console.dir` to display the properties of the resulting object.\n * Only works in Node.js or in browsers that support `console.dir` and\n * `console.error` (such as FF and Chrome).\n * If multiple arguments are returned from the async function,\n * `console.dir` is called on each argument in order.\n *\n * @name dir\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} function - The function you want to eventually apply\n * all arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n * setTimeout(function() {\n * callback(null, {hello: name});\n * }, 1000);\n * };\n *\n * // in the node repl\n * node> async.dir(hello, 'world');\n * {hello: 'world'}\n */\nvar dir = consoleFunc('dir');\n\n/**\n * The post-check version of [`during`]{@link module:ControlFlow.during}. To reflect the difference in\n * the order of operations, the arguments `test` and `fn` are switched.\n *\n * Also a version of [`doWhilst`]{@link module:ControlFlow.doWhilst} with asynchronous `test` function.\n * @name doDuring\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.during]{@link module:ControlFlow.during}\n * @category Control Flow\n * @param {AsyncFunction} fn - An async function which is called each time\n * `test` passes. Invoked with (callback).\n * @param {AsyncFunction} test - asynchronous truth test to perform before each\n * execution of `fn`. Invoked with (...args, callback), where `...args` are the\n * non-error args from the previous callback of `fn`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `fn` has stopped. `callback`\n * will be passed an error if one occurred, otherwise `null`.\n */\nfunction doDuring(fn, test, callback) {\n callback = onlyOnce(callback || noop);\n var _fn = wrapAsync(fn);\n var _test = wrapAsync(test);\n\n function next(err/*, ...args*/) {\n if (err) return callback(err);\n var args = slice(arguments, 1);\n args.push(check);\n _test.apply(this, args);\n }\n\n function check(err, truth) {\n if (err) return callback(err);\n if (!truth) return callback(null);\n _fn(next);\n }\n\n check(null, true);\n\n}\n\n/**\n * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in\n * the order of operations, the arguments `test` and `iteratee` are switched.\n *\n * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n *\n * @name doWhilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - A function which is called each time `test`\n * passes. Invoked with (callback).\n * @param {Function} test - synchronous truth test to perform after each\n * execution of `iteratee`. Invoked with any non-error callback results of\n * `iteratee`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped.\n * `callback` will be passed an error and any arguments passed to the final\n * `iteratee`'s callback. Invoked with (err, [results]);\n */\nfunction doWhilst(iteratee, test, callback) {\n callback = onlyOnce(callback || noop);\n var _iteratee = wrapAsync(iteratee);\n var next = function(err/*, ...args*/) {\n if (err) return callback(err);\n var args = slice(arguments, 1);\n if (test.apply(this, args)) return _iteratee(next);\n callback.apply(null, [null].concat(args));\n };\n _iteratee(next);\n}\n\n/**\n * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the\n * argument ordering differs from `until`.\n *\n * @name doUntil\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.doWhilst]{@link module:ControlFlow.doWhilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` fails. Invoked with (callback).\n * @param {Function} test - synchronous truth test to perform after each\n * execution of `iteratee`. Invoked with any non-error callback results of\n * `iteratee`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n */\nfunction doUntil(iteratee, test, callback) {\n doWhilst(iteratee, function() {\n return !test.apply(this, arguments);\n }, callback);\n}\n\n/**\n * Like [`whilst`]{@link module:ControlFlow.whilst}, except the `test` is an asynchronous function that\n * is passed a callback in the form of `function (err, truth)`. If error is\n * passed to `test` or `fn`, the main callback is immediately called with the\n * value of the error.\n *\n * @name during\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} test - asynchronous truth test to perform before each\n * execution of `fn`. Invoked with (callback).\n * @param {AsyncFunction} fn - An async function which is called each time\n * `test` passes. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `fn` has stopped. `callback`\n * will be passed an error, if one occurred, otherwise `null`.\n * @example\n *\n * var count = 0;\n *\n * async.during(\n * function (callback) {\n * return callback(null, count < 5);\n * },\n * function (callback) {\n * count++;\n * setTimeout(callback, 1000);\n * },\n * function (err) {\n * // 5 seconds have passed\n * }\n * );\n */\nfunction during(test, fn, callback) {\n callback = onlyOnce(callback || noop);\n var _fn = wrapAsync(fn);\n var _test = wrapAsync(test);\n\n function next(err) {\n if (err) return callback(err);\n _test(check);\n }\n\n function check(err, truth) {\n if (err) return callback(err);\n if (!truth) return callback(null);\n _fn(next);\n }\n\n _test(check);\n}\n\nfunction _withoutIndex(iteratee) {\n return function (value, index, callback) {\n return iteratee(value, callback);\n };\n}\n\n/**\n * Applies the function `iteratee` to each item in `coll`, in parallel.\n * The `iteratee` is called with an item from the list, and a callback for when\n * it has finished. If the `iteratee` passes an error to its `callback`, the\n * main `callback` (for the `each` function) is immediately called with the\n * error.\n *\n * Note, that since this function applies `iteratee` to each item in parallel,\n * there is no guarantee that the iteratee functions will complete in order.\n *\n * @name each\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEach\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to\n * each item in `coll`. Invoked with (item, callback).\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOf`.\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @example\n *\n * // assuming openFiles is an array of file names and saveFile is a function\n * // to save the modified contents of that file:\n *\n * async.each(openFiles, saveFile, function(err){\n * // if any of the saves produced an error, err would equal that error\n * });\n *\n * // assuming openFiles is an array of file names\n * async.each(openFiles, function(file, callback) {\n *\n * // Perform operation on file here.\n * console.log('Processing file ' + file);\n *\n * if( file.length > 32 ) {\n * console.log('This file name is too long');\n * callback('File name too long');\n * } else {\n * // Do work to process file here\n * console.log('File processed');\n * callback();\n * }\n * }, function(err) {\n * // if any of the file processing produced an error, err would equal that error\n * if( err ) {\n * // One of the iterations produced an error.\n * // All processing will now stop.\n * console.log('A file failed to process');\n * } else {\n * console.log('All files have been processed successfully');\n * }\n * });\n */\nfunction eachLimit(coll, iteratee, callback) {\n eachOf(coll, _withoutIndex(wrapAsync(iteratee)), callback);\n}\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.\n *\n * @name eachLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfLimit`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nfunction eachLimit$1(coll, limit, iteratee, callback) {\n _eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback);\n}\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.\n *\n * @name eachSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachSeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfSeries`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nvar eachSeries = doLimit(eachLimit$1, 1);\n\n/**\n * Wrap an async function and ensure it calls its callback on a later tick of\n * the event loop. If the function already calls its callback on a next tick,\n * no extra deferral is added. This is useful for preventing stack overflows\n * (`RangeError: Maximum call stack size exceeded`) and generally keeping\n * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)\n * contained. ES2017 `async` functions are returned as-is -- they are immune\n * to Zalgo's corrupting influences, as they always resolve on a later tick.\n *\n * @name ensureAsync\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - an async function, one that expects a node-style\n * callback as its last argument.\n * @returns {AsyncFunction} Returns a wrapped function with the exact same call\n * signature as the function passed in.\n * @example\n *\n * function sometimesAsync(arg, callback) {\n * if (cache[arg]) {\n * return callback(null, cache[arg]); // this would be synchronous!!\n * } else {\n * doSomeIO(arg, callback); // this IO would be asynchronous\n * }\n * }\n *\n * // this has a risk of stack overflows if many results are cached in a row\n * async.mapSeries(args, sometimesAsync, done);\n *\n * // this will defer sometimesAsync's callback if necessary,\n * // preventing stack overflows\n * async.mapSeries(args, async.ensureAsync(sometimesAsync), done);\n */\nfunction ensureAsync(fn) {\n if (isAsync(fn)) return fn;\n return initialParams(function (args, callback) {\n var sync = true;\n args.push(function () {\n var innerArgs = arguments;\n if (sync) {\n setImmediate$1(function () {\n callback.apply(null, innerArgs);\n });\n } else {\n callback.apply(null, innerArgs);\n }\n });\n fn.apply(this, args);\n sync = false;\n });\n}\n\nfunction notId(v) {\n return !v;\n}\n\n/**\n * Returns `true` if every element in `coll` satisfies an async test. If any\n * iteratee call returns `false`, the main `callback` is immediately called.\n *\n * @name every\n * @static\n * @memberOf module:Collections\n * @method\n * @alias all\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n * @example\n *\n * async.every(['file1','file2','file3'], function(filePath, callback) {\n * fs.access(filePath, function(err) {\n * callback(null, !err)\n * });\n * }, function(err, result) {\n * // if result is true then every file exists\n * });\n */\nvar every = doParallel(_createTester(notId, notId));\n\n/**\n * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.\n *\n * @name everyLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.every]{@link module:Collections.every}\n * @alias allLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n */\nvar everyLimit = doParallelLimit(_createTester(notId, notId));\n\n/**\n * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.\n *\n * @name everySeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.every]{@link module:Collections.every}\n * @alias allSeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in series.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n */\nvar everySeries = doLimit(everyLimit, 1);\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nfunction filterArray(eachfn, arr, iteratee, callback) {\n var truthValues = new Array(arr.length);\n eachfn(arr, function (x, index, callback) {\n iteratee(x, function (err, v) {\n truthValues[index] = !!v;\n callback(err);\n });\n }, function (err) {\n if (err) return callback(err);\n var results = [];\n for (var i = 0; i < arr.length; i++) {\n if (truthValues[i]) results.push(arr[i]);\n }\n callback(null, results);\n });\n}\n\nfunction filterGeneric(eachfn, coll, iteratee, callback) {\n var results = [];\n eachfn(coll, function (x, index, callback) {\n iteratee(x, function (err, v) {\n if (err) {\n callback(err);\n } else {\n if (v) {\n results.push({index: index, value: x});\n }\n callback();\n }\n });\n }, function (err) {\n if (err) {\n callback(err);\n } else {\n callback(null, arrayMap(results.sort(function (a, b) {\n return a.index - b.index;\n }), baseProperty('value')));\n }\n });\n}\n\nfunction _filter(eachfn, coll, iteratee, callback) {\n var filter = isArrayLike(coll) ? filterArray : filterGeneric;\n filter(eachfn, coll, wrapAsync(iteratee), callback || noop);\n}\n\n/**\n * Returns a new array of all the values in `coll` which pass an async truth\n * test. This operation is performed in parallel, but the results array will be\n * in the same order as the original.\n *\n * @name filter\n * @static\n * @memberOf module:Collections\n * @method\n * @alias select\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @example\n *\n * async.filter(['file1','file2','file3'], function(filePath, callback) {\n * fs.access(filePath, function(err) {\n * callback(null, !err)\n * });\n * }, function(err, results) {\n * // results now equals an array of the existing files\n * });\n */\nvar filter = doParallel(_filter);\n\n/**\n * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name filterLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @alias selectLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n */\nvar filterLimit = doParallelLimit(_filter);\n\n/**\n * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.\n *\n * @name filterSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @alias selectSeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results)\n */\nvar filterSeries = doLimit(filterLimit, 1);\n\n/**\n * Calls the asynchronous function `fn` with a callback parameter that allows it\n * to call itself again, in series, indefinitely.\n\n * If an error is passed to the callback then `errback` is called with the\n * error, and execution stops, otherwise it will never be called.\n *\n * @name forever\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} fn - an async function to call repeatedly.\n * Invoked with (next).\n * @param {Function} [errback] - when `fn` passes an error to it's callback,\n * this function will be called, and execution stops. Invoked with (err).\n * @example\n *\n * async.forever(\n * function(next) {\n * // next is suitable for passing to things that need a callback(err [, whatever]);\n * // it will result in this function being called again.\n * },\n * function(err) {\n * // if next is called with a value in its first parameter, it will appear\n * // in here as 'err', and execution will stop.\n * }\n * );\n */\nfunction forever(fn, errback) {\n var done = onlyOnce(errback || noop);\n var task = wrapAsync(ensureAsync(fn));\n\n function next(err) {\n if (err) return done(err);\n task(next);\n }\n next();\n}\n\n/**\n * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time.\n *\n * @name groupByLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.groupBy]{@link module:Collections.groupBy}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n */\nvar groupByLimit = function(coll, limit, iteratee, callback) {\n callback = callback || noop;\n var _iteratee = wrapAsync(iteratee);\n mapLimit(coll, limit, function(val, callback) {\n _iteratee(val, function(err, key) {\n if (err) return callback(err);\n return callback(null, {key: key, val: val});\n });\n }, function(err, mapResults) {\n var result = {};\n // from MDN, handle object having an `hasOwnProperty` prop\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n\n for (var i = 0; i < mapResults.length; i++) {\n if (mapResults[i]) {\n var key = mapResults[i].key;\n var val = mapResults[i].val;\n\n if (hasOwnProperty.call(result, key)) {\n result[key].push(val);\n } else {\n result[key] = [val];\n }\n }\n }\n\n return callback(err, result);\n });\n};\n\n/**\n * Returns a new object, where each value corresponds to an array of items, from\n * `coll`, that returned the corresponding key. That is, the keys of the object\n * correspond to the values passed to the `iteratee` callback.\n *\n * Note: Since this function applies the `iteratee` to each item in parallel,\n * there is no guarantee that the `iteratee` functions will complete in order.\n * However, the values for each key in the `result` will be in the same order as\n * the original `coll`. For Objects, the values will roughly be in the order of\n * the original Objects' keys (but this can vary across JavaScript engines).\n *\n * @name groupBy\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n * @example\n *\n * async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) {\n * db.findById(userId, function(err, user) {\n * if (err) return callback(err);\n * return callback(null, user.age);\n * });\n * }, function(err, result) {\n * // result is object containing the userIds grouped by age\n * // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']};\n * });\n */\nvar groupBy = doLimit(groupByLimit, Infinity);\n\n/**\n * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time.\n *\n * @name groupBySeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.groupBy]{@link module:Collections.groupBy}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n */\nvar groupBySeries = doLimit(groupByLimit, 1);\n\n/**\n * Logs the result of an `async` function to the `console`. Only works in\n * Node.js or in browsers that support `console.log` and `console.error` (such\n * as FF and Chrome). If multiple arguments are returned from the async\n * function, `console.log` is called on each argument in order.\n *\n * @name log\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} function - The function you want to eventually apply\n * all arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n * setTimeout(function() {\n * callback(null, 'hello ' + name);\n * }, 1000);\n * };\n *\n * // in the node repl\n * node> async.log(hello, 'world');\n * 'hello world'\n */\nvar log = consoleFunc('log');\n\n/**\n * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name mapValuesLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.mapValues]{@link module:Collections.mapValues}\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n */\nfunction mapValuesLimit(obj, limit, iteratee, callback) {\n callback = once(callback || noop);\n var newObj = {};\n var _iteratee = wrapAsync(iteratee);\n eachOfLimit(obj, limit, function(val, key, next) {\n _iteratee(val, key, function (err, result) {\n if (err) return next(err);\n newObj[key] = result;\n next();\n });\n }, function (err) {\n callback(err, newObj);\n });\n}\n\n/**\n * A relative of [`map`]{@link module:Collections.map}, designed for use with objects.\n *\n * Produces a new Object by mapping each value of `obj` through the `iteratee`\n * function. The `iteratee` is called each `value` and `key` from `obj` and a\n * callback for when it has finished processing. Each of these callbacks takes\n * two arguments: an `error`, and the transformed item from `obj`. If `iteratee`\n * passes an error to its callback, the main `callback` (for the `mapValues`\n * function) is immediately called with the error.\n *\n * Note, the order of the keys in the result is not guaranteed. The keys will\n * be roughly in the order they complete, (but this is very engine-specific)\n *\n * @name mapValues\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @example\n *\n * async.mapValues({\n * f1: 'file1',\n * f2: 'file2',\n * f3: 'file3'\n * }, function (file, key, callback) {\n * fs.stat(file, callback);\n * }, function(err, result) {\n * // result is now a map of stats for each file, e.g.\n * // {\n * // f1: [stats for file1],\n * // f2: [stats for file2],\n * // f3: [stats for file3]\n * // }\n * });\n */\n\nvar mapValues = doLimit(mapValuesLimit, Infinity);\n\n/**\n * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time.\n *\n * @name mapValuesSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.mapValues]{@link module:Collections.mapValues}\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n */\nvar mapValuesSeries = doLimit(mapValuesLimit, 1);\n\nfunction has(obj, key) {\n return key in obj;\n}\n\n/**\n * Caches the results of an async function. When creating a hash to store\n * function results against, the callback is omitted from the hash and an\n * optional hash function can be used.\n *\n * If no hash function is specified, the first argument is used as a hash key,\n * which may work reasonably if it is a string or a data type that converts to a\n * distinct string. Note that objects and arrays will not behave reasonably.\n * Neither will cases where the other arguments are significant. In such cases,\n * specify your own hash function.\n *\n * The cache of results is exposed as the `memo` property of the function\n * returned by `memoize`.\n *\n * @name memoize\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - The async function to proxy and cache results from.\n * @param {Function} hasher - An optional function for generating a custom hash\n * for storing results. It has all the arguments applied to it apart from the\n * callback, and must be synchronous.\n * @returns {AsyncFunction} a memoized version of `fn`\n * @example\n *\n * var slow_fn = function(name, callback) {\n * // do something\n * callback(null, result);\n * };\n * var fn = async.memoize(slow_fn);\n *\n * // fn can now be used as if it were slow_fn\n * fn('some name', function() {\n * // callback\n * });\n */\nfunction memoize(fn, hasher) {\n var memo = Object.create(null);\n var queues = Object.create(null);\n hasher = hasher || identity;\n var _fn = wrapAsync(fn);\n var memoized = initialParams(function memoized(args, callback) {\n var key = hasher.apply(null, args);\n if (has(memo, key)) {\n setImmediate$1(function() {\n callback.apply(null, memo[key]);\n });\n } else if (has(queues, key)) {\n queues[key].push(callback);\n } else {\n queues[key] = [callback];\n _fn.apply(null, args.concat(function(/*args*/) {\n var args = slice(arguments);\n memo[key] = args;\n var q = queues[key];\n delete queues[key];\n for (var i = 0, l = q.length; i < l; i++) {\n q[i].apply(null, args);\n }\n }));\n }\n });\n memoized.memo = memo;\n memoized.unmemoized = fn;\n return memoized;\n}\n\n/**\n * Calls `callback` on a later loop around the event loop. In Node.js this just\n * calls `process.nextTick`. In the browser it will use `setImmediate` if\n * available, otherwise `setTimeout(callback, 0)`, which means other higher\n * priority events may precede the execution of `callback`.\n *\n * This is used internally for browser-compatibility purposes.\n *\n * @name nextTick\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.setImmediate]{@link module:Utils.setImmediate}\n * @category Util\n * @param {Function} callback - The function to call on a later loop around\n * the event loop. Invoked with (args...).\n * @param {...*} args... - any number of additional arguments to pass to the\n * callback on the next tick.\n * @example\n *\n * var call_order = [];\n * async.nextTick(function() {\n * call_order.push('two');\n * // call_order now equals ['one','two']\n * });\n * call_order.push('one');\n *\n * async.setImmediate(function (a, b, c) {\n * // a, b, and c equal 1, 2, and 3\n * }, 1, 2, 3);\n */\nvar _defer$1;\n\nif (hasNextTick) {\n _defer$1 = process.nextTick;\n} else if (hasSetImmediate) {\n _defer$1 = setImmediate;\n} else {\n _defer$1 = fallback;\n}\n\nvar nextTick = wrap(_defer$1);\n\nfunction _parallel(eachfn, tasks, callback) {\n callback = callback || noop;\n var results = isArrayLike(tasks) ? [] : {};\n\n eachfn(tasks, function (task, key, callback) {\n wrapAsync(task)(function (err, result) {\n if (arguments.length > 2) {\n result = slice(arguments, 1);\n }\n results[key] = result;\n callback(err);\n });\n }, function (err) {\n callback(err, results);\n });\n}\n\n/**\n * Run the `tasks` collection of functions in parallel, without waiting until\n * the previous function has completed. If any of the functions pass an error to\n * its callback, the main `callback` is immediately called with the value of the\n * error. Once the `tasks` have completed, the results are passed to the final\n * `callback` as an array.\n *\n * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about\n * parallel execution of code. If your tasks do not use any timers or perform\n * any I/O, they will actually be executed in series. Any synchronous setup\n * sections for each task will happen one after the other. JavaScript remains\n * single-threaded.\n *\n * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the\n * execution of other tasks when a task fails.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function and the results will be passed to the final `callback`\n * as an object instead of an array. This can be a more readable way of handling\n * results from {@link async.parallel}.\n *\n * @name parallel\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional `result` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n *\n * @example\n * async.parallel([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ],\n * // optional callback\n * function(err, results) {\n * // the results array will equal ['one','two'] even though\n * // the second function had a shorter timeout.\n * });\n *\n * // an example using an object instead of an array\n * async.parallel({\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * callback(null, 2);\n * }, 100);\n * }\n * }, function(err, results) {\n * // results is now equals to: {one: 1, two: 2}\n * });\n */\nfunction parallelLimit(tasks, callback) {\n _parallel(eachOf, tasks, callback);\n}\n\n/**\n * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name parallelLimit\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.parallel]{@link module:ControlFlow.parallel}\n * @category Control Flow\n * @param {Array|Iterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional `result` values.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n */\nfunction parallelLimit$1(tasks, limit, callback) {\n _parallel(_eachOfLimit(limit), tasks, callback);\n}\n\n/**\n * A queue of tasks for the worker function to complete.\n * @typedef {Object} QueueObject\n * @memberOf module:ControlFlow\n * @property {Function} length - a function returning the number of items\n * waiting to be processed. Invoke with `queue.length()`.\n * @property {boolean} started - a boolean indicating whether or not any\n * items have been pushed and processed by the queue.\n * @property {Function} running - a function returning the number of items\n * currently being processed. Invoke with `queue.running()`.\n * @property {Function} workersList - a function returning the array of items\n * currently being processed. Invoke with `queue.workersList()`.\n * @property {Function} idle - a function returning false if there are items\n * waiting or being processed, or true if not. Invoke with `queue.idle()`.\n * @property {number} concurrency - an integer for determining how many `worker`\n * functions should be run in parallel. This property can be changed after a\n * `queue` is created to alter the concurrency on-the-fly.\n * @property {Function} push - add a new task to the `queue`. Calls `callback`\n * once the `worker` has finished processing the task. Instead of a single task,\n * a `tasks` array can be submitted. The respective callback is used for every\n * task in the list. Invoke with `queue.push(task, [callback])`,\n * @property {Function} unshift - add a new task to the front of the `queue`.\n * Invoke with `queue.unshift(task, [callback])`.\n * @property {Function} remove - remove items from the queue that match a test\n * function. The test function will be passed an object with a `data` property,\n * and a `priority` property, if this is a\n * [priorityQueue]{@link module:ControlFlow.priorityQueue} object.\n * Invoked with `queue.remove(testFn)`, where `testFn` is of the form\n * `function ({data, priority}) {}` and returns a Boolean.\n * @property {Function} saturated - a callback that is called when the number of\n * running workers hits the `concurrency` limit, and further tasks will be\n * queued.\n * @property {Function} unsaturated - a callback that is called when the number\n * of running workers is less than the `concurrency` & `buffer` limits, and\n * further tasks will not be queued.\n * @property {number} buffer - A minimum threshold buffer in order to say that\n * the `queue` is `unsaturated`.\n * @property {Function} empty - a callback that is called when the last item\n * from the `queue` is given to a `worker`.\n * @property {Function} drain - a callback that is called when the last item\n * from the `queue` has returned from the `worker`.\n * @property {Function} error - a callback that is called when a task errors.\n * Has the signature `function(error, task)`.\n * @property {boolean} paused - a boolean for determining whether the queue is\n * in a paused state.\n * @property {Function} pause - a function that pauses the processing of tasks\n * until `resume()` is called. Invoke with `queue.pause()`.\n * @property {Function} resume - a function that resumes the processing of\n * queued tasks when the queue is paused. Invoke with `queue.resume()`.\n * @property {Function} kill - a function that removes the `drain` callback and\n * empties remaining tasks from the queue forcing it to go idle. No more tasks\n * should be pushed to the queue after calling this function. Invoke with `queue.kill()`.\n */\n\n/**\n * Creates a `queue` object with the specified `concurrency`. Tasks added to the\n * `queue` are processed in parallel (up to the `concurrency` limit). If all\n * `worker`s are in progress, the task is queued until one becomes available.\n * Once a `worker` completes a `task`, that `task`'s callback is called.\n *\n * @name queue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * `q.push()`. Invoked with (task, callback).\n * @param {number} [concurrency=1] - An `integer` for determining how many\n * `worker` functions should be run in parallel. If omitted, the concurrency\n * defaults to `1`. If the concurrency is `0`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can\n * attached as certain properties to listen for specific events during the\n * lifecycle of the queue.\n * @example\n *\n * // create a queue object with concurrency 2\n * var q = async.queue(function(task, callback) {\n * console.log('hello ' + task.name);\n * callback();\n * }, 2);\n *\n * // assign a callback\n * q.drain = function() {\n * console.log('all items have been processed');\n * };\n *\n * // add some items to the queue\n * q.push({name: 'foo'}, function(err) {\n * console.log('finished processing foo');\n * });\n * q.push({name: 'bar'}, function (err) {\n * console.log('finished processing bar');\n * });\n *\n * // add some items to the queue (batch-wise)\n * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {\n * console.log('finished processing item');\n * });\n *\n * // add some items to the front of the queue\n * q.unshift({name: 'bar'}, function (err) {\n * console.log('finished processing bar');\n * });\n */\nvar queue$1 = function (worker, concurrency) {\n var _worker = wrapAsync(worker);\n return queue(function (items, cb) {\n _worker(items[0], cb);\n }, concurrency, 1);\n};\n\n/**\n * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and\n * completed in ascending priority order.\n *\n * @name priorityQueue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * `q.push()`.\n * Invoked with (task, callback).\n * @param {number} concurrency - An `integer` for determining how many `worker`\n * functions should be run in parallel. If omitted, the concurrency defaults to\n * `1`. If the concurrency is `0`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two\n * differences between `queue` and `priorityQueue` objects:\n * * `push(task, priority, [callback])` - `priority` should be a number. If an\n * array of `tasks` is given, all tasks will be assigned the same priority.\n * * The `unshift` method was removed.\n */\nvar priorityQueue = function(worker, concurrency) {\n // Start with a normal queue\n var q = queue$1(worker, concurrency);\n\n // Override push to accept second parameter representing priority\n q.push = function(data, priority, callback) {\n if (callback == null) callback = noop;\n if (typeof callback !== 'function') {\n throw new Error('task callback must be a function');\n }\n q.started = true;\n if (!isArray(data)) {\n data = [data];\n }\n if (data.length === 0) {\n // call drain immediately if there are no tasks\n return setImmediate$1(function() {\n q.drain();\n });\n }\n\n priority = priority || 0;\n var nextNode = q._tasks.head;\n while (nextNode && priority >= nextNode.priority) {\n nextNode = nextNode.next;\n }\n\n for (var i = 0, l = data.length; i < l; i++) {\n var item = {\n data: data[i],\n priority: priority,\n callback: callback\n };\n\n if (nextNode) {\n q._tasks.insertBefore(nextNode, item);\n } else {\n q._tasks.push(item);\n }\n }\n setImmediate$1(q.process);\n };\n\n // Remove unshift function\n delete q.unshift;\n\n return q;\n};\n\n/**\n * Runs the `tasks` array of functions in parallel, without waiting until the\n * previous function has completed. Once any of the `tasks` complete or pass an\n * error to its callback, the main `callback` is immediately called. It's\n * equivalent to `Promise.race()`.\n *\n * @name race\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction}\n * to run. Each function can complete with an optional `result` value.\n * @param {Function} callback - A callback to run once any of the functions have\n * completed. This function gets an error or result from the first function that\n * completed. Invoked with (err, result).\n * @returns undefined\n * @example\n *\n * async.race([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ],\n * // main callback\n * function(err, result) {\n * // the result will be equal to 'two' as it finishes earlier\n * });\n */\nfunction race(tasks, callback) {\n callback = once(callback || noop);\n if (!isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));\n if (!tasks.length) return callback();\n for (var i = 0, l = tasks.length; i < l; i++) {\n wrapAsync(tasks[i])(callback);\n }\n}\n\n/**\n * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.\n *\n * @name reduceRight\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reduce]{@link module:Collections.reduce}\n * @alias foldr\n * @category Collection\n * @param {Array} array - A collection to iterate over.\n * @param {*} memo - The initial state of the reduction.\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * array to produce the next step in the reduction.\n * The `iteratee` should complete with the next state of the reduction.\n * If the iteratee complete with an error, the reduction is stopped and the\n * main `callback` is immediately called with the error.\n * Invoked with (memo, item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the reduced value. Invoked with\n * (err, result).\n */\nfunction reduceRight (array, memo, iteratee, callback) {\n var reversed = slice(array).reverse();\n reduce(reversed, memo, iteratee, callback);\n}\n\n/**\n * Wraps the async function in another function that always completes with a\n * result object, even when it errors.\n *\n * The result object has either the property `error` or `value`.\n *\n * @name reflect\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - The async function you want to wrap\n * @returns {Function} - A function that always passes null to it's callback as\n * the error. The second argument to the callback will be an `object` with\n * either an `error` or a `value` property.\n * @example\n *\n * async.parallel([\n * async.reflect(function(callback) {\n * // do some stuff ...\n * callback(null, 'one');\n * }),\n * async.reflect(function(callback) {\n * // do some more stuff but error ...\n * callback('bad stuff happened');\n * }),\n * async.reflect(function(callback) {\n * // do some more stuff ...\n * callback(null, 'two');\n * })\n * ],\n * // optional callback\n * function(err, results) {\n * // values\n * // results[0].value = 'one'\n * // results[1].error = 'bad stuff happened'\n * // results[2].value = 'two'\n * });\n */\nfunction reflect(fn) {\n var _fn = wrapAsync(fn);\n return initialParams(function reflectOn(args, reflectCallback) {\n args.push(function callback(error, cbArg) {\n if (error) {\n reflectCallback(null, { error: error });\n } else {\n var value;\n if (arguments.length <= 2) {\n value = cbArg;\n } else {\n value = slice(arguments, 1);\n }\n reflectCallback(null, { value: value });\n }\n });\n\n return _fn.apply(this, args);\n });\n}\n\n/**\n * A helper function that wraps an array or an object of functions with `reflect`.\n *\n * @name reflectAll\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.reflect]{@link module:Utils.reflect}\n * @category Util\n * @param {Array|Object|Iterable} tasks - The collection of\n * [async functions]{@link AsyncFunction} to wrap in `async.reflect`.\n * @returns {Array} Returns an array of async functions, each wrapped in\n * `async.reflect`\n * @example\n *\n * let tasks = [\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * // do some more stuff but error ...\n * callback(new Error('bad stuff happened'));\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ];\n *\n * async.parallel(async.reflectAll(tasks),\n * // optional callback\n * function(err, results) {\n * // values\n * // results[0].value = 'one'\n * // results[1].error = Error('bad stuff happened')\n * // results[2].value = 'two'\n * });\n *\n * // an example using an object instead of an array\n * let tasks = {\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * two: function(callback) {\n * callback('two');\n * },\n * three: function(callback) {\n * setTimeout(function() {\n * callback(null, 'three');\n * }, 100);\n * }\n * };\n *\n * async.parallel(async.reflectAll(tasks),\n * // optional callback\n * function(err, results) {\n * // values\n * // results.one.value = 'one'\n * // results.two.error = 'two'\n * // results.three.value = 'three'\n * });\n */\nfunction reflectAll(tasks) {\n var results;\n if (isArray(tasks)) {\n results = arrayMap(tasks, reflect);\n } else {\n results = {};\n baseForOwn(tasks, function(task, key) {\n results[key] = reflect.call(this, task);\n });\n }\n return results;\n}\n\nfunction reject$1(eachfn, arr, iteratee, callback) {\n _filter(eachfn, arr, function(value, cb) {\n iteratee(value, function(err, v) {\n cb(err, !v);\n });\n }, callback);\n}\n\n/**\n * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test.\n *\n * @name reject\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @example\n *\n * async.reject(['file1','file2','file3'], function(filePath, callback) {\n * fs.access(filePath, function(err) {\n * callback(null, !err)\n * });\n * }, function(err, results) {\n * // results now equals an array of missing files\n * createFiles(results);\n * });\n */\nvar reject = doParallel(reject$1);\n\n/**\n * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name rejectLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reject]{@link module:Collections.reject}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n */\nvar rejectLimit = doParallelLimit(reject$1);\n\n/**\n * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time.\n *\n * @name rejectSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reject]{@link module:Collections.reject}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n */\nvar rejectSeries = doLimit(rejectLimit, 1);\n\n/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant$1(value) {\n return function() {\n return value;\n };\n}\n\n/**\n * Attempts to get a successful response from `task` no more than `times` times\n * before returning an error. If the task is successful, the `callback` will be\n * passed the result of the successful task. If all attempts fail, the callback\n * will be passed the error and result (if any) of the final attempt.\n *\n * @name retry\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @see [async.retryable]{@link module:ControlFlow.retryable}\n * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an\n * object with `times` and `interval` or a number.\n * * `times` - The number of attempts to make before giving up. The default\n * is `5`.\n * * `interval` - The time to wait between retries, in milliseconds. The\n * default is `0`. The interval may also be specified as a function of the\n * retry count (see example).\n * * `errorFilter` - An optional synchronous function that is invoked on\n * erroneous result. If it returns `true` the retry attempts will continue;\n * if the function returns `false` the retry flow is aborted with the current\n * attempt's error and result being returned to the final callback.\n * Invoked with (err).\n * * If `opts` is a number, the number specifies the number of times to retry,\n * with the default interval of `0`.\n * @param {AsyncFunction} task - An async function to retry.\n * Invoked with (callback).\n * @param {Function} [callback] - An optional callback which is called when the\n * task has succeeded, or after the final failed attempt. It receives the `err`\n * and `result` arguments of the last attempt at completing the `task`. Invoked\n * with (err, results).\n *\n * @example\n *\n * // The `retry` function can be used as a stand-alone control flow by passing\n * // a callback, as shown below:\n *\n * // try calling apiMethod 3 times\n * async.retry(3, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod 3 times, waiting 200 ms between each retry\n * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod 10 times with exponential backoff\n * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds)\n * async.retry({\n * times: 10,\n * interval: function(retryCount) {\n * return 50 * Math.pow(2, retryCount);\n * }\n * }, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod the default 5 times no delay between each retry\n * async.retry(apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod only when error condition satisfies, all other\n * // errors will abort the retry control flow and return to final callback\n * async.retry({\n * errorFilter: function(err) {\n * return err.message === 'Temporary error'; // only retry on a specific error\n * }\n * }, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // to retry individual methods that are not as reliable within other\n * // control flow functions, use the `retryable` wrapper:\n * async.auto({\n * users: api.getUsers.bind(api),\n * payments: async.retryable(3, api.getPayments.bind(api))\n * }, function(err, results) {\n * // do something with the results\n * });\n *\n */\nfunction retry(opts, task, callback) {\n var DEFAULT_TIMES = 5;\n var DEFAULT_INTERVAL = 0;\n\n var options = {\n times: DEFAULT_TIMES,\n intervalFunc: constant$1(DEFAULT_INTERVAL)\n };\n\n function parseTimes(acc, t) {\n if (typeof t === 'object') {\n acc.times = +t.times || DEFAULT_TIMES;\n\n acc.intervalFunc = typeof t.interval === 'function' ?\n t.interval :\n constant$1(+t.interval || DEFAULT_INTERVAL);\n\n acc.errorFilter = t.errorFilter;\n } else if (typeof t === 'number' || typeof t === 'string') {\n acc.times = +t || DEFAULT_TIMES;\n } else {\n throw new Error(\"Invalid arguments for async.retry\");\n }\n }\n\n if (arguments.length < 3 && typeof opts === 'function') {\n callback = task || noop;\n task = opts;\n } else {\n parseTimes(options, opts);\n callback = callback || noop;\n }\n\n if (typeof task !== 'function') {\n throw new Error(\"Invalid arguments for async.retry\");\n }\n\n var _task = wrapAsync(task);\n\n var attempt = 1;\n function retryAttempt() {\n _task(function(err) {\n if (err && attempt++ < options.times &&\n (typeof options.errorFilter != 'function' ||\n options.errorFilter(err))) {\n setTimeout(retryAttempt, options.intervalFunc(attempt));\n } else {\n callback.apply(null, arguments);\n }\n });\n }\n\n retryAttempt();\n}\n\n/**\n * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method\n * wraps a task and makes it retryable, rather than immediately calling it\n * with retries.\n *\n * @name retryable\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.retry]{@link module:ControlFlow.retry}\n * @category Control Flow\n * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional\n * options, exactly the same as from `retry`\n * @param {AsyncFunction} task - the asynchronous function to wrap.\n * This function will be passed any arguments passed to the returned wrapper.\n * Invoked with (...args, callback).\n * @returns {AsyncFunction} The wrapped function, which when invoked, will\n * retry on an error, based on the parameters specified in `opts`.\n * This function will accept the same parameters as `task`.\n * @example\n *\n * async.auto({\n * dep1: async.retryable(3, getFromFlakyService),\n * process: [\"dep1\", async.retryable(3, function (results, cb) {\n * maybeProcessData(results.dep1, cb);\n * })]\n * }, callback);\n */\nvar retryable = function (opts, task) {\n if (!task) {\n task = opts;\n opts = null;\n }\n var _task = wrapAsync(task);\n return initialParams(function (args, callback) {\n function taskFn(cb) {\n _task.apply(null, args.concat(cb));\n }\n\n if (opts) retry(opts, taskFn, callback);\n else retry(taskFn, callback);\n\n });\n};\n\n/**\n * Run the functions in the `tasks` collection in series, each one running once\n * the previous function has completed. If any functions in the series pass an\n * error to its callback, no more functions are run, and `callback` is\n * immediately called with the value of the error. Otherwise, `callback`\n * receives an array of results when `tasks` have completed.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function, and the results will be passed to the final `callback`\n * as an object instead of an array. This can be a more readable way of handling\n * results from {@link async.series}.\n *\n * **Note** that while many implementations preserve the order of object\n * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)\n * explicitly states that\n *\n * > The mechanics and order of enumerating the properties is not specified.\n *\n * So if you rely on the order in which your series of functions are executed,\n * and want this to work on all platforms, consider using an array.\n *\n * @name series\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} tasks - A collection containing\n * [async functions]{@link AsyncFunction} to run in series.\n * Each function can complete with any number of optional `result` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This function gets a results array (or object)\n * containing all the result arguments passed to the `task` callbacks. Invoked\n * with (err, result).\n * @example\n * async.series([\n * function(callback) {\n * // do some stuff ...\n * callback(null, 'one');\n * },\n * function(callback) {\n * // do some more stuff ...\n * callback(null, 'two');\n * }\n * ],\n * // optional callback\n * function(err, results) {\n * // results is now equal to ['one', 'two']\n * });\n *\n * async.series({\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback){\n * setTimeout(function() {\n * callback(null, 2);\n * }, 100);\n * }\n * }, function(err, results) {\n * // results is now equal to: {one: 1, two: 2}\n * });\n */\nfunction series(tasks, callback) {\n _parallel(eachOfSeries, tasks, callback);\n}\n\n/**\n * Returns `true` if at least one element in the `coll` satisfies an async test.\n * If any iteratee call returns `true`, the main `callback` is immediately\n * called.\n *\n * @name some\n * @static\n * @memberOf module:Collections\n * @method\n * @alias any\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n * @example\n *\n * async.some(['file1','file2','file3'], function(filePath, callback) {\n * fs.access(filePath, function(err) {\n * callback(null, !err)\n * });\n * }, function(err, result) {\n * // if result is true then at least one of the files exists\n * });\n */\nvar some = doParallel(_createTester(Boolean, identity));\n\n/**\n * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.\n *\n * @name someLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.some]{@link module:Collections.some}\n * @alias anyLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n */\nvar someLimit = doParallelLimit(_createTester(Boolean, identity));\n\n/**\n * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.\n *\n * @name someSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.some]{@link module:Collections.some}\n * @alias anySeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in series.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n */\nvar someSeries = doLimit(someLimit, 1);\n\n/**\n * Sorts a list by the results of running each `coll` value through an async\n * `iteratee`.\n *\n * @name sortBy\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a value to use as the sort criteria as\n * its `result`.\n * Invoked with (item, callback).\n * @param {Function} callback - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is the items\n * from the original `coll` sorted by the values returned by the `iteratee`\n * calls. Invoked with (err, results).\n * @example\n *\n * async.sortBy(['file1','file2','file3'], function(file, callback) {\n * fs.stat(file, function(err, stats) {\n * callback(err, stats.mtime);\n * });\n * }, function(err, results) {\n * // results is now the original array of files sorted by\n * // modified date\n * });\n *\n * // By modifying the callback parameter the\n * // sorting order can be influenced:\n *\n * // ascending order\n * async.sortBy([1,9,3,5], function(x, callback) {\n * callback(null, x);\n * }, function(err,result) {\n * // result callback\n * });\n *\n * // descending order\n * async.sortBy([1,9,3,5], function(x, callback) {\n * callback(null, x*-1); //<- x*-1 instead of x, turns the order around\n * }, function(err,result) {\n * // result callback\n * });\n */\nfunction sortBy (coll, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n map(coll, function (x, callback) {\n _iteratee(x, function (err, criteria) {\n if (err) return callback(err);\n callback(null, {value: x, criteria: criteria});\n });\n }, function (err, results) {\n if (err) return callback(err);\n callback(null, arrayMap(results.sort(comparator), baseProperty('value')));\n });\n\n function comparator(left, right) {\n var a = left.criteria, b = right.criteria;\n return a < b ? -1 : a > b ? 1 : 0;\n }\n}\n\n/**\n * Sets a time limit on an asynchronous function. If the function does not call\n * its callback within the specified milliseconds, it will be called with a\n * timeout error. The code property for the error object will be `'ETIMEDOUT'`.\n *\n * @name timeout\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} asyncFn - The async function to limit in time.\n * @param {number} milliseconds - The specified time limit.\n * @param {*} [info] - Any variable you want attached (`string`, `object`, etc)\n * to timeout Error for more information..\n * @returns {AsyncFunction} Returns a wrapped function that can be used with any\n * of the control flow functions.\n * Invoke this function with the same parameters as you would `asyncFunc`.\n * @example\n *\n * function myFunction(foo, callback) {\n * doAsyncTask(foo, function(err, data) {\n * // handle errors\n * if (err) return callback(err);\n *\n * // do some stuff ...\n *\n * // return processed data\n * return callback(null, data);\n * });\n * }\n *\n * var wrapped = async.timeout(myFunction, 1000);\n *\n * // call `wrapped` as you would `myFunction`\n * wrapped({ bar: 'bar' }, function(err, data) {\n * // if `myFunction` takes < 1000 ms to execute, `err`\n * // and `data` will have their expected values\n *\n * // else `err` will be an Error with the code 'ETIMEDOUT'\n * });\n */\nfunction timeout(asyncFn, milliseconds, info) {\n var fn = wrapAsync(asyncFn);\n\n return initialParams(function (args, callback) {\n var timedOut = false;\n var timer;\n\n function timeoutCallback() {\n var name = asyncFn.name || 'anonymous';\n var error = new Error('Callback function \"' + name + '\" timed out.');\n error.code = 'ETIMEDOUT';\n if (info) {\n error.info = info;\n }\n timedOut = true;\n callback(error);\n }\n\n args.push(function () {\n if (!timedOut) {\n callback.apply(null, arguments);\n clearTimeout(timer);\n }\n });\n\n // setup timer and call original function\n timer = setTimeout(timeoutCallback, milliseconds);\n fn.apply(null, args);\n });\n}\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil;\nvar nativeMax = Math.max;\n\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\nfunction baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n}\n\n/**\n * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name timesLimit\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.times]{@link module:ControlFlow.times}\n * @category Control Flow\n * @param {number} count - The number of times to run the function.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see [async.map]{@link module:Collections.map}.\n */\nfunction timeLimit(count, limit, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n mapLimit(baseRange(0, count, 1), limit, _iteratee, callback);\n}\n\n/**\n * Calls the `iteratee` function `n` times, and accumulates results in the same\n * manner you would use with [map]{@link module:Collections.map}.\n *\n * @name times\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Control Flow\n * @param {number} n - The number of times to run the function.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see {@link module:Collections.map}.\n * @example\n *\n * // Pretend this is some complicated async factory\n * var createUser = function(id, callback) {\n * callback(null, {\n * id: 'user' + id\n * });\n * };\n *\n * // generate 5 users\n * async.times(5, function(n, next) {\n * createUser(n, function(err, user) {\n * next(err, user);\n * });\n * }, function(err, users) {\n * // we should now have 5 users\n * });\n */\nvar times = doLimit(timeLimit, Infinity);\n\n/**\n * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time.\n *\n * @name timesSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.times]{@link module:ControlFlow.times}\n * @category Control Flow\n * @param {number} n - The number of times to run the function.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see {@link module:Collections.map}.\n */\nvar timesSeries = doLimit(timeLimit, 1);\n\n/**\n * A relative of `reduce`. Takes an Object or Array, and iterates over each\n * element in series, each step potentially mutating an `accumulator` value.\n * The type of the accumulator defaults to the type of collection passed in.\n *\n * @name transform\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {*} [accumulator] - The initial state of the transform. If omitted,\n * it will default to an empty Object or Array, depending on the type of `coll`\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * collection that potentially modifies the accumulator.\n * Invoked with (accumulator, item, key, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the transformed accumulator.\n * Invoked with (err, result).\n * @example\n *\n * async.transform([1,2,3], function(acc, item, index, callback) {\n * // pointless async:\n * process.nextTick(function() {\n * acc.push(item * 2)\n * callback(null)\n * });\n * }, function(err, result) {\n * // result is now equal to [2, 4, 6]\n * });\n *\n * @example\n *\n * async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) {\n * setImmediate(function () {\n * obj[key] = val * 2;\n * callback();\n * })\n * }, function (err, result) {\n * // result is equal to {a: 2, b: 4, c: 6}\n * })\n */\nfunction transform (coll, accumulator, iteratee, callback) {\n if (arguments.length <= 3) {\n callback = iteratee;\n iteratee = accumulator;\n accumulator = isArray(coll) ? [] : {};\n }\n callback = once(callback || noop);\n var _iteratee = wrapAsync(iteratee);\n\n eachOf(coll, function(v, k, cb) {\n _iteratee(accumulator, v, k, cb);\n }, function(err) {\n callback(err, accumulator);\n });\n}\n\n/**\n * It runs each task in series but stops whenever any of the functions were\n * successful. If one of the tasks were successful, the `callback` will be\n * passed the result of the successful task. If all tasks fail, the callback\n * will be passed the error and result (if any) of the final attempt.\n *\n * @name tryEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} tasks - A collection containing functions to\n * run, each function is passed a `callback(err, result)` it must call on\n * completion with an error `err` (which can be `null`) and an optional `result`\n * value.\n * @param {Function} [callback] - An optional callback which is called when one\n * of the tasks has succeeded, or all have failed. It receives the `err` and\n * `result` arguments of the last attempt at completing the `task`. Invoked with\n * (err, results).\n * @example\n * async.tryEach([\n * function getDataFromFirstWebsite(callback) {\n * // Try getting the data from the first website\n * callback(err, data);\n * },\n * function getDataFromSecondWebsite(callback) {\n * // First website failed,\n * // Try getting the data from the backup website\n * callback(err, data);\n * }\n * ],\n * // optional callback\n * function(err, results) {\n * Now do something with the data.\n * });\n *\n */\nfunction tryEach(tasks, callback) {\n var error = null;\n var result;\n callback = callback || noop;\n eachSeries(tasks, function(task, callback) {\n wrapAsync(task)(function (err, res/*, ...args*/) {\n if (arguments.length > 2) {\n result = slice(arguments, 1);\n } else {\n result = res;\n }\n error = err;\n callback(!err);\n });\n }, function () {\n callback(error, result);\n });\n}\n\n/**\n * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original,\n * unmemoized form. Handy for testing.\n *\n * @name unmemoize\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.memoize]{@link module:Utils.memoize}\n * @category Util\n * @param {AsyncFunction} fn - the memoized function\n * @returns {AsyncFunction} a function that calls the original unmemoized function\n */\nfunction unmemoize(fn) {\n return function () {\n return (fn.unmemoized || fn).apply(null, arguments);\n };\n}\n\n/**\n * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when\n * stopped, or an error occurs.\n *\n * @name whilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Function} test - synchronous truth test to perform before each\n * execution of `iteratee`. Invoked with ().\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` passes. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n * @returns undefined\n * @example\n *\n * var count = 0;\n * async.whilst(\n * function() { return count < 5; },\n * function(callback) {\n * count++;\n * setTimeout(function() {\n * callback(null, count);\n * }, 1000);\n * },\n * function (err, n) {\n * // 5 seconds have passed, n = 5\n * }\n * );\n */\nfunction whilst(test, iteratee, callback) {\n callback = onlyOnce(callback || noop);\n var _iteratee = wrapAsync(iteratee);\n if (!test()) return callback(null);\n var next = function(err/*, ...args*/) {\n if (err) return callback(err);\n if (test()) return _iteratee(next);\n var args = slice(arguments, 1);\n callback.apply(null, [null].concat(args));\n };\n _iteratee(next);\n}\n\n/**\n * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when\n * stopped, or an error occurs. `callback` will be passed an error and any\n * arguments passed to the final `iteratee`'s callback.\n *\n * The inverse of [whilst]{@link module:ControlFlow.whilst}.\n *\n * @name until\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {Function} test - synchronous truth test to perform before each\n * execution of `iteratee`. Invoked with ().\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` fails. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n */\nfunction until(test, iteratee, callback) {\n whilst(function() {\n return !test.apply(this, arguments);\n }, iteratee, callback);\n}\n\n/**\n * Runs the `tasks` array of functions in series, each passing their results to\n * the next in the array. However, if any of the `tasks` pass an error to their\n * own callback, the next function is not executed, and the main `callback` is\n * immediately called with the error.\n *\n * @name waterfall\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array of [async functions]{@link AsyncFunction}\n * to run.\n * Each function should complete with any number of `result` values.\n * The `result` values will be passed as arguments, in order, to the next task.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This will be passed the results of the last task's\n * callback. Invoked with (err, [results]).\n * @returns undefined\n * @example\n *\n * async.waterfall([\n * function(callback) {\n * callback(null, 'one', 'two');\n * },\n * function(arg1, arg2, callback) {\n * // arg1 now equals 'one' and arg2 now equals 'two'\n * callback(null, 'three');\n * },\n * function(arg1, callback) {\n * // arg1 now equals 'three'\n * callback(null, 'done');\n * }\n * ], function (err, result) {\n * // result now equals 'done'\n * });\n *\n * // Or, with named functions:\n * async.waterfall([\n * myFirstFunction,\n * mySecondFunction,\n * myLastFunction,\n * ], function (err, result) {\n * // result now equals 'done'\n * });\n * function myFirstFunction(callback) {\n * callback(null, 'one', 'two');\n * }\n * function mySecondFunction(arg1, arg2, callback) {\n * // arg1 now equals 'one' and arg2 now equals 'two'\n * callback(null, 'three');\n * }\n * function myLastFunction(arg1, callback) {\n * // arg1 now equals 'three'\n * callback(null, 'done');\n * }\n */\nvar waterfall = function(tasks, callback) {\n callback = once(callback || noop);\n if (!isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));\n if (!tasks.length) return callback();\n var taskIndex = 0;\n\n function nextTask(args) {\n var task = wrapAsync(tasks[taskIndex++]);\n args.push(onlyOnce(next));\n task.apply(null, args);\n }\n\n function next(err/*, ...args*/) {\n if (err || taskIndex === tasks.length) {\n return callback.apply(null, arguments);\n }\n nextTask(slice(arguments, 1));\n }\n\n nextTask([]);\n};\n\n/**\n * An \"async function\" in the context of Async is an asynchronous function with\n * a variable number of parameters, with the final parameter being a callback.\n * (`function (arg1, arg2, ..., callback) {}`)\n * The final callback is of the form `callback(err, results...)`, which must be\n * called once the function is completed. The callback should be called with a\n * Error as its first argument to signal that an error occurred.\n * Otherwise, if no error occurred, it should be called with `null` as the first\n * argument, and any additional `result` arguments that may apply, to signal\n * successful completion.\n * The callback must be called exactly once, ideally on a later tick of the\n * JavaScript event loop.\n *\n * This type of function is also referred to as a \"Node-style async function\",\n * or a \"continuation passing-style function\" (CPS). Most of the methods of this\n * library are themselves CPS/Node-style async functions, or functions that\n * return CPS/Node-style async functions.\n *\n * Wherever we accept a Node-style async function, we also directly accept an\n * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}.\n * In this case, the `async` function will not be passed a final callback\n * argument, and any thrown error will be used as the `err` argument of the\n * implicit callback, and the return value will be used as the `result` value.\n * (i.e. a `rejected` of the returned Promise becomes the `err` callback\n * argument, and a `resolved` value becomes the `result`.)\n *\n * Note, due to JavaScript limitations, we can only detect native `async`\n * functions and not transpilied implementations.\n * Your environment must have `async`/`await` support for this to work.\n * (e.g. Node > v7.6, or a recent version of a modern browser).\n * If you are using `async` functions through a transpiler (e.g. Babel), you\n * must still wrap the function with [asyncify]{@link module:Utils.asyncify},\n * because the `async function` will be compiled to an ordinary function that\n * returns a promise.\n *\n * @typedef {Function} AsyncFunction\n * @static\n */\n\n/**\n * Async is a utility module which provides straight-forward, powerful functions\n * for working with asynchronous JavaScript. Although originally designed for\n * use with [Node.js](http://nodejs.org) and installable via\n * `npm install --save async`, it can also be used directly in the browser.\n * @module async\n * @see AsyncFunction\n */\n\n\n/**\n * A collection of `async` functions for manipulating collections, such as\n * arrays and objects.\n * @module Collections\n */\n\n/**\n * A collection of `async` functions for controlling the flow through a script.\n * @module ControlFlow\n */\n\n/**\n * A collection of `async` utility functions.\n * @module Utils\n */\n\nvar index = {\n apply: apply,\n applyEach: applyEach,\n applyEachSeries: applyEachSeries,\n asyncify: asyncify,\n auto: auto,\n autoInject: autoInject,\n cargo: cargo,\n compose: compose,\n concat: concat,\n concatLimit: concatLimit,\n concatSeries: concatSeries,\n constant: constant,\n detect: detect,\n detectLimit: detectLimit,\n detectSeries: detectSeries,\n dir: dir,\n doDuring: doDuring,\n doUntil: doUntil,\n doWhilst: doWhilst,\n during: during,\n each: eachLimit,\n eachLimit: eachLimit$1,\n eachOf: eachOf,\n eachOfLimit: eachOfLimit,\n eachOfSeries: eachOfSeries,\n eachSeries: eachSeries,\n ensureAsync: ensureAsync,\n every: every,\n everyLimit: everyLimit,\n everySeries: everySeries,\n filter: filter,\n filterLimit: filterLimit,\n filterSeries: filterSeries,\n forever: forever,\n groupBy: groupBy,\n groupByLimit: groupByLimit,\n groupBySeries: groupBySeries,\n log: log,\n map: map,\n mapLimit: mapLimit,\n mapSeries: mapSeries,\n mapValues: mapValues,\n mapValuesLimit: mapValuesLimit,\n mapValuesSeries: mapValuesSeries,\n memoize: memoize,\n nextTick: nextTick,\n parallel: parallelLimit,\n parallelLimit: parallelLimit$1,\n priorityQueue: priorityQueue,\n queue: queue$1,\n race: race,\n reduce: reduce,\n reduceRight: reduceRight,\n reflect: reflect,\n reflectAll: reflectAll,\n reject: reject,\n rejectLimit: rejectLimit,\n rejectSeries: rejectSeries,\n retry: retry,\n retryable: retryable,\n seq: seq,\n series: series,\n setImmediate: setImmediate$1,\n some: some,\n someLimit: someLimit,\n someSeries: someSeries,\n sortBy: sortBy,\n timeout: timeout,\n times: times,\n timesLimit: timeLimit,\n timesSeries: timesSeries,\n transform: transform,\n tryEach: tryEach,\n unmemoize: unmemoize,\n until: until,\n waterfall: waterfall,\n whilst: whilst,\n\n // aliases\n all: every,\n allLimit: everyLimit,\n allSeries: everySeries,\n any: some,\n anyLimit: someLimit,\n anySeries: someSeries,\n find: detect,\n findLimit: detectLimit,\n findSeries: detectSeries,\n forEach: eachLimit,\n forEachSeries: eachSeries,\n forEachLimit: eachLimit$1,\n forEachOf: eachOf,\n forEachOfSeries: eachOfSeries,\n forEachOfLimit: eachOfLimit,\n inject: reduce,\n foldl: reduce,\n foldr: reduceRight,\n select: filter,\n selectLimit: filterLimit,\n selectSeries: filterSeries,\n wrapSync: asyncify\n};\n\nexports['default'] = index;\nexports.apply = apply;\nexports.applyEach = applyEach;\nexports.applyEachSeries = applyEachSeries;\nexports.asyncify = asyncify;\nexports.auto = auto;\nexports.autoInject = autoInject;\nexports.cargo = cargo;\nexports.compose = compose;\nexports.concat = concat;\nexports.concatLimit = concatLimit;\nexports.concatSeries = concatSeries;\nexports.constant = constant;\nexports.detect = detect;\nexports.detectLimit = detectLimit;\nexports.detectSeries = detectSeries;\nexports.dir = dir;\nexports.doDuring = doDuring;\nexports.doUntil = doUntil;\nexports.doWhilst = doWhilst;\nexports.during = during;\nexports.each = eachLimit;\nexports.eachLimit = eachLimit$1;\nexports.eachOf = eachOf;\nexports.eachOfLimit = eachOfLimit;\nexports.eachOfSeries = eachOfSeries;\nexports.eachSeries = eachSeries;\nexports.ensureAsync = ensureAsync;\nexports.every = every;\nexports.everyLimit = everyLimit;\nexports.everySeries = everySeries;\nexports.filter = filter;\nexports.filterLimit = filterLimit;\nexports.filterSeries = filterSeries;\nexports.forever = forever;\nexports.groupBy = groupBy;\nexports.groupByLimit = groupByLimit;\nexports.groupBySeries = groupBySeries;\nexports.log = log;\nexports.map = map;\nexports.mapLimit = mapLimit;\nexports.mapSeries = mapSeries;\nexports.mapValues = mapValues;\nexports.mapValuesLimit = mapValuesLimit;\nexports.mapValuesSeries = mapValuesSeries;\nexports.memoize = memoize;\nexports.nextTick = nextTick;\nexports.parallel = parallelLimit;\nexports.parallelLimit = parallelLimit$1;\nexports.priorityQueue = priorityQueue;\nexports.queue = queue$1;\nexports.race = race;\nexports.reduce = reduce;\nexports.reduceRight = reduceRight;\nexports.reflect = reflect;\nexports.reflectAll = reflectAll;\nexports.reject = reject;\nexports.rejectLimit = rejectLimit;\nexports.rejectSeries = rejectSeries;\nexports.retry = retry;\nexports.retryable = retryable;\nexports.seq = seq;\nexports.series = series;\nexports.setImmediate = setImmediate$1;\nexports.some = some;\nexports.someLimit = someLimit;\nexports.someSeries = someSeries;\nexports.sortBy = sortBy;\nexports.timeout = timeout;\nexports.times = times;\nexports.timesLimit = timeLimit;\nexports.timesSeries = timesSeries;\nexports.transform = transform;\nexports.tryEach = tryEach;\nexports.unmemoize = unmemoize;\nexports.until = until;\nexports.waterfall = waterfall;\nexports.whilst = whilst;\nexports.all = every;\nexports.allLimit = everyLimit;\nexports.allSeries = everySeries;\nexports.any = some;\nexports.anyLimit = someLimit;\nexports.anySeries = someSeries;\nexports.find = detect;\nexports.findLimit = detectLimit;\nexports.findSeries = detectSeries;\nexports.forEach = eachLimit;\nexports.forEachSeries = eachSeries;\nexports.forEachLimit = eachLimit$1;\nexports.forEachOf = eachOf;\nexports.forEachOfSeries = eachOfSeries;\nexports.forEachOfLimit = eachOfLimit;\nexports.inject = reduce;\nexports.foldl = reduce;\nexports.foldr = reduceRight;\nexports.select = filter;\nexports.selectLimit = filterLimit;\nexports.selectSeries = filterSeries;\nexports.wrapSync = asyncify;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","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","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildFullPath = require('../core/buildFullPath');\nvar buildURL = require('./../helpers/buildURL');\nvar http = require('http');\nvar https = require('https');\nvar httpFollow = require('follow-redirects').http;\nvar httpsFollow = require('follow-redirects').https;\nvar url = require('url');\nvar zlib = require('zlib');\nvar VERSION = require('./../env/data').version;\nvar transitionalDefaults = require('../defaults/transitional');\nvar AxiosError = require('../core/AxiosError');\nvar CanceledError = require('../cancel/CanceledError');\n\nvar isHttps = /https:?/;\n\nvar supportedProtocols = [ 'http:', 'https:', 'file:' ];\n\n/**\n *\n * @param {http.ClientRequestArgs} options\n * @param {AxiosProxyConfig} proxy\n * @param {string} location\n */\nfunction setProxy(options, proxy, location) {\n options.hostname = proxy.host;\n options.host = proxy.host;\n options.port = proxy.port;\n options.path = location;\n\n // Basic proxy authorization\n if (proxy.auth) {\n var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n\n // If a proxy is used, any redirects must also pass through the proxy\n options.beforeRedirect = function beforeRedirect(redirection) {\n redirection.headers.host = redirection.host;\n setProxy(redirection, proxy, redirection.href);\n };\n}\n\n/*eslint consistent-return:0*/\nmodule.exports = function httpAdapter(config) {\n return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {\n var 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 var resolve = function resolve(value) {\n done();\n resolvePromise(value);\n };\n var rejected = false;\n var reject = function reject(value) {\n done();\n rejected = true;\n rejectPromise(value);\n };\n var data = config.data;\n var headers = config.headers;\n var headerNames = {};\n\n Object.keys(headers).forEach(function storeLowerName(name) {\n headerNames[name.toLowerCase()] = name;\n });\n\n // Set User-Agent (required by some servers)\n // See https://github.com/axios/axios/issues/69\n if ('user-agent' in headerNames) {\n // User-Agent is specified; handle case where no UA header is desired\n if (!headers[headerNames['user-agent']]) {\n delete headers[headerNames['user-agent']];\n }\n // Otherwise, use specified value\n } else {\n // Only set header if it hasn't been set in config\n headers['User-Agent'] = 'axios/' + VERSION;\n }\n\n // support for https://www.npmjs.com/package/form-data api\n if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {\n Object.assign(headers, data.getHeaders());\n } else if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) {\n // Nothing to do...\n } 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 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 // Add Content-Length header if data exists\n if (!headerNames['content-length']) {\n headers['Content-Length'] = data.length;\n }\n }\n\n // HTTP basic authentication\n var auth = undefined;\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n // Parse url\n var fullPath = buildFullPath(config.baseURL, config.url);\n var parsed = url.parse(fullPath);\n var protocol = parsed.protocol || supportedProtocols[0];\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 if (!auth && parsed.auth) {\n var urlAuth = parsed.auth.split(':');\n var urlUsername = urlAuth[0] || '';\n var urlPassword = urlAuth[1] || '';\n auth = urlUsername + ':' + urlPassword;\n }\n\n if (auth && headerNames.authorization) {\n delete headers[headerNames.authorization];\n }\n\n var isHttpsRequest = isHttps.test(protocol);\n var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n\n try {\n buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, '');\n } catch (err) {\n var customErr = new Error(err.message);\n customErr.config = config;\n customErr.url = config.url;\n customErr.exists = true;\n reject(customErr);\n }\n\n var options = {\n path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, ''),\n method: config.method.toUpperCase(),\n headers: headers,\n agent: agent,\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth: auth\n };\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n }\n\n var proxy = config.proxy;\n if (!proxy && proxy !== false) {\n var proxyEnv = protocol.slice(0, -1) + '_proxy';\n var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];\n if (proxyUrl) {\n var parsedProxyUrl = url.parse(proxyUrl);\n var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;\n var shouldProxy = true;\n\n if (noProxyEnv) {\n var noProxy = noProxyEnv.split(',').map(function trim(s) {\n return s.trim();\n });\n\n shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {\n if (!proxyElement) {\n return false;\n }\n if (proxyElement === '*') {\n return true;\n }\n if (proxyElement[0] === '.' &&\n parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {\n return true;\n }\n\n return parsed.hostname === proxyElement;\n });\n }\n\n if (shouldProxy) {\n proxy = {\n host: parsedProxyUrl.hostname,\n port: parsedProxyUrl.port,\n protocol: parsedProxyUrl.protocol\n };\n\n if (parsedProxyUrl.auth) {\n var proxyUrlAuth = parsedProxyUrl.auth.split(':');\n proxy.auth = {\n username: proxyUrlAuth[0],\n password: proxyUrlAuth[1]\n };\n }\n }\n }\n }\n\n if (proxy) {\n options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');\n setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);\n }\n\n var transport;\n var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsProxy ? https : http;\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n if (config.beforeRedirect) {\n options.beforeRedirect = config.beforeRedirect;\n }\n transport = isHttpsProxy ? httpsFollow : httpFollow;\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n }\n\n if (config.insecureHTTPParser) {\n options.insecureHTTPParser = config.insecureHTTPParser;\n }\n\n // Create the request\n var req = transport.request(options, function handleResponse(res) {\n if (req.aborted) return;\n\n // uncompress the response body transparently if required\n var stream = res;\n\n // return the last request in case of redirects\n var lastRequest = res.req || req;\n\n\n // if no content, is HEAD request or decompress disabled we should not decompress\n if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) {\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 stream = stream.pipe(zlib.createUnzip());\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n }\n }\n\n var response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: res.headers,\n config: config,\n request: lastRequest\n };\n\n if (config.responseType === 'stream') {\n response.data = stream;\n settle(resolve, reject, response);\n } else {\n var responseBuffer = [];\n var totalResponseBytes = 0;\n stream.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.destoy() emit aborted event before calling reject() on Node.js v16\n rejected = true;\n stream.destroy();\n reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE, config, lastRequest));\n }\n });\n\n stream.on('aborted', function handlerStreamAborted() {\n if (rejected) {\n return;\n }\n stream.destroy();\n reject(new AxiosError(\n 'maxContentLength size of ' + config.maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n lastRequest\n ));\n });\n\n stream.on('error', function handleStreamError(err) {\n if (req.aborted) return;\n reject(AxiosError.from(err, null, config, lastRequest));\n });\n\n stream.on('end', function handleStreamEnd() {\n try {\n var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);\n if (config.responseType !== 'arraybuffer') {\n responseData = responseData.toString(config.responseEncoding);\n if (!config.responseEncoding || config.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\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 var 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 devoring 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 req.abort();\n var transitional = config.transitional || transitionalDefaults;\n reject(new AxiosError(\n 'timeout of ' + timeout + 'ms exceeded',\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n req\n ));\n });\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (req.aborted) return;\n\n req.abort();\n reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);\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\n // Send the request\n if (utils.isStream(data)) {\n data.on('error', function handleStreamError(err) {\n reject(AxiosError.from(err, config, null, req));\n }).pipe(req);\n } else {\n req.end(data);\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar transitionalDefaults = require('../defaults/transitional');\nvar AxiosError = require('../core/AxiosError');\nvar CanceledError = require('../cancel/CanceledError');\nvar parseProtocol = require('../helpers/parseProtocol');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var 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) && utils.isStandardBrowserEnv()) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var 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 var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: 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, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var 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 (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\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', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new CanceledError() : 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 if (!requestData) {\n requestData = null;\n }\n\n var protocol = parseProtocol(fullPath);\n\n if (protocol && [ 'http', 'https', 'file' ].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);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\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\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = require('./cancel/CanceledError');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\naxios.toFormData = require('./helpers/toFormData');\n\n// Expose AxiosError class\naxios.AxiosError = require('../lib/core/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};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar CanceledError = require('./CanceledError');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(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) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function 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\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var 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 */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nvar AxiosError = require('../core/AxiosError');\nvar utils = require('../utils');\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction CanceledError(message) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nmodule.exports = CanceledError;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar buildFullPath = require('./buildFullPath');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(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 {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function 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 // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\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 // filter out skipped interceptors\n var requestInterceptorChain = [];\n var 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 var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n var fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\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: method,\n url: 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: method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url: url,\n data: data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('../utils');\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 * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\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\nvar prototype = AxiosError.prototype;\nvar 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// eslint-disable-next-line func-names\n].forEach(function(code) {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = function(error, code, config, request, response, customProps) {\n var axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nmodule.exports = AxiosError;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\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 */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: 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 */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\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 */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\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 * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar CanceledError = require('../cancel/CanceledError');\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\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 * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var 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 response.data,\n response.headers,\n config.transformResponse\n );\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 reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('../utils');\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 * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var 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 var 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 var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","'use strict';\n\nvar AxiosError = require('./AxiosError');\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 */\nmodule.exports = function settle(resolve, reject, response) {\n var 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","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","// eslint-disable-next-line strict\nmodule.exports = require('form-data');\n","'use strict';\n\nvar utils = require('../utils');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\nvar AxiosError = require('../core/AxiosError');\nvar transitionalDefaults = require('./transitional');\nvar toFormData = require('../helpers/toFormData');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('../adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('../adapters/http');\n }\n return adapter;\n}\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\nvar defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n 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 setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n\n var isObjectPayload = utils.isObject(data);\n var contentType = headers && headers['Content-Type'];\n\n var isFileList;\n\n if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {\n var _FormData = this.env && this.env.FormData;\n return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData());\n } else if (isObjectPayload || contentType === 'application/json') {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\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: require('./env/FormData')\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\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","module.exports = {\n \"version\": \"0.27.2\"\n};","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\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 * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\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 * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.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 var 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 var 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);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function 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","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.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 var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var 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 var 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 var 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);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\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} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nmodule.exports = function parseProtocol(url) {\n var match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n};\n","'use strict';\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 * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Convert a data object to FormData\n * @param {Object} obj\n * @param {?Object} [formData]\n * @returns {Object}\n **/\n\nfunction toFormData(obj, formData) {\n // eslint-disable-next-line no-param-reassign\n formData = formData || new FormData();\n\n var stack = [];\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n function build(data, parentKey) {\n if (utils.isPlainObject(data) || utils.isArray(data)) {\n if (stack.indexOf(data) !== -1) {\n throw Error('Circular reference detected in ' + parentKey);\n }\n\n stack.push(data);\n\n utils.forEach(data, function each(value, key) {\n if (utils.isUndefined(value)) return;\n var fullKey = parentKey ? parentKey + '.' + key : key;\n var arr;\n\n if (value && !parentKey && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {\n // eslint-disable-next-line func-names\n arr.forEach(function(el) {\n !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));\n });\n return;\n }\n }\n\n build(value, fullKey);\n });\n\n stack.pop();\n } else {\n formData.append(parentKey, convertValue(data));\n }\n }\n\n build(obj);\n\n return formData;\n}\n\nmodule.exports = toFormData;\n","'use strict';\n\nvar VERSION = require('../env/data').version;\nvar AxiosError = require('../core/AxiosError');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\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 * @returns {function}\n */\nvalidators.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 function(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 * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\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 var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var 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\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n// eslint-disable-next-line func-names\nvar kindOf = (function(cache) {\n // eslint-disable-next-line func-names\n return function(thing) {\n var str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n };\n})(Object.create(null));\n\nfunction kindOfTest(type) {\n type = type.toLowerCase();\n return function isKindOf(thing) {\n return kindOf(thing) === type;\n };\n}\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\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 && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nvar isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var 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 {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nvar isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nvar isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nvar isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nvar isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} thing The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(thing) {\n var 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 * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nvar 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 * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\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 */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\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 (var 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 for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\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 * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function 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 (var i = 0, l = arguments.length; i < l; i++) {\n 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 * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\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 * @return {string} content value without BOM\n */\nfunction 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\nfunction inherits(constructor, superConstructor, props, descriptors) {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\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} [filter]\n * @returns {Object}\n */\n\nfunction toFlatObject(sourceObj, destObj, filter) {\n var props;\n var i;\n var prop;\n var merged = {};\n\n destObj = destObj || {};\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if (!merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = Object.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 * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n * @returns {boolean}\n */\nfunction 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 var lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object\n * @param {*} [thing]\n * @returns {Array}\n */\nfunction toArray(thing) {\n if (!thing) return null;\n var i = thing.length;\n if (isUndefined(i)) return null;\n var arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n// eslint-disable-next-line func-names\nvar isTypedArray = (function(TypedArray) {\n // eslint-disable-next-line func-names\n return function(thing) {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM,\n inherits: inherits,\n toFlatObject: toFlatObject,\n kindOf: kindOf,\n kindOfTest: kindOfTest,\n endsWith: endsWith,\n toArray: toArray,\n isTypedArray: isTypedArray,\n isFileList: isFileList\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';\nmodule.exports = (flag, argv) => {\n\targv = argv || process.argv;\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst pos = argv.indexOf(prefix + flag);\n\tconst terminatorPos = argv.indexOf('--');\n\treturn pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);\n};\n","'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","var path = require('path');\nvar fs = require('fs');\nvar _0777 = parseInt('0777', 8);\n\nmodule.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;\n\nfunction mkdirP (p, opts, f, made) {\n if (typeof opts === 'function') {\n f = opts;\n opts = {};\n }\n else if (!opts || typeof opts !== 'object') {\n opts = { mode: opts };\n }\n \n var mode = opts.mode;\n var xfs = opts.fs || fs;\n \n if (mode === undefined) {\n mode = _0777\n }\n if (!made) made = null;\n \n var cb = f || /* istanbul ignore next */ function () {};\n p = path.resolve(p);\n \n xfs.mkdir(p, mode, function (er) {\n if (!er) {\n made = made || p;\n return cb(null, made);\n }\n switch (er.code) {\n case 'ENOENT':\n /* istanbul ignore if */\n if (path.dirname(p) === p) return cb(er);\n mkdirP(path.dirname(p), opts, function (er, made) {\n /* istanbul ignore if */\n if (er) cb(er, made);\n else mkdirP(p, opts, cb, made);\n });\n break;\n\n // In the case of any other error, just see if there's a dir\n // there already. If so, then hooray! If not, then something\n // is borked.\n default:\n xfs.stat(p, function (er2, stat) {\n // if the stat fails, then that's super weird.\n // let the original error be the failure reason.\n if (er2 || !stat.isDirectory()) cb(er, made)\n else cb(null, made);\n });\n break;\n }\n });\n}\n\nmkdirP.sync = function sync (p, opts, made) {\n if (!opts || typeof opts !== 'object') {\n opts = { mode: opts };\n }\n \n var mode = opts.mode;\n var xfs = opts.fs || fs;\n \n if (mode === undefined) {\n mode = _0777\n }\n if (!made) made = null;\n\n p = path.resolve(p);\n\n try {\n xfs.mkdirSync(p, mode);\n made = made || p;\n }\n catch (err0) {\n switch (err0.code) {\n case 'ENOENT' :\n made = sync(path.dirname(p), opts, made);\n sync(p, opts, made);\n break;\n\n // In the case of any other error, just see if there's a dir\n // there already. If so, then hooray! If not, then something\n // is borked.\n default:\n var stat;\n try {\n stat = xfs.statSync(p);\n }\n catch (err1) /* istanbul ignore next */ {\n throw err0;\n }\n /* istanbul ignore if */\n if (!stat.isDirectory()) throw err0;\n break;\n }\n }\n\n return made;\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","/*\n * portfinder.js: A simple tool to find an open port on the current machine.\n *\n * (C) 2011, Charlie Robbins\n *\n */\n\n\"use strict\";\n\nvar fs = require('fs'),\n os = require('os'),\n net = require('net'),\n path = require('path'),\n _async = require('async'),\n debug = require('debug'),\n mkdirp = require('mkdirp').mkdirp;\n\nvar debugTestPort = debug('portfinder:testPort'),\n debugGetPort = debug('portfinder:getPort'),\n debugDefaultHosts = debug('portfinder:defaultHosts');\n\nvar internals = {};\n\ninternals.testPort = function(options, callback) {\n if (!callback) {\n callback = options;\n options = {};\n }\n\n options.server = options.server || net.createServer(function () {\n //\n // Create an empty listener for the port testing server.\n //\n });\n\n debugTestPort(\"entered testPort(): trying\", options.host, \"port\", options.port);\n\n function onListen () {\n debugTestPort(\"done w/ testPort(): OK\", options.host, \"port\", options.port);\n\n options.server.removeListener('error', onError);\n options.server.close();\n callback(null, options.port);\n }\n\n function onError (err) {\n debugTestPort(\"done w/ testPort(): failed\", options.host, \"w/ port\", options.port, \"with error\", err.code);\n\n options.server.removeListener('listening', onListen);\n\n if (!(err.code == 'EADDRINUSE' || err.code == 'EACCES')) {\n return callback(err);\n }\n\n var nextPort = exports.nextPort(options.port);\n\n if (nextPort > exports.highestPort) {\n return callback(new Error('No open ports available'));\n }\n\n internals.testPort({\n port: nextPort,\n host: options.host,\n server: options.server\n }, callback);\n }\n\n options.server.once('error', onError);\n options.server.once('listening', onListen);\n\n if (options.host) {\n options.server.listen(options.port, options.host);\n } else {\n /*\n Judgement of service without host\n example:\n express().listen(options.port)\n */\n options.server.listen(options.port);\n }\n};\n\n//\n// ### @basePort {Number}\n// The lowest port to begin any port search from\n//\nexports.basePort = 8000;\n\n//\n// ### @highestPort {Number}\n// Largest port number is an unsigned short 2**16 -1=65335\n//\nexports.highestPort = 65535;\n\n//\n// ### @basePath {string}\n// Default path to begin any socket search from\n//\nexports.basePath = '/tmp/portfinder'\n\n//\n// ### function getPort (options, callback)\n// #### @options {Object} Settings to use when finding the necessary port\n// #### @callback {function} Continuation to respond to when complete.\n// Responds with a unbound port on the current machine.\n//\nexports.getPort = function (options, callback) {\n if (!callback) {\n callback = options;\n options = {};\n\n }\n\n options.port = Number(options.port) || Number(exports.basePort);\n options.host = options.host || null;\n options.stopPort = Number(options.stopPort) || Number(exports.highestPort);\n\n if(!options.startPort) {\n options.startPort = Number(options.port);\n if(options.startPort < 0) {\n throw Error('Provided options.startPort(' + options.startPort + ') is less than 0, which are cannot be bound.');\n }\n if(options.stopPort < options.startPort) {\n throw Error('Provided options.stopPort(' + options.stopPort + 'is less than options.startPort (' + options.startPort + ')');\n }\n }\n\n if (options.host) {\n\n var hasUserGivenHost;\n for (var i = 0; i < exports._defaultHosts.length; i++) {\n if (exports._defaultHosts[i] === options.host) {\n hasUserGivenHost = true;\n break;\n }\n }\n\n if (!hasUserGivenHost) {\n exports._defaultHosts.push(options.host);\n }\n\n }\n\n var openPorts = [], currentHost;\n return _async.eachSeries(exports._defaultHosts, function(host, next) {\n debugGetPort(\"in eachSeries() iteration callback: host is\", host);\n\n return internals.testPort({ host: host, port: options.port }, function(err, port) {\n if (err) {\n debugGetPort(\"in eachSeries() iteration callback testPort() callback\", \"with an err:\", err.code);\n currentHost = host;\n return next(err);\n } else {\n debugGetPort(\"in eachSeries() iteration callback testPort() callback\",\n \"with a success for port\", port);\n openPorts.push(port);\n return next();\n }\n });\n }, function(err) {\n\n if (err) {\n debugGetPort(\"in eachSeries() result callback: err is\", err);\n // If we get EADDRNOTAVAIL it means the host is not bindable, so remove it\n // from exports._defaultHosts and start over. For ubuntu, we use EINVAL for the same\n if (err.code === 'EADDRNOTAVAIL' || err.code === 'EINVAL') {\n if (options.host === currentHost) {\n // if bad address matches host given by user, tell them\n //\n // NOTE: We may need to one day handle `my-non-existent-host.local` if users\n // report frustration with passing in hostnames that DONT map to bindable\n // hosts, without showing them a good error.\n var msg = 'Provided host ' + options.host + ' could NOT be bound. Please provide a different host address or hostname';\n return callback(Error(msg));\n } else {\n var idx = exports._defaultHosts.indexOf(currentHost);\n exports._defaultHosts.splice(idx, 1);\n return exports.getPort(options, callback);\n }\n } else {\n // error is not accounted for, file ticket, handle special case\n return callback(err);\n }\n }\n\n // sort so we can compare first host to last host\n openPorts.sort(function(a, b) {\n return a - b;\n });\n\n debugGetPort(\"in eachSeries() result callback: openPorts is\", openPorts);\n\n if (openPorts[0] === openPorts[openPorts.length-1]) {\n // if first === last, we found an open port\n if(openPorts[0] <= options.stopPort) {\n return callback(null, openPorts[0]);\n }\n else {\n var msg = 'No open ports found in between '+ options.startPort + ' and ' + options.stopPort;\n return callback(Error(msg));\n }\n } else {\n // otherwise, try again, using sorted port, aka, highest open for >= 1 host\n return exports.getPort({ port: openPorts.pop(), host: options.host, startPort: options.startPort, stopPort: options.stopPort }, callback);\n }\n\n });\n};\n\n//\n// ### function getPortPromise (options)\n// #### @options {Object} Settings to use when finding the necessary port\n// Responds a promise to an unbound port on the current machine.\n//\nexports.getPortPromise = function (options) {\n if (typeof Promise !== 'function') {\n throw Error('Native promise support is not available in this version of node.' +\n 'Please install a polyfill and assign Promise to global.Promise before calling this method');\n }\n if (!options) {\n options = {};\n }\n return new Promise(function(resolve, reject) {\n exports.getPort(options, function(err, port) {\n if (err) {\n return reject(err);\n }\n resolve(port);\n });\n });\n}\n\n//\n// ### function getPorts (count, options, callback)\n// #### @count {Number} The number of ports to find\n// #### @options {Object} Settings to use when finding the necessary port\n// #### @callback {function} Continuation to respond to when complete.\n// Responds with an array of unbound ports on the current machine.\n//\nexports.getPorts = function (count, options, callback) {\n if (!callback) {\n callback = options;\n options = {};\n }\n\n var lastPort = null;\n _async.timesSeries(count, function(index, asyncCallback) {\n if (lastPort) {\n options.port = exports.nextPort(lastPort);\n }\n\n exports.getPort(options, function (err, port) {\n if (err) {\n asyncCallback(err);\n } else {\n lastPort = port;\n asyncCallback(null, port);\n }\n });\n }, callback);\n};\n\n//\n// ### function getSocket (options, callback)\n// #### @options {Object} Settings to use when finding the necessary port\n// #### @callback {function} Continuation to respond to when complete.\n// Responds with a unbound socket using the specified directory and base\n// name on the current machine.\n//\nexports.getSocket = function (options, callback) {\n if (!callback) {\n callback = options;\n options = {};\n }\n\n options.mod = options.mod || parseInt(755, 8);\n options.path = options.path || exports.basePath + '.sock';\n\n //\n // Tests the specified socket\n //\n function testSocket () {\n fs.stat(options.path, function (err) {\n //\n // If file we're checking doesn't exist (thus, stating it emits ENOENT),\n // we should be OK with listening on this socket.\n //\n if (err) {\n if (err.code == 'ENOENT') {\n callback(null, options.path);\n }\n else {\n callback(err);\n }\n }\n else {\n //\n // This file exists, so it isn't possible to listen on it. Lets try\n // next socket.\n //\n options.path = exports.nextSocket(options.path);\n exports.getSocket(options, callback);\n }\n });\n }\n\n //\n // Create the target `dir` then test connection\n // against the socket.\n //\n function createAndTestSocket (dir) {\n mkdirp(dir, options.mod, function (err) {\n if (err) {\n return callback(err);\n }\n\n options.exists = true;\n testSocket();\n });\n }\n\n //\n // Check if the parent directory of the target\n // socket path exists. If it does, test connection\n // against the socket. Otherwise, create the directory\n // then test connection.\n //\n function checkAndTestSocket () {\n var dir = path.dirname(options.path);\n\n fs.stat(dir, function (err, stats) {\n if (err || !stats.isDirectory()) {\n return createAndTestSocket(dir);\n }\n\n options.exists = true;\n testSocket();\n });\n }\n\n //\n // If it has been explicitly stated that the\n // target `options.path` already exists, then\n // simply test the socket.\n //\n return options.exists\n ? testSocket()\n : checkAndTestSocket();\n};\n\n//\n// ### function nextPort (port)\n// #### @port {Number} Port to increment from.\n// Gets the next port in sequence from the\n// specified `port`.\n//\nexports.nextPort = function (port) {\n return port + 1;\n};\n\n//\n// ### function nextSocket (socketPath)\n// #### @socketPath {string} Path to increment from\n// Gets the next socket path in sequence from the\n// specified `socketPath`.\n//\nexports.nextSocket = function (socketPath) {\n var dir = path.dirname(socketPath),\n name = path.basename(socketPath, '.sock'),\n match = name.match(/^([a-zA-z]+)(\\d*)$/i),\n index = parseInt(match[2]),\n base = match[1];\n if (isNaN(index)) {\n index = 0;\n }\n\n index += 1;\n return path.join(dir, base + index + '.sock');\n};\n\n/**\n * @desc List of internal hostnames provided by your machine. A user\n * provided hostname may also be provided when calling portfinder.getPort,\n * which would then be added to the default hosts we lookup and return here.\n *\n * @return {array}\n *\n * Long Form Explantion:\n *\n * - Input: (os.networkInterfaces() w/ MacOS 10.11.5+ and running a VM)\n *\n * { lo0:\n * [ { address: '::1',\n * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',\n * family: 'IPv6',\n * mac: '00:00:00:00:00:00',\n * scopeid: 0,\n * internal: true },\n * { address: '127.0.0.1',\n * netmask: '255.0.0.0',\n * family: 'IPv4',\n * mac: '00:00:00:00:00:00',\n * internal: true },\n * { address: 'fe80::1',\n * netmask: 'ffff:ffff:ffff:ffff::',\n * family: 'IPv6',\n * mac: '00:00:00:00:00:00',\n * scopeid: 1,\n * internal: true } ],\n * en0:\n * [ { address: 'fe80::a299:9bff:fe17:766d',\n * netmask: 'ffff:ffff:ffff:ffff::',\n * family: 'IPv6',\n * mac: 'a0:99:9b:17:76:6d',\n * scopeid: 4,\n * internal: false },\n * { address: '10.0.1.22',\n * netmask: '255.255.255.0',\n * family: 'IPv4',\n * mac: 'a0:99:9b:17:76:6d',\n * internal: false } ],\n * awdl0:\n * [ { address: 'fe80::48a8:37ff:fe34:aaef',\n * netmask: 'ffff:ffff:ffff:ffff::',\n * family: 'IPv6',\n * mac: '4a:a8:37:34:aa:ef',\n * scopeid: 8,\n * internal: false } ],\n * vnic0:\n * [ { address: '10.211.55.2',\n * netmask: '255.255.255.0',\n * family: 'IPv4',\n * mac: '00:1c:42:00:00:08',\n * internal: false } ],\n * vnic1:\n * [ { address: '10.37.129.2',\n * netmask: '255.255.255.0',\n * family: 'IPv4',\n * mac: '00:1c:42:00:00:09',\n * internal: false } ] }\n *\n * - Output:\n *\n * [\n * '0.0.0.0',\n * '::1',\n * '127.0.0.1',\n * 'fe80::1',\n * '10.0.1.22',\n * 'fe80::48a8:37ff:fe34:aaef',\n * '10.211.55.2',\n * '10.37.129.2'\n * ]\n *\n * Note we export this so we can use it in our tests, otherwise this API is private\n */\nexports._defaultHosts = (function() {\n var interfaces = {};\n try{\n interfaces = os.networkInterfaces();\n }\n catch(e) {\n // As of October 2016, Windows Subsystem for Linux (WSL) does not support\n // the os.networkInterfaces() call and throws instead. For this platform,\n // assume 0.0.0.0 as the only address\n //\n // - https://github.com/Microsoft/BashOnWindows/issues/468\n //\n // - Workaround is a mix of good work from the community:\n // - https://github.com/http-party/node-portfinder/commit/8d7e30a648ff5034186551fa8a6652669dec2f2f\n // - https://github.com/yarnpkg/yarn/pull/772/files\n if (e.syscall === 'uv_interface_addresses') {\n // swallow error because we're just going to use defaults\n // documented @ https://github.com/nodejs/node/blob/4b65a65e75f48ff447cabd5500ce115fb5ad4c57/doc/api/net.md#L231\n } else {\n throw e;\n }\n }\n\n var interfaceNames = Object.keys(interfaces),\n hiddenButImportantHost = '0.0.0.0', // !important - dont remove, hence the naming :)\n results = [hiddenButImportantHost];\n for (var i = 0; i < interfaceNames.length; i++) {\n var _interface = interfaces[interfaceNames[i]];\n for (var j = 0; j < _interface.length; j++) {\n var curr = _interface[j];\n results.push(curr.address);\n }\n }\n\n // add null value, For createServer function, do not use host.\n results.push(null);\n\n debugDefaultHosts(\"exports._defaultHosts is: %o\", results);\n\n return results;\n}());\n","\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n/**\n * Colors.\n */\n\nexports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];\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// eslint-disable-next-line complexity\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n return true;\n } // Internet Explorer and Edge do not support colors.\n\n\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n } // Is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\n\n return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773\n typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);\n}\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\n\nfunction formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function (match) {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\n\nfunction log() {\n var _console;\n\n // This hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return (typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);\n}\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\n\nfunction save(namespaces) {\n try {\n if (namespaces) {\n exports.storage.setItem('debug', namespaces);\n } else {\n exports.storage.removeItem('debug');\n }\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\n\nfunction load() {\n var r;\n\n try {\n r = exports.storage.getItem('debug');\n } catch (error) {} // Swallow\n // XXX (@Qix-) should we be logging these?\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\n\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\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\n\nfunction localstorage() {\n try {\n // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n // The Browser also has localStorage in the global context.\n return localStorage;\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n\nmodule.exports = require('./common')(exports);\nvar formatters = module.exports.formatters;\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n try {\n return JSON.stringify(v);\n } catch (error) {\n return '[UnexpectedJSONParseError]: ' + error.message;\n }\n};\n\n","\"use strict\";\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\nfunction setup(env) {\n createDebug.debug = createDebug;\n createDebug.default = createDebug;\n createDebug.coerce = coerce;\n createDebug.disable = disable;\n createDebug.enable = enable;\n createDebug.enabled = enabled;\n createDebug.humanize = require('ms');\n Object.keys(env).forEach(function (key) {\n createDebug[key] = env[key];\n });\n /**\n * Active `debug` instances.\n */\n\n createDebug.instances = [];\n /**\n * The currently active debug mode names, and names to skip.\n */\n\n createDebug.names = [];\n createDebug.skips = [];\n /**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\n createDebug.formatters = {};\n /**\n * Selects a color for a debug namespace\n * @param {String} namespace The namespace string for the for the debug instance to be colored\n * @return {Number|String} An ANSI color code for the given namespace\n * @api private\n */\n\n function selectColor(namespace) {\n var hash = 0;\n\n for (var i = 0; i < namespace.length; i++) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n }\n\n createDebug.selectColor = selectColor;\n /**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n function createDebug(namespace) {\n var prevTime;\n\n function debug() {\n // Disabled?\n if (!debug.enabled) {\n return;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var self = debug; // Set `diff` timestamp\n\n var curr = Number(new Date());\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n args[0] = createDebug.coerce(args[0]);\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O');\n } // Apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // If we encounter an escaped % then don't increase the array index\n if (match === '%%') {\n return match;\n }\n\n index++;\n var formatter = createDebug.formatters[format];\n\n if (typeof formatter === 'function') {\n var val = args[index];\n match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // Apply env-specific formatting (colors, etc.)\n\n createDebug.formatArgs.call(self, args);\n var logFn = self.log || createDebug.log;\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = createDebug.enabled(namespace);\n debug.useColors = createDebug.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n debug.extend = extend; // Debug.formatArgs = formatArgs;\n // debug.rawLog = rawLog;\n // env-specific initialization logic for debug instances\n\n if (typeof createDebug.init === 'function') {\n createDebug.init(debug);\n }\n\n createDebug.instances.push(debug);\n return debug;\n }\n\n function destroy() {\n var index = createDebug.instances.indexOf(this);\n\n if (index !== -1) {\n createDebug.instances.splice(index, 1);\n return true;\n }\n\n return false;\n }\n\n function extend(namespace, delimiter) {\n return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n }\n /**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\n function enable(namespaces) {\n createDebug.save(namespaces);\n createDebug.names = [];\n createDebug.skips = [];\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) {\n // ignore empty strings\n continue;\n }\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n createDebug.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < createDebug.instances.length; i++) {\n var instance = createDebug.instances[i];\n instance.enabled = createDebug.enabled(instance.namespace);\n }\n }\n /**\n * Disable debug output.\n *\n * @api public\n */\n\n\n function disable() {\n createDebug.enable('');\n }\n /**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\n function enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n\n var i;\n var len;\n\n for (i = 0, len = createDebug.skips.length; i < len; i++) {\n if (createDebug.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = createDebug.names.length; i < len; i++) {\n if (createDebug.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\n function coerce(val) {\n if (val instanceof Error) {\n return val.stack || val.message;\n }\n\n return val;\n }\n\n createDebug.enable(createDebug.load());\n return createDebug;\n}\n\nmodule.exports = setup;\n\n","\"use strict\";\n\n/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n\n","\"use strict\";\n\n/**\n * Module dependencies.\n */\nvar tty = require('tty');\n\nvar util = require('util');\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n // eslint-disable-next-line import/no-extraneous-dependencies\n var supportsColor = require('supports-color');\n\n if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n exports.colors = [20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221];\n }\n} catch (error) {} // Swallow - we only care if `supports-color` is available; it doesn't have to be.\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\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // Camel-case\n var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) {\n return k.toUpperCase();\n }); // Coerce string value into JS value\n\n var val = process.env[key];\n\n if (/^(yes|on|true|enabled)$/i.test(val)) {\n val = true;\n } else if (/^(no|off|false|disabled)$/i.test(val)) {\n val = false;\n } else if (val === 'null') {\n val = null;\n } else {\n val = Number(val);\n }\n\n obj[prop] = val;\n return obj;\n}, {});\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\n\nfunction formatArgs(args) {\n var name = this.namespace,\n useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var colorCode = \"\\x1B[3\" + (c < 8 ? c : '8;5;' + c);\n var prefix = \" \".concat(colorCode, \";1m\").concat(name, \" \\x1B[0m\");\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + \"\\x1B[0m\");\n } else {\n args[0] = getDate() + name + ' ' + args[0];\n }\n}\n\nfunction getDate() {\n if (exports.inspectOpts.hideDate) {\n return '';\n }\n\n return new Date().toISOString() + ' ';\n}\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\n\nfunction log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\n\nfunction save(namespaces) {\n if (namespaces) {\n process.env.DEBUG = namespaces;\n } else {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n }\n}\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\n\nfunction load() {\n return process.env.DEBUG;\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\n\nfunction init(debug) {\n debug.inspectOpts = {};\n var keys = Object.keys(exports.inspectOpts);\n\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\nmodule.exports = require('./common')(exports);\nvar formatters = module.exports.formatters;\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n')\n .map(function (str) { return str.trim(); })\n .join(' ');\n};\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\n\nformatters.O = function (v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n","'use strict';\nconst os = require('os');\nconst hasFlag = require('has-flag');\n\nconst env = process.env;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false')) {\n\tforceColor = false;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = true;\n}\nif ('FORCE_COLOR' in env) {\n\tforceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(stream) {\n\tif (forceColor === false) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (stream && !stream.isTTY && forceColor !== true) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor ? 1 : 0;\n\n\tif (process.platform === 'win32') {\n\t\t// Node.js 7.5.0 is the first version of Node.js to include a patch to\n\t\t// libuv that enables 256 color output on Windows. Anything earlier and it\n\t\t// won't work. However, here we target Node.js 8 at minimum as it is an LTS\n\t\t// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows\n\t\t// release that supports 256 colors. Windows 10 build 14931 is the first release\n\t\t// that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(process.versions.node.split('.')[0]) >= 8 &&\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: getSupportLevel(process.stdout),\n\tstderr: getSupportLevel(process.stderr)\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// 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","\"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 = '[Foresight Workflow Kit]';\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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst http_1 = require(\"http\");\nconst systeminformation_1 = __importDefault(require(\"systeminformation\"));\nconst logger = __importStar(require(\"./logger\"));\nconst utils_1 = require(\"./utils\");\nconst STATS_FREQ = parseInt(process.env.WORKFLOW_TELEMETRY_STAT_FREQ || '') || 5000;\nconst SERVER_HOST = 'localhost';\nconst SERVER_PORT = parseInt(process.env.WORKFLOW_TELEMETRY_SERVER_PORT || '');\nlet expectedScheduleTime = 0;\nlet statCollectTime = 0;\nconst metricStatsData = [];\nconst metricTelemetryData = {\n \"type\": \"Metric\",\n \"version\": utils_1.WORKFLOW_TELEMETRY_VERSIONS.METRIC,\n \"data\": metricStatsData\n};\n///////////////////////////\n// CPU Stats //\n///////////////////////////\nfunction collectCPUStats(statTime, timeInterval) {\n return systeminformation_1.default\n .currentLoad()\n .then((data) => {\n const points = [\n {\n unit: \"Percentage\",\n description: \"CPU Load Total\",\n name: \"cpu.load.total\",\n value: (data.currentLoad && data.currentLoad > 0 ? data.currentLoad : 0)\n },\n {\n unit: \"Percentage\",\n description: \"CPU Load User\",\n name: \"cpu.load.user\",\n value: (data.currentLoadUser && data.currentLoadUser > 0 ? data.currentLoadUser : 0)\n },\n {\n unit: \"Percentage\",\n description: \"CPU Load System\",\n name: \"cpu.load.system\",\n value: (data.currentLoadSystem && data.currentLoadSystem > 0 ? data.currentLoadSystem : 0)\n }\n ];\n const cpuStats = {\n domain: \"cpu\",\n group: \"cpu.load\",\n time: statTime,\n points: points\n };\n metricTelemetryData.data.push(cpuStats);\n })\n .catch((error) => {\n logger.error(error);\n });\n}\n///////////////////////////\n// Memory Stats //\n///////////////////////////\nfunction collectMemoryStats(statTime, timeInterval) {\n return systeminformation_1.default\n .mem()\n .then((data) => {\n const points = [\n {\n unit: \"Mb\",\n description: \"Memory Usage Total\",\n name: \"memory.usage.total\",\n value: (data.total && data.total > 0 ? data.total : 0) / 1024 / 1024\n },\n {\n unit: \"Mb\",\n description: \"Memory Usage Active\",\n name: \"memory.usage.active\",\n value: (data.active && data.active > 0 ? data.active : 0) / 1024 / 1024\n },\n {\n unit: \"Mb\",\n description: \"Memory Usage Available\",\n name: \"memory.usage.available\",\n value: (data.available && data.available > 0 ? data.available : 0) / 1024 / 1024\n }\n ];\n const memoryStats = {\n domain: \"memory\",\n group: \"memory.usage\",\n time: statTime,\n points: points\n };\n metricTelemetryData.data.push(memoryStats);\n })\n .catch((error) => {\n logger.error(error);\n });\n}\n///////////////////////////\n// Network Stats //\n///////////////////////////\nfunction collectNetworkStats(statTime, timeInterval) {\n return systeminformation_1.default\n .networkStats()\n .then((data) => {\n let totalRxSec = 0, totalTxSec = 0;\n for (let nsd of data) {\n totalRxSec += nsd.rx_sec && nsd.rx_sec > 0 ? nsd.rx_sec : 0;\n totalTxSec += nsd.tx_sec && nsd.tx_sec > 0 ? nsd.tx_sec : 0;\n }\n const points = [\n {\n unit: \"Mb\",\n description: \"Network IO Receive\",\n name: \"network.io.rxMb\",\n value: Math.floor((totalRxSec * (timeInterval / 1000)) / 1024 / 1024)\n },\n {\n unit: \"Mb\",\n description: \"Network IO Transmit\",\n name: \"network.io.txMb\",\n value: Math.floor((totalTxSec * (timeInterval / 1000)) / 1024 / 1024)\n }\n ];\n const networkStats = {\n domain: \"network\",\n group: \"network.io\",\n time: statTime,\n points: points\n };\n metricTelemetryData.data.push(networkStats);\n })\n .catch((error) => {\n logger.error(error);\n });\n}\n///////////////////////////\n// Disk Stats //\n///////////////////////////\nfunction collectDiskStats(statTime, timeInterval) {\n return systeminformation_1.default\n .fsStats()\n .then((data) => {\n let rxSec = data.rx_sec && data.rx_sec > 0 ? data.rx_sec : 0;\n let wxSec = data.wx_sec && data.wx_sec > 0 ? data.wx_sec : 0;\n const points = [\n {\n unit: \"Mb\",\n description: \"Disk IO Read\",\n name: \"disk.io.rxMb\",\n value: Math.floor((rxSec * (timeInterval / 1000)) / 1024 / 1024)\n },\n {\n unit: \"Mb\",\n description: \"Disk IO Write\",\n name: \"disk.io.wxMb\",\n value: Math.floor((wxSec * (timeInterval / 1000)) / 1024 / 1024)\n }\n ];\n const diskStats = {\n domain: \"disk\",\n group: \"disk.io\",\n time: statTime,\n points: points\n };\n metricTelemetryData.data.push(diskStats);\n })\n .catch((error) => {\n logger.error(error);\n });\n}\n///////////////////////////\nfunction collectStats(triggeredFromScheduler = true) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const currentTime = Date.now();\n const timeInterval = statCollectTime\n ? currentTime - statCollectTime\n : 0;\n statCollectTime = currentTime;\n const promises = [];\n promises.push(collectCPUStats(statCollectTime, timeInterval));\n promises.push(collectMemoryStats(statCollectTime, timeInterval));\n promises.push(collectNetworkStats(statCollectTime, timeInterval));\n promises.push(collectDiskStats(statCollectTime, timeInterval));\n return promises;\n }\n finally {\n if (triggeredFromScheduler) {\n expectedScheduleTime += STATS_FREQ;\n setTimeout(collectStats, expectedScheduleTime - Date.now());\n }\n }\n });\n}\nfunction startHttpServer() {\n const server = (0, http_1.createServer)((request, response) => __awaiter(this, void 0, void 0, function* () {\n try {\n switch (request.url) {\n case '/collect': {\n if (request.method === 'POST') {\n yield collectStats(false);\n response.end();\n }\n else {\n response.statusCode = 405;\n response.end();\n }\n break;\n }\n case '/metrics': {\n if (request.method === 'GET') {\n response.end(JSON.stringify(metricTelemetryData));\n }\n else {\n response.statusCode = 405;\n response.end();\n }\n break;\n }\n default: {\n response.statusCode = 404;\n response.end();\n }\n }\n }\n catch (error) {\n logger.error(error);\n response.statusCode = 500;\n response.end(JSON.stringify({\n type: error.type,\n message: error.message\n }));\n }\n }));\n server.listen(SERVER_PORT, SERVER_HOST, () => {\n logger.info(`Stat server listening on port ${SERVER_PORT}`);\n });\n}\n// Init //\n///////////////////////////\nfunction init() {\n expectedScheduleTime = Date.now();\n logger.info('Starting stat collector ...');\n process.nextTick(collectStats);\n logger.info('Starting HTTP server ...');\n startHttpServer();\n}\ninit();\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};\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.sendData = exports.createCITelemetryData = exports.saveJobInfos = exports.setServerPort = exports.JOB_STATES_NAME = exports.WORKFLOW_TELEMETRY_ENDPOINTS = exports.WORKFLOW_TELEMETRY_VERSIONS = exports.WORKFLOW_TELEMETRY_SERVER_PORT = void 0;\nconst logger = __importStar(require(\"./logger\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst github = __importStar(require(\"@actions/github\"));\nconst axios_1 = __importDefault(require(\"axios\"));\nconst path = __importStar(require(\"path\"));\nexports.WORKFLOW_TELEMETRY_SERVER_PORT = \"WORKFLOW_TELEMETRY_SERVER_PORT\";\nexports.WORKFLOW_TELEMETRY_VERSIONS = {\n METRIC: \"v1\",\n PROCESS: \"v1\"\n};\nconst WORKFLOW_TELEMETRY_BASE_URL = `${process.env[\"WORKFLOW_TELEMETRY_BASE_URL\"] || \"https://foresight.service.thundra.io\"}`;\nexports.WORKFLOW_TELEMETRY_ENDPOINTS = {\n METRIC: new URL(path.join(\"api\", exports.WORKFLOW_TELEMETRY_VERSIONS.METRIC, \"telemetry/metrics\"), WORKFLOW_TELEMETRY_BASE_URL).toString(),\n PROCESS: new URL(path.join(\"api\", exports.WORKFLOW_TELEMETRY_VERSIONS.PROCESS, \"telemetry/processes\"), WORKFLOW_TELEMETRY_BASE_URL).toString()\n};\nexports.JOB_STATES_NAME = {\n FORESIGHT_WORKFLOW_JOB_ID: \"FORESIGHT_WORKFLOW_JOB_ID\",\n FORESIGHT_WORKFLOW_JOB_NAME: \"FORESIGHT_WORKFLOW_JOB_NAME\",\n FORESIGHT_WORKFLOW_JOB_RUN_ATTEMPT: \"FORESIGHT_WORKFLOW_JOB_RUN_ATTEMPT\"\n};\nfunction setServerPort() {\n return __awaiter(this, void 0, void 0, function* () {\n var portfinder = require('portfinder');\n portfinder.basePort = 10000;\n const port = parseInt(process.env.WORKFLOW_TELEMETRY_SERVER_PORT || '');\n if (!port) {\n process.env[\"WORKFLOW_TELEMETRY_SERVER_PORT\"] = yield portfinder.getPortPromise();\n }\n core.saveState(exports.WORKFLOW_TELEMETRY_SERVER_PORT, process.env.WORKFLOW_TELEMETRY_SERVER_PORT);\n logger.info(`Workflow telemetry server port is: ${process.env.WORKFLOW_TELEMETRY_SERVER_PORT}`);\n });\n}\nexports.setServerPort = setServerPort;\nfunction saveJobInfos(jobInfo) {\n core.exportVariable(exports.JOB_STATES_NAME.FORESIGHT_WORKFLOW_JOB_ID, jobInfo.id);\n core.exportVariable(exports.JOB_STATES_NAME.FORESIGHT_WORKFLOW_JOB_NAME, jobInfo.name);\n}\nexports.saveJobInfos = saveJobInfos;\nfunction getJobInfo() {\n const jobInfo = {\n id: parseInt(process.env[exports.JOB_STATES_NAME.FORESIGHT_WORKFLOW_JOB_ID] || ''),\n name: process.env[exports.JOB_STATES_NAME.FORESIGHT_WORKFLOW_JOB_NAME],\n };\n return jobInfo;\n}\nfunction getMetaData() {\n const { repo, runId } = github.context;\n const jobInfo = getJobInfo();\n const metaData = {\n ciProvider: \"GITHUB\",\n runId: runId,\n repoName: repo.repo,\n repoOwner: repo.owner,\n runAttempt: process.env.GITHUB_RUN_ATTEMPT,\n runnerName: process.env.RUNNER_NAME,\n jobId: jobInfo.id,\n jobName: jobInfo.name,\n };\n return metaData;\n}\nfunction createCITelemetryData(telemetryData) {\n return {\n metaData: getMetaData(),\n telemetryData: telemetryData\n };\n}\nexports.createCITelemetryData = createCITelemetryData;\nfunction sendData(url, ciTelemetryData) {\n return __awaiter(this, void 0, void 0, function* () {\n logger.debug(`Sending data (api key=${core.getInput(\"api_key\")}) to url: ${url}`);\n try {\n const { data } = yield axios_1.default.post(url, ciTelemetryData, {\n headers: {\n 'Content-type': 'application/json; charset=utf-8',\n 'Authorization': `ApiKey ${core.getInput(\"api_key\")}`\n },\n });\n if (logger.isDebugEnabled()) {\n logger.debug(JSON.stringify(data, null, 4));\n }\n }\n catch (error) {\n if (axios_1.default.isAxiosError(error)) {\n logger.error(error.message);\n }\n else {\n logger.error(`unexpected error: ${error}`);\n }\n }\n });\n}\nexports.sendData = sendData;\n",null,"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(\"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\tid: moduleId,\n\t\tloaded: false,\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// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\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__(5914);\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;A;;;;;;AClUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;A;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;AC7+KA;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACzaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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/NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACjKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACvDA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACrGA;AACA;AACA;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;A;;;;;ACvBA;AACA;AACA;AACA;A;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACnJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;ACRA;AACA;AACA;AACA;A;;;;;;ACHA;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;A;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;A;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACfA;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;AACA;AACA;AACA;A;;;;;;ACrEA;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;A;;;;;;ACtDA;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;;;;;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;ACvdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;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;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;A;;;;;ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;AClfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;AC1PA;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;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;A;;;;;;ACpIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;ACnIA;AACA;AACA;A;;;;;AAFA;AACA;AACA;A;;;;;;;;A;;;;;;;;A;;;;;;;;A;;;;;;ACFA;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;AACA;AACA;AACA;;;;AC/BA;AACA;AACA;AACA;AACA;;;;ACJA;AACA;ACDA;AACA;AACA;AACA;;A","sourceRoot":""} \ No newline at end of file diff --git a/src/statCollectorWorker.ts b/src/statCollectorWorker.ts index f8ad27b..2abbdeb 100644 --- a/src/statCollectorWorker.ts +++ b/src/statCollectorWorker.ts @@ -41,19 +41,19 @@ function collectCPUStats( unit: "Percentage", description: "CPU Load Total", name: "cpu.load.total", - value: (data.currentLoad || 0) + value: (data.currentLoad && data.currentLoad > 0 ? data.currentLoad : 0) }, { unit: "Percentage", description: "CPU Load User", name: "cpu.load.user", - value:(data.currentLoadUser || 0) + value:(data.currentLoadUser && data.currentLoadUser > 0 ? data.currentLoadUser : 0) }, { unit: "Percentage", description: "CPU Load System", name: "cpu.load.system", - value: (data.currentLoadSystem || 0) + value: (data.currentLoadSystem && data.currentLoadSystem > 0 ? data.currentLoadSystem : 0) } ] const cpuStats: MetricStats = { @@ -86,19 +86,19 @@ function collectMemoryStats( unit: "Mb", description: "Memory Usage Total", name: "memory.usage.total", - value: (data.total || 0) / 1024 / 1024 + value: (data.total && data.total > 0 ? data.total : 0) / 1024 / 1024 }, { unit: "Mb", description: "Memory Usage Active", name: "memory.usage.active", - value: (data.active || 0) / 1024 / 1024 + value: (data.active && data.active > 0 ? data.active : 0) / 1024 / 1024 }, { unit: "Mb", description: "Memory Usage Available", name: "memory.usage.available", - value: (data.available || 0) / 1024 / 1024 + value: (data.available && data.available > 0 ? data.available : 0) / 1024 / 1024 } ] const memoryStats: MetricStats = { @@ -129,8 +129,8 @@ function collectNetworkStats( let totalRxSec = 0, totalTxSec = 0 for (let nsd of data) { - totalRxSec += nsd.rx_sec || 0 - totalTxSec += nsd.tx_sec || 0 + totalRxSec += nsd.rx_sec && nsd.rx_sec > 0 ? nsd.rx_sec : 0 + totalTxSec += nsd.tx_sec && nsd.tx_sec > 0 ? nsd.tx_sec : 0 } const points: Point[] = [ { @@ -171,8 +171,8 @@ function collectDiskStats( return si .fsStats() .then((data: si.Systeminformation.FsStatsData) => { - let rxSec = data.rx_sec ? data.rx_sec : 0 - let wxSec = data.wx_sec ? data.wx_sec : 0 + let rxSec = data.rx_sec && data.rx_sec > 0 ? data.rx_sec : 0 + let wxSec = data.wx_sec && data.wx_sec > 0 ? data.wx_sec : 0 const points: Point[] = [ {