From b5e097f5495fbc01d1c17d57ee4327a486d139df Mon Sep 17 00:00:00 2001 From: Roel Magdaleno Date: Tue, 23 May 2023 17:46:23 -0600 Subject: [PATCH] IMPROVE: Add comments and improve code --- action.yml | 2 +- dist/37.index.js | 450 +++++++++ dist/index.js | 2365 +-------------------------------------------- dist/licenses.txt | 24 +- dist/package.json | 3 + index.js | 121 ++- package-lock.json | 239 ++++- package.json | 16 +- 8 files changed, 785 insertions(+), 2435 deletions(-) create mode 100644 dist/37.index.js create mode 100644 dist/package.json diff --git a/action.yml b/action.yml index 5fc9973..e5da576 100644 --- a/action.yml +++ b/action.yml @@ -27,5 +27,5 @@ outputs: operation: description: 'The Cloudways API operation ID' runs: - using: 'node12' + using: 'node16' main: 'dist/index.js' diff --git a/dist/37.index.js b/dist/37.index.js new file mode 100644 index 0000000..62eb6b6 --- /dev/null +++ b/dist/37.index.js @@ -0,0 +1,450 @@ +export const id = 37; +export const ids = [37]; +export const modules = { + +/***/ 4037: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "toFormData": () => (/* binding */ toFormData) +/* harmony export */ }); +/* harmony import */ var fetch_blob_from_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2777); +/* harmony import */ var formdata_polyfill_esm_min_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8010); + + + +let s = 0; +const S = { + START_BOUNDARY: s++, + HEADER_FIELD_START: s++, + HEADER_FIELD: s++, + HEADER_VALUE_START: s++, + HEADER_VALUE: s++, + HEADER_VALUE_ALMOST_DONE: s++, + HEADERS_ALMOST_DONE: s++, + PART_DATA_START: s++, + PART_DATA: s++, + END: s++ +}; + +let f = 1; +const F = { + PART_BOUNDARY: f, + LAST_BOUNDARY: f *= 2 +}; + +const LF = 10; +const CR = 13; +const SPACE = 32; +const HYPHEN = 45; +const COLON = 58; +const A = 97; +const Z = 122; + +const lower = c => c | 0x20; + +const noop = () => {}; + +class MultipartParser { + /** + * @param {string} boundary + */ + constructor(boundary) { + this.index = 0; + this.flags = 0; + + this.onHeaderEnd = noop; + this.onHeaderField = noop; + this.onHeadersEnd = noop; + this.onHeaderValue = noop; + this.onPartBegin = noop; + this.onPartData = noop; + this.onPartEnd = noop; + + this.boundaryChars = {}; + + boundary = '\r\n--' + boundary; + const ui8a = new Uint8Array(boundary.length); + for (let i = 0; i < boundary.length; i++) { + ui8a[i] = boundary.charCodeAt(i); + this.boundaryChars[ui8a[i]] = true; + } + + this.boundary = ui8a; + this.lookbehind = new Uint8Array(this.boundary.length + 8); + this.state = S.START_BOUNDARY; + } + + /** + * @param {Uint8Array} data + */ + write(data) { + let i = 0; + const length_ = data.length; + let previousIndex = this.index; + let {lookbehind, boundary, boundaryChars, index, state, flags} = this; + const boundaryLength = this.boundary.length; + const boundaryEnd = boundaryLength - 1; + const bufferLength = data.length; + let c; + let cl; + + const mark = name => { + this[name + 'Mark'] = i; + }; + + const clear = name => { + delete this[name + 'Mark']; + }; + + const callback = (callbackSymbol, start, end, ui8a) => { + if (start === undefined || start !== end) { + this[callbackSymbol](ui8a && ui8a.subarray(start, end)); + } + }; + + const dataCallback = (name, clear) => { + const markSymbol = name + 'Mark'; + if (!(markSymbol in this)) { + return; + } + + if (clear) { + callback(name, this[markSymbol], i, data); + delete this[markSymbol]; + } else { + callback(name, this[markSymbol], data.length, data); + this[markSymbol] = 0; + } + }; + + for (i = 0; i < length_; i++) { + c = data[i]; + + switch (state) { + case S.START_BOUNDARY: + if (index === boundary.length - 2) { + if (c === HYPHEN) { + flags |= F.LAST_BOUNDARY; + } else if (c !== CR) { + return; + } + + index++; + break; + } else if (index - 1 === boundary.length - 2) { + if (flags & F.LAST_BOUNDARY && c === HYPHEN) { + state = S.END; + flags = 0; + } else if (!(flags & F.LAST_BOUNDARY) && c === LF) { + index = 0; + callback('onPartBegin'); + state = S.HEADER_FIELD_START; + } else { + return; + } + + break; + } + + if (c !== boundary[index + 2]) { + index = -2; + } + + if (c === boundary[index + 2]) { + index++; + } + + break; + case S.HEADER_FIELD_START: + state = S.HEADER_FIELD; + mark('onHeaderField'); + index = 0; + // falls through + case S.HEADER_FIELD: + if (c === CR) { + clear('onHeaderField'); + state = S.HEADERS_ALMOST_DONE; + break; + } + + index++; + if (c === HYPHEN) { + break; + } + + if (c === COLON) { + if (index === 1) { + // empty header field + return; + } + + dataCallback('onHeaderField', true); + state = S.HEADER_VALUE_START; + break; + } + + cl = lower(c); + if (cl < A || cl > Z) { + return; + } + + break; + case S.HEADER_VALUE_START: + if (c === SPACE) { + break; + } + + mark('onHeaderValue'); + state = S.HEADER_VALUE; + // falls through + case S.HEADER_VALUE: + if (c === CR) { + dataCallback('onHeaderValue', true); + callback('onHeaderEnd'); + state = S.HEADER_VALUE_ALMOST_DONE; + } + + break; + case S.HEADER_VALUE_ALMOST_DONE: + if (c !== LF) { + return; + } + + state = S.HEADER_FIELD_START; + break; + case S.HEADERS_ALMOST_DONE: + if (c !== LF) { + return; + } + + callback('onHeadersEnd'); + state = S.PART_DATA_START; + break; + case S.PART_DATA_START: + state = S.PART_DATA; + mark('onPartData'); + // falls through + case S.PART_DATA: + previousIndex = index; + + if (index === 0) { + // boyer-moore derrived algorithm to safely skip non-boundary data + i += boundaryEnd; + while (i < bufferLength && !(data[i] in boundaryChars)) { + i += boundaryLength; + } + + i -= boundaryEnd; + c = data[i]; + } + + if (index < boundary.length) { + if (boundary[index] === c) { + if (index === 0) { + dataCallback('onPartData', true); + } + + index++; + } else { + index = 0; + } + } else if (index === boundary.length) { + index++; + if (c === CR) { + // CR = part boundary + flags |= F.PART_BOUNDARY; + } else if (c === HYPHEN) { + // HYPHEN = end boundary + flags |= F.LAST_BOUNDARY; + } else { + index = 0; + } + } else if (index - 1 === boundary.length) { + if (flags & F.PART_BOUNDARY) { + index = 0; + if (c === LF) { + // unset the PART_BOUNDARY flag + flags &= ~F.PART_BOUNDARY; + callback('onPartEnd'); + callback('onPartBegin'); + state = S.HEADER_FIELD_START; + break; + } + } else if (flags & F.LAST_BOUNDARY) { + if (c === HYPHEN) { + callback('onPartEnd'); + state = S.END; + flags = 0; + } else { + index = 0; + } + } else { + index = 0; + } + } + + if (index > 0) { + // when matching a possible boundary, keep a lookbehind reference + // in case it turns out to be a false lead + lookbehind[index - 1] = c; + } else if (previousIndex > 0) { + // if our boundary turned out to be rubbish, the captured lookbehind + // belongs to partData + const _lookbehind = new Uint8Array(lookbehind.buffer, lookbehind.byteOffset, lookbehind.byteLength); + callback('onPartData', 0, previousIndex, _lookbehind); + previousIndex = 0; + mark('onPartData'); + + // reconsider the current character even so it interrupted the sequence + // it could be the beginning of a new sequence + i--; + } + + break; + case S.END: + break; + default: + throw new Error(`Unexpected state entered: ${state}`); + } + } + + dataCallback('onHeaderField'); + dataCallback('onHeaderValue'); + dataCallback('onPartData'); + + // Update properties for the next call + this.index = index; + this.state = state; + this.flags = flags; + } + + end() { + if ((this.state === S.HEADER_FIELD_START && this.index === 0) || + (this.state === S.PART_DATA && this.index === this.boundary.length)) { + this.onPartEnd(); + } else if (this.state !== S.END) { + throw new Error('MultipartParser.end(): stream ended unexpectedly'); + } + } +} + +function _fileName(headerValue) { + // matches either a quoted-string or a token (RFC 2616 section 19.5.1) + const m = headerValue.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i); + if (!m) { + return; + } + + const match = m[2] || m[3] || ''; + let filename = match.slice(match.lastIndexOf('\\') + 1); + filename = filename.replace(/%22/g, '"'); + filename = filename.replace(/&#(\d{4});/g, (m, code) => { + return String.fromCharCode(code); + }); + return filename; +} + +async function toFormData(Body, ct) { + if (!/multipart/i.test(ct)) { + throw new TypeError('Failed to fetch'); + } + + const m = ct.match(/boundary=(?:"([^"]+)"|([^;]+))/i); + + if (!m) { + throw new TypeError('no or bad content-type header, no multipart boundary'); + } + + const parser = new MultipartParser(m[1] || m[2]); + + let headerField; + let headerValue; + let entryValue; + let entryName; + let contentType; + let filename; + const entryChunks = []; + const formData = new formdata_polyfill_esm_min_js__WEBPACK_IMPORTED_MODULE_1__/* .FormData */ .Ct(); + + const onPartData = ui8a => { + entryValue += decoder.decode(ui8a, {stream: true}); + }; + + const appendToFile = ui8a => { + entryChunks.push(ui8a); + }; + + const appendFileToFormData = () => { + const file = new fetch_blob_from_js__WEBPACK_IMPORTED_MODULE_0__/* .File */ .$B(entryChunks, filename, {type: contentType}); + formData.append(entryName, file); + }; + + const appendEntryToFormData = () => { + formData.append(entryName, entryValue); + }; + + const decoder = new TextDecoder('utf-8'); + decoder.decode(); + + parser.onPartBegin = function () { + parser.onPartData = onPartData; + parser.onPartEnd = appendEntryToFormData; + + headerField = ''; + headerValue = ''; + entryValue = ''; + entryName = ''; + contentType = ''; + filename = null; + entryChunks.length = 0; + }; + + parser.onHeaderField = function (ui8a) { + headerField += decoder.decode(ui8a, {stream: true}); + }; + + parser.onHeaderValue = function (ui8a) { + headerValue += decoder.decode(ui8a, {stream: true}); + }; + + parser.onHeaderEnd = function () { + headerValue += decoder.decode(); + headerField = headerField.toLowerCase(); + + if (headerField === 'content-disposition') { + // matches either a quoted-string or a token (RFC 2616 section 19.5.1) + const m = headerValue.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i); + + if (m) { + entryName = m[2] || m[3] || ''; + } + + filename = _fileName(headerValue); + + if (filename) { + parser.onPartData = appendToFile; + parser.onPartEnd = appendFileToFormData; + } + } else if (headerField === 'content-type') { + contentType = headerValue; + } + + headerValue = ''; + headerField = ''; + }; + + for await (const chunk of Body) { + parser.write(chunk); + } + + parser.end(); + + return formData; +} + + +/***/ }) + +}; diff --git a/dist/index.js b/dist/index.js index 12e37cd..468c1a9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,2360 +1,5 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ 351: -/***/ (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__(87)); -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)}`; - } - } - } - } - 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.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__(351); -const file_command_1 = __nccwpck_require__(717); -const utils_1 = __nccwpck_require__(278); -const os = __importStar(__nccwpck_require__(87)); -const path = __importStar(__nccwpck_require__(622)); -/** - * 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) { - const delimiter = '_GitHubActionsFileCommandDelimeter_'; - const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; - file_command_1.issueCommand('ENV', commandValue); - } - else { - 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.issueCommand('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 !== ''); - return inputs; -} -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) { - process.stdout.write(os.EOL); - command_1.issueCommand('set-output', { name }, 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) { - command_1.issueCommand('save-state', { name }, 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; -//# 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.issueCommand = void 0; -// We use any as a valid input type -/* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__nccwpck_require__(747)); -const os = __importStar(__nccwpck_require__(87)); -const utils_1 = __nccwpck_require__(278); -function issueCommand(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.issueCommand = issueCommand; -//# sourceMappingURL=file-command.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, - line: annotationProperties.startLine, - endLine: annotationProperties.endLine, - col: annotationProperties.startColumn, - endColumn: annotationProperties.endColumn - }; -} -exports.toCommandProperties = toCommandProperties; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 467: -/***/ ((module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var Stream = _interopDefault(__nccwpck_require__(413)); -var http = _interopDefault(__nccwpck_require__(605)); -var Url = _interopDefault(__nccwpck_require__(835)); -var https = _interopDefault(__nccwpck_require__(211)); -var zlib = _interopDefault(__nccwpck_require__(761)); - -// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js - -// fix for "Readable" isn't a named export issue -const Readable = Stream.Readable; - -const BUFFER = Symbol('buffer'); -const TYPE = Symbol('type'); - -class Blob { - constructor() { - this[TYPE] = ''; - - const blobParts = arguments[0]; - const options = arguments[1]; - - const buffers = []; - let size = 0; - - if (blobParts) { - const a = blobParts; - const length = Number(a.length); - for (let i = 0; i < length; i++) { - const element = a[i]; - let buffer; - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(element); - } else if (element instanceof Blob) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === 'string' ? element : String(element)); - } - size += buffer.length; - buffers.push(buffer); - } - } - - this[BUFFER] = Buffer.concat(buffers); - - let type = options && options.type !== undefined && String(options.type).toLowerCase(); - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type; - } - } - get size() { - return this[BUFFER].length; - } - get type() { - return this[TYPE]; - } - text() { - return Promise.resolve(this[BUFFER].toString()); - } - arrayBuffer() { - const buf = this[BUFFER]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); - } - stream() { - const readable = new Readable(); - readable._read = function () {}; - readable.push(this[BUFFER]); - readable.push(null); - return readable; - } - toString() { - return '[object Blob]'; - } - slice() { - const size = this.size; - - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === undefined) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); - } else { - relativeStart = Math.min(start, size); - } - if (end === undefined) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); - } else { - relativeEnd = Math.min(end, size); - } - const span = Math.max(relativeEnd - relativeStart, 0); - - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob([], { type: arguments[2] }); - blob[BUFFER] = slicedBuffer; - return blob; - } -} - -Object.defineProperties(Blob.prototype, { - size: { enumerable: true }, - type: { enumerable: true }, - slice: { enumerable: true } -}); - -Object.defineProperty(Blob.prototype, Symbol.toStringTag, { - value: 'Blob', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * fetch-error.js - * - * FetchError interface for operational errors - */ - -/** - * Create FetchError instance - * - * @param String message Error message for human - * @param String type Error type for machine - * @param String systemError For Node.js system error - * @return FetchError - */ -function FetchError(message, type, systemError) { - Error.call(this, message); - - this.message = message; - this.type = type; - - // when err.type is `system`, err.code contains system error code - if (systemError) { - this.code = this.errno = systemError.code; - } - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -FetchError.prototype = Object.create(Error.prototype); -FetchError.prototype.constructor = FetchError; -FetchError.prototype.name = 'FetchError'; - -let convert; -try { - convert = __nccwpck_require__(877).convert; -} catch (e) {} - -const INTERNALS = Symbol('Body internals'); - -// fix an issue where "PassThrough" isn't a named export for node <10 -const PassThrough = Stream.PassThrough; - -/** - * Body mixin - * - * Ref: https://fetch.spec.whatwg.org/#body - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -function Body(body) { - var _this = this; - - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$size = _ref.size; - - let size = _ref$size === undefined ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; - - if (body == null) { - // body is undefined or null - body = null; - } else if (isURLSearchParams(body)) { - // body is a URLSearchParams - body = Buffer.from(body.toString()); - } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { - // body is ArrayBuffer - body = Buffer.from(body); - } else if (ArrayBuffer.isView(body)) { - // body is ArrayBufferView - body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof Stream) ; else { - // none of the above - // coerce to string then buffer - body = Buffer.from(String(body)); - } - this[INTERNALS] = { - body, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout; - - if (body instanceof Stream) { - body.on('error', function (err) { - const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); - _this[INTERNALS].error = error; - }); - } -} - -Body.prototype = { - get body() { - return this[INTERNALS].body; - }, - - get bodyUsed() { - return this[INTERNALS].disturbed; - }, - - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer() { - return consumeBody.call(this).then(function (buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, - - /** - * Return raw response as Blob - * - * @return Promise - */ - blob() { - let ct = this.headers && this.headers.get('content-type') || ''; - return consumeBody.call(this).then(function (buf) { - return Object.assign( - // Prevent copying - new Blob([], { - type: ct.toLowerCase() - }), { - [BUFFER]: buf - }); - }); - }, - - /** - * Decode response as json - * - * @return Promise - */ - json() { - var _this2 = this; - - return consumeBody.call(this).then(function (buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); - } - }); - }, - - /** - * Decode response as text - * - * @return Promise - */ - text() { - return consumeBody.call(this).then(function (buffer) { - return buffer.toString(); - }); - }, - - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, - - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted() { - var _this3 = this; - - return consumeBody.call(this).then(function (buffer) { - return convertBody(buffer, _this3.headers); - }); - } -}; - -// In browsers, all properties are enumerable. -Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } -}); - -Body.mixIn = function (proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - // istanbul ignore else: future proof - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } - } -}; - -/** - * Consume and convert an entire Body to a Buffer. - * - * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body - * - * @return Promise - */ -function consumeBody() { - var _this4 = this; - - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } - - this[INTERNALS].disturbed = true; - - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } - - let body = this.body; - - // body is null - if (body === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is blob - if (isBlob(body)) { - body = body.stream(); - } - - // body is buffer - if (Buffer.isBuffer(body)) { - return Body.Promise.resolve(body); - } - - // istanbul ignore if: should never happen - if (!(body instanceof Stream)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is stream - // get ready to actually consume the body - let accum = []; - let accumBytes = 0; - let abort = false; - - return new Body.Promise(function (resolve, reject) { - let resTimeout; - - // allow timeout on slow response body - if (_this4.timeout) { - resTimeout = setTimeout(function () { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); - }, _this4.timeout); - } - - // handle stream errors - body.on('error', function (err) { - if (err.name === 'AbortError') { - // if the request was aborted, reject with this Error - abort = true; - reject(err); - } else { - // other errors, such as incorrect content-encoding - reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - - body.on('data', function (chunk) { - if (abort || chunk === null) { - return; - } - - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); - return; - } - - accumBytes += chunk.length; - accum.push(chunk); - }); - - body.on('end', function () { - if (abort) { - return; - } - - clearTimeout(resTimeout); - - try { - resolve(Buffer.concat(accum, accumBytes)); - } catch (err) { - // handle streams that have accumulated too much data (issue #414) - reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - }); -} - -/** - * Detect buffer encoding and convert to target encoding - * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding - * - * @param Buffer buffer Incoming buffer - * @param String encoding Target encoding - * @return String - */ -function convertBody(buffer, headers) { - if (typeof convert !== 'function') { - throw new Error('The package `encoding` must be installed to use the textConverted() function'); - } - - const ct = headers.get('content-type'); - let charset = 'utf-8'; - let res, str; - - // header - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } - - // no charset in content type, peek at response body for at most 1024 bytes - str = buffer.slice(0, 1024).toString(); - - // html5 - if (!res && str) { - res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; - - this[MAP] = Object.create(null); - - if (init instanceof Headers) { - const rawHeaders = init.raw(); - const headerNames = Object.keys(rawHeaders); - - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } - - return; - } - - // We don't worry about converting prop to ByteString here as append() - // will handle it. - if (init == null) ; else if (typeof init === 'object') { - const method = init[Symbol.iterator]; - if (method != null) { - if (typeof method !== 'function') { - throw new TypeError('Header pairs must be iterable'); - } - - // sequence> - // Note: per spec we have to first exhaust the lists then process them - const pairs = []; - for (const pair of init) { - if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { - throw new TypeError('Each header pair must be iterable'); - } - pairs.push(Array.from(pair)); - } - - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError('Each header pair must be a name/value tuple'); - } - this.append(pair[0], pair[1]); - } - } else { - // record - for (const key of Object.keys(init)) { - const value = init[key]; - this.append(key, value); - } - } - } else { - throw new TypeError('Provided initializer must be an object'); - } - } - - /** - * Return combined header value given name - * - * @param String name Header name - * @return Mixed - */ - get(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key === undefined) { - return null; - } - - return this[MAP][key].join(', '); - } - - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - - let pairs = getHeaders(this); - let i = 0; - while (i < pairs.length) { - var _pairs$i = pairs[i]; - const name = _pairs$i[0], - value = _pairs$i[1]; - - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i++; - } - } - - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - this[MAP][key !== undefined ? key : name] = [value]; - } - - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - if (key !== undefined) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } - } - - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has(name) { - name = `${name}`; - validateName(name); - return find(this[MAP], name) !== undefined; - } - - /** - * Delete all header values given name - * - * @param String name Header name - * @return Void - */ - delete(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key !== undefined) { - delete this[MAP][key]; - } - } - - /** - * Return raw headers (non-spec api) - * - * @return Object - */ - raw() { - return this[MAP]; - } - - /** - * Get an iterator on keys. - * - * @return Iterator - */ - keys() { - return createHeadersIterator(this, 'key'); - } - - /** - * Get an iterator on values. - * - * @return Iterator - */ - values() { - return createHeadersIterator(this, 'value'); - } - - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return Iterator - */ - [Symbol.iterator]() { - return createHeadersIterator(this, 'key+value'); - } -} -Headers.prototype.entries = Headers.prototype[Symbol.iterator]; - -Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: 'Headers', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Headers.prototype, { - get: { enumerable: true }, - forEach: { enumerable: true }, - set: { enumerable: true }, - append: { enumerable: true }, - has: { enumerable: true }, - delete: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true } -}); - -function getHeaders(headers) { - let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; - - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === 'key' ? function (k) { - return k.toLowerCase(); - } : kind === 'value' ? function (k) { - return headers[MAP][k].join(', '); - } : function (k) { - return [k.toLowerCase(), headers[MAP][k].join(', ')]; - }); -} - -const INTERNAL = Symbol('internal'); - -function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator; -} - -const HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - // istanbul ignore if - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError('Value of `this` is not a HeadersIterator'); - } - - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, - kind = _INTERNAL.kind, - index = _INTERNAL.index; - - const values = getHeaders(target, kind); - const len = values.length; - if (index >= len) { - return { - value: undefined, - done: true - }; - } - - this[INTERNAL].index = index + 1; - - return { - value: values[index], - done: false - }; - } -}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: 'HeadersIterator', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * Export the Headers object in a form that Node.js can consume. - * - * @param Headers headers - * @return Object - */ -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); - - // http.request() only supports string as Host header. This hack makes - // specifying custom Host header possible. - const hostHeaderKey = find(headers[MAP], 'Host'); - if (hostHeaderKey !== undefined) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } - - return obj; -} - -/** - * Create a Headers object from an object of headers, ignoring those that do - * not conform to HTTP grammar productions. - * - * @param Object obj Object of headers - * @return Headers - */ -function createHeadersLenient(obj) { - const headers = new Headers(); - for (const name of Object.keys(obj)) { - if (invalidTokenRegex.test(name)) { - continue; - } - if (Array.isArray(obj[name])) { - for (const val of obj[name]) { - if (invalidHeaderCharRegex.test(val)) { - continue; - } - if (headers[MAP][name] === undefined) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); - } - } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } - } - return headers; -} - -const INTERNALS$1 = Symbol('Response internals'); - -// fix an issue where "STATUS_CODES" aren't a named export for node <10 -const STATUS_CODES = http.STATUS_CODES; - -/** - * Response class - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -class Response { - constructor() { - let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - Body.call(this, body, opts); - - const status = opts.status || 200; - const headers = new Headers(opts.headers); - - if (body != null && !headers.has('Content-Type')) { - const contentType = extractContentType(body); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; - } - - get url() { - return this[INTERNALS$1].url || ''; - } - - get status() { - return this[INTERNALS$1].status; - } - - /** - * Convenience property representing if the request ended normally - */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; - } - - get redirected() { - return this[INTERNALS$1].counter > 0; - } - - get statusText() { - return this[INTERNALS$1].statusText; - } - - get headers() { - return this[INTERNALS$1].headers; - } - - /** - * Clone this response - * - * @return Response - */ - clone() { - return new Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected - }); - } -} - -Body.mixIn(Response.prototype); - -Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } -}); - -Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: 'Response', - writable: false, - enumerable: false, - configurable: true -}); - -const INTERNALS$2 = Symbol('Request internals'); - -// fix an issue where "format", "parse" aren't a named export for node <10 -const parse_url = Url.parse; -const format_url = Url.format; - -const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; - -/** - * Check if a value is an instance of Request. - * - * @param Mixed input - * @return Boolean - */ -function isRequest(input) { - return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; -} - -function isAbortSignal(signal) { - const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === 'AbortSignal'); -} - -/** - * Request class - * - * @param Mixed input Url or Request instance - * @param Object init Custom options - * @return Void - */ -class Request { - constructor(input) { - let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - let parsedURL; - - // normalize input - if (!isRequest(input)) { - if (input && input.href) { - // in order to support Node.js' Url objects; though WHATWG's URL objects - // will fall into this branch also (since their `toString()` will return - // `href` property anyway) - parsedURL = parse_url(input.href); - } else { - // coerce input to a string before attempting to parse - parsedURL = parse_url(`${input}`); - } - input = {}; - } else { - parsedURL = parse_url(input.url); - } - - let method = init.method || input.method || 'GET'; - method = method.toUpperCase(); - - if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { - throw new TypeError('Request with GET/HEAD method cannot have body'); - } - - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; - - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }); - - const headers = new Headers(init.headers || input.headers || {}); - - if (inputBody != null && !headers.has('Content-Type')) { - const contentType = extractContentType(inputBody); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - let signal = isRequest(input) ? input.signal : null; - if ('signal' in init) signal = init.signal; - - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError('Expected signal to be an instanceof AbortSignal'); - } - - this[INTERNALS$2] = { - method, - redirect: init.redirect || input.redirect || 'follow', - headers, - parsedURL, - signal - }; - - // node-fetch-only options - this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; - this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; - } - - get method() { - return this[INTERNALS$2].method; - } - - get url() { - return format_url(this[INTERNALS$2].parsedURL); - } - - get headers() { - return this[INTERNALS$2].headers; - } - - get redirect() { - return this[INTERNALS$2].redirect; - } - - get signal() { - return this[INTERNALS$2].signal; - } - - /** - * Clone this request - * - * @return Request - */ - clone() { - return new Request(this); - } -} - -Body.mixIn(Request.prototype); - -Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: 'Request', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Request.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } -}); - -/** - * Convert a Request to Node.js http request options. - * - * @param Request A Request instance - * @return Object The options object to be passed to http.request - */ -function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers(request[INTERNALS$2].headers); - - // fetch step 1.3 - if (!headers.has('Accept')) { - headers.set('Accept', '*/*'); - } - - // Basic fetch - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError('Only absolute URLs are supported'); - } - - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError('Only HTTP(S) protocols are supported'); - } - - if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { - throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); - } - - // HTTP-network-or-cache fetch steps 2.4-2.7 - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = '0'; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - if (typeof totalBytes === 'number') { - contentLengthValue = String(totalBytes); - } - } - if (contentLengthValue) { - headers.set('Content-Length', contentLengthValue); - } - - // HTTP-network-or-cache fetch step 2.11 - if (!headers.has('User-Agent')) { - headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); - } - - // HTTP-network-or-cache fetch step 2.15 - if (request.compress && !headers.has('Accept-Encoding')) { - headers.set('Accept-Encoding', 'gzip,deflate'); - } - - let agent = request.agent; - if (typeof agent === 'function') { - agent = agent(parsedURL); - } - - if (!headers.has('Connection') && !agent) { - headers.set('Connection', 'close'); - } - - // HTTP-network fetch step 4.2 - // chunked encoding is handled by Node.js - - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); -} - -/** - * abort-error.js - * - * AbortError interface for cancelled requests - */ - -/** - * Create AbortError instance - * - * @param String message Error message for human - * @return AbortError - */ -function AbortError(message) { - Error.call(this, message); - - this.type = 'aborted'; - this.message = message; - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -AbortError.prototype = Object.create(Error.prototype); -AbortError.prototype.constructor = AbortError; -AbortError.prototype.name = 'AbortError'; - -// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 -const PassThrough$1 = Stream.PassThrough; -const resolve_url = Url.resolve; - -/** - * Fetch function - * - * @param Mixed url Absolute url or Request instance - * @param Object opts Fetch options - * @return Promise - */ -function fetch(url, opts) { - - // allow custom promise - if (!fetch.Promise) { - throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); - } - - Body.Promise = fetch.Promise; - - // wrap http.request into fetch - return new fetch.Promise(function (resolve, reject) { - // build request object - const request = new Request(url, opts); - const options = getNodeRequestOptions(request); - - const send = (options.protocol === 'https:' ? https : http).request; - const signal = request.signal; - - let response = null; - - const abort = function abort() { - let error = new AbortError('The user aborted a request.'); - reject(error); - if (request.body && request.body instanceof Stream.Readable) { - request.body.destroy(error); - } - if (!response || !response.body) return; - response.body.emit('error', error); - }; - - if (signal && signal.aborted) { - abort(); - return; - } - - const abortAndFinalize = function abortAndFinalize() { - abort(); - finalize(); - }; - - // send request - const req = send(options); - let reqTimeout; - - if (signal) { - signal.addEventListener('abort', abortAndFinalize); - } - - function finalize() { - req.abort(); - if (signal) signal.removeEventListener('abort', abortAndFinalize); - clearTimeout(reqTimeout); - } - - if (request.timeout) { - req.once('socket', function (socket) { - reqTimeout = setTimeout(function () { - reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); - finalize(); - }, request.timeout); - }); - } - - req.on('error', function (err) { - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); - finalize(); - }); - - req.on('response', function (res) { - clearTimeout(reqTimeout); - - const headers = createHeadersLenient(res.headers); - - // HTTP fetch step 5 - if (fetch.isRedirect(res.statusCode)) { - // HTTP fetch step 5.2 - const location = headers.get('Location'); - - // HTTP fetch step 5.3 - const locationURL = location === null ? null : resolve_url(request.url, location); - - // HTTP fetch step 5.5 - switch (request.redirect) { - case 'error': - reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); - finalize(); - return; - case 'manual': - // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. - if (locationURL !== null) { - // handle corrupted header - try { - headers.set('Location', locationURL); - } catch (err) { - // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request - reject(err); - } - } - break; - case 'follow': - // HTTP-redirect fetch step 2 - if (locationURL === null) { - break; - } - - // HTTP-redirect fetch step 5 - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 6 (counter increment) - // Create a new Request object. - const requestOpts = { - headers: new Headers(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout, - size: request.size - }; - - // HTTP-redirect fetch step 9 - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { - reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 11 - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { - requestOpts.method = 'GET'; - requestOpts.body = undefined; - requestOpts.headers.delete('content-length'); - } - - // HTTP-redirect fetch step 15 - resolve(fetch(new Request(locationURL, requestOpts))); - finalize(); - return; - } - } - - // prepare response - res.once('end', function () { - if (signal) signal.removeEventListener('abort', abortAndFinalize); - }); - let body = res.pipe(new PassThrough$1()); - - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers: headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; - - // HTTP-network fetch step 12.1.1.3 - const codings = headers.get('Content-Encoding'); - - // HTTP-network fetch step 12.1.1.4: handle content codings - - // in following scenarios we ignore compression support - // 1. compression support is disabled - // 2. HEAD request - // 3. no Content-Encoding header - // 4. no content response (204) - // 5. content not modified response (304) - if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body, response_options); - resolve(response); - return; - } - - // For Node v6+ - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - const zlibOptions = { - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH - }; - - // for gzip - if (codings == 'gzip' || codings == 'x-gzip') { - body = body.pipe(zlib.createGunzip(zlibOptions)); - response = new Response(body, response_options); - resolve(response); - return; - } - - // for deflate - if (codings == 'deflate' || codings == 'x-deflate') { - // handle the infamous raw deflate response from old servers - // a hack for old IIS and Apache servers - const raw = res.pipe(new PassThrough$1()); - raw.once('data', function (chunk) { - // see http://stackoverflow.com/questions/37519828 - if ((chunk[0] & 0x0F) === 0x08) { - body = body.pipe(zlib.createInflate()); - } else { - body = body.pipe(zlib.createInflateRaw()); - } - response = new Response(body, response_options); - resolve(response); - }); - return; - } - - // for br - if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { - body = body.pipe(zlib.createBrotliDecompress()); - response = new Response(body, response_options); - resolve(response); - return; - } - - // otherwise, use response as-is - response = new Response(body, response_options); - resolve(response); - }); - - writeToStream(req, request); - }); -} -/** - * Redirect code matching - * - * @param Number code Status code - * @return Boolean - */ -fetch.isRedirect = function (code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; -}; - -// expose Promise -fetch.Promise = global.Promise; - -module.exports = exports = fetch; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.default = exports; -exports.Headers = Headers; -exports.Request = Request; -exports.Response = Response; -exports.FetchError = FetchError; - - -/***/ }), - -/***/ 877: -/***/ ((module) => { - -module.exports = eval("require")("encoding"); - - -/***/ }), - -/***/ 747: -/***/ ((module) => { - -"use strict"; -module.exports = require("fs"); - -/***/ }), - -/***/ 605: -/***/ ((module) => { - -"use strict"; -module.exports = require("http"); - -/***/ }), - -/***/ 211: -/***/ ((module) => { - -"use strict"; -module.exports = require("https"); - -/***/ }), - -/***/ 87: -/***/ ((module) => { - -"use strict"; -module.exports = require("os"); - -/***/ }), - -/***/ 622: -/***/ ((module) => { - -"use strict"; -module.exports = require("path"); - -/***/ }), - -/***/ 413: -/***/ ((module) => { - -"use strict"; -module.exports = require("stream"); - -/***/ }), - -/***/ 835: -/***/ ((module) => { - -"use strict"; -module.exports = require("url"); - -/***/ }), - -/***/ 761: -/***/ ((module) => { - -"use strict"; -module.exports = require("zlib"); - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // 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. -(() => { -const core = __nccwpck_require__(186); -const fetch = __nccwpck_require__(467); -const apiUri = 'https://api.cloudways.com/api/v1'; - -async function getOauthToken() { - const body = { - email: core.getInput('email'), - api_key: core.getInput('api-key') - }; - - const options = { - method: 'POST', - body: JSON.stringify(body), - headers: { - 'Content-Type': 'application/json' - } - }; - - return await fetch(`${ apiUri }/oauth/access_token`, options).then(res => res.json()); -} - -async function deployChanges(token) { - const body = { - server_id: core.getInput('server-id'), - app_id: core.getInput('app-id'), - branch_name: core.getInput('branch-name'), - deploy_path: core.getInput('deploy-path'), - }; - - const options = { - method: 'POST', - body: JSON.stringify(body), - headers: { - 'Content-Type': 'application/json', - 'Authorization': `Bearer ${ token }` - } - }; - - return await fetch(`${ apiUri }/git/pull`, options).then(response => { - return response.json().then(data => { - return { - ok: response.ok, - code: response.status, - body: data - } - }); - }); -} - -async function run() { - try { - const oauthToken = await getOauthToken(); - - if (oauthToken.error) { - throw new Error(oauthToken.error_description); - } - - if (!oauthToken.access_token || oauthToken.access_token === '') { - throw new Error('The access token does not exist.'); - } - - await deployChanges(oauthToken.access_token).then(response => { - if (!response.ok) { - throw new Error(response.body.error_description); - } - - core.info(`Success. Operation ID: ${ response.body.operation_id }`); - core.setOutput('operation', response.body.operation_id); - }); - } catch (error) { - core.setFailed(error.message); - } -} - -run(); - -})(); - -module.exports = __webpack_exports__; -/******/ })() -; \ No newline at end of file +var t={7351:function(t,r,n){var o=this&&this.__createBinding||(Object.create?function(t,r,n,o){if(o===undefined)o=n;Object.defineProperty(t,o,{enumerable:true,get:function(){return r[n]}})}:function(t,r,n,o){if(o===undefined)o=n;t[o]=r[n]});var a=this&&this.__setModuleDefault||(Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:true,value:r})}:function(t,r){t["default"]=r});var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n in t)if(n!=="default"&&Object.hasOwnProperty.call(t,n))o(r,t,n);a(r,t);return r};Object.defineProperty(r,"__esModule",{value:true});r.issue=r.issueCommand=void 0;const s=i(n(2037));const l=n(5278);function issueCommand(t,r,n){const o=new Command(t,r,n);process.stdout.write(o.toString()+s.EOL)}r.issueCommand=issueCommand;function issue(t,r=""){issueCommand(t,{},r)}r.issue=issue;const u="::";class Command{constructor(t,r,n){if(!t){t="missing.command"}this.command=t;this.properties=r;this.message=n}toString(){let t=u+this.command;if(this.properties&&Object.keys(this.properties).length>0){t+=" ";let r=true;for(const n in this.properties){if(this.properties.hasOwnProperty(n)){const o=this.properties[n];if(o){if(r){r=false}else{t+=","}t+=`${n}=${escapeProperty(o)}`}}}}t+=`${u}${escapeData(this.message)}`;return t}}function escapeData(t){return l.toCommandValue(t).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(t){return l.toCommandValue(t).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(t,r,n){var o=this&&this.__createBinding||(Object.create?function(t,r,n,o){if(o===undefined)o=n;Object.defineProperty(t,o,{enumerable:true,get:function(){return r[n]}})}:function(t,r,n,o){if(o===undefined)o=n;t[o]=r[n]});var a=this&&this.__setModuleDefault||(Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:true,value:r})}:function(t,r){t["default"]=r});var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n in t)if(n!=="default"&&Object.hasOwnProperty.call(t,n))o(r,t,n);a(r,t);return r};var s=this&&this.__awaiter||function(t,r,n,o){function adopt(t){return t instanceof n?t:new n((function(r){r(t)}))}return new(n||(n=Promise))((function(n,a){function fulfilled(t){try{step(o.next(t))}catch(t){a(t)}}function rejected(t){try{step(o["throw"](t))}catch(t){a(t)}}function step(t){t.done?n(t.value):adopt(t.value).then(fulfilled,rejected)}step((o=o.apply(t,r||[])).next())}))};Object.defineProperty(r,"__esModule",{value:true});r.getIDToken=r.getState=r.saveState=r.group=r.endGroup=r.startGroup=r.info=r.notice=r.warning=r.error=r.debug=r.isDebug=r.setFailed=r.setCommandEcho=r.setOutput=r.getBooleanInput=r.getMultilineInput=r.getInput=r.addPath=r.setSecret=r.exportVariable=r.ExitCode=void 0;const l=n(7351);const u=n(717);const d=n(5278);const c=i(n(2037));const m=i(n(1017));const h=n(8041);var p;(function(t){t[t["Success"]=0]="Success";t[t["Failure"]=1]="Failure"})(p=r.ExitCode||(r.ExitCode={}));function exportVariable(t,r){const n=d.toCommandValue(r);process.env[t]=n;const o=process.env["GITHUB_ENV"]||"";if(o){return u.issueFileCommand("ENV",u.prepareKeyValueMessage(t,r))}l.issueCommand("set-env",{name:t},n)}r.exportVariable=exportVariable;function setSecret(t){l.issueCommand("add-mask",{},t)}r.setSecret=setSecret;function addPath(t){const r=process.env["GITHUB_PATH"]||"";if(r){u.issueFileCommand("PATH",t)}else{l.issueCommand("add-path",{},t)}process.env["PATH"]=`${t}${m.delimiter}${process.env["PATH"]}`}r.addPath=addPath;function getInput(t,r){const n=process.env[`INPUT_${t.replace(/ /g,"_").toUpperCase()}`]||"";if(r&&r.required&&!n){throw new Error(`Input required and not supplied: ${t}`)}if(r&&r.trimWhitespace===false){return n}return n.trim()}r.getInput=getInput;function getMultilineInput(t,r){const n=getInput(t,r).split("\n").filter((t=>t!==""));if(r&&r.trimWhitespace===false){return n}return n.map((t=>t.trim()))}r.getMultilineInput=getMultilineInput;function getBooleanInput(t,r){const n=["true","True","TRUE"];const o=["false","False","FALSE"];const a=getInput(t,r);if(n.includes(a))return true;if(o.includes(a))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${t}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}r.getBooleanInput=getBooleanInput;function setOutput(t,r){const n=process.env["GITHUB_OUTPUT"]||"";if(n){return u.issueFileCommand("OUTPUT",u.prepareKeyValueMessage(t,r))}process.stdout.write(c.EOL);l.issueCommand("set-output",{name:t},d.toCommandValue(r))}r.setOutput=setOutput;function setCommandEcho(t){l.issue("echo",t?"on":"off")}r.setCommandEcho=setCommandEcho;function setFailed(t){process.exitCode=p.Failure;error(t)}r.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}r.isDebug=isDebug;function debug(t){l.issueCommand("debug",{},t)}r.debug=debug;function error(t,r={}){l.issueCommand("error",d.toCommandProperties(r),t instanceof Error?t.toString():t)}r.error=error;function warning(t,r={}){l.issueCommand("warning",d.toCommandProperties(r),t instanceof Error?t.toString():t)}r.warning=warning;function notice(t,r={}){l.issueCommand("notice",d.toCommandProperties(r),t instanceof Error?t.toString():t)}r.notice=notice;function info(t){process.stdout.write(t+c.EOL)}r.info=info;function startGroup(t){l.issue("group",t)}r.startGroup=startGroup;function endGroup(){l.issue("endgroup")}r.endGroup=endGroup;function group(t,r){return s(this,void 0,void 0,(function*(){startGroup(t);let n;try{n=yield r()}finally{endGroup()}return n}))}r.group=group;function saveState(t,r){const n=process.env["GITHUB_STATE"]||"";if(n){return u.issueFileCommand("STATE",u.prepareKeyValueMessage(t,r))}l.issueCommand("save-state",{name:t},d.toCommandValue(r))}r.saveState=saveState;function getState(t){return process.env[`STATE_${t}`]||""}r.getState=getState;function getIDToken(t){return s(this,void 0,void 0,(function*(){return yield h.OidcClient.getIDToken(t)}))}r.getIDToken=getIDToken;var b=n(1327);Object.defineProperty(r,"summary",{enumerable:true,get:function(){return b.summary}});var y=n(1327);Object.defineProperty(r,"markdownSummary",{enumerable:true,get:function(){return y.markdownSummary}});var S=n(2981);Object.defineProperty(r,"toPosixPath",{enumerable:true,get:function(){return S.toPosixPath}});Object.defineProperty(r,"toWin32Path",{enumerable:true,get:function(){return S.toWin32Path}});Object.defineProperty(r,"toPlatformPath",{enumerable:true,get:function(){return S.toPlatformPath}})},717:function(t,r,n){var o=this&&this.__createBinding||(Object.create?function(t,r,n,o){if(o===undefined)o=n;Object.defineProperty(t,o,{enumerable:true,get:function(){return r[n]}})}:function(t,r,n,o){if(o===undefined)o=n;t[o]=r[n]});var a=this&&this.__setModuleDefault||(Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:true,value:r})}:function(t,r){t["default"]=r});var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n in t)if(n!=="default"&&Object.hasOwnProperty.call(t,n))o(r,t,n);a(r,t);return r};Object.defineProperty(r,"__esModule",{value:true});r.prepareKeyValueMessage=r.issueFileCommand=void 0;const s=i(n(7147));const l=i(n(2037));const u=n(5840);const d=n(5278);function issueFileCommand(t,r){const n=process.env[`GITHUB_${t}`];if(!n){throw new Error(`Unable to find environment variable for file command ${t}`)}if(!s.existsSync(n)){throw new Error(`Missing file at path: ${n}`)}s.appendFileSync(n,`${d.toCommandValue(r)}${l.EOL}`,{encoding:"utf8"})}r.issueFileCommand=issueFileCommand;function prepareKeyValueMessage(t,r){const n=`ghadelimiter_${u.v4()}`;const o=d.toCommandValue(r);if(t.includes(n)){throw new Error(`Unexpected input: name should not contain the delimiter "${n}"`)}if(o.includes(n)){throw new Error(`Unexpected input: value should not contain the delimiter "${n}"`)}return`${t}<<${n}${l.EOL}${o}${l.EOL}${n}`}r.prepareKeyValueMessage=prepareKeyValueMessage},8041:function(t,r,n){var o=this&&this.__awaiter||function(t,r,n,o){function adopt(t){return t instanceof n?t:new n((function(r){r(t)}))}return new(n||(n=Promise))((function(n,a){function fulfilled(t){try{step(o.next(t))}catch(t){a(t)}}function rejected(t){try{step(o["throw"](t))}catch(t){a(t)}}function step(t){t.done?n(t.value):adopt(t.value).then(fulfilled,rejected)}step((o=o.apply(t,r||[])).next())}))};Object.defineProperty(r,"__esModule",{value:true});r.OidcClient=void 0;const a=n(6255);const i=n(5526);const s=n(2186);class OidcClient{static createHttpClient(t=true,r=10){const n={allowRetries:t,maxRetries:r};return new a.HttpClient("actions/oidc-client",[new i.BearerCredentialHandler(OidcClient.getRequestToken())],n)}static getRequestToken(){const t=process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];if(!t){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable")}return t}static getIDTokenUrl(){const t=process.env["ACTIONS_ID_TOKEN_REQUEST_URL"];if(!t){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable")}return t}static getCall(t){var r;return o(this,void 0,void 0,(function*(){const n=OidcClient.createHttpClient();const o=yield n.getJson(t).catch((t=>{throw new Error(`Failed to get ID Token. \n \n Error Code : ${t.statusCode}\n \n Error Message: ${t.result.message}`)}));const a=(r=o.result)===null||r===void 0?void 0:r.value;if(!a){throw new Error("Response json body do not have ID Token field")}return a}))}static getIDToken(t){return o(this,void 0,void 0,(function*(){try{let r=OidcClient.getIDTokenUrl();if(t){const n=encodeURIComponent(t);r=`${r}&audience=${n}`}s.debug(`ID token url is ${r}`);const n=yield OidcClient.getCall(r);s.setSecret(n);return n}catch(t){throw new Error(`Error message: ${t.message}`)}}))}}r.OidcClient=OidcClient},2981:function(t,r,n){var o=this&&this.__createBinding||(Object.create?function(t,r,n,o){if(o===undefined)o=n;Object.defineProperty(t,o,{enumerable:true,get:function(){return r[n]}})}:function(t,r,n,o){if(o===undefined)o=n;t[o]=r[n]});var a=this&&this.__setModuleDefault||(Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:true,value:r})}:function(t,r){t["default"]=r});var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n in t)if(n!=="default"&&Object.hasOwnProperty.call(t,n))o(r,t,n);a(r,t);return r};Object.defineProperty(r,"__esModule",{value:true});r.toPlatformPath=r.toWin32Path=r.toPosixPath=void 0;const s=i(n(1017));function toPosixPath(t){return t.replace(/[\\]/g,"/")}r.toPosixPath=toPosixPath;function toWin32Path(t){return t.replace(/[/]/g,"\\")}r.toWin32Path=toWin32Path;function toPlatformPath(t){return t.replace(/[/\\]/g,s.sep)}r.toPlatformPath=toPlatformPath},1327:function(t,r,n){var o=this&&this.__awaiter||function(t,r,n,o){function adopt(t){return t instanceof n?t:new n((function(r){r(t)}))}return new(n||(n=Promise))((function(n,a){function fulfilled(t){try{step(o.next(t))}catch(t){a(t)}}function rejected(t){try{step(o["throw"](t))}catch(t){a(t)}}function step(t){t.done?n(t.value):adopt(t.value).then(fulfilled,rejected)}step((o=o.apply(t,r||[])).next())}))};Object.defineProperty(r,"__esModule",{value:true});r.summary=r.markdownSummary=r.SUMMARY_DOCS_URL=r.SUMMARY_ENV_VAR=void 0;const a=n(2037);const i=n(7147);const{access:s,appendFile:l,writeFile:u}=i.promises;r.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";r.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class Summary{constructor(){this._buffer=""}filePath(){return o(this,void 0,void 0,(function*(){if(this._filePath){return this._filePath}const t=process.env[r.SUMMARY_ENV_VAR];if(!t){throw new Error(`Unable to find environment variable for $${r.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`)}try{yield s(t,i.constants.R_OK|i.constants.W_OK)}catch(r){throw new Error(`Unable to access summary file: '${t}'. Check if the file has correct read/write permissions.`)}this._filePath=t;return this._filePath}))}wrap(t,r,n={}){const o=Object.entries(n).map((([t,r])=>` ${t}="${r}"`)).join("");if(!r){return`<${t}${o}>`}return`<${t}${o}>${r}`}write(t){return o(this,void 0,void 0,(function*(){const r=!!(t===null||t===void 0?void 0:t.overwrite);const n=yield this.filePath();const o=r?u:l;yield o(n,this._buffer,{encoding:"utf8"});return this.emptyBuffer()}))}clear(){return o(this,void 0,void 0,(function*(){return this.emptyBuffer().write({overwrite:true})}))}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){this._buffer="";return this}addRaw(t,r=false){this._buffer+=t;return r?this.addEOL():this}addEOL(){return this.addRaw(a.EOL)}addCodeBlock(t,r){const n=Object.assign({},r&&{lang:r});const o=this.wrap("pre",this.wrap("code",t),n);return this.addRaw(o).addEOL()}addList(t,r=false){const n=r?"ol":"ul";const o=t.map((t=>this.wrap("li",t))).join("");const a=this.wrap(n,o);return this.addRaw(a).addEOL()}addTable(t){const r=t.map((t=>{const r=t.map((t=>{if(typeof t==="string"){return this.wrap("td",t)}const{header:r,data:n,colspan:o,rowspan:a}=t;const i=r?"th":"td";const s=Object.assign(Object.assign({},o&&{colspan:o}),a&&{rowspan:a});return this.wrap(i,n,s)})).join("");return this.wrap("tr",r)})).join("");const n=this.wrap("table",r);return this.addRaw(n).addEOL()}addDetails(t,r){const n=this.wrap("details",this.wrap("summary",t)+r);return this.addRaw(n).addEOL()}addImage(t,r,n){const{width:o,height:a}=n||{};const i=Object.assign(Object.assign({},o&&{width:o}),a&&{height:a});const s=this.wrap("img",null,Object.assign({src:t,alt:r},i));return this.addRaw(s).addEOL()}addHeading(t,r){const n=`h${r}`;const o=["h1","h2","h3","h4","h5","h6"].includes(n)?n:"h1";const a=this.wrap(o,t);return this.addRaw(a).addEOL()}addSeparator(){const t=this.wrap("hr",null);return this.addRaw(t).addEOL()}addBreak(){const t=this.wrap("br",null);return this.addRaw(t).addEOL()}addQuote(t,r){const n=Object.assign({},r&&{cite:r});const o=this.wrap("blockquote",t,n);return this.addRaw(o).addEOL()}addLink(t,r){const n=this.wrap("a",t,{href:r});return this.addRaw(n).addEOL()}}const d=new Summary;r.markdownSummary=d;r.summary=d},5278:(t,r)=>{Object.defineProperty(r,"__esModule",{value:true});r.toCommandProperties=r.toCommandValue=void 0;function toCommandValue(t){if(t===null||t===undefined){return""}else if(typeof t==="string"||t instanceof String){return t}return JSON.stringify(t)}r.toCommandValue=toCommandValue;function toCommandProperties(t){if(!Object.keys(t).length){return{}}return{title:t.title,file:t.file,line:t.startLine,endLine:t.endLine,col:t.startColumn,endColumn:t.endColumn}}r.toCommandProperties=toCommandProperties},5526:function(t,r){var n=this&&this.__awaiter||function(t,r,n,o){function adopt(t){return t instanceof n?t:new n((function(r){r(t)}))}return new(n||(n=Promise))((function(n,a){function fulfilled(t){try{step(o.next(t))}catch(t){a(t)}}function rejected(t){try{step(o["throw"](t))}catch(t){a(t)}}function step(t){t.done?n(t.value):adopt(t.value).then(fulfilled,rejected)}step((o=o.apply(t,r||[])).next())}))};Object.defineProperty(r,"__esModule",{value:true});r.PersonalAccessTokenCredentialHandler=r.BearerCredentialHandler=r.BasicCredentialHandler=void 0;class BasicCredentialHandler{constructor(t,r){this.username=t;this.password=r}prepareRequest(t){if(!t.headers){throw Error("The request has no headers")}t.headers["Authorization"]=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return n(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}r.BasicCredentialHandler=BasicCredentialHandler;class BearerCredentialHandler{constructor(t){this.token=t}prepareRequest(t){if(!t.headers){throw Error("The request has no headers")}t.headers["Authorization"]=`Bearer ${this.token}`}canHandleAuthentication(){return false}handleAuthentication(){return n(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}r.BearerCredentialHandler=BearerCredentialHandler;class PersonalAccessTokenCredentialHandler{constructor(t){this.token=t}prepareRequest(t){if(!t.headers){throw Error("The request has no headers")}t.headers["Authorization"]=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return n(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}r.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler},6255:function(t,r,n){var o=this&&this.__createBinding||(Object.create?function(t,r,n,o){if(o===undefined)o=n;Object.defineProperty(t,o,{enumerable:true,get:function(){return r[n]}})}:function(t,r,n,o){if(o===undefined)o=n;t[o]=r[n]});var a=this&&this.__setModuleDefault||(Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:true,value:r})}:function(t,r){t["default"]=r});var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n in t)if(n!=="default"&&Object.hasOwnProperty.call(t,n))o(r,t,n);a(r,t);return r};var s=this&&this.__awaiter||function(t,r,n,o){function adopt(t){return t instanceof n?t:new n((function(r){r(t)}))}return new(n||(n=Promise))((function(n,a){function fulfilled(t){try{step(o.next(t))}catch(t){a(t)}}function rejected(t){try{step(o["throw"](t))}catch(t){a(t)}}function step(t){t.done?n(t.value):adopt(t.value).then(fulfilled,rejected)}step((o=o.apply(t,r||[])).next())}))};Object.defineProperty(r,"__esModule",{value:true});r.HttpClient=r.isHttps=r.HttpClientResponse=r.HttpClientError=r.getProxyUrl=r.MediaTypes=r.Headers=r.HttpCodes=void 0;const l=i(n(3685));const u=i(n(5687));const d=i(n(9835));const c=i(n(4294));var m;(function(t){t[t["OK"]=200]="OK";t[t["MultipleChoices"]=300]="MultipleChoices";t[t["MovedPermanently"]=301]="MovedPermanently";t[t["ResourceMoved"]=302]="ResourceMoved";t[t["SeeOther"]=303]="SeeOther";t[t["NotModified"]=304]="NotModified";t[t["UseProxy"]=305]="UseProxy";t[t["SwitchProxy"]=306]="SwitchProxy";t[t["TemporaryRedirect"]=307]="TemporaryRedirect";t[t["PermanentRedirect"]=308]="PermanentRedirect";t[t["BadRequest"]=400]="BadRequest";t[t["Unauthorized"]=401]="Unauthorized";t[t["PaymentRequired"]=402]="PaymentRequired";t[t["Forbidden"]=403]="Forbidden";t[t["NotFound"]=404]="NotFound";t[t["MethodNotAllowed"]=405]="MethodNotAllowed";t[t["NotAcceptable"]=406]="NotAcceptable";t[t["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";t[t["RequestTimeout"]=408]="RequestTimeout";t[t["Conflict"]=409]="Conflict";t[t["Gone"]=410]="Gone";t[t["TooManyRequests"]=429]="TooManyRequests";t[t["InternalServerError"]=500]="InternalServerError";t[t["NotImplemented"]=501]="NotImplemented";t[t["BadGateway"]=502]="BadGateway";t[t["ServiceUnavailable"]=503]="ServiceUnavailable";t[t["GatewayTimeout"]=504]="GatewayTimeout"})(m=r.HttpCodes||(r.HttpCodes={}));var h;(function(t){t["Accept"]="accept";t["ContentType"]="content-type"})(h=r.Headers||(r.Headers={}));var p;(function(t){t["ApplicationJson"]="application/json"})(p=r.MediaTypes||(r.MediaTypes={}));function getProxyUrl(t){const r=d.getProxyUrl(new URL(t));return r?r.href:""}r.getProxyUrl=getProxyUrl;const b=[m.MovedPermanently,m.ResourceMoved,m.SeeOther,m.TemporaryRedirect,m.PermanentRedirect];const y=[m.BadGateway,m.ServiceUnavailable,m.GatewayTimeout];const S=["OPTIONS","GET","DELETE","HEAD"];const R=10;const g=5;class HttpClientError extends Error{constructor(t,r){super(t);this.name="HttpClientError";this.statusCode=r;Object.setPrototypeOf(this,HttpClientError.prototype)}}r.HttpClientError=HttpClientError;class HttpClientResponse{constructor(t){this.message=t}readBody(){return s(this,void 0,void 0,(function*(){return new Promise((t=>s(this,void 0,void 0,(function*(){let r=Buffer.alloc(0);this.message.on("data",(t=>{r=Buffer.concat([r,t])}));this.message.on("end",(()=>{t(r.toString())}))}))))}))}}r.HttpClientResponse=HttpClientResponse;function isHttps(t){const r=new URL(t);return r.protocol==="https:"}r.isHttps=isHttps;class HttpClient{constructor(t,r,n){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=t;this.handlers=r||[];this.requestOptions=n;if(n){if(n.ignoreSslError!=null){this._ignoreSslError=n.ignoreSslError}this._socketTimeout=n.socketTimeout;if(n.allowRedirects!=null){this._allowRedirects=n.allowRedirects}if(n.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=n.allowRedirectDowngrade}if(n.maxRedirects!=null){this._maxRedirects=Math.max(n.maxRedirects,0)}if(n.keepAlive!=null){this._keepAlive=n.keepAlive}if(n.allowRetries!=null){this._allowRetries=n.allowRetries}if(n.maxRetries!=null){this._maxRetries=n.maxRetries}}}options(t,r){return s(this,void 0,void 0,(function*(){return this.request("OPTIONS",t,null,r||{})}))}get(t,r){return s(this,void 0,void 0,(function*(){return this.request("GET",t,null,r||{})}))}del(t,r){return s(this,void 0,void 0,(function*(){return this.request("DELETE",t,null,r||{})}))}post(t,r,n){return s(this,void 0,void 0,(function*(){return this.request("POST",t,r,n||{})}))}patch(t,r,n){return s(this,void 0,void 0,(function*(){return this.request("PATCH",t,r,n||{})}))}put(t,r,n){return s(this,void 0,void 0,(function*(){return this.request("PUT",t,r,n||{})}))}head(t,r){return s(this,void 0,void 0,(function*(){return this.request("HEAD",t,null,r||{})}))}sendStream(t,r,n,o){return s(this,void 0,void 0,(function*(){return this.request(t,r,n,o)}))}getJson(t,r={}){return s(this,void 0,void 0,(function*(){r[h.Accept]=this._getExistingOrDefaultHeader(r,h.Accept,p.ApplicationJson);const n=yield this.get(t,r);return this._processResponse(n,this.requestOptions)}))}postJson(t,r,n={}){return s(this,void 0,void 0,(function*(){const o=JSON.stringify(r,null,2);n[h.Accept]=this._getExistingOrDefaultHeader(n,h.Accept,p.ApplicationJson);n[h.ContentType]=this._getExistingOrDefaultHeader(n,h.ContentType,p.ApplicationJson);const a=yield this.post(t,o,n);return this._processResponse(a,this.requestOptions)}))}putJson(t,r,n={}){return s(this,void 0,void 0,(function*(){const o=JSON.stringify(r,null,2);n[h.Accept]=this._getExistingOrDefaultHeader(n,h.Accept,p.ApplicationJson);n[h.ContentType]=this._getExistingOrDefaultHeader(n,h.ContentType,p.ApplicationJson);const a=yield this.put(t,o,n);return this._processResponse(a,this.requestOptions)}))}patchJson(t,r,n={}){return s(this,void 0,void 0,(function*(){const o=JSON.stringify(r,null,2);n[h.Accept]=this._getExistingOrDefaultHeader(n,h.Accept,p.ApplicationJson);n[h.ContentType]=this._getExistingOrDefaultHeader(n,h.ContentType,p.ApplicationJson);const a=yield this.patch(t,o,n);return this._processResponse(a,this.requestOptions)}))}request(t,r,n,o){return s(this,void 0,void 0,(function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const a=new URL(r);let i=this._prepareRequest(t,a,o);const s=this._allowRetries&&S.includes(t)?this._maxRetries+1:1;let l=0;let u;do{u=yield this.requestRaw(i,n);if(u&&u.message&&u.message.statusCode===m.Unauthorized){let t;for(const r of this.handlers){if(r.canHandleAuthentication(u)){t=r;break}}if(t){return t.handleAuthentication(this,i,n)}else{return u}}let r=this._maxRedirects;while(u.message.statusCode&&b.includes(u.message.statusCode)&&this._allowRedirects&&r>0){const s=u.message.headers["location"];if(!s){break}const l=new URL(s);if(a.protocol==="https:"&&a.protocol!==l.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.")}yield u.readBody();if(l.hostname!==a.hostname){for(const t in o){if(t.toLowerCase()==="authorization"){delete o[t]}}}i=this._prepareRequest(t,l,o);u=yield this.requestRaw(i,n);r--}if(!u.message.statusCode||!y.includes(u.message.statusCode)){return u}l+=1;if(l{function callbackForResult(t,r){if(t){o(t)}else if(!r){o(new Error("Unknown error"))}else{n(r)}}this.requestRawWithCallback(t,r,callbackForResult)}))}))}requestRawWithCallback(t,r,n){if(typeof r==="string"){if(!t.options.headers){t.options.headers={}}t.options.headers["Content-Length"]=Buffer.byteLength(r,"utf8")}let o=false;function handleResult(t,r){if(!o){o=true;n(t,r)}}const a=t.httpModule.request(t.options,(t=>{const r=new HttpClientResponse(t);handleResult(undefined,r)}));let i;a.on("socket",(t=>{i=t}));a.setTimeout(this._socketTimeout||3*6e4,(()=>{if(i){i.end()}handleResult(new Error(`Request timeout: ${t.options.path}`))}));a.on("error",(function(t){handleResult(t)}));if(r&&typeof r==="string"){a.write(r,"utf8")}if(r&&typeof r!=="string"){r.on("close",(function(){a.end()}));r.pipe(a)}else{a.end()}}getAgent(t){const r=new URL(t);return this._getAgent(r)}_prepareRequest(t,r,n){const o={};o.parsedUrl=r;const a=o.parsedUrl.protocol==="https:";o.httpModule=a?u:l;const i=a?443:80;o.options={};o.options.host=o.parsedUrl.hostname;o.options.port=o.parsedUrl.port?parseInt(o.parsedUrl.port):i;o.options.path=(o.parsedUrl.pathname||"")+(o.parsedUrl.search||"");o.options.method=t;o.options.headers=this._mergeHeaders(n);if(this.userAgent!=null){o.options.headers["user-agent"]=this.userAgent}o.options.agent=this._getAgent(o.parsedUrl);if(this.handlers){for(const t of this.handlers){t.prepareRequest(o.options)}}return o}_mergeHeaders(t){if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(t||{}))}return lowercaseKeys(t||{})}_getExistingOrDefaultHeader(t,r,n){let o;if(this.requestOptions&&this.requestOptions.headers){o=lowercaseKeys(this.requestOptions.headers)[r]}return t[r]||o||n}_getAgent(t){let r;const n=d.getProxyUrl(t);const o=n&&n.hostname;if(this._keepAlive&&o){r=this._proxyAgent}if(this._keepAlive&&!o){r=this._agent}if(r){return r}const a=t.protocol==="https:";let i=100;if(this.requestOptions){i=this.requestOptions.maxSockets||l.globalAgent.maxSockets}if(n&&n.hostname){const t={maxSockets:i,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`}),{host:n.hostname,port:n.port})};let o;const s=n.protocol==="https:";if(a){o=s?c.httpsOverHttps:c.httpsOverHttp}else{o=s?c.httpOverHttps:c.httpOverHttp}r=o(t);this._proxyAgent=r}if(this._keepAlive&&!r){const t={keepAlive:this._keepAlive,maxSockets:i};r=a?new u.Agent(t):new l.Agent(t);this._agent=r}if(!r){r=a?u.globalAgent:l.globalAgent}if(a&&this._ignoreSslError){r.options=Object.assign(r.options||{},{rejectUnauthorized:false})}return r}_performExponentialBackoff(t){return s(this,void 0,void 0,(function*(){t=Math.min(R,t);const r=g*Math.pow(2,t);return new Promise((t=>setTimeout((()=>t()),r)))}))}_processResponse(t,r){return s(this,void 0,void 0,(function*(){return new Promise(((n,o)=>s(this,void 0,void 0,(function*(){const a=t.message.statusCode||0;const i={statusCode:a,result:null,headers:{}};if(a===m.NotFound){n(i)}function dateTimeDeserializer(t,r){if(typeof r==="string"){const t=new Date(r);if(!isNaN(t.valueOf())){return t}}return r}let s;let l;try{l=yield t.readBody();if(l&&l.length>0){if(r&&r.deserializeDates){s=JSON.parse(l,dateTimeDeserializer)}else{s=JSON.parse(l)}i.result=s}i.headers=t.message.headers}catch(t){}if(a>299){let t;if(s&&s.message){t=s.message}else if(l&&l.length>0){t=l}else{t=`Failed request: (${a})`}const r=new HttpClientError(t,a);r.result=i.result;o(r)}else{n(i)}}))))}))}}r.HttpClient=HttpClient;const lowercaseKeys=t=>Object.keys(t).reduce(((r,n)=>(r[n.toLowerCase()]=t[n],r)),{})},9835:(t,r)=>{Object.defineProperty(r,"__esModule",{value:true});r.checkBypass=r.getProxyUrl=void 0;function getProxyUrl(t){const r=t.protocol==="https:";if(checkBypass(t)){return undefined}const n=(()=>{if(r){return process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{return process.env["http_proxy"]||process.env["HTTP_PROXY"]}})();if(n){return new URL(n)}else{return undefined}}r.getProxyUrl=getProxyUrl;function checkBypass(t){if(!t.hostname){return false}const r=t.hostname;if(isLoopbackAddress(r)){return true}const n=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!n){return false}let o;if(t.port){o=Number(t.port)}else if(t.protocol==="http:"){o=80}else if(t.protocol==="https:"){o=443}const a=[t.hostname.toUpperCase()];if(typeof o==="number"){a.push(`${a[0]}:${o}`)}for(const t of n.split(",").map((t=>t.trim().toUpperCase())).filter((t=>t))){if(t==="*"||a.some((r=>r===t||r.endsWith(`.${t}`)||t.startsWith(".")&&r.endsWith(`${t}`)))){return true}}return false}r.checkBypass=checkBypass;function isLoopbackAddress(t){const r=t.toLowerCase();return r==="localhost"||r.startsWith("127.")||r.startsWith("[::1]")||r.startsWith("[0:0:0:0:0:0:0:1]")}},7760:(t,r,n)=>{ +/*! node-domexception. MIT License. Jimmy Wärting */ +if(!globalThis.DOMException){try{const{MessageChannel:t}=n(1267),r=(new t).port1,o=new ArrayBuffer;r.postMessage(o,[o,o])}catch(t){t.constructor.name==="DOMException"&&(globalThis.DOMException=t.constructor)}}t.exports=globalThis.DOMException},4294:(t,r,n)=>{t.exports=n(4219)},4219:(t,r,n)=>{var o=n(1808);var a=n(4404);var i=n(3685);var s=n(5687);var l=n(2361);var u=n(9491);var d=n(3837);r.httpOverHttp=httpOverHttp;r.httpsOverHttp=httpsOverHttp;r.httpOverHttps=httpOverHttps;r.httpsOverHttps=httpsOverHttps;function httpOverHttp(t){var r=new TunnelingAgent(t);r.request=i.request;return r}function httpsOverHttp(t){var r=new TunnelingAgent(t);r.request=i.request;r.createSocket=createSecureSocket;r.defaultPort=443;return r}function httpOverHttps(t){var r=new TunnelingAgent(t);r.request=s.request;return r}function httpsOverHttps(t){var r=new TunnelingAgent(t);r.request=s.request;r.createSocket=createSecureSocket;r.defaultPort=443;return r}function TunnelingAgent(t){var r=this;r.options=t||{};r.proxyOptions=r.options.proxy||{};r.maxSockets=r.options.maxSockets||i.Agent.defaultMaxSockets;r.requests=[];r.sockets=[];r.on("free",(function onFree(t,n,o,a){var i=toOptions(n,o,a);for(var s=0,l=r.requests.length;s=this.maxSockets){a.requests.push(i);return}a.createSocket(i,(function(r){r.on("free",onFree);r.on("close",onCloseOrRemove);r.on("agentRemove",onCloseOrRemove);t.onSocket(r);function onFree(){a.emit("free",r,i)}function onCloseOrRemove(t){a.removeSocket(r);r.removeListener("free",onFree);r.removeListener("close",onCloseOrRemove);r.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(t,r){var n=this;var o={};n.sockets.push(o);var a=mergeOptions({},n.proxyOptions,{method:"CONNECT",path:t.host+":"+t.port,agent:false,headers:{host:t.host+":"+t.port}});if(t.localAddress){a.localAddress=t.localAddress}if(a.proxyAuth){a.headers=a.headers||{};a.headers["Proxy-Authorization"]="Basic "+new Buffer(a.proxyAuth).toString("base64")}c("making CONNECT request");var i=n.request(a);i.useChunkedEncodingByDefault=false;i.once("response",onResponse);i.once("upgrade",onUpgrade);i.once("connect",onConnect);i.once("error",onError);i.end();function onResponse(t){t.upgrade=true}function onUpgrade(t,r,n){process.nextTick((function(){onConnect(t,r,n)}))}function onConnect(a,s,l){i.removeAllListeners();s.removeAllListeners();if(a.statusCode!==200){c("tunneling socket could not be established, statusCode=%d",a.statusCode);s.destroy();var u=new Error("tunneling socket could not be established, "+"statusCode="+a.statusCode);u.code="ECONNRESET";t.request.emit("error",u);n.removeSocket(o);return}if(l.length>0){c("got illegal response body from proxy");s.destroy();var u=new Error("got illegal response body from proxy");u.code="ECONNRESET";t.request.emit("error",u);n.removeSocket(o);return}c("tunneling connection has established");n.sockets[n.sockets.indexOf(o)]=s;return r(s)}function onError(r){i.removeAllListeners();c("tunneling socket could not be established, cause=%s\n",r.message,r.stack);var a=new Error("tunneling socket could not be established, "+"cause="+r.message);a.code="ECONNRESET";t.request.emit("error",a);n.removeSocket(o)}};TunnelingAgent.prototype.removeSocket=function removeSocket(t){var r=this.sockets.indexOf(t);if(r===-1){return}this.sockets.splice(r,1);var n=this.requests.shift();if(n){this.createSocket(n,(function(t){n.request.onSocket(t)}))}};function createSecureSocket(t,r){var n=this;TunnelingAgent.prototype.createSocket.call(n,t,(function(o){var i=t.request.getHeader("host");var s=mergeOptions({},n.options,{socket:o,servername:i?i.replace(/:.*$/,""):t.host});var l=a.connect(0,s);n.sockets[n.sockets.indexOf(o)]=l;r(l)}))}function toOptions(t,r,n){if(typeof t==="string"){return{host:t,port:r,localAddress:n}}return t}function mergeOptions(t){for(var r=1,n=arguments.length;r{Object.defineProperty(r,"__esModule",{value:true});Object.defineProperty(r,"v1",{enumerable:true,get:function(){return o.default}});Object.defineProperty(r,"v3",{enumerable:true,get:function(){return a.default}});Object.defineProperty(r,"v4",{enumerable:true,get:function(){return i.default}});Object.defineProperty(r,"v5",{enumerable:true,get:function(){return s.default}});Object.defineProperty(r,"NIL",{enumerable:true,get:function(){return l.default}});Object.defineProperty(r,"version",{enumerable:true,get:function(){return u.default}});Object.defineProperty(r,"validate",{enumerable:true,get:function(){return d.default}});Object.defineProperty(r,"stringify",{enumerable:true,get:function(){return c.default}});Object.defineProperty(r,"parse",{enumerable:true,get:function(){return m.default}});var o=_interopRequireDefault(n(8628));var a=_interopRequireDefault(n(6409));var i=_interopRequireDefault(n(5122));var s=_interopRequireDefault(n(9120));var l=_interopRequireDefault(n(5332));var u=_interopRequireDefault(n(1595));var d=_interopRequireDefault(n(6900));var c=_interopRequireDefault(n(8950));var m=_interopRequireDefault(n(2746));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}},4569:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(6113));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function md5(t){if(Array.isArray(t)){t=Buffer.from(t)}else if(typeof t==="string"){t=Buffer.from(t,"utf8")}return o.default.createHash("md5").update(t).digest()}var a=md5;r["default"]=a},5332:(t,r)=>{Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var n="00000000-0000-0000-0000-000000000000";r["default"]=n},2746:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(6900));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function parse(t){if(!(0,o.default)(t)){throw TypeError("Invalid UUID")}let r;const n=new Uint8Array(16);n[0]=(r=parseInt(t.slice(0,8),16))>>>24;n[1]=r>>>16&255;n[2]=r>>>8&255;n[3]=r&255;n[4]=(r=parseInt(t.slice(9,13),16))>>>8;n[5]=r&255;n[6]=(r=parseInt(t.slice(14,18),16))>>>8;n[7]=r&255;n[8]=(r=parseInt(t.slice(19,23),16))>>>8;n[9]=r&255;n[10]=(r=parseInt(t.slice(24,36),16))/1099511627776&255;n[11]=r/4294967296&255;n[12]=r>>>24&255;n[13]=r>>>16&255;n[14]=r>>>8&255;n[15]=r&255;return n}var a=parse;r["default"]=a},814:(t,r)=>{Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var n=/^(?:[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;r["default"]=n},807:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r["default"]=rng;var o=_interopRequireDefault(n(6113));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}const a=new Uint8Array(256);let i=a.length;function rng(){if(i>a.length-16){o.default.randomFillSync(a);i=0}return a.slice(i,i+=16)}},5274:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(6113));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function sha1(t){if(Array.isArray(t)){t=Buffer.from(t)}else if(typeof t==="string"){t=Buffer.from(t,"utf8")}return o.default.createHash("sha1").update(t).digest()}var a=sha1;r["default"]=a},8950:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(6900));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}const a=[];for(let t=0;t<256;++t){a.push((t+256).toString(16).substr(1))}function stringify(t,r=0){const n=(a[t[r+0]]+a[t[r+1]]+a[t[r+2]]+a[t[r+3]]+"-"+a[t[r+4]]+a[t[r+5]]+"-"+a[t[r+6]]+a[t[r+7]]+"-"+a[t[r+8]]+a[t[r+9]]+"-"+a[t[r+10]]+a[t[r+11]]+a[t[r+12]]+a[t[r+13]]+a[t[r+14]]+a[t[r+15]]).toLowerCase();if(!(0,o.default)(n)){throw TypeError("Stringified UUID is invalid")}return n}var i=stringify;r["default"]=i},8628:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(807));var a=_interopRequireDefault(n(8950));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}let i;let s;let l=0;let u=0;function v1(t,r,n){let d=r&&n||0;const c=r||new Array(16);t=t||{};let m=t.node||i;let h=t.clockseq!==undefined?t.clockseq:s;if(m==null||h==null){const r=t.random||(t.rng||o.default)();if(m==null){m=i=[r[0]|1,r[1],r[2],r[3],r[4],r[5]]}if(h==null){h=s=(r[6]<<8|r[7])&16383}}let p=t.msecs!==undefined?t.msecs:Date.now();let b=t.nsecs!==undefined?t.nsecs:u+1;const y=p-l+(b-u)/1e4;if(y<0&&t.clockseq===undefined){h=h+1&16383}if((y<0||p>l)&&t.nsecs===undefined){b=0}if(b>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}l=p;u=b;s=h;p+=122192928e5;const S=((p&268435455)*1e4+b)%4294967296;c[d++]=S>>>24&255;c[d++]=S>>>16&255;c[d++]=S>>>8&255;c[d++]=S&255;const R=p/4294967296*1e4&268435455;c[d++]=R>>>8&255;c[d++]=R&255;c[d++]=R>>>24&15|16;c[d++]=R>>>16&255;c[d++]=h>>>8|128;c[d++]=h&255;for(let t=0;t<6;++t){c[d+t]=m[t]}return r||(0,a.default)(c)}var d=v1;r["default"]=d},6409:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(5998));var a=_interopRequireDefault(n(4569));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}const i=(0,o.default)("v3",48,a.default);var s=i;r["default"]=s},5998:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r["default"]=_default;r.URL=r.DNS=void 0;var o=_interopRequireDefault(n(8950));var a=_interopRequireDefault(n(2746));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function stringToBytes(t){t=unescape(encodeURIComponent(t));const r=[];for(let n=0;n{Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(807));var a=_interopRequireDefault(n(8950));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function v4(t,r,n){t=t||{};const i=t.random||(t.rng||o.default)();i[6]=i[6]&15|64;i[8]=i[8]&63|128;if(r){n=n||0;for(let t=0;t<16;++t){r[n+t]=i[t]}return r}return(0,a.default)(i)}var i=v4;r["default"]=i},9120:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(5998));var a=_interopRequireDefault(n(5274));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}const i=(0,o.default)("v5",80,a.default);var s=i;r["default"]=s},6900:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(814));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function validate(t){return typeof t==="string"&&o.default.test(t)}var a=validate;r["default"]=a},1595:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(6900));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function version(t){if(!(0,o.default)(t)){throw TypeError("Invalid UUID")}return parseInt(t.substr(14,1),16)}var a=version;r["default"]=a},1452:function(t,r){(function(t,n){true?n(r):0})(this,(function(t){"use strict";const r=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol:t=>`Symbol(${t})`;function noop(){return undefined}function getGlobals(){if(typeof self!=="undefined"){return self}else if(typeof window!=="undefined"){return window}else if(typeof global!=="undefined"){return global}return undefined}const n=getGlobals();function typeIsObject(t){return typeof t==="object"&&t!==null||typeof t==="function"}const o=noop;const a=Promise;const i=Promise.prototype.then;const s=Promise.resolve.bind(a);const l=Promise.reject.bind(a);function newPromise(t){return new a(t)}function promiseResolvedWith(t){return s(t)}function promiseRejectedWith(t){return l(t)}function PerformPromiseThen(t,r,n){return i.call(t,r,n)}function uponPromise(t,r,n){PerformPromiseThen(PerformPromiseThen(t,r,n),undefined,o)}function uponFulfillment(t,r){uponPromise(t,r)}function uponRejection(t,r){uponPromise(t,undefined,r)}function transformPromiseWith(t,r,n){return PerformPromiseThen(t,r,n)}function setPromiseIsHandledToTrue(t){PerformPromiseThen(t,undefined,o)}const u=(()=>{const t=n&&n.queueMicrotask;if(typeof t==="function"){return t}const r=promiseResolvedWith(undefined);return t=>PerformPromiseThen(r,t)})();function reflectCall(t,r,n){if(typeof t!=="function"){throw new TypeError("Argument is not a function")}return Function.prototype.apply.call(t,r,n)}function promiseCall(t,r,n){try{return promiseResolvedWith(reflectCall(t,r,n))}catch(t){return promiseRejectedWith(t)}}const d=16384;class SimpleQueue{constructor(){this._cursor=0;this._size=0;this._front={_elements:[],_next:undefined};this._back=this._front;this._cursor=0;this._size=0}get length(){return this._size}push(t){const r=this._back;let n=r;if(r._elements.length===d-1){n={_elements:[],_next:undefined}}r._elements.push(t);if(n!==r){this._back=n;r._next=n}++this._size}shift(){const t=this._front;let r=t;const n=this._cursor;let o=n+1;const a=t._elements;const i=a[n];if(o===d){r=t._next;o=0}--this._size;this._cursor=o;if(t!==r){this._front=r}a[n]=undefined;return i}forEach(t){let r=this._cursor;let n=this._front;let o=n._elements;while(r!==o.length||n._next!==undefined){if(r===o.length){n=n._next;o=n._elements;r=0;if(o.length===0){break}}t(o[r]);++r}}peek(){const t=this._front;const r=this._cursor;return t._elements[r]}}function ReadableStreamReaderGenericInitialize(t,r){t._ownerReadableStream=r;r._reader=t;if(r._state==="readable"){defaultReaderClosedPromiseInitialize(t)}else if(r._state==="closed"){defaultReaderClosedPromiseInitializeAsResolved(t)}else{defaultReaderClosedPromiseInitializeAsRejected(t,r._storedError)}}function ReadableStreamReaderGenericCancel(t,r){const n=t._ownerReadableStream;return ReadableStreamCancel(n,r)}function ReadableStreamReaderGenericRelease(t){if(t._ownerReadableStream._state==="readable"){defaultReaderClosedPromiseReject(t,new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`))}else{defaultReaderClosedPromiseResetToRejected(t,new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`))}t._ownerReadableStream._reader=undefined;t._ownerReadableStream=undefined}function readerLockException(t){return new TypeError("Cannot "+t+" a stream using a released reader")}function defaultReaderClosedPromiseInitialize(t){t._closedPromise=newPromise(((r,n)=>{t._closedPromise_resolve=r;t._closedPromise_reject=n}))}function defaultReaderClosedPromiseInitializeAsRejected(t,r){defaultReaderClosedPromiseInitialize(t);defaultReaderClosedPromiseReject(t,r)}function defaultReaderClosedPromiseInitializeAsResolved(t){defaultReaderClosedPromiseInitialize(t);defaultReaderClosedPromiseResolve(t)}function defaultReaderClosedPromiseReject(t,r){if(t._closedPromise_reject===undefined){return}setPromiseIsHandledToTrue(t._closedPromise);t._closedPromise_reject(r);t._closedPromise_resolve=undefined;t._closedPromise_reject=undefined}function defaultReaderClosedPromiseResetToRejected(t,r){defaultReaderClosedPromiseInitializeAsRejected(t,r)}function defaultReaderClosedPromiseResolve(t){if(t._closedPromise_resolve===undefined){return}t._closedPromise_resolve(undefined);t._closedPromise_resolve=undefined;t._closedPromise_reject=undefined}const c=r("[[AbortSteps]]");const m=r("[[ErrorSteps]]");const h=r("[[CancelSteps]]");const p=r("[[PullSteps]]");const b=Number.isFinite||function(t){return typeof t==="number"&&isFinite(t)};const y=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};function isDictionary(t){return typeof t==="object"||typeof t==="function"}function assertDictionary(t,r){if(t!==undefined&&!isDictionary(t)){throw new TypeError(`${r} is not an object.`)}}function assertFunction(t,r){if(typeof t!=="function"){throw new TypeError(`${r} is not a function.`)}}function isObject(t){return typeof t==="object"&&t!==null||typeof t==="function"}function assertObject(t,r){if(!isObject(t)){throw new TypeError(`${r} is not an object.`)}}function assertRequiredArgument(t,r,n){if(t===undefined){throw new TypeError(`Parameter ${r} is required in '${n}'.`)}}function assertRequiredField(t,r,n){if(t===undefined){throw new TypeError(`${r} is required in '${n}'.`)}}function convertUnrestrictedDouble(t){return Number(t)}function censorNegativeZero(t){return t===0?0:t}function integerPart(t){return censorNegativeZero(y(t))}function convertUnsignedLongLongWithEnforceRange(t,r){const n=0;const o=Number.MAX_SAFE_INTEGER;let a=Number(t);a=censorNegativeZero(a);if(!b(a)){throw new TypeError(`${r} is not a finite number`)}a=integerPart(a);if(ao){throw new TypeError(`${r} is outside the accepted range of ${n} to ${o}, inclusive`)}if(!b(a)||a===0){return 0}return a}function assertReadableStream(t,r){if(!IsReadableStream(t)){throw new TypeError(`${r} is not a ReadableStream.`)}}function AcquireReadableStreamDefaultReader(t){return new ReadableStreamDefaultReader(t)}function ReadableStreamAddReadRequest(t,r){t._reader._readRequests.push(r)}function ReadableStreamFulfillReadRequest(t,r,n){const o=t._reader;const a=o._readRequests.shift();if(n){a._closeSteps()}else{a._chunkSteps(r)}}function ReadableStreamGetNumReadRequests(t){return t._reader._readRequests.length}function ReadableStreamHasDefaultReader(t){const r=t._reader;if(r===undefined){return false}if(!IsReadableStreamDefaultReader(r)){return false}return true}class ReadableStreamDefaultReader{constructor(t){assertRequiredArgument(t,1,"ReadableStreamDefaultReader");assertReadableStream(t,"First parameter");if(IsReadableStreamLocked(t)){throw new TypeError("This stream has already been locked for exclusive reading by another reader")}ReadableStreamReaderGenericInitialize(this,t);this._readRequests=new SimpleQueue}get closed(){if(!IsReadableStreamDefaultReader(this)){return promiseRejectedWith(defaultReaderBrandCheckException("closed"))}return this._closedPromise}cancel(t=undefined){if(!IsReadableStreamDefaultReader(this)){return promiseRejectedWith(defaultReaderBrandCheckException("cancel"))}if(this._ownerReadableStream===undefined){return promiseRejectedWith(readerLockException("cancel"))}return ReadableStreamReaderGenericCancel(this,t)}read(){if(!IsReadableStreamDefaultReader(this)){return promiseRejectedWith(defaultReaderBrandCheckException("read"))}if(this._ownerReadableStream===undefined){return promiseRejectedWith(readerLockException("read from"))}let t;let r;const n=newPromise(((n,o)=>{t=n;r=o}));const o={_chunkSteps:r=>t({value:r,done:false}),_closeSteps:()=>t({value:undefined,done:true}),_errorSteps:t=>r(t)};ReadableStreamDefaultReaderRead(this,o);return n}releaseLock(){if(!IsReadableStreamDefaultReader(this)){throw defaultReaderBrandCheckException("releaseLock")}if(this._ownerReadableStream===undefined){return}if(this._readRequests.length>0){throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled")}ReadableStreamReaderGenericRelease(this)}}Object.defineProperties(ReadableStreamDefaultReader.prototype,{cancel:{enumerable:true},read:{enumerable:true},releaseLock:{enumerable:true},closed:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(ReadableStreamDefaultReader.prototype,r.toStringTag,{value:"ReadableStreamDefaultReader",configurable:true})}function IsReadableStreamDefaultReader(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_readRequests")){return false}return t instanceof ReadableStreamDefaultReader}function ReadableStreamDefaultReaderRead(t,r){const n=t._ownerReadableStream;n._disturbed=true;if(n._state==="closed"){r._closeSteps()}else if(n._state==="errored"){r._errorSteps(n._storedError)}else{n._readableStreamController[p](r)}}function defaultReaderBrandCheckException(t){return new TypeError(`ReadableStreamDefaultReader.prototype.${t} can only be used on a ReadableStreamDefaultReader`)}const S=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class ReadableStreamAsyncIteratorImpl{constructor(t,r){this._ongoingPromise=undefined;this._isFinished=false;this._reader=t;this._preventCancel=r}next(){const nextSteps=()=>this._nextSteps();this._ongoingPromise=this._ongoingPromise?transformPromiseWith(this._ongoingPromise,nextSteps,nextSteps):nextSteps();return this._ongoingPromise}return(t){const returnSteps=()=>this._returnSteps(t);return this._ongoingPromise?transformPromiseWith(this._ongoingPromise,returnSteps,returnSteps):returnSteps()}_nextSteps(){if(this._isFinished){return Promise.resolve({value:undefined,done:true})}const t=this._reader;if(t._ownerReadableStream===undefined){return promiseRejectedWith(readerLockException("iterate"))}let r;let n;const o=newPromise(((t,o)=>{r=t;n=o}));const a={_chunkSteps:t=>{this._ongoingPromise=undefined;u((()=>r({value:t,done:false})))},_closeSteps:()=>{this._ongoingPromise=undefined;this._isFinished=true;ReadableStreamReaderGenericRelease(t);r({value:undefined,done:true})},_errorSteps:r=>{this._ongoingPromise=undefined;this._isFinished=true;ReadableStreamReaderGenericRelease(t);n(r)}};ReadableStreamDefaultReaderRead(t,a);return o}_returnSteps(t){if(this._isFinished){return Promise.resolve({value:t,done:true})}this._isFinished=true;const r=this._reader;if(r._ownerReadableStream===undefined){return promiseRejectedWith(readerLockException("finish iterating"))}if(!this._preventCancel){const n=ReadableStreamReaderGenericCancel(r,t);ReadableStreamReaderGenericRelease(r);return transformPromiseWith(n,(()=>({value:t,done:true})))}ReadableStreamReaderGenericRelease(r);return promiseResolvedWith({value:t,done:true})}}const R={next(){if(!IsReadableStreamAsyncIterator(this)){return promiseRejectedWith(streamAsyncIteratorBrandCheckException("next"))}return this._asyncIteratorImpl.next()},return(t){if(!IsReadableStreamAsyncIterator(this)){return promiseRejectedWith(streamAsyncIteratorBrandCheckException("return"))}return this._asyncIteratorImpl.return(t)}};if(S!==undefined){Object.setPrototypeOf(R,S)}function AcquireReadableStreamAsyncIterator(t,r){const n=AcquireReadableStreamDefaultReader(t);const o=new ReadableStreamAsyncIteratorImpl(n,r);const a=Object.create(R);a._asyncIteratorImpl=o;return a}function IsReadableStreamAsyncIterator(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_asyncIteratorImpl")){return false}try{return t._asyncIteratorImpl instanceof ReadableStreamAsyncIteratorImpl}catch(t){return false}}function streamAsyncIteratorBrandCheckException(t){return new TypeError(`ReadableStreamAsyncIterator.${t} can only be used on a ReadableSteamAsyncIterator`)}const g=Number.isNaN||function(t){return t!==t};function CreateArrayFromList(t){return t.slice()}function CopyDataBlockBytes(t,r,n,o,a){new Uint8Array(t).set(new Uint8Array(n,o,a),r)}function TransferArrayBuffer(t){return t}function IsDetachedBuffer(t){return false}function ArrayBufferSlice(t,r,n){if(t.slice){return t.slice(r,n)}const o=n-r;const a=new ArrayBuffer(o);CopyDataBlockBytes(a,0,t,r,o);return a}function IsNonNegativeNumber(t){if(typeof t!=="number"){return false}if(g(t)){return false}if(t<0){return false}return true}function CloneAsUint8Array(t){const r=ArrayBufferSlice(t.buffer,t.byteOffset,t.byteOffset+t.byteLength);return new Uint8Array(r)}function DequeueValue(t){const r=t._queue.shift();t._queueTotalSize-=r.size;if(t._queueTotalSize<0){t._queueTotalSize=0}return r.value}function EnqueueValueWithSize(t,r,n){if(!IsNonNegativeNumber(n)||n===Infinity){throw new RangeError("Size must be a finite, non-NaN, non-negative number.")}t._queue.push({value:r,size:n});t._queueTotalSize+=n}function PeekQueueValue(t){const r=t._queue.peek();return r.value}function ResetQueue(t){t._queue=new SimpleQueue;t._queueTotalSize=0}class ReadableStreamBYOBRequest{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!IsReadableStreamBYOBRequest(this)){throw byobRequestBrandCheckException("view")}return this._view}respond(t){if(!IsReadableStreamBYOBRequest(this)){throw byobRequestBrandCheckException("respond")}assertRequiredArgument(t,1,"respond");t=convertUnsignedLongLongWithEnforceRange(t,"First parameter");if(this._associatedReadableByteStreamController===undefined){throw new TypeError("This BYOB request has been invalidated")}if(IsDetachedBuffer(this._view.buffer));ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController,t)}respondWithNewView(t){if(!IsReadableStreamBYOBRequest(this)){throw byobRequestBrandCheckException("respondWithNewView")}assertRequiredArgument(t,1,"respondWithNewView");if(!ArrayBuffer.isView(t)){throw new TypeError("You can only respond with array buffer views")}if(this._associatedReadableByteStreamController===undefined){throw new TypeError("This BYOB request has been invalidated")}if(IsDetachedBuffer(t.buffer));ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController,t)}}Object.defineProperties(ReadableStreamBYOBRequest.prototype,{respond:{enumerable:true},respondWithNewView:{enumerable:true},view:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(ReadableStreamBYOBRequest.prototype,r.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:true})}class ReadableByteStreamController{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!IsReadableByteStreamController(this)){throw byteStreamControllerBrandCheckException("byobRequest")}return ReadableByteStreamControllerGetBYOBRequest(this)}get desiredSize(){if(!IsReadableByteStreamController(this)){throw byteStreamControllerBrandCheckException("desiredSize")}return ReadableByteStreamControllerGetDesiredSize(this)}close(){if(!IsReadableByteStreamController(this)){throw byteStreamControllerBrandCheckException("close")}if(this._closeRequested){throw new TypeError("The stream has already been closed; do not close it again!")}const t=this._controlledReadableByteStream._state;if(t!=="readable"){throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be closed`)}ReadableByteStreamControllerClose(this)}enqueue(t){if(!IsReadableByteStreamController(this)){throw byteStreamControllerBrandCheckException("enqueue")}assertRequiredArgument(t,1,"enqueue");if(!ArrayBuffer.isView(t)){throw new TypeError("chunk must be an array buffer view")}if(t.byteLength===0){throw new TypeError("chunk must have non-zero byteLength")}if(t.buffer.byteLength===0){throw new TypeError(`chunk's buffer must have non-zero byteLength`)}if(this._closeRequested){throw new TypeError("stream is closed or draining")}const r=this._controlledReadableByteStream._state;if(r!=="readable"){throw new TypeError(`The stream (in ${r} state) is not in the readable state and cannot be enqueued to`)}ReadableByteStreamControllerEnqueue(this,t)}error(t=undefined){if(!IsReadableByteStreamController(this)){throw byteStreamControllerBrandCheckException("error")}ReadableByteStreamControllerError(this,t)}[h](t){ReadableByteStreamControllerClearPendingPullIntos(this);ResetQueue(this);const r=this._cancelAlgorithm(t);ReadableByteStreamControllerClearAlgorithms(this);return r}[p](t){const r=this._controlledReadableByteStream;if(this._queueTotalSize>0){const r=this._queue.shift();this._queueTotalSize-=r.byteLength;ReadableByteStreamControllerHandleQueueDrain(this);const n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);t._chunkSteps(n);return}const n=this._autoAllocateChunkSize;if(n!==undefined){let r;try{r=new ArrayBuffer(n)}catch(r){t._errorSteps(r);return}const o={buffer:r,bufferByteLength:n,byteOffset:0,byteLength:n,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(o)}ReadableStreamAddReadRequest(r,t);ReadableByteStreamControllerCallPullIfNeeded(this)}}Object.defineProperties(ReadableByteStreamController.prototype,{close:{enumerable:true},enqueue:{enumerable:true},error:{enumerable:true},byobRequest:{enumerable:true},desiredSize:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(ReadableByteStreamController.prototype,r.toStringTag,{value:"ReadableByteStreamController",configurable:true})}function IsReadableByteStreamController(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_controlledReadableByteStream")){return false}return t instanceof ReadableByteStreamController}function IsReadableStreamBYOBRequest(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_associatedReadableByteStreamController")){return false}return t instanceof ReadableStreamBYOBRequest}function ReadableByteStreamControllerCallPullIfNeeded(t){const r=ReadableByteStreamControllerShouldCallPull(t);if(!r){return}if(t._pulling){t._pullAgain=true;return}t._pulling=true;const n=t._pullAlgorithm();uponPromise(n,(()=>{t._pulling=false;if(t._pullAgain){t._pullAgain=false;ReadableByteStreamControllerCallPullIfNeeded(t)}}),(r=>{ReadableByteStreamControllerError(t,r)}))}function ReadableByteStreamControllerClearPendingPullIntos(t){ReadableByteStreamControllerInvalidateBYOBRequest(t);t._pendingPullIntos=new SimpleQueue}function ReadableByteStreamControllerCommitPullIntoDescriptor(t,r){let n=false;if(t._state==="closed"){n=true}const o=ReadableByteStreamControllerConvertPullIntoDescriptor(r);if(r.readerType==="default"){ReadableStreamFulfillReadRequest(t,o,n)}else{ReadableStreamFulfillReadIntoRequest(t,o,n)}}function ReadableByteStreamControllerConvertPullIntoDescriptor(t){const r=t.bytesFilled;const n=t.elementSize;return new t.viewConstructor(t.buffer,t.byteOffset,r/n)}function ReadableByteStreamControllerEnqueueChunkToQueue(t,r,n,o){t._queue.push({buffer:r,byteOffset:n,byteLength:o});t._queueTotalSize+=o}function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(t,r){const n=r.elementSize;const o=r.bytesFilled-r.bytesFilled%n;const a=Math.min(t._queueTotalSize,r.byteLength-r.bytesFilled);const i=r.bytesFilled+a;const s=i-i%n;let l=a;let u=false;if(s>o){l=s-r.bytesFilled;u=true}const d=t._queue;while(l>0){const n=d.peek();const o=Math.min(l,n.byteLength);const a=r.byteOffset+r.bytesFilled;CopyDataBlockBytes(r.buffer,a,n.buffer,n.byteOffset,o);if(n.byteLength===o){d.shift()}else{n.byteOffset+=o;n.byteLength-=o}t._queueTotalSize-=o;ReadableByteStreamControllerFillHeadPullIntoDescriptor(t,o,r);l-=o}return u}function ReadableByteStreamControllerFillHeadPullIntoDescriptor(t,r,n){n.bytesFilled+=r}function ReadableByteStreamControllerHandleQueueDrain(t){if(t._queueTotalSize===0&&t._closeRequested){ReadableByteStreamControllerClearAlgorithms(t);ReadableStreamClose(t._controlledReadableByteStream)}else{ReadableByteStreamControllerCallPullIfNeeded(t)}}function ReadableByteStreamControllerInvalidateBYOBRequest(t){if(t._byobRequest===null){return}t._byobRequest._associatedReadableByteStreamController=undefined;t._byobRequest._view=null;t._byobRequest=null}function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(t){while(t._pendingPullIntos.length>0){if(t._queueTotalSize===0){return}const r=t._pendingPullIntos.peek();if(ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(t,r)){ReadableByteStreamControllerShiftPendingPullInto(t);ReadableByteStreamControllerCommitPullIntoDescriptor(t._controlledReadableByteStream,r)}}}function ReadableByteStreamControllerPullInto(t,r,n){const o=t._controlledReadableByteStream;let a=1;if(r.constructor!==DataView){a=r.constructor.BYTES_PER_ELEMENT}const i=r.constructor;const s=TransferArrayBuffer(r.buffer);const l={buffer:s,bufferByteLength:s.byteLength,byteOffset:r.byteOffset,byteLength:r.byteLength,bytesFilled:0,elementSize:a,viewConstructor:i,readerType:"byob"};if(t._pendingPullIntos.length>0){t._pendingPullIntos.push(l);ReadableStreamAddReadIntoRequest(o,n);return}if(o._state==="closed"){const t=new i(l.buffer,l.byteOffset,0);n._closeSteps(t);return}if(t._queueTotalSize>0){if(ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(t,l)){const r=ReadableByteStreamControllerConvertPullIntoDescriptor(l);ReadableByteStreamControllerHandleQueueDrain(t);n._chunkSteps(r);return}if(t._closeRequested){const r=new TypeError("Insufficient bytes to fill elements in the given buffer");ReadableByteStreamControllerError(t,r);n._errorSteps(r);return}}t._pendingPullIntos.push(l);ReadableStreamAddReadIntoRequest(o,n);ReadableByteStreamControllerCallPullIfNeeded(t)}function ReadableByteStreamControllerRespondInClosedState(t,r){const n=t._controlledReadableByteStream;if(ReadableStreamHasBYOBReader(n)){while(ReadableStreamGetNumReadIntoRequests(n)>0){const r=ReadableByteStreamControllerShiftPendingPullInto(t);ReadableByteStreamControllerCommitPullIntoDescriptor(n,r)}}}function ReadableByteStreamControllerRespondInReadableState(t,r,n){ReadableByteStreamControllerFillHeadPullIntoDescriptor(t,r,n);if(n.bytesFilled0){const r=n.byteOffset+n.bytesFilled;const a=ArrayBufferSlice(n.buffer,r-o,r);ReadableByteStreamControllerEnqueueChunkToQueue(t,a,0,a.byteLength)}n.bytesFilled-=o;ReadableByteStreamControllerCommitPullIntoDescriptor(t._controlledReadableByteStream,n);ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(t)}function ReadableByteStreamControllerRespondInternal(t,r){const n=t._pendingPullIntos.peek();ReadableByteStreamControllerInvalidateBYOBRequest(t);const o=t._controlledReadableByteStream._state;if(o==="closed"){ReadableByteStreamControllerRespondInClosedState(t)}else{ReadableByteStreamControllerRespondInReadableState(t,r,n)}ReadableByteStreamControllerCallPullIfNeeded(t)}function ReadableByteStreamControllerShiftPendingPullInto(t){const r=t._pendingPullIntos.shift();return r}function ReadableByteStreamControllerShouldCallPull(t){const r=t._controlledReadableByteStream;if(r._state!=="readable"){return false}if(t._closeRequested){return false}if(!t._started){return false}if(ReadableStreamHasDefaultReader(r)&&ReadableStreamGetNumReadRequests(r)>0){return true}if(ReadableStreamHasBYOBReader(r)&&ReadableStreamGetNumReadIntoRequests(r)>0){return true}const n=ReadableByteStreamControllerGetDesiredSize(t);if(n>0){return true}return false}function ReadableByteStreamControllerClearAlgorithms(t){t._pullAlgorithm=undefined;t._cancelAlgorithm=undefined}function ReadableByteStreamControllerClose(t){const r=t._controlledReadableByteStream;if(t._closeRequested||r._state!=="readable"){return}if(t._queueTotalSize>0){t._closeRequested=true;return}if(t._pendingPullIntos.length>0){const r=t._pendingPullIntos.peek();if(r.bytesFilled>0){const r=new TypeError("Insufficient bytes to fill elements in the given buffer");ReadableByteStreamControllerError(t,r);throw r}}ReadableByteStreamControllerClearAlgorithms(t);ReadableStreamClose(r)}function ReadableByteStreamControllerEnqueue(t,r){const n=t._controlledReadableByteStream;if(t._closeRequested||n._state!=="readable"){return}const o=r.buffer;const a=r.byteOffset;const i=r.byteLength;const s=TransferArrayBuffer(o);if(t._pendingPullIntos.length>0){const r=t._pendingPullIntos.peek();if(IsDetachedBuffer(r.buffer));r.buffer=TransferArrayBuffer(r.buffer)}ReadableByteStreamControllerInvalidateBYOBRequest(t);if(ReadableStreamHasDefaultReader(n)){if(ReadableStreamGetNumReadRequests(n)===0){ReadableByteStreamControllerEnqueueChunkToQueue(t,s,a,i)}else{if(t._pendingPullIntos.length>0){ReadableByteStreamControllerShiftPendingPullInto(t)}const r=new Uint8Array(s,a,i);ReadableStreamFulfillReadRequest(n,r,false)}}else if(ReadableStreamHasBYOBReader(n)){ReadableByteStreamControllerEnqueueChunkToQueue(t,s,a,i);ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(t)}else{ReadableByteStreamControllerEnqueueChunkToQueue(t,s,a,i)}ReadableByteStreamControllerCallPullIfNeeded(t)}function ReadableByteStreamControllerError(t,r){const n=t._controlledReadableByteStream;if(n._state!=="readable"){return}ReadableByteStreamControllerClearPendingPullIntos(t);ResetQueue(t);ReadableByteStreamControllerClearAlgorithms(t);ReadableStreamError(n,r)}function ReadableByteStreamControllerGetBYOBRequest(t){if(t._byobRequest===null&&t._pendingPullIntos.length>0){const r=t._pendingPullIntos.peek();const n=new Uint8Array(r.buffer,r.byteOffset+r.bytesFilled,r.byteLength-r.bytesFilled);const o=Object.create(ReadableStreamBYOBRequest.prototype);SetUpReadableStreamBYOBRequest(o,t,n);t._byobRequest=o}return t._byobRequest}function ReadableByteStreamControllerGetDesiredSize(t){const r=t._controlledReadableByteStream._state;if(r==="errored"){return null}if(r==="closed"){return 0}return t._strategyHWM-t._queueTotalSize}function ReadableByteStreamControllerRespond(t,r){const n=t._pendingPullIntos.peek();const o=t._controlledReadableByteStream._state;if(o==="closed"){if(r!==0){throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}}else{if(r===0){throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream")}if(n.bytesFilled+r>n.byteLength){throw new RangeError("bytesWritten out of range")}}n.buffer=TransferArrayBuffer(n.buffer);ReadableByteStreamControllerRespondInternal(t,r)}function ReadableByteStreamControllerRespondWithNewView(t,r){const n=t._pendingPullIntos.peek();const o=t._controlledReadableByteStream._state;if(o==="closed"){if(r.byteLength!==0){throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}}else{if(r.byteLength===0){throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream")}}if(n.byteOffset+n.bytesFilled!==r.byteOffset){throw new RangeError("The region specified by view does not match byobRequest")}if(n.bufferByteLength!==r.buffer.byteLength){throw new RangeError("The buffer of view has different capacity than byobRequest")}if(n.bytesFilled+r.byteLength>n.byteLength){throw new RangeError("The region specified by view is larger than byobRequest")}const a=r.byteLength;n.buffer=TransferArrayBuffer(r.buffer);ReadableByteStreamControllerRespondInternal(t,a)}function SetUpReadableByteStreamController(t,r,n,o,a,i,s){r._controlledReadableByteStream=t;r._pullAgain=false;r._pulling=false;r._byobRequest=null;r._queue=r._queueTotalSize=undefined;ResetQueue(r);r._closeRequested=false;r._started=false;r._strategyHWM=i;r._pullAlgorithm=o;r._cancelAlgorithm=a;r._autoAllocateChunkSize=s;r._pendingPullIntos=new SimpleQueue;t._readableStreamController=r;const l=n();uponPromise(promiseResolvedWith(l),(()=>{r._started=true;ReadableByteStreamControllerCallPullIfNeeded(r)}),(t=>{ReadableByteStreamControllerError(r,t)}))}function SetUpReadableByteStreamControllerFromUnderlyingSource(t,r,n){const o=Object.create(ReadableByteStreamController.prototype);let startAlgorithm=()=>undefined;let pullAlgorithm=()=>promiseResolvedWith(undefined);let cancelAlgorithm=()=>promiseResolvedWith(undefined);if(r.start!==undefined){startAlgorithm=()=>r.start(o)}if(r.pull!==undefined){pullAlgorithm=()=>r.pull(o)}if(r.cancel!==undefined){cancelAlgorithm=t=>r.cancel(t)}const a=r.autoAllocateChunkSize;if(a===0){throw new TypeError("autoAllocateChunkSize must be greater than 0")}SetUpReadableByteStreamController(t,o,startAlgorithm,pullAlgorithm,cancelAlgorithm,n,a)}function SetUpReadableStreamBYOBRequest(t,r,n){t._associatedReadableByteStreamController=r;t._view=n}function byobRequestBrandCheckException(t){return new TypeError(`ReadableStreamBYOBRequest.prototype.${t} can only be used on a ReadableStreamBYOBRequest`)}function byteStreamControllerBrandCheckException(t){return new TypeError(`ReadableByteStreamController.prototype.${t} can only be used on a ReadableByteStreamController`)}function AcquireReadableStreamBYOBReader(t){return new ReadableStreamBYOBReader(t)}function ReadableStreamAddReadIntoRequest(t,r){t._reader._readIntoRequests.push(r)}function ReadableStreamFulfillReadIntoRequest(t,r,n){const o=t._reader;const a=o._readIntoRequests.shift();if(n){a._closeSteps(r)}else{a._chunkSteps(r)}}function ReadableStreamGetNumReadIntoRequests(t){return t._reader._readIntoRequests.length}function ReadableStreamHasBYOBReader(t){const r=t._reader;if(r===undefined){return false}if(!IsReadableStreamBYOBReader(r)){return false}return true}class ReadableStreamBYOBReader{constructor(t){assertRequiredArgument(t,1,"ReadableStreamBYOBReader");assertReadableStream(t,"First parameter");if(IsReadableStreamLocked(t)){throw new TypeError("This stream has already been locked for exclusive reading by another reader")}if(!IsReadableByteStreamController(t._readableStreamController)){throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte "+"source")}ReadableStreamReaderGenericInitialize(this,t);this._readIntoRequests=new SimpleQueue}get closed(){if(!IsReadableStreamBYOBReader(this)){return promiseRejectedWith(byobReaderBrandCheckException("closed"))}return this._closedPromise}cancel(t=undefined){if(!IsReadableStreamBYOBReader(this)){return promiseRejectedWith(byobReaderBrandCheckException("cancel"))}if(this._ownerReadableStream===undefined){return promiseRejectedWith(readerLockException("cancel"))}return ReadableStreamReaderGenericCancel(this,t)}read(t){if(!IsReadableStreamBYOBReader(this)){return promiseRejectedWith(byobReaderBrandCheckException("read"))}if(!ArrayBuffer.isView(t)){return promiseRejectedWith(new TypeError("view must be an array buffer view"))}if(t.byteLength===0){return promiseRejectedWith(new TypeError("view must have non-zero byteLength"))}if(t.buffer.byteLength===0){return promiseRejectedWith(new TypeError(`view's buffer must have non-zero byteLength`))}if(IsDetachedBuffer(t.buffer));if(this._ownerReadableStream===undefined){return promiseRejectedWith(readerLockException("read from"))}let r;let n;const o=newPromise(((t,o)=>{r=t;n=o}));const a={_chunkSteps:t=>r({value:t,done:false}),_closeSteps:t=>r({value:t,done:true}),_errorSteps:t=>n(t)};ReadableStreamBYOBReaderRead(this,t,a);return o}releaseLock(){if(!IsReadableStreamBYOBReader(this)){throw byobReaderBrandCheckException("releaseLock")}if(this._ownerReadableStream===undefined){return}if(this._readIntoRequests.length>0){throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled")}ReadableStreamReaderGenericRelease(this)}}Object.defineProperties(ReadableStreamBYOBReader.prototype,{cancel:{enumerable:true},read:{enumerable:true},releaseLock:{enumerable:true},closed:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(ReadableStreamBYOBReader.prototype,r.toStringTag,{value:"ReadableStreamBYOBReader",configurable:true})}function IsReadableStreamBYOBReader(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_readIntoRequests")){return false}return t instanceof ReadableStreamBYOBReader}function ReadableStreamBYOBReaderRead(t,r,n){const o=t._ownerReadableStream;o._disturbed=true;if(o._state==="errored"){n._errorSteps(o._storedError)}else{ReadableByteStreamControllerPullInto(o._readableStreamController,r,n)}}function byobReaderBrandCheckException(t){return new TypeError(`ReadableStreamBYOBReader.prototype.${t} can only be used on a ReadableStreamBYOBReader`)}function ExtractHighWaterMark(t,r){const{highWaterMark:n}=t;if(n===undefined){return r}if(g(n)||n<0){throw new RangeError("Invalid highWaterMark")}return n}function ExtractSizeAlgorithm(t){const{size:r}=t;if(!r){return()=>1}return r}function convertQueuingStrategy(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.highWaterMark;const o=t===null||t===void 0?void 0:t.size;return{highWaterMark:n===undefined?undefined:convertUnrestrictedDouble(n),size:o===undefined?undefined:convertQueuingStrategySize(o,`${r} has member 'size' that`)}}function convertQueuingStrategySize(t,r){assertFunction(t,r);return r=>convertUnrestrictedDouble(t(r))}function convertUnderlyingSink(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.abort;const o=t===null||t===void 0?void 0:t.close;const a=t===null||t===void 0?void 0:t.start;const i=t===null||t===void 0?void 0:t.type;const s=t===null||t===void 0?void 0:t.write;return{abort:n===undefined?undefined:convertUnderlyingSinkAbortCallback(n,t,`${r} has member 'abort' that`),close:o===undefined?undefined:convertUnderlyingSinkCloseCallback(o,t,`${r} has member 'close' that`),start:a===undefined?undefined:convertUnderlyingSinkStartCallback(a,t,`${r} has member 'start' that`),write:s===undefined?undefined:convertUnderlyingSinkWriteCallback(s,t,`${r} has member 'write' that`),type:i}}function convertUnderlyingSinkAbortCallback(t,r,n){assertFunction(t,n);return n=>promiseCall(t,r,[n])}function convertUnderlyingSinkCloseCallback(t,r,n){assertFunction(t,n);return()=>promiseCall(t,r,[])}function convertUnderlyingSinkStartCallback(t,r,n){assertFunction(t,n);return n=>reflectCall(t,r,[n])}function convertUnderlyingSinkWriteCallback(t,r,n){assertFunction(t,n);return(n,o)=>promiseCall(t,r,[n,o])}function assertWritableStream(t,r){if(!IsWritableStream(t)){throw new TypeError(`${r} is not a WritableStream.`)}}function isAbortSignal(t){if(typeof t!=="object"||t===null){return false}try{return typeof t.aborted==="boolean"}catch(t){return false}}const _=typeof AbortController==="function";function createAbortController(){if(_){return new AbortController}return undefined}class WritableStream{constructor(t={},r={}){if(t===undefined){t=null}else{assertObject(t,"First parameter")}const n=convertQueuingStrategy(r,"Second parameter");const o=convertUnderlyingSink(t,"First parameter");InitializeWritableStream(this);const a=o.type;if(a!==undefined){throw new RangeError("Invalid type is specified")}const i=ExtractSizeAlgorithm(n);const s=ExtractHighWaterMark(n,1);SetUpWritableStreamDefaultControllerFromUnderlyingSink(this,o,s,i)}get locked(){if(!IsWritableStream(this)){throw streamBrandCheckException$2("locked")}return IsWritableStreamLocked(this)}abort(t=undefined){if(!IsWritableStream(this)){return promiseRejectedWith(streamBrandCheckException$2("abort"))}if(IsWritableStreamLocked(this)){return promiseRejectedWith(new TypeError("Cannot abort a stream that already has a writer"))}return WritableStreamAbort(this,t)}close(){if(!IsWritableStream(this)){return promiseRejectedWith(streamBrandCheckException$2("close"))}if(IsWritableStreamLocked(this)){return promiseRejectedWith(new TypeError("Cannot close a stream that already has a writer"))}if(WritableStreamCloseQueuedOrInFlight(this)){return promiseRejectedWith(new TypeError("Cannot close an already-closing stream"))}return WritableStreamClose(this)}getWriter(){if(!IsWritableStream(this)){throw streamBrandCheckException$2("getWriter")}return AcquireWritableStreamDefaultWriter(this)}}Object.defineProperties(WritableStream.prototype,{abort:{enumerable:true},close:{enumerable:true},getWriter:{enumerable:true},locked:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(WritableStream.prototype,r.toStringTag,{value:"WritableStream",configurable:true})}function AcquireWritableStreamDefaultWriter(t){return new WritableStreamDefaultWriter(t)}function CreateWritableStream(t,r,n,o,a=1,i=(()=>1)){const s=Object.create(WritableStream.prototype);InitializeWritableStream(s);const l=Object.create(WritableStreamDefaultController.prototype);SetUpWritableStreamDefaultController(s,l,t,r,n,o,a,i);return s}function InitializeWritableStream(t){t._state="writable";t._storedError=undefined;t._writer=undefined;t._writableStreamController=undefined;t._writeRequests=new SimpleQueue;t._inFlightWriteRequest=undefined;t._closeRequest=undefined;t._inFlightCloseRequest=undefined;t._pendingAbortRequest=undefined;t._backpressure=false}function IsWritableStream(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_writableStreamController")){return false}return t instanceof WritableStream}function IsWritableStreamLocked(t){if(t._writer===undefined){return false}return true}function WritableStreamAbort(t,r){var n;if(t._state==="closed"||t._state==="errored"){return promiseResolvedWith(undefined)}t._writableStreamController._abortReason=r;(n=t._writableStreamController._abortController)===null||n===void 0?void 0:n.abort();const o=t._state;if(o==="closed"||o==="errored"){return promiseResolvedWith(undefined)}if(t._pendingAbortRequest!==undefined){return t._pendingAbortRequest._promise}let a=false;if(o==="erroring"){a=true;r=undefined}const i=newPromise(((n,o)=>{t._pendingAbortRequest={_promise:undefined,_resolve:n,_reject:o,_reason:r,_wasAlreadyErroring:a}}));t._pendingAbortRequest._promise=i;if(!a){WritableStreamStartErroring(t,r)}return i}function WritableStreamClose(t){const r=t._state;if(r==="closed"||r==="errored"){return promiseRejectedWith(new TypeError(`The stream (in ${r} state) is not in the writable state and cannot be closed`))}const n=newPromise(((r,n)=>{const o={_resolve:r,_reject:n};t._closeRequest=o}));const o=t._writer;if(o!==undefined&&t._backpressure&&r==="writable"){defaultWriterReadyPromiseResolve(o)}WritableStreamDefaultControllerClose(t._writableStreamController);return n}function WritableStreamAddWriteRequest(t){const r=newPromise(((r,n)=>{const o={_resolve:r,_reject:n};t._writeRequests.push(o)}));return r}function WritableStreamDealWithRejection(t,r){const n=t._state;if(n==="writable"){WritableStreamStartErroring(t,r);return}WritableStreamFinishErroring(t)}function WritableStreamStartErroring(t,r){const n=t._writableStreamController;t._state="erroring";t._storedError=r;const o=t._writer;if(o!==undefined){WritableStreamDefaultWriterEnsureReadyPromiseRejected(o,r)}if(!WritableStreamHasOperationMarkedInFlight(t)&&n._started){WritableStreamFinishErroring(t)}}function WritableStreamFinishErroring(t){t._state="errored";t._writableStreamController[m]();const r=t._storedError;t._writeRequests.forEach((t=>{t._reject(r)}));t._writeRequests=new SimpleQueue;if(t._pendingAbortRequest===undefined){WritableStreamRejectCloseAndClosedPromiseIfNeeded(t);return}const n=t._pendingAbortRequest;t._pendingAbortRequest=undefined;if(n._wasAlreadyErroring){n._reject(r);WritableStreamRejectCloseAndClosedPromiseIfNeeded(t);return}const o=t._writableStreamController[c](n._reason);uponPromise(o,(()=>{n._resolve();WritableStreamRejectCloseAndClosedPromiseIfNeeded(t)}),(r=>{n._reject(r);WritableStreamRejectCloseAndClosedPromiseIfNeeded(t)}))}function WritableStreamFinishInFlightWrite(t){t._inFlightWriteRequest._resolve(undefined);t._inFlightWriteRequest=undefined}function WritableStreamFinishInFlightWriteWithError(t,r){t._inFlightWriteRequest._reject(r);t._inFlightWriteRequest=undefined;WritableStreamDealWithRejection(t,r)}function WritableStreamFinishInFlightClose(t){t._inFlightCloseRequest._resolve(undefined);t._inFlightCloseRequest=undefined;const r=t._state;if(r==="erroring"){t._storedError=undefined;if(t._pendingAbortRequest!==undefined){t._pendingAbortRequest._resolve();t._pendingAbortRequest=undefined}}t._state="closed";const n=t._writer;if(n!==undefined){defaultWriterClosedPromiseResolve(n)}}function WritableStreamFinishInFlightCloseWithError(t,r){t._inFlightCloseRequest._reject(r);t._inFlightCloseRequest=undefined;if(t._pendingAbortRequest!==undefined){t._pendingAbortRequest._reject(r);t._pendingAbortRequest=undefined}WritableStreamDealWithRejection(t,r)}function WritableStreamCloseQueuedOrInFlight(t){if(t._closeRequest===undefined&&t._inFlightCloseRequest===undefined){return false}return true}function WritableStreamHasOperationMarkedInFlight(t){if(t._inFlightWriteRequest===undefined&&t._inFlightCloseRequest===undefined){return false}return true}function WritableStreamMarkCloseRequestInFlight(t){t._inFlightCloseRequest=t._closeRequest;t._closeRequest=undefined}function WritableStreamMarkFirstWriteRequestInFlight(t){t._inFlightWriteRequest=t._writeRequests.shift()}function WritableStreamRejectCloseAndClosedPromiseIfNeeded(t){if(t._closeRequest!==undefined){t._closeRequest._reject(t._storedError);t._closeRequest=undefined}const r=t._writer;if(r!==undefined){defaultWriterClosedPromiseReject(r,t._storedError)}}function WritableStreamUpdateBackpressure(t,r){const n=t._writer;if(n!==undefined&&r!==t._backpressure){if(r){defaultWriterReadyPromiseReset(n)}else{defaultWriterReadyPromiseResolve(n)}}t._backpressure=r}class WritableStreamDefaultWriter{constructor(t){assertRequiredArgument(t,1,"WritableStreamDefaultWriter");assertWritableStream(t,"First parameter");if(IsWritableStreamLocked(t)){throw new TypeError("This stream has already been locked for exclusive writing by another writer")}this._ownerWritableStream=t;t._writer=this;const r=t._state;if(r==="writable"){if(!WritableStreamCloseQueuedOrInFlight(t)&&t._backpressure){defaultWriterReadyPromiseInitialize(this)}else{defaultWriterReadyPromiseInitializeAsResolved(this)}defaultWriterClosedPromiseInitialize(this)}else if(r==="erroring"){defaultWriterReadyPromiseInitializeAsRejected(this,t._storedError);defaultWriterClosedPromiseInitialize(this)}else if(r==="closed"){defaultWriterReadyPromiseInitializeAsResolved(this);defaultWriterClosedPromiseInitializeAsResolved(this)}else{const r=t._storedError;defaultWriterReadyPromiseInitializeAsRejected(this,r);defaultWriterClosedPromiseInitializeAsRejected(this,r)}}get closed(){if(!IsWritableStreamDefaultWriter(this)){return promiseRejectedWith(defaultWriterBrandCheckException("closed"))}return this._closedPromise}get desiredSize(){if(!IsWritableStreamDefaultWriter(this)){throw defaultWriterBrandCheckException("desiredSize")}if(this._ownerWritableStream===undefined){throw defaultWriterLockException("desiredSize")}return WritableStreamDefaultWriterGetDesiredSize(this)}get ready(){if(!IsWritableStreamDefaultWriter(this)){return promiseRejectedWith(defaultWriterBrandCheckException("ready"))}return this._readyPromise}abort(t=undefined){if(!IsWritableStreamDefaultWriter(this)){return promiseRejectedWith(defaultWriterBrandCheckException("abort"))}if(this._ownerWritableStream===undefined){return promiseRejectedWith(defaultWriterLockException("abort"))}return WritableStreamDefaultWriterAbort(this,t)}close(){if(!IsWritableStreamDefaultWriter(this)){return promiseRejectedWith(defaultWriterBrandCheckException("close"))}const t=this._ownerWritableStream;if(t===undefined){return promiseRejectedWith(defaultWriterLockException("close"))}if(WritableStreamCloseQueuedOrInFlight(t)){return promiseRejectedWith(new TypeError("Cannot close an already-closing stream"))}return WritableStreamDefaultWriterClose(this)}releaseLock(){if(!IsWritableStreamDefaultWriter(this)){throw defaultWriterBrandCheckException("releaseLock")}const t=this._ownerWritableStream;if(t===undefined){return}WritableStreamDefaultWriterRelease(this)}write(t=undefined){if(!IsWritableStreamDefaultWriter(this)){return promiseRejectedWith(defaultWriterBrandCheckException("write"))}if(this._ownerWritableStream===undefined){return promiseRejectedWith(defaultWriterLockException("write to"))}return WritableStreamDefaultWriterWrite(this,t)}}Object.defineProperties(WritableStreamDefaultWriter.prototype,{abort:{enumerable:true},close:{enumerable:true},releaseLock:{enumerable:true},write:{enumerable:true},closed:{enumerable:true},desiredSize:{enumerable:true},ready:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(WritableStreamDefaultWriter.prototype,r.toStringTag,{value:"WritableStreamDefaultWriter",configurable:true})}function IsWritableStreamDefaultWriter(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_ownerWritableStream")){return false}return t instanceof WritableStreamDefaultWriter}function WritableStreamDefaultWriterAbort(t,r){const n=t._ownerWritableStream;return WritableStreamAbort(n,r)}function WritableStreamDefaultWriterClose(t){const r=t._ownerWritableStream;return WritableStreamClose(r)}function WritableStreamDefaultWriterCloseWithErrorPropagation(t){const r=t._ownerWritableStream;const n=r._state;if(WritableStreamCloseQueuedOrInFlight(r)||n==="closed"){return promiseResolvedWith(undefined)}if(n==="errored"){return promiseRejectedWith(r._storedError)}return WritableStreamDefaultWriterClose(t)}function WritableStreamDefaultWriterEnsureClosedPromiseRejected(t,r){if(t._closedPromiseState==="pending"){defaultWriterClosedPromiseReject(t,r)}else{defaultWriterClosedPromiseResetToRejected(t,r)}}function WritableStreamDefaultWriterEnsureReadyPromiseRejected(t,r){if(t._readyPromiseState==="pending"){defaultWriterReadyPromiseReject(t,r)}else{defaultWriterReadyPromiseResetToRejected(t,r)}}function WritableStreamDefaultWriterGetDesiredSize(t){const r=t._ownerWritableStream;const n=r._state;if(n==="errored"||n==="erroring"){return null}if(n==="closed"){return 0}return WritableStreamDefaultControllerGetDesiredSize(r._writableStreamController)}function WritableStreamDefaultWriterRelease(t){const r=t._ownerWritableStream;const n=new TypeError(`Writer was released and can no longer be used to monitor the stream's closedness`);WritableStreamDefaultWriterEnsureReadyPromiseRejected(t,n);WritableStreamDefaultWriterEnsureClosedPromiseRejected(t,n);r._writer=undefined;t._ownerWritableStream=undefined}function WritableStreamDefaultWriterWrite(t,r){const n=t._ownerWritableStream;const o=n._writableStreamController;const a=WritableStreamDefaultControllerGetChunkSize(o,r);if(n!==t._ownerWritableStream){return promiseRejectedWith(defaultWriterLockException("write to"))}const i=n._state;if(i==="errored"){return promiseRejectedWith(n._storedError)}if(WritableStreamCloseQueuedOrInFlight(n)||i==="closed"){return promiseRejectedWith(new TypeError("The stream is closing or closed and cannot be written to"))}if(i==="erroring"){return promiseRejectedWith(n._storedError)}const s=WritableStreamAddWriteRequest(n);WritableStreamDefaultControllerWrite(o,r,a);return s}const C={};class WritableStreamDefaultController{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!IsWritableStreamDefaultController(this)){throw defaultControllerBrandCheckException$2("abortReason")}return this._abortReason}get signal(){if(!IsWritableStreamDefaultController(this)){throw defaultControllerBrandCheckException$2("signal")}if(this._abortController===undefined){throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported")}return this._abortController.signal}error(t=undefined){if(!IsWritableStreamDefaultController(this)){throw defaultControllerBrandCheckException$2("error")}const r=this._controlledWritableStream._state;if(r!=="writable"){return}WritableStreamDefaultControllerError(this,t)}[c](t){const r=this._abortAlgorithm(t);WritableStreamDefaultControllerClearAlgorithms(this);return r}[m](){ResetQueue(this)}}Object.defineProperties(WritableStreamDefaultController.prototype,{abortReason:{enumerable:true},signal:{enumerable:true},error:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(WritableStreamDefaultController.prototype,r.toStringTag,{value:"WritableStreamDefaultController",configurable:true})}function IsWritableStreamDefaultController(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_controlledWritableStream")){return false}return t instanceof WritableStreamDefaultController}function SetUpWritableStreamDefaultController(t,r,n,o,a,i,s,l){r._controlledWritableStream=t;t._writableStreamController=r;r._queue=undefined;r._queueTotalSize=undefined;ResetQueue(r);r._abortReason=undefined;r._abortController=createAbortController();r._started=false;r._strategySizeAlgorithm=l;r._strategyHWM=s;r._writeAlgorithm=o;r._closeAlgorithm=a;r._abortAlgorithm=i;const u=WritableStreamDefaultControllerGetBackpressure(r);WritableStreamUpdateBackpressure(t,u);const d=n();const c=promiseResolvedWith(d);uponPromise(c,(()=>{r._started=true;WritableStreamDefaultControllerAdvanceQueueIfNeeded(r)}),(n=>{r._started=true;WritableStreamDealWithRejection(t,n)}))}function SetUpWritableStreamDefaultControllerFromUnderlyingSink(t,r,n,o){const a=Object.create(WritableStreamDefaultController.prototype);let startAlgorithm=()=>undefined;let writeAlgorithm=()=>promiseResolvedWith(undefined);let closeAlgorithm=()=>promiseResolvedWith(undefined);let abortAlgorithm=()=>promiseResolvedWith(undefined);if(r.start!==undefined){startAlgorithm=()=>r.start(a)}if(r.write!==undefined){writeAlgorithm=t=>r.write(t,a)}if(r.close!==undefined){closeAlgorithm=()=>r.close()}if(r.abort!==undefined){abortAlgorithm=t=>r.abort(t)}SetUpWritableStreamDefaultController(t,a,startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,n,o)}function WritableStreamDefaultControllerClearAlgorithms(t){t._writeAlgorithm=undefined;t._closeAlgorithm=undefined;t._abortAlgorithm=undefined;t._strategySizeAlgorithm=undefined}function WritableStreamDefaultControllerClose(t){EnqueueValueWithSize(t,C,0);WritableStreamDefaultControllerAdvanceQueueIfNeeded(t)}function WritableStreamDefaultControllerGetChunkSize(t,r){try{return t._strategySizeAlgorithm(r)}catch(r){WritableStreamDefaultControllerErrorIfNeeded(t,r);return 1}}function WritableStreamDefaultControllerGetDesiredSize(t){return t._strategyHWM-t._queueTotalSize}function WritableStreamDefaultControllerWrite(t,r,n){try{EnqueueValueWithSize(t,r,n)}catch(r){WritableStreamDefaultControllerErrorIfNeeded(t,r);return}const o=t._controlledWritableStream;if(!WritableStreamCloseQueuedOrInFlight(o)&&o._state==="writable"){const r=WritableStreamDefaultControllerGetBackpressure(t);WritableStreamUpdateBackpressure(o,r)}WritableStreamDefaultControllerAdvanceQueueIfNeeded(t)}function WritableStreamDefaultControllerAdvanceQueueIfNeeded(t){const r=t._controlledWritableStream;if(!t._started){return}if(r._inFlightWriteRequest!==undefined){return}const n=r._state;if(n==="erroring"){WritableStreamFinishErroring(r);return}if(t._queue.length===0){return}const o=PeekQueueValue(t);if(o===C){WritableStreamDefaultControllerProcessClose(t)}else{WritableStreamDefaultControllerProcessWrite(t,o)}}function WritableStreamDefaultControllerErrorIfNeeded(t,r){if(t._controlledWritableStream._state==="writable"){WritableStreamDefaultControllerError(t,r)}}function WritableStreamDefaultControllerProcessClose(t){const r=t._controlledWritableStream;WritableStreamMarkCloseRequestInFlight(r);DequeueValue(t);const n=t._closeAlgorithm();WritableStreamDefaultControllerClearAlgorithms(t);uponPromise(n,(()=>{WritableStreamFinishInFlightClose(r)}),(t=>{WritableStreamFinishInFlightCloseWithError(r,t)}))}function WritableStreamDefaultControllerProcessWrite(t,r){const n=t._controlledWritableStream;WritableStreamMarkFirstWriteRequestInFlight(n);const o=t._writeAlgorithm(r);uponPromise(o,(()=>{WritableStreamFinishInFlightWrite(n);const r=n._state;DequeueValue(t);if(!WritableStreamCloseQueuedOrInFlight(n)&&r==="writable"){const r=WritableStreamDefaultControllerGetBackpressure(t);WritableStreamUpdateBackpressure(n,r)}WritableStreamDefaultControllerAdvanceQueueIfNeeded(t)}),(r=>{if(n._state==="writable"){WritableStreamDefaultControllerClearAlgorithms(t)}WritableStreamFinishInFlightWriteWithError(n,r)}))}function WritableStreamDefaultControllerGetBackpressure(t){const r=WritableStreamDefaultControllerGetDesiredSize(t);return r<=0}function WritableStreamDefaultControllerError(t,r){const n=t._controlledWritableStream;WritableStreamDefaultControllerClearAlgorithms(t);WritableStreamStartErroring(n,r)}function streamBrandCheckException$2(t){return new TypeError(`WritableStream.prototype.${t} can only be used on a WritableStream`)}function defaultControllerBrandCheckException$2(t){return new TypeError(`WritableStreamDefaultController.prototype.${t} can only be used on a WritableStreamDefaultController`)}function defaultWriterBrandCheckException(t){return new TypeError(`WritableStreamDefaultWriter.prototype.${t} can only be used on a WritableStreamDefaultWriter`)}function defaultWriterLockException(t){return new TypeError("Cannot "+t+" a stream using a released writer")}function defaultWriterClosedPromiseInitialize(t){t._closedPromise=newPromise(((r,n)=>{t._closedPromise_resolve=r;t._closedPromise_reject=n;t._closedPromiseState="pending"}))}function defaultWriterClosedPromiseInitializeAsRejected(t,r){defaultWriterClosedPromiseInitialize(t);defaultWriterClosedPromiseReject(t,r)}function defaultWriterClosedPromiseInitializeAsResolved(t){defaultWriterClosedPromiseInitialize(t);defaultWriterClosedPromiseResolve(t)}function defaultWriterClosedPromiseReject(t,r){if(t._closedPromise_reject===undefined){return}setPromiseIsHandledToTrue(t._closedPromise);t._closedPromise_reject(r);t._closedPromise_resolve=undefined;t._closedPromise_reject=undefined;t._closedPromiseState="rejected"}function defaultWriterClosedPromiseResetToRejected(t,r){defaultWriterClosedPromiseInitializeAsRejected(t,r)}function defaultWriterClosedPromiseResolve(t){if(t._closedPromise_resolve===undefined){return}t._closedPromise_resolve(undefined);t._closedPromise_resolve=undefined;t._closedPromise_reject=undefined;t._closedPromiseState="resolved"}function defaultWriterReadyPromiseInitialize(t){t._readyPromise=newPromise(((r,n)=>{t._readyPromise_resolve=r;t._readyPromise_reject=n}));t._readyPromiseState="pending"}function defaultWriterReadyPromiseInitializeAsRejected(t,r){defaultWriterReadyPromiseInitialize(t);defaultWriterReadyPromiseReject(t,r)}function defaultWriterReadyPromiseInitializeAsResolved(t){defaultWriterReadyPromiseInitialize(t);defaultWriterReadyPromiseResolve(t)}function defaultWriterReadyPromiseReject(t,r){if(t._readyPromise_reject===undefined){return}setPromiseIsHandledToTrue(t._readyPromise);t._readyPromise_reject(r);t._readyPromise_resolve=undefined;t._readyPromise_reject=undefined;t._readyPromiseState="rejected"}function defaultWriterReadyPromiseReset(t){defaultWriterReadyPromiseInitialize(t)}function defaultWriterReadyPromiseResetToRejected(t,r){defaultWriterReadyPromiseInitializeAsRejected(t,r)}function defaultWriterReadyPromiseResolve(t){if(t._readyPromise_resolve===undefined){return}t._readyPromise_resolve(undefined);t._readyPromise_resolve=undefined;t._readyPromise_reject=undefined;t._readyPromiseState="fulfilled"}const w=typeof DOMException!=="undefined"?DOMException:undefined;function isDOMExceptionConstructor(t){if(!(typeof t==="function"||typeof t==="object")){return false}try{new t;return true}catch(t){return false}}function createDOMExceptionPolyfill(){const t=function DOMException(t,r){this.message=t||"";this.name=r||"Error";if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}};t.prototype=Object.create(Error.prototype);Object.defineProperty(t.prototype,"constructor",{value:t,writable:true,configurable:true});return t}const v=isDOMExceptionConstructor(w)?w:createDOMExceptionPolyfill();function ReadableStreamPipeTo(t,r,n,o,a,i){const s=AcquireReadableStreamDefaultReader(t);const l=AcquireWritableStreamDefaultWriter(r);t._disturbed=true;let u=false;let d=promiseResolvedWith(undefined);return newPromise(((c,m)=>{let h;if(i!==undefined){h=()=>{const n=new v("Aborted","AbortError");const i=[];if(!o){i.push((()=>{if(r._state==="writable"){return WritableStreamAbort(r,n)}return promiseResolvedWith(undefined)}))}if(!a){i.push((()=>{if(t._state==="readable"){return ReadableStreamCancel(t,n)}return promiseResolvedWith(undefined)}))}shutdownWithAction((()=>Promise.all(i.map((t=>t())))),true,n)};if(i.aborted){h();return}i.addEventListener("abort",h)}function pipeLoop(){return newPromise(((t,r)=>{function next(n){if(n){t()}else{PerformPromiseThen(pipeStep(),next,r)}}next(false)}))}function pipeStep(){if(u){return promiseResolvedWith(true)}return PerformPromiseThen(l._readyPromise,(()=>newPromise(((t,r)=>{ReadableStreamDefaultReaderRead(s,{_chunkSteps:r=>{d=PerformPromiseThen(WritableStreamDefaultWriterWrite(l,r),undefined,noop);t(false)},_closeSteps:()=>t(true),_errorSteps:r})}))))}isOrBecomesErrored(t,s._closedPromise,(t=>{if(!o){shutdownWithAction((()=>WritableStreamAbort(r,t)),true,t)}else{shutdown(true,t)}}));isOrBecomesErrored(r,l._closedPromise,(r=>{if(!a){shutdownWithAction((()=>ReadableStreamCancel(t,r)),true,r)}else{shutdown(true,r)}}));isOrBecomesClosed(t,s._closedPromise,(()=>{if(!n){shutdownWithAction((()=>WritableStreamDefaultWriterCloseWithErrorPropagation(l)))}else{shutdown()}}));if(WritableStreamCloseQueuedOrInFlight(r)||r._state==="closed"){const r=new TypeError("the destination writable stream closed before all data could be piped to it");if(!a){shutdownWithAction((()=>ReadableStreamCancel(t,r)),true,r)}else{shutdown(true,r)}}setPromiseIsHandledToTrue(pipeLoop());function waitForWritesToFinish(){const t=d;return PerformPromiseThen(d,(()=>t!==d?waitForWritesToFinish():undefined))}function isOrBecomesErrored(t,r,n){if(t._state==="errored"){n(t._storedError)}else{uponRejection(r,n)}}function isOrBecomesClosed(t,r,n){if(t._state==="closed"){n()}else{uponFulfillment(r,n)}}function shutdownWithAction(t,n,o){if(u){return}u=true;if(r._state==="writable"&&!WritableStreamCloseQueuedOrInFlight(r)){uponFulfillment(waitForWritesToFinish(),doTheRest)}else{doTheRest()}function doTheRest(){uponPromise(t(),(()=>finalize(n,o)),(t=>finalize(true,t)))}}function shutdown(t,n){if(u){return}u=true;if(r._state==="writable"&&!WritableStreamCloseQueuedOrInFlight(r)){uponFulfillment(waitForWritesToFinish(),(()=>finalize(t,n)))}else{finalize(t,n)}}function finalize(t,r){WritableStreamDefaultWriterRelease(l);ReadableStreamReaderGenericRelease(s);if(i!==undefined){i.removeEventListener("abort",h)}if(t){m(r)}else{c(undefined)}}}))}class ReadableStreamDefaultController{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!IsReadableStreamDefaultController(this)){throw defaultControllerBrandCheckException$1("desiredSize")}return ReadableStreamDefaultControllerGetDesiredSize(this)}close(){if(!IsReadableStreamDefaultController(this)){throw defaultControllerBrandCheckException$1("close")}if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)){throw new TypeError("The stream is not in a state that permits close")}ReadableStreamDefaultControllerClose(this)}enqueue(t=undefined){if(!IsReadableStreamDefaultController(this)){throw defaultControllerBrandCheckException$1("enqueue")}if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)){throw new TypeError("The stream is not in a state that permits enqueue")}return ReadableStreamDefaultControllerEnqueue(this,t)}error(t=undefined){if(!IsReadableStreamDefaultController(this)){throw defaultControllerBrandCheckException$1("error")}ReadableStreamDefaultControllerError(this,t)}[h](t){ResetQueue(this);const r=this._cancelAlgorithm(t);ReadableStreamDefaultControllerClearAlgorithms(this);return r}[p](t){const r=this._controlledReadableStream;if(this._queue.length>0){const n=DequeueValue(this);if(this._closeRequested&&this._queue.length===0){ReadableStreamDefaultControllerClearAlgorithms(this);ReadableStreamClose(r)}else{ReadableStreamDefaultControllerCallPullIfNeeded(this)}t._chunkSteps(n)}else{ReadableStreamAddReadRequest(r,t);ReadableStreamDefaultControllerCallPullIfNeeded(this)}}}Object.defineProperties(ReadableStreamDefaultController.prototype,{close:{enumerable:true},enqueue:{enumerable:true},error:{enumerable:true},desiredSize:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(ReadableStreamDefaultController.prototype,r.toStringTag,{value:"ReadableStreamDefaultController",configurable:true})}function IsReadableStreamDefaultController(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_controlledReadableStream")){return false}return t instanceof ReadableStreamDefaultController}function ReadableStreamDefaultControllerCallPullIfNeeded(t){const r=ReadableStreamDefaultControllerShouldCallPull(t);if(!r){return}if(t._pulling){t._pullAgain=true;return}t._pulling=true;const n=t._pullAlgorithm();uponPromise(n,(()=>{t._pulling=false;if(t._pullAgain){t._pullAgain=false;ReadableStreamDefaultControllerCallPullIfNeeded(t)}}),(r=>{ReadableStreamDefaultControllerError(t,r)}))}function ReadableStreamDefaultControllerShouldCallPull(t){const r=t._controlledReadableStream;if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(t)){return false}if(!t._started){return false}if(IsReadableStreamLocked(r)&&ReadableStreamGetNumReadRequests(r)>0){return true}const n=ReadableStreamDefaultControllerGetDesiredSize(t);if(n>0){return true}return false}function ReadableStreamDefaultControllerClearAlgorithms(t){t._pullAlgorithm=undefined;t._cancelAlgorithm=undefined;t._strategySizeAlgorithm=undefined}function ReadableStreamDefaultControllerClose(t){if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(t)){return}const r=t._controlledReadableStream;t._closeRequested=true;if(t._queue.length===0){ReadableStreamDefaultControllerClearAlgorithms(t);ReadableStreamClose(r)}}function ReadableStreamDefaultControllerEnqueue(t,r){if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(t)){return}const n=t._controlledReadableStream;if(IsReadableStreamLocked(n)&&ReadableStreamGetNumReadRequests(n)>0){ReadableStreamFulfillReadRequest(n,r,false)}else{let n;try{n=t._strategySizeAlgorithm(r)}catch(r){ReadableStreamDefaultControllerError(t,r);throw r}try{EnqueueValueWithSize(t,r,n)}catch(r){ReadableStreamDefaultControllerError(t,r);throw r}}ReadableStreamDefaultControllerCallPullIfNeeded(t)}function ReadableStreamDefaultControllerError(t,r){const n=t._controlledReadableStream;if(n._state!=="readable"){return}ResetQueue(t);ReadableStreamDefaultControllerClearAlgorithms(t);ReadableStreamError(n,r)}function ReadableStreamDefaultControllerGetDesiredSize(t){const r=t._controlledReadableStream._state;if(r==="errored"){return null}if(r==="closed"){return 0}return t._strategyHWM-t._queueTotalSize}function ReadableStreamDefaultControllerHasBackpressure(t){if(ReadableStreamDefaultControllerShouldCallPull(t)){return false}return true}function ReadableStreamDefaultControllerCanCloseOrEnqueue(t){const r=t._controlledReadableStream._state;if(!t._closeRequested&&r==="readable"){return true}return false}function SetUpReadableStreamDefaultController(t,r,n,o,a,i,s){r._controlledReadableStream=t;r._queue=undefined;r._queueTotalSize=undefined;ResetQueue(r);r._started=false;r._closeRequested=false;r._pullAgain=false;r._pulling=false;r._strategySizeAlgorithm=s;r._strategyHWM=i;r._pullAlgorithm=o;r._cancelAlgorithm=a;t._readableStreamController=r;const l=n();uponPromise(promiseResolvedWith(l),(()=>{r._started=true;ReadableStreamDefaultControllerCallPullIfNeeded(r)}),(t=>{ReadableStreamDefaultControllerError(r,t)}))}function SetUpReadableStreamDefaultControllerFromUnderlyingSource(t,r,n,o){const a=Object.create(ReadableStreamDefaultController.prototype);let startAlgorithm=()=>undefined;let pullAlgorithm=()=>promiseResolvedWith(undefined);let cancelAlgorithm=()=>promiseResolvedWith(undefined);if(r.start!==undefined){startAlgorithm=()=>r.start(a)}if(r.pull!==undefined){pullAlgorithm=()=>r.pull(a)}if(r.cancel!==undefined){cancelAlgorithm=t=>r.cancel(t)}SetUpReadableStreamDefaultController(t,a,startAlgorithm,pullAlgorithm,cancelAlgorithm,n,o)}function defaultControllerBrandCheckException$1(t){return new TypeError(`ReadableStreamDefaultController.prototype.${t} can only be used on a ReadableStreamDefaultController`)}function ReadableStreamTee(t,r){if(IsReadableByteStreamController(t._readableStreamController)){return ReadableByteStreamTee(t)}return ReadableStreamDefaultTee(t)}function ReadableStreamDefaultTee(t,r){const n=AcquireReadableStreamDefaultReader(t);let o=false;let a=false;let i=false;let s=false;let l;let d;let c;let m;let h;const p=newPromise((t=>{h=t}));function pullAlgorithm(){if(o){a=true;return promiseResolvedWith(undefined)}o=true;const t={_chunkSteps:t=>{u((()=>{a=false;const r=t;const n=t;if(!i){ReadableStreamDefaultControllerEnqueue(c._readableStreamController,r)}if(!s){ReadableStreamDefaultControllerEnqueue(m._readableStreamController,n)}o=false;if(a){pullAlgorithm()}}))},_closeSteps:()=>{o=false;if(!i){ReadableStreamDefaultControllerClose(c._readableStreamController)}if(!s){ReadableStreamDefaultControllerClose(m._readableStreamController)}if(!i||!s){h(undefined)}},_errorSteps:()=>{o=false}};ReadableStreamDefaultReaderRead(n,t);return promiseResolvedWith(undefined)}function cancel1Algorithm(r){i=true;l=r;if(s){const r=CreateArrayFromList([l,d]);const n=ReadableStreamCancel(t,r);h(n)}return p}function cancel2Algorithm(r){s=true;d=r;if(i){const r=CreateArrayFromList([l,d]);const n=ReadableStreamCancel(t,r);h(n)}return p}function startAlgorithm(){}c=CreateReadableStream(startAlgorithm,pullAlgorithm,cancel1Algorithm);m=CreateReadableStream(startAlgorithm,pullAlgorithm,cancel2Algorithm);uponRejection(n._closedPromise,(t=>{ReadableStreamDefaultControllerError(c._readableStreamController,t);ReadableStreamDefaultControllerError(m._readableStreamController,t);if(!i||!s){h(undefined)}}));return[c,m]}function ReadableByteStreamTee(t){let r=AcquireReadableStreamDefaultReader(t);let n=false;let o=false;let a=false;let i=false;let s=false;let l;let d;let c;let m;let h;const p=newPromise((t=>{h=t}));function forwardReaderError(t){uponRejection(t._closedPromise,(n=>{if(t!==r){return}ReadableByteStreamControllerError(c._readableStreamController,n);ReadableByteStreamControllerError(m._readableStreamController,n);if(!i||!s){h(undefined)}}))}function pullWithDefaultReader(){if(IsReadableStreamBYOBReader(r)){ReadableStreamReaderGenericRelease(r);r=AcquireReadableStreamDefaultReader(t);forwardReaderError(r)}const l={_chunkSteps:r=>{u((()=>{o=false;a=false;const l=r;let u=r;if(!i&&!s){try{u=CloneAsUint8Array(r)}catch(r){ReadableByteStreamControllerError(c._readableStreamController,r);ReadableByteStreamControllerError(m._readableStreamController,r);h(ReadableStreamCancel(t,r));return}}if(!i){ReadableByteStreamControllerEnqueue(c._readableStreamController,l)}if(!s){ReadableByteStreamControllerEnqueue(m._readableStreamController,u)}n=false;if(o){pull1Algorithm()}else if(a){pull2Algorithm()}}))},_closeSteps:()=>{n=false;if(!i){ReadableByteStreamControllerClose(c._readableStreamController)}if(!s){ReadableByteStreamControllerClose(m._readableStreamController)}if(c._readableStreamController._pendingPullIntos.length>0){ReadableByteStreamControllerRespond(c._readableStreamController,0)}if(m._readableStreamController._pendingPullIntos.length>0){ReadableByteStreamControllerRespond(m._readableStreamController,0)}if(!i||!s){h(undefined)}},_errorSteps:()=>{n=false}};ReadableStreamDefaultReaderRead(r,l)}function pullWithBYOBReader(l,d){if(IsReadableStreamDefaultReader(r)){ReadableStreamReaderGenericRelease(r);r=AcquireReadableStreamBYOBReader(t);forwardReaderError(r)}const p=d?m:c;const b=d?c:m;const y={_chunkSteps:r=>{u((()=>{o=false;a=false;const l=d?s:i;const u=d?i:s;if(!u){let n;try{n=CloneAsUint8Array(r)}catch(r){ReadableByteStreamControllerError(p._readableStreamController,r);ReadableByteStreamControllerError(b._readableStreamController,r);h(ReadableStreamCancel(t,r));return}if(!l){ReadableByteStreamControllerRespondWithNewView(p._readableStreamController,r)}ReadableByteStreamControllerEnqueue(b._readableStreamController,n)}else if(!l){ReadableByteStreamControllerRespondWithNewView(p._readableStreamController,r)}n=false;if(o){pull1Algorithm()}else if(a){pull2Algorithm()}}))},_closeSteps:t=>{n=false;const r=d?s:i;const o=d?i:s;if(!r){ReadableByteStreamControllerClose(p._readableStreamController)}if(!o){ReadableByteStreamControllerClose(b._readableStreamController)}if(t!==undefined){if(!r){ReadableByteStreamControllerRespondWithNewView(p._readableStreamController,t)}if(!o&&b._readableStreamController._pendingPullIntos.length>0){ReadableByteStreamControllerRespond(b._readableStreamController,0)}}if(!r||!o){h(undefined)}},_errorSteps:()=>{n=false}};ReadableStreamBYOBReaderRead(r,l,y)}function pull1Algorithm(){if(n){o=true;return promiseResolvedWith(undefined)}n=true;const t=ReadableByteStreamControllerGetBYOBRequest(c._readableStreamController);if(t===null){pullWithDefaultReader()}else{pullWithBYOBReader(t._view,false)}return promiseResolvedWith(undefined)}function pull2Algorithm(){if(n){a=true;return promiseResolvedWith(undefined)}n=true;const t=ReadableByteStreamControllerGetBYOBRequest(m._readableStreamController);if(t===null){pullWithDefaultReader()}else{pullWithBYOBReader(t._view,true)}return promiseResolvedWith(undefined)}function cancel1Algorithm(r){i=true;l=r;if(s){const r=CreateArrayFromList([l,d]);const n=ReadableStreamCancel(t,r);h(n)}return p}function cancel2Algorithm(r){s=true;d=r;if(i){const r=CreateArrayFromList([l,d]);const n=ReadableStreamCancel(t,r);h(n)}return p}function startAlgorithm(){return}c=CreateReadableByteStream(startAlgorithm,pull1Algorithm,cancel1Algorithm);m=CreateReadableByteStream(startAlgorithm,pull2Algorithm,cancel2Algorithm);forwardReaderError(r);return[c,m]}function convertUnderlyingDefaultOrByteSource(t,r){assertDictionary(t,r);const n=t;const o=n===null||n===void 0?void 0:n.autoAllocateChunkSize;const a=n===null||n===void 0?void 0:n.cancel;const i=n===null||n===void 0?void 0:n.pull;const s=n===null||n===void 0?void 0:n.start;const l=n===null||n===void 0?void 0:n.type;return{autoAllocateChunkSize:o===undefined?undefined:convertUnsignedLongLongWithEnforceRange(o,`${r} has member 'autoAllocateChunkSize' that`),cancel:a===undefined?undefined:convertUnderlyingSourceCancelCallback(a,n,`${r} has member 'cancel' that`),pull:i===undefined?undefined:convertUnderlyingSourcePullCallback(i,n,`${r} has member 'pull' that`),start:s===undefined?undefined:convertUnderlyingSourceStartCallback(s,n,`${r} has member 'start' that`),type:l===undefined?undefined:convertReadableStreamType(l,`${r} has member 'type' that`)}}function convertUnderlyingSourceCancelCallback(t,r,n){assertFunction(t,n);return n=>promiseCall(t,r,[n])}function convertUnderlyingSourcePullCallback(t,r,n){assertFunction(t,n);return n=>promiseCall(t,r,[n])}function convertUnderlyingSourceStartCallback(t,r,n){assertFunction(t,n);return n=>reflectCall(t,r,[n])}function convertReadableStreamType(t,r){t=`${t}`;if(t!=="bytes"){throw new TypeError(`${r} '${t}' is not a valid enumeration value for ReadableStreamType`)}return t}function convertReaderOptions(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.mode;return{mode:n===undefined?undefined:convertReadableStreamReaderMode(n,`${r} has member 'mode' that`)}}function convertReadableStreamReaderMode(t,r){t=`${t}`;if(t!=="byob"){throw new TypeError(`${r} '${t}' is not a valid enumeration value for ReadableStreamReaderMode`)}return t}function convertIteratorOptions(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.preventCancel;return{preventCancel:Boolean(n)}}function convertPipeOptions(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.preventAbort;const o=t===null||t===void 0?void 0:t.preventCancel;const a=t===null||t===void 0?void 0:t.preventClose;const i=t===null||t===void 0?void 0:t.signal;if(i!==undefined){assertAbortSignal(i,`${r} has member 'signal' that`)}return{preventAbort:Boolean(n),preventCancel:Boolean(o),preventClose:Boolean(a),signal:i}}function assertAbortSignal(t,r){if(!isAbortSignal(t)){throw new TypeError(`${r} is not an AbortSignal.`)}}function convertReadableWritablePair(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.readable;assertRequiredField(n,"readable","ReadableWritablePair");assertReadableStream(n,`${r} has member 'readable' that`);const o=t===null||t===void 0?void 0:t.writable;assertRequiredField(o,"writable","ReadableWritablePair");assertWritableStream(o,`${r} has member 'writable' that`);return{readable:n,writable:o}}class ReadableStream{constructor(t={},r={}){if(t===undefined){t=null}else{assertObject(t,"First parameter")}const n=convertQueuingStrategy(r,"Second parameter");const o=convertUnderlyingDefaultOrByteSource(t,"First parameter");InitializeReadableStream(this);if(o.type==="bytes"){if(n.size!==undefined){throw new RangeError("The strategy for a byte stream cannot have a size function")}const t=ExtractHighWaterMark(n,0);SetUpReadableByteStreamControllerFromUnderlyingSource(this,o,t)}else{const t=ExtractSizeAlgorithm(n);const r=ExtractHighWaterMark(n,1);SetUpReadableStreamDefaultControllerFromUnderlyingSource(this,o,r,t)}}get locked(){if(!IsReadableStream(this)){throw streamBrandCheckException$1("locked")}return IsReadableStreamLocked(this)}cancel(t=undefined){if(!IsReadableStream(this)){return promiseRejectedWith(streamBrandCheckException$1("cancel"))}if(IsReadableStreamLocked(this)){return promiseRejectedWith(new TypeError("Cannot cancel a stream that already has a reader"))}return ReadableStreamCancel(this,t)}getReader(t=undefined){if(!IsReadableStream(this)){throw streamBrandCheckException$1("getReader")}const r=convertReaderOptions(t,"First parameter");if(r.mode===undefined){return AcquireReadableStreamDefaultReader(this)}return AcquireReadableStreamBYOBReader(this)}pipeThrough(t,r={}){if(!IsReadableStream(this)){throw streamBrandCheckException$1("pipeThrough")}assertRequiredArgument(t,1,"pipeThrough");const n=convertReadableWritablePair(t,"First parameter");const o=convertPipeOptions(r,"Second parameter");if(IsReadableStreamLocked(this)){throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream")}if(IsWritableStreamLocked(n.writable)){throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream")}const a=ReadableStreamPipeTo(this,n.writable,o.preventClose,o.preventAbort,o.preventCancel,o.signal);setPromiseIsHandledToTrue(a);return n.readable}pipeTo(t,r={}){if(!IsReadableStream(this)){return promiseRejectedWith(streamBrandCheckException$1("pipeTo"))}if(t===undefined){return promiseRejectedWith(`Parameter 1 is required in 'pipeTo'.`)}if(!IsWritableStream(t)){return promiseRejectedWith(new TypeError(`ReadableStream.prototype.pipeTo's first argument must be a WritableStream`))}let n;try{n=convertPipeOptions(r,"Second parameter")}catch(t){return promiseRejectedWith(t)}if(IsReadableStreamLocked(this)){return promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream"))}if(IsWritableStreamLocked(t)){return promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream"))}return ReadableStreamPipeTo(this,t,n.preventClose,n.preventAbort,n.preventCancel,n.signal)}tee(){if(!IsReadableStream(this)){throw streamBrandCheckException$1("tee")}const t=ReadableStreamTee(this);return CreateArrayFromList(t)}values(t=undefined){if(!IsReadableStream(this)){throw streamBrandCheckException$1("values")}const r=convertIteratorOptions(t,"First parameter");return AcquireReadableStreamAsyncIterator(this,r.preventCancel)}}Object.defineProperties(ReadableStream.prototype,{cancel:{enumerable:true},getReader:{enumerable:true},pipeThrough:{enumerable:true},pipeTo:{enumerable:true},tee:{enumerable:true},values:{enumerable:true},locked:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(ReadableStream.prototype,r.toStringTag,{value:"ReadableStream",configurable:true})}if(typeof r.asyncIterator==="symbol"){Object.defineProperty(ReadableStream.prototype,r.asyncIterator,{value:ReadableStream.prototype.values,writable:true,configurable:true})}function CreateReadableStream(t,r,n,o=1,a=(()=>1)){const i=Object.create(ReadableStream.prototype);InitializeReadableStream(i);const s=Object.create(ReadableStreamDefaultController.prototype);SetUpReadableStreamDefaultController(i,s,t,r,n,o,a);return i}function CreateReadableByteStream(t,r,n){const o=Object.create(ReadableStream.prototype);InitializeReadableStream(o);const a=Object.create(ReadableByteStreamController.prototype);SetUpReadableByteStreamController(o,a,t,r,n,0,undefined);return o}function InitializeReadableStream(t){t._state="readable";t._reader=undefined;t._storedError=undefined;t._disturbed=false}function IsReadableStream(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_readableStreamController")){return false}return t instanceof ReadableStream}function IsReadableStreamLocked(t){if(t._reader===undefined){return false}return true}function ReadableStreamCancel(t,r){t._disturbed=true;if(t._state==="closed"){return promiseResolvedWith(undefined)}if(t._state==="errored"){return promiseRejectedWith(t._storedError)}ReadableStreamClose(t);const n=t._reader;if(n!==undefined&&IsReadableStreamBYOBReader(n)){n._readIntoRequests.forEach((t=>{t._closeSteps(undefined)}));n._readIntoRequests=new SimpleQueue}const o=t._readableStreamController[h](r);return transformPromiseWith(o,noop)}function ReadableStreamClose(t){t._state="closed";const r=t._reader;if(r===undefined){return}defaultReaderClosedPromiseResolve(r);if(IsReadableStreamDefaultReader(r)){r._readRequests.forEach((t=>{t._closeSteps()}));r._readRequests=new SimpleQueue}}function ReadableStreamError(t,r){t._state="errored";t._storedError=r;const n=t._reader;if(n===undefined){return}defaultReaderClosedPromiseReject(n,r);if(IsReadableStreamDefaultReader(n)){n._readRequests.forEach((t=>{t._errorSteps(r)}));n._readRequests=new SimpleQueue}else{n._readIntoRequests.forEach((t=>{t._errorSteps(r)}));n._readIntoRequests=new SimpleQueue}}function streamBrandCheckException$1(t){return new TypeError(`ReadableStream.prototype.${t} can only be used on a ReadableStream`)}function convertQueuingStrategyInit(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.highWaterMark;assertRequiredField(n,"highWaterMark","QueuingStrategyInit");return{highWaterMark:convertUnrestrictedDouble(n)}}const byteLengthSizeFunction=t=>t.byteLength;try{Object.defineProperty(byteLengthSizeFunction,"name",{value:"size",configurable:true})}catch(t){}class ByteLengthQueuingStrategy{constructor(t){assertRequiredArgument(t,1,"ByteLengthQueuingStrategy");t=convertQueuingStrategyInit(t,"First parameter");this._byteLengthQueuingStrategyHighWaterMark=t.highWaterMark}get highWaterMark(){if(!IsByteLengthQueuingStrategy(this)){throw byteLengthBrandCheckException("highWaterMark")}return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!IsByteLengthQueuingStrategy(this)){throw byteLengthBrandCheckException("size")}return byteLengthSizeFunction}}Object.defineProperties(ByteLengthQueuingStrategy.prototype,{highWaterMark:{enumerable:true},size:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(ByteLengthQueuingStrategy.prototype,r.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:true})}function byteLengthBrandCheckException(t){return new TypeError(`ByteLengthQueuingStrategy.prototype.${t} can only be used on a ByteLengthQueuingStrategy`)}function IsByteLengthQueuingStrategy(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_byteLengthQueuingStrategyHighWaterMark")){return false}return t instanceof ByteLengthQueuingStrategy}const countSizeFunction=()=>1;try{Object.defineProperty(countSizeFunction,"name",{value:"size",configurable:true})}catch(t){}class CountQueuingStrategy{constructor(t){assertRequiredArgument(t,1,"CountQueuingStrategy");t=convertQueuingStrategyInit(t,"First parameter");this._countQueuingStrategyHighWaterMark=t.highWaterMark}get highWaterMark(){if(!IsCountQueuingStrategy(this)){throw countBrandCheckException("highWaterMark")}return this._countQueuingStrategyHighWaterMark}get size(){if(!IsCountQueuingStrategy(this)){throw countBrandCheckException("size")}return countSizeFunction}}Object.defineProperties(CountQueuingStrategy.prototype,{highWaterMark:{enumerable:true},size:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(CountQueuingStrategy.prototype,r.toStringTag,{value:"CountQueuingStrategy",configurable:true})}function countBrandCheckException(t){return new TypeError(`CountQueuingStrategy.prototype.${t} can only be used on a CountQueuingStrategy`)}function IsCountQueuingStrategy(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_countQueuingStrategyHighWaterMark")){return false}return t instanceof CountQueuingStrategy}function convertTransformer(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.flush;const o=t===null||t===void 0?void 0:t.readableType;const a=t===null||t===void 0?void 0:t.start;const i=t===null||t===void 0?void 0:t.transform;const s=t===null||t===void 0?void 0:t.writableType;return{flush:n===undefined?undefined:convertTransformerFlushCallback(n,t,`${r} has member 'flush' that`),readableType:o,start:a===undefined?undefined:convertTransformerStartCallback(a,t,`${r} has member 'start' that`),transform:i===undefined?undefined:convertTransformerTransformCallback(i,t,`${r} has member 'transform' that`),writableType:s}}function convertTransformerFlushCallback(t,r,n){assertFunction(t,n);return n=>promiseCall(t,r,[n])}function convertTransformerStartCallback(t,r,n){assertFunction(t,n);return n=>reflectCall(t,r,[n])}function convertTransformerTransformCallback(t,r,n){assertFunction(t,n);return(n,o)=>promiseCall(t,r,[n,o])}class TransformStream{constructor(t={},r={},n={}){if(t===undefined){t=null}const o=convertQueuingStrategy(r,"Second parameter");const a=convertQueuingStrategy(n,"Third parameter");const i=convertTransformer(t,"First parameter");if(i.readableType!==undefined){throw new RangeError("Invalid readableType specified")}if(i.writableType!==undefined){throw new RangeError("Invalid writableType specified")}const s=ExtractHighWaterMark(a,0);const l=ExtractSizeAlgorithm(a);const u=ExtractHighWaterMark(o,1);const d=ExtractSizeAlgorithm(o);let c;const m=newPromise((t=>{c=t}));InitializeTransformStream(this,m,u,d,s,l);SetUpTransformStreamDefaultControllerFromTransformer(this,i);if(i.start!==undefined){c(i.start(this._transformStreamController))}else{c(undefined)}}get readable(){if(!IsTransformStream(this)){throw streamBrandCheckException("readable")}return this._readable}get writable(){if(!IsTransformStream(this)){throw streamBrandCheckException("writable")}return this._writable}}Object.defineProperties(TransformStream.prototype,{readable:{enumerable:true},writable:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(TransformStream.prototype,r.toStringTag,{value:"TransformStream",configurable:true})}function InitializeTransformStream(t,r,n,o,a,i){function startAlgorithm(){return r}function writeAlgorithm(r){return TransformStreamDefaultSinkWriteAlgorithm(t,r)}function abortAlgorithm(r){return TransformStreamDefaultSinkAbortAlgorithm(t,r)}function closeAlgorithm(){return TransformStreamDefaultSinkCloseAlgorithm(t)}t._writable=CreateWritableStream(startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,n,o);function pullAlgorithm(){return TransformStreamDefaultSourcePullAlgorithm(t)}function cancelAlgorithm(r){TransformStreamErrorWritableAndUnblockWrite(t,r);return promiseResolvedWith(undefined)}t._readable=CreateReadableStream(startAlgorithm,pullAlgorithm,cancelAlgorithm,a,i);t._backpressure=undefined;t._backpressureChangePromise=undefined;t._backpressureChangePromise_resolve=undefined;TransformStreamSetBackpressure(t,true);t._transformStreamController=undefined}function IsTransformStream(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_transformStreamController")){return false}return t instanceof TransformStream}function TransformStreamError(t,r){ReadableStreamDefaultControllerError(t._readable._readableStreamController,r);TransformStreamErrorWritableAndUnblockWrite(t,r)}function TransformStreamErrorWritableAndUnblockWrite(t,r){TransformStreamDefaultControllerClearAlgorithms(t._transformStreamController);WritableStreamDefaultControllerErrorIfNeeded(t._writable._writableStreamController,r);if(t._backpressure){TransformStreamSetBackpressure(t,false)}}function TransformStreamSetBackpressure(t,r){if(t._backpressureChangePromise!==undefined){t._backpressureChangePromise_resolve()}t._backpressureChangePromise=newPromise((r=>{t._backpressureChangePromise_resolve=r}));t._backpressure=r}class TransformStreamDefaultController{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!IsTransformStreamDefaultController(this)){throw defaultControllerBrandCheckException("desiredSize")}const t=this._controlledTransformStream._readable._readableStreamController;return ReadableStreamDefaultControllerGetDesiredSize(t)}enqueue(t=undefined){if(!IsTransformStreamDefaultController(this)){throw defaultControllerBrandCheckException("enqueue")}TransformStreamDefaultControllerEnqueue(this,t)}error(t=undefined){if(!IsTransformStreamDefaultController(this)){throw defaultControllerBrandCheckException("error")}TransformStreamDefaultControllerError(this,t)}terminate(){if(!IsTransformStreamDefaultController(this)){throw defaultControllerBrandCheckException("terminate")}TransformStreamDefaultControllerTerminate(this)}}Object.defineProperties(TransformStreamDefaultController.prototype,{enqueue:{enumerable:true},error:{enumerable:true},terminate:{enumerable:true},desiredSize:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(TransformStreamDefaultController.prototype,r.toStringTag,{value:"TransformStreamDefaultController",configurable:true})}function IsTransformStreamDefaultController(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_controlledTransformStream")){return false}return t instanceof TransformStreamDefaultController}function SetUpTransformStreamDefaultController(t,r,n,o){r._controlledTransformStream=t;t._transformStreamController=r;r._transformAlgorithm=n;r._flushAlgorithm=o}function SetUpTransformStreamDefaultControllerFromTransformer(t,r){const n=Object.create(TransformStreamDefaultController.prototype);let transformAlgorithm=t=>{try{TransformStreamDefaultControllerEnqueue(n,t);return promiseResolvedWith(undefined)}catch(t){return promiseRejectedWith(t)}};let flushAlgorithm=()=>promiseResolvedWith(undefined);if(r.transform!==undefined){transformAlgorithm=t=>r.transform(t,n)}if(r.flush!==undefined){flushAlgorithm=()=>r.flush(n)}SetUpTransformStreamDefaultController(t,n,transformAlgorithm,flushAlgorithm)}function TransformStreamDefaultControllerClearAlgorithms(t){t._transformAlgorithm=undefined;t._flushAlgorithm=undefined}function TransformStreamDefaultControllerEnqueue(t,r){const n=t._controlledTransformStream;const o=n._readable._readableStreamController;if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(o)){throw new TypeError("Readable side is not in a state that permits enqueue")}try{ReadableStreamDefaultControllerEnqueue(o,r)}catch(t){TransformStreamErrorWritableAndUnblockWrite(n,t);throw n._readable._storedError}const a=ReadableStreamDefaultControllerHasBackpressure(o);if(a!==n._backpressure){TransformStreamSetBackpressure(n,true)}}function TransformStreamDefaultControllerError(t,r){TransformStreamError(t._controlledTransformStream,r)}function TransformStreamDefaultControllerPerformTransform(t,r){const n=t._transformAlgorithm(r);return transformPromiseWith(n,undefined,(r=>{TransformStreamError(t._controlledTransformStream,r);throw r}))}function TransformStreamDefaultControllerTerminate(t){const r=t._controlledTransformStream;const n=r._readable._readableStreamController;ReadableStreamDefaultControllerClose(n);const o=new TypeError("TransformStream terminated");TransformStreamErrorWritableAndUnblockWrite(r,o)}function TransformStreamDefaultSinkWriteAlgorithm(t,r){const n=t._transformStreamController;if(t._backpressure){const o=t._backpressureChangePromise;return transformPromiseWith(o,(()=>{const o=t._writable;const a=o._state;if(a==="erroring"){throw o._storedError}return TransformStreamDefaultControllerPerformTransform(n,r)}))}return TransformStreamDefaultControllerPerformTransform(n,r)}function TransformStreamDefaultSinkAbortAlgorithm(t,r){TransformStreamError(t,r);return promiseResolvedWith(undefined)}function TransformStreamDefaultSinkCloseAlgorithm(t){const r=t._readable;const n=t._transformStreamController;const o=n._flushAlgorithm();TransformStreamDefaultControllerClearAlgorithms(n);return transformPromiseWith(o,(()=>{if(r._state==="errored"){throw r._storedError}ReadableStreamDefaultControllerClose(r._readableStreamController)}),(n=>{TransformStreamError(t,n);throw r._storedError}))}function TransformStreamDefaultSourcePullAlgorithm(t){TransformStreamSetBackpressure(t,false);return t._backpressureChangePromise}function defaultControllerBrandCheckException(t){return new TypeError(`TransformStreamDefaultController.prototype.${t} can only be used on a TransformStreamDefaultController`)}function streamBrandCheckException(t){return new TypeError(`TransformStream.prototype.${t} can only be used on a TransformStream`)}t.ByteLengthQueuingStrategy=ByteLengthQueuingStrategy;t.CountQueuingStrategy=CountQueuingStrategy;t.ReadableByteStreamController=ReadableByteStreamController;t.ReadableStream=ReadableStream;t.ReadableStreamBYOBReader=ReadableStreamBYOBReader;t.ReadableStreamBYOBRequest=ReadableStreamBYOBRequest;t.ReadableStreamDefaultController=ReadableStreamDefaultController;t.ReadableStreamDefaultReader=ReadableStreamDefaultReader;t.TransformStream=TransformStream;t.TransformStreamDefaultController=TransformStreamDefaultController;t.WritableStream=WritableStream;t.WritableStreamDefaultController=WritableStreamDefaultController;t.WritableStreamDefaultWriter=WritableStreamDefaultWriter;Object.defineProperty(t,"__esModule",{value:true})}))},9491:t=>{t.exports=require("assert")},4300:t=>{t.exports=require("buffer")},6113:t=>{t.exports=require("crypto")},2361:t=>{t.exports=require("events")},7147:t=>{t.exports=require("fs")},3685:t=>{t.exports=require("http")},5687:t=>{t.exports=require("https")},1808:t=>{t.exports=require("net")},7742:t=>{t.exports=require("node:process")},2477:t=>{t.exports=require("node:stream/web")},2037:t=>{t.exports=require("os")},1017:t=>{t.exports=require("path")},4404:t=>{t.exports=require("tls")},3837:t=>{t.exports=require("util")},1267:t=>{t.exports=require("worker_threads")},8572:(t,r,n)=>{const o=65536;if(!globalThis.ReadableStream){try{const t=n(7742);const{emitWarning:r}=t;try{t.emitWarning=()=>{};Object.assign(globalThis,n(2477));t.emitWarning=r}catch(n){t.emitWarning=r;throw n}}catch(t){Object.assign(globalThis,n(1452))}}try{const{Blob:t}=n(4300);if(t&&!t.prototype.stream){t.prototype.stream=function name(t){let r=0;const n=this;return new ReadableStream({type:"bytes",async pull(t){const a=n.slice(r,Math.min(n.size,r+o));const i=await a.arrayBuffer();r+=i.byteLength;t.enqueue(new Uint8Array(i));if(r===n.size){t.close()}}})}}}catch(t){}},3213:(t,r,n)=>{n.d(r,{Z:()=>s});var o=n(1410);const a=class File extends o.Z{#e=0;#t="";constructor(t,r,n={}){if(arguments.length<2){throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`)}super(t,n);if(n===null)n={};const o=n.lastModified===undefined?Date.now():Number(n.lastModified);if(!Number.isNaN(o)){this.#e=o}this.#t=String(r)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](t){return!!t&&t instanceof o.Z&&/^(File)$/.test(t[Symbol.toStringTag])}};const i=a;const s=i},2777:(t,r,n)=>{n.d(r,{$B:()=>s.Z});const o=require("node:fs");const a=require("node:path");var i=n(7760);var s=n(3213);var l=n(1410);const{stat:u}=o.promises;const blobFromSync=(t,r)=>fromBlob(statSync(t),t,r);const blobFrom=(t,r)=>u(t).then((n=>fromBlob(n,t,r)));const fileFrom=(t,r)=>u(t).then((n=>fromFile(n,t,r)));const fileFromSync=(t,r)=>fromFile(statSync(t),t,r);const fromBlob=(t,r,n="")=>new Blob([new BlobDataItem({path:r,size:t.size,lastModified:t.mtimeMs,start:0})],{type:n});const fromFile=(t,r,n="")=>new File([new BlobDataItem({path:r,size:t.size,lastModified:t.mtimeMs,start:0})],basename(r),{type:n,lastModified:t.mtimeMs});class BlobDataItem{#r;#n;constructor(t){this.#r=t.path;this.#n=t.start;this.size=t.size;this.lastModified=t.lastModified}slice(t,r){return new BlobDataItem({path:this.#r,lastModified:this.lastModified,size:r-t,start:this.#n+t})}async*stream(){const{mtimeMs:t}=await u(this.#r);if(t>this.lastModified){throw new DOMException("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError")}yield*createReadStream(this.#r,{start:this.#n,end:this.#n+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}const d=null&&blobFromSync},1410:(t,r,n)=>{n.d(r,{Z:()=>l});var o=n(8572); +/*! fetch-blob. MIT License. Jimmy Wärting */const a=65536;async function*toIterator(t,r=true){for(const n of t){if("stream"in n){yield*n.stream()}else if(ArrayBuffer.isView(n)){if(r){let t=n.byteOffset;const r=n.byteOffset+n.byteLength;while(t!==r){const o=Math.min(r-t,a);const i=n.buffer.slice(t,t+o);t+=i.byteLength;yield new Uint8Array(i)}}else{yield n}}else{let t=0,r=n;while(t!==r.size){const n=r.slice(t,Math.min(r.size,t+a));const o=await n.arrayBuffer();t+=o.byteLength;yield new Uint8Array(o)}}}}const i=class Blob{#o=[];#a="";#i=0;#s="transparent";constructor(t=[],r={}){if(typeof t!=="object"||t===null){throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.")}if(typeof t[Symbol.iterator]!=="function"){throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.")}if(typeof r!=="object"&&typeof r!=="function"){throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.")}if(r===null)r={};const n=new TextEncoder;for(const r of t){let t;if(ArrayBuffer.isView(r)){t=new Uint8Array(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength))}else if(r instanceof ArrayBuffer){t=new Uint8Array(r.slice(0))}else if(r instanceof Blob){t=r}else{t=n.encode(`${r}`)}this.#i+=ArrayBuffer.isView(t)?t.byteLength:t.size;this.#o.push(t)}this.#s=`${r.endings===undefined?"transparent":r.endings}`;const o=r.type===undefined?"":String(r.type);this.#a=/^[\x20-\x7E]*$/.test(o)?o:""}get size(){return this.#i}get type(){return this.#a}async text(){const t=new TextDecoder;let r="";for await(const n of toIterator(this.#o,false)){r+=t.decode(n,{stream:true})}r+=t.decode();return r}async arrayBuffer(){const t=new Uint8Array(this.size);let r=0;for await(const n of toIterator(this.#o,false)){t.set(n,r);r+=n.length}return t.buffer}stream(){const t=toIterator(this.#o,true);return new globalThis.ReadableStream({type:"bytes",async pull(r){const n=await t.next();n.done?r.close():r.enqueue(n.value)},async cancel(){await t.return()}})}slice(t=0,r=this.size,n=""){const{size:o}=this;let a=t<0?Math.max(o+t,0):Math.min(t,o);let i=r<0?Math.max(o+r,0):Math.min(r,o);const s=Math.max(i-a,0);const l=this.#o;const u=[];let d=0;for(const t of l){if(d>=s){break}const r=ArrayBuffer.isView(t)?t.byteLength:t.size;if(a&&r<=a){a-=r;i-=r}else{let n;if(ArrayBuffer.isView(t)){n=t.subarray(a,Math.min(r,i));d+=n.byteLength}else{n=t.slice(a,Math.min(r,i));d+=n.size}i-=r;u.push(n);a=0}}const c=new Blob([],{type:String(n).toLowerCase()});c.#i=s;c.#o=u;return c}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](t){return t&&typeof t==="object"&&typeof t.constructor==="function"&&(typeof t.stream==="function"||typeof t.arrayBuffer==="function")&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}};Object.defineProperties(i.prototype,{size:{enumerable:true},type:{enumerable:true},slice:{enumerable:true}});const s=i;const l=s},8010:(t,r,n)=>{n.d(r,{Ct:()=>m,au:()=>formDataToBlob});var o=n(1410);var a=n(3213); +/*! formdata-polyfill. MIT License. Jimmy Wärting */var{toStringTag:i,iterator:s,hasInstance:l}=Symbol,u=Math.random,d="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),f=(t,r,n)=>(t+="",/^(Blob|File)$/.test(r&&r[i])?[(n=n!==void 0?n+"":r[i]=="File"?r.name:"blob",t),r.name!==n||r[i]=="blob"?new a.Z([r],n,r):r]:[t,r+""]),e=(t,r)=>(r?t:t.replace(/\r?\n|\r/g,"\r\n")).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),x=(t,r,n)=>{if(r.lengthtypeof t[r]!="function"))}append(...t){x("append",arguments,2);this.#l.push(f(...t))}delete(t){x("delete",arguments,1);t+="";this.#l=this.#l.filter((([r])=>r!==t))}get(t){x("get",arguments,1);t+="";for(var r=this.#l,n=r.length,o=0;on[0]===t&&r.push(n[1])));return r}has(t){x("has",arguments,1);t+="";return this.#l.some((r=>r[0]===t))}forEach(t,r){x("forEach",arguments,1);for(var[n,o]of this)t.call(r,o,n,this)}set(...t){x("set",arguments,2);var r=[],n=!0;t=f(...t);this.#l.forEach((o=>{o[0]===t[0]?n&&(n=!r.push(t)):r.push(o)}));n&&r.push(t);this.#l=r}*entries(){yield*this.#l}*keys(){for(var[t]of this)yield t}*values(){for(var[,t]of this)yield t}};function formDataToBlob(t,r=o.Z){var n=`${u()}${u()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),a=[],i=`--${n}\r\nContent-Disposition: form-data; name="`;t.forEach(((t,r)=>typeof t=="string"?a.push(i+e(r)+`"\r\n\r\n${t.replace(/\r(?!\n)|(?{__nccwpck_require__.d=(t,r)=>{for(var n in r){if(__nccwpck_require__.o(r,n)&&!__nccwpck_require__.o(t,n)){Object.defineProperty(t,n,{enumerable:true,get:r[n]})}}}})();(()=>{__nccwpck_require__.f={};__nccwpck_require__.e=t=>Promise.all(Object.keys(__nccwpck_require__.f).reduce(((r,n)=>{__nccwpck_require__.f[n](t,r);return r}),[]))})();(()=>{__nccwpck_require__.u=t=>""+t+".index.js"})();(()=>{__nccwpck_require__.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=new URL(".",import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/)?1:0,-1)+"/";(()=>{var t={179:0};var installChunk=r=>{var{ids:n,modules:o,runtime:a}=r;var i,s,l=0;for(i in o){if(__nccwpck_require__.o(o,i)){__nccwpck_require__.m[i]=o[i]}}if(a)a(__nccwpck_require__);for(;l{var o=__nccwpck_require__.o(t,r)?t[r]:undefined;if(o!==0){if(o){n.push(o[1])}else{if(true){var a=import("./"+__nccwpck_require__.u(r)).then(installChunk,(n=>{if(t[r]!==0)t[r]=undefined;throw n}));var a=Promise.race([a,new Promise((n=>o=t[r]=[n]))]);n.push(o[1]=a)}else t[r]=0}}}})();var n={};(()=>{var t=__nccwpck_require__(2186);const r=require("node:http");const n=require("node:https");const o=require("node:zlib");const a=require("node:stream");const i=require("node:buffer");function dataUriToBuffer(t){if(!/^data:/i.test(t)){throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")')}t=t.replace(/\r?\n/g,"");const r=t.indexOf(",");if(r===-1||r<=4){throw new TypeError("malformed data: URI")}const n=t.substring(5,r).split(";");let o="";let a=false;const i=n[0]||"text/plain";let s=i;for(let t=1;ttypeof t==="object"&&typeof t.append==="function"&&typeof t.delete==="function"&&typeof t.get==="function"&&typeof t.getAll==="function"&&typeof t.has==="function"&&typeof t.set==="function"&&typeof t.sort==="function"&&t[c]==="URLSearchParams";const isBlob=t=>t&&typeof t==="object"&&typeof t.arrayBuffer==="function"&&typeof t.type==="string"&&typeof t.stream==="function"&&typeof t.constructor==="function"&&/^(Blob|File)$/.test(t[c]);const isAbortSignal=t=>typeof t==="object"&&(t[c]==="AbortSignal"||t[c]==="EventTarget");const isDomainOrSubdomain=(t,r)=>{const n=new URL(r).hostname;const o=new URL(t).hostname;return n===o||n.endsWith(`.${o}`)};const isSameProtocol=(t,r)=>{const n=new URL(r).protocol;const o=new URL(t).protocol;return n===o};const m=(0,l.promisify)(a.pipeline);const h=Symbol("Body internals");class Body{constructor(t,{size:r=0}={}){let n=null;if(t===null){t=null}else if(isURLSearchParameters(t)){t=i.Buffer.from(t.toString())}else if(isBlob(t)){}else if(i.Buffer.isBuffer(t)){}else if(l.types.isAnyArrayBuffer(t)){t=i.Buffer.from(t)}else if(ArrayBuffer.isView(t)){t=i.Buffer.from(t.buffer,t.byteOffset,t.byteLength)}else if(t instanceof a){}else if(t instanceof d.Ct){t=(0,d.au)(t);n=t.type.split("=")[1]}else{t=i.Buffer.from(String(t))}let o=t;if(i.Buffer.isBuffer(t)){o=a.Readable.from(t)}else if(isBlob(t)){o=a.Readable.from(t.stream())}this[h]={body:t,stream:o,boundary:n,disturbed:false,error:null};this.size=r;if(t instanceof a){t.on("error",(t=>{const r=t instanceof FetchBaseError?t:new FetchError(`Invalid response body while trying to fetch ${this.url}: ${t.message}`,"system",t);this[h].error=r}))}}get body(){return this[h].stream}get bodyUsed(){return this[h].disturbed}async arrayBuffer(){const{buffer:t,byteOffset:r,byteLength:n}=await consumeBody(this);return t.slice(r,r+n)}async formData(){const t=this.headers.get("content-type");if(t.startsWith("application/x-www-form-urlencoded")){const t=new d.Ct;const r=new URLSearchParams(await this.text());for(const[n,o]of r){t.append(n,o)}return t}const{toFormData:r}=await __nccwpck_require__.e(37).then(__nccwpck_require__.bind(__nccwpck_require__,4037));return r(this.body,t)}async blob(){const t=this.headers&&this.headers.get("content-type")||this[h].body&&this[h].body.type||"";const r=await this.arrayBuffer();return new u.Z([r],{type:t})}async json(){const t=await this.text();return JSON.parse(t)}async text(){const t=await consumeBody(this);return(new TextDecoder).decode(t)}buffer(){return consumeBody(this)}}Body.prototype.buffer=(0,l.deprecate)(Body.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Body.prototype,{body:{enumerable:true},bodyUsed:{enumerable:true},arrayBuffer:{enumerable:true},blob:{enumerable:true},json:{enumerable:true},text:{enumerable:true},data:{get:(0,l.deprecate)((()=>{}),"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function consumeBody(t){if(t[h].disturbed){throw new TypeError(`body used already for: ${t.url}`)}t[h].disturbed=true;if(t[h].error){throw t[h].error}const{body:r}=t;if(r===null){return i.Buffer.alloc(0)}if(!(r instanceof a)){return i.Buffer.alloc(0)}const n=[];let o=0;try{for await(const a of r){if(t.size>0&&o+a.length>t.size){const n=new FetchError(`content size at ${t.url} over limit: ${t.size}`,"max-size");r.destroy(n);throw n}o+=a.length;n.push(a)}}catch(r){const n=r instanceof FetchBaseError?r:new FetchError(`Invalid response body while trying to fetch ${t.url}: ${r.message}`,"system",r);throw n}if(r.readableEnded===true||r._readableState.ended===true){try{if(n.every((t=>typeof t==="string"))){return i.Buffer.from(n.join(""))}return i.Buffer.concat(n,o)}catch(r){throw new FetchError(`Could not create Buffer from response body for ${t.url}: ${r.message}`,"system",r)}}else{throw new FetchError(`Premature close of server response while trying to fetch ${t.url}`)}}const clone=(t,r)=>{let n;let o;let{body:i}=t[h];if(t.bodyUsed){throw new Error("cannot clone body after it is used")}if(i instanceof a&&typeof i.getBoundary!=="function"){n=new a.PassThrough({highWaterMark:r});o=new a.PassThrough({highWaterMark:r});i.pipe(n);i.pipe(o);t[h].stream=n;i=o}return i};const p=(0,l.deprecate)((t=>t.getBoundary()),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167");const extractContentType=(t,r)=>{if(t===null){return null}if(typeof t==="string"){return"text/plain;charset=UTF-8"}if(isURLSearchParameters(t)){return"application/x-www-form-urlencoded;charset=UTF-8"}if(isBlob(t)){return t.type||null}if(i.Buffer.isBuffer(t)||l.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)){return null}if(t instanceof d.Ct){return`multipart/form-data; boundary=${r[h].boundary}`}if(t&&typeof t.getBoundary==="function"){return`multipart/form-data;boundary=${p(t)}`}if(t instanceof a){return null}return"text/plain;charset=UTF-8"};const getTotalBytes=t=>{const{body:r}=t[h];if(r===null){return 0}if(isBlob(r)){return r.size}if(i.Buffer.isBuffer(r)){return r.length}if(r&&typeof r.getLengthSync==="function"){return r.hasKnownLength&&r.hasKnownLength()?r.getLengthSync():null}return null};const writeToStream=async(t,{body:r})=>{if(r===null){t.end()}else{await m(r,t)}};const b=typeof r.validateHeaderName==="function"?r.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){const r=new TypeError(`Header name must be a valid HTTP token [${t}]`);Object.defineProperty(r,"code",{value:"ERR_INVALID_HTTP_TOKEN"});throw r}};const y=typeof r.validateHeaderValue==="function"?r.validateHeaderValue:(t,r)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(r)){const r=new TypeError(`Invalid character in header content ["${t}"]`);Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"});throw r}};class Headers extends URLSearchParams{constructor(t){let r=[];if(t instanceof Headers){const n=t.raw();for(const[t,o]of Object.entries(n)){r.push(...o.map((r=>[t,r])))}}else if(t==null){}else if(typeof t==="object"&&!l.types.isBoxedPrimitive(t)){const n=t[Symbol.iterator];if(n==null){r.push(...Object.entries(t))}else{if(typeof n!=="function"){throw new TypeError("Header pairs must be iterable")}r=[...t].map((t=>{if(typeof t!=="object"||l.types.isBoxedPrimitive(t)){throw new TypeError("Each header pair must be an iterable object")}return[...t]})).map((t=>{if(t.length!==2){throw new TypeError("Each header pair must be a name/value tuple")}return[...t]}))}}else{throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence> or record)")}r=r.length>0?r.map((([t,r])=>{b(t);y(t,String(r));return[String(t).toLowerCase(),String(r)]})):undefined;super(r);return new Proxy(this,{get(t,r,n){switch(r){case"append":case"set":return(n,o)=>{b(n);y(n,String(o));return URLSearchParams.prototype[r].call(t,String(n).toLowerCase(),String(o))};case"delete":case"has":case"getAll":return n=>{b(n);return URLSearchParams.prototype[r].call(t,String(n).toLowerCase())};case"keys":return()=>{t.sort();return new Set(URLSearchParams.prototype.keys.call(t)).keys()};default:return Reflect.get(t,r,n)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(t){const r=this.getAll(t);if(r.length===0){return null}let n=r.join(", ");if(/^content-encoding$/i.test(t)){n=n.toLowerCase()}return n}forEach(t,r=undefined){for(const n of this.keys()){Reflect.apply(t,r,[this.get(n),n,this])}}*values(){for(const t of this.keys()){yield this.get(t)}}*entries(){for(const t of this.keys()){yield[t,this.get(t)]}}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce(((t,r)=>{t[r]=this.getAll(r);return t}),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce(((t,r)=>{const n=this.getAll(r);if(r==="host"){t[r]=n[0]}else{t[r]=n.length>1?n:n[0]}return t}),{})}}Object.defineProperties(Headers.prototype,["get","entries","forEach","values"].reduce(((t,r)=>{t[r]={enumerable:true};return t}),{}));function fromRawHeaders(t=[]){return new Headers(t.reduce(((t,r,n,o)=>{if(n%2===0){t.push(o.slice(n,n+2))}return t}),[]).filter((([t,r])=>{try{b(t);y(t,String(r));return true}catch{return false}})))}const S=new Set([301,302,303,307,308]);const isRedirect=t=>S.has(t);const R=Symbol("Response internals");class Response extends Body{constructor(t=null,r={}){super(t,r);const n=r.status!=null?r.status:200;const o=new Headers(r.headers);if(t!==null&&!o.has("Content-Type")){const r=extractContentType(t,this);if(r){o.append("Content-Type",r)}}this[R]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:o,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[R].type}get url(){return this[R].url||""}get status(){return this[R].status}get ok(){return this[R].status>=200&&this[R].status<300}get redirected(){return this[R].counter>0}get statusText(){return this[R].statusText}get headers(){return this[R].headers}get highWaterMark(){return this[R].highWaterMark}clone(){return new Response(clone(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(t,r=302){if(!isRedirect(r)){throw new RangeError('Failed to execute "redirect" on "response": Invalid status code')}return new Response(null,{headers:{location:new URL(t).toString()},status:r})}static error(){const t=new Response(null,{status:0,statusText:""});t[R].type="error";return t}static json(t=undefined,r={}){const n=JSON.stringify(t);if(n===undefined){throw new TypeError("data is not JSON serializable")}const o=new Headers(r&&r.headers);if(!o.has("content-type")){o.set("content-type","application/json")}return new Response(n,{...r,headers:o})}get[Symbol.toStringTag](){return"Response"}}Object.defineProperties(Response.prototype,{type:{enumerable:true},url:{enumerable:true},status:{enumerable:true},ok:{enumerable:true},redirected:{enumerable:true},statusText:{enumerable:true},headers:{enumerable:true},clone:{enumerable:true}});const g=require("node:url");const getSearch=t=>{if(t.search){return t.search}const r=t.href.length-1;const n=t.hash||(t.href[r]==="#"?"#":"");return t.href[r-n.length]==="?"?"?":""};const _=require("node:net");function stripURLForUseAsAReferrer(t,r=false){if(t==null){return"no-referrer"}t=new URL(t);if(/^(about|blob|data):$/.test(t.protocol)){return"no-referrer"}t.username="";t.password="";t.hash="";if(r){t.pathname="";t.search=""}return t}const C=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]);const w="strict-origin-when-cross-origin";function validateReferrerPolicy(t){if(!C.has(t)){throw new TypeError(`Invalid referrerPolicy: ${t}`)}return t}function isOriginPotentiallyTrustworthy(t){if(/^(http|ws)s:$/.test(t.protocol)){return true}const r=t.host.replace(/(^\[)|(]$)/g,"");const n=(0,_.isIP)(r);if(n===4&&/^127\./.test(r)){return true}if(n===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(r)){return true}if(t.host==="localhost"||t.host.endsWith(".localhost")){return false}if(t.protocol==="file:"){return true}return false}function isUrlPotentiallyTrustworthy(t){if(/^about:(blank|srcdoc)$/.test(t)){return true}if(t.protocol==="data:"){return true}if(/^(blob|filesystem):$/.test(t.protocol)){return true}return isOriginPotentiallyTrustworthy(t)}function determineRequestsReferrer(t,{referrerURLCallback:r,referrerOriginCallback:n}={}){if(t.referrer==="no-referrer"||t.referrerPolicy===""){return null}const o=t.referrerPolicy;if(t.referrer==="about:client"){return"no-referrer"}const a=t.referrer;let i=stripURLForUseAsAReferrer(a);let s=stripURLForUseAsAReferrer(a,true);if(i.toString().length>4096){i=s}if(r){i=r(i)}if(n){s=n(s)}const l=new URL(t.url);switch(o){case"no-referrer":return"no-referrer";case"origin":return s;case"unsafe-url":return i;case"strict-origin":if(isUrlPotentiallyTrustworthy(i)&&!isUrlPotentiallyTrustworthy(l)){return"no-referrer"}return s.toString();case"strict-origin-when-cross-origin":if(i.origin===l.origin){return i}if(isUrlPotentiallyTrustworthy(i)&&!isUrlPotentiallyTrustworthy(l)){return"no-referrer"}return s;case"same-origin":if(i.origin===l.origin){return i}return"no-referrer";case"origin-when-cross-origin":if(i.origin===l.origin){return i}return s;case"no-referrer-when-downgrade":if(isUrlPotentiallyTrustworthy(i)&&!isUrlPotentiallyTrustworthy(l)){return"no-referrer"}return i;default:throw new TypeError(`Invalid referrerPolicy: ${o}`)}}function parseReferrerPolicyFromHeader(t){const r=(t.get("referrer-policy")||"").split(/[,\s]+/);let n="";for(const t of r){if(t&&C.has(t)){n=t}}return n}const v=Symbol("Request internals");const isRequest=t=>typeof t==="object"&&typeof t[v]==="object";const P=(0,l.deprecate)((()=>{}),".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)");class Request extends Body{constructor(t,r={}){let n;if(isRequest(t)){n=new URL(t.url)}else{n=new URL(t);t={}}if(n.username!==""||n.password!==""){throw new TypeError(`${n} is an url with embedded credentials.`)}let o=r.method||t.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(o)){o=o.toUpperCase()}if(!isRequest(r)&&"data"in r){P()}if((r.body!=null||isRequest(t)&&t.body!==null)&&(o==="GET"||o==="HEAD")){throw new TypeError("Request with GET/HEAD method cannot have body")}const a=r.body?r.body:isRequest(t)&&t.body!==null?clone(t):null;super(a,{size:r.size||t.size||0});const i=new Headers(r.headers||t.headers||{});if(a!==null&&!i.has("Content-Type")){const t=extractContentType(a,this);if(t){i.set("Content-Type",t)}}let s=isRequest(t)?t.signal:null;if("signal"in r){s=r.signal}if(s!=null&&!isAbortSignal(s)){throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget")}let l=r.referrer==null?t.referrer:r.referrer;if(l===""){l="no-referrer"}else if(l){const t=new URL(l);l=/^about:(\/\/)?client$/.test(t)?"client":t}else{l=undefined}this[v]={method:o,redirect:r.redirect||t.redirect||"follow",headers:i,parsedURL:n,signal:s,referrer:l};this.follow=r.follow===undefined?t.follow===undefined?20:t.follow:r.follow;this.compress=r.compress===undefined?t.compress===undefined?true:t.compress:r.compress;this.counter=r.counter||t.counter||0;this.agent=r.agent||t.agent;this.highWaterMark=r.highWaterMark||t.highWaterMark||16384;this.insecureHTTPParser=r.insecureHTTPParser||t.insecureHTTPParser||false;this.referrerPolicy=r.referrerPolicy||t.referrerPolicy||""}get method(){return this[v].method}get url(){return(0,g.format)(this[v].parsedURL)}get headers(){return this[v].headers}get redirect(){return this[v].redirect}get signal(){return this[v].signal}get referrer(){if(this[v].referrer==="no-referrer"){return""}if(this[v].referrer==="client"){return"about:client"}if(this[v].referrer){return this[v].referrer.toString()}return undefined}get referrerPolicy(){return this[v].referrerPolicy}set referrerPolicy(t){this[v].referrerPolicy=validateReferrerPolicy(t)}clone(){return new Request(this)}get[Symbol.toStringTag](){return"Request"}}Object.defineProperties(Request.prototype,{method:{enumerable:true},url:{enumerable:true},headers:{enumerable:true},redirect:{enumerable:true},clone:{enumerable:true},signal:{enumerable:true},referrer:{enumerable:true},referrerPolicy:{enumerable:true}});const getNodeRequestOptions=t=>{const{parsedURL:r}=t[v];const n=new Headers(t[v].headers);if(!n.has("Accept")){n.set("Accept","*/*")}let o=null;if(t.body===null&&/^(post|put)$/i.test(t.method)){o="0"}if(t.body!==null){const r=getTotalBytes(t);if(typeof r==="number"&&!Number.isNaN(r)){o=String(r)}}if(o){n.set("Content-Length",o)}if(t.referrerPolicy===""){t.referrerPolicy=w}if(t.referrer&&t.referrer!=="no-referrer"){t[v].referrer=determineRequestsReferrer(t)}else{t[v].referrer="no-referrer"}if(t[v].referrer instanceof URL){n.set("Referer",t.referrer)}if(!n.has("User-Agent")){n.set("User-Agent","node-fetch")}if(t.compress&&!n.has("Accept-Encoding")){n.set("Accept-Encoding","gzip, deflate, br")}let{agent:a}=t;if(typeof a==="function"){a=a(r)}if(!n.has("Connection")&&!a){n.set("Connection","close")}const i=getSearch(r);const s={path:r.pathname+i,method:t.method,headers:n[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:a};return{parsedURL:r,options:s}};class AbortError extends FetchBaseError{constructor(t,r="aborted"){super(t,r)}}var E=__nccwpck_require__(2777);const T=new Set(["data:","http:","https:"]);async function fetch(t,i){return new Promise(((l,u)=>{const d=new Request(t,i);const{parsedURL:c,options:m}=getNodeRequestOptions(d);if(!T.has(c.protocol)){throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${c.protocol.replace(/:$/,"")}" is not supported.`)}if(c.protocol==="data:"){const t=s(d.url);const r=new Response(t,{headers:{"Content-Type":t.typeFull}});l(r);return}const h=(c.protocol==="https:"?n:r).request;const{signal:p}=d;let b=null;const abort=()=>{const t=new AbortError("The operation was aborted.");u(t);if(d.body&&d.body instanceof a.Readable){d.body.destroy(t)}if(!b||!b.body){return}b.body.emit("error",t)};if(p&&p.aborted){abort();return}const abortAndFinalize=()=>{abort();finalize()};const y=h(c.toString(),m);if(p){p.addEventListener("abort",abortAndFinalize)}const finalize=()=>{y.abort();if(p){p.removeEventListener("abort",abortAndFinalize)}};y.on("error",(t=>{u(new FetchError(`request to ${d.url} failed, reason: ${t.message}`,"system",t));finalize()}));fixResponseChunkedTransferBadEnding(y,(t=>{if(b&&b.body){b.body.destroy(t)}}));if(process.version<"v14"){y.on("socket",(t=>{let r;t.prependListener("end",(()=>{r=t._eventsCount}));t.prependListener("close",(n=>{if(b&&r{y.setTimeout(0);const r=fromRawHeaders(t.rawHeaders);if(isRedirect(t.statusCode)){const n=r.get("Location");let o=null;try{o=n===null?null:new URL(n,d.url)}catch{if(d.redirect!=="manual"){u(new FetchError(`uri requested responds with an invalid redirect URL: ${n}`,"invalid-redirect"));finalize();return}}switch(d.redirect){case"error":u(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${d.url}`,"no-redirect"));finalize();return;case"manual":break;case"follow":{if(o===null){break}if(d.counter>=d.follow){u(new FetchError(`maximum redirect reached at: ${d.url}`,"max-redirect"));finalize();return}const n={headers:new Headers(d.headers),follow:d.follow,counter:d.counter+1,agent:d.agent,compress:d.compress,method:d.method,body:clone(d),signal:d.signal,size:d.size,referrer:d.referrer,referrerPolicy:d.referrerPolicy};if(!isDomainOrSubdomain(d.url,o)||!isSameProtocol(d.url,o)){for(const t of["authorization","www-authenticate","cookie","cookie2"]){n.headers.delete(t)}}if(t.statusCode!==303&&d.body&&i.body instanceof a.Readable){u(new FetchError("Cannot follow redirect with body being a readable stream","unsupported-redirect"));finalize();return}if(t.statusCode===303||(t.statusCode===301||t.statusCode===302)&&d.method==="POST"){n.method="GET";n.body=undefined;n.headers.delete("content-length")}const s=parseReferrerPolicyFromHeader(r);if(s){n.referrerPolicy=s}l(fetch(new Request(o,n)));finalize();return}default:return u(new TypeError(`Redirect option '${d.redirect}' is not a valid value of RequestRedirect`))}}if(p){t.once("end",(()=>{p.removeEventListener("abort",abortAndFinalize)}))}let n=(0,a.pipeline)(t,new a.PassThrough,(t=>{if(t){u(t)}}));if(process.version<"v12.10"){t.on("aborted",abortAndFinalize)}const s={url:d.url,status:t.statusCode,statusText:t.statusMessage,headers:r,size:d.size,counter:d.counter,highWaterMark:d.highWaterMark};const c=r.get("Content-Encoding");if(!d.compress||d.method==="HEAD"||c===null||t.statusCode===204||t.statusCode===304){b=new Response(n,s);l(b);return}const m={flush:o.Z_SYNC_FLUSH,finishFlush:o.Z_SYNC_FLUSH};if(c==="gzip"||c==="x-gzip"){n=(0,a.pipeline)(n,o.createGunzip(m),(t=>{if(t){u(t)}}));b=new Response(n,s);l(b);return}if(c==="deflate"||c==="x-deflate"){const r=(0,a.pipeline)(t,new a.PassThrough,(t=>{if(t){u(t)}}));r.once("data",(t=>{if((t[0]&15)===8){n=(0,a.pipeline)(n,o.createInflate(),(t=>{if(t){u(t)}}))}else{n=(0,a.pipeline)(n,o.createInflateRaw(),(t=>{if(t){u(t)}}))}b=new Response(n,s);l(b)}));r.once("end",(()=>{if(!b){b=new Response(n,s);l(b)}}));return}if(c==="br"){n=(0,a.pipeline)(n,o.createBrotliDecompress(),(t=>{if(t){u(t)}}));b=new Response(n,s);l(b);return}b=new Response(n,s);l(b)}));writeToStream(y,d).catch(u)}))}function fixResponseChunkedTransferBadEnding(t,r){const n=i.Buffer.from("0\r\n\r\n");let o=false;let a=false;let s;t.on("response",(t=>{const{headers:r}=t;o=r["transfer-encoding"]==="chunked"&&!r["content-length"]}));t.on("socket",(l=>{const onSocketClose=()=>{if(o&&!a){const t=new Error("Premature close");t.code="ERR_STREAM_PREMATURE_CLOSE";r(t)}};const onData=t=>{a=i.Buffer.compare(t.slice(-5),n)===0;if(!a&&s){a=i.Buffer.compare(s.slice(-3),n.slice(0,3))===0&&i.Buffer.compare(t.slice(-2),n.slice(3))===0}s=t};l.prependListener("close",onSocketClose);l.on("data",onData);t.on("close",(()=>{l.removeListener("close",onSocketClose);l.removeListener("data",onData)}))}))}const B="https://api.cloudways.com/api/v1";async function getOauthToken(){const r={api_key:(0,t.getInput)("api-key"),email:(0,t.getInput)("email")};const n={method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}};const o=await fetch(`${B}/oauth/access_token`,n).then((t=>t.json()));if(o.error){throw new Error(o.error_description)}if(!o.access_token||o.access_token===""){throw new Error("The access token does not exist.")}return o.access_token}async function deployChanges(r){const n={app_id:(0,t.getInput)("app-id"),branch_name:(0,t.getInput)("branch-name"),deploy_path:(0,t.getInput)("deploy-path"),server_id:(0,t.getInput)("server-id")};const o={method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}};return await fetch(`${B}/git/pull`,o).then((t=>t.json().then((r=>({ok:t.ok,code:t.status,body:r})))))}async function run(){try{const r=await getOauthToken();await deployChanges(r).then((r=>{if(!r.ok){throw new Error(r.body.error_description)}(0,t.info)(`Success. Operation ID: ${r.body.operation_id}`);(0,t.setOutput)("operation",r.body.operation_id)}))}catch(r){(0,t.setFailed)(r.message)}}run()})(); \ No newline at end of file diff --git a/dist/licenses.txt b/dist/licenses.txt index a27ea07..747a90c 100644 --- a/dist/licenses.txt +++ b/dist/licenses.txt @@ -1,30 +1,8 @@ -@actions/core -MIT -The MIT License (MIT) - -Copyright 2019 GitHub - -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. - -@vercel/ncc -MIT -Copyright 2018 ZEIT, Inc. - -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. - node-fetch MIT The MIT License (MIT) -Copyright (c) 2016 David Frank +Copyright (c) 2016 - 2020 Node Fetch Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/dist/package.json b/dist/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/dist/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/index.js b/index.js index 7acb6aa..53bcd06 100644 --- a/index.js +++ b/index.js @@ -1,30 +1,101 @@ -const core = require('@actions/core'); -const fetch = require('node-fetch'); +import { + getInput, + info, + setFailed, + setOutput, +} from '@actions/core'; + +import fetch from 'node-fetch'; + +/** + * The Cloudways API URI. + * It'll be used to make the requests. + * + * @since 1.0.0 + * + * @type {string} + */ const apiUri = 'https://api.cloudways.com/api/v1'; +/** + * Get access token. + * + * We need the Cloudways API Key and the email address of the account. + * The access token will be used to authenticate the request. + * + * @link https://developers.cloudways.com/docs/#!/AuthenticationApi#getOAuthAccessToken + * + * @since 1.0.0 + * @since 1.2.0 - Add error handling. + * + * @returns {Promise} + */ async function getOauthToken() { const body = { - email: core.getInput('email'), - api_key: core.getInput('api-key') + api_key: getInput('api-key'), + email: getInput('email'), }; const options = { method: 'POST', body: JSON.stringify(body), - headers: { - 'Content-Type': 'application/json' - } + headers: { 'Content-Type': 'application/json' }, }; - return await fetch(`${ apiUri }/oauth/access_token`, options).then(res => res.json()); + /** + * The API response. + * + * If the request is successful, the response will contain the access token. + * Otherwise, it'll contain the error message. + * + * @since 1.0.0 + * + * @type {{ + * error: boolean, + * error_description: string, + * access_token: string, + * expires_in: number, + * token_type: string + * }} + */ + const response = await fetch(`${ apiUri }/oauth/access_token`, options).then(res => res.json()); + + if (response.error) { + throw new Error(response.error_description); + } + + if (!response.access_token || response.access_token === '') { + throw new Error('The access token does not exist.'); + } + + return response.access_token; } +/** + * Deploy changes. + * + * It'll pull the new changes from the repository and deploy them to the server. + * + * We need: + * + * - `server_id`. Numeric id of the server. + * - `app_id`. Numeric id of the application. + * - `branch_name`. Name of the branch to pull. + * - `deploy_path`. Path to deploy the changes. + * + * @link https://developers.cloudways.com/docs/#!/GitApi#startGitPull + * + * @since 1.0.0 + * + * @param {string} token The access token. + * @returns {Promise<{code: *, ok: *, body: *}>} + */ async function deployChanges(token) { const body = { - server_id: core.getInput('server-id'), - app_id: core.getInput('app-id'), - branch_name: core.getInput('branch-name'), - deploy_path: core.getInput('deploy-path'), + app_id: getInput('app-id'), + branch_name: getInput('branch-name'), + deploy_path: getInput('deploy-path'), + server_id: getInput('server-id'), }; const options = { @@ -47,28 +118,28 @@ async function deployChanges(token) { }); } +/** + * Run the action. + * It'll get the access token and deploy the changes. + * + * @since 1.0.0 + * + * @returns {Promise} + */ async function run() { try { - const oauthToken = await getOauthToken(); - - if (oauthToken.error) { - throw new Error(oauthToken.error_description); - } - - if (!oauthToken.access_token || oauthToken.access_token === '') { - throw new Error('The access token does not exist.'); - } + const access_token = await getOauthToken(); - await deployChanges(oauthToken.access_token).then(response => { + await deployChanges(access_token).then(response => { if (!response.ok) { throw new Error(response.body.error_description); } - core.info(`Success. Operation ID: ${ response.body.operation_id }`); - core.setOutput('operation', response.body.operation_id); + info(`Success. Operation ID: ${ response.body.operation_id }`); + setOutput('operation', response.body.operation_id); }); } catch (error) { - core.setFailed(error.message); + setFailed(error.message); } } diff --git a/package-lock.json b/package-lock.json index b32e82d..ffbe904 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,24 +1,223 @@ { - "name": "cloudways-api-git-pull-action", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@actions/core": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.5.0.tgz", - "integrity": "sha512-eDOLH1Nq9zh+PJlYLqEMkS/jLQxhksPNmUGNBHfa4G+tQmnIhzpctxmchETtVGyBOvXgOVVpYuE40+eS4cUnwQ==" + "name": "cloudways-api-git-pull-action", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "cloudways-api-git-pull-action", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@actions/core": "^1.10.0", + "node-fetch": "^3.3.1" + }, + "devDependencies": { + "@vercel/ncc": "^0.36.1" + } + }, + "node_modules/@actions/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", + "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", + "dependencies": { + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" + } + }, + "node_modules/@actions/http-client": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz", + "integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==", + "dependencies": { + "tunnel": "^0.0.6" + } + }, + "node_modules/@vercel/ncc": { + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.1.tgz", + "integrity": "sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw==", + "dev": true, + "bin": { + "ncc": "dist/ncc/cli.js" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", + "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "engines": { + "node": ">= 8" + } + } }, - "@vercel/ncc": { - "version": "0.29.2", - "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.29.2.tgz", - "integrity": "sha512-eUxibZD92k+rY0oZJFZooGqdVpGkDrrHlUhj9UAWrtoyXCGmNOWC1Kcr2KPrZoHRSlWwHOcRnkn2nGT+aHY2KA==", - "dev": true - }, - "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "dependencies": { + "@actions/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", + "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", + "requires": { + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" + } + }, + "@actions/http-client": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz", + "integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==", + "requires": { + "tunnel": "^0.0.6" + } + }, + "@vercel/ncc": { + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.1.tgz", + "integrity": "sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw==", + "dev": true + }, + "data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==" + }, + "fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "requires": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + } + }, + "formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "requires": { + "fetch-blob": "^3.1.2" + } + }, + "node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" + }, + "node-fetch": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", + "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", + "requires": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + } + }, + "tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==" + } } - } } diff --git a/package.json b/package.json index 7fa2d31..5e1ad11 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,11 @@ { "name": "cloudways-api-git-pull-action", - "version": "1.0.0", + "version": "1.2.0", "description": "Github Action to deploy your project to Cloudways.", "main": "index.js", + "type": "module", "scripts": { - "prepare": "ncc build index.js --license licenses.txt" + "prepare": "ncc build index.js -m --license licenses.txt" }, "keywords": [ "cloudways", @@ -13,7 +14,10 @@ "pull", "action" ], - "author": "Roel Magdaleno", + "author": { + "name": "Roel Magdaleno", + "url": "https://roelmagdaleno.com" + }, "license": "MIT", "repository": { "type": "git", @@ -24,10 +28,10 @@ }, "homepage": "https://github.com/roelmagdaleno/cloudways-api-git-pull-action#readme", "dependencies": { - "@actions/core": "^1.5.0", - "node-fetch": "^2.6.1" + "@actions/core": "^1.10.0", + "node-fetch": "^3.3.1" }, "devDependencies": { - "@vercel/ncc": "^0.29.2" + "@vercel/ncc": "^0.36.1" } }