diff --git a/forge/actions/publish/dist/index.js b/forge/actions/publish/dist/index.js index f31a3a9..d83365c 100644 --- a/forge/actions/publish/dist/index.js +++ b/forge/actions/publish/dist/index.js @@ -1,4256 +1,5202 @@ -require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ 241: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.issue = exports.issueCommand = void 0; -const os = __importStar(__nccwpck_require__(37)); -const utils_1 = __nccwpck_require__(278); -/** - * Commands - * - * Command Format: - * ::name key=value,key=value::message - * - * Examples: - * ::warning::This is the message - * ::set-env name=MY_VAR::some value - */ -function issueCommand(command, properties, message) { - const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os.EOL); -} -exports.issueCommand = issueCommand; -function issue(name, message = '') { - issueCommand(name, {}, message); -} -exports.issue = issue; -const CMD_STRING = '::'; -class Command { - constructor(command, properties, message) { - if (!command) { - command = 'missing.command'; - } - this.command = command; - this.properties = properties; - this.message = message; - } - toString() { - let cmdStr = CMD_STRING + this.command; - if (this.properties && Object.keys(this.properties).length > 0) { - cmdStr += ' '; +require("./sourcemap-register.js"); +/******/ (() => { + // webpackBootstrap + /******/ var __webpack_modules__ = { + /***/ 241: /***/ function ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) { + "use strict"; + + var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v, + }); + } + : function (o, v) { + o["default"] = v; + }); + var __importStar = + (this && this.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.issue = exports.issueCommand = void 0; + const os = __importStar(__nccwpck_require__(37)); + const utils_1 = __nccwpck_require__(278); + /** + * Commands + * + * Command Format: + * ::name key=value,key=value::message + * + * Examples: + * ::warning::This is the message + * ::set-env name=MY_VAR::some value + */ + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os.EOL); + } + exports.issueCommand = issueCommand; + function issue(name, message = "") { + issueCommand(name, {}, message); + } + exports.issue = issue; + const CMD_STRING = "::"; + class Command { + constructor(command, properties, message) { + if (!command) { + command = "missing.command"; + } + this.command = command; + this.properties = properties; + this.message = message; + } + toString() { + let cmdStr = CMD_STRING + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + cmdStr += " "; let first = true; for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { - const val = this.properties[key]; - if (val) { - if (first) { - first = false; - } - else { - cmdStr += ','; - } - cmdStr += `${key}=${escapeProperty(val)}`; - } + if (this.properties.hasOwnProperty(key)) { + const val = this.properties[key]; + if (val) { + if (first) { + first = false; + } else { + cmdStr += ","; + } + cmdStr += `${key}=${escapeProperty(val)}`; } + } } + } + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; } - cmdStr += `${CMD_STRING}${escapeData(this.message)}`; - return cmdStr; - } -} -function escapeData(s) { - return utils_1.toCommandValue(s) - .replace(/%/g, '%25') - .replace(/\r/g, '%0D') - .replace(/\n/g, '%0A'); -} -function escapeProperty(s) { - return utils_1.toCommandValue(s) - .replace(/%/g, '%25') - .replace(/\r/g, '%0D') - .replace(/\n/g, '%0A') - .replace(/:/g, '%3A') - .replace(/,/g, '%2C'); -} -//# sourceMappingURL=command.js.map - -/***/ }), - -/***/ 186: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.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; -const command_1 = __nccwpck_require__(241); -const file_command_1 = __nccwpck_require__(717); -const utils_1 = __nccwpck_require__(278); -const os = __importStar(__nccwpck_require__(37)); -const path = __importStar(__nccwpck_require__(17)); -const oidc_utils_1 = __nccwpck_require__(41); -/** - * The code to exit an action - */ -var ExitCode; -(function (ExitCode) { - /** - * A code indicating that the action was successful - */ - ExitCode[ExitCode["Success"] = 0] = "Success"; - /** - * A code indicating that the action was a failure - */ - ExitCode[ExitCode["Failure"] = 1] = "Failure"; -})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); -//----------------------------------------------------------------------- -// Variables -//----------------------------------------------------------------------- -/** - * Sets env variable for this action and future actions in the job - * @param name the name of the variable to set - * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function exportVariable(name, val) { - const convertedVal = utils_1.toCommandValue(val); - process.env[name] = convertedVal; - const filePath = process.env['GITHUB_ENV'] || ''; - if (filePath) { - return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val)); - } - command_1.issueCommand('set-env', { name }, convertedVal); -} -exports.exportVariable = exportVariable; -/** - * Registers a secret which will get masked from logs - * @param secret value of the secret - */ -function setSecret(secret) { - command_1.issueCommand('add-mask', {}, secret); -} -exports.setSecret = setSecret; -/** - * Prepends inputPath to the PATH (for this action and future actions) - * @param inputPath - */ -function addPath(inputPath) { - const filePath = process.env['GITHUB_PATH'] || ''; - if (filePath) { - file_command_1.issueFileCommand('PATH', inputPath); - } - else { - command_1.issueCommand('add-path', {}, inputPath); - } - process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; -} -exports.addPath = addPath; -/** - * Gets the value of an input. - * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. - * Returns an empty string if the value is not defined. - * - * @param name name of the input to get - * @param options optional. See InputOptions. - * @returns string - */ -function getInput(name, options) { - const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; - if (options && options.required && !val) { - throw new Error(`Input required and not supplied: ${name}`); - } - if (options && options.trimWhitespace === false) { - return val; - } - return val.trim(); -} -exports.getInput = getInput; -/** - * Gets the values of an multiline input. Each value is also trimmed. - * - * @param name name of the input to get - * @param options optional. See InputOptions. - * @returns string[] - * - */ -function getMultilineInput(name, options) { - const inputs = getInput(name, options) - .split('\n') - .filter(x => x !== ''); - if (options && options.trimWhitespace === false) { - return inputs; - } - return inputs.map(input => input.trim()); -} -exports.getMultilineInput = getMultilineInput; -/** - * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. - * Support boolean input list: `true | True | TRUE | false | False | FALSE` . - * The return value is also in boolean type. - * ref: https://yaml.org/spec/1.2/spec.html#id2804923 - * - * @param name name of the input to get - * @param options optional. See InputOptions. - * @returns boolean - */ -function getBooleanInput(name, options) { - const trueValue = ['true', 'True', 'TRUE']; - const falseValue = ['false', 'False', 'FALSE']; - const val = getInput(name, options); - if (trueValue.includes(val)) - return true; - if (falseValue.includes(val)) - return false; - throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` + - `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); -} -exports.getBooleanInput = getBooleanInput; -/** - * Sets the value of an output. - * - * @param name name of the output to set - * @param value value to store. Non-string values will be converted to a string via JSON.stringify - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function setOutput(name, value) { - const filePath = process.env['GITHUB_OUTPUT'] || ''; - if (filePath) { - return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value)); - } - process.stdout.write(os.EOL); - command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value)); -} -exports.setOutput = setOutput; -/** - * Enables or disables the echoing of commands into stdout for the rest of the step. - * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. - * - */ -function setCommandEcho(enabled) { - command_1.issue('echo', enabled ? 'on' : 'off'); -} -exports.setCommandEcho = setCommandEcho; -//----------------------------------------------------------------------- -// Results -//----------------------------------------------------------------------- -/** - * Sets the action status to failed. - * When the action exits it will be with an exit code of 1 - * @param message add error issue message - */ -function setFailed(message) { - process.exitCode = ExitCode.Failure; - error(message); -} -exports.setFailed = setFailed; -//----------------------------------------------------------------------- -// Logging Commands -//----------------------------------------------------------------------- -/** - * Gets whether Actions Step Debug is on or not - */ -function isDebug() { - return process.env['RUNNER_DEBUG'] === '1'; -} -exports.isDebug = isDebug; -/** - * Writes debug message to user log - * @param message debug message - */ -function debug(message) { - command_1.issueCommand('debug', {}, message); -} -exports.debug = debug; -/** - * Adds an error issue - * @param message error issue message. Errors will be converted to string via toString() - * @param properties optional properties to add to the annotation. - */ -function error(message, properties = {}) { - command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); -} -exports.error = error; -/** - * Adds a warning issue - * @param message warning issue message. Errors will be converted to string via toString() - * @param properties optional properties to add to the annotation. - */ -function warning(message, properties = {}) { - command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); -} -exports.warning = warning; -/** - * Adds a notice issue - * @param message notice issue message. Errors will be converted to string via toString() - * @param properties optional properties to add to the annotation. - */ -function notice(message, properties = {}) { - command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); -} -exports.notice = notice; -/** - * Writes info to log with console.log. - * @param message info message - */ -function info(message) { - process.stdout.write(message + os.EOL); -} -exports.info = info; -/** - * Begin an output group. - * - * Output until the next `groupEnd` will be foldable in this group - * - * @param name The name of the output group - */ -function startGroup(name) { - command_1.issue('group', name); -} -exports.startGroup = startGroup; -/** - * End an output group. - */ -function endGroup() { - command_1.issue('endgroup'); -} -exports.endGroup = endGroup; -/** - * Wrap an asynchronous function call in a group. - * - * Returns the same type as the function itself. - * - * @param name The name of the group - * @param fn The function to wrap in the group - */ -function group(name, fn) { - return __awaiter(this, void 0, void 0, function* () { - startGroup(name); - let result; - try { - result = yield fn(); + } + function escapeData(s) { + return utils_1 + .toCommandValue(s) + .replace(/%/g, "%25") + .replace(/\r/g, "%0D") + .replace(/\n/g, "%0A"); + } + function escapeProperty(s) { + return utils_1 + .toCommandValue(s) + .replace(/%/g, "%25") + .replace(/\r/g, "%0D") + .replace(/\n/g, "%0A") + .replace(/:/g, "%3A") + .replace(/,/g, "%2C"); + } + //# sourceMappingURL=command.js.map + + /***/ + }, + + /***/ 186: /***/ function ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) { + "use strict"; + + var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v, + }); + } + : function (o, v) { + o["default"] = v; + }); + var __importStar = + (this && this.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step( + (generator = generator.apply(thisArg, _arguments || [])).next(), + ); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.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; + const command_1 = __nccwpck_require__(241); + const file_command_1 = __nccwpck_require__(717); + const utils_1 = __nccwpck_require__(278); + const os = __importStar(__nccwpck_require__(37)); + const path = __importStar(__nccwpck_require__(17)); + const oidc_utils_1 = __nccwpck_require__(41); + /** + * The code to exit an action + */ + var ExitCode; + (function (ExitCode) { + /** + * A code indicating that the action was successful + */ + ExitCode[(ExitCode["Success"] = 0)] = "Success"; + /** + * A code indicating that the action was a failure + */ + ExitCode[(ExitCode["Failure"] = 1)] = "Failure"; + })((ExitCode = exports.ExitCode || (exports.ExitCode = {}))); + //----------------------------------------------------------------------- + // Variables + //----------------------------------------------------------------------- + /** + * Sets env variable for this action and future actions in the job + * @param name the name of the variable to set + * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function exportVariable(name, val) { + const convertedVal = utils_1.toCommandValue(val); + process.env[name] = convertedVal; + const filePath = process.env["GITHUB_ENV"] || ""; + if (filePath) { + return file_command_1.issueFileCommand( + "ENV", + file_command_1.prepareKeyValueMessage(name, val), + ); + } + command_1.issueCommand("set-env", { name }, convertedVal); + } + exports.exportVariable = exportVariable; + /** + * Registers a secret which will get masked from logs + * @param secret value of the secret + */ + function setSecret(secret) { + command_1.issueCommand("add-mask", {}, secret); + } + exports.setSecret = setSecret; + /** + * Prepends inputPath to the PATH (for this action and future actions) + * @param inputPath + */ + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + file_command_1.issueFileCommand("PATH", inputPath); + } else { + command_1.issueCommand("add-path", {}, inputPath); + } + process.env["PATH"] = + `${inputPath}${path.delimiter}${process.env["PATH"]}`; + } + exports.addPath = addPath; + /** + * Gets the value of an input. + * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. + * Returns an empty string if the value is not defined. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string + */ + function getInput(name, options) { + const val = + process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; + if (options && options.required && !val) { + throw new Error(`Input required and not supplied: ${name}`); + } + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); + } + exports.getInput = getInput; + /** + * Gets the values of an multiline input. Each value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string[] + * + */ + function getMultilineInput(name, options) { + const inputs = getInput(name, options) + .split("\n") + .filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; + } + return inputs.map((input) => input.trim()); + } + exports.getMultilineInput = getMultilineInput; + /** + * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. + * Support boolean input list: `true | True | TRUE | false | False | FALSE` . + * The return value is also in boolean type. + * ref: https://yaml.org/spec/1.2/spec.html#id2804923 + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns boolean + */ + function getBooleanInput(name, options) { + const trueValue = ["true", "True", "TRUE"]; + const falseValue = ["false", "False", "FALSE"]; + const val = getInput(name, options); + if (trueValue.includes(val)) return true; + if (falseValue.includes(val)) return false; + throw new TypeError( + `Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` + + `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``, + ); + } + exports.getBooleanInput = getBooleanInput; + /** + * Sets the value of an output. + * + * @param name name of the output to set + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return file_command_1.issueFileCommand( + "OUTPUT", + file_command_1.prepareKeyValueMessage(name, value), + ); } - finally { + process.stdout.write(os.EOL); + command_1.issueCommand( + "set-output", + { name }, + utils_1.toCommandValue(value), + ); + } + exports.setOutput = setOutput; + /** + * Enables or disables the echoing of commands into stdout for the rest of the step. + * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. + * + */ + function setCommandEcho(enabled) { + command_1.issue("echo", enabled ? "on" : "off"); + } + exports.setCommandEcho = setCommandEcho; + //----------------------------------------------------------------------- + // Results + //----------------------------------------------------------------------- + /** + * Sets the action status to failed. + * When the action exits it will be with an exit code of 1 + * @param message add error issue message + */ + function setFailed(message) { + process.exitCode = ExitCode.Failure; + error(message); + } + exports.setFailed = setFailed; + //----------------------------------------------------------------------- + // Logging Commands + //----------------------------------------------------------------------- + /** + * Gets whether Actions Step Debug is on or not + */ + function isDebug() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports.isDebug = isDebug; + /** + * Writes debug message to user log + * @param message debug message + */ + function debug(message) { + command_1.issueCommand("debug", {}, message); + } + exports.debug = debug; + /** + * Adds an error issue + * @param message error issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ + function error(message, properties = {}) { + command_1.issueCommand( + "error", + utils_1.toCommandProperties(properties), + message instanceof Error ? message.toString() : message, + ); + } + exports.error = error; + /** + * Adds a warning issue + * @param message warning issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ + function warning(message, properties = {}) { + command_1.issueCommand( + "warning", + utils_1.toCommandProperties(properties), + message instanceof Error ? message.toString() : message, + ); + } + exports.warning = warning; + /** + * Adds a notice issue + * @param message notice issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ + function notice(message, properties = {}) { + command_1.issueCommand( + "notice", + utils_1.toCommandProperties(properties), + message instanceof Error ? message.toString() : message, + ); + } + exports.notice = notice; + /** + * Writes info to log with console.log. + * @param message info message + */ + function info(message) { + process.stdout.write(message + os.EOL); + } + exports.info = info; + /** + * Begin an output group. + * + * Output until the next `groupEnd` will be foldable in this group + * + * @param name The name of the output group + */ + function startGroup(name) { + command_1.issue("group", name); + } + exports.startGroup = startGroup; + /** + * End an output group. + */ + function endGroup() { + command_1.issue("endgroup"); + } + exports.endGroup = endGroup; + /** + * Wrap an asynchronous function call in a group. + * + * Returns the same type as the function itself. + * + * @param name The name of the group + * @param fn The function to wrap in the group + */ + function group(name, fn) { + return __awaiter(this, void 0, void 0, function* () { + startGroup(name); + let result; + try { + result = yield fn(); + } finally { endGroup(); + } + return result; + }); + } + exports.group = group; + //----------------------------------------------------------------------- + // Wrapper action state + //----------------------------------------------------------------------- + /** + * Saves state for current action, the state can only be retrieved by this action's post job execution. + * + * @param name name of the state to store + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function saveState(name, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return file_command_1.issueFileCommand( + "STATE", + file_command_1.prepareKeyValueMessage(name, value), + ); } - return result; - }); -} -exports.group = group; -//----------------------------------------------------------------------- -// Wrapper action state -//----------------------------------------------------------------------- -/** - * Saves state for current action, the state can only be retrieved by this action's post job execution. - * - * @param name name of the state to store - * @param value value to store. Non-string values will be converted to a string via JSON.stringify - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function saveState(name, value) { - const filePath = process.env['GITHUB_STATE'] || ''; - if (filePath) { - return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value)); - } - command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value)); -} -exports.saveState = saveState; -/** - * Gets the value of an state set by this action's main execution. - * - * @param name name of the state to get - * @returns string - */ -function getState(name) { - return process.env[`STATE_${name}`] || ''; -} -exports.getState = getState; -function getIDToken(aud) { - return __awaiter(this, void 0, void 0, function* () { - return yield oidc_utils_1.OidcClient.getIDToken(aud); - }); -} -exports.getIDToken = getIDToken; -/** - * Summary exports - */ -var summary_1 = __nccwpck_require__(327); -Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); -/** - * @deprecated use core.summary - */ -var summary_2 = __nccwpck_require__(327); -Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); -/** - * Path exports - */ -var path_utils_1 = __nccwpck_require__(981); -Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); -Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); -Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); -//# sourceMappingURL=core.js.map - -/***/ }), - -/***/ 717: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -// For internal use, subject to change. -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; -// We use any as a valid input type -/* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__nccwpck_require__(147)); -const os = __importStar(__nccwpck_require__(37)); -const uuid_1 = __nccwpck_require__(840); -const utils_1 = __nccwpck_require__(278); -function issueFileCommand(command, message) { - const filePath = process.env[`GITHUB_${command}`]; - if (!filePath) { - throw new Error(`Unable to find environment variable for file command ${command}`); - } - if (!fs.existsSync(filePath)) { - throw new Error(`Missing file at path: ${filePath}`); - } - fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { - encoding: 'utf8' - }); -} -exports.issueFileCommand = issueFileCommand; -function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${uuid_1.v4()}`; - const convertedValue = utils_1.toCommandValue(value); - // These should realistically never happen, but just in case someone finds a - // way to exploit uuid generation let's not allow keys or values that contain - // the delimiter. - if (key.includes(delimiter)) { - throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); - } - if (convertedValue.includes(delimiter)) { - throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); - } - return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; -} -exports.prepareKeyValueMessage = prepareKeyValueMessage; -//# sourceMappingURL=file-command.js.map - -/***/ }), - -/***/ 41: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + command_1.issueCommand( + "save-state", + { name }, + utils_1.toCommandValue(value), + ); + } + exports.saveState = saveState; + /** + * Gets the value of an state set by this action's main execution. + * + * @param name name of the state to get + * @returns string + */ + function getState(name) { + return process.env[`STATE_${name}`] || ""; + } + exports.getState = getState; + function getIDToken(aud) { + return __awaiter(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); + } + exports.getIDToken = getIDToken; + /** + * Summary exports + */ + var summary_1 = __nccwpck_require__(327); + Object.defineProperty(exports, "summary", { + enumerable: true, + get: function () { + return summary_1.summary; + }, + }); + /** + * @deprecated use core.summary + */ + var summary_2 = __nccwpck_require__(327); + Object.defineProperty(exports, "markdownSummary", { + enumerable: true, + get: function () { + return summary_2.markdownSummary; + }, + }); + /** + * Path exports + */ + var path_utils_1 = __nccwpck_require__(981); + Object.defineProperty(exports, "toPosixPath", { + enumerable: true, + get: function () { + return path_utils_1.toPosixPath; + }, + }); + Object.defineProperty(exports, "toWin32Path", { + enumerable: true, + get: function () { + return path_utils_1.toWin32Path; + }, + }); + Object.defineProperty(exports, "toPlatformPath", { + enumerable: true, + get: function () { + return path_utils_1.toPlatformPath; + }, + }); + //# sourceMappingURL=core.js.map + + /***/ + }, + + /***/ 717: /***/ function ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) { + "use strict"; + + // For internal use, subject to change. + var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v, + }); + } + : function (o, v) { + o["default"] = v; + }); + var __importStar = + (this && this.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; + // We use any as a valid input type + /* eslint-disable @typescript-eslint/no-explicit-any */ + const fs = __importStar(__nccwpck_require__(147)); + const os = __importStar(__nccwpck_require__(37)); + const uuid_1 = __nccwpck_require__(840); + const utils_1 = __nccwpck_require__(278); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error( + `Unable to find environment variable for file command ${command}`, + ); + } + if (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs.appendFileSync( + filePath, + `${utils_1.toCommandValue(message)}${os.EOL}`, + { + encoding: "utf8", + }, + ); + } + exports.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${uuid_1.v4()}`; + const convertedValue = utils_1.toCommandValue(value); + // These should realistically never happen, but just in case someone finds a + // way to exploit uuid generation let's not allow keys or values that contain + // the delimiter. + if (key.includes(delimiter)) { + throw new Error( + `Unexpected input: name should not contain the delimiter "${delimiter}"`, + ); + } + if (convertedValue.includes(delimiter)) { + throw new Error( + `Unexpected input: value should not contain the delimiter "${delimiter}"`, + ); + } + return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; + } + exports.prepareKeyValueMessage = prepareKeyValueMessage; + //# sourceMappingURL=file-command.js.map -"use strict"; + /***/ + }, -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OidcClient = void 0; -const http_client_1 = __nccwpck_require__(255); -const auth_1 = __nccwpck_require__(526); -const core_1 = __nccwpck_require__(186); -class OidcClient { - static createHttpClient(allowRetry = true, maxRetry = 10) { - const requestOptions = { - allowRetries: allowRetry, - maxRetries: maxRetry + /***/ 41: /***/ function ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) { + "use strict"; + + var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step( + (generator = generator.apply(thisArg, _arguments || [])).next(), + ); + }); }; - return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions); - } - static getRequestToken() { - const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN']; - if (!token) { - throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable'); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OidcClient = void 0; + const http_client_1 = __nccwpck_require__(255); + const auth_1 = __nccwpck_require__(526); + const core_1 = __nccwpck_require__(186); + class OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry, + }; + return new http_client_1.HttpClient( + "actions/oidc-client", + [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], + requestOptions, + ); } - return token; - } - static getIDTokenUrl() { - const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL']; - if (!runtimeUrl) { - throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable'); + static getRequestToken() { + const token = process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"]; + if (!token) { + throw new Error( + "Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable", + ); + } + return token; } - return runtimeUrl; - } - static getCall(id_token_url) { - var _a; - return __awaiter(this, void 0, void 0, function* () { + static getIDTokenUrl() { + const runtimeUrl = process.env["ACTIONS_ID_TOKEN_REQUEST_URL"]; + if (!runtimeUrl) { + throw new Error( + "Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable", + ); + } + return runtimeUrl; + } + static getCall(id_token_url) { + var _a; + return __awaiter(this, void 0, void 0, function* () { const httpclient = OidcClient.createHttpClient(); const res = yield httpclient - .getJson(id_token_url) - .catch(error => { + .getJson(id_token_url) + .catch((error) => { throw new Error(`Failed to get ID Token. \n Error Code : ${error.statusCode}\n Error Message: ${error.message}`); - }); - const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + }); + const id_token = + (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { - throw new Error('Response json body do not have ID Token field'); + throw new Error("Response json body do not have ID Token field"); } return id_token; - }); - } - static getIDToken(audience) { - return __awaiter(this, void 0, void 0, function* () { + }); + } + static getIDToken(audience) { + return __awaiter(this, void 0, void 0, function* () { try { - // New ID Token is requested from action service - let id_token_url = OidcClient.getIDTokenUrl(); - if (audience) { - const encodedAudience = encodeURIComponent(audience); - id_token_url = `${id_token_url}&audience=${encodedAudience}`; - } - core_1.debug(`ID token url is ${id_token_url}`); - const id_token = yield OidcClient.getCall(id_token_url); - core_1.setSecret(id_token); - return id_token; + // New ID Token is requested from action service + let id_token_url = OidcClient.getIDTokenUrl(); + if (audience) { + const encodedAudience = encodeURIComponent(audience); + id_token_url = `${id_token_url}&audience=${encodedAudience}`; + } + core_1.debug(`ID token url is ${id_token_url}`); + const id_token = yield OidcClient.getCall(id_token_url); + core_1.setSecret(id_token); + return id_token; + } catch (error) { + throw new Error(`Error message: ${error.message}`); } - catch (error) { - throw new Error(`Error message: ${error.message}`); + }); + } + } + exports.OidcClient = OidcClient; + //# sourceMappingURL=oidc-utils.js.map + + /***/ + }, + + /***/ 981: /***/ function ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) { + "use strict"; + + var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); } - }); - } -} -exports.OidcClient = OidcClient; -//# sourceMappingURL=oidc-utils.js.map - -/***/ }), - -/***/ 981: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; -const path = __importStar(__nccwpck_require__(17)); -/** - * toPosixPath converts the given path to the posix form. On Windows, \\ will be - * replaced with /. - * - * @param pth. Path to transform. - * @return string Posix path. - */ -function toPosixPath(pth) { - return pth.replace(/[\\]/g, '/'); -} -exports.toPosixPath = toPosixPath; -/** - * toWin32Path converts the given path to the win32 form. On Linux, / will be - * replaced with \\. - * - * @param pth. Path to transform. - * @return string Win32 path. - */ -function toWin32Path(pth) { - return pth.replace(/[/]/g, '\\'); -} -exports.toWin32Path = toWin32Path; -/** - * toPlatformPath converts the given path to a platform-specific path. It does - * this by replacing instances of / and \ with the platform-specific path - * separator. - * - * @param pth The path to platformize. - * @return string The platform-specific path. - */ -function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path.sep); -} -exports.toPlatformPath = toPlatformPath; -//# sourceMappingURL=path-utils.js.map - -/***/ }), - -/***/ 327: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; -const os_1 = __nccwpck_require__(37); -const fs_1 = __nccwpck_require__(147); -const { access, appendFile, writeFile } = fs_1.promises; -exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; -exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; -class Summary { - constructor() { - this._buffer = ''; - } - /** - * Finds the summary file path from the environment, rejects if env var is not found or file does not exist - * Also checks r/w permissions. - * - * @returns step summary file path - */ - filePath() { - return __awaiter(this, void 0, void 0, function* () { + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v, + }); + } + : function (o, v) { + o["default"] = v; + }); + var __importStar = + (this && this.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.toPlatformPath = + exports.toWin32Path = + exports.toPosixPath = + void 0; + const path = __importStar(__nccwpck_require__(17)); + /** + * toPosixPath converts the given path to the posix form. On Windows, \\ will be + * replaced with /. + * + * @param pth. Path to transform. + * @return string Posix path. + */ + function toPosixPath(pth) { + return pth.replace(/[\\]/g, "/"); + } + exports.toPosixPath = toPosixPath; + /** + * toWin32Path converts the given path to the win32 form. On Linux, / will be + * replaced with \\. + * + * @param pth. Path to transform. + * @return string Win32 path. + */ + function toWin32Path(pth) { + return pth.replace(/[/]/g, "\\"); + } + exports.toWin32Path = toWin32Path; + /** + * toPlatformPath converts the given path to a platform-specific path. It does + * this by replacing instances of / and \ with the platform-specific path + * separator. + * + * @param pth The path to platformize. + * @return string The platform-specific path. + */ + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path.sep); + } + exports.toPlatformPath = toPlatformPath; + //# sourceMappingURL=path-utils.js.map + + /***/ + }, + + /***/ 327: /***/ function ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) { + "use strict"; + + var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step( + (generator = generator.apply(thisArg, _arguments || [])).next(), + ); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.summary = + exports.markdownSummary = + exports.SUMMARY_DOCS_URL = + exports.SUMMARY_ENV_VAR = + void 0; + const os_1 = __nccwpck_require__(37); + const fs_1 = __nccwpck_require__(147); + const { access, appendFile, writeFile } = fs_1.promises; + exports.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; + exports.SUMMARY_DOCS_URL = + "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary"; + class Summary { + constructor() { + this._buffer = ""; + } + /** + * Finds the summary file path from the environment, rejects if env var is not found or file does not exist + * Also checks r/w permissions. + * + * @returns step summary file path + */ + filePath() { + return __awaiter(this, void 0, void 0, function* () { if (this._filePath) { - return this._filePath; + return this._filePath; } const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR]; if (!pathFromEnv) { - throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); + throw new Error( + `Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`, + ); } try { - yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); - } - catch (_a) { - throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + yield access( + pathFromEnv, + fs_1.constants.R_OK | fs_1.constants.W_OK, + ); + } catch (_a) { + throw new Error( + `Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`, + ); } this._filePath = pathFromEnv; return this._filePath; - }); - } - /** - * Wraps content in an HTML tag, adding any HTML attributes - * - * @param {string} tag HTML tag to wrap - * @param {string | null} content content within the tag - * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add - * - * @returns {string} content wrapped in HTML element - */ - wrap(tag, content, attrs = {}) { - const htmlAttrs = Object.entries(attrs) + }); + } + /** + * Wraps content in an HTML tag, adding any HTML attributes + * + * @param {string} tag HTML tag to wrap + * @param {string | null} content content within the tag + * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add + * + * @returns {string} content wrapped in HTML element + */ + wrap(tag, content, attrs = {}) { + const htmlAttrs = Object.entries(attrs) .map(([key, value]) => ` ${key}="${value}"`) - .join(''); - if (!content) { + .join(""); + if (!content) { return `<${tag}${htmlAttrs}>`; + } + return `<${tag}${htmlAttrs}>${content}`; } - return `<${tag}${htmlAttrs}>${content}`; - } - /** - * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. - * - * @param {SummaryWriteOptions} [options] (optional) options for write operation - * - * @returns {Promise} summary instance - */ - write(options) { - return __awaiter(this, void 0, void 0, function* () { - const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); + /** + * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. + * + * @param {SummaryWriteOptions} [options] (optional) options for write operation + * + * @returns {Promise} summary instance + */ + write(options) { + return __awaiter(this, void 0, void 0, function* () { + const overwrite = !!(options === null || options === void 0 + ? void 0 + : options.overwrite); const filePath = yield this.filePath(); const writeFunc = overwrite ? writeFile : appendFile; - yield writeFunc(filePath, this._buffer, { encoding: 'utf8' }); + yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); return this.emptyBuffer(); - }); - } - /** - * Clears the summary buffer and wipes the summary file - * - * @returns {Summary} summary instance - */ - clear() { - return __awaiter(this, void 0, void 0, function* () { + }); + } + /** + * Clears the summary buffer and wipes the summary file + * + * @returns {Summary} summary instance + */ + clear() { + return __awaiter(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); - }); - } - /** - * Returns the current summary buffer as a string - * - * @returns {string} string of summary buffer - */ - stringify() { - return this._buffer; - } - /** - * If the summary buffer is empty - * - * @returns {boolen} true if the buffer is empty - */ - isEmptyBuffer() { - return this._buffer.length === 0; - } - /** - * Resets the summary buffer without writing to summary file - * - * @returns {Summary} summary instance - */ - emptyBuffer() { - this._buffer = ''; - return this; - } - /** - * Adds raw text to the summary buffer - * - * @param {string} text content to add - * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) - * - * @returns {Summary} summary instance - */ - addRaw(text, addEOL = false) { - this._buffer += text; - return addEOL ? this.addEOL() : this; - } - /** - * Adds the operating system-specific end-of-line marker to the buffer - * - * @returns {Summary} summary instance - */ - addEOL() { - return this.addRaw(os_1.EOL); - } - /** - * Adds an HTML codeblock to the summary buffer - * - * @param {string} code content to render within fenced code block - * @param {string} lang (optional) language to syntax highlight code - * - * @returns {Summary} summary instance - */ - addCodeBlock(code, lang) { - const attrs = Object.assign({}, (lang && { lang })); - const element = this.wrap('pre', this.wrap('code', code), attrs); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML list to the summary buffer - * - * @param {string[]} items list of items to render - * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) - * - * @returns {Summary} summary instance - */ - addList(items, ordered = false) { - const tag = ordered ? 'ol' : 'ul'; - const listItems = items.map(item => this.wrap('li', item)).join(''); - const element = this.wrap(tag, listItems); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML table to the summary buffer - * - * @param {SummaryTableCell[]} rows table rows - * - * @returns {Summary} summary instance - */ - addTable(rows) { - const tableBody = rows - .map(row => { - const cells = row - .map(cell => { - if (typeof cell === 'string') { - return this.wrap('td', cell); - } - const { header, data, colspan, rowspan } = cell; - const tag = header ? 'th' : 'td'; - const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan })); - return this.wrap(tag, data, attrs); + }); + } + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; + } + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; + } + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; + } + /** + * Adds raw text to the summary buffer + * + * @param {string} text content to add + * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) + * + * @returns {Summary} summary instance + */ + addRaw(text, addEOL = false) { + this._buffer += text; + return addEOL ? this.addEOL() : this; + } + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); + } + /** + * Adds an HTML codeblock to the summary buffer + * + * @param {string} code content to render within fenced code block + * @param {string} lang (optional) language to syntax highlight code + * + * @returns {Summary} summary instance + */ + addCodeBlock(code, lang) { + const attrs = Object.assign({}, lang && { lang }); + const element = this.wrap("pre", this.wrap("code", code), attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML list to the summary buffer + * + * @param {string[]} items list of items to render + * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) + * + * @returns {Summary} summary instance + */ + addList(items, ordered = false) { + const tag = ordered ? "ol" : "ul"; + const listItems = items.map((item) => this.wrap("li", item)).join(""); + const element = this.wrap(tag, listItems); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML table to the summary buffer + * + * @param {SummaryTableCell[]} rows table rows + * + * @returns {Summary} summary instance + */ + addTable(rows) { + const tableBody = rows + .map((row) => { + const cells = row + .map((cell) => { + if (typeof cell === "string") { + return this.wrap("td", cell); + } + const { header, data, colspan, rowspan } = cell; + const tag = header ? "th" : "td"; + const attrs = Object.assign( + Object.assign({}, colspan && { colspan }), + rowspan && { rowspan }, + ); + return this.wrap(tag, data, attrs); + }) + .join(""); + return this.wrap("tr", cells); }) - .join(''); - return this.wrap('tr', cells); - }) - .join(''); - const element = this.wrap('table', tableBody); - return this.addRaw(element).addEOL(); - } - /** - * Adds a collapsable HTML details element to the summary buffer - * - * @param {string} label text for the closed state - * @param {string} content collapsable content - * - * @returns {Summary} summary instance - */ - addDetails(label, content) { - const element = this.wrap('details', this.wrap('summary', label) + content); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML image tag to the summary buffer - * - * @param {string} src path to the image you to embed - * @param {string} alt text description of the image - * @param {SummaryImageOptions} options (optional) addition image attributes - * - * @returns {Summary} summary instance - */ - addImage(src, alt, options) { - const { width, height } = options || {}; - const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height })); - const element = this.wrap('img', null, Object.assign({ src, alt }, attrs)); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML section heading element - * - * @param {string} text heading text - * @param {number | string} [level=1] (optional) the heading level, default: 1 - * - * @returns {Summary} summary instance - */ - addHeading(text, level) { - const tag = `h${level}`; - const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag) + .join(""); + const element = this.wrap("table", tableBody); + return this.addRaw(element).addEOL(); + } + /** + * Adds a collapsable HTML details element to the summary buffer + * + * @param {string} label text for the closed state + * @param {string} content collapsable content + * + * @returns {Summary} summary instance + */ + addDetails(label, content) { + const element = this.wrap( + "details", + this.wrap("summary", label) + content, + ); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML image tag to the summary buffer + * + * @param {string} src path to the image you to embed + * @param {string} alt text description of the image + * @param {SummaryImageOptions} options (optional) addition image attributes + * + * @returns {Summary} summary instance + */ + addImage(src, alt, options) { + const { width, height } = options || {}; + const attrs = Object.assign( + Object.assign({}, width && { width }), + height && { height }, + ); + const element = this.wrap( + "img", + null, + Object.assign({ src, alt }, attrs), + ); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML section heading element + * + * @param {string} text heading text + * @param {number | string} [level=1] (optional) the heading level, default: 1 + * + * @returns {Summary} summary instance + */ + addHeading(text, level) { + const tag = `h${level}`; + const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag - : 'h1'; - const element = this.wrap(allowedTag, text); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML thematic break (
) to the summary buffer - * - * @returns {Summary} summary instance - */ - addSeparator() { - const element = this.wrap('hr', null); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML line break (
) to the summary buffer - * - * @returns {Summary} summary instance - */ - addBreak() { - const element = this.wrap('br', null); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML blockquote to the summary buffer - * - * @param {string} text quote text - * @param {string} cite (optional) citation url - * - * @returns {Summary} summary instance - */ - addQuote(text, cite) { - const attrs = Object.assign({}, (cite && { cite })); - const element = this.wrap('blockquote', text, attrs); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML anchor tag to the summary buffer - * - * @param {string} text link text/content - * @param {string} href hyperlink - * - * @returns {Summary} summary instance - */ - addLink(text, href) { - const element = this.wrap('a', text, { href }); - return this.addRaw(element).addEOL(); - } -} -const _summary = new Summary(); -/** - * @deprecated use `core.summary` - */ -exports.markdownSummary = _summary; -exports.summary = _summary; -//# sourceMappingURL=summary.js.map - -/***/ }), - -/***/ 278: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -// We use any as a valid input type -/* eslint-disable @typescript-eslint/no-explicit-any */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toCommandProperties = exports.toCommandValue = void 0; -/** - * Sanitizes an input into a string so it can be passed into issueCommand safely - * @param input input to sanitize into a string - */ -function toCommandValue(input) { - if (input === null || input === undefined) { - return ''; - } - else if (typeof input === 'string' || input instanceof String) { - return input; - } - return JSON.stringify(input); -} -exports.toCommandValue = toCommandValue; -/** - * - * @param annotationProperties - * @returns The command properties to send with the actual annotation command - * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 - */ -function toCommandProperties(annotationProperties) { - if (!Object.keys(annotationProperties).length) { - return {}; - } - return { - title: annotationProperties.title, - file: annotationProperties.file, - line: annotationProperties.startLine, - endLine: annotationProperties.endLine, - col: annotationProperties.startColumn, - endColumn: annotationProperties.endColumn - }; -} -exports.toCommandProperties = toCommandProperties; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 514: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getExecOutput = exports.exec = void 0; -const string_decoder_1 = __nccwpck_require__(576); -const tr = __importStar(__nccwpck_require__(159)); -/** - * Exec a command. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param commandLine command to execute (can include additional args). Must be correctly escaped. - * @param args optional arguments for tool. Escaping is handled by the lib. - * @param options optional exec options. See ExecOptions - * @returns Promise exit code - */ -function exec(commandLine, args, options) { - return __awaiter(this, void 0, void 0, function* () { - const commandArgs = tr.argStringToArray(commandLine); - if (commandArgs.length === 0) { - throw new Error(`Parameter 'commandLine' cannot be null or empty.`); + : "h1"; + const element = this.wrap(allowedTag, text); + return this.addRaw(element).addEOL(); } - // Path to tool to execute should be first arg - const toolPath = commandArgs[0]; - args = commandArgs.slice(1).concat(args || []); - const runner = new tr.ToolRunner(toolPath, args, options); - return runner.exec(); - }); -} -exports.exec = exec; -/** - * Exec a command and get the output. - * Output will be streamed to the live console. - * Returns promise with the exit code and collected stdout and stderr - * - * @param commandLine command to execute (can include additional args). Must be correctly escaped. - * @param args optional arguments for tool. Escaping is handled by the lib. - * @param options optional exec options. See ExecOptions - * @returns Promise exit code, stdout, and stderr - */ -function getExecOutput(commandLine, args, options) { - var _a, _b; - return __awaiter(this, void 0, void 0, function* () { - let stdout = ''; - let stderr = ''; - //Using string decoder covers the case where a mult-byte character is split - const stdoutDecoder = new string_decoder_1.StringDecoder('utf8'); - const stderrDecoder = new string_decoder_1.StringDecoder('utf8'); - const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; - const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; - const stdErrListener = (data) => { + /** + * Adds an HTML thematic break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addSeparator() { + const element = this.wrap("hr", null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML line break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addBreak() { + const element = this.wrap("br", null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML blockquote to the summary buffer + * + * @param {string} text quote text + * @param {string} cite (optional) citation url + * + * @returns {Summary} summary instance + */ + addQuote(text, cite) { + const attrs = Object.assign({}, cite && { cite }); + const element = this.wrap("blockquote", text, attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML anchor tag to the summary buffer + * + * @param {string} text link text/content + * @param {string} href hyperlink + * + * @returns {Summary} summary instance + */ + addLink(text, href) { + const element = this.wrap("a", text, { href }); + return this.addRaw(element).addEOL(); + } + } + const _summary = new Summary(); + /** + * @deprecated use `core.summary` + */ + exports.markdownSummary = _summary; + exports.summary = _summary; + //# sourceMappingURL=summary.js.map + + /***/ + }, + + /***/ 278: /***/ (__unused_webpack_module, exports) => { + "use strict"; + + // We use any as a valid input type + /* eslint-disable @typescript-eslint/no-explicit-any */ + Object.defineProperty(exports, "__esModule", { value: true }); + exports.toCommandProperties = exports.toCommandValue = void 0; + /** + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string + */ + function toCommandValue(input) { + if (input === null || input === undefined) { + return ""; + } else if (typeof input === "string" || input instanceof String) { + return input; + } + return JSON.stringify(input); + } + exports.toCommandValue = toCommandValue; + /** + * + * @param annotationProperties + * @returns The command properties to send with the actual annotation command + * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 + */ + function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; + } + return { + title: annotationProperties.title, + file: annotationProperties.file, + line: annotationProperties.startLine, + endLine: annotationProperties.endLine, + col: annotationProperties.startColumn, + endColumn: annotationProperties.endColumn, + }; + } + exports.toCommandProperties = toCommandProperties; + //# sourceMappingURL=utils.js.map + + /***/ + }, + + /***/ 514: /***/ function ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) { + "use strict"; + + var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v, + }); + } + : function (o, v) { + o["default"] = v; + }); + var __importStar = + (this && this.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step( + (generator = generator.apply(thisArg, _arguments || [])).next(), + ); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getExecOutput = exports.exec = void 0; + const string_decoder_1 = __nccwpck_require__(576); + const tr = __importStar(__nccwpck_require__(159)); + /** + * Exec a command. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code + */ + function exec(commandLine, args, options) { + return __awaiter(this, void 0, void 0, function* () { + const commandArgs = tr.argStringToArray(commandLine); + if (commandArgs.length === 0) { + throw new Error(`Parameter 'commandLine' cannot be null or empty.`); + } + // Path to tool to execute should be first arg + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); + } + exports.exec = exec; + /** + * Exec a command and get the output. + * Output will be streamed to the live console. + * Returns promise with the exit code and collected stdout and stderr + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code, stdout, and stderr + */ + function getExecOutput(commandLine, args, options) { + var _a, _b; + return __awaiter(this, void 0, void 0, function* () { + let stdout = ""; + let stderr = ""; + //Using string decoder covers the case where a mult-byte character is split + const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); + const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); + const originalStdoutListener = + (_a = + options === null || options === void 0 + ? void 0 + : options.listeners) === null || _a === void 0 + ? void 0 + : _a.stdout; + const originalStdErrListener = + (_b = + options === null || options === void 0 + ? void 0 + : options.listeners) === null || _b === void 0 + ? void 0 + : _b.stderr; + const stdErrListener = (data) => { stderr += stderrDecoder.write(data); if (originalStdErrListener) { - originalStdErrListener(data); + originalStdErrListener(data); } - }; - const stdOutListener = (data) => { + }; + const stdOutListener = (data) => { stdout += stdoutDecoder.write(data); if (originalStdoutListener) { - originalStdoutListener(data); + originalStdoutListener(data); } - }; - const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - //flush any remaining characters - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { + }; + const listeners = Object.assign( + Object.assign( + {}, + options === null || options === void 0 + ? void 0 + : options.listeners, + ), + { stdout: stdOutListener, stderr: stdErrListener }, + ); + const exitCode = yield exec( + commandLine, + args, + Object.assign(Object.assign({}, options), { listeners }), + ); + //flush any remaining characters + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { exitCode, stdout, - stderr + stderr, + }; + }); + } + exports.getExecOutput = getExecOutput; + //# sourceMappingURL=exec.js.map + + /***/ + }, + + /***/ 159: /***/ function ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) { + "use strict"; + + var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v, + }); + } + : function (o, v) { + o["default"] = v; + }); + var __importStar = + (this && this.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; }; - }); -} -exports.getExecOutput = getExecOutput; -//# sourceMappingURL=exec.js.map - -/***/ }), - -/***/ 159: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.argStringToArray = exports.ToolRunner = void 0; -const os = __importStar(__nccwpck_require__(37)); -const events = __importStar(__nccwpck_require__(361)); -const child = __importStar(__nccwpck_require__(81)); -const path = __importStar(__nccwpck_require__(17)); -const io = __importStar(__nccwpck_require__(436)); -const ioUtil = __importStar(__nccwpck_require__(962)); -const timers_1 = __nccwpck_require__(512); -/* eslint-disable @typescript-eslint/unbound-method */ -const IS_WINDOWS = process.platform === 'win32'; -/* - * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. - */ -class ToolRunner extends events.EventEmitter { - constructor(toolPath, args, options) { - super(); - if (!toolPath) { + var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step( + (generator = generator.apply(thisArg, _arguments || [])).next(), + ); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.argStringToArray = exports.ToolRunner = void 0; + const os = __importStar(__nccwpck_require__(37)); + const events = __importStar(__nccwpck_require__(361)); + const child = __importStar(__nccwpck_require__(81)); + const path = __importStar(__nccwpck_require__(17)); + const io = __importStar(__nccwpck_require__(436)); + const ioUtil = __importStar(__nccwpck_require__(962)); + const timers_1 = __nccwpck_require__(512); + /* eslint-disable @typescript-eslint/unbound-method */ + const IS_WINDOWS = process.platform === "win32"; + /* + * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. + */ + class ToolRunner extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) { throw new Error("Parameter 'toolPath' cannot be null or empty."); + } + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; } - this.toolPath = toolPath; - this.args = args || []; - this.options = options || {}; - } - _debug(message) { - if (this.options.listeners && this.options.listeners.debug) { + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { this.options.listeners.debug(message); + } } - } - _getCommandString(options, noPrefix) { - const toolPath = this._getSpawnFileName(); - const args = this._getSpawnArgs(options); - let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool - if (IS_WINDOWS) { + _getCommandString(options, noPrefix) { + const toolPath = this._getSpawnFileName(); + const args = this._getSpawnArgs(options); + let cmd = noPrefix ? "" : "[command]"; // omit prefix when piped to a second tool + if (IS_WINDOWS) { // Windows + cmd file if (this._isCmdFile()) { - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; - } + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } // Windows + verbatim else if (options.windowsVerbatimArguments) { - cmd += `"${toolPath}"`; - for (const a of args) { - cmd += ` ${a}`; - } + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; + } } // Windows (regular) else { - cmd += this._windowsQuoteCmdArg(toolPath); - for (const a of args) { - cmd += ` ${this._windowsQuoteCmdArg(a)}`; - } + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; + } } - } - else { + } else { // OSX/Linux - this can likely be improved with some form of quoting. // creating processes on Unix is fundamentally different than Windows. // on Unix, execvp() takes an arg array. cmd += toolPath; for (const a of args) { - cmd += ` ${a}`; + cmd += ` ${a}`; } + } + return cmd; } - return cmd; - } - _processLineBuffer(data, strBuffer, onLine) { - try { + _processLineBuffer(data, strBuffer, onLine) { + try { let s = strBuffer + data.toString(); let n = s.indexOf(os.EOL); while (n > -1) { - const line = s.substring(0, n); - onLine(line); - // the rest of the string ... - s = s.substring(n + os.EOL.length); - n = s.indexOf(os.EOL); + const line = s.substring(0, n); + onLine(line); + // the rest of the string ... + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); } return s; - } - catch (err) { + } catch (err) { // streaming lines to console is best effort. Don't fail a build. this._debug(`error processing line. Failed with error ${err}`); - return ''; + return ""; + } } - } - _getSpawnFileName() { - if (IS_WINDOWS) { + _getSpawnFileName() { + if (IS_WINDOWS) { if (this._isCmdFile()) { - return process.env['COMSPEC'] || 'cmd.exe'; + return process.env["COMSPEC"] || "cmd.exe"; } + } + return this.toolPath; } - return this.toolPath; - } - _getSpawnArgs(options) { - if (IS_WINDOWS) { + _getSpawnArgs(options) { + if (IS_WINDOWS) { if (this._isCmdFile()) { - let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; - for (const a of this.args) { - argline += ' '; - argline += options.windowsVerbatimArguments - ? a - : this._windowsQuoteCmdArg(a); - } - argline += '"'; - return [argline]; + let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const a of this.args) { + argline += " "; + argline += options.windowsVerbatimArguments + ? a + : this._windowsQuoteCmdArg(a); + } + argline += '"'; + return [argline]; } + } + return this.args; } - return this.args; - } - _endsWith(str, end) { - return str.endsWith(end); - } - _isCmdFile() { - const upperToolPath = this.toolPath.toUpperCase(); - return (this._endsWith(upperToolPath, '.CMD') || - this._endsWith(upperToolPath, '.BAT')); - } - _windowsQuoteCmdArg(arg) { - // for .exe, apply the normal quoting rules that libuv applies - if (!this._isCmdFile()) { - return this._uvQuoteCmdArg(arg); + _endsWith(str, end) { + return str.endsWith(end); } - // otherwise apply quoting rules specific to the cmd.exe command line parser. - // the libuv rules are generic and are not designed specifically for cmd.exe - // command line parser. - // - // for a detailed description of the cmd.exe command line parser, refer to - // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 - // need quotes for empty arg - if (!arg) { - return '""'; + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return ( + this._endsWith(upperToolPath, ".CMD") || + this._endsWith(upperToolPath, ".BAT") + ); } - // determine whether the arg needs to be quoted - const cmdSpecialChars = [ - ' ', - '\t', - '&', - '(', - ')', - '[', - ']', - '{', - '}', - '^', - '=', - ';', - '!', + _windowsQuoteCmdArg(arg) { + // for .exe, apply the normal quoting rules that libuv applies + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); + } + // otherwise apply quoting rules specific to the cmd.exe command line parser. + // the libuv rules are generic and are not designed specifically for cmd.exe + // command line parser. + // + // for a detailed description of the cmd.exe command line parser, refer to + // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 + // need quotes for empty arg + if (!arg) { + return '""'; + } + // determine whether the arg needs to be quoted + const cmdSpecialChars = [ + " ", + "\t", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", "'", - '+', - ',', - '`', - '~', - '|', - '<', - '>', - '"' - ]; - let needsQuotes = false; - for (const char of arg) { - if (cmdSpecialChars.some(x => x === char)) { - needsQuotes = true; - break; + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"', + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; } - } - // short-circuit if quotes not needed - if (!needsQuotes) { + } + // short-circuit if quotes not needed + if (!needsQuotes) { return arg; - } - // the following quoting rules are very similar to the rules that by libuv applies. - // - // 1) wrap the string in quotes - // - // 2) double-up quotes - i.e. " => "" - // - // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately - // doesn't work well with a cmd.exe command line. - // - // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. - // for example, the command line: - // foo.exe "myarg:""my val""" - // is parsed by a .NET console app into an arg array: - // [ "myarg:\"my val\"" ] - // which is the same end result when applying libuv quoting rules. although the actual - // command line from libuv quoting rules would look like: - // foo.exe "myarg:\"my val\"" - // - // 3) double-up slashes that precede a quote, - // e.g. hello \world => "hello \world" - // hello\"world => "hello\\""world" - // hello\\"world => "hello\\\\""world" - // hello world\ => "hello world\\" - // - // technically this is not required for a cmd.exe command line, or the batch argument parser. - // the reasons for including this as a .cmd quoting rule are: - // - // a) this is optimized for the scenario where the argument is passed from the .cmd file to an - // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. - // - // b) it's what we've been doing previously (by deferring to node default behavior) and we - // haven't heard any complaints about that aspect. - // - // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be - // escaped when used on the command line directly - even though within a .cmd file % can be escaped - // by using %%. - // - // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts - // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. - // - // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would - // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the - // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args - // to an external program. - // - // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. - // % can be escaped within a .cmd file. - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { + } + // the following quoting rules are very similar to the rules that by libuv applies. + // + // 1) wrap the string in quotes + // + // 2) double-up quotes - i.e. " => "" + // + // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately + // doesn't work well with a cmd.exe command line. + // + // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. + // for example, the command line: + // foo.exe "myarg:""my val""" + // is parsed by a .NET console app into an arg array: + // [ "myarg:\"my val\"" ] + // which is the same end result when applying libuv quoting rules. although the actual + // command line from libuv quoting rules would look like: + // foo.exe "myarg:\"my val\"" + // + // 3) double-up slashes that precede a quote, + // e.g. hello \world => "hello \world" + // hello\"world => "hello\\""world" + // hello\\"world => "hello\\\\""world" + // hello world\ => "hello world\\" + // + // technically this is not required for a cmd.exe command line, or the batch argument parser. + // the reasons for including this as a .cmd quoting rule are: + // + // a) this is optimized for the scenario where the argument is passed from the .cmd file to an + // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. + // + // b) it's what we've been doing previously (by deferring to node default behavior) and we + // haven't heard any complaints about that aspect. + // + // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be + // escaped when used on the command line directly - even though within a .cmd file % can be escaped + // by using %%. + // + // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts + // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. + // + // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would + // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the + // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args + // to an external program. + // + // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. + // % can be escaped within a .cmd file. + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { // walk the string in reverse reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === '\\') { - reverse += '\\'; // double the slash - } - else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '"'; // double the quote - } - else { - quoteHit = false; + if (quoteHit && arg[i - 1] === "\\") { + reverse += "\\"; // double the slash + } else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '"'; // double the quote + } else { + quoteHit = false; } + } + reverse += '"'; + return reverse.split("").reverse().join(""); } - reverse += '"'; - return reverse - .split('') - .reverse() - .join(''); - } - _uvQuoteCmdArg(arg) { - // Tool runner wraps child_process.spawn() and needs to apply the same quoting as - // Node in certain cases where the undocumented spawn option windowsVerbatimArguments - // is used. - // - // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, - // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), - // pasting copyright notice from Node within this function: - // - // Copyright Joyent, Inc. and other Node contributors. All rights reserved. - // - // Permission is hereby granted, free of charge, to any person obtaining a copy - // of this software and associated documentation files (the "Software"), to - // deal in the Software without restriction, including without limitation the - // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - // sell copies of the Software, and to permit persons to whom the Software is - // furnished to do so, subject to the following conditions: - // - // The above copyright notice and this permission notice shall be included in - // all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - // IN THE SOFTWARE. - if (!arg) { + _uvQuoteCmdArg(arg) { + // Tool runner wraps child_process.spawn() and needs to apply the same quoting as + // Node in certain cases where the undocumented spawn option windowsVerbatimArguments + // is used. + // + // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, + // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), + // pasting copyright notice from Node within this function: + // + // Copyright Joyent, Inc. and other Node contributors. All rights reserved. + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to + // deal in the Software without restriction, including without limitation the + // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + // sell copies of the Software, and to permit persons to whom the Software is + // furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + // IN THE SOFTWARE. + if (!arg) { // Need double quotation for empty argument return '""'; - } - if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { + } + if (!arg.includes(" ") && !arg.includes("\t") && !arg.includes('"')) { // No quotation needed return arg; - } - if (!arg.includes('"') && !arg.includes('\\')) { + } + if (!arg.includes('"') && !arg.includes("\\")) { // No embedded double quotes or backslashes, so I can just wrap // quote marks around the whole thing. return `"${arg}"`; - } - // Expected input/output: - // input : hello"world - // output: "hello\"world" - // input : hello""world - // output: "hello\"\"world" - // input : hello\world - // output: hello\world - // input : hello\\world - // output: hello\\world - // input : hello\"world - // output: "hello\\\"world" - // input : hello\\"world - // output: "hello\\\\\"world" - // input : hello world\ - // output: "hello world\\" - note the comment in libuv actually reads "hello world\" - // but it appears the comment is wrong, it should be "hello world\\" - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { + } + // Expected input/output: + // input : hello"world + // output: "hello\"world" + // input : hello""world + // output: "hello\"\"world" + // input : hello\world + // output: hello\world + // input : hello\\world + // output: hello\\world + // input : hello\"world + // output: "hello\\\"world" + // input : hello\\"world + // output: "hello\\\\\"world" + // input : hello world\ + // output: "hello world\\" - note the comment in libuv actually reads "hello world\" + // but it appears the comment is wrong, it should be "hello world\\" + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { // walk the string in reverse reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === '\\') { - reverse += '\\'; - } - else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '\\'; - } - else { - quoteHit = false; + if (quoteHit && arg[i - 1] === "\\") { + reverse += "\\"; + } else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += "\\"; + } else { + quoteHit = false; } + } + reverse += '"'; + return reverse.split("").reverse().join(""); } - reverse += '"'; - return reverse - .split('') - .reverse() - .join(''); - } - _cloneExecOptions(options) { - options = options || {}; - const result = { + _cloneExecOptions(options) { + options = options || {}; + const result = { cwd: options.cwd || process.cwd(), env: options.env || process.env, silent: options.silent || false, windowsVerbatimArguments: options.windowsVerbatimArguments || false, failOnStdErr: options.failOnStdErr || false, ignoreReturnCode: options.ignoreReturnCode || false, - delay: options.delay || 10000 - }; - result.outStream = options.outStream || process.stdout; - result.errStream = options.errStream || process.stderr; - return result; - } - _getSpawnOptions(options, toolPath) { - options = options || {}; - const result = {}; - result.cwd = options.cwd; - result.env = options.env; - result['windowsVerbatimArguments'] = + delay: options.delay || 10000, + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; + return result; + } + _getSpawnOptions(options, toolPath) { + options = options || {}; + const result = {}; + result.cwd = options.cwd; + result.env = options.env; + result["windowsVerbatimArguments"] = options.windowsVerbatimArguments || this._isCmdFile(); - if (options.windowsVerbatimArguments) { + if (options.windowsVerbatimArguments) { result.argv0 = `"${toolPath}"`; + } + return result; } - return result; - } - /** - * Exec a tool. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param tool path to tool to exec - * @param options optional exec options. See ExecOptions - * @returns number - */ - exec() { - return __awaiter(this, void 0, void 0, function* () { + /** + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number + */ + exec() { + return __awaiter(this, void 0, void 0, function* () { // root the tool path if it is unrooted and contains relative pathing - if (!ioUtil.isRooted(this.toolPath) && - (this.toolPath.includes('/') || - (IS_WINDOWS && this.toolPath.includes('\\')))) { - // prefer options.cwd if it is specified, however options.cwd may also need to be rooted - this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + if ( + !ioUtil.isRooted(this.toolPath) && + (this.toolPath.includes("/") || + (IS_WINDOWS && this.toolPath.includes("\\"))) + ) { + // prefer options.cwd if it is specified, however options.cwd may also need to be rooted + this.toolPath = path.resolve( + process.cwd(), + this.options.cwd || process.cwd(), + this.toolPath, + ); } // if the tool is only a file name, then resolve it from the PATH // otherwise verify it exists (add extension on Windows if necessary) this.toolPath = yield io.which(this.toolPath, true); - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => + __awaiter(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); - this._debug('arguments:'); + this._debug("arguments:"); for (const arg of this.args) { - this._debug(` ${arg}`); + this._debug(` ${arg}`); } const optionsNonNull = this._cloneExecOptions(this.options); if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + optionsNonNull.outStream.write( + this._getCommandString(optionsNonNull) + os.EOL, + ); } const state = new ExecState(optionsNonNull, this.toolPath); - state.on('debug', (message) => { - this._debug(message); + state.on("debug", (message) => { + this._debug(message); }); - if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { - return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); + if ( + this.options.cwd && + !(yield ioUtil.exists(this.options.cwd)) + ) { + return reject( + new Error(`The cwd: ${this.options.cwd} does not exist!`), + ); } const fileName = this._getSpawnFileName(); - const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); - let stdbuffer = ''; + const cp = child.spawn( + fileName, + this._getSpawnArgs(optionsNonNull), + this._getSpawnOptions(this.options, fileName), + ); + let stdbuffer = ""; if (cp.stdout) { - cp.stdout.on('data', (data) => { - if (this.options.listeners && this.options.listeners.stdout) { - this.options.listeners.stdout(data); - } - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(data); + cp.stdout.on("data", (data) => { + if ( + this.options.listeners && + this.options.listeners.stdout + ) { + this.options.listeners.stdout(data); + } + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(data); + } + stdbuffer = this._processLineBuffer( + data, + stdbuffer, + (line) => { + if ( + this.options.listeners && + this.options.listeners.stdline + ) { + this.options.listeners.stdline(line); } - stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { - if (this.options.listeners && this.options.listeners.stdline) { - this.options.listeners.stdline(line); - } - }); - }); + }, + ); + }); } - let errbuffer = ''; + let errbuffer = ""; if (cp.stderr) { - cp.stderr.on('data', (data) => { - state.processStderr = true; - if (this.options.listeners && this.options.listeners.stderr) { - this.options.listeners.stderr(data); - } - if (!optionsNonNull.silent && - optionsNonNull.errStream && - optionsNonNull.outStream) { - const s = optionsNonNull.failOnStdErr - ? optionsNonNull.errStream - : optionsNonNull.outStream; - s.write(data); + cp.stderr.on("data", (data) => { + state.processStderr = true; + if ( + this.options.listeners && + this.options.listeners.stderr + ) { + this.options.listeners.stderr(data); + } + if ( + !optionsNonNull.silent && + optionsNonNull.errStream && + optionsNonNull.outStream + ) { + const s = optionsNonNull.failOnStdErr + ? optionsNonNull.errStream + : optionsNonNull.outStream; + s.write(data); + } + errbuffer = this._processLineBuffer( + data, + errbuffer, + (line) => { + if ( + this.options.listeners && + this.options.listeners.errline + ) { + this.options.listeners.errline(line); } - errbuffer = this._processLineBuffer(data, errbuffer, (line) => { - if (this.options.listeners && this.options.listeners.errline) { - this.options.listeners.errline(line); - } - }); - }); + }, + ); + }); } - cp.on('error', (err) => { - state.processError = err.message; - state.processExited = true; - state.processClosed = true; - state.CheckComplete(); + cp.on("error", (err) => { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); }); - cp.on('exit', (code) => { - state.processExitCode = code; - state.processExited = true; - this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); - state.CheckComplete(); + cp.on("exit", (code) => { + state.processExitCode = code; + state.processExited = true; + this._debug( + `Exit code ${code} received from tool '${this.toolPath}'`, + ); + state.CheckComplete(); }); - cp.on('close', (code) => { - state.processExitCode = code; - state.processExited = true; - state.processClosed = true; - this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); - state.CheckComplete(); + cp.on("close", (code) => { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + this._debug( + `STDIO streams have closed for tool '${this.toolPath}'`, + ); + state.CheckComplete(); }); - state.on('done', (error, exitCode) => { - if (stdbuffer.length > 0) { - this.emit('stdline', stdbuffer); - } - if (errbuffer.length > 0) { - this.emit('errline', errbuffer); - } - cp.removeAllListeners(); - if (error) { - reject(error); - } - else { - resolve(exitCode); - } + state.on("done", (error, exitCode) => { + if (stdbuffer.length > 0) { + this.emit("stdline", stdbuffer); + } + if (errbuffer.length > 0) { + this.emit("errline", errbuffer); + } + cp.removeAllListeners(); + if (error) { + reject(error); + } else { + resolve(exitCode); + } }); if (this.options.input) { - if (!cp.stdin) { - throw new Error('child process missing stdin'); - } - cp.stdin.end(this.options.input); + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); } - })); - }); - } -} -exports.ToolRunner = ToolRunner; -/** - * Convert an arg string to an array of args. Handles escaping - * - * @param argString string of arguments - * @returns string[] array of arguments - */ -function argStringToArray(argString) { - const args = []; - let inQuotes = false; - let escaped = false; - let arg = ''; - function append(c) { - // we only escape double quotes. - if (escaped && c !== '"') { - arg += '\\'; - } - arg += c; - escaped = false; - } - for (let i = 0; i < argString.length; i++) { - const c = argString.charAt(i); - if (c === '"') { + }), + ); + }); + } + } + exports.ToolRunner = ToolRunner; + /** + * Convert an arg string to an array of args. Handles escaping + * + * @param argString string of arguments + * @returns string[] array of arguments + */ + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + // we only escape double quotes. + if (escaped && c !== '"') { + arg += "\\"; + } + arg += c; + escaped = false; + } + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { if (!escaped) { - inQuotes = !inQuotes; - } - else { - append(c); + inQuotes = !inQuotes; + } else { + append(c); } continue; - } - if (c === '\\' && escaped) { + } + if (c === "\\" && escaped) { append(c); continue; - } - if (c === '\\' && inQuotes) { + } + if (c === "\\" && inQuotes) { escaped = true; continue; - } - if (c === ' ' && !inQuotes) { + } + if (c === " " && !inQuotes) { if (arg.length > 0) { - args.push(arg); - arg = ''; + args.push(arg); + arg = ""; } continue; + } + append(c); } - append(c); - } - if (arg.length > 0) { - args.push(arg.trim()); - } - return args; -} -exports.argStringToArray = argStringToArray; -class ExecState extends events.EventEmitter { - constructor(options, toolPath) { - super(); - this.processClosed = false; // tracks whether the process has exited and stdio is closed - this.processError = ''; - this.processExitCode = 0; - this.processExited = false; // tracks whether the process has exited - this.processStderr = false; // tracks whether stderr was written to - this.delay = 10000; // 10 seconds - this.done = false; - this.timeout = null; - if (!toolPath) { - throw new Error('toolPath must not be empty'); - } - this.options = options; - this.toolPath = toolPath; - if (options.delay) { + if (arg.length > 0) { + args.push(arg.trim()); + } + return args; + } + exports.argStringToArray = argStringToArray; + class ExecState extends events.EventEmitter { + constructor(options, toolPath) { + super(); + this.processClosed = false; // tracks whether the process has exited and stdio is closed + this.processError = ""; + this.processExitCode = 0; + this.processExited = false; // tracks whether the process has exited + this.processStderr = false; // tracks whether stderr was written to + this.delay = 10000; // 10 seconds + this.done = false; + this.timeout = null; + if (!toolPath) { + throw new Error("toolPath must not be empty"); + } + this.options = options; + this.toolPath = toolPath; + if (options.delay) { this.delay = options.delay; + } } - } - CheckComplete() { - if (this.done) { + CheckComplete() { + if (this.done) { return; - } - if (this.processClosed) { + } + if (this.processClosed) { this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout( + ExecState.HandleTimeout, + this.delay, + this, + ); + } } - else if (this.processExited) { - this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this); + _debug(message) { + this.emit("debug", message); } - } - _debug(message) { - this.emit('debug', message); - } - _setResult() { - // determine whether there is an error - let error; - if (this.processExited) { + _setResult() { + // determine whether there is an error + let error; + if (this.processExited) { if (this.processError) { - error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); - } - else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { - error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + error = new Error( + `There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`, + ); + } else if ( + this.processExitCode !== 0 && + !this.options.ignoreReturnCode + ) { + error = new Error( + `The process '${this.toolPath}' failed with exit code ${this.processExitCode}`, + ); + } else if (this.processStderr && this.options.failOnStdErr) { + error = new Error( + `The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`, + ); } - else if (this.processStderr && this.options.failOnStdErr) { - error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); - } - } - // clear the timeout - if (this.timeout) { + } + // clear the timeout + if (this.timeout) { clearTimeout(this.timeout); this.timeout = null; + } + this.done = true; + this.emit("done", error, this.processExitCode); } - this.done = true; - this.emit('done', error, this.processExitCode); - } - static HandleTimeout(state) { - if (state.done) { + static HandleTimeout(state) { + if (state.done) { return; - } - if (!state.processClosed && state.processExited) { - const message = `The STDIO streams did not close within ${state.delay / - 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + } + if (!state.processClosed && state.processExited) { + const message = `The STDIO streams did not close within ${ + state.delay / 1000 + } seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; state._debug(message); + } + state._setResult(); } - state._setResult(); - } -} -//# sourceMappingURL=toolrunner.js.map - -/***/ }), - -/***/ 526: -/***/ (function(__unused_webpack_module, exports) { + } + //# sourceMappingURL=toolrunner.js.map + + /***/ + }, + + /***/ 526: /***/ function (__unused_webpack_module, exports) { + "use strict"; + + var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step( + (generator = generator.apply(thisArg, _arguments || [])).next(), + ); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PersonalAccessTokenCredentialHandler = + exports.BearerCredentialHandler = + exports.BasicCredentialHandler = + void 0; + class BasicCredentialHandler { + constructor(username, password) { + this.username = username; + this.password = password; + } + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = + `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); + } + } + exports.BasicCredentialHandler = BasicCredentialHandler; + class BearerCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Bearer ${this.token}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); + } + } + exports.BearerCredentialHandler = BearerCredentialHandler; + class PersonalAccessTokenCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = + `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); + } + } + exports.PersonalAccessTokenCredentialHandler = + PersonalAccessTokenCredentialHandler; + //# sourceMappingURL=auth.js.map -"use strict"; + /***/ + }, -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; -class BasicCredentialHandler { - constructor(username, password) { - this.username = username; - this.password = password; - } - prepareRequest(options) { - if (!options.headers) { - throw Error('The request has no headers'); - } - options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error('not implemented'); - }); - } -} -exports.BasicCredentialHandler = BasicCredentialHandler; -class BearerCredentialHandler { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error('The request has no headers'); + /***/ 255: /***/ function ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) { + "use strict"; + + /* eslint-disable @typescript-eslint/no-explicit-any */ + var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v, + }); + } + : function (o, v) { + o["default"] = v; + }); + var __importStar = + (this && this.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step( + (generator = generator.apply(thisArg, _arguments || [])).next(), + ); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.HttpClient = + exports.isHttps = + exports.HttpClientResponse = + exports.HttpClientError = + exports.getProxyUrl = + exports.MediaTypes = + exports.Headers = + exports.HttpCodes = + void 0; + const http = __importStar(__nccwpck_require__(685)); + const https = __importStar(__nccwpck_require__(687)); + const pm = __importStar(__nccwpck_require__(835)); + const tunnel = __importStar(__nccwpck_require__(294)); + var HttpCodes; + (function (HttpCodes) { + HttpCodes[(HttpCodes["OK"] = 200)] = "OK"; + HttpCodes[(HttpCodes["MultipleChoices"] = 300)] = "MultipleChoices"; + HttpCodes[(HttpCodes["MovedPermanently"] = 301)] = "MovedPermanently"; + HttpCodes[(HttpCodes["ResourceMoved"] = 302)] = "ResourceMoved"; + HttpCodes[(HttpCodes["SeeOther"] = 303)] = "SeeOther"; + HttpCodes[(HttpCodes["NotModified"] = 304)] = "NotModified"; + HttpCodes[(HttpCodes["UseProxy"] = 305)] = "UseProxy"; + HttpCodes[(HttpCodes["SwitchProxy"] = 306)] = "SwitchProxy"; + HttpCodes[(HttpCodes["TemporaryRedirect"] = 307)] = "TemporaryRedirect"; + HttpCodes[(HttpCodes["PermanentRedirect"] = 308)] = "PermanentRedirect"; + HttpCodes[(HttpCodes["BadRequest"] = 400)] = "BadRequest"; + HttpCodes[(HttpCodes["Unauthorized"] = 401)] = "Unauthorized"; + HttpCodes[(HttpCodes["PaymentRequired"] = 402)] = "PaymentRequired"; + HttpCodes[(HttpCodes["Forbidden"] = 403)] = "Forbidden"; + HttpCodes[(HttpCodes["NotFound"] = 404)] = "NotFound"; + HttpCodes[(HttpCodes["MethodNotAllowed"] = 405)] = "MethodNotAllowed"; + HttpCodes[(HttpCodes["NotAcceptable"] = 406)] = "NotAcceptable"; + HttpCodes[(HttpCodes["ProxyAuthenticationRequired"] = 407)] = + "ProxyAuthenticationRequired"; + HttpCodes[(HttpCodes["RequestTimeout"] = 408)] = "RequestTimeout"; + HttpCodes[(HttpCodes["Conflict"] = 409)] = "Conflict"; + HttpCodes[(HttpCodes["Gone"] = 410)] = "Gone"; + HttpCodes[(HttpCodes["TooManyRequests"] = 429)] = "TooManyRequests"; + HttpCodes[(HttpCodes["InternalServerError"] = 500)] = + "InternalServerError"; + HttpCodes[(HttpCodes["NotImplemented"] = 501)] = "NotImplemented"; + HttpCodes[(HttpCodes["BadGateway"] = 502)] = "BadGateway"; + HttpCodes[(HttpCodes["ServiceUnavailable"] = 503)] = + "ServiceUnavailable"; + HttpCodes[(HttpCodes["GatewayTimeout"] = 504)] = "GatewayTimeout"; + })((HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}))); + var Headers; + (function (Headers) { + Headers["Accept"] = "accept"; + Headers["ContentType"] = "content-type"; + })((Headers = exports.Headers || (exports.Headers = {}))); + var MediaTypes; + (function (MediaTypes) { + MediaTypes["ApplicationJson"] = "application/json"; + })((MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}))); + /** + * Returns the proxy URL, depending upon the supplied url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + function getProxyUrl(serverUrl) { + const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); + return proxyUrl ? proxyUrl.href : ""; + } + exports.getProxyUrl = getProxyUrl; + const HttpRedirectCodes = [ + HttpCodes.MovedPermanently, + HttpCodes.ResourceMoved, + HttpCodes.SeeOther, + HttpCodes.TemporaryRedirect, + HttpCodes.PermanentRedirect, + ]; + const HttpResponseRetryCodes = [ + HttpCodes.BadGateway, + HttpCodes.ServiceUnavailable, + HttpCodes.GatewayTimeout, + ]; + const RetryableHttpVerbs = ["OPTIONS", "GET", "DELETE", "HEAD"]; + const ExponentialBackoffCeiling = 10; + const ExponentialBackoffTimeSlice = 5; + class HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = "HttpClientError"; + this.statusCode = statusCode; + Object.setPrototypeOf(this, HttpClientError.prototype); } - options.headers['Authorization'] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error('not implemented'); - }); - } -} -exports.BearerCredentialHandler = BearerCredentialHandler; -class PersonalAccessTokenCredentialHandler { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error('The request has no headers'); + } + exports.HttpClientError = HttpClientError; + class HttpClientResponse { + constructor(message) { + this.message = message; } - options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error('not implemented'); - }); - } -} -exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; -//# sourceMappingURL=auth.js.map - -/***/ }), - -/***/ 255: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* eslint-disable @typescript-eslint/no-explicit-any */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; -const http = __importStar(__nccwpck_require__(685)); -const https = __importStar(__nccwpck_require__(687)); -const pm = __importStar(__nccwpck_require__(835)); -const tunnel = __importStar(__nccwpck_require__(294)); -var HttpCodes; -(function (HttpCodes) { - HttpCodes[HttpCodes["OK"] = 200] = "OK"; - HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; - HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; - HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; - HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; - HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; - HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; - HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; - HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; - HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; - HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; -})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); -var Headers; -(function (Headers) { - Headers["Accept"] = "accept"; - Headers["ContentType"] = "content-type"; -})(Headers = exports.Headers || (exports.Headers = {})); -var MediaTypes; -(function (MediaTypes) { - MediaTypes["ApplicationJson"] = "application/json"; -})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); -/** - * Returns the proxy URL, depending upon the supplied url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ -function getProxyUrl(serverUrl) { - const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); - return proxyUrl ? proxyUrl.href : ''; -} -exports.getProxyUrl = getProxyUrl; -const HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect -]; -const HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.GatewayTimeout -]; -const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; -const ExponentialBackoffCeiling = 10; -const ExponentialBackoffTimeSlice = 5; -class HttpClientError extends Error { - constructor(message, statusCode) { - super(message); - this.name = 'HttpClientError'; - this.statusCode = statusCode; - Object.setPrototypeOf(this, HttpClientError.prototype); - } -} -exports.HttpClientError = HttpClientError; -class HttpClientResponse { - constructor(message) { - this.message = message; - } - readBody() { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + readBody() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => + __awaiter(this, void 0, void 0, function* () { let output = Buffer.alloc(0); - this.message.on('data', (chunk) => { - output = Buffer.concat([output, chunk]); + this.message.on("data", (chunk) => { + output = Buffer.concat([output, chunk]); }); - this.message.on('end', () => { - resolve(output.toString()); + this.message.on("end", () => { + resolve(output.toString()); }); - })); - }); - } - readBodyBuffer() { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + }), + ); + }); + } + readBodyBuffer() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => + __awaiter(this, void 0, void 0, function* () { const chunks = []; - this.message.on('data', (chunk) => { - chunks.push(chunk); + this.message.on("data", (chunk) => { + chunks.push(chunk); }); - this.message.on('end', () => { - resolve(Buffer.concat(chunks)); + this.message.on("end", () => { + resolve(Buffer.concat(chunks)); }); - })); - }); - } -} -exports.HttpClientResponse = HttpClientResponse; -function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === 'https:'; -} -exports.isHttps = isHttps; -class HttpClient { - constructor(userAgent, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = userAgent; - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { + }), + ); + }); + } + } + exports.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; + } + exports.isHttps = isHttps; + class HttpClient { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; + this._ignoreSslError = requestOptions.ignoreSslError; } this._socketTimeout = requestOptions.socketTimeout; if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; + this._allowRedirects = requestOptions.allowRedirects; } if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + this._allowRedirectDowngrade = + requestOptions.allowRedirectDowngrade; } if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); } if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; + this._keepAlive = requestOptions.keepAlive; } if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; + this._allowRetries = requestOptions.allowRetries; } if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + this._maxRetries = requestOptions.maxRetries; } + } + } + options(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request( + "OPTIONS", + requestUrl, + null, + additionalHeaders || {}, + ); + }); + } + get(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request( + "GET", + requestUrl, + null, + additionalHeaders || {}, + ); + }); + } + del(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request( + "DELETE", + requestUrl, + null, + additionalHeaders || {}, + ); + }); } - } - options(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('GET', requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('DELETE', requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('POST', requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('PATCH', requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('PUT', requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('HEAD', requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { + post(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request( + "POST", + requestUrl, + data, + additionalHeaders || {}, + ); + }); + } + patch(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request( + "PATCH", + requestUrl, + data, + additionalHeaders || {}, + ); + }); + } + put(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request( + "PUT", + requestUrl, + data, + additionalHeaders || {}, + ); + }); + } + head(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request( + "HEAD", + requestUrl, + null, + additionalHeaders || {}, + ); + }); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); - }); - } - /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise - */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + }); + } + /** + * Gets a typed object from an endpoint + * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + */ + getJson(requestUrl, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + additionalHeaders[Headers.Accept] = + this._getExistingOrDefaultHeader( + additionalHeaders, + Headers.Accept, + MediaTypes.ApplicationJson, + ); const res = yield this.get(requestUrl, additionalHeaders); return this._processResponse(res, this.requestOptions); - }); - } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { + }); + } + postJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.Accept] = + this._getExistingOrDefaultHeader( + additionalHeaders, + Headers.Accept, + MediaTypes.ApplicationJson, + ); + additionalHeaders[Headers.ContentType] = + this._getExistingOrDefaultHeader( + additionalHeaders, + Headers.ContentType, + MediaTypes.ApplicationJson, + ); const res = yield this.post(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); - }); - } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { + }); + } + putJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.Accept] = + this._getExistingOrDefaultHeader( + additionalHeaders, + Headers.Accept, + MediaTypes.ApplicationJson, + ); + additionalHeaders[Headers.ContentType] = + this._getExistingOrDefaultHeader( + additionalHeaders, + Headers.ContentType, + MediaTypes.ApplicationJson, + ); const res = yield this.put(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); - }); - } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { + }); + } + patchJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.Accept] = + this._getExistingOrDefaultHeader( + additionalHeaders, + Headers.Accept, + MediaTypes.ApplicationJson, + ); + additionalHeaders[Headers.ContentType] = + this._getExistingOrDefaultHeader( + additionalHeaders, + Headers.ContentType, + MediaTypes.ApplicationJson, + ); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); - }); - } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - request(verb, requestUrl, data, headers) { - return __awaiter(this, void 0, void 0, function* () { + }); + } + /** + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch + */ + request(verb, requestUrl, data, headers) { + return __awaiter(this, void 0, void 0, function* () { if (this._disposed) { - throw new Error('Client has already been disposed.'); + throw new Error("Client has already been disposed."); } const parsedUrl = new URL(requestUrl); let info = this._prepareRequest(verb, parsedUrl, headers); // Only perform retries on reads since writes may not be idempotent. - const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) + const maxTries = + this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; let numTries = 0; let response; do { - response = yield this.requestRaw(info, data); - // Check if it's an authentication challenge - if (response && - response.message && - response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info, data); - } - else { - // We have received an unauthorized response but have no handlers to handle it. - // Let the response return to the caller. - return response; - } + response = yield this.requestRaw(info, data); + // Check if it's an authentication challenge + if ( + response && + response.message && + response.message.statusCode === HttpCodes.Unauthorized + ) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } } - let redirectsRemaining = this._maxRedirects; - while (response.message.statusCode && - HttpRedirectCodes.includes(response.message.statusCode) && - this._allowRedirects && - redirectsRemaining > 0) { - const redirectUrl = response.message.headers['location']; - if (!redirectUrl) { - // if there's no location to redirect to, we won't - break; - } - const parsedRedirectUrl = new URL(redirectUrl); - if (parsedUrl.protocol === 'https:' && - parsedUrl.protocol !== parsedRedirectUrl.protocol && - !this._allowRedirectDowngrade) { - 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.'); - } - // we need to finish reading the response before reassigning response - // which will leak the open socket. - yield response.readBody(); - // strip authorization header if redirected to a different hostname - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - // header names are case insensitive - if (header.toLowerCase() === 'authorization') { - delete headers[header]; - } - } - } - // let's make the request with the new redirectUrl - info = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info, data); - redirectsRemaining--; + if (authenticationHandler) { + return authenticationHandler.handleAuthentication( + this, + info, + data, + ); + } else { + // We have received an unauthorized response but have no handlers to handle it. + // Let the response return to the caller. + return response; } - if (!response.message.statusCode || - !HttpResponseRetryCodes.includes(response.message.statusCode)) { - // If not a retry code, return immediately instead of retrying - return response; + } + let redirectsRemaining = this._maxRedirects; + while ( + response.message.statusCode && + HttpRedirectCodes.includes(response.message.statusCode) && + this._allowRedirects && + redirectsRemaining > 0 + ) { + const redirectUrl = response.message.headers["location"]; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); + const parsedRedirectUrl = new URL(redirectUrl); + if ( + parsedUrl.protocol === "https:" && + parsedUrl.protocol !== parsedRedirectUrl.protocol && + !this._allowRedirectDowngrade + ) { + 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.", + ); } + // we need to finish reading the response before reassigning response + // which will leak the open socket. + yield response.readBody(); + // strip authorization header if redirected to a different hostname + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) { + // header names are case insensitive + if (header.toLowerCase() === "authorization") { + delete headers[header]; + } + } + } + // let's make the request with the new redirectUrl + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info, data); + redirectsRemaining--; + } + if ( + !response.message.statusCode || + !HttpResponseRetryCodes.includes(response.message.statusCode) + ) { + // If not a retry code, return immediately instead of retrying + return response; + } + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); + } } while (numTries < maxTries); return response; - }); - } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { + }); + } + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { this._agent.destroy(); + } + this._disposed = true; } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info, data) { - return __awaiter(this, void 0, void 0, function* () { + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info, data) { + return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } - else if (!res) { - // If `err` is not passed, then `res` must be passed. - reject(new Error('Unknown error')); - } - else { - resolve(res); - } + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + // If `err` is not passed, then `res` must be passed. + reject(new Error("Unknown error")); + } else { + resolve(res); } - this.requestRawWithCallback(info, data, callbackForResult); + } + this.requestRawWithCallback(info, data, callbackForResult); }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info, data, onResult) { - if (typeof data === 'string') { + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info, data, onResult) { + if (typeof data === "string") { if (!info.options.headers) { - info.options.headers = {}; + info.options.headers = {}; } - info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); - } - let callbackCalled = false; - function handleResult(err, res) { + info.options.headers["Content-Length"] = Buffer.byteLength( + data, + "utf8", + ); + } + let callbackCalled = false; + function handleResult(err, res) { if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + callbackCalled = true; + onResult(err, res); } - } - const req = info.httpModule.request(info.options, (msg) => { + } + const req = info.httpModule.request(info.options, (msg) => { const res = new HttpClientResponse(msg); handleResult(undefined, res); - }); - let socket; - req.on('socket', sock => { + }); + let socket; + req.on("socket", (sock) => { socket = sock; - }); - // If we ever get disconnected, we want the socket to timeout eventually - req.setTimeout(this._socketTimeout || 3 * 60000, () => { + }); + // If we ever get disconnected, we want the socket to timeout eventually + req.setTimeout(this._socketTimeout || 3 * 60000, () => { if (socket) { - socket.end(); + socket.end(); } handleResult(new Error(`Request timeout: ${info.options.path}`)); - }); - req.on('error', function (err) { + }); + req.on("error", function (err) { // err has statusCode property // res should have headers handleResult(err); - }); - if (data && typeof data === 'string') { - req.write(data, 'utf8'); - } - if (data && typeof data !== 'string') { - data.on('close', function () { - req.end(); + }); + if (data && typeof data === "string") { + req.write(data, "utf8"); + } + if (data && typeof data !== "string") { + data.on("close", function () { + req.end(); }); data.pipe(req); - } - else { + } else { req.end(); + } } - } - /** - * Gets an http agent. This function is useful when you need an http agent that handles - * routing through a proxy server - depending upon the url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ - getAgent(serverUrl) { - const parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info = {}; - info.parsedUrl = requestUrl; - const usingSsl = info.parsedUrl.protocol === 'https:'; - info.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info.options = {}; - info.options.host = info.parsedUrl.hostname; - info.options.port = info.parsedUrl.port + /** + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + getAgent(serverUrl) { + const parsedUrl = new URL(serverUrl); + return this._getAgent(parsedUrl); + } + _prepareRequest(method, requestUrl, headers) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === "https:"; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort; - info.options.path = - (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); - info.options.method = method; - info.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info.options.headers['user-agent'] = this.userAgent; - } - info.options.agent = this._getAgent(info.parsedUrl); - // gives handlers an opportunity to participate - if (this.handlers) { + info.options.path = + (info.parsedUrl.pathname || "") + (info.parsedUrl.search || ""); + info.options.method = method; + info.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info.options.headers["user-agent"] = this.userAgent; + } + info.options.agent = this._getAgent(info.parsedUrl); + // gives handlers an opportunity to participate + if (this.handlers) { for (const handler of this.handlers) { - handler.prepareRequest(info.options); + handler.prepareRequest(info.options); } + } + return info; } - return info; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign( + {}, + lowercaseKeys(this.requestOptions.headers), + lowercaseKeys(headers || {}), + ); + } + return lowercaseKeys(headers || {}); } - return lowercaseKeys(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default; } - return additionalHeaders[header] || clientHeader || _default; - } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { agent = this._proxyAgent; - } - if (this._keepAlive && !useProxy) { + } + if (this._keepAlive && !useProxy) { agent = this._agent; - } - // if agent is already assigned use that agent. - if (agent) { + } + // if agent is already assigned use that agent. + if (agent) { return agent; - } - const usingSsl = parsedUrl.protocol === 'https:'; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; - } - // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis. - if (proxyUrl && proxyUrl.hostname) { + } + const usingSsl = parsedUrl.protocol === "https:"; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = + this.requestOptions.maxSockets || http.globalAgent.maxSockets; + } + // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis. + if (proxyUrl && proxyUrl.hostname) { const agentOptions = { - maxSockets, - keepAlive: this._keepAlive, - proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && { - proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` - })), { host: proxyUrl.hostname, port: proxyUrl.port }) + maxSockets, + keepAlive: this._keepAlive, + proxy: Object.assign( + Object.assign( + {}, + (proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`, + }, + ), + { host: proxyUrl.hostname, port: proxyUrl.port }, + ), }; let tunnelAgent; - const overHttps = proxyUrl.protocol === 'https:'; + const overHttps = proxyUrl.protocol === "https:"; if (usingSsl) { - tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; - } - else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + tunnelAgent = overHttps + ? tunnel.httpsOverHttps + : tunnel.httpsOverHttp; + } else { + tunnelAgent = overHttps + ? tunnel.httpOverHttps + : tunnel.httpOverHttp; } agent = tunnelAgent(agentOptions); this._proxyAgent = agent; - } - // if reusing agent across request and tunneling agent isn't assigned create a new agent - if (this._keepAlive && !agent) { + } + // if reusing agent across request and tunneling agent isn't assigned create a new agent + if (this._keepAlive && !agent) { const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + agent = usingSsl + ? new https.Agent(options) + : new http.Agent(options); this._agent = agent; - } - // if not using private agent and tunnel agent isn't setup then use global agent - if (!agent) { + } + // if not using private agent and tunnel agent isn't setup then use global agent + if (!agent) { agent = usingSsl ? https.globalAgent : http.globalAgent; - } - if (usingSsl && this._ignoreSslError) { + } + if (usingSsl && this._ignoreSslError) { // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options // we have to cast it to any and change it directly agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false + rejectUnauthorized: false, }); + } + return agent; } - return agent; - } - _performExponentialBackoff(retryNumber) { - return __awaiter(this, void 0, void 0, function* () { + _performExponentialBackoff(retryNumber) { + return __awaiter(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise(resolve => setTimeout(() => resolve(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => setTimeout(() => resolve(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => + __awaiter(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { - statusCode, - result: null, - headers: {} + statusCode, + result: null, + headers: {}, }; // not found leads to null obj returned if (statusCode === HttpCodes.NotFound) { - resolve(response); + resolve(response); } // get the result from the body function dateTimeDeserializer(key, value) { - if (typeof value === 'string') { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; } - return value; + } + return value; } let obj; let contents; try { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, dateTimeDeserializer); - } - else { - obj = JSON.parse(contents); - } - response.result = obj; + contents = yield res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, dateTimeDeserializer); + } else { + obj = JSON.parse(contents); } - response.headers = res.message.headers; - } - catch (err) { - // Invalid resource (contents not json); leaving result obj null + response.result = obj; + } + response.headers = res.message.headers; + } catch (err) { + // Invalid resource (contents not json); leaving result obj null } // note that 3xx redirects are handled by the http layer. if (statusCode > 299) { - let msg; - // if exception/error in body, attempt to get better error - if (obj && obj.message) { - msg = obj.message; - } - else if (contents && contents.length > 0) { - // it may be the case that the exception is in the body message as string - msg = contents; - } - else { - msg = `Failed request: (${statusCode})`; - } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } - else { - resolve(response); + let msg; + // if exception/error in body, attempt to get better error + if (obj && obj.message) { + msg = obj.message; + } else if (contents && contents.length > 0) { + // it may be the case that the exception is in the body message as string + msg = contents; + } else { + msg = `Failed request: (${statusCode})`; + } + const err = new HttpClientError(msg, statusCode); + err.result = response.result; + reject(err); + } else { + resolve(response); } - })); - }); - } -} -exports.HttpClient = HttpClient; -const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 835: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.checkBypass = exports.getProxyUrl = void 0; -function getProxyUrl(reqUrl) { - const usingSsl = reqUrl.protocol === 'https:'; - if (checkBypass(reqUrl)) { - return undefined; - } - const proxyVar = (() => { - if (usingSsl) { - return process.env['https_proxy'] || process.env['HTTPS_PROXY']; + }), + ); + }); } - else { - return process.env['http_proxy'] || process.env['HTTP_PROXY']; + } + exports.HttpClient = HttpClient; + const lowercaseKeys = (obj) => + Object.keys(obj).reduce( + (c, k) => ((c[k.toLowerCase()] = obj[k]), c), + {}, + ); + //# sourceMappingURL=index.js.map + + /***/ + }, + + /***/ 835: /***/ (__unused_webpack_module, exports) => { + "use strict"; + + Object.defineProperty(exports, "__esModule", { value: true }); + exports.checkBypass = exports.getProxyUrl = void 0; + function getProxyUrl(reqUrl) { + const usingSsl = reqUrl.protocol === "https:"; + if (checkBypass(reqUrl)) { + return undefined; } - })(); - if (proxyVar) { - try { + const proxyVar = (() => { + if (usingSsl) { + return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; + } else { + return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + } + })(); + if (proxyVar) { + try { return new URL(proxyVar); + } catch (_a) { + if ( + !proxyVar.startsWith("http://") && + !proxyVar.startsWith("https://") + ) + return new URL(`http://${proxyVar}`); + } + } else { + return undefined; } - catch (_a) { - if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) - return new URL(`http://${proxyVar}`); + } + exports.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - } - else { - return undefined; - } -} -exports.getProxyUrl = getProxyUrl; -function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; - } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; - } - const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; - if (!noProxy) { - return false; - } - // Determine the request port - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } - else if (reqUrl.protocol === 'http:') { - reqPort = 80; - } - else if (reqUrl.protocol === 'https:') { - reqPort = 443; - } - // Format the request hostname and hostname with port - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === 'number') { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); - } - // Compare request host against noproxy - for (const upperNoProxyItem of noProxy - .split(',') - .map(x => x.trim().toUpperCase()) - .filter(x => x)) { - if (upperNoProxyItem === '*' || - upperReqHosts.some(x => x === upperNoProxyItem || + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } + const noProxy = + process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; + } + // Determine the request port + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; + } + // Format the request hostname and hostname with port + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + } + // Compare request host against noproxy + for (const upperNoProxyItem of noProxy + .split(",") + .map((x) => x.trim().toUpperCase()) + .filter((x) => x)) { + if ( + upperNoProxyItem === "*" || + upperReqHosts.some( + (x) => + x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || - (upperNoProxyItem.startsWith('.') && - x.endsWith(`${upperNoProxyItem}`)))) { + (upperNoProxyItem.startsWith(".") && + x.endsWith(`${upperNoProxyItem}`)), + ) + ) { return true; + } } - } - return false; -} -exports.checkBypass = checkBypass; -function isLoopbackAddress(host) { - const hostLower = host.toLowerCase(); - return (hostLower === 'localhost' || - hostLower.startsWith('127.') || - hostLower.startsWith('[::1]') || - hostLower.startsWith('[0:0:0:0:0:0:0:1]')); -} -//# sourceMappingURL=proxy.js.map - -/***/ }), - -/***/ 962: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var _a; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; -const fs = __importStar(__nccwpck_require__(147)); -const path = __importStar(__nccwpck_require__(17)); -_a = fs.promises -// export const {open} = 'fs' -, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; -// export const {open} = 'fs' -exports.IS_WINDOWS = process.platform === 'win32'; -// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 -exports.UV_FS_O_EXLOCK = 0x10000000; -exports.READONLY = fs.constants.O_RDONLY; -function exists(fsPath) { - return __awaiter(this, void 0, void 0, function* () { - try { + return false; + } + exports.checkBypass = checkBypass; + function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return ( + hostLower === "localhost" || + hostLower.startsWith("127.") || + hostLower.startsWith("[::1]") || + hostLower.startsWith("[0:0:0:0:0:0:0:1]") + ); + } + //# sourceMappingURL=proxy.js.map + + /***/ + }, + + /***/ 962: /***/ function ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) { + "use strict"; + + var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v, + }); + } + : function (o, v) { + o["default"] = v; + }); + var __importStar = + (this && this.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step( + (generator = generator.apply(thisArg, _arguments || [])).next(), + ); + }); + }; + var _a; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getCmdPath = + exports.tryGetExecutablePath = + exports.isRooted = + exports.isDirectory = + exports.exists = + exports.READONLY = + exports.UV_FS_O_EXLOCK = + exports.IS_WINDOWS = + exports.unlink = + exports.symlink = + exports.stat = + exports.rmdir = + exports.rm = + exports.rename = + exports.readlink = + exports.readdir = + exports.open = + exports.mkdir = + exports.lstat = + exports.copyFile = + exports.chmod = + void 0; + const fs = __importStar(__nccwpck_require__(147)); + const path = __importStar(__nccwpck_require__(17)); + (_a = fs.promises), + // export const {open} = 'fs' + (exports.chmod = _a.chmod), + (exports.copyFile = _a.copyFile), + (exports.lstat = _a.lstat), + (exports.mkdir = _a.mkdir), + (exports.open = _a.open), + (exports.readdir = _a.readdir), + (exports.readlink = _a.readlink), + (exports.rename = _a.rename), + (exports.rm = _a.rm), + (exports.rmdir = _a.rmdir), + (exports.stat = _a.stat), + (exports.symlink = _a.symlink), + (exports.unlink = _a.unlink); + // export const {open} = 'fs' + exports.IS_WINDOWS = process.platform === "win32"; + // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 + exports.UV_FS_O_EXLOCK = 0x10000000; + exports.READONLY = fs.constants.O_RDONLY; + function exists(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + try { yield exports.stat(fsPath); - } - catch (err) { - if (err.code === 'ENOENT') { - return false; + } catch (err) { + if (err.code === "ENOENT") { + return false; } throw err; + } + return true; + }); + } + exports.exists = exists; + function isDirectory(fsPath, useStat = false) { + return __awaiter(this, void 0, void 0, function* () { + const stats = useStat + ? yield exports.stat(fsPath) + : yield exports.lstat(fsPath); + return stats.isDirectory(); + }); + } + exports.isDirectory = isDirectory; + /** + * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: + * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). + */ + function isRooted(p) { + p = normalizeSeparators(p); + if (!p) { + throw new Error('isRooted() parameter "p" cannot be empty'); } - return true; - }); -} -exports.exists = exists; -function isDirectory(fsPath, useStat = false) { - return __awaiter(this, void 0, void 0, function* () { - const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); - return stats.isDirectory(); - }); -} -exports.isDirectory = isDirectory; -/** - * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: - * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). - */ -function isRooted(p) { - p = normalizeSeparators(p); - if (!p) { - throw new Error('isRooted() parameter "p" cannot be empty'); - } - if (exports.IS_WINDOWS) { - return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello - ); // e.g. C: or C:\hello - } - return p.startsWith('/'); -} -exports.isRooted = isRooted; -/** - * Best effort attempt to determine whether a file exists and is executable. - * @param filePath file path to check - * @param extensions additional file extensions to try - * @return if file exists and is executable, returns the file path. otherwise empty string. - */ -function tryGetExecutablePath(filePath, extensions) { - return __awaiter(this, void 0, void 0, function* () { - let stats = undefined; - try { + if (exports.IS_WINDOWS) { + return ( + p.startsWith("\\") || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello + ); // e.g. C: or C:\hello + } + return p.startsWith("/"); + } + exports.isRooted = isRooted; + /** + * Best effort attempt to determine whether a file exists and is executable. + * @param filePath file path to check + * @param extensions additional file extensions to try + * @return if file exists and is executable, returns the file path. otherwise empty string. + */ + function tryGetExecutablePath(filePath, extensions) { + return __awaiter(this, void 0, void 0, function* () { + let stats = undefined; + try { // test file exists stats = yield exports.stat(filePath); - } - catch (err) { - if (err.code !== 'ENOENT') { - // eslint-disable-next-line no-console - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } catch (err) { + if (err.code !== "ENOENT") { + // eslint-disable-next-line no-console + console.log( + `Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`, + ); } - } - if (stats && stats.isFile()) { + } + if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { - // on Windows, test for valid extension - const upperExt = path.extname(filePath).toUpperCase(); - if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { - return filePath; - } + // on Windows, test for valid extension + const upperExt = path.extname(filePath).toUpperCase(); + if ( + extensions.some( + (validExt) => validExt.toUpperCase() === upperExt, + ) + ) { + return filePath; + } + } else { + if (isUnixExecutable(stats)) { + return filePath; + } } - else { - if (isUnixExecutable(stats)) { - return filePath; - } - } - } - // try each extension - const originalFilePath = filePath; - for (const extension of extensions) { + } + // try each extension + const originalFilePath = filePath; + for (const extension of extensions) { filePath = originalFilePath + extension; stats = undefined; try { - stats = yield exports.stat(filePath); - } - catch (err) { - if (err.code !== 'ENOENT') { - // eslint-disable-next-line no-console - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } + stats = yield exports.stat(filePath); + } catch (err) { + if (err.code !== "ENOENT") { + // eslint-disable-next-line no-console + console.log( + `Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`, + ); + } } if (stats && stats.isFile()) { - if (exports.IS_WINDOWS) { - // preserve the case of the actual file (since an extension was appended) - try { - const directory = path.dirname(filePath); - const upperName = path.basename(filePath).toUpperCase(); - for (const actualName of yield exports.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path.join(directory, actualName); - break; - } - } - } - catch (err) { - // eslint-disable-next-line no-console - console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); + if (exports.IS_WINDOWS) { + // preserve the case of the actual file (since an extension was appended) + try { + const directory = path.dirname(filePath); + const upperName = path.basename(filePath).toUpperCase(); + for (const actualName of yield exports.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path.join(directory, actualName); + break; } - return filePath; + } + } catch (err) { + // eslint-disable-next-line no-console + console.log( + `Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`, + ); } - else { - if (isUnixExecutable(stats)) { - return filePath; - } + return filePath; + } else { + if (isUnixExecutable(stats)) { + return filePath; } + } } + } + return ""; + }); + } + exports.tryGetExecutablePath = tryGetExecutablePath; + function normalizeSeparators(p) { + p = p || ""; + if (exports.IS_WINDOWS) { + // convert slashes on Windows + p = p.replace(/\//g, "\\"); + // remove redundant slashes + return p.replace(/\\\\+/g, "\\"); } - return ''; - }); -} -exports.tryGetExecutablePath = tryGetExecutablePath; -function normalizeSeparators(p) { - p = p || ''; - if (exports.IS_WINDOWS) { - // convert slashes on Windows - p = p.replace(/\//g, '\\'); // remove redundant slashes - return p.replace(/\\\\+/g, '\\'); - } - // remove redundant slashes - return p.replace(/\/\/+/g, '/'); -} -// on Mac/Linux, test the execute bit -// R W X R W X R W X -// 256 128 64 32 16 8 4 2 1 -function isUnixExecutable(stats) { - return ((stats.mode & 1) > 0 || - ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || - ((stats.mode & 64) > 0 && stats.uid === process.getuid())); -} -// Get the path of cmd.exe in windows -function getCmdPath() { - var _a; - return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`; -} -exports.getCmdPath = getCmdPath; -//# sourceMappingURL=io-util.js.map - -/***/ }), - -/***/ 436: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; -const assert_1 = __nccwpck_require__(491); -const path = __importStar(__nccwpck_require__(17)); -const ioUtil = __importStar(__nccwpck_require__(962)); -/** - * Copies a file or folder. - * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js - * - * @param source source path - * @param dest destination path - * @param options optional. See CopyOptions. - */ -function cp(source, dest, options = {}) { - return __awaiter(this, void 0, void 0, function* () { - const { force, recursive, copySourceDirectory } = readCopyOptions(options); - const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; - // Dest is an existing file, but not forcing - if (destStat && destStat.isFile() && !force) { + return p.replace(/\/\/+/g, "/"); + } + // on Mac/Linux, test the execute bit + // R W X R W X R W X + // 256 128 64 32 16 8 4 2 1 + function isUnixExecutable(stats) { + return ( + (stats.mode & 1) > 0 || + ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || + ((stats.mode & 64) > 0 && stats.uid === process.getuid()) + ); + } + // Get the path of cmd.exe in windows + function getCmdPath() { + var _a; + return (_a = process.env["COMSPEC"]) !== null && _a !== void 0 + ? _a + : `cmd.exe`; + } + exports.getCmdPath = getCmdPath; + //# sourceMappingURL=io-util.js.map + + /***/ + }, + + /***/ 436: /***/ function ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) { + "use strict"; + + var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v, + }); + } + : function (o, v) { + o["default"] = v; + }); + var __importStar = + (this && this.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step( + (generator = generator.apply(thisArg, _arguments || [])).next(), + ); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findInPath = + exports.which = + exports.mkdirP = + exports.rmRF = + exports.mv = + exports.cp = + void 0; + const assert_1 = __nccwpck_require__(491); + const path = __importStar(__nccwpck_require__(17)); + const ioUtil = __importStar(__nccwpck_require__(962)); + /** + * Copies a file or folder. + * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js + * + * @param source source path + * @param dest destination path + * @param options optional. See CopyOptions. + */ + function cp(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + const { force, recursive, copySourceDirectory } = + readCopyOptions(options); + const destStat = (yield ioUtil.exists(dest)) + ? yield ioUtil.stat(dest) + : null; + // Dest is an existing file, but not forcing + if (destStat && destStat.isFile() && !force) { return; - } - // If dest is an existing directory, should copy inside. - const newDest = destStat && destStat.isDirectory() && copySourceDirectory - ? path.join(dest, path.basename(source)) - : dest; - if (!(yield ioUtil.exists(source))) { + } + // If dest is an existing directory, should copy inside. + const newDest = + destStat && destStat.isDirectory() && copySourceDirectory + ? path.join(dest, path.basename(source)) + : dest; + if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); - } - const sourceStat = yield ioUtil.stat(source); - if (sourceStat.isDirectory()) { + } + const sourceStat = yield ioUtil.stat(source); + if (sourceStat.isDirectory()) { if (!recursive) { - throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); - } - else { - yield cpDirRecursive(source, newDest, 0, force); + throw new Error( + `Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`, + ); + } else { + yield cpDirRecursive(source, newDest, 0, force); } - } - else { - if (path.relative(source, newDest) === '') { - // a file cannot be copied to itself - throw new Error(`'${newDest}' and '${source}' are the same file`); + } else { + if (path.relative(source, newDest) === "") { + // a file cannot be copied to itself + throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); - } - }); -} -exports.cp = cp; -/** - * Moves a path. - * - * @param source source path - * @param dest destination path - * @param options optional. See MoveOptions. - */ -function mv(source, dest, options = {}) { - return __awaiter(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { + } + }); + } + exports.cp = cp; + /** + * Moves a path. + * + * @param source source path + * @param dest destination path + * @param options optional. See MoveOptions. + */ + function mv(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - // If dest is directory copy src into dest - dest = path.join(dest, path.basename(source)); - destExists = yield ioUtil.exists(dest); + // If dest is directory copy src into dest + dest = path.join(dest, path.basename(source)); + destExists = yield ioUtil.exists(dest); } if (destExists) { - if (options.force == null || options.force) { - yield rmRF(dest); - } - else { - throw new Error('Destination already exists'); - } + if (options.force == null || options.force) { + yield rmRF(dest); + } else { + throw new Error("Destination already exists"); + } } - } - yield mkdirP(path.dirname(dest)); - yield ioUtil.rename(source, dest); - }); -} -exports.mv = mv; -/** - * Remove a path recursively with force - * - * @param inputPath path to remove - */ -function rmRF(inputPath) { - return __awaiter(this, void 0, void 0, function* () { - if (ioUtil.IS_WINDOWS) { + } + yield mkdirP(path.dirname(dest)); + yield ioUtil.rename(source, dest); + }); + } + exports.mv = mv; + /** + * Remove a path recursively with force + * + * @param inputPath path to remove + */ + function rmRF(inputPath) { + return __awaiter(this, void 0, void 0, function* () { + if (ioUtil.IS_WINDOWS) { // Check for invalid characters // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file if (/[*"<>|]/.test(inputPath)) { - throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + throw new Error( + 'File path must not contain `*`, `"`, `<`, `>` or `|` on Windows', + ); } - } - try { + } + try { // note if path does not exist, error is silent yield ioUtil.rm(inputPath, { - force: true, - maxRetries: 3, - recursive: true, - retryDelay: 300 + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300, }); - } - catch (err) { + } catch (err) { throw new Error(`File was unable to be removed ${err}`); - } - }); -} -exports.rmRF = rmRF; -/** - * Make a directory. Creates the full path with folders in between - * Will throw if it fails - * - * @param fsPath path to create - * @returns Promise - */ -function mkdirP(fsPath) { - return __awaiter(this, void 0, void 0, function* () { - assert_1.ok(fsPath, 'a path argument must be provided'); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); -} -exports.mkdirP = mkdirP; -/** - * Returns path of a tool had the tool actually been invoked. Resolves via paths. - * If you check and the tool does not exist, it will throw. - * - * @param tool name of the tool - * @param check whether to check if tool exists - * @returns Promise path to tool - */ -function which(tool, check) { - return __awaiter(this, void 0, void 0, function* () { - if (!tool) { + } + }); + } + exports.rmRF = rmRF; + /** + * Make a directory. Creates the full path with folders in between + * Will throw if it fails + * + * @param fsPath path to create + * @returns Promise + */ + function mkdirP(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + assert_1.ok(fsPath, "a path argument must be provided"); + yield ioUtil.mkdir(fsPath, { recursive: true }); + }); + } + exports.mkdirP = mkdirP; + /** + * Returns path of a tool had the tool actually been invoked. Resolves via paths. + * If you check and the tool does not exist, it will throw. + * + * @param tool name of the tool + * @param check whether to check if tool exists + * @returns Promise path to tool + */ + function which(tool, check) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { throw new Error("parameter 'tool' is required"); - } - // recursive when check=true - if (check) { + } + // recursive when check=true + if (check) { const result = yield which(tool, false); if (!result) { - if (ioUtil.IS_WINDOWS) { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); - } - else { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); - } + if (ioUtil.IS_WINDOWS) { + throw new Error( + `Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`, + ); + } else { + throw new Error( + `Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`, + ); + } } return result; - } - const matches = yield findInPath(tool); - if (matches && matches.length > 0) { - return matches[0]; - } - return ''; - }); -} -exports.which = which; -/** - * Returns a list of all occurrences of the given tool on the system path. - * - * @returns Promise the paths of the tool - */ -function findInPath(tool) { - return __awaiter(this, void 0, void 0, function* () { - if (!tool) { + } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ""; + }); + } + exports.which = which; + /** + * Returns a list of all occurrences of the given tool on the system path. + * + * @returns Promise the paths of the tool + */ + function findInPath(tool) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { throw new Error("parameter 'tool' is required"); - } - // build the list of extensions to try - const extensions = []; - if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { - for (const extension of process.env['PATHEXT'].split(path.delimiter)) { - if (extension) { - extensions.push(extension); - } + } + // build the list of extensions to try + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { + for (const extension of process.env["PATHEXT"].split( + path.delimiter, + )) { + if (extension) { + extensions.push(extension); + } } - } - // if it's rooted, return it if exists. otherwise return empty. - if (ioUtil.isRooted(tool)) { - const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + } + // if it's rooted, return it if exists. otherwise return empty. + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath( + tool, + extensions, + ); if (filePath) { - return [filePath]; + return [filePath]; } return []; - } - // if any path separators, return empty - if (tool.includes(path.sep)) { + } + // if any path separators, return empty + if (tool.includes(path.sep)) { return []; - } - // build the list of directories - // - // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, - // it feels like we should not do this. Checking the current directory seems like more of a use - // case of a shell, and the which() function exposed by the toolkit should strive for consistency - // across platforms. - const directories = []; - if (process.env.PATH) { + } + // build the list of directories + // + // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, + // it feels like we should not do this. Checking the current directory seems like more of a use + // case of a shell, and the which() function exposed by the toolkit should strive for consistency + // across platforms. + const directories = []; + if (process.env.PATH) { for (const p of process.env.PATH.split(path.delimiter)) { - if (p) { - directories.push(p); - } + if (p) { + directories.push(p); + } } - } - // find all matches - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); + } + // find all matches + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath( + path.join(directory, tool), + extensions, + ); if (filePath) { - matches.push(filePath); + matches.push(filePath); } - } - return matches; - }); -} -exports.findInPath = findInPath; -function readCopyOptions(options) { - const force = options.force == null ? true : options.force; - const recursive = Boolean(options.recursive); - const copySourceDirectory = options.copySourceDirectory == null - ? true - : Boolean(options.copySourceDirectory); - return { force, recursive, copySourceDirectory }; -} -function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter(this, void 0, void 0, function* () { - // Ensure there is not a run away recursive copy - if (currentDepth >= 255) - return; - currentDepth++; - yield mkdirP(destDir); - const files = yield ioUtil.readdir(sourceDir); - for (const fileName of files) { + } + return matches; + }); + } + exports.findInPath = findInPath; + function readCopyOptions(options) { + const force = options.force == null ? true : options.force; + const recursive = Boolean(options.recursive); + const copySourceDirectory = + options.copySourceDirectory == null + ? true + : Boolean(options.copySourceDirectory); + return { force, recursive, copySourceDirectory }; + } + function cpDirRecursive(sourceDir, destDir, currentDepth, force) { + return __awaiter(this, void 0, void 0, function* () { + // Ensure there is not a run away recursive copy + if (currentDepth >= 255) return; + currentDepth++; + yield mkdirP(destDir); + const files = yield ioUtil.readdir(sourceDir); + for (const fileName of files) { const srcFile = `${sourceDir}/${fileName}`; const destFile = `${destDir}/${fileName}`; const srcFileStat = yield ioUtil.lstat(srcFile); if (srcFileStat.isDirectory()) { - // Recurse - yield cpDirRecursive(srcFile, destFile, currentDepth, force); - } - else { - yield copyFile(srcFile, destFile, force); + // Recurse + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } else { + yield copyFile(srcFile, destFile, force); } - } - // Change the mode for the newly created directory - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); -} -// Buffered file copy -function copyFile(srcFile, destFile, force) { - return __awaiter(this, void 0, void 0, function* () { - if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { + } + // Change the mode for the newly created directory + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); + } + // Buffered file copy + function copyFile(srcFile, destFile, force) { + return __awaiter(this, void 0, void 0, function* () { + if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { // unlink/re-link it try { - yield ioUtil.lstat(destFile); + yield ioUtil.lstat(destFile); + yield ioUtil.unlink(destFile); + } catch (e) { + // Try to override file permission + if (e.code === "EPERM") { + yield ioUtil.chmod(destFile, "0666"); yield ioUtil.unlink(destFile); - } - catch (e) { - // Try to override file permission - if (e.code === 'EPERM') { - yield ioUtil.chmod(destFile, '0666'); - yield ioUtil.unlink(destFile); - } - // other errors = it doesn't exist, no work to do + } + // other errors = it doesn't exist, no work to do } // Copy over symlink const symlinkFull = yield ioUtil.readlink(srcFile); - yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); - } - else if (!(yield ioUtil.exists(destFile)) || force) { + yield ioUtil.symlink( + symlinkFull, + destFile, + ioUtil.IS_WINDOWS ? "junction" : null, + ); + } else if (!(yield ioUtil.exists(destFile)) || force) { yield ioUtil.copyFile(srcFile, destFile); - } - }); -} -//# sourceMappingURL=io.js.map - -/***/ }), - -/***/ 294: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = __nccwpck_require__(219); - - -/***/ }), - -/***/ 219: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var net = __nccwpck_require__(808); -var tls = __nccwpck_require__(404); -var http = __nccwpck_require__(685); -var https = __nccwpck_require__(687); -var events = __nccwpck_require__(361); -var assert = __nccwpck_require__(491); -var util = __nccwpck_require__(837); - - -exports.httpOverHttp = httpOverHttp; -exports.httpsOverHttp = httpsOverHttp; -exports.httpOverHttps = httpOverHttps; -exports.httpsOverHttps = httpsOverHttps; - - -function httpOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - return agent; -} - -function httpsOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; -} - -function httpOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https.request; - return agent; -} - -function httpsOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; -} - - -function TunnelingAgent(options) { - var self = this; - self.options = options || {}; - self.proxyOptions = self.options.proxy || {}; - self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; - self.requests = []; - self.sockets = []; - - self.on('free', function onFree(socket, host, port, localAddress) { - var options = toOptions(host, port, localAddress); - for (var i = 0, len = self.requests.length; i < len; ++i) { - var pending = self.requests[i]; - if (pending.host === options.host && pending.port === options.port) { - // Detect the request to connect same origin server, - // reuse the connection. - self.requests.splice(i, 1); - pending.request.onSocket(socket); - return; + } + }); } - } - socket.destroy(); - self.removeSocket(socket); - }); -} -util.inherits(TunnelingAgent, events.EventEmitter); - -TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { - var self = this; - var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress)); - - if (self.sockets.length >= this.maxSockets) { - // We are over limit so we'll add it to the queue. - self.requests.push(options); - return; - } - - // If we are under maxSockets create a new one. - self.createSocket(options, function(socket) { - socket.on('free', onFree); - socket.on('close', onCloseOrRemove); - socket.on('agentRemove', onCloseOrRemove); - req.onSocket(socket); - - function onFree() { - self.emit('free', socket, options); - } - - function onCloseOrRemove(err) { - self.removeSocket(socket); - socket.removeListener('free', onFree); - socket.removeListener('close', onCloseOrRemove); - socket.removeListener('agentRemove', onCloseOrRemove); - } - }); -}; - -TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { - var self = this; - var placeholder = {}; - self.sockets.push(placeholder); - - var connectOptions = mergeOptions({}, self.proxyOptions, { - method: 'CONNECT', - path: options.host + ':' + options.port, - agent: false, - headers: { - host: options.host + ':' + options.port - } - }); - if (options.localAddress) { - connectOptions.localAddress = options.localAddress; - } - if (connectOptions.proxyAuth) { - connectOptions.headers = connectOptions.headers || {}; - connectOptions.headers['Proxy-Authorization'] = 'Basic ' + - new Buffer(connectOptions.proxyAuth).toString('base64'); - } - - debug('making CONNECT request'); - var connectReq = self.request(connectOptions); - connectReq.useChunkedEncodingByDefault = false; // for v0.6 - connectReq.once('response', onResponse); // for v0.6 - connectReq.once('upgrade', onUpgrade); // for v0.6 - connectReq.once('connect', onConnect); // for v0.7 or later - connectReq.once('error', onError); - connectReq.end(); - - function onResponse(res) { - // Very hacky. This is necessary to avoid http-parser leaks. - res.upgrade = true; - } - - function onUpgrade(res, socket, head) { - // Hacky. - process.nextTick(function() { - onConnect(res, socket, head); - }); - } - - function onConnect(res, socket, head) { - connectReq.removeAllListeners(); - socket.removeAllListeners(); - - if (res.statusCode !== 200) { - debug('tunneling socket could not be established, statusCode=%d', - res.statusCode); - socket.destroy(); - var error = new Error('tunneling socket could not be established, ' + - 'statusCode=' + res.statusCode); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - return; - } - if (head.length > 0) { - debug('got illegal response body from proxy'); - socket.destroy(); - var error = new Error('got illegal response body from proxy'); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - return; - } - debug('tunneling connection has established'); - self.sockets[self.sockets.indexOf(placeholder)] = socket; - return cb(socket); - } - - function onError(cause) { - connectReq.removeAllListeners(); - - debug('tunneling socket could not be established, cause=%s\n', - cause.message, cause.stack); - var error = new Error('tunneling socket could not be established, ' + - 'cause=' + cause.message); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - } -}; - -TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { - var pos = this.sockets.indexOf(socket) - if (pos === -1) { - return; - } - this.sockets.splice(pos, 1); - - var pending = this.requests.shift(); - if (pending) { - // If we have pending requests and a socket gets closed a new one - // needs to be created to take over in the pool for the one that closed. - this.createSocket(pending, function(socket) { - pending.request.onSocket(socket); - }); - } -}; - -function createSecureSocket(options, cb) { - var self = this; - TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { - var hostHeader = options.request.getHeader('host'); - var tlsOptions = mergeOptions({}, self.options, { - socket: socket, - servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host - }); - - // 0 is dummy port for v0.6 - var secureSocket = tls.connect(0, tlsOptions); - self.sockets[self.sockets.indexOf(socket)] = secureSocket; - cb(secureSocket); - }); -} - - -function toOptions(host, port, localAddress) { - if (typeof host === 'string') { // since v0.10 - return { - host: host, - port: port, - localAddress: localAddress - }; - } - return host; // for v0.11 or later -} - -function mergeOptions(target) { - for (var i = 1, len = arguments.length; i < len; ++i) { - var overrides = arguments[i]; - if (typeof overrides === 'object') { - var keys = Object.keys(overrides); - for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { - var k = keys[j]; - if (overrides[k] !== undefined) { - target[k] = overrides[k]; - } + //# sourceMappingURL=io.js.map + + /***/ + }, + + /***/ 294: /***/ ( + module, + __unused_webpack_exports, + __nccwpck_require__, + ) => { + module.exports = __nccwpck_require__(219); + + /***/ + }, + + /***/ 219: /***/ ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) => { + "use strict"; + + var net = __nccwpck_require__(808); + var tls = __nccwpck_require__(404); + var http = __nccwpck_require__(685); + var https = __nccwpck_require__(687); + var events = __nccwpck_require__(361); + var assert = __nccwpck_require__(491); + var util = __nccwpck_require__(837); + + exports.httpOverHttp = httpOverHttp; + exports.httpsOverHttp = httpsOverHttp; + exports.httpOverHttps = httpOverHttps; + exports.httpsOverHttps = httpsOverHttps; + + function httpOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + return agent; } - } - } - return target; -} - - -var debug; -if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { - debug = function() { - var args = Array.prototype.slice.call(arguments); - if (typeof args[0] === 'string') { - args[0] = 'TUNNEL: ' + args[0]; - } else { - args.unshift('TUNNEL:'); - } - console.error.apply(console, args); - } -} else { - debug = function() {}; -} -exports.debug = debug; // for test - - -/***/ }), - -/***/ 840: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -Object.defineProperty(exports, "v1", ({ - enumerable: true, - get: function () { - return _v.default; - } -})); -Object.defineProperty(exports, "v3", ({ - enumerable: true, - get: function () { - return _v2.default; - } -})); -Object.defineProperty(exports, "v4", ({ - enumerable: true, - get: function () { - return _v3.default; - } -})); -Object.defineProperty(exports, "v5", ({ - enumerable: true, - get: function () { - return _v4.default; - } -})); -Object.defineProperty(exports, "NIL", ({ - enumerable: true, - get: function () { - return _nil.default; - } -})); -Object.defineProperty(exports, "version", ({ - enumerable: true, - get: function () { - return _version.default; - } -})); -Object.defineProperty(exports, "validate", ({ - enumerable: true, - get: function () { - return _validate.default; - } -})); -Object.defineProperty(exports, "stringify", ({ - enumerable: true, - get: function () { - return _stringify.default; - } -})); -Object.defineProperty(exports, "parse", ({ - enumerable: true, - get: function () { - return _parse.default; - } -})); -var _v = _interopRequireDefault(__nccwpck_require__(628)); + function httpsOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; + } -var _v2 = _interopRequireDefault(__nccwpck_require__(409)); + function httpOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + return agent; + } -var _v3 = _interopRequireDefault(__nccwpck_require__(122)); + function httpsOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; + } -var _v4 = _interopRequireDefault(__nccwpck_require__(120)); + function TunnelingAgent(options) { + var self = this; + self.options = options || {}; + self.proxyOptions = self.options.proxy || {}; + self.maxSockets = + self.options.maxSockets || http.Agent.defaultMaxSockets; + self.requests = []; + self.sockets = []; + + self.on("free", function onFree(socket, host, port, localAddress) { + var options = toOptions(host, port, localAddress); + for (var i = 0, len = self.requests.length; i < len; ++i) { + var pending = self.requests[i]; + if ( + pending.host === options.host && + pending.port === options.port + ) { + // Detect the request to connect same origin server, + // reuse the connection. + self.requests.splice(i, 1); + pending.request.onSocket(socket); + return; + } + } + socket.destroy(); + self.removeSocket(socket); + }); + } + util.inherits(TunnelingAgent, events.EventEmitter); + + TunnelingAgent.prototype.addRequest = function addRequest( + req, + host, + port, + localAddress, + ) { + var self = this; + var options = mergeOptions( + { request: req }, + self.options, + toOptions(host, port, localAddress), + ); + + if (self.sockets.length >= this.maxSockets) { + // We are over limit so we'll add it to the queue. + self.requests.push(options); + return; + } -var _nil = _interopRequireDefault(__nccwpck_require__(332)); + // If we are under maxSockets create a new one. + self.createSocket(options, function (socket) { + socket.on("free", onFree); + socket.on("close", onCloseOrRemove); + socket.on("agentRemove", onCloseOrRemove); + req.onSocket(socket); + + function onFree() { + self.emit("free", socket, options); + } + + function onCloseOrRemove(err) { + self.removeSocket(socket); + socket.removeListener("free", onFree); + socket.removeListener("close", onCloseOrRemove); + socket.removeListener("agentRemove", onCloseOrRemove); + } + }); + }; + + TunnelingAgent.prototype.createSocket = function createSocket( + options, + cb, + ) { + var self = this; + var placeholder = {}; + self.sockets.push(placeholder); + + var connectOptions = mergeOptions({}, self.proxyOptions, { + method: "CONNECT", + path: options.host + ":" + options.port, + agent: false, + headers: { + host: options.host + ":" + options.port, + }, + }); + if (options.localAddress) { + connectOptions.localAddress = options.localAddress; + } + if (connectOptions.proxyAuth) { + connectOptions.headers = connectOptions.headers || {}; + connectOptions.headers["Proxy-Authorization"] = + "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64"); + } -var _version = _interopRequireDefault(__nccwpck_require__(595)); + debug("making CONNECT request"); + var connectReq = self.request(connectOptions); + connectReq.useChunkedEncodingByDefault = false; // for v0.6 + connectReq.once("response", onResponse); // for v0.6 + connectReq.once("upgrade", onUpgrade); // for v0.6 + connectReq.once("connect", onConnect); // for v0.7 or later + connectReq.once("error", onError); + connectReq.end(); + + function onResponse(res) { + // Very hacky. This is necessary to avoid http-parser leaks. + res.upgrade = true; + } -var _validate = _interopRequireDefault(__nccwpck_require__(900)); + function onUpgrade(res, socket, head) { + // Hacky. + process.nextTick(function () { + onConnect(res, socket, head); + }); + } -var _stringify = _interopRequireDefault(__nccwpck_require__(950)); + function onConnect(res, socket, head) { + connectReq.removeAllListeners(); + socket.removeAllListeners(); + + if (res.statusCode !== 200) { + debug( + "tunneling socket could not be established, statusCode=%d", + res.statusCode, + ); + socket.destroy(); + var error = new Error( + "tunneling socket could not be established, " + + "statusCode=" + + res.statusCode, + ); + error.code = "ECONNRESET"; + options.request.emit("error", error); + self.removeSocket(placeholder); + return; + } + if (head.length > 0) { + debug("got illegal response body from proxy"); + socket.destroy(); + var error = new Error("got illegal response body from proxy"); + error.code = "ECONNRESET"; + options.request.emit("error", error); + self.removeSocket(placeholder); + return; + } + debug("tunneling connection has established"); + self.sockets[self.sockets.indexOf(placeholder)] = socket; + return cb(socket); + } -var _parse = _interopRequireDefault(__nccwpck_require__(746)); + function onError(cause) { + connectReq.removeAllListeners(); + + debug( + "tunneling socket could not be established, cause=%s\n", + cause.message, + cause.stack, + ); + var error = new Error( + "tunneling socket could not be established, " + + "cause=" + + cause.message, + ); + error.code = "ECONNRESET"; + options.request.emit("error", error); + self.removeSocket(placeholder); + } + }; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { + var pos = this.sockets.indexOf(socket); + if (pos === -1) { + return; + } + this.sockets.splice(pos, 1); + + var pending = this.requests.shift(); + if (pending) { + // If we have pending requests and a socket gets closed a new one + // needs to be created to take over in the pool for the one that closed. + this.createSocket(pending, function (socket) { + pending.request.onSocket(socket); + }); + } + }; + + function createSecureSocket(options, cb) { + var self = this; + TunnelingAgent.prototype.createSocket.call( + self, + options, + function (socket) { + var hostHeader = options.request.getHeader("host"); + var tlsOptions = mergeOptions({}, self.options, { + socket: socket, + servername: hostHeader + ? hostHeader.replace(/:.*$/, "") + : options.host, + }); -/***/ }), + // 0 is dummy port for v0.6 + var secureSocket = tls.connect(0, tlsOptions); + self.sockets[self.sockets.indexOf(socket)] = secureSocket; + cb(secureSocket); + }, + ); + } -/***/ 569: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + function toOptions(host, port, localAddress) { + if (typeof host === "string") { + // since v0.10 + return { + host: host, + port: port, + localAddress: localAddress, + }; + } + return host; // for v0.11 or later + } -"use strict"; + function mergeOptions(target) { + for (var i = 1, len = arguments.length; i < len; ++i) { + var overrides = arguments[i]; + if (typeof overrides === "object") { + var keys = Object.keys(overrides); + for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { + var k = keys[j]; + if (overrides[k] !== undefined) { + target[k] = overrides[k]; + } + } + } + } + return target; + } + var debug; + if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments); + if (typeof args[0] === "string") { + args[0] = "TUNNEL: " + args[0]; + } else { + args.unshift("TUNNEL:"); + } + console.error.apply(console, args); + }; + } else { + debug = function () {}; + } + exports.debug = debug; // for test + + /***/ + }, + + /***/ 840: /***/ ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) => { + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true, + }); + Object.defineProperty(exports, "v1", { + enumerable: true, + get: function () { + return _v.default; + }, + }); + Object.defineProperty(exports, "v3", { + enumerable: true, + get: function () { + return _v2.default; + }, + }); + Object.defineProperty(exports, "v4", { + enumerable: true, + get: function () { + return _v3.default; + }, + }); + Object.defineProperty(exports, "v5", { + enumerable: true, + get: function () { + return _v4.default; + }, + }); + Object.defineProperty(exports, "NIL", { + enumerable: true, + get: function () { + return _nil.default; + }, + }); + Object.defineProperty(exports, "version", { + enumerable: true, + get: function () { + return _version.default; + }, + }); + Object.defineProperty(exports, "validate", { + enumerable: true, + get: function () { + return _validate.default; + }, + }); + Object.defineProperty(exports, "stringify", { + enumerable: true, + get: function () { + return _stringify.default; + }, + }); + Object.defineProperty(exports, "parse", { + enumerable: true, + get: function () { + return _parse.default; + }, + }); + + var _v = _interopRequireDefault(__nccwpck_require__(628)); + + var _v2 = _interopRequireDefault(__nccwpck_require__(409)); + + var _v3 = _interopRequireDefault(__nccwpck_require__(122)); + + var _v4 = _interopRequireDefault(__nccwpck_require__(120)); + + var _nil = _interopRequireDefault(__nccwpck_require__(332)); + + var _version = _interopRequireDefault(__nccwpck_require__(595)); + + var _validate = _interopRequireDefault(__nccwpck_require__(900)); + + var _stringify = _interopRequireDefault(__nccwpck_require__(950)); + + var _parse = _interopRequireDefault(__nccwpck_require__(746)); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + /***/ + }, -var _crypto = _interopRequireDefault(__nccwpck_require__(113)); + /***/ 569: /***/ ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) => { + "use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; -function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } + var _crypto = _interopRequireDefault(__nccwpck_require__(113)); - return _crypto.default.createHash('md5').update(bytes).digest(); -} + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } -var _default = md5; -exports["default"] = _default; + function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === "string") { + bytes = Buffer.from(bytes, "utf8"); + } -/***/ }), + return _crypto.default.createHash("md5").update(bytes).digest(); + } -/***/ 332: -/***/ ((__unused_webpack_module, exports) => { + var _default = md5; + exports["default"] = _default; -"use strict"; + /***/ + }, + /***/ 332: /***/ (__unused_webpack_module, exports) => { + "use strict"; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _default = '00000000-0000-0000-0000-000000000000'; -exports["default"] = _default; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; + var _default = "00000000-0000-0000-0000-000000000000"; + exports["default"] = _default; -/***/ }), + /***/ + }, -/***/ 746: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + /***/ 746: /***/ ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) => { + "use strict"; -"use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; + var _validate = _interopRequireDefault(__nccwpck_require__(900)); -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } -var _validate = _interopRequireDefault(__nccwpck_require__(900)); + function parse(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError("Invalid UUID"); + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + let v; + const arr = new Uint8Array(16); // Parse ########-....-....-....-............ -function parse(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError('Invalid UUID'); - } + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = (v >>> 16) & 0xff; + arr[2] = (v >>> 8) & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ - let v; - const arr = new Uint8Array(16); // Parse ########-....-....-....-............ + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 0xff; - arr[2] = v >>> 8 & 0xff; - arr[3] = v & 0xff; // Parse ........-####-....-....-............ + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 0xff; // Parse ........-....-####-....-............ + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 0xff; // Parse ........-....-....-####-............ + arr[10] = + ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff; + arr[11] = (v / 0x100000000) & 0xff; + arr[12] = (v >>> 24) & 0xff; + arr[13] = (v >>> 16) & 0xff; + arr[14] = (v >>> 8) & 0xff; + arr[15] = v & 0xff; + return arr; + } - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 0xff; // Parse ........-....-....-....-############ - // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + var _default = parse; + exports["default"] = _default; - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; - arr[11] = v / 0x100000000 & 0xff; - arr[12] = v >>> 24 & 0xff; - arr[13] = v >>> 16 & 0xff; - arr[14] = v >>> 8 & 0xff; - arr[15] = v & 0xff; - return arr; -} + /***/ + }, -var _default = parse; -exports["default"] = _default; + /***/ 814: /***/ (__unused_webpack_module, exports) => { + "use strict"; -/***/ }), + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; + var _default = + /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; + exports["default"] = _default; -/***/ 814: -/***/ ((__unused_webpack_module, exports) => { + /***/ + }, -"use strict"; + /***/ 807: /***/ ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) => { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = rng; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; -exports["default"] = _default; + var _crypto = _interopRequireDefault(__nccwpck_require__(113)); -/***/ }), + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } -/***/ 807: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate -"use strict"; + let poolPtr = rnds8Pool.length; + function rng() { + if (poolPtr > rnds8Pool.length - 16) { + _crypto.default.randomFillSync(rnds8Pool); -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = rng; + poolPtr = 0; + } -var _crypto = _interopRequireDefault(__nccwpck_require__(113)); + return rnds8Pool.slice(poolPtr, (poolPtr += 16)); + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /***/ + }, -const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate + /***/ 274: /***/ ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) => { + "use strict"; -let poolPtr = rnds8Pool.length; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - _crypto.default.randomFillSync(rnds8Pool); + var _crypto = _interopRequireDefault(__nccwpck_require__(113)); - poolPtr = 0; - } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} + function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === "string") { + bytes = Buffer.from(bytes, "utf8"); + } -/***/ }), + return _crypto.default.createHash("sha1").update(bytes).digest(); + } -/***/ 274: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var _default = sha1; + exports["default"] = _default; -"use strict"; + /***/ + }, + /***/ 950: /***/ ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) => { + "use strict"; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; -var _crypto = _interopRequireDefault(__nccwpck_require__(113)); + var _validate = _interopRequireDefault(__nccwpck_require__(900)); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } -function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } + /** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ + const byteToHex = []; - return _crypto.default.createHash('sha1').update(bytes).digest(); -} + for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); + } -var _default = sha1; -exports["default"] = _default; + function stringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + const uuid = ( + byteToHex[arr[offset + 0]] + + byteToHex[arr[offset + 1]] + + byteToHex[arr[offset + 2]] + + byteToHex[arr[offset + 3]] + + "-" + + byteToHex[arr[offset + 4]] + + byteToHex[arr[offset + 5]] + + "-" + + byteToHex[arr[offset + 6]] + + byteToHex[arr[offset + 7]] + + "-" + + byteToHex[arr[offset + 8]] + + byteToHex[arr[offset + 9]] + + "-" + + byteToHex[arr[offset + 10]] + + byteToHex[arr[offset + 11]] + + byteToHex[arr[offset + 12]] + + byteToHex[arr[offset + 13]] + + byteToHex[arr[offset + 14]] + + byteToHex[arr[offset + 15]] + ).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!(0, _validate.default)(uuid)) { + throw TypeError("Stringified UUID is invalid"); + } -/***/ }), + return uuid; + } -/***/ 950: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var _default = stringify; + exports["default"] = _default; -"use strict"; + /***/ + }, + /***/ 628: /***/ ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) => { + "use strict"; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(900)); + var _rng = _interopRequireDefault(__nccwpck_require__(807)); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _stringify = _interopRequireDefault(__nccwpck_require__(950)); -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -const byteToHex = []; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).substr(1)); -} + // **`v1()` - Generate time-based UUID** + // + // Inspired by https://github.com/LiosK/UUID.js + // and http://docs.python.org/library/uuid.html + let _nodeId; -function stringify(arr, offset = 0) { - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields + let _clockseq; // Previous uuid creation time - if (!(0, _validate.default)(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } + let _lastMSecs = 0; + let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details - return uuid; -} + function v1(options, buf, offset) { + let i = (buf && offset) || 0; + const b = buf || new Array(16); + options = options || {}; + let node = options.node || _nodeId; + let clockseq = + options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + const seedBytes = options.random || (options.rng || _rng.default)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [ + seedBytes[0] | 0x01, + seedBytes[1], + seedBytes[2], + seedBytes[3], + seedBytes[4], + seedBytes[5], + ]; + } + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = + ((seedBytes[6] << 8) | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + let nsecs = + options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = (clockseq + 1) & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } -var _default = stringify; -exports["default"] = _default; + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch -/***/ }), + msecs += 12219292800000; // `time_low` -/***/ 628: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = (tl >>> 24) & 0xff; + b[i++] = (tl >>> 16) & 0xff; + b[i++] = (tl >>> 8) & 0xff; + b[i++] = tl & 0xff; // `time_mid` -"use strict"; + const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff; + b[i++] = (tmh >>> 8) & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + b[i++] = ((tmh >>> 24) & 0xf) | 0x10; // include version -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + b[i++] = (tmh >>> 16) & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) -var _rng = _interopRequireDefault(__nccwpck_require__(807)); + b[i++] = (clockseq >>> 8) | 0x80; // `clock_seq_low` -var _stringify = _interopRequireDefault(__nccwpck_require__(950)); + b[i++] = clockseq & 0xff; // `node` -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + for (let n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } -// **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html -let _nodeId; + return buf || (0, _stringify.default)(b); + } -let _clockseq; // Previous uuid creation time + var _default = v1; + exports["default"] = _default; + /***/ + }, -let _lastMSecs = 0; -let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + /***/ 409: /***/ ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) => { + "use strict"; -function v1(options, buf, offset) { - let i = buf && offset || 0; - const b = buf || new Array(16); - options = options || {}; - let node = options.node || _nodeId; - let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || _rng.default)(); + var _v = _interopRequireDefault(__nccwpck_require__(998)); - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } + var _md = _interopRequireDefault(__nccwpck_require__(569)); - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; - } - } // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + const v3 = (0, _v.default)("v3", 0x30, _md.default); + var _default = v3; + exports["default"] = _default; - let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock + /***/ + }, - let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + /***/ 998: /***/ ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) => { + "use strict"; - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = _default; + exports.URL = exports.DNS = void 0; - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval + var _stringify = _interopRequireDefault(__nccwpck_require__(950)); + var _parse = _interopRequireDefault(__nccwpck_require__(746)); - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } // Per 4.2.1.2 Throw error if too many uuids are requested + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } + const bytes = []; - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } - msecs += 12219292800000; // `time_low` + return bytes; + } - const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; // `time_mid` + const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; + exports.DNS = DNS; + const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; + exports.URL = URL; + + function _default(name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === "string") { + value = stringToBytes(value); + } + + if (typeof namespace === "string") { + namespace = (0, _parse.default)(namespace); + } + + if (namespace.length !== 16) { + throw TypeError( + "Namespace must be array-like (16 iterable integer values, 0-255)", + ); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + let bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = (bytes[6] & 0x0f) | version; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } - const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` + return buf; + } - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + return (0, _stringify.default)(bytes); + } // Function#name is not settable on some platforms (#270) - b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support - b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; + } - b[i++] = clockseq & 0xff; // `node` + /***/ + }, - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } + /***/ 122: /***/ ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) => { + "use strict"; - return buf || (0, _stringify.default)(b); -} + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; -var _default = v1; -exports["default"] = _default; + var _rng = _interopRequireDefault(__nccwpck_require__(807)); -/***/ }), + var _stringify = _interopRequireDefault(__nccwpck_require__(950)); -/***/ 409: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } -"use strict"; + function v4(options, buf, offset) { + options = options || {}; + const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; // Copy bytes to buffer, if provided -var _v = _interopRequireDefault(__nccwpck_require__(998)); + if (buf) { + offset = offset || 0; -var _md = _interopRequireDefault(__nccwpck_require__(569)); + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + return buf; + } -const v3 = (0, _v.default)('v3', 0x30, _md.default); -var _default = v3; -exports["default"] = _default; + return (0, _stringify.default)(rnds); + } -/***/ }), + var _default = v4; + exports["default"] = _default; -/***/ 998: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + /***/ + }, -"use strict"; + /***/ 120: /***/ ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) => { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -exports.URL = exports.DNS = void 0; + var _v = _interopRequireDefault(__nccwpck_require__(998)); -var _stringify = _interopRequireDefault(__nccwpck_require__(950)); + var _sha = _interopRequireDefault(__nccwpck_require__(274)); -var _parse = _interopRequireDefault(__nccwpck_require__(746)); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + const v5 = (0, _v.default)("v5", 0x50, _sha.default); + var _default = v5; + exports["default"] = _default; -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape + /***/ + }, - const bytes = []; + /***/ 900: /***/ ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) => { + "use strict"; - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; - return bytes; -} + var _regex = _interopRequireDefault(__nccwpck_require__(814)); -const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; -exports.DNS = DNS; -const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; -exports.URL = URL; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } -function _default(name, version, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - if (typeof value === 'string') { - value = stringToBytes(value); - } + function validate(uuid) { + return typeof uuid === "string" && _regex.default.test(uuid); + } - if (typeof namespace === 'string') { - namespace = (0, _parse.default)(namespace); - } + var _default = validate; + exports["default"] = _default; - if (namespace.length !== 16) { - throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); - } // Compute hash of namespace and value, Per 4.3 - // Future: Use spread syntax when supported on all platforms, e.g. `bytes = - // hashfunc([...namespace, ... value])` + /***/ + }, + /***/ 595: /***/ ( + __unused_webpack_module, + exports, + __nccwpck_require__, + ) => { + "use strict"; - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 0x0f | version; - bytes[8] = bytes[8] & 0x3f | 0x80; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; - if (buf) { - offset = offset || 0; + var _validate = _interopRequireDefault(__nccwpck_require__(900)); - for (let i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; } - return buf; - } - - return (0, _stringify.default)(bytes); - } // Function#name is not settable on some platforms (#270) - - - try { - generateUUID.name = name; // eslint-disable-next-line no-empty - } catch (err) {} // For CommonJS default export support - - - generateUUID.DNS = DNS; - generateUUID.URL = URL; - return generateUUID; -} + function version(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError("Invalid UUID"); + } -/***/ }), + return parseInt(uuid.substr(14, 1), 16); + } -/***/ 122: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var _default = version; + exports["default"] = _default; -"use strict"; + /***/ + }, + /***/ 713: /***/ ( + module, + __unused_webpack_exports, + __nccwpck_require__, + ) => { + const core = __nccwpck_require__(186); + const exec = __nccwpck_require__(514); -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + async function run() { + try { + const project = core.getInput("project", { required: true }); + const image = core.getInput("image", { required: true }); -var _rng = _interopRequireDefault(__nccwpck_require__(807)); + if (imageExists(image) === false) { + core.setFailed( + `Image ${image} does not exist in the local Docker daemon`, + ); + return; + } -var _stringify = _interopRequireDefault(__nccwpck_require__(950)); + const blueprint = await getBlueprint(project); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (blueprint?.project?.container === undefined) { + core.warning( + `Project ${project} does not have a container defined. Skipping publish`, + ); + return; + } else if (blueprint?.global?.ci?.tagging?.strategy === undefined) { + core.warning( + `The repository does not have a tagging strategy defined. Skipping publish`, + ); + return; + } else if ( + blueprint?.global?.ci?.registries === undefined || + blueprint?.global?.ci?.registries.length === 0 + ) { + core.warning( + `The repository does not have any registries defined. Skipping publish`, + ); + return; + } -function v4(options, buf, offset) { - options = options || {}; + const container = blueprint.project.container; + const registries = blueprint.global.ci.registries; + const tag = getTag(blueprint.global.ci.tagging.strategy); - const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + for (const registry of registries) { + const taggedImage = `${registry}/${container}:${tag}`; + core.info(`Tagging image ${image} as ${taggedImage}`); + await tagImage(image, taggedImage); - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + core.info(`Pushing image ${taggedImage}`); + await pushImage(taggedImage); + } + } catch (error) { + core.setFailed(error.message); + } + } - if (buf) { - offset = offset || 0; + module.exports = { + run, + }; + + /** + * + * @param {string} project The name of the project to get the blueprint for + * @returns {object} The blueprint object + */ + async function getBlueprint(project) { + let result = await exec.getExecOutput("forge", [ + "blueprint", + "dump", + project, + ]); + return JSON.parse(result.stdout); + } - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } + /** + * Get the tag to use for the Docker image from the tagging strategy + * @param {string} strategy The tagging strategy to use + * @returns {string} The tag to use + */ + function getTag(strategy) { + switch (strategy) { + case "commit": { + return strategyCommit(); + } + default: { + throw new Error(`Unknown tagging strategy: ${strategy}`); + } + } + } - return buf; - } + /** + * Check if a Docker image exists + * @param {string} name The name of the image to check + * @return {boolean} True if the image exists, false otherwise + */ + async function imageExists(name) { + const result = await exec.exec("docker", ["inspect", name], { + ignoreReturnCode: true, + silent: true, + }); - return (0, _stringify.default)(rnds); -} + console.log(`Result: ${result}`); -var _default = v4; -exports["default"] = _default; + return result === 0; + } -/***/ }), + /*** + * Push a Docker image to a registry + */ + async function pushImage(image) { + await exec.exec("docker", ["push", image]); + } -/***/ 120: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + /** + * The "commit" tagging strategy + * @returns {string} The commit hash + */ + function strategyCommit() { + return process.env.GITHUB_SHA; + } -"use strict"; + /** + * Tag a Docker image + * @param {string} oldImage The old image name + * @param {string} newImage The new image name + */ + async function tagImage(oldImage, newImage) { + await exec.exec("docker", ["tag", oldImage, newImage]); + } + /***/ + }, -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + /***/ 491: /***/ (module) => { + "use strict"; + module.exports = require("assert"); -var _v = _interopRequireDefault(__nccwpck_require__(998)); + /***/ + }, -var _sha = _interopRequireDefault(__nccwpck_require__(274)); + /***/ 81: /***/ (module) => { + "use strict"; + module.exports = require("child_process"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /***/ + }, -const v5 = (0, _v.default)('v5', 0x50, _sha.default); -var _default = v5; -exports["default"] = _default; + /***/ 113: /***/ (module) => { + "use strict"; + module.exports = require("crypto"); -/***/ }), + /***/ + }, -/***/ 900: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + /***/ 361: /***/ (module) => { + "use strict"; + module.exports = require("events"); -"use strict"; + /***/ + }, + /***/ 147: /***/ (module) => { + "use strict"; + module.exports = require("fs"); -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + /***/ + }, -var _regex = _interopRequireDefault(__nccwpck_require__(814)); + /***/ 685: /***/ (module) => { + "use strict"; + module.exports = require("http"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /***/ + }, -function validate(uuid) { - return typeof uuid === 'string' && _regex.default.test(uuid); -} + /***/ 687: /***/ (module) => { + "use strict"; + module.exports = require("https"); -var _default = validate; -exports["default"] = _default; + /***/ + }, -/***/ }), + /***/ 808: /***/ (module) => { + "use strict"; + module.exports = require("net"); -/***/ 595: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + /***/ + }, -"use strict"; + /***/ 37: /***/ (module) => { + "use strict"; + module.exports = require("os"); + /***/ + }, -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + /***/ 17: /***/ (module) => { + "use strict"; + module.exports = require("path"); -var _validate = _interopRequireDefault(__nccwpck_require__(900)); + /***/ + }, -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /***/ 576: /***/ (module) => { + "use strict"; + module.exports = require("string_decoder"); -function version(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError('Invalid UUID'); - } + /***/ + }, - return parseInt(uuid.substr(14, 1), 16); -} + /***/ 512: /***/ (module) => { + "use strict"; + module.exports = require("timers"); -var _default = version; -exports["default"] = _default; + /***/ + }, -/***/ }), + /***/ 404: /***/ (module) => { + "use strict"; + module.exports = require("tls"); -/***/ 713: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /***/ + }, -const core = __nccwpck_require__(186); -const exec = __nccwpck_require__(514); + /***/ 837: /***/ (module) => { + "use strict"; + module.exports = require("util"); -async function run() { - try { - const project = core.getInput("project", { required: true }); - const image = core.getInput("image", { required: true }); + /***/ + }, - if (imageExists(image) === false) { - core.setFailed( - `Image ${image} does not exist in the local Docker daemon`, - ); - return; + /******/ + }; + /************************************************************************/ + /******/ // The module cache + /******/ var __webpack_module_cache__ = {}; + /******/ + /******/ // The require function + /******/ function __nccwpck_require__(moduleId) { + /******/ // Check if module is in cache + /******/ var cachedModule = __webpack_module_cache__[moduleId]; + /******/ if (cachedModule !== undefined) { + /******/ return cachedModule.exports; + /******/ } - - const blueprint = await getBlueprint(project); - - if (blueprint?.project?.container === undefined) { - core.warning( - `Project ${project} does not have a container defined. Skipping publish`, - ); - return; - } else if (blueprint?.global?.ci?.tagging?.strategy === undefined) { - core.warning( - `The repository does not have a tagging strategy defined. Skipping publish`, - ); - return; - } else if ( - blueprint?.global?.ci?.registries === undefined || - blueprint?.global?.ci?.registries.length === 0 - ) { - core.warning( - `The repository does not have any registries defined. Skipping publish`, + /******/ // Create a new module (and put it into the cache) + /******/ var module = (__webpack_module_cache__[moduleId] = { + /******/ // no module.id needed + /******/ // no module.loaded needed + /******/ exports: {}, + /******/ + }); + /******/ + /******/ // Execute the module function + /******/ var threw = true; + /******/ try { + /******/ __webpack_modules__[moduleId].call( + module.exports, + module, + module.exports, + __nccwpck_require__, ); - return; - } - - const container = blueprint.project.container; - const registries = blueprint.global.ci.registries; - const tag = getTag(blueprint.global.ci.tagging.strategy); - - for (const registry of registries) { - const taggedImage = `${registry}/${container}:${tag}`; - - core.info(`Tagging image ${image} as ${taggedImage}`); - await tagImage(image, taggedImage); - - core.info(`Pushing image ${taggedImage}`); - await pushImage(taggedImage); - } - } catch (error) { - core.setFailed(error.message); - } -} - -module.exports = { - run, -}; - -/** - * - * @param {string} project The name of the project to get the blueprint for - * @returns {object} The blueprint object - */ -async function getBlueprint(project) { - let result = await exec.getExecOutput("forge", [ - "blueprint", - "dump", - project, - ]); - return JSON.parse(result.stdout); -} - -/** - * Get the tag to use for the Docker image from the tagging strategy - * @param {string} strategy The tagging strategy to use - * @returns {string} The tag to use - */ -function getTag(strategy) { - switch (strategy) { - case "commit": { - return strategyCommit(); - } - default: { - throw new Error(`Unknown tagging strategy: ${strategy}`); - } + /******/ threw = false; + /******/ + } finally { + /******/ if (threw) delete __webpack_module_cache__[moduleId]; + /******/ + } + /******/ + /******/ // Return the exports of the module + /******/ return module.exports; + /******/ } -} - -/** - * Check if a Docker image exists - * @param {string} name The name of the image to check - * @return {boolean} True if the image exists, false otherwise - */ -async function imageExists(name) { - const result = await exec.exec("docker", ["inspect", name], { - ignoreReturnCode: true, - silent: true, - }); - - console.log(`Result: ${result}`); - - return result === 0; -} - -/*** - * Push a Docker image to a registry - */ -async function pushImage(image) { - await exec.exec("docker", ["push", image]); -} - -/** - * The "commit" tagging strategy - * @returns {string} The commit hash - */ -function strategyCommit() { - return process.env.GITHUB_SHA; -} - -/** - * Tag a Docker image - * @param {string} oldImage The old image name - * @param {string} newImage The new image name - */ -async function tagImage(oldImage, newImage) { - await exec.exec("docker", ["tag", oldImage, newImage]); -} - - -/***/ }), - -/***/ 491: -/***/ ((module) => { - -"use strict"; -module.exports = require("assert"); - -/***/ }), - -/***/ 81: -/***/ ((module) => { - -"use strict"; -module.exports = require("child_process"); - -/***/ }), - -/***/ 113: -/***/ ((module) => { - -"use strict"; -module.exports = require("crypto"); - -/***/ }), - -/***/ 361: -/***/ ((module) => { - -"use strict"; -module.exports = require("events"); - -/***/ }), - -/***/ 147: -/***/ ((module) => { - -"use strict"; -module.exports = require("fs"); - -/***/ }), - -/***/ 685: -/***/ ((module) => { - -"use strict"; -module.exports = require("http"); - -/***/ }), - -/***/ 687: -/***/ ((module) => { - -"use strict"; -module.exports = require("https"); - -/***/ }), - -/***/ 808: -/***/ ((module) => { - -"use strict"; -module.exports = require("net"); - -/***/ }), - -/***/ 37: -/***/ ((module) => { - -"use strict"; -module.exports = require("os"); - -/***/ }), - -/***/ 17: -/***/ ((module) => { - -"use strict"; -module.exports = require("path"); - -/***/ }), - -/***/ 576: -/***/ ((module) => { - -"use strict"; -module.exports = require("string_decoder"); - -/***/ }), - -/***/ 512: -/***/ ((module) => { - -"use strict"; -module.exports = require("timers"); - -/***/ }), - -/***/ 404: -/***/ ((module) => { - -"use strict"; -module.exports = require("tls"); - -/***/ }), - -/***/ 837: -/***/ ((module) => { - -"use strict"; -module.exports = require("util"); - -/***/ }) + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat */ + /******/ + /******/ if (typeof __nccwpck_require__ !== "undefined") + __nccwpck_require__.ab = __dirname + "/"; + /******/ + /************************************************************************/ + var __webpack_exports__ = {}; + // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. + (() => { + /** + * The entrypoint for the action. + */ + const { run } = __nccwpck_require__(713); -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __nccwpck_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ var threw = true; -/******/ try { -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__); -/******/ threw = false; -/******/ } finally { -/******/ if(threw) delete __webpack_module_cache__[moduleId]; -/******/ } -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat */ -/******/ -/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/"; -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. -(() => { -/** - * The entrypoint for the action. - */ -const { run } = __nccwpck_require__(713); - -run(); + run(); + })(); + module.exports = __webpack_exports__; + /******/ })(); - -module.exports = __webpack_exports__; -/******/ })() -; -//# sourceMappingURL=index.js.map \ No newline at end of file +//# sourceMappingURL=index.js.map diff --git a/forge/actions/publish/dist/sourcemap-register.js b/forge/actions/publish/dist/sourcemap-register.js index 466141d..3b96536 100644 --- a/forge/actions/publish/dist/sourcemap-register.js +++ b/forge/actions/publish/dist/sourcemap-register.js @@ -1 +1,2351 @@ -(()=>{var e={650:e=>{var r=Object.prototype.toString;var n=typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return r.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,r,t){r>>>=0;var o=e.byteLength-r;if(o<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=o}else{t>>>=0;if(t>o){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(r,r+t)):new Buffer(new Uint8Array(e.slice(r,r+t)))}function fromString(e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,r):new Buffer(e,r)}function bufferFrom(e,r,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,r,t)}if(typeof e==="string"){return fromString(e,r)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},274:(e,r,n)=>{var t=n(339);var o=Object.prototype.hasOwnProperty;var i=typeof Map!=="undefined";function ArraySet(){this._array=[];this._set=i?new Map:Object.create(null)}ArraySet.fromArray=function ArraySet_fromArray(e,r){var n=new ArraySet;for(var t=0,o=e.length;t=0){return r}}else{var n=t.toSetString(e);if(o.call(this._set,n)){return this._set[n]}}throw new Error('"'+e+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(e){if(e>=0&&e{var t=n(190);var o=5;var i=1<>1;return r?-n:n}r.encode=function base64VLQ_encode(e){var r="";var n;var i=toVLQSigned(e);do{n=i&a;i>>>=o;if(i>0){n|=u}r+=t.encode(n)}while(i>0);return r};r.decode=function base64VLQ_decode(e,r,n){var i=e.length;var s=0;var l=0;var c,p;do{if(r>=i){throw new Error("Expected more digits in base 64 VLQ value.")}p=t.decode(e.charCodeAt(r++));if(p===-1){throw new Error("Invalid base64 digit: "+e.charAt(r-1))}c=!!(p&u);p&=a;s=s+(p<{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(e){if(0<=e&&e{r.GREATEST_LOWER_BOUND=1;r.LEAST_UPPER_BOUND=2;function recursiveSearch(e,n,t,o,i,a){var u=Math.floor((n-e)/2)+e;var s=i(t,o[u],true);if(s===0){return u}else if(s>0){if(n-u>1){return recursiveSearch(u,n,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return n1){return recursiveSearch(e,u,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return u}else{return e<0?-1:e}}}r.search=function search(e,n,t,o){if(n.length===0){return-1}var i=recursiveSearch(-1,n.length,e,n,t,o||r.GREATEST_LOWER_BOUND);if(i<0){return-1}while(i-1>=0){if(t(n[i],n[i-1],true)!==0){break}--i}return i}},680:(e,r,n)=>{var t=n(339);function generatedPositionAfter(e,r){var n=e.generatedLine;var o=r.generatedLine;var i=e.generatedColumn;var a=r.generatedColumn;return o>n||o==n&&a>=i||t.compareByGeneratedPositionsInflated(e,r)<=0}function MappingList(){this._array=[];this._sorted=true;this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(e,r){this._array.forEach(e,r)};MappingList.prototype.add=function MappingList_add(e){if(generatedPositionAfter(this._last,e)){this._last=e;this._array.push(e)}else{this._sorted=false;this._array.push(e)}};MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(t.compareByGeneratedPositionsInflated);this._sorted=true}return this._array};r.H=MappingList},758:(e,r)=>{function swap(e,r,n){var t=e[r];e[r]=e[n];e[n]=t}function randomIntInRange(e,r){return Math.round(e+Math.random()*(r-e))}function doQuickSort(e,r,n,t){if(n{var t;var o=n(339);var i=n(345);var a=n(274).I;var u=n(449);var s=n(758).U;function SourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}return n.sections!=null?new IndexedSourceMapConsumer(n,r):new BasicSourceMapConsumer(n,r)}SourceMapConsumer.fromSourceMap=function(e,r){return BasicSourceMapConsumer.fromSourceMap(e,r)};SourceMapConsumer.prototype._version=3;SourceMapConsumer.prototype.__generatedMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{configurable:true,enumerable:true,get:function(){if(!this.__generatedMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});SourceMapConsumer.prototype.__originalMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{configurable:true,enumerable:true,get:function(){if(!this.__originalMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});SourceMapConsumer.prototype._charIsMappingSeparator=function SourceMapConsumer_charIsMappingSeparator(e,r){var n=e.charAt(r);return n===";"||n===","};SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(e,r){throw new Error("Subclasses must implement _parseMappings")};SourceMapConsumer.GENERATED_ORDER=1;SourceMapConsumer.ORIGINAL_ORDER=2;SourceMapConsumer.GREATEST_LOWER_BOUND=1;SourceMapConsumer.LEAST_UPPER_BOUND=2;SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(e,r,n){var t=r||null;var i=n||SourceMapConsumer.GENERATED_ORDER;var a;switch(i){case SourceMapConsumer.GENERATED_ORDER:a=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;a.map((function(e){var r=e.source===null?null:this._sources.at(e.source);r=o.computeSourceURL(u,r,this._sourceMapURL);return{source:r,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:e.name===null?null:this._names.at(e.name)}}),this).forEach(e,t)};SourceMapConsumer.prototype.allGeneratedPositionsFor=function SourceMapConsumer_allGeneratedPositionsFor(e){var r=o.getArg(e,"line");var n={source:o.getArg(e,"source"),originalLine:r,originalColumn:o.getArg(e,"column",0)};n.source=this._findSourceIndex(n.source);if(n.source<0){return[]}var t=[];var a=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,i.LEAST_UPPER_BOUND);if(a>=0){var u=this._originalMappings[a];if(e.column===undefined){var s=u.originalLine;while(u&&u.originalLine===s){t.push({line:o.getArg(u,"generatedLine",null),column:o.getArg(u,"generatedColumn",null),lastColumn:o.getArg(u,"lastGeneratedColumn",null)});u=this._originalMappings[++a]}}else{var l=u.originalColumn;while(u&&u.originalLine===r&&u.originalColumn==l){t.push({line:o.getArg(u,"generatedLine",null),column:o.getArg(u,"generatedColumn",null),lastColumn:o.getArg(u,"lastGeneratedColumn",null)});u=this._originalMappings[++a]}}}return t};r.SourceMapConsumer=SourceMapConsumer;function BasicSourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}var t=o.getArg(n,"version");var i=o.getArg(n,"sources");var u=o.getArg(n,"names",[]);var s=o.getArg(n,"sourceRoot",null);var l=o.getArg(n,"sourcesContent",null);var c=o.getArg(n,"mappings");var p=o.getArg(n,"file",null);if(t!=this._version){throw new Error("Unsupported version: "+t)}if(s){s=o.normalize(s)}i=i.map(String).map(o.normalize).map((function(e){return s&&o.isAbsolute(s)&&o.isAbsolute(e)?o.relative(s,e):e}));this._names=a.fromArray(u.map(String),true);this._sources=a.fromArray(i,true);this._absoluteSources=this._sources.toArray().map((function(e){return o.computeSourceURL(s,e,r)}));this.sourceRoot=s;this.sourcesContent=l;this._mappings=c;this._sourceMapURL=r;this.file=p}BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype);BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer;BasicSourceMapConsumer.prototype._findSourceIndex=function(e){var r=e;if(this.sourceRoot!=null){r=o.relative(this.sourceRoot,r)}if(this._sources.has(r)){return this._sources.indexOf(r)}var n;for(n=0;n1){v.source=l+_[1];l+=_[1];v.originalLine=i+_[2];i=v.originalLine;v.originalLine+=1;v.originalColumn=a+_[3];a=v.originalColumn;if(_.length>4){v.name=c+_[4];c+=_[4]}}m.push(v);if(typeof v.originalLine==="number"){d.push(v)}}}s(m,o.compareByGeneratedPositionsDeflated);this.__generatedMappings=m;s(d,o.compareByOriginalPositions);this.__originalMappings=d};BasicSourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(e,r,n,t,o,a){if(e[n]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+e[n])}if(e[t]<0){throw new TypeError("Column must be greater than or equal to 0, got "+e[t])}return i.search(e,r,o,a)};BasicSourceMapConsumer.prototype.computeColumnSpans=function SourceMapConsumer_computeColumnSpans(){for(var e=0;e=0){var t=this._generatedMappings[n];if(t.generatedLine===r.generatedLine){var i=o.getArg(t,"source",null);if(i!==null){i=this._sources.at(i);i=o.computeSourceURL(this.sourceRoot,i,this._sourceMapURL)}var a=o.getArg(t,"name",null);if(a!==null){a=this._names.at(a)}return{source:i,line:o.getArg(t,"originalLine",null),column:o.getArg(t,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function BasicSourceMapConsumer_hasContentsOfAllSources(){if(!this.sourcesContent){return false}return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return e==null}))};BasicSourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(e,r){if(!this.sourcesContent){return null}var n=this._findSourceIndex(e);if(n>=0){return this.sourcesContent[n]}var t=e;if(this.sourceRoot!=null){t=o.relative(this.sourceRoot,t)}var i;if(this.sourceRoot!=null&&(i=o.urlParse(this.sourceRoot))){var a=t.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(a)){return this.sourcesContent[this._sources.indexOf(a)]}if((!i.path||i.path=="/")&&this._sources.has("/"+t)){return this.sourcesContent[this._sources.indexOf("/"+t)]}}if(r){return null}else{throw new Error('"'+t+'" is not in the SourceMap.')}};BasicSourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(e){var r=o.getArg(e,"source");r=this._findSourceIndex(r);if(r<0){return{line:null,column:null,lastColumn:null}}var n={source:r,originalLine:o.getArg(e,"line"),originalColumn:o.getArg(e,"column")};var t=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,o.getArg(e,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(t>=0){var i=this._originalMappings[t];if(i.source===n.source){return{line:o.getArg(i,"generatedLine",null),column:o.getArg(i,"generatedColumn",null),lastColumn:o.getArg(i,"lastGeneratedColumn",null)}}}return{line:null,column:null,lastColumn:null}};t=BasicSourceMapConsumer;function IndexedSourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}var t=o.getArg(n,"version");var i=o.getArg(n,"sections");if(t!=this._version){throw new Error("Unsupported version: "+t)}this._sources=new a;this._names=new a;var u={line:-1,column:0};this._sections=i.map((function(e){if(e.url){throw new Error("Support for url field in sections not implemented.")}var n=o.getArg(e,"offset");var t=o.getArg(n,"line");var i=o.getArg(n,"column");if(t{var t=n(449);var o=n(339);var i=n(274).I;var a=n(680).H;function SourceMapGenerator(e){if(!e){e={}}this._file=o.getArg(e,"file",null);this._sourceRoot=o.getArg(e,"sourceRoot",null);this._skipValidation=o.getArg(e,"skipValidation",false);this._sources=new i;this._names=new i;this._mappings=new a;this._sourcesContents=null}SourceMapGenerator.prototype._version=3;SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(e){var r=e.sourceRoot;var n=new SourceMapGenerator({file:e.file,sourceRoot:r});e.eachMapping((function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};if(e.source!=null){t.source=e.source;if(r!=null){t.source=o.relative(r,t.source)}t.original={line:e.originalLine,column:e.originalColumn};if(e.name!=null){t.name=e.name}}n.addMapping(t)}));e.sources.forEach((function(t){var i=t;if(r!==null){i=o.relative(r,t)}if(!n._sources.has(i)){n._sources.add(i)}var a=e.sourceContentFor(t);if(a!=null){n.setSourceContent(t,a)}}));return n};SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(e){var r=o.getArg(e,"generated");var n=o.getArg(e,"original",null);var t=o.getArg(e,"source",null);var i=o.getArg(e,"name",null);if(!this._skipValidation){this._validateMapping(r,n,t,i)}if(t!=null){t=String(t);if(!this._sources.has(t)){this._sources.add(t)}}if(i!=null){i=String(i);if(!this._names.has(i)){this._names.add(i)}}this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:t,name:i})};SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(e,r){var n=e;if(this._sourceRoot!=null){n=o.relative(this._sourceRoot,n)}if(r!=null){if(!this._sourcesContents){this._sourcesContents=Object.create(null)}this._sourcesContents[o.toSetString(n)]=r}else if(this._sourcesContents){delete this._sourcesContents[o.toSetString(n)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(e,r,n){var t=r;if(r==null){if(e.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}t=e.file}var a=this._sourceRoot;if(a!=null){t=o.relative(a,t)}var u=new i;var s=new i;this._mappings.unsortedForEach((function(r){if(r.source===t&&r.originalLine!=null){var i=e.originalPositionFor({line:r.originalLine,column:r.originalColumn});if(i.source!=null){r.source=i.source;if(n!=null){r.source=o.join(n,r.source)}if(a!=null){r.source=o.relative(a,r.source)}r.originalLine=i.line;r.originalColumn=i.column;if(i.name!=null){r.name=i.name}}}var l=r.source;if(l!=null&&!u.has(l)){u.add(l)}var c=r.name;if(c!=null&&!s.has(c)){s.add(c)}}),this);this._sources=u;this._names=s;e.sources.forEach((function(r){var t=e.sourceContentFor(r);if(t!=null){if(n!=null){r=o.join(n,r)}if(a!=null){r=o.relative(a,r)}this.setSourceContent(r,t)}}),this)};SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(e,r,n,t){if(r&&typeof r.line!=="number"&&typeof r.column!=="number"){throw new Error("original.line and original.column are not numbers -- you probably meant to omit "+"the original mapping entirely and only map the generated position. If so, pass "+"null for the original mapping instead of an object with empty or null values.")}if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!t){return}else if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:t}))}};SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){var e=0;var r=1;var n=0;var i=0;var a=0;var u=0;var s="";var l;var c;var p;var f;var g=this._mappings.toArray();for(var h=0,d=g.length;h0){if(!o.compareByGeneratedPositionsInflated(c,g[h-1])){continue}l+=","}}l+=t.encode(c.generatedColumn-e);e=c.generatedColumn;if(c.source!=null){f=this._sources.indexOf(c.source);l+=t.encode(f-u);u=f;l+=t.encode(c.originalLine-1-i);i=c.originalLine-1;l+=t.encode(c.originalColumn-n);n=c.originalColumn;if(c.name!=null){p=this._names.indexOf(c.name);l+=t.encode(p-a);a=p}}s+=l}return s};SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(e,r){return e.map((function(e){if(!this._sourcesContents){return null}if(r!=null){e=o.relative(r,e)}var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)};SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){e.file=this._file}if(this._sourceRoot!=null){e.sourceRoot=this._sourceRoot}if(this._sourcesContents){e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)}return e};SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON())};r.h=SourceMapGenerator},351:(e,r,n)=>{var t;var o=n(591).h;var i=n(339);var a=/(\r?\n)/;var u=10;var s="$$$isSourceNode$$$";function SourceNode(e,r,n,t,o){this.children=[];this.sourceContents={};this.line=e==null?null:e;this.column=r==null?null:r;this.source=n==null?null:n;this.name=o==null?null:o;this[s]=true;if(t!=null)this.add(t)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(e,r,n){var t=new SourceNode;var o=e.split(a);var u=0;var shiftNextLine=function(){var e=getNextLine();var r=getNextLine()||"";return e+r;function getNextLine(){return u=0;r--){this.prepend(e[r])}}else if(e[s]||typeof e==="string"){this.children.unshift(e)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};SourceNode.prototype.walk=function SourceNode_walk(e){var r;for(var n=0,t=this.children.length;n0){r=[];for(n=0;n{function getArg(e,r,n){if(r in e){return e[r]}else if(arguments.length===3){return n}else{throw new Error('"'+r+'" is a required argument.')}}r.getArg=getArg;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;var t=/^data:.+\,.+$/;function urlParse(e){var r=e.match(n);if(!r){return null}return{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}}r.urlParse=urlParse;function urlGenerate(e){var r="";if(e.scheme){r+=e.scheme+":"}r+="//";if(e.auth){r+=e.auth+"@"}if(e.host){r+=e.host}if(e.port){r+=":"+e.port}if(e.path){r+=e.path}return r}r.urlGenerate=urlGenerate;function normalize(e){var n=e;var t=urlParse(e);if(t){if(!t.path){return e}n=t.path}var o=r.isAbsolute(n);var i=n.split(/\/+/);for(var a,u=0,s=i.length-1;s>=0;s--){a=i[s];if(a==="."){i.splice(s,1)}else if(a===".."){u++}else if(u>0){if(a===""){i.splice(s+1,u);u=0}else{i.splice(s,2);u--}}}n=i.join("/");if(n===""){n=o?"/":"."}if(t){t.path=n;return urlGenerate(t)}return n}r.normalize=normalize;function join(e,r){if(e===""){e="."}if(r===""){r="."}var n=urlParse(r);var o=urlParse(e);if(o){e=o.path||"/"}if(n&&!n.scheme){if(o){n.scheme=o.scheme}return urlGenerate(n)}if(n||r.match(t)){return r}if(o&&!o.host&&!o.path){o.host=r;return urlGenerate(o)}var i=r.charAt(0)==="/"?r:normalize(e.replace(/\/+$/,"")+"/"+r);if(o){o.path=i;return urlGenerate(o)}return i}r.join=join;r.isAbsolute=function(e){return e.charAt(0)==="/"||n.test(e)};function relative(e,r){if(e===""){e="."}e=e.replace(/\/$/,"");var n=0;while(r.indexOf(e+"/")!==0){var t=e.lastIndexOf("/");if(t<0){return r}e=e.slice(0,t);if(e.match(/^([^\/]+:\/)?\/*$/)){return r}++n}return Array(n+1).join("../")+r.substr(e.length+1)}r.relative=relative;var o=function(){var e=Object.create(null);return!("__proto__"in e)}();function identity(e){return e}function toSetString(e){if(isProtoString(e)){return"$"+e}return e}r.toSetString=o?identity:toSetString;function fromSetString(e){if(isProtoString(e)){return e.slice(1)}return e}r.fromSetString=o?identity:fromSetString;function isProtoString(e){if(!e){return false}var r=e.length;if(r<9){return false}if(e.charCodeAt(r-1)!==95||e.charCodeAt(r-2)!==95||e.charCodeAt(r-3)!==111||e.charCodeAt(r-4)!==116||e.charCodeAt(r-5)!==111||e.charCodeAt(r-6)!==114||e.charCodeAt(r-7)!==112||e.charCodeAt(r-8)!==95||e.charCodeAt(r-9)!==95){return false}for(var n=r-10;n>=0;n--){if(e.charCodeAt(n)!==36){return false}}return true}function compareByOriginalPositions(e,r,n){var t=strcmp(e.source,r.source);if(t!==0){return t}t=e.originalLine-r.originalLine;if(t!==0){return t}t=e.originalColumn-r.originalColumn;if(t!==0||n){return t}t=e.generatedColumn-r.generatedColumn;if(t!==0){return t}t=e.generatedLine-r.generatedLine;if(t!==0){return t}return strcmp(e.name,r.name)}r.compareByOriginalPositions=compareByOriginalPositions;function compareByGeneratedPositionsDeflated(e,r,n){var t=e.generatedLine-r.generatedLine;if(t!==0){return t}t=e.generatedColumn-r.generatedColumn;if(t!==0||n){return t}t=strcmp(e.source,r.source);if(t!==0){return t}t=e.originalLine-r.originalLine;if(t!==0){return t}t=e.originalColumn-r.originalColumn;if(t!==0){return t}return strcmp(e.name,r.name)}r.compareByGeneratedPositionsDeflated=compareByGeneratedPositionsDeflated;function strcmp(e,r){if(e===r){return 0}if(e===null){return 1}if(r===null){return-1}if(e>r){return 1}return-1}function compareByGeneratedPositionsInflated(e,r){var n=e.generatedLine-r.generatedLine;if(n!==0){return n}n=e.generatedColumn-r.generatedColumn;if(n!==0){return n}n=strcmp(e.source,r.source);if(n!==0){return n}n=e.originalLine-r.originalLine;if(n!==0){return n}n=e.originalColumn-r.originalColumn;if(n!==0){return n}return strcmp(e.name,r.name)}r.compareByGeneratedPositionsInflated=compareByGeneratedPositionsInflated;function parseSourceMapInput(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}r.parseSourceMapInput=parseSourceMapInput;function computeSourceURL(e,r,n){r=r||"";if(e){if(e[e.length-1]!=="/"&&r[0]!=="/"){e+="/"}r=e+r}if(n){var t=urlParse(n);if(!t){throw new Error("sourceMapURL could not be parsed")}if(t.path){var o=t.path.lastIndexOf("/");if(o>=0){t.path=t.path.substring(0,o+1)}}r=join(urlGenerate(t),r)}return normalize(r)}r.computeSourceURL=computeSourceURL},997:(e,r,n)=>{n(591).h;r.SourceMapConsumer=n(952).SourceMapConsumer;n(351)},284:(e,r,n)=>{e=n.nmd(e);var t=n(997).SourceMapConsumer;var o=n(17);var i;try{i=n(147);if(!i.existsSync||!i.readFileSync){i=null}}catch(e){}var a=n(650);function dynamicRequire(e,r){return e.require(r)}var u=false;var s=false;var l=false;var c="auto";var p={};var f={};var g=/^data:application\/json[^,]+base64,/;var h=[];var d=[];function isInBrowser(){if(c==="browser")return true;if(c==="node")return false;return typeof window!=="undefined"&&typeof XMLHttpRequest==="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function hasGlobalProcessEventEmitter(){return typeof process==="object"&&process!==null&&typeof process.on==="function"}function globalProcessVersion(){if(typeof process==="object"&&process!==null){return process.version}else{return""}}function globalProcessStderr(){if(typeof process==="object"&&process!==null){return process.stderr}}function globalProcessExit(e){if(typeof process==="object"&&process!==null&&typeof process.exit==="function"){return process.exit(e)}}function handlerExec(e){return function(r){for(var n=0;n"}var n=this.getLineNumber();if(n!=null){r+=":"+n;var t=this.getColumnNumber();if(t){r+=":"+t}}}var o="";var i=this.getFunctionName();var a=true;var u=this.isConstructor();var s=!(this.isToplevel()||u);if(s){var l=this.getTypeName();if(l==="[object Object]"){l="null"}var c=this.getMethodName();if(i){if(l&&i.indexOf(l)!=0){o+=l+"."}o+=i;if(c&&i.indexOf("."+c)!=i.length-c.length-1){o+=" [as "+c+"]"}}else{o+=l+"."+(c||"")}}else if(u){o+="new "+(i||"")}else if(i){o+=i}else{o+=r;a=false}if(a){o+=" ("+r+")"}return o}function cloneCallSite(e){var r={};Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(n){r[n]=/^(?:is|get)/.test(n)?function(){return e[n].call(e)}:e[n]}));r.toString=CallSiteToString;return r}function wrapCallSite(e,r){if(r===undefined){r={nextPosition:null,curPosition:null}}if(e.isNative()){r.curPosition=null;return e}var n=e.getFileName()||e.getScriptNameOrSourceURL();if(n){var t=e.getLineNumber();var o=e.getColumnNumber()-1;var i=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;var a=i.test(globalProcessVersion())?0:62;if(t===1&&o>a&&!isInBrowser()&&!e.isEval()){o-=a}var u=mapSourcePosition({source:n,line:t,column:o});r.curPosition=u;e=cloneCallSite(e);var s=e.getFunctionName;e.getFunctionName=function(){if(r.nextPosition==null){return s()}return r.nextPosition.name||s()};e.getFileName=function(){return u.source};e.getLineNumber=function(){return u.line};e.getColumnNumber=function(){return u.column+1};e.getScriptNameOrSourceURL=function(){return u.source};return e}var l=e.isEval()&&e.getEvalOrigin();if(l){l=mapEvalOrigin(l);e=cloneCallSite(e);e.getEvalOrigin=function(){return l};return e}return e}function prepareStackTrace(e,r){if(l){p={};f={}}var n=e.name||"Error";var t=e.message||"";var o=n+": "+t;var i={nextPosition:null,curPosition:null};var a=[];for(var u=r.length-1;u>=0;u--){a.push("\n at "+wrapCallSite(r[u],i));i.nextPosition=i.curPosition}i.curPosition=i.nextPosition=null;return o+a.reverse().join("")}function getErrorSource(e){var r=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(e.stack);if(r){var n=r[1];var t=+r[2];var o=+r[3];var a=p[n];if(!a&&i&&i.existsSync(n)){try{a=i.readFileSync(n,"utf8")}catch(e){a=""}}if(a){var u=a.split(/(?:\r\n|\r|\n)/)[t-1];if(u){return n+":"+t+"\n"+u+"\n"+new Array(o).join(" ")+"^"}}}return null}function printErrorAndExit(e){var r=getErrorSource(e);var n=globalProcessStderr();if(n&&n._handle&&n._handle.setBlocking){n._handle.setBlocking(true)}if(r){console.error();console.error(r)}console.error(e.stack);globalProcessExit(1)}function shimEmitUncaughtException(){var e=process.emit;process.emit=function(r){if(r==="uncaughtException"){var n=arguments[1]&&arguments[1].stack;var t=this.listeners(r).length>0;if(n&&!t){return printErrorAndExit(arguments[1])}}return e.apply(this,arguments)}}var S=h.slice(0);var _=d.slice(0);r.wrapCallSite=wrapCallSite;r.getErrorSource=getErrorSource;r.mapSourcePosition=mapSourcePosition;r.retrieveSourceMap=v;r.install=function(r){r=r||{};if(r.environment){c=r.environment;if(["node","browser","auto"].indexOf(c)===-1){throw new Error("environment "+c+" was unknown. Available options are {auto, browser, node}")}}if(r.retrieveFile){if(r.overrideRetrieveFile){h.length=0}h.unshift(r.retrieveFile)}if(r.retrieveSourceMap){if(r.overrideRetrieveSourceMap){d.length=0}d.unshift(r.retrieveSourceMap)}if(r.hookRequire&&!isInBrowser()){var n=dynamicRequire(e,"module");var t=n.prototype._compile;if(!t.__sourceMapSupport){n.prototype._compile=function(e,r){p[r]=e;f[r]=undefined;return t.call(this,e,r)};n.prototype._compile.__sourceMapSupport=true}}if(!l){l="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:false}if(!u){u=true;Error.prepareStackTrace=prepareStackTrace}if(!s){var o="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:true;try{var i=dynamicRequire(e,"worker_threads");if(i.isMainThread===false){o=false}}catch(e){}if(o&&hasGlobalProcessEventEmitter()){s=true;shimEmitUncaughtException()}}};r.resetRetrieveHandlers=function(){h.length=0;d.length=0;h=S.slice(0);d=_.slice(0);v=handlerExec(d);m=handlerExec(h)}},147:e=>{"use strict";e.exports=require("fs")},17:e=>{"use strict";e.exports=require("path")}};var r={};function __webpack_require__(n){var t=r[n];if(t!==undefined){return t.exports}var o=r[n]={id:n,loaded:false,exports:{}};var i=true;try{e[n](o,o.exports,__webpack_require__);i=false}finally{if(i)delete r[n]}o.loaded=true;return o.exports}(()=>{__webpack_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __webpack_require__!=="undefined")__webpack_require__.ab=__dirname+"/";var n={};(()=>{__webpack_require__(284).install()})();module.exports=n})(); \ No newline at end of file +(() => { + var e = { + 650: (e) => { + var r = Object.prototype.toString; + var n = + typeof Buffer.alloc === "function" && + typeof Buffer.allocUnsafe === "function" && + typeof Buffer.from === "function"; + function isArrayBuffer(e) { + return r.call(e).slice(8, -1) === "ArrayBuffer"; + } + function fromArrayBuffer(e, r, t) { + r >>>= 0; + var o = e.byteLength - r; + if (o < 0) { + throw new RangeError("'offset' is out of bounds"); + } + if (t === undefined) { + t = o; + } else { + t >>>= 0; + if (t > o) { + throw new RangeError("'length' is out of bounds"); + } + } + return n + ? Buffer.from(e.slice(r, r + t)) + : new Buffer(new Uint8Array(e.slice(r, r + t))); + } + function fromString(e, r) { + if (typeof r !== "string" || r === "") { + r = "utf8"; + } + if (!Buffer.isEncoding(r)) { + throw new TypeError('"encoding" must be a valid string encoding'); + } + return n ? Buffer.from(e, r) : new Buffer(e, r); + } + function bufferFrom(e, r, t) { + if (typeof e === "number") { + throw new TypeError('"value" argument must not be a number'); + } + if (isArrayBuffer(e)) { + return fromArrayBuffer(e, r, t); + } + if (typeof e === "string") { + return fromString(e, r); + } + return n ? Buffer.from(e) : new Buffer(e); + } + e.exports = bufferFrom; + }, + 274: (e, r, n) => { + var t = n(339); + var o = Object.prototype.hasOwnProperty; + var i = typeof Map !== "undefined"; + function ArraySet() { + this._array = []; + this._set = i ? new Map() : Object.create(null); + } + ArraySet.fromArray = function ArraySet_fromArray(e, r) { + var n = new ArraySet(); + for (var t = 0, o = e.length; t < o; t++) { + n.add(e[t], r); + } + return n; + }; + ArraySet.prototype.size = function ArraySet_size() { + return i + ? this._set.size + : Object.getOwnPropertyNames(this._set).length; + }; + ArraySet.prototype.add = function ArraySet_add(e, r) { + var n = i ? e : t.toSetString(e); + var a = i ? this.has(e) : o.call(this._set, n); + var u = this._array.length; + if (!a || r) { + this._array.push(e); + } + if (!a) { + if (i) { + this._set.set(e, u); + } else { + this._set[n] = u; + } + } + }; + ArraySet.prototype.has = function ArraySet_has(e) { + if (i) { + return this._set.has(e); + } else { + var r = t.toSetString(e); + return o.call(this._set, r); + } + }; + ArraySet.prototype.indexOf = function ArraySet_indexOf(e) { + if (i) { + var r = this._set.get(e); + if (r >= 0) { + return r; + } + } else { + var n = t.toSetString(e); + if (o.call(this._set, n)) { + return this._set[n]; + } + } + throw new Error('"' + e + '" is not in the set.'); + }; + ArraySet.prototype.at = function ArraySet_at(e) { + if (e >= 0 && e < this._array.length) { + return this._array[e]; + } + throw new Error("No element indexed by " + e); + }; + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + r.I = ArraySet; + }, + 449: (e, r, n) => { + var t = n(190); + var o = 5; + var i = 1 << o; + var a = i - 1; + var u = i; + function toVLQSigned(e) { + return e < 0 ? (-e << 1) + 1 : (e << 1) + 0; + } + function fromVLQSigned(e) { + var r = (e & 1) === 1; + var n = e >> 1; + return r ? -n : n; + } + r.encode = function base64VLQ_encode(e) { + var r = ""; + var n; + var i = toVLQSigned(e); + do { + n = i & a; + i >>>= o; + if (i > 0) { + n |= u; + } + r += t.encode(n); + } while (i > 0); + return r; + }; + r.decode = function base64VLQ_decode(e, r, n) { + var i = e.length; + var s = 0; + var l = 0; + var c, p; + do { + if (r >= i) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + p = t.decode(e.charCodeAt(r++)); + if (p === -1) { + throw new Error("Invalid base64 digit: " + e.charAt(r - 1)); + } + c = !!(p & u); + p &= a; + s = s + (p << l); + l += o; + } while (c); + n.value = fromVLQSigned(s); + n.rest = r; + }; + }, + 190: (e, r) => { + var n = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split( + "", + ); + r.encode = function (e) { + if (0 <= e && e < n.length) { + return n[e]; + } + throw new TypeError("Must be between 0 and 63: " + e); + }; + r.decode = function (e) { + var r = 65; + var n = 90; + var t = 97; + var o = 122; + var i = 48; + var a = 57; + var u = 43; + var s = 47; + var l = 26; + var c = 52; + if (r <= e && e <= n) { + return e - r; + } + if (t <= e && e <= o) { + return e - t + l; + } + if (i <= e && e <= a) { + return e - i + c; + } + if (e == u) { + return 62; + } + if (e == s) { + return 63; + } + return -1; + }; + }, + 345: (e, r) => { + r.GREATEST_LOWER_BOUND = 1; + r.LEAST_UPPER_BOUND = 2; + function recursiveSearch(e, n, t, o, i, a) { + var u = Math.floor((n - e) / 2) + e; + var s = i(t, o[u], true); + if (s === 0) { + return u; + } else if (s > 0) { + if (n - u > 1) { + return recursiveSearch(u, n, t, o, i, a); + } + if (a == r.LEAST_UPPER_BOUND) { + return n < o.length ? n : -1; + } else { + return u; + } + } else { + if (u - e > 1) { + return recursiveSearch(e, u, t, o, i, a); + } + if (a == r.LEAST_UPPER_BOUND) { + return u; + } else { + return e < 0 ? -1 : e; + } + } + } + r.search = function search(e, n, t, o) { + if (n.length === 0) { + return -1; + } + var i = recursiveSearch( + -1, + n.length, + e, + n, + t, + o || r.GREATEST_LOWER_BOUND, + ); + if (i < 0) { + return -1; + } + while (i - 1 >= 0) { + if (t(n[i], n[i - 1], true) !== 0) { + break; + } + --i; + } + return i; + }; + }, + 680: (e, r, n) => { + var t = n(339); + function generatedPositionAfter(e, r) { + var n = e.generatedLine; + var o = r.generatedLine; + var i = e.generatedColumn; + var a = r.generatedColumn; + return ( + o > n || + (o == n && a >= i) || + t.compareByGeneratedPositionsInflated(e, r) <= 0 + ); + } + function MappingList() { + this._array = []; + this._sorted = true; + this._last = { generatedLine: -1, generatedColumn: 0 }; + } + MappingList.prototype.unsortedForEach = function MappingList_forEach( + e, + r, + ) { + this._array.forEach(e, r); + }; + MappingList.prototype.add = function MappingList_add(e) { + if (generatedPositionAfter(this._last, e)) { + this._last = e; + this._array.push(e); + } else { + this._sorted = false; + this._array.push(e); + } + }; + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(t.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + r.H = MappingList; + }, + 758: (e, r) => { + function swap(e, r, n) { + var t = e[r]; + e[r] = e[n]; + e[n] = t; + } + function randomIntInRange(e, r) { + return Math.round(e + Math.random() * (r - e)); + } + function doQuickSort(e, r, n, t) { + if (n < t) { + var o = randomIntInRange(n, t); + var i = n - 1; + swap(e, o, t); + var a = e[t]; + for (var u = n; u < t; u++) { + if (r(e[u], a) <= 0) { + i += 1; + swap(e, i, u); + } + } + swap(e, i + 1, u); + var s = i + 1; + doQuickSort(e, r, n, s - 1); + doQuickSort(e, r, s + 1, t); + } + } + r.U = function (e, r) { + doQuickSort(e, r, 0, e.length - 1); + }; + }, + 952: (e, r, n) => { + var t; + var o = n(339); + var i = n(345); + var a = n(274).I; + var u = n(449); + var s = n(758).U; + function SourceMapConsumer(e, r) { + var n = e; + if (typeof e === "string") { + n = o.parseSourceMapInput(e); + } + return n.sections != null + ? new IndexedSourceMapConsumer(n, r) + : new BasicSourceMapConsumer(n, r); + } + SourceMapConsumer.fromSourceMap = function (e, r) { + return BasicSourceMapConsumer.fromSourceMap(e, r); + }; + SourceMapConsumer.prototype._version = 3; + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + return this.__generatedMappings; + }, + }); + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + return this.__originalMappings; + }, + }); + SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(e, r) { + var n = e.charAt(r); + return n === ";" || n === ","; + }; + SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(e, r) { + throw new Error("Subclasses must implement _parseMappings"); + }; + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(e, r, n) { + var t = r || null; + var i = n || SourceMapConsumer.GENERATED_ORDER; + var a; + switch (i) { + case SourceMapConsumer.GENERATED_ORDER: + a = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + a = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + var u = this.sourceRoot; + a.map(function (e) { + var r = e.source === null ? null : this._sources.at(e.source); + r = o.computeSourceURL(u, r, this._sourceMapURL); + return { + source: r, + generatedLine: e.generatedLine, + generatedColumn: e.generatedColumn, + originalLine: e.originalLine, + originalColumn: e.originalColumn, + name: e.name === null ? null : this._names.at(e.name), + }; + }, this).forEach(e, t); + }; + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(e) { + var r = o.getArg(e, "line"); + var n = { + source: o.getArg(e, "source"), + originalLine: r, + originalColumn: o.getArg(e, "column", 0), + }; + n.source = this._findSourceIndex(n.source); + if (n.source < 0) { + return []; + } + var t = []; + var a = this._findMapping( + n, + this._originalMappings, + "originalLine", + "originalColumn", + o.compareByOriginalPositions, + i.LEAST_UPPER_BOUND, + ); + if (a >= 0) { + var u = this._originalMappings[a]; + if (e.column === undefined) { + var s = u.originalLine; + while (u && u.originalLine === s) { + t.push({ + line: o.getArg(u, "generatedLine", null), + column: o.getArg(u, "generatedColumn", null), + lastColumn: o.getArg(u, "lastGeneratedColumn", null), + }); + u = this._originalMappings[++a]; + } + } else { + var l = u.originalColumn; + while (u && u.originalLine === r && u.originalColumn == l) { + t.push({ + line: o.getArg(u, "generatedLine", null), + column: o.getArg(u, "generatedColumn", null), + lastColumn: o.getArg(u, "lastGeneratedColumn", null), + }); + u = this._originalMappings[++a]; + } + } + } + return t; + }; + r.SourceMapConsumer = SourceMapConsumer; + function BasicSourceMapConsumer(e, r) { + var n = e; + if (typeof e === "string") { + n = o.parseSourceMapInput(e); + } + var t = o.getArg(n, "version"); + var i = o.getArg(n, "sources"); + var u = o.getArg(n, "names", []); + var s = o.getArg(n, "sourceRoot", null); + var l = o.getArg(n, "sourcesContent", null); + var c = o.getArg(n, "mappings"); + var p = o.getArg(n, "file", null); + if (t != this._version) { + throw new Error("Unsupported version: " + t); + } + if (s) { + s = o.normalize(s); + } + i = i + .map(String) + .map(o.normalize) + .map(function (e) { + return s && o.isAbsolute(s) && o.isAbsolute(e) + ? o.relative(s, e) + : e; + }); + this._names = a.fromArray(u.map(String), true); + this._sources = a.fromArray(i, true); + this._absoluteSources = this._sources.toArray().map(function (e) { + return o.computeSourceURL(s, e, r); + }); + this.sourceRoot = s; + this.sourcesContent = l; + this._mappings = c; + this._sourceMapURL = r; + this.file = p; + } + BasicSourceMapConsumer.prototype = Object.create( + SourceMapConsumer.prototype, + ); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + BasicSourceMapConsumer.prototype._findSourceIndex = function (e) { + var r = e; + if (this.sourceRoot != null) { + r = o.relative(this.sourceRoot, r); + } + if (this._sources.has(r)) { + return this._sources.indexOf(r); + } + var n; + for (n = 0; n < this._absoluteSources.length; ++n) { + if (this._absoluteSources[n] == e) { + return n; + } + } + return -1; + }; + BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(e, r) { + var n = Object.create(BasicSourceMapConsumer.prototype); + var t = (n._names = a.fromArray(e._names.toArray(), true)); + var i = (n._sources = a.fromArray(e._sources.toArray(), true)); + n.sourceRoot = e._sourceRoot; + n.sourcesContent = e._generateSourcesContent( + n._sources.toArray(), + n.sourceRoot, + ); + n.file = e._file; + n._sourceMapURL = r; + n._absoluteSources = n._sources.toArray().map(function (e) { + return o.computeSourceURL(n.sourceRoot, e, r); + }); + var u = e._mappings.toArray().slice(); + var l = (n.__generatedMappings = []); + var c = (n.__originalMappings = []); + for (var p = 0, f = u.length; p < f; p++) { + var g = u[p]; + var h = new Mapping(); + h.generatedLine = g.generatedLine; + h.generatedColumn = g.generatedColumn; + if (g.source) { + h.source = i.indexOf(g.source); + h.originalLine = g.originalLine; + h.originalColumn = g.originalColumn; + if (g.name) { + h.name = t.indexOf(g.name); + } + c.push(h); + } + l.push(h); + } + s(n.__originalMappings, o.compareByOriginalPositions); + return n; + }; + BasicSourceMapConsumer.prototype._version = 3; + Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", { + get: function () { + return this._absoluteSources.slice(); + }, + }); + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(e, r) { + var n = 1; + var t = 0; + var i = 0; + var a = 0; + var l = 0; + var c = 0; + var p = e.length; + var f = 0; + var g = {}; + var h = {}; + var d = []; + var m = []; + var v, S, _, C, y; + while (f < p) { + if (e.charAt(f) === ";") { + n++; + f++; + t = 0; + } else if (e.charAt(f) === ",") { + f++; + } else { + v = new Mapping(); + v.generatedLine = n; + for (C = f; C < p; C++) { + if (this._charIsMappingSeparator(e, C)) { + break; + } + } + S = e.slice(f, C); + _ = g[S]; + if (_) { + f += S.length; + } else { + _ = []; + while (f < C) { + u.decode(e, f, h); + y = h.value; + f = h.rest; + _.push(y); + } + if (_.length === 2) { + throw new Error("Found a source, but no line and column"); + } + if (_.length === 3) { + throw new Error("Found a source and line, but no column"); + } + g[S] = _; + } + v.generatedColumn = t + _[0]; + t = v.generatedColumn; + if (_.length > 1) { + v.source = l + _[1]; + l += _[1]; + v.originalLine = i + _[2]; + i = v.originalLine; + v.originalLine += 1; + v.originalColumn = a + _[3]; + a = v.originalColumn; + if (_.length > 4) { + v.name = c + _[4]; + c += _[4]; + } + } + m.push(v); + if (typeof v.originalLine === "number") { + d.push(v); + } + } + } + s(m, o.compareByGeneratedPositionsDeflated); + this.__generatedMappings = m; + s(d, o.compareByOriginalPositions); + this.__originalMappings = d; + }; + BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(e, r, n, t, o, a) { + if (e[n] <= 0) { + throw new TypeError( + "Line must be greater than or equal to 1, got " + e[n], + ); + } + if (e[t] < 0) { + throw new TypeError( + "Column must be greater than or equal to 0, got " + e[t], + ); + } + return i.search(e, r, o, a); + }; + BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var e = 0; e < this._generatedMappings.length; ++e) { + var r = this._generatedMappings[e]; + if (e + 1 < this._generatedMappings.length) { + var n = this._generatedMappings[e + 1]; + if (r.generatedLine === n.generatedLine) { + r.lastGeneratedColumn = n.generatedColumn - 1; + continue; + } + } + r.lastGeneratedColumn = Infinity; + } + }; + BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(e) { + var r = { + generatedLine: o.getArg(e, "line"), + generatedColumn: o.getArg(e, "column"), + }; + var n = this._findMapping( + r, + this._generatedMappings, + "generatedLine", + "generatedColumn", + o.compareByGeneratedPositionsDeflated, + o.getArg(e, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND), + ); + if (n >= 0) { + var t = this._generatedMappings[n]; + if (t.generatedLine === r.generatedLine) { + var i = o.getArg(t, "source", null); + if (i !== null) { + i = this._sources.at(i); + i = o.computeSourceURL(this.sourceRoot, i, this._sourceMapURL); + } + var a = o.getArg(t, "name", null); + if (a !== null) { + a = this._names.at(a); + } + return { + source: i, + line: o.getArg(t, "originalLine", null), + column: o.getArg(t, "originalColumn", null), + name: a, + }; + } + } + return { source: null, line: null, column: null, name: null }; + }; + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return ( + this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (e) { + return e == null; + }) + ); + }; + BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(e, r) { + if (!this.sourcesContent) { + return null; + } + var n = this._findSourceIndex(e); + if (n >= 0) { + return this.sourcesContent[n]; + } + var t = e; + if (this.sourceRoot != null) { + t = o.relative(this.sourceRoot, t); + } + var i; + if (this.sourceRoot != null && (i = o.urlParse(this.sourceRoot))) { + var a = t.replace(/^file:\/\//, ""); + if (i.scheme == "file" && this._sources.has(a)) { + return this.sourcesContent[this._sources.indexOf(a)]; + } + if ((!i.path || i.path == "/") && this._sources.has("/" + t)) { + return this.sourcesContent[this._sources.indexOf("/" + t)]; + } + } + if (r) { + return null; + } else { + throw new Error('"' + t + '" is not in the SourceMap.'); + } + }; + BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(e) { + var r = o.getArg(e, "source"); + r = this._findSourceIndex(r); + if (r < 0) { + return { line: null, column: null, lastColumn: null }; + } + var n = { + source: r, + originalLine: o.getArg(e, "line"), + originalColumn: o.getArg(e, "column"), + }; + var t = this._findMapping( + n, + this._originalMappings, + "originalLine", + "originalColumn", + o.compareByOriginalPositions, + o.getArg(e, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND), + ); + if (t >= 0) { + var i = this._originalMappings[t]; + if (i.source === n.source) { + return { + line: o.getArg(i, "generatedLine", null), + column: o.getArg(i, "generatedColumn", null), + lastColumn: o.getArg(i, "lastGeneratedColumn", null), + }; + } + } + return { line: null, column: null, lastColumn: null }; + }; + t = BasicSourceMapConsumer; + function IndexedSourceMapConsumer(e, r) { + var n = e; + if (typeof e === "string") { + n = o.parseSourceMapInput(e); + } + var t = o.getArg(n, "version"); + var i = o.getArg(n, "sections"); + if (t != this._version) { + throw new Error("Unsupported version: " + t); + } + this._sources = new a(); + this._names = new a(); + var u = { line: -1, column: 0 }; + this._sections = i.map(function (e) { + if (e.url) { + throw new Error( + "Support for url field in sections not implemented.", + ); + } + var n = o.getArg(e, "offset"); + var t = o.getArg(n, "line"); + var i = o.getArg(n, "column"); + if (t < u.line || (t === u.line && i < u.column)) { + throw new Error( + "Section offsets must be ordered and non-overlapping.", + ); + } + u = n; + return { + generatedOffset: { generatedLine: t + 1, generatedColumn: i + 1 }, + consumer: new SourceMapConsumer(o.getArg(e, "map"), r), + }; + }); + } + IndexedSourceMapConsumer.prototype = Object.create( + SourceMapConsumer.prototype, + ); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + IndexedSourceMapConsumer.prototype._version = 3; + Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", { + get: function () { + var e = []; + for (var r = 0; r < this._sections.length; r++) { + for ( + var n = 0; + n < this._sections[r].consumer.sources.length; + n++ + ) { + e.push(this._sections[r].consumer.sources[n]); + } + } + return e; + }, + }); + IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(e) { + var r = { + generatedLine: o.getArg(e, "line"), + generatedColumn: o.getArg(e, "column"), + }; + var n = i.search(r, this._sections, function (e, r) { + var n = e.generatedLine - r.generatedOffset.generatedLine; + if (n) { + return n; + } + return e.generatedColumn - r.generatedOffset.generatedColumn; + }); + var t = this._sections[n]; + if (!t) { + return { source: null, line: null, column: null, name: null }; + } + return t.consumer.originalPositionFor({ + line: r.generatedLine - (t.generatedOffset.generatedLine - 1), + column: + r.generatedColumn - + (t.generatedOffset.generatedLine === r.generatedLine + ? t.generatedOffset.generatedColumn - 1 + : 0), + bias: e.bias, + }); + }; + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (e) { + return e.consumer.hasContentsOfAllSources(); + }); + }; + IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(e, r) { + for (var n = 0; n < this._sections.length; n++) { + var t = this._sections[n]; + var o = t.consumer.sourceContentFor(e, true); + if (o) { + return o; + } + } + if (r) { + return null; + } else { + throw new Error('"' + e + '" is not in the SourceMap.'); + } + }; + IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(e) { + for (var r = 0; r < this._sections.length; r++) { + var n = this._sections[r]; + if (n.consumer._findSourceIndex(o.getArg(e, "source")) === -1) { + continue; + } + var t = n.consumer.generatedPositionFor(e); + if (t) { + var i = { + line: t.line + (n.generatedOffset.generatedLine - 1), + column: + t.column + + (n.generatedOffset.generatedLine === t.line + ? n.generatedOffset.generatedColumn - 1 + : 0), + }; + return i; + } + } + return { line: null, column: null }; + }; + IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(e, r) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var n = 0; n < this._sections.length; n++) { + var t = this._sections[n]; + var i = t.consumer._generatedMappings; + for (var a = 0; a < i.length; a++) { + var u = i[a]; + var l = t.consumer._sources.at(u.source); + l = o.computeSourceURL( + t.consumer.sourceRoot, + l, + this._sourceMapURL, + ); + this._sources.add(l); + l = this._sources.indexOf(l); + var c = null; + if (u.name) { + c = t.consumer._names.at(u.name); + this._names.add(c); + c = this._names.indexOf(c); + } + var p = { + source: l, + generatedLine: + u.generatedLine + (t.generatedOffset.generatedLine - 1), + generatedColumn: + u.generatedColumn + + (t.generatedOffset.generatedLine === u.generatedLine + ? t.generatedOffset.generatedColumn - 1 + : 0), + originalLine: u.originalLine, + originalColumn: u.originalColumn, + name: c, + }; + this.__generatedMappings.push(p); + if (typeof p.originalLine === "number") { + this.__originalMappings.push(p); + } + } + } + s(this.__generatedMappings, o.compareByGeneratedPositionsDeflated); + s(this.__originalMappings, o.compareByOriginalPositions); + }; + t = IndexedSourceMapConsumer; + }, + 591: (e, r, n) => { + var t = n(449); + var o = n(339); + var i = n(274).I; + var a = n(680).H; + function SourceMapGenerator(e) { + if (!e) { + e = {}; + } + this._file = o.getArg(e, "file", null); + this._sourceRoot = o.getArg(e, "sourceRoot", null); + this._skipValidation = o.getArg(e, "skipValidation", false); + this._sources = new i(); + this._names = new i(); + this._mappings = new a(); + this._sourcesContents = null; + } + SourceMapGenerator.prototype._version = 3; + SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(e) { + var r = e.sourceRoot; + var n = new SourceMapGenerator({ file: e.file, sourceRoot: r }); + e.eachMapping(function (e) { + var t = { + generated: { line: e.generatedLine, column: e.generatedColumn }, + }; + if (e.source != null) { + t.source = e.source; + if (r != null) { + t.source = o.relative(r, t.source); + } + t.original = { line: e.originalLine, column: e.originalColumn }; + if (e.name != null) { + t.name = e.name; + } + } + n.addMapping(t); + }); + e.sources.forEach(function (t) { + var i = t; + if (r !== null) { + i = o.relative(r, t); + } + if (!n._sources.has(i)) { + n._sources.add(i); + } + var a = e.sourceContentFor(t); + if (a != null) { + n.setSourceContent(t, a); + } + }); + return n; + }; + SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(e) { + var r = o.getArg(e, "generated"); + var n = o.getArg(e, "original", null); + var t = o.getArg(e, "source", null); + var i = o.getArg(e, "name", null); + if (!this._skipValidation) { + this._validateMapping(r, n, t, i); + } + if (t != null) { + t = String(t); + if (!this._sources.has(t)) { + this._sources.add(t); + } + } + if (i != null) { + i = String(i); + if (!this._names.has(i)) { + this._names.add(i); + } + } + this._mappings.add({ + generatedLine: r.line, + generatedColumn: r.column, + originalLine: n != null && n.line, + originalColumn: n != null && n.column, + source: t, + name: i, + }); + }; + SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(e, r) { + var n = e; + if (this._sourceRoot != null) { + n = o.relative(this._sourceRoot, n); + } + if (r != null) { + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[o.toSetString(n)] = r; + } else if (this._sourcesContents) { + delete this._sourcesContents[o.toSetString(n)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(e, r, n) { + var t = r; + if (r == null) { + if (e.file == null) { + throw new Error( + "SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, " + + 'or the source map\'s "file" property. Both were omitted.', + ); + } + t = e.file; + } + var a = this._sourceRoot; + if (a != null) { + t = o.relative(a, t); + } + var u = new i(); + var s = new i(); + this._mappings.unsortedForEach(function (r) { + if (r.source === t && r.originalLine != null) { + var i = e.originalPositionFor({ + line: r.originalLine, + column: r.originalColumn, + }); + if (i.source != null) { + r.source = i.source; + if (n != null) { + r.source = o.join(n, r.source); + } + if (a != null) { + r.source = o.relative(a, r.source); + } + r.originalLine = i.line; + r.originalColumn = i.column; + if (i.name != null) { + r.name = i.name; + } + } + } + var l = r.source; + if (l != null && !u.has(l)) { + u.add(l); + } + var c = r.name; + if (c != null && !s.has(c)) { + s.add(c); + } + }, this); + this._sources = u; + this._names = s; + e.sources.forEach(function (r) { + var t = e.sourceContentFor(r); + if (t != null) { + if (n != null) { + r = o.join(n, r); + } + if (a != null) { + r = o.relative(a, r); + } + this.setSourceContent(r, t); + } + }, this); + }; + SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(e, r, n, t) { + if (r && typeof r.line !== "number" && typeof r.column !== "number") { + throw new Error( + "original.line and original.column are not numbers -- you probably meant to omit " + + "the original mapping entirely and only map the generated position. If so, pass " + + "null for the original mapping instead of an object with empty or null values.", + ); + } + if ( + e && + "line" in e && + "column" in e && + e.line > 0 && + e.column >= 0 && + !r && + !n && + !t + ) { + return; + } else if ( + e && + "line" in e && + "column" in e && + r && + "line" in r && + "column" in r && + e.line > 0 && + e.column >= 0 && + r.line > 0 && + r.column >= 0 && + n + ) { + return; + } else { + throw new Error( + "Invalid mapping: " + + JSON.stringify({ + generated: e, + source: n, + original: r, + name: t, + }), + ); + } + }; + SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var e = 0; + var r = 1; + var n = 0; + var i = 0; + var a = 0; + var u = 0; + var s = ""; + var l; + var c; + var p; + var f; + var g = this._mappings.toArray(); + for (var h = 0, d = g.length; h < d; h++) { + c = g[h]; + l = ""; + if (c.generatedLine !== r) { + e = 0; + while (c.generatedLine !== r) { + l += ";"; + r++; + } + } else { + if (h > 0) { + if (!o.compareByGeneratedPositionsInflated(c, g[h - 1])) { + continue; + } + l += ","; + } + } + l += t.encode(c.generatedColumn - e); + e = c.generatedColumn; + if (c.source != null) { + f = this._sources.indexOf(c.source); + l += t.encode(f - u); + u = f; + l += t.encode(c.originalLine - 1 - i); + i = c.originalLine - 1; + l += t.encode(c.originalColumn - n); + n = c.originalColumn; + if (c.name != null) { + p = this._names.indexOf(c.name); + l += t.encode(p - a); + a = p; + } + } + s += l; + } + return s; + }; + SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(e, r) { + return e.map(function (e) { + if (!this._sourcesContents) { + return null; + } + if (r != null) { + e = o.relative(r, e); + } + var n = o.toSetString(e); + return Object.prototype.hasOwnProperty.call( + this._sourcesContents, + n, + ) + ? this._sourcesContents[n] + : null; + }, this); + }; + SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var e = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings(), + }; + if (this._file != null) { + e.file = this._file; + } + if (this._sourceRoot != null) { + e.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + e.sourcesContent = this._generateSourcesContent( + e.sources, + e.sourceRoot, + ); + } + return e; + }; + SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + r.h = SourceMapGenerator; + }, + 351: (e, r, n) => { + var t; + var o = n(591).h; + var i = n(339); + var a = /(\r?\n)/; + var u = 10; + var s = "$$$isSourceNode$$$"; + function SourceNode(e, r, n, t, o) { + this.children = []; + this.sourceContents = {}; + this.line = e == null ? null : e; + this.column = r == null ? null : r; + this.source = n == null ? null : n; + this.name = o == null ? null : o; + this[s] = true; + if (t != null) this.add(t); + } + SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(e, r, n) { + var t = new SourceNode(); + var o = e.split(a); + var u = 0; + var shiftNextLine = function () { + var e = getNextLine(); + var r = getNextLine() || ""; + return e + r; + function getNextLine() { + return u < o.length ? o[u++] : undefined; + } + }; + var s = 1, + l = 0; + var c = null; + r.eachMapping(function (e) { + if (c !== null) { + if (s < e.generatedLine) { + addMappingWithCode(c, shiftNextLine()); + s++; + l = 0; + } else { + var r = o[u] || ""; + var n = r.substr(0, e.generatedColumn - l); + o[u] = r.substr(e.generatedColumn - l); + l = e.generatedColumn; + addMappingWithCode(c, n); + c = e; + return; + } + } + while (s < e.generatedLine) { + t.add(shiftNextLine()); + s++; + } + if (l < e.generatedColumn) { + var r = o[u] || ""; + t.add(r.substr(0, e.generatedColumn)); + o[u] = r.substr(e.generatedColumn); + l = e.generatedColumn; + } + c = e; + }, this); + if (u < o.length) { + if (c) { + addMappingWithCode(c, shiftNextLine()); + } + t.add(o.splice(u).join("")); + } + r.sources.forEach(function (e) { + var o = r.sourceContentFor(e); + if (o != null) { + if (n != null) { + e = i.join(n, e); + } + t.setSourceContent(e, o); + } + }); + return t; + function addMappingWithCode(e, r) { + if (e === null || e.source === undefined) { + t.add(r); + } else { + var o = n ? i.join(n, e.source) : e.source; + t.add( + new SourceNode(e.originalLine, e.originalColumn, o, r, e.name), + ); + } + } + }; + SourceNode.prototype.add = function SourceNode_add(e) { + if (Array.isArray(e)) { + e.forEach(function (e) { + this.add(e); + }, this); + } else if (e[s] || typeof e === "string") { + if (e) { + this.children.push(e); + } + } else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + + e, + ); + } + return this; + }; + SourceNode.prototype.prepend = function SourceNode_prepend(e) { + if (Array.isArray(e)) { + for (var r = e.length - 1; r >= 0; r--) { + this.prepend(e[r]); + } + } else if (e[s] || typeof e === "string") { + this.children.unshift(e); + } else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + + e, + ); + } + return this; + }; + SourceNode.prototype.walk = function SourceNode_walk(e) { + var r; + for (var n = 0, t = this.children.length; n < t; n++) { + r = this.children[n]; + if (r[s]) { + r.walk(e); + } else { + if (r !== "") { + e(r, { + source: this.source, + line: this.line, + column: this.column, + name: this.name, + }); + } + } + } + }; + SourceNode.prototype.join = function SourceNode_join(e) { + var r; + var n; + var t = this.children.length; + if (t > 0) { + r = []; + for (n = 0; n < t - 1; n++) { + r.push(this.children[n]); + r.push(e); + } + r.push(this.children[n]); + this.children = r; + } + return this; + }; + SourceNode.prototype.replaceRight = function SourceNode_replaceRight( + e, + r, + ) { + var n = this.children[this.children.length - 1]; + if (n[s]) { + n.replaceRight(e, r); + } else if (typeof n === "string") { + this.children[this.children.length - 1] = n.replace(e, r); + } else { + this.children.push("".replace(e, r)); + } + return this; + }; + SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(e, r) { + this.sourceContents[i.toSetString(e)] = r; + }; + SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(e) { + for (var r = 0, n = this.children.length; r < n; r++) { + if (this.children[r][s]) { + this.children[r].walkSourceContents(e); + } + } + var t = Object.keys(this.sourceContents); + for (var r = 0, n = t.length; r < n; r++) { + e(i.fromSetString(t[r]), this.sourceContents[t[r]]); + } + }; + SourceNode.prototype.toString = function SourceNode_toString() { + var e = ""; + this.walk(function (r) { + e += r; + }); + return e; + }; + SourceNode.prototype.toStringWithSourceMap = + function SourceNode_toStringWithSourceMap(e) { + var r = { code: "", line: 1, column: 0 }; + var n = new o(e); + var t = false; + var i = null; + var a = null; + var s = null; + var l = null; + this.walk(function (e, o) { + r.code += e; + if (o.source !== null && o.line !== null && o.column !== null) { + if ( + i !== o.source || + a !== o.line || + s !== o.column || + l !== o.name + ) { + n.addMapping({ + source: o.source, + original: { line: o.line, column: o.column }, + generated: { line: r.line, column: r.column }, + name: o.name, + }); + } + i = o.source; + a = o.line; + s = o.column; + l = o.name; + t = true; + } else if (t) { + n.addMapping({ generated: { line: r.line, column: r.column } }); + i = null; + t = false; + } + for (var c = 0, p = e.length; c < p; c++) { + if (e.charCodeAt(c) === u) { + r.line++; + r.column = 0; + if (c + 1 === p) { + i = null; + t = false; + } else if (t) { + n.addMapping({ + source: o.source, + original: { line: o.line, column: o.column }, + generated: { line: r.line, column: r.column }, + name: o.name, + }); + } + } else { + r.column++; + } + } + }); + this.walkSourceContents(function (e, r) { + n.setSourceContent(e, r); + }); + return { code: r.code, map: n }; + }; + t = SourceNode; + }, + 339: (e, r) => { + function getArg(e, r, n) { + if (r in e) { + return e[r]; + } else if (arguments.length === 3) { + return n; + } else { + throw new Error('"' + r + '" is a required argument.'); + } + } + r.getArg = getArg; + var n = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; + var t = /^data:.+\,.+$/; + function urlParse(e) { + var r = e.match(n); + if (!r) { + return null; + } + return { scheme: r[1], auth: r[2], host: r[3], port: r[4], path: r[5] }; + } + r.urlParse = urlParse; + function urlGenerate(e) { + var r = ""; + if (e.scheme) { + r += e.scheme + ":"; + } + r += "//"; + if (e.auth) { + r += e.auth + "@"; + } + if (e.host) { + r += e.host; + } + if (e.port) { + r += ":" + e.port; + } + if (e.path) { + r += e.path; + } + return r; + } + r.urlGenerate = urlGenerate; + function normalize(e) { + var n = e; + var t = urlParse(e); + if (t) { + if (!t.path) { + return e; + } + n = t.path; + } + var o = r.isAbsolute(n); + var i = n.split(/\/+/); + for (var a, u = 0, s = i.length - 1; s >= 0; s--) { + a = i[s]; + if (a === ".") { + i.splice(s, 1); + } else if (a === "..") { + u++; + } else if (u > 0) { + if (a === "") { + i.splice(s + 1, u); + u = 0; + } else { + i.splice(s, 2); + u--; + } + } + } + n = i.join("/"); + if (n === "") { + n = o ? "/" : "."; + } + if (t) { + t.path = n; + return urlGenerate(t); + } + return n; + } + r.normalize = normalize; + function join(e, r) { + if (e === "") { + e = "."; + } + if (r === "") { + r = "."; + } + var n = urlParse(r); + var o = urlParse(e); + if (o) { + e = o.path || "/"; + } + if (n && !n.scheme) { + if (o) { + n.scheme = o.scheme; + } + return urlGenerate(n); + } + if (n || r.match(t)) { + return r; + } + if (o && !o.host && !o.path) { + o.host = r; + return urlGenerate(o); + } + var i = + r.charAt(0) === "/" ? r : normalize(e.replace(/\/+$/, "") + "/" + r); + if (o) { + o.path = i; + return urlGenerate(o); + } + return i; + } + r.join = join; + r.isAbsolute = function (e) { + return e.charAt(0) === "/" || n.test(e); + }; + function relative(e, r) { + if (e === "") { + e = "."; + } + e = e.replace(/\/$/, ""); + var n = 0; + while (r.indexOf(e + "/") !== 0) { + var t = e.lastIndexOf("/"); + if (t < 0) { + return r; + } + e = e.slice(0, t); + if (e.match(/^([^\/]+:\/)?\/*$/)) { + return r; + } + ++n; + } + return Array(n + 1).join("../") + r.substr(e.length + 1); + } + r.relative = relative; + var o = (function () { + var e = Object.create(null); + return !("__proto__" in e); + })(); + function identity(e) { + return e; + } + function toSetString(e) { + if (isProtoString(e)) { + return "$" + e; + } + return e; + } + r.toSetString = o ? identity : toSetString; + function fromSetString(e) { + if (isProtoString(e)) { + return e.slice(1); + } + return e; + } + r.fromSetString = o ? identity : fromSetString; + function isProtoString(e) { + if (!e) { + return false; + } + var r = e.length; + if (r < 9) { + return false; + } + if ( + e.charCodeAt(r - 1) !== 95 || + e.charCodeAt(r - 2) !== 95 || + e.charCodeAt(r - 3) !== 111 || + e.charCodeAt(r - 4) !== 116 || + e.charCodeAt(r - 5) !== 111 || + e.charCodeAt(r - 6) !== 114 || + e.charCodeAt(r - 7) !== 112 || + e.charCodeAt(r - 8) !== 95 || + e.charCodeAt(r - 9) !== 95 + ) { + return false; + } + for (var n = r - 10; n >= 0; n--) { + if (e.charCodeAt(n) !== 36) { + return false; + } + } + return true; + } + function compareByOriginalPositions(e, r, n) { + var t = strcmp(e.source, r.source); + if (t !== 0) { + return t; + } + t = e.originalLine - r.originalLine; + if (t !== 0) { + return t; + } + t = e.originalColumn - r.originalColumn; + if (t !== 0 || n) { + return t; + } + t = e.generatedColumn - r.generatedColumn; + if (t !== 0) { + return t; + } + t = e.generatedLine - r.generatedLine; + if (t !== 0) { + return t; + } + return strcmp(e.name, r.name); + } + r.compareByOriginalPositions = compareByOriginalPositions; + function compareByGeneratedPositionsDeflated(e, r, n) { + var t = e.generatedLine - r.generatedLine; + if (t !== 0) { + return t; + } + t = e.generatedColumn - r.generatedColumn; + if (t !== 0 || n) { + return t; + } + t = strcmp(e.source, r.source); + if (t !== 0) { + return t; + } + t = e.originalLine - r.originalLine; + if (t !== 0) { + return t; + } + t = e.originalColumn - r.originalColumn; + if (t !== 0) { + return t; + } + return strcmp(e.name, r.name); + } + r.compareByGeneratedPositionsDeflated = + compareByGeneratedPositionsDeflated; + function strcmp(e, r) { + if (e === r) { + return 0; + } + if (e === null) { + return 1; + } + if (r === null) { + return -1; + } + if (e > r) { + return 1; + } + return -1; + } + function compareByGeneratedPositionsInflated(e, r) { + var n = e.generatedLine - r.generatedLine; + if (n !== 0) { + return n; + } + n = e.generatedColumn - r.generatedColumn; + if (n !== 0) { + return n; + } + n = strcmp(e.source, r.source); + if (n !== 0) { + return n; + } + n = e.originalLine - r.originalLine; + if (n !== 0) { + return n; + } + n = e.originalColumn - r.originalColumn; + if (n !== 0) { + return n; + } + return strcmp(e.name, r.name); + } + r.compareByGeneratedPositionsInflated = + compareByGeneratedPositionsInflated; + function parseSourceMapInput(e) { + return JSON.parse(e.replace(/^\)]}'[^\n]*\n/, "")); + } + r.parseSourceMapInput = parseSourceMapInput; + function computeSourceURL(e, r, n) { + r = r || ""; + if (e) { + if (e[e.length - 1] !== "/" && r[0] !== "/") { + e += "/"; + } + r = e + r; + } + if (n) { + var t = urlParse(n); + if (!t) { + throw new Error("sourceMapURL could not be parsed"); + } + if (t.path) { + var o = t.path.lastIndexOf("/"); + if (o >= 0) { + t.path = t.path.substring(0, o + 1); + } + } + r = join(urlGenerate(t), r); + } + return normalize(r); + } + r.computeSourceURL = computeSourceURL; + }, + 997: (e, r, n) => { + n(591).h; + r.SourceMapConsumer = n(952).SourceMapConsumer; + n(351); + }, + 284: (e, r, n) => { + e = n.nmd(e); + var t = n(997).SourceMapConsumer; + var o = n(17); + var i; + try { + i = n(147); + if (!i.existsSync || !i.readFileSync) { + i = null; + } + } catch (e) {} + var a = n(650); + function dynamicRequire(e, r) { + return e.require(r); + } + var u = false; + var s = false; + var l = false; + var c = "auto"; + var p = {}; + var f = {}; + var g = /^data:application\/json[^,]+base64,/; + var h = []; + var d = []; + function isInBrowser() { + if (c === "browser") return true; + if (c === "node") return false; + return ( + typeof window !== "undefined" && + typeof XMLHttpRequest === "function" && + !( + window.require && + window.module && + window.process && + window.process.type === "renderer" + ) + ); + } + function hasGlobalProcessEventEmitter() { + return ( + typeof process === "object" && + process !== null && + typeof process.on === "function" + ); + } + function globalProcessVersion() { + if (typeof process === "object" && process !== null) { + return process.version; + } else { + return ""; + } + } + function globalProcessStderr() { + if (typeof process === "object" && process !== null) { + return process.stderr; + } + } + function globalProcessExit(e) { + if ( + typeof process === "object" && + process !== null && + typeof process.exit === "function" + ) { + return process.exit(e); + } + } + function handlerExec(e) { + return function (r) { + for (var n = 0; n < e.length; n++) { + var t = e[n](r); + if (t) { + return t; + } + } + return null; + }; + } + var m = handlerExec(h); + h.push(function (e) { + e = e.trim(); + if (/^file:/.test(e)) { + e = e.replace(/file:\/\/\/(\w:)?/, function (e, r) { + return r ? "" : "/"; + }); + } + if (e in p) { + return p[e]; + } + var r = ""; + try { + if (!i) { + var n = new XMLHttpRequest(); + n.open("GET", e, false); + n.send(null); + if (n.readyState === 4 && n.status === 200) { + r = n.responseText; + } + } else if (i.existsSync(e)) { + r = i.readFileSync(e, "utf8"); + } + } catch (e) {} + return (p[e] = r); + }); + function supportRelativeURL(e, r) { + if (!e) return r; + var n = o.dirname(e); + var t = /^\w+:\/\/[^\/]*/.exec(n); + var i = t ? t[0] : ""; + var a = n.slice(i.length); + if (i && /^\/\w\:/.test(a)) { + i += "/"; + return i + o.resolve(n.slice(i.length), r).replace(/\\/g, "/"); + } + return i + o.resolve(n.slice(i.length), r); + } + function retrieveSourceMapURL(e) { + var r; + if (isInBrowser()) { + try { + var n = new XMLHttpRequest(); + n.open("GET", e, false); + n.send(null); + r = n.readyState === 4 ? n.responseText : null; + var t = + n.getResponseHeader("SourceMap") || + n.getResponseHeader("X-SourceMap"); + if (t) { + return t; + } + } catch (e) {} + } + r = m(e); + var o = + /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/gm; + var i, a; + while ((a = o.exec(r))) i = a; + if (!i) return null; + return i[1]; + } + var v = handlerExec(d); + d.push(function (e) { + var r = retrieveSourceMapURL(e); + if (!r) return null; + var n; + if (g.test(r)) { + var t = r.slice(r.indexOf(",") + 1); + n = a(t, "base64").toString(); + r = e; + } else { + r = supportRelativeURL(e, r); + n = m(r); + } + if (!n) { + return null; + } + return { url: r, map: n }; + }); + function mapSourcePosition(e) { + var r = f[e.source]; + if (!r) { + var n = v(e.source); + if (n) { + r = f[e.source] = { url: n.url, map: new t(n.map) }; + if (r.map.sourcesContent) { + r.map.sources.forEach(function (e, n) { + var t = r.map.sourcesContent[n]; + if (t) { + var o = supportRelativeURL(r.url, e); + p[o] = t; + } + }); + } + } else { + r = f[e.source] = { url: null, map: null }; + } + } + if (r && r.map && typeof r.map.originalPositionFor === "function") { + var o = r.map.originalPositionFor(e); + if (o.source !== null) { + o.source = supportRelativeURL(r.url, o.source); + return o; + } + } + return e; + } + function mapEvalOrigin(e) { + var r = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(e); + if (r) { + var n = mapSourcePosition({ + source: r[2], + line: +r[3], + column: r[4] - 1, + }); + return ( + "eval at " + + r[1] + + " (" + + n.source + + ":" + + n.line + + ":" + + (n.column + 1) + + ")" + ); + } + r = /^eval at ([^(]+) \((.+)\)$/.exec(e); + if (r) { + return "eval at " + r[1] + " (" + mapEvalOrigin(r[2]) + ")"; + } + return e; + } + function CallSiteToString() { + var e; + var r = ""; + if (this.isNative()) { + r = "native"; + } else { + e = this.getScriptNameOrSourceURL(); + if (!e && this.isEval()) { + r = this.getEvalOrigin(); + r += ", "; + } + if (e) { + r += e; + } else { + r += ""; + } + var n = this.getLineNumber(); + if (n != null) { + r += ":" + n; + var t = this.getColumnNumber(); + if (t) { + r += ":" + t; + } + } + } + var o = ""; + var i = this.getFunctionName(); + var a = true; + var u = this.isConstructor(); + var s = !(this.isToplevel() || u); + if (s) { + var l = this.getTypeName(); + if (l === "[object Object]") { + l = "null"; + } + var c = this.getMethodName(); + if (i) { + if (l && i.indexOf(l) != 0) { + o += l + "."; + } + o += i; + if (c && i.indexOf("." + c) != i.length - c.length - 1) { + o += " [as " + c + "]"; + } + } else { + o += l + "." + (c || ""); + } + } else if (u) { + o += "new " + (i || ""); + } else if (i) { + o += i; + } else { + o += r; + a = false; + } + if (a) { + o += " (" + r + ")"; + } + return o; + } + function cloneCallSite(e) { + var r = {}; + Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach( + function (n) { + r[n] = /^(?:is|get)/.test(n) + ? function () { + return e[n].call(e); + } + : e[n]; + }, + ); + r.toString = CallSiteToString; + return r; + } + function wrapCallSite(e, r) { + if (r === undefined) { + r = { nextPosition: null, curPosition: null }; + } + if (e.isNative()) { + r.curPosition = null; + return e; + } + var n = e.getFileName() || e.getScriptNameOrSourceURL(); + if (n) { + var t = e.getLineNumber(); + var o = e.getColumnNumber() - 1; + var i = + /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/; + var a = i.test(globalProcessVersion()) ? 0 : 62; + if (t === 1 && o > a && !isInBrowser() && !e.isEval()) { + o -= a; + } + var u = mapSourcePosition({ source: n, line: t, column: o }); + r.curPosition = u; + e = cloneCallSite(e); + var s = e.getFunctionName; + e.getFunctionName = function () { + if (r.nextPosition == null) { + return s(); + } + return r.nextPosition.name || s(); + }; + e.getFileName = function () { + return u.source; + }; + e.getLineNumber = function () { + return u.line; + }; + e.getColumnNumber = function () { + return u.column + 1; + }; + e.getScriptNameOrSourceURL = function () { + return u.source; + }; + return e; + } + var l = e.isEval() && e.getEvalOrigin(); + if (l) { + l = mapEvalOrigin(l); + e = cloneCallSite(e); + e.getEvalOrigin = function () { + return l; + }; + return e; + } + return e; + } + function prepareStackTrace(e, r) { + if (l) { + p = {}; + f = {}; + } + var n = e.name || "Error"; + var t = e.message || ""; + var o = n + ": " + t; + var i = { nextPosition: null, curPosition: null }; + var a = []; + for (var u = r.length - 1; u >= 0; u--) { + a.push("\n at " + wrapCallSite(r[u], i)); + i.nextPosition = i.curPosition; + } + i.curPosition = i.nextPosition = null; + return o + a.reverse().join(""); + } + function getErrorSource(e) { + var r = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(e.stack); + if (r) { + var n = r[1]; + var t = +r[2]; + var o = +r[3]; + var a = p[n]; + if (!a && i && i.existsSync(n)) { + try { + a = i.readFileSync(n, "utf8"); + } catch (e) { + a = ""; + } + } + if (a) { + var u = a.split(/(?:\r\n|\r|\n)/)[t - 1]; + if (u) { + return ( + n + ":" + t + "\n" + u + "\n" + new Array(o).join(" ") + "^" + ); + } + } + } + return null; + } + function printErrorAndExit(e) { + var r = getErrorSource(e); + var n = globalProcessStderr(); + if (n && n._handle && n._handle.setBlocking) { + n._handle.setBlocking(true); + } + if (r) { + console.error(); + console.error(r); + } + console.error(e.stack); + globalProcessExit(1); + } + function shimEmitUncaughtException() { + var e = process.emit; + process.emit = function (r) { + if (r === "uncaughtException") { + var n = arguments[1] && arguments[1].stack; + var t = this.listeners(r).length > 0; + if (n && !t) { + return printErrorAndExit(arguments[1]); + } + } + return e.apply(this, arguments); + }; + } + var S = h.slice(0); + var _ = d.slice(0); + r.wrapCallSite = wrapCallSite; + r.getErrorSource = getErrorSource; + r.mapSourcePosition = mapSourcePosition; + r.retrieveSourceMap = v; + r.install = function (r) { + r = r || {}; + if (r.environment) { + c = r.environment; + if (["node", "browser", "auto"].indexOf(c) === -1) { + throw new Error( + "environment " + + c + + " was unknown. Available options are {auto, browser, node}", + ); + } + } + if (r.retrieveFile) { + if (r.overrideRetrieveFile) { + h.length = 0; + } + h.unshift(r.retrieveFile); + } + if (r.retrieveSourceMap) { + if (r.overrideRetrieveSourceMap) { + d.length = 0; + } + d.unshift(r.retrieveSourceMap); + } + if (r.hookRequire && !isInBrowser()) { + var n = dynamicRequire(e, "module"); + var t = n.prototype._compile; + if (!t.__sourceMapSupport) { + n.prototype._compile = function (e, r) { + p[r] = e; + f[r] = undefined; + return t.call(this, e, r); + }; + n.prototype._compile.__sourceMapSupport = true; + } + } + if (!l) { + l = + "emptyCacheBetweenOperations" in r + ? r.emptyCacheBetweenOperations + : false; + } + if (!u) { + u = true; + Error.prepareStackTrace = prepareStackTrace; + } + if (!s) { + var o = + "handleUncaughtExceptions" in r ? r.handleUncaughtExceptions : true; + try { + var i = dynamicRequire(e, "worker_threads"); + if (i.isMainThread === false) { + o = false; + } + } catch (e) {} + if (o && hasGlobalProcessEventEmitter()) { + s = true; + shimEmitUncaughtException(); + } + } + }; + r.resetRetrieveHandlers = function () { + h.length = 0; + d.length = 0; + h = S.slice(0); + d = _.slice(0); + v = handlerExec(d); + m = handlerExec(h); + }; + }, + 147: (e) => { + "use strict"; + e.exports = require("fs"); + }, + 17: (e) => { + "use strict"; + e.exports = require("path"); + }, + }; + var r = {}; + function __webpack_require__(n) { + var t = r[n]; + if (t !== undefined) { + return t.exports; + } + var o = (r[n] = { id: n, loaded: false, exports: {} }); + var i = true; + try { + e[n](o, o.exports, __webpack_require__); + i = false; + } finally { + if (i) delete r[n]; + } + o.loaded = true; + return o.exports; + } + (() => { + __webpack_require__.nmd = (e) => { + e.paths = []; + if (!e.children) e.children = []; + return e; + }; + })(); + if (typeof __webpack_require__ !== "undefined") + __webpack_require__.ab = __dirname + "/"; + var n = {}; + (() => { + __webpack_require__(284).install(); + })(); + module.exports = n; +})(); diff --git a/forge/actions/publish/src/main.js b/forge/actions/publish/src/main.js index 3890bae..fc4331c 100644 --- a/forge/actions/publish/src/main.js +++ b/forge/actions/publish/src/main.js @@ -6,7 +6,8 @@ async function run() { const project = core.getInput("project", { required: true }); const image = core.getInput("image", { required: true }); - if (imageExists(image) === false) { + const exists = await imageExists(image); + if (!exists) { core.setFailed( `Image ${image} does not exist in the local Docker daemon`, ); @@ -58,12 +59,12 @@ module.exports = { }; /** - * + * Get the blueprint for a project * @param {string} project The name of the project to get the blueprint for * @returns {object} The blueprint object */ async function getBlueprint(project) { - let result = await exec.getExecOutput("forge", [ + const result = await exec.getExecOutput("forge", [ "blueprint", "dump", project,